From 8e2f1c51203a5b0965da0d29642f13c6a1906127 Mon Sep 17 00:00:00 2001 From: zuozhengqing <a13193816592@163.com> Date: 星期五, 20 十月 2023 12:13:10 +0800 Subject: [PATCH] Merge branch 'dev' of http://192.168.5.5:10010/r/web/WMS into dev --- src/views/productManage/productCategory/AddProductCategoryDialog.vue | 27 +++++++++++++++++++++++---- 1 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/views/productManage/productCategory/AddProductCategoryDialog.vue b/src/views/productManage/productCategory/AddProductCategoryDialog.vue index 2f86a71..b8453ee 100644 --- a/src/views/productManage/productCategory/AddProductCategoryDialog.vue +++ b/src/views/productManage/productCategory/AddProductCategoryDialog.vue @@ -88,7 +88,7 @@ style="width: 85%" :disabled="!showFooter" > - <el-option v-for="item in productCategoryListWithDefault" :key="item.id" :label="item.name" :value="item.id"> + <el-option v-for="item in productCategoryList" :key="item.id" :label="item.name" :value="item.id"> </el-option> </el-select> </el-form-item> @@ -197,9 +197,6 @@ }, components: {}, computed: { - productCategoryListWithDefault(){ - return [{id:0,name:'璇烽�夋嫨'},...(this.productCategoryList?? [])] - }, modalTitle(){ if (this.editConfig.title === '缂栬緫' && this.editConfig.autoEdit){ return '缂栬緫' @@ -239,8 +236,29 @@ if (this.editConfig.autoEdit){ this.editClick() } + this.setOptionalFieldsToEmpty() }, methods: { + /** + * 闈炲繀濉」鍚庣杩斿洖鐨勬槸鏁板瓧 0,琛ㄥ崟闇�瑕佺┖涓叉墠鑳借涓烘湭閫夋嫨鍥炴樉 + */ + setOptionalFieldsToEmpty(){ + ['parentId','costingMethod','inventoryValuation','forceRemovalStrategy'] + .filter(filed => this.editConfig.infomation[filed] === 0) + .forEach(filed => { + this.editConfig.infomation[filed] = '' + }) + }, + /** + * 鍚庣鍙帴鍙楁暟瀛楀舰寮�, 淇濆瓨鏃惰繕寰楀啀杞洖鍘� + */ + unsetFieldsToNumber(){ + ['parentId','costingMethod','inventoryValuation','forceRemovalStrategy'] + .filter(filed => this.editConfig.infomation[filed] === '') + .forEach(filed => { + this.editConfig.infomation[filed] = 0 + }) + }, // 鑾峰彇浜у搧鏁伴噺 getProductCount(){ getProductList({ @@ -294,6 +312,7 @@ this.showFooter = true }, saveParams() { + this.unsetFieldsToNumber() let data = JSON.parse(JSON.stringify(this.editConfig.infomation)) let params = { -- Gitblit v1.8.0