From e3cadadc1e03e0648a079f7fc8bf8b3d0d64bc27 Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期一, 15 四月 2024 15:54:04 +0800 Subject: [PATCH] wms的出库入库调拨 3个模块新建,编辑,列表增加 主管,会计,保管员3个字段以及新建,编辑联调 --- src/views/productManage/product/AddProductDialog.vue | 106 ++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 93 insertions(+), 13 deletions(-) diff --git a/src/views/productManage/product/AddProductDialog.vue b/src/views/productManage/product/AddProductDialog.vue index 3534884..3be77ba 100644 --- a/src/views/productManage/product/AddProductDialog.vue +++ b/src/views/productManage/product/AddProductDialog.vue @@ -130,14 +130,38 @@ </el-option> </el-select> </el-form-item> - <el-form-item label="鍗曚綅" prop="unit"> + <!-- <el-form-item label="鍗曚綅old" prop="unit"> <el-input v-model="editConfig.infomation.unit" placeholder="璇疯緭鍏�" style="width: 85%" :disabled="!showFooter" ></el-input> + </el-form-item> --> + + <el-form-item label="鍗曚綅" prop="unit"> + <el-select + :disabled="!showFooter" + v-model="editConfig.infomation.unit" + placeholder="鍗曚綅" + filterable + @change="Gtechange" + style="width: 85%" + > + <el-option + v-for="ele in unitList" + :key="ele.id" + :label="ele.name" + :value="ele.name" + ></el-option> + </el-select> + <i + class="el-icon-setting margin_left_10px cursor_pointer" + style="font-size: 20px; color: gray" + @click="handleUnitShow" + ></i> </el-form-item> + <el-form-item label="浜у搧鏍囩" prop="productTagName"> <el-input v-model="editConfig.infomation.productTagName" @@ -215,12 +239,13 @@ placeholder="璇疯緭鍏�" ></el-input> </el-form-item> - <el-form-item label="閲囪喘绫诲瀷" prop="purchaseType"> - <el-radio-group :disabled="!showFooter" v-model="editConfig.infomation.purchaseType"> - <el-radio v-for="item in purchaseTypeList" :key="item.id" :label="item.id">{{ - item.name - }}</el-radio> - </el-radio-group> + <el-form-item label="閲囪喘绫诲瀷" prop="purchaseTypeList"> + <el-checkbox-group + v-model="editConfig.infomation.purchaseTypeList" + :disabled="!showFooter" + > + <el-checkbox v-for="item in bomPurchaseTypeList" :key="item.id" :label="item.id">{{ item.name }}</el-checkbox> + </el-checkbox-group> </el-form-item> <el-form-item label="鍐呴儴缂栫爜" prop="internalReference"> <el-input @@ -510,16 +535,28 @@ <el-button size="small" @click="editConfig.visible = false">鍙栨秷</el-button> </div> </el-dialog> + <BomDialog + ref="editDialog" + :editRow="editRow" + @handleConfirmSave="handleConfirmSave" + :workList="unitList" + title="璁¢噺鍗曚綅" + ></BomDialog> </div> </template> <script> import IconCropper from "./IconCropper" import { getProductCategoryList } from "@/api/product/productCategory" -import { getProductList, addProduct, updateProduct } from "@/api/product/product" -import { uploadFiles, getUserInfo } from "@/api/common/other" +import { getProductList, addProduct, updateProduct,saveUnitDict } from "@/api/product/product" +import { uploadFiles, getUserInfo, } from "@/api/common/other" import codeMixin from "@/components/mixin/codeMixin" import { getDataByType } from "@/api/data" +import BomDialog from "./components/bomDialog"; +import {getUnitInfo, } from "@/api/basic/standard"; +// import { postGetSaveSUnitDict } from "@/api/basic/standard"; + + export default { mixins: [codeMixin], name: "AddProductDialog", @@ -536,7 +573,10 @@ } } }, - components: { IconCropper }, + components: { + IconCropper, + BomDialog, + }, computed: { modalTitle() { if (this.editConfig.title === "缂栬緫" && this.editConfig.autoEdit) { @@ -557,9 +597,9 @@ id: [{ required: true, validator: this.validateCheckCode, trigger: ["change", "blur"] }], model: [{ required: true, message: "璇烽�夋嫨鐗╂枡绫诲瀷", trigger: "change" }], // salePrice: [{ required: true, message: "璇疯緭鍏ラ攢鍞环鏍�", trigger: "blur" }], - unit: [{ required: true, message: "璇疯緭鍏ュ崟浣�", trigger: ["change", "blur"] }], + unit: [{ required: true, message: "璇疯緭鍏ュ崟浣�", trigger: ["blur"] }], // 閲囪喘绫诲瀷 - purchaseType: [{ required: true, message: "璇烽�夋嫨", trigger: "blur" }] + purchaseTypeList: [{ required: true, message: "璇烽�夋嫨", trigger: "blur" }] }, memberOptions: [], productCategoryOptions: [], // 浜у搧绫诲埆 @@ -616,7 +656,12 @@ }, isView: false, fileFormdata: null, // 涓婁紶鍥剧墖鍏ュ弬 - purchaseTypeList: getDataByType("purchaseType") + bomPurchaseTypeList: getDataByType("purchaseType"), + unitList: [], + editRow:{ + editDialogVisible:false, + BomTableData:[] + } } }, created() { @@ -637,8 +682,26 @@ this.setOptionalFieldsToEmpty() this.formInfo() this.getUserInfo() + this.getUnitInfo() }, methods: { + // 鍗曚綅 + handleUnitShow() { + this.editRow.editDialogVisible = true; + }, + handleConfirmSave(dataList) { + saveUnitDict({ data: dataList }).then((res) => { + if (res.code == 200) { + this.$message({ + message: "鎿嶄綔鎴愬姛锛�", + type: "success", + }); + this.getUnitInfo() + } + }); + this.editRow.editDialogVisible = false; + + }, // 鑾峰彇鐧诲綍鐢ㄦ埛淇℃伅 getUserInfo() { getUserInfo().then((res) => { @@ -915,6 +978,23 @@ } else if (val === "閿�鍞�") { this.showSale = param } + }, + Gtechange(){ + this.$forceUpdate() + }, + // 鑾峰彇鍗曚綅鍒楄〃鏁版嵁 + async getUnitInfo(){ + await getUnitInfo().then((res)=>{ + if( this.editConfig.title==="鏂板缓"){ + res.data.map((item)=>{ + if(item.isDefault){ + this.editConfig.infomation.unit=item.name + } + }) + } + this.editRow.BomTableData = res.data; + this.unitList=res.data + }) } } } -- Gitblit v1.8.0