From 60d0884f82141a0127fca7e2b03bf3c147436776 Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期五, 08 三月 2024 11:29:20 +0800 Subject: [PATCH] 采购订单列表接口联调和添加采购订单接口联调 --- src/views/purchaseManage/purchase/components/AddPurchase.vue | 86 +++++++++++++++++++++++++++++++++++++++---- 1 files changed, 78 insertions(+), 8 deletions(-) diff --git a/src/views/purchaseManage/purchase/components/AddPurchase.vue b/src/views/purchaseManage/purchase/components/AddPurchase.vue index f782552..10641ed 100644 --- a/src/views/purchaseManage/purchase/components/AddPurchase.vue +++ b/src/views/purchaseManage/purchase/components/AddPurchase.vue @@ -54,7 +54,7 @@ > <el-option v-for="ele in plcBrandList" - :key="ele.name" + :key="ele.purchaseTypeId" :label="ele.name" :value="ele.id" ></el-option> @@ -97,11 +97,11 @@ </div> </el-form-item> </el-col> - <el-col :span="12"> + <!-- <el-col :span="12"> <el-form-item label="鍗曟嵁鏉ユ簮" prop="orderSource"> <el-input v-model="editConfig.infomation.orderSource" disabled placeholder="璇峰~鍐�"></el-input> </el-form-item> - </el-col> + </el-col> --> <el-col :span="12"> <el-form-item label="閲囪喘鍗曞悕绉�" prop="name"> <el-input @@ -160,6 +160,54 @@ value-format="yyyy-MM-dd" > </el-date-picker> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="鏀惰揣浠撳簱" prop="warehouse"> + <el-select + placeholder="璇烽�夋嫨鏀惰揣浠撳簱" + v-model="editConfig.infomation.warehouse" + clearable + style="width: calc(100% - 0px)" + :disabled="editConfig.isDisabled" + > + <el-option + v-for="(ele, index) in receiveWhouseList" + :key="index" + :label="ele.name" + :value="ele.name" + ></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="鍦板潃" prop="warehouseAddress"> + <el-input + :disabled="editConfig.isDisabled" + v-model="editConfig.infomation.warehouseAddress" + placeholder="璇峰~鍐�" + clearable + ></el-input> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="鎺ユ敹浜�" prop="principal"> + <el-input + :disabled="editConfig.isDisabled" + v-model="editConfig.infomation.principal" + placeholder="璇峰~鍐�" + clearable + ></el-input> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="鏉ユ簮鍗曟嵁" prop="sourceOrder"> + <el-input + :disabled="editConfig.isDisabled" + v-model="editConfig.infomation.sourceOrder" + placeholder="璇峰~鍐�" + clearable + ></el-input> </el-form-item> </el-col> <el-col :span="24"> @@ -287,7 +335,13 @@ import CommonFormTableView from "@/components/makepager/CommonFormTableView" import BomDialog from "@/components/makepager/BomDialog" import { getProductList } from "@/api/productManage/product" -import { addPurchase, updatePurchase, savePurchaseType, getPurchaseType } from "@/api/purchaseManage/purchase" +import { + addPurchase, + updatePurchase, + savePurchaseType, + getPurchaseType, + getWarehouseInfo +} from "@/api/purchaseManage/purchase" import SelectSupplierDialog from "@/views/purchaseManage/purchase/components/SelectSupplierDialog" // import { formToJSON } from "axios"; import codeMixin from "@/components/mixin/codeMixin" @@ -369,11 +423,14 @@ total: 0, totalTwo: 0, productListIdx: 0, - lacks: [] + lacks: [], + receiveWhouseList: [] // 鏀惰揣浠撳簱鍒楄〃 } }, created() { + console.log(this.editConfig, "鍙傛暟") this.handleGetBomKindDictList() + this.getWarehouseInfo() this.$store.dispatch("getSupplier") this.formInfo() }, @@ -446,13 +503,15 @@ this.plcBrandList = res.data this.setTableForm() if (val) { + // this.plcBrandList.map((item)=>{ + // item.purchaseTypeId=item.id + // }) for (let i in this.plcBrandList) { if (this.plcBrandList[i][this.editRow.isDefault]) { this.editConfig.infomation.purchaseTypeId = this.editConfig.infomation.purchaseTypeId ? this.editConfig.infomation.purchaseTypeId : this.plcBrandList[i].id this.$set(this.editConfig.infomation, "purchaseTypeId", this.editConfig.infomation.purchaseTypeId) - break } } @@ -648,7 +707,11 @@ realTotalPrice: this.total ? Number(this.total) : 0, totalPrice: this.totalTwo ? Number(this.totalTwo) : 0, status: data.status, - quantity: data.quantity // 閲囪喘鏁伴噺 + quantity: data.quantity, // 閲囪喘鏁伴噺 + warehouse: data.warehouse || "", // 鏀惰揣浠撳簱 + warehouseAddress: data.warehouseAddress || "", // 鏀惰揣浠撳簱鍦板潃 + principal: data.principal || "", // 浠撳簱璐熻矗浜� + sourceOrder: data.sourceOrder || "" // 鏉ユ簮鍗曟嵁 } } if (data.id) { @@ -723,7 +786,7 @@ this.tableData = [ { purchaseId: 0, - productId:Number(this.productId), + productId: Number(this.productId), productIndex: this.productIndex, amount: 0, name: "", @@ -862,6 +925,13 @@ handleProduct(item) { this.tableData[this.productListIdx].productId = Number(item.id) console.log(item, "閫変腑浜у搧", this.tableData) + }, + // 鑾峰彇鏀惰揣浠撳簱鍒楄〃 + async getWarehouseInfo() { + await getWarehouseInfo().then((res) => { + console.log(res) + this.receiveWhouseList = res.data.info + }) } } } -- Gitblit v1.8.0