lxf 1 year ago
parent
commit
b8e6b6800c
1 changed files with 22 additions and 15 deletions
  1. 22 15
      src/views/production/operation/overclaim/index.vue

+ 22 - 15
src/views/production/operation/overclaim/index.vue

@@ -6,16 +6,16 @@
           <el-select-v2 v-model="formData.data.orderId" :options="productionOrder" placeholder="请选择订单号" @change="changeOrder()" style="width: 100%" filterable />
         </div>
       </template>
-      <template #productionCostList>
+      <template #productionExceedReceiveSkuList>
         <div style="width: 100%">
-          <el-table :data="formData.data.productionCostList" :row-style="{ height: '35px' }" header-row-class-name="tableHeader">
+          <el-table :data="formData.data.productionExceedReceiveSkuList" :row-style="{ height: '35px' }" header-row-class-name="tableHeader">
             <el-table-column label="SKU品号" prop="code" width="160" />
             <el-table-column label="SKU品名" prop="name" min-width="220" />
             <el-table-column label="BOM品号" prop="bomCode" width="160" />
             <el-table-column label="订单数量" prop="orderQuantity" width="120" />
             <el-table-column label="超领数量" width="160">
               <template #default="{ row, $index }">
-                <el-form-item :prop="'productionCostList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true" style="width: 100%">
+                <el-form-item :prop="'productionExceedReceiveSkuList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true" style="width: 100%">
                   <el-input-number
                     onmousewheel="return false;"
                     v-model="row.quantity"
@@ -45,7 +45,7 @@ import { ElMessage } from "element-plus";
 
 const { proxy } = getCurrentInstance();
 const productionOrder = ref([]);
-const exceedReceiveReasonList = ref([
+const typeList = ref([
   {
     dictKey: 1,
     dictValue: "制作损坏",
@@ -88,8 +88,8 @@ const formOption = reactive({
 const formData = reactive({
   data: {
     orderId: "",
-    exceedReceiveReason: "",
-    productionCostList: [],
+    type: "",
+    productionExceedReceiveSkuList: [],
   },
 });
 const formConfig = computed(() => {
@@ -104,25 +104,32 @@ const formConfig = computed(() => {
     {
       type: "select",
       label: "超领原因",
-      prop: "exceedReceiveReason",
-      data: exceedReceiveReasonList.value,
+      prop: "type",
+      data: typeList.value,
+      itemWidth: 51,
+    },
+    {
+      type: "input",
+      label: "责任人",
+      prop: "responsible",
       itemWidth: 51,
     },
     {
       type: "slot",
-      slotName: "productionCostList",
+      slotName: "productionExceedReceiveSkuList",
       label: "订单商品",
     },
   ];
 });
 const rules = ref({
   orderId: [{ required: true, message: "请选择订单号", trigger: "change" }],
-  exceedReceiveReason: [{ required: true, message: "请选择超领原因", trigger: "change" }],
+  type: [{ required: true, message: "请选择超领原因", trigger: "change" }],
   quantity: [{ required: true, message: "请输入超领数量", trigger: "blur" }],
+  responsible: [{ required: true, message: "请输入责任人", trigger: "blur" }],
 });
 const submitForm = () => {
   submit.value.handleSubmit(() => {
-    if (formData.data.productionCostList && formData.data.productionCostList.length > 0) {
+    if (formData.data.productionExceedReceiveSkuList && formData.data.productionExceedReceiveSkuList.length > 0) {
       proxy.post("/productionExceedReceive/exceedReceive", formData.data).then(() => {
         ElMessage({ message: "操作完成", type: "success" });
         clickCancel();
@@ -134,7 +141,7 @@ const submitForm = () => {
 };
 const clickCancel = () => {
   formData.data = {
-    productionCostList: [],
+    productionExceedReceiveSkuList: [],
   };
   submit.value.resetFields();
 };
@@ -142,7 +149,7 @@ const changeOrder = () => {
   if (formData.data.orderId) {
     proxy.post("/productionExceedReceive/getOrderSkuList", { id: formData.data.orderId }).then((res) => {
       if (res && res.length > 0) {
-        formData.data.productionCostList = res.map((item) => {
+        formData.data.productionExceedReceiveSkuList = res.map((item) => {
           return {
             bomSpecId: item.bomSpecId,
             name: item.name,
@@ -154,11 +161,11 @@ const changeOrder = () => {
           };
         });
       } else {
-        formData.data.productionCostList = [];
+        formData.data.productionExceedReceiveSkuList = [];
       }
     });
   } else {
-    formData.data.productionCostList = [];
+    formData.data.productionExceedReceiveSkuList = [];
   }
 };
 </script>