From 09fd818c1c04c6abe0d4fe874a5b6aab761e4ae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E5=AD=90=E5=8E=9A?= Date: Mon, 3 Aug 2020 16:27:33 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=BA=93=E4=BD=8D=E7=BB=B4=E6=8A=A4?= =?UTF-8?q?=E9=A1=B5-=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81=E6=A0=87?= =?UTF-8?q?=E5=87=86=E5=8C=96=EF=BC=8C=E6=96=B0=E5=A2=9E=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E6=8A=BD=E6=88=90=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/styles/index.scss | 6 + src/utils/index.js | 45 ++ src/views/house/storeLocation.vue | 515 ++++++------------ .../storeLocationConfig/storeLocationEdit.vue | 225 ++++++++ 4 files changed, 449 insertions(+), 342 deletions(-) create mode 100644 src/views/house/storeLocationConfig/storeLocationEdit.vue diff --git a/src/styles/index.scss b/src/styles/index.scss index aff06f2..ee0ae25 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -200,6 +200,12 @@ a:hover { .w163{ width: 163px!important; } +.w184{ + width: 184px!important; +} +.web_form_active{ + height: 42px; +} .fsc-keep div{ word-break:keep-all !important; } diff --git a/src/utils/index.js b/src/utils/index.js index a6fbf1b..2e6c1ec 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -114,4 +114,49 @@ export function array_cut_item(arr, item, idKey) { } return arr } +/** + * 对象数组去重 + * */ +export function arrayUnique2(arr, name) { + const hash = {} + return arr.reduce(function(item, next) { + hash[next[name]] ? '' : hash[next[name]] = true && item.push(next) + return item + }, []) +} +// 重置 (objEditData) 对象的各属性值 +export function resetObjEditDataFunc(objEditData) { + for (const i in objEditData) { + objEditData[i] = null + } + return objEditData +} +/** + * 例子: ['abc','efg'] => 'abc,efg' + * */ +export function arrayToStringFunc(array) { + let now_str = '' + if (array) { + if (array.length > 1) { + now_str = array.join(',') + } else { + now_str = (array[0]) + '' + } + } + return now_str +} +/** + * 例子: 'abc,efg' => ['abc','efg'] + * */ +export function stringToArrayFunc(string) { + let now_arr = [] + if (string) { + if (string.indexOf(',') !== -1) { + now_arr = string.split(',') + } else { + now_arr.push(string) + } + } + return now_arr +} diff --git a/src/views/house/storeLocation.vue b/src/views/house/storeLocation.vue index 90180cc..ae24b48 100644 --- a/src/views/house/storeLocation.vue +++ b/src/views/house/storeLocation.vue @@ -1,14 +1,10 @@ diff --git a/src/views/house/storeLocationConfig/storeLocationEdit.vue b/src/views/house/storeLocationConfig/storeLocationEdit.vue new file mode 100644 index 0000000..a5beef7 --- /dev/null +++ b/src/views/house/storeLocationConfig/storeLocationEdit.vue @@ -0,0 +1,225 @@ + + + + -- Gitee From 48f9e281916dad7763eac4f9093caac645dd3271 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E5=AD=90=E5=8E=9A?= Date: Thu, 6 Aug 2020 15:53:18 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=BA=93=E4=BD=8D=E7=BB=B4=E6=8A=A4?= =?UTF-8?q?=E9=A1=B5-=E6=89=B9=E9=87=8F=E4=BF=AE=E6=94=B9=E5=BA=93?= =?UTF-8?q?=E4=BD=8D=E7=B1=BB=E5=9E=8B=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/api/house/storeArea.js | 8 ++ src/filter/customFilters.js | 29 ++--- src/views/house/storeLocation.vue | 71 ++++++++++- .../storeLocationConfig/storeLocationEdit.vue | 9 +- .../storeLocationConfig/storeTypeEdit.vue | 119 ++++++++++++++++++ 6 files changed, 209 insertions(+), 29 deletions(-) create mode 100644 src/views/house/storeLocationConfig/storeTypeEdit.vue diff --git a/package.json b/package.json index 652ddff..565b284 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "axios": "0.16.2", - "element-ui": "2.0.7", + "element-ui": "2.1.0", "file-saver": "^1.3.8", "js-cookie": "2.1.4", "normalize.css": "7.0.0", diff --git a/src/api/house/storeArea.js b/src/api/house/storeArea.js index ba67ffe..f38def8 100644 --- a/src/api/house/storeArea.js +++ b/src/api/house/storeArea.js @@ -35,3 +35,11 @@ export function updateStoreArea(data) { data: data }) } +// 批量 修改 库位类型 +export function batchUpdateLocationType(data) { + return fetch({ + url: '/storeArea/batchUpdateLocationType', + method: 'post', + data: data + }) +} diff --git a/src/filter/customFilters.js b/src/filter/customFilters.js index ad16fde..cc3b869 100644 --- a/src/filter/customFilters.js +++ b/src/filter/customFilters.js @@ -332,27 +332,24 @@ Vue.filter('storeAreaStatusFilter', (v) => { }) // 库位类型 Vue.filter('storeLocationTypeFilter', (v) => { - if (v === '10') { - return '普通库区' - } else if (v === '20') { - return '临时库区' - } else if (v === '30') { - return '虚拟库区' - } else if (v === '40') { - return '大库区' - } else { - return v + const status = parseInt(v) + const statusMap = { + 10: '普通库区', + 20: '临时库区', + 30: '虚拟库区', + 40: '大库区', + 50: '中库区' } + return statusMap[status] }) // 库位状态 Vue.filter('storeLocationStatusFilter', (v) => { - if (v === '10') { - return '正常' - } else if (v === '20') { - return '失效' - } else { - return v + const status = parseInt(v) + const statusMap = { + 10: '正常', + 20: '失效' } + return statusMap[status] }) // 仓库状态 Vue.filter('storeHouseFilter', (v) => { diff --git a/src/views/house/storeLocation.vue b/src/views/house/storeLocation.vue index ae24b48..dfd9b95 100644 --- a/src/views/house/storeLocation.vue +++ b/src/views/house/storeLocation.vue @@ -14,6 +14,7 @@ 启用 + 批量修改库位类型 @@ -107,7 +108,7 @@ - + + + + + + -- Gitee From 0592b901acc76b4f84caa5d3c04575ef60bab0e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E5=AD=90=E5=8E=9A?= Date: Thu, 6 Aug 2020 15:56:59 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=BA=93=E4=BD=8D=E7=BB=B4=E6=8A=A4?= =?UTF-8?q?=E9=A1=B5-=E9=9D=A2=E6=9D=BF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/house/storeLocationConfig/storeTypeEdit.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/house/storeLocationConfig/storeTypeEdit.vue b/src/views/house/storeLocationConfig/storeTypeEdit.vue index 2c781d6..e2a41a5 100644 --- a/src/views/house/storeLocationConfig/storeTypeEdit.vue +++ b/src/views/house/storeLocationConfig/storeTypeEdit.vue @@ -33,7 +33,7 @@ type: null }, objEditRules: { - // driverId: [{ required: true, message: '司机id必填', trigger: 'blur' }], + type: [{ required: true, message: '请先选择库位类型', trigger: 'blur' }] }, objEditWays: { type: [ -- Gitee