lshcom 1.0.13 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lshcom",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "files": [
5
5
  "src/assets/*",
6
6
  "src/common/*",
package/src/common/api.js CHANGED
@@ -94,6 +94,13 @@ axios.interceptors.response.use((res) => {
94
94
 
95
95
  }
96
96
  }
97
+ if ([res.data.errorcode,res.data.errorCode].includes("importBasisDistribuRelations")) {
98
+ Message.closeAll()
99
+ Message({
100
+ message: res.data.message,
101
+ type: 'success',
102
+ })
103
+ }
97
104
  }
98
105
  else if (res.data.code === 'fail') {
99
106
  Message.closeAll()
@@ -1,6 +1,10 @@
1
1
  <template>
2
2
  <div class="f-ib f-maw1">
3
+ <span v-if="uploadDialogFlag">
4
+ <el-button :size="size" :type="type" :class="btnClass" :style="btnStyle" @click="$refs.EleDialog.visible = true">{{ text }}</el-button>
5
+ </span>
3
6
  <el-upload
7
+ v-else
4
8
  class="f-ib f-maw1"
5
9
  ref="upload"
6
10
  :action="global.uploadUrl"
@@ -18,6 +22,28 @@
18
22
  <el-button v-if="importRelationCode && importFlag" :type="importType" :size="size" :class="btnClass" :style="btnStyle" @click.stop="global.getFileList(importRelationCode,'download')">{{ importText }}</el-button>
19
23
  <el-button v-if="abnormal" type="danger" :disabled="!downloadErrorInfo.downloadErrorUrl" :size="size" :class="btnClass" @click.stop="global.open(downloadErrorInfo.downloadErrorUrl)">异常数据下载</el-button>
20
24
  <el-button v-if="importRelationCode && !importFlag" :type="importType" :size="size" :class="btnClass" :style="btnStyle" @click.stop="global.getFileList(importRelationCode,'download')">{{ importText }}</el-button>
25
+
26
+ <EleDialog title="导入" ref="EleDialog" showFooter customFooter>
27
+ 请按照导入模板的规范,使用excel表格导入。
28
+ <div slot="footer">
29
+ <el-button v-if="uploadDialogImportRelationCode" :size="size" :class="btnClass" :style="btnStyle" @click.stop="global.getFileList(uploadDialogImportRelationCode,'download')">导入模板下载</el-button>
30
+ <el-upload
31
+ class="f-ib f-maw1"
32
+ ref="upload"
33
+ :action="global.uploadUrl"
34
+ :data="params"
35
+ :accept="accept"
36
+ :show-file-list="showFileList"
37
+ :auto-upload="autoUpload"
38
+ :before-upload="beforeUpload"
39
+ :on-success ='onSuccess'
40
+ :on-preview="onPreview"
41
+ :on-remove="onRemove"
42
+ :file-list="fileList">
43
+ <el-button :size="size" :type="type" :class="btnClass" :style="btnStyle">立即导入</el-button>
44
+ </el-upload>
45
+ </div>
46
+ </EleDialog>
21
47
  </div>
22
48
  </template>
23
49
 
@@ -39,6 +65,8 @@
39
65
  abnormal: { type: Boolean, default: false }, // 是否显示异常数据下载
40
66
  btnClass: { type: String, default: '' }, // 按钮class
41
67
  btnStyle: { type: Object, default: () => ({}) }, // 按钮style
68
+ uploadDialogFlag: { type: Boolean, default: false }, // 上传按钮点击弹框显示
69
+ uploadDialogImportRelationCode: { type: String, default: '' }, // 导入模板的relationCode
42
70
  },
