|
@@ -26,6 +26,22 @@
|
|
|
@size-change="sizeChange"
|
|
|
@refresh-change="refreshChange"
|
|
|
@on-load="onLoad">
|
|
|
+ <template slot="menuLeft">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ icon="el-icon-plus"
|
|
|
+ @click="commodityImport()"
|
|
|
+ >导入
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ icon="el-icon-upload2"
|
|
|
+ size="small"
|
|
|
+ @click="derivation()"
|
|
|
+ >下载模板
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
<template slot-scope="scope" slot="menu">
|
|
|
<el-button
|
|
|
type="text"
|
|
@@ -128,6 +144,12 @@
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog title="导入商品"
|
|
|
+ append-to-body
|
|
|
+ :visible.sync="excelBox"
|
|
|
+ width="555px">
|
|
|
+ <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter"/>
|
|
|
+ </el-dialog>
|
|
|
</basic-container>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -313,42 +335,11 @@ export default {
|
|
|
loadText: '模板上传中,请稍等',
|
|
|
span: 24,
|
|
|
propsHttp: {
|
|
|
- res: 'data'
|
|
|
+ res: 'data',
|
|
|
+ // url:'link'
|
|
|
},
|
|
|
tip: '请上传 .xls,.xlsx 标准格式文件',
|
|
|
- action: "/api/blade-user/import-user"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "数据覆盖",
|
|
|
- prop: "isCovered",
|
|
|
- type: "switch",
|
|
|
- align: "center",
|
|
|
- width: 80,
|
|
|
- dicData: [
|
|
|
- {
|
|
|
- label: "否",
|
|
|
- value: 0
|
|
|
- },
|
|
|
- {
|
|
|
- label: "是",
|
|
|
- value: 1
|
|
|
- }
|
|
|
- ],
|
|
|
- value: 0,
|
|
|
- slot: true,
|
|
|
- rules: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "请选择是否覆盖",
|
|
|
- trigger: "blur"
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- label: '模板下载',
|
|
|
- prop: 'excelTemplate',
|
|
|
- formslot: true,
|
|
|
- span: 24,
|
|
|
+ action: "/api/blade-client/goodsdesc/import-desc?typeId="+this.treeDeptId+"",
|
|
|
}
|
|
|
]
|
|
|
}
|
|
@@ -361,12 +352,6 @@ export default {
|
|
|
this.initData(0);
|
|
|
}
|
|
|
},
|
|
|
- 'excelForm.isCovered'() {
|
|
|
- if (this.excelForm.isCovered !== '') {
|
|
|
- const column = this.findObject(this.excelOption.column, "excelFile");
|
|
|
- column.action = `/api/blade-user/import-user?isCovered=${this.excelForm.isCovered}`;
|
|
|
- }
|
|
|
- }
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters(["userInfo", "permission"]),
|
|
@@ -401,6 +386,31 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ //导入
|
|
|
+ commodityImport(){
|
|
|
+ if(this.treeDeptId === ''){
|
|
|
+ this.$message.warning("请选择商品类型")
|
|
|
+ }else{
|
|
|
+ this.excelBox = !this.excelBox
|
|
|
+ const column = this.findObject(this.excelOption.column, "excelFile");
|
|
|
+ column.action = "/api/blade-client/goodsdesc/import-desc?typeId="+this.treeDeptId+"";
|
|
|
+ }
|
|
|
+ },
|
|
|
+ derivation() {
|
|
|
+ this.$confirm("是否下载模板?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ window.open(`/api/blade-client/goodsdesc/export-template?${this.website.tokenHeader}=${getToken()}`);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ uploadAfter(res, done, loading, column) {
|
|
|
+ window.console.log(column);
|
|
|
+ this.excelBox = false;
|
|
|
+ this.refreshChange();
|
|
|
+ done();
|
|
|
+ },
|
|
|
nodeClick(data) {
|
|
|
this.treeDeptId = data.id;
|
|
|
this.page.currentPage = 1;
|
|
@@ -556,12 +566,6 @@ export default {
|
|
|
handleImport() {
|
|
|
this.excelBox = true;
|
|
|
},
|
|
|
- uploadAfter(res, done, loading, column) {
|
|
|
- window.console.log(column);
|
|
|
- this.excelBox = false;
|
|
|
- this.refreshChange();
|
|
|
- done();
|
|
|
- },
|
|
|
handleTemplate() {
|
|
|
window.open(`/api/blade-user/export-template?${this.website.tokenHeader}=${getToken()}`);
|
|
|
},
|