소스 검색

feat(purchase&sale order): 增加完结功能

liujt 1 개월 전
부모
커밋
fff02bebaf

+ 10 - 0
src/api/purchasingManage/purchaseOrder.js

@@ -172,3 +172,13 @@ export async function getExport(id) {
 
   download(res.data, '采购订单.xlsx');
 }
+
+
+// 更新状态
+export async function batchCompleted(data) {
+  const res = await request.patch(`/eom/purchaseorder/v1/batchCompleted`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 11 - 1
src/api/saleManage/saleorder.js

@@ -208,4 +208,14 @@ export async function saleOrderAdd(data) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
-}
+}
+
+// 更新状态
+export async function batchCompleted(data) {
+  const res = await request.patch(`/eom/saleorder/v1/batchCompleted`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+

+ 22 - 1
src/views/purchasingManage/purchaseOrder/index.vue

@@ -202,6 +202,17 @@
                   >
                     导出
                   </el-link>
+                  <el-link
+                    type="primary"
+                    :underline="false"
+                    @click="finish('single', row)"
+                    v-if="
+                      [2].includes(row.orderStatus) &&
+                      row.progress != 1000
+                    "
+                  >
+                    完结
+                  </el-link>
                 </template>
               </ele-pro-table>
             </div>
@@ -321,7 +332,8 @@ import outSourceSend from './outSourceSend/index';
 import {
   getTableList,
   deleteInformation,
-  getExport
+  getExport,
+  batchCompleted
 } from '@/api/purchasingManage/purchaseOrder';
 import dictMixins from '@/mixins/dictMixins';
 import { purchaseOrderProgressStatusEnum, reviewStatus } from '@/enum/dict';
@@ -768,6 +780,15 @@ export default {
       this.remove(dataId);
     },
 
+    finish(type, row) {
+      if (type == 'single') {
+        batchCompleted([row.id]).then((res) => {
+          this.$message.success(res.message);
+          this.reload();
+        }).catch((err) => {});
+      }
+    },
+
     //查看详情
     openorderDetail(row) {
       this.$refs.contactDetailDialogRef.open(row);

+ 21 - 1
src/views/saleManage/saleOrder/index.vue

@@ -261,6 +261,17 @@
                   >
                     催单
                   </el-link>
+                  <el-link
+                    type="primary"
+                    :underline="false"
+                    @click="finish('single', row)"
+                    v-if="
+                      [2].includes(row.orderStatus) &&
+                      row.progress != 1000
+                    "
+                  >
+                    完结
+                  </el-link>
                   <!-- <el-link
                     type="primary"
                     :underline="false"
@@ -439,7 +450,8 @@ import {
   getByRepeatBomAttribute,
   saveOrderBomList,
   updateOrderInfo,
-  saleOrderAdd
+  saleOrderAdd,
+  batchCompleted
 } from '@/api/saleManage/saleorder';
 import { getToDoReminder } from '@/api/common/index';
 import { exportSaleorder } from '@/api/system/file/index.js';
@@ -986,6 +998,14 @@ export default {
         })
         .catch((err) => {});
     },
+    finish(type, row) {
+      if (type == 'single') {
+        batchCompleted([row.id]).then((res) => {
+          this.$message.success(res.message);
+          this.reload();
+        }).catch((err) => {});
+      }
+    },
     //更多菜单
     handleCommand(command, row) {
       if (command === 'invoice') {