Commit 2394c5ec authored by 全洪江's avatar 全洪江

增加导出功能和增加产品编码字段

parent 47976738
...@@ -128,12 +128,14 @@ ...@@ -128,12 +128,14 @@
<script> <script>
import { addAccount, delAccount, getAccount, pageAccount, updateAccount } from '@/api/mes/md/clientAccount' import { addAccount, delAccount, getAccount, pageAccount, updateAccount } from '@/api/mes/md/clientAccount'
import {number} from "echarts/lib/export";
export default { export default {
name: 'Account', name: 'Account',
dicts: ['sys_yes_no'], dicts: ['sys_yes_no'],
props: { props: {
clientCode: {type: String | undefined, default: undefined}, clientCode: {type: String | undefined, default: undefined},
clientId: {type: number | null, default: null}
}, },
data() { data() {
return { return {
...@@ -159,7 +161,7 @@ export default { ...@@ -159,7 +161,7 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
clientCode: this.clientCode, bank: null, bankAccount: null, accountName: null, enableFlag: null clientCode: this.clientCode, bank: null, bankAccount: null, accountName: null, enableFlag: null,clientId: this.clientId
}, },
// 表单参数 // 表单参数
form: {}, form: {},
...@@ -268,7 +270,7 @@ export default { ...@@ -268,7 +270,7 @@ export default {
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('md/account/export', { this.download('md/mdClientAccount/export', {
...this.queryParams ...this.queryParams
}, `account_${new Date().getTime()}.xlsx`) }, `account_${new Date().getTime()}.xlsx`)
}, },
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
:disabled="!queryParams.clientId"
>新增</el-button> >新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
...@@ -31,12 +30,31 @@ ...@@ -31,12 +30,31 @@
@click="handleDelete" @click="handleDelete"
>删除</el-button> >删除</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-upload2"
size="mini"
@click="handleImport"
>导入</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="itemList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="itemList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55" />
<el-table-column label="产品" prop="itemName" /> <el-table-column label="产品" prop="itemName" />
<el-table-column label="产品编码" prop="itemCode" />
<el-table-column label="客户产品名称" prop="clientItemName" /> <el-table-column label="客户产品名称" prop="clientItemName" />
<el-table-column label="客户产品编码" prop="clientItemCode" /> <el-table-column label="客户产品编码" prop="clientItemCode" />
<el-table-column label="操作" width="120"> <el-table-column label="操作" width="120">
...@@ -53,6 +71,8 @@ ...@@ -53,6 +71,8 @@
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
>删除</el-button> >删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -86,18 +106,65 @@ ...@@ -86,18 +106,65 @@
<el-button @click="cancel">取 消</el-button> <el-button @click="cancel">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 产品对照组导入对话框 -->
<el-dialog
:title="upload.title"
:visible.sync="upload.open"
width="400px"
append-to-body
>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" />
是否更新已经存在的用户数据
</div>
<span>仅允许导入xls、xlsx格式文件。</span>
<el-link
type="primary"
:underline="false"
style="font-size: 12px; vertical-align: baseline"
@click="importTemplate"
>下载模板</el-link
>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm">确 定</el-button>
<el-button @click="upload.open = false">取 消</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { addItem, delItem, getItem, listItem, updateItem } from '@/api/mes/md/clientItem' import { addItem, delItem, getItem, listItem, updateItem } from '@/api/mes/md/clientItem'
import { listClient } from '@/api/mes/md/client'
import ItemSelect from '@/components/itemSelect/single.vue' import ItemSelect from '@/components/itemSelect/single.vue'
import {getToken} from "@/utils/auth";
import {number} from "echarts/lib/export";
export default { export default {
components: { components: {
ItemSelect ItemSelect
}, },
props: {
clientCode: {type: String | undefined, default: undefined},
},
data() { data() {
return { return {
// 遮罩层 // 遮罩层
...@@ -122,7 +189,19 @@ export default { ...@@ -122,7 +189,19 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
clientId: null, itemId: null, clientItemName: null, clientItemCode: null,}, clientCode: this.clientCode, itemId: null, clientItemName: null, clientItemCode: null,
},
//用户导入参数
upload: {
open: false,
title: "",
isUploading: false,
updateSupport: 0,
// 设置上传的请求头部
headers: { Authorization: "Bearer " + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API + "/md/clientItem/importData",
},
// 表单参数 // 表单参数
form: {}, form: {},
clientList: [], clientList: [],
...@@ -150,7 +229,7 @@ export default { ...@@ -150,7 +229,7 @@ export default {
reset() { reset() {
this.form = { this.form = {
id: null, id: null,
clientId: null, clientCode: null,
itemId: null, itemId: null,
clientItemName: null, clientItemName: null,
clientItemCode: null, clientItemCode: null,
...@@ -171,6 +250,17 @@ export default { ...@@ -171,6 +250,17 @@ export default {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
}, },
/** 导入按钮操作 */
handleImport() {
this.upload.title = "产品对照组导入";
this.upload.open = true;
},
/** 导出按钮操作 */
handleExport() {
this.download('md/clientItem/export', {
...this.queryParams
}, `client_${new Date().getTime()}.xlsx`)
},
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map(item => item.id)
...@@ -190,8 +280,6 @@ export default { ...@@ -190,8 +280,6 @@ export default {
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.form.clientId = this.queryParams.clientId || 0
if (!this.form.clientId) return
this.open = true; this.open = true;
this.title = "添加客户产品对照"; this.title = "添加客户产品对照";
}, },
...@@ -237,8 +325,7 @@ export default { ...@@ -237,8 +325,7 @@ export default {
}, },
init(form) { init(form) {
this.queryParams.clientId = form.clientId || 0 this.queryParams.clientCode = form.clientCode || 0
console.log(form)
this.getList(); this.getList();
}, },
} }
......
...@@ -243,19 +243,19 @@ ...@@ -243,19 +243,19 @@
<FinanceInfo ref="FinanceInfo" :form="form"/> <FinanceInfo ref="FinanceInfo" :form="form"/>
</el-tab-pane>--> </el-tab-pane>-->
<el-tab-pane label="客户联系人" name="ClientContact"> <el-tab-pane label="客户联系人" name="ClientContact">
<ClientContact ref="ClientContact" :clientCode="form.clientCode"/> <ClientContact ref="ClientContact" :clientCode="form.clientCode" :clientId="form.clientId"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="银行账号" name="Account"> <el-tab-pane label="银行账号" name="Account">
<Account ref="Account" :clientCode="form.clientCode"/> <Account ref="Account" :clientCode="form.clientCode" :clientId="form.clientId"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="产品对照" name="ClientItem"> <el-tab-pane label="产品对照" name="ClientItem">
<ClientItem ref="ClientItem"/> <ClientItem ref="ClientItem"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="催货款通知邮箱" name="UrgeEmail"> <el-tab-pane label="催货款通知邮箱" name="UrgeEmail">
<UrgeEmail ref="UrgeEmail" :clientCode="form.clientCode"/> <UrgeEmail ref="UrgeEmail" :clientCode="form.clientCode" :clientId="form.clientId"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="客户关联关系" name="PaymentRelation"> <el-tab-pane label="客户关联关系" name="PaymentRelation">
<PaymentRelation ref="PaymentRelation" :clientCode="form.clientCode"/> <PaymentRelation ref="PaymentRelation" :clientCode="form.clientCode" :clientId="form.clientId"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="SAP特性" name="SapProperty"> <el-tab-pane label="SAP特性" name="SapProperty">
<SapPropertyData ref="SapProperty"/> <SapPropertyData ref="SapProperty"/>
...@@ -294,6 +294,8 @@ export default { ...@@ -294,6 +294,8 @@ export default {
}, },
data() { data() {
return { return {
//单选框组的默认选项
radio: '是',
//自动生成编码 //自动生成编码
activeName: 'BaseInfo', activeName: 'BaseInfo',
autoGenFlag: true, autoGenFlag: true,
...@@ -534,7 +536,7 @@ export default { ...@@ -534,7 +536,7 @@ export default {
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('md/client/export', { this.download('mes/md/client/export', {
...this.queryParams ...this.queryParams
}, `client_${new Date().getTime()}.xlsx`) }, `client_${new Date().getTime()}.xlsx`)
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment