diff --git a/klp-ui/src/components/KLPService/RawMaterialSelect/index.vue b/klp-ui/src/components/KLPService/RawMaterialSelect/index.vue index 6ff4e014..2d02f930 100644 --- a/klp-ui/src/components/KLPService/RawMaterialSelect/index.vue +++ b/klp-ui/src/components/KLPService/RawMaterialSelect/index.vue @@ -4,8 +4,6 @@ :placeholder="placeholder" filterable clearable - remote - :remote-method="debouncedRemoteMethod" :loading="loading" @change="onChange" style="width: 100%" @@ -67,25 +65,19 @@ export default { this.fetchOptions(""); }, methods: { - fetchOptions(keyword) { + fetchOptions() { this.loading = true; - listRawMaterial({ pageNum: 1, pageSize: 10, rawMaterialName: keyword }).then(res => { + listRawMaterial({ pageNum: 1, pageSize: 9999 }).then(res => { this.options = res.rows || []; this.loading = false; }).catch(() => { this.loading = false; }); }, - remoteMethod(keyword) { - this.fetchOptions(keyword); + async onChange(val) { + const rawMaterial = this.options.find(p => p.rawMaterialId === val); + this.$emit('change', rawMaterial); }, - debouncedRemoteMethod: debounce(function(keyword) { - this.remoteMethod(keyword); - }, 400), - onChange(val) { - this.$emit("input", val); - this.$emit("change", val); - } } }; diff --git a/klp-ui/src/views/wms/order/index.vue b/klp-ui/src/views/wms/order/index.vue index c82c8683..f640df07 100644 --- a/klp-ui/src/views/wms/order/index.vue +++ b/klp-ui/src/views/wms/order/index.vue @@ -157,10 +157,10 @@ - - + + - + diff --git a/klp-ui/src/views/wms/purchasePlan/index.vue b/klp-ui/src/views/wms/purchasePlan/index.vue index cd09f7ff..4f8cdd0a 100644 --- a/klp-ui/src/views/wms/purchasePlan/index.vue +++ b/klp-ui/src/views/wms/purchasePlan/index.vue @@ -239,6 +239,25 @@ 关 闭 + + + + + @@ -247,13 +266,15 @@ import { listPurchasePlan, getPurchasePlan, delPurchasePlan, addPurchasePlan, up import { listOrder } from "@/api/wms/order"; import PurchasePlanClac from "./panels/clac.vue"; import PurchasePlanDetail from "./panels/detail.vue"; +import CreatePurchasePanel from "./panels/CreatePurchasePanel.vue"; import { EOrderStatus } from "../../../utils/enums"; export default { name: "PurchasePlan", components: { PurchasePlanClac, - PurchasePlanDetail + PurchasePlanDetail, + CreatePurchasePanel }, dicts: ['order_status'], data() { @@ -327,7 +348,8 @@ export default { status: [ { required: true, message: "状态不能为空", trigger: "change" } ], - } + }, + addDrawerOpen: false, }; }, mounted() { @@ -383,9 +405,7 @@ export default { }, /** 新增按钮操作 */ handleAdd() { - this.reset(); - this.open = true; - this.title = "添加采购计划主"; + this.addDrawerOpen = true; }, /** 修改按钮操作 */ handleUpdate(row) { @@ -498,7 +518,19 @@ export default { handleDetail(row) { this.selectedPlanId = row.planId; this.detailOpen = true; + }, + onAddConfirm() { + this.addDrawerOpen = false; + this.getList(); } } }; + + diff --git a/klp-ui/src/views/wms/purchasePlan/panels/CreatePurchasePanel.vue b/klp-ui/src/views/wms/purchasePlan/panels/CreatePurchasePanel.vue new file mode 100644 index 00000000..0ab03932 --- /dev/null +++ b/klp-ui/src/views/wms/purchasePlan/panels/CreatePurchasePanel.vue @@ -0,0 +1,280 @@ + + + + + \ No newline at end of file diff --git a/klp-ui/src/views/wms/purchasePlan/panels/RecommendPurchasePanel.vue b/klp-ui/src/views/wms/purchasePlan/panels/RecommendPurchasePanel.vue new file mode 100644 index 00000000..aa364459 --- /dev/null +++ b/klp-ui/src/views/wms/purchasePlan/panels/RecommendPurchasePanel.vue @@ -0,0 +1,50 @@ + + + \ No newline at end of file diff --git a/klp-ui/src/views/wms/purchasePlan/panels/clac.vue b/klp-ui/src/views/wms/purchasePlan/panels/clac.vue index 44ed7d89..e22db312 100644 --- a/klp-ui/src/views/wms/purchasePlan/panels/clac.vue +++ b/klp-ui/src/views/wms/purchasePlan/panels/clac.vue @@ -1,89 +1,27 @@ diff --git a/klp-ui/src/views/wms/purchasePlan/panels/detail.vue b/klp-ui/src/views/wms/purchasePlan/panels/detail.vue index 7ef71357..aa898eb6 100644 --- a/klp-ui/src/views/wms/purchasePlan/panels/detail.vue +++ b/klp-ui/src/views/wms/purchasePlan/panels/detail.vue @@ -129,7 +129,7 @@ - + @@ -138,7 +138,7 @@ - + @@ -163,11 +163,13 @@ import { listPurchasePlanDetail, getPurchasePlanDetail, delPurchasePlanDetail, addPurchasePlanDetail, updatePurchasePlanDetail } from "@/api/wms/purchasePlanDetail"; import { EPurchaseDetailStatus } from "@/utils/enums"; import StockInDialog from "./stockin.vue"; +import RawMaterialSelect from '@/components/KLPService/RawMaterialSelect'; export default { name: "PurchasePlanDetail", components: { - StockInDialog + StockInDialog, + RawMaterialSelect }, props: { planId: { @@ -411,6 +413,11 @@ export default { this.getList(); this.stockInVisible = false; this.selectedArrivalItems = []; // 清空选中的明细 + }, + onRawMaterialChange(rawMaterial) { + if (rawMaterial && rawMaterial.unit) { + this.form.unit = rawMaterial.unit; + } } } }; diff --git a/klp-ui/src/views/wms/stockIo/panels/detail.vue b/klp-ui/src/views/wms/stockIo/panels/detail.vue index e2edb401..ab873457 100644 --- a/klp-ui/src/views/wms/stockIo/panels/detail.vue +++ b/klp-ui/src/views/wms/stockIo/panels/detail.vue @@ -70,7 +70,6 @@ - - + + + @@ -155,9 +158,9 @@ - - - + + @@ -165,11 +168,13 @@ v-if="form.itemType === ITEM_TYPE.RAW_MATERIAL" v-model="form.itemId" placeholder="请选择原材料" + @change="onItemChange" /> - + @@ -217,6 +222,7 @@ export default { RawMaterialSelect, ProductSelect }, + dicts: ['stock_item_type'], props: { stockIo: { type: Object, @@ -260,7 +266,8 @@ export default { single: true, multiple: true, statusLoading: false, // 新增状态修改按钮加载状态 - cancelLoading: false // 撤回按钮加载状态 + cancelLoading: false, // 撤回按钮加载状态 + unitDisabled: false // 新增:单位输入框是否禁用 }; }, watch: { @@ -405,6 +412,7 @@ export default { batchNo: undefined, remark: undefined }; + this.unitDisabled = false; // 新增:重置单位输入框为可编辑 this.resetForm("form"); }, cancel() { @@ -526,6 +534,12 @@ export default { if (type === 'return') return 'warning'; if (type === 'relocation') return 'info'; return 'default'; + }, + onItemChange(e) { + if (e && e.unit) { + this.form.unit = e.unit; + this.unitDisabled = true; + } } } }