Commit 19039080 authored by 全洪江's avatar 全洪江

产品对照组导入功能

parent 93bdd3cf
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
:limit="1" :limit="1"
accept=".xlsx, .xls" accept=".xlsx, .xls"
:headers="upload.headers" :headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport" :action="upload.url + '&updateSupport=' + upload.updateSupport"
:disabled="upload.isUploading" :disabled="upload.isUploading"
:on-progress="handleFileUploadProgress" :on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess" :on-success="handleFileSuccess"
...@@ -156,7 +156,6 @@ ...@@ -156,7 +156,6 @@
import { addItem, delItem, getItem, listItem, updateItem } from '@/api/mes/md/clientItem' import { addItem, delItem, getItem, listItem, updateItem } from '@/api/mes/md/clientItem'
import ItemSelect from '@/components/itemSelect/single.vue' import ItemSelect from '@/components/itemSelect/single.vue'
import {getToken} from "@/utils/auth"; import {getToken} from "@/utils/auth";
import {number} from "echarts/lib/export";
export default { export default {
components: { components: {
...@@ -196,11 +195,11 @@ export default { ...@@ -196,11 +195,11 @@ export default {
open: false, open: false,
title: "", title: "",
isUploading: false, isUploading: false,
updateSupport: 0, updateSupport: false,
// 设置上传的请求头部 // 设置上传的请求头部
headers: { Authorization: "Bearer " + getToken() }, headers: { Authorization: "Bearer " + getToken() },
// 上传的地址 // 上传的地址
url: process.env.VUE_APP_BASE_API + "/md/clientItem/importData", url: process.env.VUE_APP_BASE_API + "/md/clientItem/importData?clientCode=" + this.clientCode,
}, },
// 表单参数 // 表单参数
form: {}, form: {},
...@@ -252,14 +251,35 @@ export default { ...@@ -252,14 +251,35 @@ export default {
}, },
/** 导入按钮操作 */ /** 导入按钮操作 */
handleImport() { handleImport() {
this.upload.title = "产品对照组导入"; this.upload.title = "导入产品对照组";
this.upload.open = true; this.upload.open = true;
}, },
/** 下载模板操作 */
importTemplate() {
this.download('md/clientItem/importTemplate', {
}, `md_client_item_template_${new Date().getTime()}.xlsx`)
},
/** 提交上传文件 */
submitFileForm() {
this.$refs.upload.submit();
},
// 文件上传中处理
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
},
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('md/clientItem/export', { this.download('md/clientItem/export', {
...this.queryParams ...this.queryParams
}, `client_${new Date().getTime()}.xlsx`) }, `md_client_item_${new Date().getTime()}.xlsx`)
}, },
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
......
...@@ -249,7 +249,7 @@ ...@@ -249,7 +249,7 @@
<Account ref="Account" :clientCode="form.clientCode" :clientId="form.clientId"/> <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" :clientCode="form.clientCode"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="催货款通知邮箱" name="UrgeEmail"> <el-tab-pane label="催货款通知邮箱" name="UrgeEmail">
<UrgeEmail ref="UrgeEmail" :clientCode="form.clientCode" :clientId="form.clientId"/> <UrgeEmail ref="UrgeEmail" :clientCode="form.clientCode" :clientId="form.clientId"/>
......
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