lucw před 9 měsíci
rodič
revize
656bd2a3cc

+ 11 - 0
src/api/materialPlan/index.js

@@ -21,6 +21,17 @@ export async function save(data) {
   return Promise.reject(new Error(res.data.message));
 }
 
+/**
+ * 保存并提交
+ */
+export async function saveAndSubmit(data) {
+  const res = await request.post('/aps/batchingplan/saveAndSubmit', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
 /**
  * 修改
  */

+ 25 - 13
src/views/materialPlan/components/plan-edit-dialog.vue

@@ -159,7 +159,7 @@
         </template>
 
         <!-- 展开内容 -->
-        <template v-slot:expand="{ row, $index }">
+        <template v-slot:expand="{ row }">
           <div class="batch-actions" v-if="row.materialList.length > 0">
             <el-button @click="batchUpdateDeliveryMethod"
               >批量修改到货方式</el-button
@@ -316,11 +316,14 @@
                 />
               </template>
 
-              <template v-slot:action="{ row,$index:idx }" v-if="type != 'detail'">
+              <template
+                v-slot:action="{ row, $index: idx }"
+                v-if="type != 'detail'"
+              >
                 <el-popconfirm
                   class="ele-action"
                   title="确定要删除当前物料吗?"
-                  @confirm="remove2(row,idx)"
+                  @confirm="remove2(row, idx)"
                 >
                   <template v-slot:reference>
                     <el-link
@@ -341,7 +344,10 @@
 
     <div slot="footer" v-if="type != 'detail'">
       <el-button @click="cancel">取消</el-button>
-      <el-button type="primary" @click="confirm">保存</el-button>
+      <el-button type="primary" @click="confirm('save')">保存</el-button>
+      <el-button type="primary" @click="confirm('submit')"
+        >保存并提交</el-button
+      >
     </div>
 
     <saleOrderPop ref="saleOrderRef" @chooseOrder="chooseOrder"></saleOrderPop>
@@ -419,6 +425,7 @@
     listBomByBomVersionId,
     listBomBySalesOrderId,
     save,
+    saveAndSubmit,
     getById,
     contactList
   } from '@/api/materialPlan/index';
@@ -952,7 +959,7 @@
         this.formData.detailRemoveIds.push(row.id);
         let _arr = this.$refs.table.getData() || [];
         _arr.splice(index, 1);
-        console.log(_arr,'_arr')
+        console.log(_arr, '_arr');
         this.$refs.table.setData([..._arr]);
       },
       chooseModal(data, current) {
@@ -982,16 +989,16 @@
         this.$forceUpdate();
       },
 
-      remove2(row,idx) {
-        console.log(idx,'idx 333');
+      remove2(row, idx) {
+        console.log(idx, 'idx 333');
         const data = this.$refs.table.getData() ?? [];
         this.formData.materialRemoveIds.push(row.id);
-        console.log(data,'data 1')
-        console.log(row,'row 1')
+        console.log(data, 'data 1');
+        console.log(row, 'row 1');
         data.forEach((e) => {
           if (row.detailId == e.id) {
             // e.materialList = e.materialList.filter((d) => d.id !== row.id);
-            e.materialList.splice(idx,1)
+            e.materialList.splice(idx, 1);
           }
         });
 
@@ -1182,7 +1189,7 @@
 
         this.$refs.table.setData([...tableList]);
       },
-      confirm() {
+      confirm(type) {
         this.$refs.formRef.validate(async (value) => {
           if (value) {
             let _arr = this.$refs.table.getData() ?? [];
@@ -1213,8 +1220,13 @@
             this.formData['type'] = 1;
             this.formData['salesOrderList'] = _arr2;
             this.formData.baitingType = 2;
-            await save(this.formData);
-            this.$message.success('保存成功!');
+            if (type == 'submit') {
+              await saveAndSubmit(this.formData);
+              this.$message.success('保存并提交成功!');
+            } else {
+              await save(this.formData);
+              this.$message.success('保存成功!');
+            }
             this.$emit('success');
             this.cancel();
           }

+ 2 - 2
vue.config.js

@@ -35,10 +35,10 @@ module.exports = {
         // target: 'http://192.168.1.103:18086',
         // target: 'http://192.168.1.158:18086',
         // target: 'http://192.168.158:18086',
-        // target: 'http://192.168.1.251:18086',
+        target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.144:18086',
         // target: 'http://192.168.1.211:18086',
-        target: 'http://192.168.1.251:18186',
+        // target: 'http://192.168.1.251:18186',
 
         // target: 'http://192.168.1.125:18086',