diff --git a/klp-ui/src/api/wms/coil.js b/klp-ui/src/api/wms/coil.js index e7183df8..c3d6f25f 100644 --- a/klp-ui/src/api/wms/coil.js +++ b/klp-ui/src/api/wms/coil.js @@ -423,4 +423,16 @@ export function fixMismatchedItemCoil(coilId) { coilId } }) -} \ No newline at end of file +} + +/** + * 带有改判记录的钢卷列表 + */ +export function listWithAdjustRecordCoil(params) { + return request({ + url: '/wms/materialCoil/listWithRejudge', + method: 'get', + timeout: 600000, + params + }) +} diff --git a/klp-ui/src/views/crm/components/OrderObjection.vue b/klp-ui/src/views/crm/components/OrderObjection.vue index 55308037..d5dde8a1 100644 --- a/klp-ui/src/views/crm/components/OrderObjection.vue +++ b/klp-ui/src/views/crm/components/OrderObjection.vue @@ -27,7 +27,11 @@ - + + + - + + + @@ -276,13 +254,9 @@ import { partialPurchaseOrder, completePurchaseOrder, cancelPurchaseOrder, - listPurchaseOrderItem, - addPurchaseOrderItem, - updatePurchaseOrderItem, - delPurchaseOrderItem, - listSupplier, - listSupplierPrice + listSupplier } from '@/api/erp/purchase' +import WarehouseSelect from "@/components/KLPService/WarehouseSelect/index.vue" export default { name: 'ErpPurchaseOrder', @@ -298,26 +272,13 @@ export default { orderCode: [{ required: true, message: '请输入订单编号', trigger: 'blur' }], supplierId: [{ required: true, message: '请选择供应商', trigger: 'change' }] }, - itemDialog: { visible: false, title: '订单明细' }, - itemQuery: { pageNum: 1, pageSize: 10, orderId: null }, - itemList: [], - itemTotal: 0, - itemLoading: false, - itemFormDialog: { visible: false, title: '', form: {} }, - itemRules: { - orderId: [{ required: true, message: '请输入订单ID', trigger: 'blur' }], - materialTypeCode: [{ required: true, message: '请输入物料类型', trigger: 'blur' }], - quantity: [{ required: true, message: '请输入数量', trigger: 'blur' }] - }, supplierOptions: [], - supplierLoading: false, - dialogItems: [], - dialogItemLoading: false, - supplierGoods: [], - goodsLoading: false, - selectedSupplierGood: null + supplierLoading: false } }, + components: { + WarehouseSelect, + }, created() { this.loadOrders() // 默认加载一批供应商作为下拉初始选项 @@ -368,24 +329,36 @@ export default { if (row) { this.orderDialog.form = { ...row } this.orderDialog.title = '编辑采购订单' - this.loadDialogItems(row.orderId) - if (row.supplierId) { - this.handleSupplierChange(row.supplierId) - } } else { - this.orderDialog.form = { orderCode: '', supplierId: '', orderDate: '', orderStatus: 0 } + this.orderDialog.form = { + orderCode: '', + supplierId: '', + orderDate: '', + orderStatus: 0, + billType: '', + receiveType: '', + deptName: '', + salesman: '', + maker: '', + auditor: '', + bookkeeper: '', + auditDate: '', + totalAmount: 0, + supplyUnitId: null, + stockCode: '', + stockName: '', + specModel: '', + mainUnit: '', + stockQuantity: '', + warehouseId: null, + remark: '' + } this.orderDialog.title = '新增采购订单' - this.dialogItems = [] - this.supplierGoods = [] - this.selectedSupplierGood = null } this.orderDialog.visible = true this.$nextTick(() => this.$refs.orderForm && this.$refs.orderForm.clearValidate()) }, closeOrderDialog() { - this.dialogItems = [] - this.supplierGoods = [] - this.selectedSupplierGood = null }, submitOrder() { this.$refs.orderForm.validate(valid => { @@ -394,7 +367,6 @@ export default { api(this.orderDialog.form).then(() => { this.$message.success('保存成功') this.orderDialog.visible = false - this.closeOrderDialog() this.loadOrders() }) }) @@ -450,134 +422,6 @@ export default { 4: 'danger' } return map[status] || 'info' - }, - openItemDialog() { - this.itemDialog.visible = true - this.loadItems() - }, - loadItems() { - this.itemLoading = true - listPurchaseOrderItem(this.itemQuery) - .then(res => { - this.itemList = res.rows || [] - this.itemTotal = res.total || 0 - }) - .finally(() => { - this.itemLoading = false - }) - }, - resetItemQuery() { - this.itemQuery = { pageNum: 1, pageSize: 10, orderId: null } - this.loadItems() - }, - openItemForm(row, preset = {}) { - if (row) { - this.itemFormDialog.form = { ...row } - this.itemFormDialog.title = '编辑明细' - } else { - const targetOrderId = preset.orderId || this.orderDialog.form.orderId || '' - if (!targetOrderId) { - this.$message.warning('请先保存订单,再新增物料') - return - } - this.itemFormDialog.form = { - orderId: targetOrderId, - materialTypeCode: preset.materialTypeCode || '', - specification: preset.specification || '', - quantity: preset.quantity || 0, - unitPrice: preset.unitPrice || 0, - remark: preset.remark || '' - } - this.itemFormDialog.title = '新增明细' - } - this.itemFormDialog.visible = true - this.$nextTick(() => this.$refs.itemForm && this.$refs.itemForm.clearValidate()) - }, - submitItem() { - this.$refs.itemForm.validate(valid => { - if (!valid) return - const api = this.itemFormDialog.form.itemId ? updatePurchaseOrderItem : addPurchaseOrderItem - api(this.itemFormDialog.form).then(() => { - this.$message.success('保存成功') - this.itemFormDialog.visible = false - this.loadItems() - if (this.orderDialog.form.orderId) { - this.loadDialogItems(this.orderDialog.form.orderId) - } - }) - }) - }, - handleDeleteItem(row) { - this.$confirm('确定删除该明细吗?', '提示').then(() => { - return delPurchaseOrderItem(row.itemId) - }).then(() => { - this.$message.success('删除成功') - this.loadItems() - if (this.orderDialog.form.orderId) { - this.loadDialogItems(this.orderDialog.form.orderId) - } - }) - }, - async loadDialogItems(orderId) { - if (!orderId) { - this.dialogItems = [] - return - } - this.dialogItemLoading = true - try { - const res = await listPurchaseOrderItem({ pageNum: 1, pageSize: 100, orderId }) - this.dialogItems = res.rows || [] - } finally { - this.dialogItemLoading = false - } - }, - handleSupplierChange(val) { - if (!val) { - this.supplierGoods = [] - this.selectedSupplierGood = null - return - } - this.selectedSupplierGood = null - this.loadSupplierGoods(val) - }, - ensureSupplierGoods() { - if (!this.orderDialog.form.supplierId || this.supplierGoods.length || this.goodsLoading) return - this.loadSupplierGoods(this.orderDialog.form.supplierId) - }, - async loadSupplierGoods(supplierId) { - if (!supplierId) return - this.goodsLoading = true - try { - const res = await listSupplierPrice({ pageNum: 1, pageSize: 50, supplierId }) - this.supplierGoods = res.rows || [] - } finally { - this.goodsLoading = false - } - }, - handleSelectGoods(code) { - if (!code) return - if (!this.orderDialog.form.orderId) { - this.$message.warning('请先保存订单,再添加物料') - this.selectedSupplierGood = null - return - } - const good = this.supplierGoods.find(item => item.materialTypeCode === code) - if (!good) return - this.openItemForm(null, { - orderId: this.orderDialog.form.orderId, - materialTypeCode: good.materialTypeCode, - specification: good.specification, - unitPrice: good.price || 0 - }) - this.$nextTick(() => { - this.selectedSupplierGood = null - }) - }, - formatGoodLabel(good) { - if (!good) return '' - const spec = good.specification ? ` / ${good.specification}` : '' - const price = good.price != null ? ` · ¥${good.price}` : '' - return `${good.materialTypeCode}${spec}${price}` } } } @@ -619,11 +463,8 @@ export default { gap: 8px; } } -.danger { - color: #c0392b; -} .order-dialog ::v-deep .el-dialog { - max-width: 960px; + max-width: 1200px; } .contract-layout { display: flex; @@ -641,26 +482,6 @@ export default { font-size: 15px; color: #1f2d3d; margin-bottom: 12px; - display: flex; - align-items: center; - gap: 8px; - .subtitle { - font-size: 12px; - color: #9099a8; - } -} -.contract-card__toolbar { - display: flex; - gap: 12px; - align-items: center; - margin-bottom: 12px; - .toolbar-tip { - font-size: 12px; - color: #c97a1a; - } - .el-select { - max-width: 320px; - } } .contract-footer { text-align: right; diff --git a/klp-ui/src/views/erp/purchase/index.vue b/klp-ui/src/views/erp/purchase/index.vue deleted file mode 100644 index e0413db7..00000000 --- a/klp-ui/src/views/erp/purchase/index.vue +++ /dev/null @@ -1,765 +0,0 @@ - - - - - - diff --git a/klp-ui/src/views/wms/coil/panels/base.vue b/klp-ui/src/views/wms/coil/panels/base.vue index 63fc0641..d0a5df23 100644 --- a/klp-ui/src/views/wms/coil/panels/base.vue +++ b/klp-ui/src/views/wms/coil/panels/base.vue @@ -185,28 +185,8 @@ - - + + @@ -229,6 +211,7 @@ +