695593266@qq.com hai 7 meses
pai
achega
74244626ec

+ 151 - 38
src/views/beEntrusted/components/goodsDetail.vue

@@ -21,7 +21,7 @@
         <span>{{ row.quantity }}{{ row.measuringUnit }}</span>
       </template>
 
-      <template v-slot:receiveQuantity="{ row }">
+      <!-- <template v-slot:receiveQuantity="{ row }">
         <el-input
           placeholder=""
           v-model="row.receiveQuantity"
@@ -29,6 +29,11 @@
         >
           <template slot="append">{{ row.measuringUnit }}</template>
         </el-input>
+      </template> -->
+      <template v-slot:receiveQuantity="{ row }">
+        <el-input placeholder="" v-model="row.receiveQuantity" disabled>
+          <template slot="append">{{ row.measuringUnit }}</template>
+        </el-input>
       </template>
 
       <template v-slot:weight="{ row }">
@@ -52,6 +57,7 @@
       v-if="rejectDialogVisible"
       title="请输入驳回原因"
       width="30vw"
+      append-to-body
       :close-on-click-modal="false"
       :before-close="
         () => {
@@ -84,7 +90,7 @@
 
 <script>
   import { pleaseEntrustGoodsDetail } from '@/api/entrust';
-  import { confirmReceipt, receiveGoos } from '@/api/beEntrusted';
+  import { confirmReceipt, rejectGoods } from '@/api/beEntrusted';
   import { typeName } from '@/views/produce/components/common.js';
   export default {
     data() {
@@ -105,7 +111,8 @@
           reason: [
             { required: true, message: '请输入驳回原因', trigger: 'blur' }
           ]
-        }
+        },
+        itemData: {}
       };
     },
 
@@ -150,14 +157,14 @@
             showOverflowTooltip: true
           },
 
-          {
-            prop: 'quantity',
-            slot: 'quantity',
-            label: '数量',
-            align: 'center',
-            minWidth: 110,
-            showOverflowTooltip: true
-          },
+          // {
+          //   prop: 'quantity',
+          //   slot: 'quantity',
+          //   label: '数量',
+          //   align: 'center',
+          //   minWidth: 110,
+          //   showOverflowTooltip: true
+          // },
 
           {
             prop: 'receiveQuantity',
@@ -227,6 +234,7 @@
       open(item, type) {
         this.visible = true;
         this.id = item.id;
+        this.itemData = item;
         this.type = type;
         this.title = this.type != 'send' ? '收货单' : '发货单';
         this.getDetail(item.id);
@@ -249,34 +257,146 @@
         });
       },
 
