From 0f4dc4ea8a7de1ffdf34a640c79c29d55b79321c Mon Sep 17 00:00:00 2001 From: 张诺 <zhang_12370@163.com> Date: 星期五, 13 六月 2025 17:53:27 +0800 Subject: [PATCH] 添加生产管理接口及优化表格字段 --- src/views/production/components/ProductionDialog.vue | 192 +++++++---------------------------------------- 1 files changed, 30 insertions(+), 162 deletions(-) diff --git a/src/views/production/components/ProductionDialog.vue b/src/views/production/components/ProductionDialog.vue index 226b70e..b75a3e2 100644 --- a/src/views/production/components/ProductionDialog.vue +++ b/src/views/production/components/ProductionDialog.vue @@ -125,6 +125,16 @@ const columns = [ { label: "渚涘簲鍟嗗悕绉�", prop: "supplierName" }, { label: "鐓ょ", prop: "coal" }, + { label: "鍗曚环(涓嶅惈绋�)", prop: "priceExcludingTax" }, + { label: "搴撳瓨鏁伴噺", prop: "inventoryQuantity" }, + { + label: "浣跨敤鏁伴噺", + prop: "used", + editable: true, + width: 120, + editType: "number", + }, + ]; const detailsTableData = ref([ @@ -133,14 +143,12 @@ currentRow.value = row; }; const formalDatabaseColumns = ref([ - { prop: "supplierName", label: "渚涘簲鍟嗗悕绉�", width: 150 }, - { prop: "coal", label: "鐓ょ绫诲瀷", width: 120 }, - { prop: "unit", label: "鍗曚綅", width: 100 }, - { prop: "inventoryQuantity", label: "搴撳瓨鏁伴噺", width: 100 }, - { prop: "priceIncludingTax", label: "鍗曚环锛堝惈绋庯級", width: 120 }, - { prop: "totalPriceIncludingTax", label: "鎬讳环锛堝惈绋庯級", width: 120 }, - { prop: "priceExcludingTax", label: "鍗曚环(涓嶅惈绋�)", width: 120 }, - { prop: "totalPriceExcludingTax", label: "鎬讳环(涓嶅惈绋�)", width: 120 }, + { prop: "supplierName", label: "渚涘簲鍟嗗悕绉�", minwidth: 150 }, + { prop: "coal", label: "鐓ょ绫诲瀷", minwidth: 60 }, + { prop: "inventoryQuantity", label: "搴撳瓨鏁伴噺", minwidth: 80 }, + { prop: "unit", label: "鍗曚綅", minwidth: 100 }, + { prop: "priceExcludingTax", label: "鍗曚环锛堜笉鍚◣锛�", minwidth: 80 }, + { prop: "createTime", label: "鐧昏鏃ユ湡", minwidth: 400 }, ]); // 琛ㄥ崟鏁版嵁 const formData = reactive({ @@ -169,156 +177,9 @@ const formalDatabaseData = ref([]); const formalDatabaseSelectedData = ref([]); formalDatabaseData.value = [ - { - id: 1, - name: "渚涘簲鍟咥", - type: "鍔ㄥ姏鐓�", - unit: "鍚�", - number: 120, - money: 500, - money1: 200, - money2: 200, - money3: 300, - money4: "楂樹綅", - createUser: "admin", - createTime: "2025-06-01", - }, - { - id: 2, - name: "渚涘簲鍟咥", - type: "鍔ㄥ姏鐓�", - unit: "鍚�", - number: 100, - money: 600, - money1: 300, - money2: 300, - money3: 300, - money4: "浣庝綅", - createUser: "admin", - createTime: "2025-06-01", - }, - { - id: 3, - name: "渚涘簲鍟咮", - type: "鐒︾叅", - unit: "鍚�", - number: 300, - money: 789, - money1: 400, - money2: 400, - money3: 400, - money4: "楂樹綅", - createUser: "admin", - createTime: "2025-06-01", - }, - { - id: 4, - name: "渚涘簲鍟咮", - type: "鐒︾叅", - unit: "鍚�", - number: 256, - money: 800, - money1: 420, - money2: 420, - money3: 420, - money4: "浣庝綅", - createUser: "admin", - createTime: "2025-06-01", - }, - { - id: 5, - name: "渚涘簲鍟咰", - type: "鏃犵儫鐓�", - unit: "鍚�", - number: 256, - money: 700, - money1: 300, - money2: 300, - money3: 300, - money4: "楂樹綅", - createUser: "admin", - createTime: "2025-06-01", - }, - { - id: 6, - name: "渚涘簲鍟咥", - type: "鍔ㄥ姏鐓�", - unit: "鍚�", - number: 120, - money: 500, - money1: 200, - money2: 200, - money3: 300, - money4: "楂樹綅", - createUser: "admin", - createTime: "2025-06-01", - }, - { - id: 7, - name: "渚涘簲鍟咥", - type: "鍔ㄥ姏鐓�", - unit: "鍚�", - number: 100, - money: 600, - money1: 300, - money2: 300, - money3: 300, - money4: "浣庝綅", - createUser: "admin", - createTime: "2025-06-01", - }, - { - id: 8, - name: "渚涘簲鍟咮", - type: "鐒︾叅", - unit: "鍚�", - number: 300, - money: 789, - money1: 400, - money2: 400, - money3: 400, - money4: "楂樹綅", - createUser: "admin", - createTime: "2025-06-01", - }, - { - id: 9, - name: "渚涘簲鍟咮", - type: "鐒︾叅", - unit: "鍚�", - number: 256, - money: 800, - money1: 420, - money2: 420, - money3: 420, - money4: "浣庝綅", - createUser: "admin", - createTime: "2025-06-01", - }, - { - id: 10, - name: "渚涘簲鍟咰", - type: "鏃犵儫鐓�", - unit: "鍚�", - number: 256, - money: 700, - money1: 300, - money2: 300, - money3: 300, - money4: "楂樹綅", - createUser: "admin", - createTime: "2025-06-01", - }, ]; - -// 琛ㄥ崟楠岃瘉瑙勫垯 -const rules = { - category: [{ required: true, message: "璇烽�夋嫨鐓ょ", trigger: "change" }], -}; - // 鍒濆鍖� const Initialization = () => { - console.log("鍒濆鍖栨暟鎹�"); tableData.value = []; }; defineExpose({ @@ -338,13 +199,14 @@ (row) => row.id === item.id ); if (!existingItem) { - tableData.value.push([item, { - used: 0, // 娣诲姞榛樿鐨勪娇鐢ㄦ暟閲� - }]); + tableData.value.push( + Object.assign({}, item, { + used: 0, // 鍒濆浣跨敤鏁伴噺涓�0 + }) + ); } }); innerVisible.value = false; - console.log("閫変腑鐨勬暟鎹�:", tableData.value); }; const handleSelectionChange = (selection) => { formalDatabaseSelectedData.value = selection; @@ -358,7 +220,13 @@ // 鎻愪氦琛ㄥ崟 const handleSubmit = async () => { + console.log("鎻愪氦琛ㄥ崟鏁版嵁:", tableData.value); console.log(detailsTableData.value); + let data = { + productionList: detailsTableData.value, + productionInventoryList: tableData.value, + }; + console.log("鎻愪氦鏁版嵁", data); // dialogVisible.value = false; }; @@ -393,13 +261,13 @@ const addNewRow = () => { detailsTableData.value.push({ coalType: "", - calorificValue: "", productionQuantity: "", laborCost: "", - energyCost: "", + energyConsumptionCost: "", equipmentDepreciation: "", purchasePrice: "", - totalCost: "", + autoCalculate: "0.00", + producer:"", }); }; -- Gitblit v1.9.3