Browse Source

供应商所有履约单发货

jiandexin1 1 year ago
parent
commit
fb2ee88279
2 changed files with 32 additions and 6 deletions
  1. 10 0
      src/api/distribution/storeappoint.js
  2. 22 6
      src/views/store/storeappoint/index.vue

+ 10 - 0
src/api/distribution/storeappoint.js

@@ -58,6 +58,16 @@ export const shipments = (ids) => {
   })
 }
 
+export const shipmentsAll = (grouponId) => {
+  return request({
+    url: '/api/distribution/appoint/shipmnetsALl',
+    method: 'post',
+    params: {
+      grouponId,
+    }
+  })
+}
+
 export const goodsList = (current, size, arrivalCode) => {
   return request({
     url: '/api/finance/appointgoods/storeAppointGoodsList',

+ 22 - 6
src/views/store/storeappoint/index.vue

@@ -28,8 +28,9 @@
       </template>
       <template slot-scope="scope" slot="menu">
         <el-button type="text"
+                   v-if="scope.row.appointState == 0"
                    size="small"
-                   @click="goodsListView(scope.row.arrivalCode)">确认发货</el-button>
+                   @click="shipmnetsALl(scope.row.grouponId)">确认发货</el-button>
         <el-button type="text"
                    size="small"
                    @click="goodsListView(scope.row.arrivalCode)">查看详情</el-button>
@@ -67,7 +68,7 @@
 </template>
 
 <script>
-  import {getList, getDetail, add, update, shipments, goodsList} from "@/api/distribution/storeappoint";
+  import {getList, getDetail, add, update, shipments, goodsList, shipmentsAll} from "@/api/distribution/storeappoint";
   import {mapGetters} from "vuex";
   import {appointGoodsOption} from "../../../option/mall/appointGoodsOption"
 
@@ -94,9 +95,6 @@
         selectionList: [],
         appointGoodsOption,
         option: {
-          selectable:(row,index)=>{
-            return row.state === 0;
-          },
           height:'auto',
           calcHeight: 30,
           addBtn: false,
@@ -108,7 +106,7 @@
           editBtn: false,
           viewBtn: false,
           delBtn: false,
-          selection: true,
+          selection: false,
           searchSpan: 5,
           dialogClickModal: false,
           column: [
@@ -240,6 +238,24 @@
             this.$refs.crud.toggleSelection();
           });
       },
+      shipmnetsALl(grouponId){
+        this.$confirm("确定将这个团的所有履约单进行发货么?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        })
+            .then(() => {
+              return shipmentsAll(grouponId);
+            })
+            .then(() => {
+              this.onLoad(this.page);
+              this.$message({
+                type: "success",
+                message: "操作成功!"
+              });
+              this.$refs.crud.toggleSelection();
+            });
+      },
       beforeOpen(done, type) {
         if (["edit", "view"].includes(type)) {
           getDetail(this.form.id).then(res => {