+      // save() {
+      //   if (this.selection.length == 0) {
+      //     return this.$message.warning('请先选择一条收货数据!');
+      //   }
+
+      //   const selectionIds = new Set(this.selection.map((it) => it.id));
+
+      //   for (let item of this.goodsList) {
+      //     if (!selectionIds.has(item.id)) {
+      //       item.receiveQuantity = 0;
+      //     }
+      //   }
+
+      //   if (
+      //     Number(this.itemData.sendOutQuantity) <
+      //     Number(this.itemData.formingNum)
+      //   ) {
+      //     this.$confirm('收货数量小于请托数量是否继续收货?', '提示', {
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.loading = this.$loading({
+      //           lock: true,
+      //           text: '加载中',
+      //           background: 'rgba(0, 0, 0, 0.7)'
+      //         });
+      //         confirmReceipt(this.goodsList)
+      //           .then((res) => {
+      //             this.loading.close();
+      //             this.$message.success('收货成功');
+      //             this.$emit('done');
+      //             this.visible = false;
+      //           })
+      //           .catch(() => {
+      //             this.loading.close();
+      //           });
+      //       })
+      //       .catch(() => {});
+      //   } else if (
+      //     Number(this.itemData.sendOutQuantity) ==
+      //     Number(this.itemData.formingNum)
+      //   ) {
+      //     this.loading = this.$loading({
+      //       lock: true,
+      //       text: '加载中',
+      //       background: 'rgba(0, 0, 0, 0.7)'
+      //     });
+      //     confirmReceipt(this.goodsList)
+      //       .then((res) => {
+      //         this.loading.close();
+      //         this.$message.success('收货成功');
+      //         this.$emit('done');
+      //         this.visible = false;
+      //       })
+      //       .catch(() => {
+      //         this.loading.close();
+      //       });
+      //   } else if (
+      //     Number(this.itemData.sendOutQuantity) >
+      //     Number(this.itemData.formingNum)
+      //   ) {
+      //     this.$confirm('收货数量大于请托数量是否继续收货?', '提示', {
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.loading = this.$loading({
+      //           lock: true,
+      //           text: '加载中',
+      //           background: 'rgba(0, 0, 0, 0.7)'
+      //         });
+      //         confirmReceipt(this.goodsList)
+      //           .then((res) => {
+      //             this.loading.close();
+      //             this.$message.success('收货成功');
+      //             this.$emit('done');
+      //             this.visible = false;
+      //           })
+      //           .catch(() => {
+      //             this.loading.close();
+      //           });
+      //       })
+      //       .catch(() => {});
+      //   }
+      // },
+
       save() {
-        if (this.selection.length == 0) {
+        if (this.selection.length === 0) {
           return this.$message.warning('请先选择一条收货数据!');
         }
 
         const selectionIds = new Set(this.selection.map((it) => it.id));
-
-        for (let item of this.goodsList) {
+        this.goodsList.forEach((item) => {
           if (!selectionIds.has(item.id)) {
             item.receiveQuantity = 0;
           }
+        });
+
+        const totalNum = this.selection.reduce(
+          (total, pro) => total + Number(pro.receiveQuantity || 0),
+          0
+        );
+
+        const formingNum = Number(this.itemData.sendOutQuantity);
+
+        let confirmMessage = '';
+
+        console.log(totalNum, formingNum, '8888');
+
+        if (totalNum < formingNum) {
+          confirmMessage = '收货数量小于请托数量,是否继续收货?';
+        } else if (totalNum > formingNum) {
+          confirmMessage = '收货数量大于请托数量,是否继续收货?';
         }
 
-        this.loading = this.$loading({
-          lock: true,
-          text: '加载中',
-          background: 'rgba(0, 0, 0, 0.7)'
-        });
-        confirmReceipt(this.goodsList)
-          .then((res) => {
-            this.loading.close();
-            this.$message.success('收货成功');
-            this.$emit('done');
-            this.visible = false;
-          })
-          .catch(() => {
-            this.loading.close();
+        const doConfirmReceipt = () => {
+          this.loading = this.$loading({
+            lock: true,
+            text: '加载中',
+            background: 'rgba(0, 0, 0, 0.7)'
           });
+
+          confirmReceipt(this.goodsList)
+            .then(() => {
+              this.loading.close();
+              this.$message.success('收货成功');
+              this.$emit('done');
+              this.visible = false;
+            })
+            .catch(() => {
+              this.loading.close();
+            });
+        };
+
+        if (confirmMessage) {
+          this.$confirm(confirmMessage, '提示', { type: 'warning' })
+            .then(() => doConfirmReceipt())
+            .catch(() => {});
+        } else {
+          doConfirmReceipt();
+        }
       },
 
       cancel() {
@@ -296,7 +416,9 @@
                 return it.id;
               });
 
-              receiveGoos({
+              console.log('7777');
+
+              rejectGoods({
                 ids,
                 applyId: this.id,
                 beReason: this.rejectForm.reason
@@ -306,15 +428,6 @@
                 this.visible = false;
                 this.$emit('done');
               });
-              // rejectEntrust({
-              //   id: this.id,
-              //   reason: this.rejectForm.reason
-              // }).then(() => {
-              //   this.$message.success('驳回成功');
-              //   this.rejectDialogVisible = false;
-              //   this.visible = false;
-              //   this.$emit('done');
-              // });
             })
             .catch(() => {});
         });

+ 18 - 1
src/views/beEntrusted/index.vue

@@ -76,6 +76,12 @@
           <el-tag v-else-if="row.sendStatus == 4" type="success">{{
             '请托已收'
           }}</el-tag>
+          <el-tag v-else-if="row.sendStatus == 5" type="success">{{
+            '受托拒收'
+          }}</el-tag>
+          <el-tag v-else-if="row.sendStatus == 6" type="success">{{
+            '请托拒收'
+          }}</el-tag>
         </template>
 
         <template v-slot:approvalStatus="{ row }">
@@ -125,7 +131,11 @@
             type="primary"
             :underline="false"
             @click="receiveGoos(row, 'detail')"
-            v-if="row.approvalStatus == 2 && row.sendStatus != 1"
+            v-if="
+              row.approvalStatus == 2 &&
+              row.sendStatus != 1 &&
+              row.sendStatus != 5
+            "
           >
             收货详情
           </el-link>
@@ -407,6 +417,13 @@
             slot: 'changeType',
             width: 120
           },
+          {
+            prop: 'beReason',
+            label: '原因',
+            align: 'center',
+            slot: 'beReason',
+            width: 150
+          },
           {
             columnKey: 'action',
             label: '操作',

+ 4 - 4
src/views/entrust/components/goodsDetail.vue

@@ -54,7 +54,9 @@
 
     <template v-slot:footer v-if="type != 'detail' && itemData.sendStatus != 4">
       <el-button @click="cancel">取消</el-button>
-      <el-button @click="rejectReason" type="primary">驳回</el-button>
+      <el-button @click="rejectReason" type="primary" v-if="type == 'receipt'"
+        >驳回</el-button
+      >
       <el-button type="primary" @click="save"> 确定 </el-button>
     </template>
 
@@ -275,9 +277,7 @@
         });
       },
 
-      rejectReason() {
-
-      },
+      rejectReason() {},
 
       deepCopy(obj, hash = new WeakMap()) {
         if (obj === null) return null;

+ 19 - 2
src/views/entrust/index.vue

@@ -44,6 +44,12 @@
           <el-tag v-else-if="row.sendStatus == 4" type="success">{{
             '请托已收'
           }}</el-tag>
+          <el-tag v-else-if="row.sendStatus == 5" type="success">{{
+            '受托拒收'
+          }}</el-tag>
+          <el-tag v-else-if="row.sendStatus == 6" type="success">{{
+            '请托拒收'
+          }}</el-tag>
         </template>
 
         <template v-slot:approvalStatus="{ row }">
@@ -136,7 +142,7 @@
             @click="sendGoods(row, 'add')"
             v-if="
               row.approvalStatus == 2 &&
-              (row.sendStatus == 0 || !row.sendStatus)
+              (row.sendStatus == 0 || !row.sendStatus || row.sendStatus == 5)
             "
           >
             发货
@@ -165,7 +171,10 @@
             :underline="false"
             @click="sendGoods(row, 'detail')"
             v-if="
-              row.approvalStatus == 2 && row.sendStatus != 0 && row.sendStatus
+              row.approvalStatus == 2 &&
+              row.sendStatus != 0 &&
+              row.sendStatus &&
+              row.sendStatus != 5
             "
           >
             发货详情
@@ -494,6 +503,14 @@
             width: 100
           },
 
+          {
+            prop: 'beReason',
+            label: '原因',
+            align: 'center',
+            slot: 'beReason',
+            width: 150
+          },
+
           {
             columnKey: 'action',
             label: '操作',

+ 34 - 11
src/views/pick/pickApply/components/produceOrder-search.vue

@@ -9,8 +9,12 @@
     <el-row :gutter="15">
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <el-form-item label="工序名称:">
-  
-          <el-select size="mini"   @change="search" v-model="where.taskId"  filterable>
+          <el-select
+            size="mini"
+            @change="search"
+            v-model="where.taskId"
+            filterable
+          >
             <el-option
               v-for="(item, index) in produceTaskList"
               :key="index"
@@ -21,6 +25,26 @@
         </el-form-item>
       </el-col>
 
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="产品名称:">
+          <el-input
+            clearable
+            v-model="where.productName"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="产品编码:">
+          <el-input
+            clearable
+            v-model="where.productCode"
+            placeholder="请输入"
+          />
+        </el-form-item>
+      </el-col>
+
       <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
         <el-form-item label-width="0px">
           <el-button
@@ -53,7 +77,8 @@
       // 默认表单数据
       const defaultWhere = {
         taskId: '',
-        code: ''
+        productCode: '',
+        productName: ''
       };
       return {
         // 表单数据
@@ -75,18 +100,16 @@
     methods: {
       getTaskList() {
         let params = {
-              pageNum: 1,
-              size: -1
-          }
+          pageNum: 1,
+          size: -1
+        };
         produceTask(params).then((res) => {
           this.produceTaskList = res.list;
-          this.where.taskId =  res.list[0].id
-
+          this.where.taskId = res.list[0].id;
 
-           if(this.where.taskId) {
+          if (this.where.taskId) {
             this.$emit('search', this.where);
-           }
-        
+          }
         });
       },