@@ -686,7 +725,7 @@ import Receive from './receive.vue';
import { listSalesman } from "@/api/oms/salesman";
import { listShippingOrder, addShippingOrder, delShippingOrder } from "@/api/oms/shippingOrder";
import { listOrderDetail, addOrderDetail, updateOrderDetail } from "@/api/oms/orderDetail";
-import { listProductBase } from "@/api/mat/product";
+import { listProductBase, addProduct } from "@/api/mat/product";
import { sumStockQuantityByItemIds } from "@/api/wms/stock";
import { listReceivable } from "@/api/finance/receivable";
import { listOrderProduction, initOrderProduction, updateOrderProduction } from "@/api/oms/orderProduction";
@@ -830,6 +869,15 @@ export default {
model: "",
remark: ""
},
+ productQuickAddOpen: false,
+ productQuickAddLoading: false,
+ productQuickAddForm: {
+ productName: "",
+ spec: "",
+ model: "",
+ unitPrice: 0,
+ remark: ""
+ },
productionLoading: false,
productionInitLoading: false,
productionOnlyProduct: true,
@@ -1696,6 +1744,57 @@ export default {
});
},
+ openQuickAddProduct() {
+ this.productQuickAddForm = {
+ productName: "",
+ spec: "",
+ model: "",
+ unitPrice: 0,
+ remark: ""
+ };
+ this.productQuickAddOpen = true;
+ },
+
+ submitQuickAddProduct() {
+ const name = this.productQuickAddForm && this.productQuickAddForm.productName != null
+ ? String(this.productQuickAddForm.productName).trim()
+ : "";
+ if (!name) {
+ this.$modal.msgError("请输入成品名称");
+ return;
+ }
+ this.productQuickAddLoading = true;
+ const payload = {
+ productName: name,
+ spec: this.productQuickAddForm.spec != null ? String(this.productQuickAddForm.spec).trim() : "",
+ model: this.productQuickAddForm.model != null ? String(this.productQuickAddForm.model).trim() : "",
+ unitPrice: this.productQuickAddForm.unitPrice != null ? this.productQuickAddForm.unitPrice : 0,
+ remark: this.productQuickAddForm.remark != null ? String(this.productQuickAddForm.remark).trim() : "",
+ productType: "product"
+ };
+ addProduct(payload).then(() => {
+ this.$modal.msgSuccess("已新增成品");
+ this.productQuickAddOpen = false;
+ return listProductBase({ pageNum: 1, pageSize: 9999, productType: "product" });
+ }).then(res => {
+ this.productBaseOptions = (res && res.rows) ? res.rows : [];
+ const list = Array.isArray(this.productBaseOptions) ? this.productBaseOptions : [];
+ const hit = list.find(p => {
+ if (!p) return false;
+ const n = p.productName != null ? String(p.productName).trim() : "";
+ const s = p.spec != null ? String(p.spec).trim() : "";
+ const m = p.model != null ? String(p.model).trim() : "";
+ return n === payload.productName && s === payload.spec && m === payload.model;
+ });
+ if (hit && hit.productId != null) {
+ this.orderDetailAddForm.productId = hit.productId;
+ this.handleOrderDetailProductPicked(hit.productId);
+ }
+ }).finally(() => {
+ this.productQuickAddLoading = false;
+ });
+ },
+
/** 订单明细:选中产品后自动带出单位/单价(不涉及库存) */
handleOrderDetailProductPicked(productId) {
const list = Array.isArray(this.productBaseOptions) ? this.productBaseOptions : [];
diff --git a/gear-ui3/src/views/oms/order/panels/return.vue b/gear-ui3/src/views/oms/order/panels/return.vue
index d6dd8a2..80e0020 100644
--- a/gear-ui3/src/views/oms/order/panels/return.vue
+++ b/gear-ui3/src/views/oms/order/panels/return.vue
@@ -68,12 +68,32 @@
-
-
-
+
+
+
+
+
+ {{ item.productName || '-' }}
+
+
+ {{ item.productCode || '-' }}
+
+
+
+ {{ (item.spec || '-') + (item.model ? (' / ' + item.model) : '') }}
+
+
+
+
+
@@ -100,8 +120,8 @@