43
71
  data() {
44
72
  return {
@@ -121,6 +149,11 @@
121
149
  if (status > 1) {
122
150
  clearInterval(this.timer);
123
151
  }
152
+ if([res.data.errorcode,res.data.errorCode].includes("importBasisDistribuRelations")){
153
+ this.$emit('importsClosure', obj[0]);
154
+ if(this.uploadDialogFlag) this.$refs.EleDialog.visible = false
155
+ return
156
+ }
124
157
 
125
158
  switch (status) {
126
159
  case "2":
@@ -129,6 +162,7 @@
129
162
  message: "导入完成",
130
163
  type: "success"
131
164
  });
165
+ if(this.uploadDialogFlag) this.$refs.EleDialog.visible = false
132
166
  break;
133
167
  case "3":
134
168
  this.downloadErrorInfo = {
@@ -247,12 +247,12 @@ export default {
247
247
  this.storeCodes = value[1] || []
248
248
  },
249
249
  // 设置缓存
250
- setCache(){
251
- this.$store.commit('queryParams/setParams', {params: this.getOrgStore(), key: `${this.$route.path}Store`})
250
+ setCache(key = ''){
251
+ this.$store.commit('queryParams/setParams', {params: this.getOrgStore(), key: `${this.$route.path}Store${key}`})
252
252
  },
253
253
  // 应用缓存
254
- useCache(){
255
- this.setOrgStore(this.$store.state.queryParams[`${this.$route.path}Store`])
254
+ useCache(key = ''){
255
+ this.setOrgStore(this.$store.state.queryParams[`${this.$route.path}Store${key}`])
256
256
  },
257
257
  },
258
258
  computed: {
@@ -87,6 +87,7 @@ export default {
87
87
  orgPropertyList_store: [{ label: "门店", value: "4" }],
88
88
  orgList: [],
89
89
  isDisabled: false,
90
+ useCacheFlag: false,
90
91
  };
91
92
  },
92
93
 
@@ -163,6 +164,7 @@ export default {
163
164
  * @param {string} val 组织code
164
165
  */
165
166
  handleChange(val) {
167
+ console.log('handleChange',val)
166
168
  let label;
167
169
  let storeCode;
168
170
  let index = 0;
@@ -246,6 +248,12 @@ export default {
246
248
  } else {
247
249
  this.orgCode = this.orgList[0].value;
248
250
  }
251
+ if(this.useCacheFlag){
252
+ let obj = this.$store.state.queryParams[`${this.$route.path}Organiza`]
253
+ if(obj){
254
+ this.orgCode = obj.orgCode || ''
255
+ }
256
+ }
249
257
  }
250
258
  });
251
259
  },
@@ -255,6 +263,21 @@ export default {
255
263
  this.isDisabled = true;
256
264
  }, 1000);
257
265
  },
266
+ // 设置缓存
267
+ setCache(){
268
+ this.$store.commit('queryParams/setParams', {params: {
269
+ orgProperty: this.orgProperty,
270
+ orgCode: this.orgCode,
271
+ }, key: `${this.$route.path}Organiza`})
272
+ },
273
+ // 应用缓存
274
+ useCache(){
275
+ let obj = this.$store.state.queryParams[`${this.$route.path}Organiza`]
276
+ if(obj){
277
+ this.orgProperty = obj.orgProperty || ''
278
+ this.useCacheFlag = true
279
+ }
280
+ },
258
281
  },
259
282
  };
260
283
  </script>
@@ -1998,7 +1998,7 @@
1998
1998
  <el-button type="primary" size="large" @click="portrayalCustomerTagSearch">查询</el-button>
1999
1999
  </div>
2000
2000
  <el-collapse v-model="portrayalCustomerTagActiveName" accordion>
2001
- <el-collapse-item v-for="(item,index) in portrayalCustomerTagArrFilter" :title="item.categoryName" :name="index">
2001
+ <el-collapse-item v-for="(item,index) in portrayalCustomerTagArrFilter" :key="index" :title="item.categoryName" :name="index">
2002
2002
  <el-row :gutter="10" v-if="item.tags">
2003
2003
  <el-col :span="6" class="f-mt5 f-mb5" v-for="(item2,index2) in item.tags" :key="index2">
2004
2004
  <div class="f-c0 f-wwb">{{ item2.name }}</div>