diff --git a/src/views/modules/logistics-fare/logistics-template/index.vue b/src/views/modules/logistics-fare/logistics-template/index.vue index 6649973..2086987 100644 --- a/src/views/modules/logistics-fare/logistics-template/index.vue +++ b/src/views/modules/logistics-fare/logistics-template/index.vue @@ -20,6 +20,19 @@ v-model="searchForm.name" > + + + + + 搜索 @@ -49,19 +62,24 @@ export default { dataList: [], searchForm: { name: "", + linkId: "", }, shopId: "", + marketList: "", }; }, created() { if (JSON.parse(sessionStorage.getItem("userInfo")).markets.length > 0) { this.shopId = true; - this.formInline.marketId = JSON.parse( + this.searchForm.linkId = JSON.parse( sessionStorage.getItem("userInfo") ).markets[0].marketId; this.marketList = JSON.parse(sessionStorage.getItem("userInfo")).markets; console.log(this.marketList); } else if (JSON.parse(sessionStorage.getItem("userInfo")).shopId) { + this.searchForm.linkId = JSON.parse( + sessionStorage.getItem("userInfo") + ).shopId; this.shopId = true; } else { this.shopId = false; @@ -87,7 +105,7 @@ export default { }); }, addFareTemplate() { - this.$refs.addTemplate.toggle().add(); + this.$refs.addTemplate.toggle().add(this.searchForm.linkId); }, }, computed: { @@ -100,7 +118,6 @@ export default { this.$api.mer_admin.getShippingTemplateInfo(row.id).then((res) => { console.log(res); console.log("row.tableData", row.tableData); - if (!row.tableData) { if (res.data.data.shippingTemplatesRegionResultList) { this.$set( diff --git a/src/views/modules/logistics-fare/logistics-template/popup/add-template.vue b/src/views/modules/logistics-fare/logistics-template/popup/add-template.vue index 4a1457a..ed4cc7f 100644 --- a/src/views/modules/logistics-fare/logistics-template/popup/add-template.vue +++ b/src/views/modules/logistics-fare/logistics-template/popup/add-template.vue @@ -57,6 +57,7 @@ export default { }, fileList: [], //回显图片 place: "", //场地 + linkId: "", }; }, mounted() { @@ -141,10 +142,11 @@ export default { this.modalData = _data; }; return { - add: () => { + add: (id) => { this.$nextTick(() => { this.modalData = cloneDeep(BASE_DATA); }); + this.linkId = id; this.isAdd = true; this.modalConfig.title = "添加运费模板"; }, @@ -832,10 +834,7 @@ export default { if (this.isAdd) { this.$api.mer_admin .addShippingTemplate({ - linkId: JSON.parse(sessionStorage.getItem("userInfo")).shopId - ? JSON.parse(sessionStorage.getItem("userInfo")).shopId - : JSON.parse(sessionStorage.getItem("userInfo")).markets[0] - .marketId, + linkId: this.linkId, defaults: 0, //默认值,待确认 sort: 0, //默认值,待确认 type: 2, //默认值,待确认 @@ -894,10 +893,7 @@ export default { this.$api.mer_admin .updateShippingTemplate({ id: this.modalData.id, - linkId: JSON.parse(sessionStorage.getItem("userInfo")).shopId - ? JSON.parse(sessionStorage.getItem("userInfo")).shopId - : JSON.parse(sessionStorage.getItem("userInfo")).markets[0] - .marketId, + linkId: this.linkId, defaults: 0, //默认值,待确认 sort: 0, //默认值,待确认 type: 2, //默认值,待确认