Explorar o código

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-mes into dev

lucw hai 8 meses
pai
achega
e2a761729a

+ 19 - 1
src/api/produce/index.js

@@ -160,7 +160,7 @@ export async function juRenPrint(data) {
   return Promise.reject(new Error(res.data.message));
 }
 
-//判断是否是仁环境
+//判断是否是仁环境
 export async function isJuRen(data) {
   const res = await request.get(`/pda/mes/us/printStyle`, {
     params: data
@@ -178,3 +178,21 @@ export async function pleaseEntrustManagement(data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+//检查是否重复领料
+export async function checkRepeatPick(data) {
+  const res = await request.post(`/mes/workorder/pickCheck`, data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+//检查是否重复投料
+export async function checkRepeatFeed(data) {
+  const res = await request.post(`/mes/workorder/feedCheck`, data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 4 - 1
src/views/byProduct/components/byProduct-search.vue

@@ -108,7 +108,10 @@
     },
     methods: {
       getTaskList() {
-        produceTask().then((res) => {
+        produceTask({
+          pageNum: 1,
+          size: -1
+        }).then((res) => {
           this.produceTaskList = res.list;
           this.where.taskId = res.list[0].id;
 

+ 14 - 0
src/views/produce/components/feeding/components/batchProductsBom.vue

@@ -242,6 +242,20 @@
             align: 'center',
             showOverflowTooltip: true
           },
+          {
+            minWidth: 120,
+            prop: 'rework',
+            label: '标识',
+            align: 'center',
+            showOverflowTooltip: true,
+            formatter: (row) => {
+              return row.rework == '1'
+                ? '返工'
+                : row.rework == '2'
+                ? '返修'
+                : '';
+            }
+          },
           action
           // {
           //   columnKey: 'action',

+ 31 - 0
src/views/produce/components/feeding/components/workOrderBom.vue

@@ -117,6 +117,18 @@
             }}</div>
           </div>
         </div>
+
+        <div class="item rx-sc" v-if="isReportWork">
+          <div class="rx ww100">
+            <div class="lable rx-cc">生产要求</div>
+            <div class="content">
+              <el-input
+                :disabled="isDetails"
+                v-model="item.productionRequirements"
+              ></el-input>
+            </div>
+          </div>
+        </div>
       </div>
     </div>
   </div>
@@ -133,6 +145,10 @@
       isDetails: {
         type: Boolean,
         default: false
+      },
+      isReportWork: {
+        type: Boolean,
+        default: false
       }
     },
 
@@ -235,6 +251,10 @@
         }
       }
 
+      .ww100 {
+        width: 100%;
+      }
+
       .ww55 {
         width: 55%;
       }
@@ -284,4 +304,15 @@
       }
     }
   }
+
+  .requirement {
+    .content {
+      width: 39vw !important;
+    }
+  }
+
+  ::v-deep .el-input--medium .el-input__inner {
+    height: 28px !important;
+    line-height: 28px !important;
+  }
 </style>

+ 1 - 1
src/views/produce/components/feeding/details.vue

@@ -30,7 +30,7 @@
         </div>
 
         <div v-for="(it, idx) in item.orderInfoList" :key="idx">
-          <workOrderBom :item="it" :isDetails="true"></workOrderBom>
+          <workOrderBom :item="it" :isDetails="true" :isReportWork="false"></workOrderBom>
 
           <paramBom
             v-if="it.paramDetailList.length != 0"

+ 72 - 3
src/views/produce/components/feeding/index.vue

@@ -66,6 +66,7 @@
 
           <workOrderBom
             :item="item"
+            :isReportWork="false"
             v-if="!taskObj.isOrderListData"
           ></workOrderBom>
 
@@ -267,6 +268,8 @@
     removeCache
   } from '@/api/produce/feeding';
 
+  import { checkRepeatFeed } from '@/api/produce/index';
+
   import pickingList from '../picking/pickingList.vue';
   import packingBom from './components/packingBom.vue';
   import workOrderBom from './components/workOrderBom.vue';
@@ -817,10 +820,55 @@
           text: '加载中',
           background: 'rgba(0, 0, 0, 0.7)'
         });
-        // this.loadingBtn = true;
+
+        for (let item of this.List) {
+          await checkRepeatFeed({
+            currentTaskDiagram: item.currentTaskDiagram,
+            workOrderId: item.workOrderId
+          }).then((res) => {
+            if (res.data == 0) {
+              this.feedReport();
+            } else {
+              this.$confirm('已经有投料是否继续重复投料?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+              })
+                .then(() => {
+                  this.feedReport();
+                })
+                .catch(() => {
+                  this.loading.close();
+                });
+            }
+            // const totalNum = Number(item.formingNum);
+            // const reportNum = this.add(
+            //   item.workReportInfo.notFormedNum,
+            //   item.workReportInfo.formedNum
+            // );
+            // const totalReportNum = this.add(reportNum, Number(res));
+            // if (totalReportNum > totalNum) {
+            //   this.$confirm('报工数量大于生产数量, 是否继续报工?', '提示', {
+            //     confirmButtonText: '确定',
+            //     cancelButtonText: '取消',
+            //     type: 'warning'
+            //   })
+            //     .then(() => {
+            //       this.feedReport();
+            //     })
+            //     .catch(() => {
+            //       this.loading.close();
+            //     });
+            // } else {
+            //   this.feedReport();
+            // }
+          });
+        }
+      },
+
+      feedReport() {
         batchSave(this.List)
           .then((res) => {
-            // this.loadingBtn = false;
             this.loading.close();
             this.$message.success('投料成功');
             this.getList(this.idsList);
@@ -831,10 +879,31 @@
           })
           .catch((e) => {
             this.loading.close();
-            // this.loadingBtn = false;
           });
       },
 
+      toInteger(num) {
+        const len = this.getDecimalLength(num);
+        return {
+          int: Math.round(num * Math.pow(10, len)),
+          factor: Math.pow(10, len)
+        };
+      },
+
+      add(a, b) {
+        const { int: aInt, factor: aFactor } = this.toInteger(a);
+        const { int: bInt, factor: bFactor } = this.toInteger(b);
+        const maxFactor = Math.max(aFactor, bFactor);
+        return (
+          (aInt * (maxFactor / aFactor) + bInt * (maxFactor / bFactor)) /
+          maxFactor
+        );
+      },
+
+      getDecimalLength(num) {
+        return (num.toString().split('.')[1] || '').length;
+      },
+
       checkCache(type, index) {
         return new Promise((resolve) => {
           if (type == 1) {

+ 14 - 0
src/views/produce/components/jobBooking/components/batchSemiProductJobBom.vue

@@ -1086,6 +1086,20 @@
                 : '否';
             }
           },
+          {
+            minWidth: 120,
+            prop: 'rework',
+            label: '标识',
+            align: 'center',
+            showOverflowTooltip: true,
+            formatter: (row) => {
+              return row.rework == '1'
+                ? '返工'
+                : row.rework == '2'
+                ? '返修'
+                : '';
+            }
+          },
           {
             columnKey: 'action',
             label: '操作',

+ 14 - 0
src/views/produce/components/jobBooking/components/semiProductJobBom.vue

@@ -944,6 +944,20 @@
             align: 'center',
             showOverflowTooltip: true
           },
+          {
+            minWidth: 120,
+            prop: 'rework',
+            label: '标识',
+            align: 'center',
+            showOverflowTooltip: true,
+            formatter: (row) => {
+              return row.rework == '1'
+                ? '返工'
+                : row.rework == '2'
+                ? '返修'
+                : '';
+            }
+          },
           {
             columnKey: 'action',
             label: '操作',

+ 1 - 0
src/views/produce/components/jobBooking/details.vue

@@ -68,6 +68,7 @@
             :item="objData"
             v-if="objData"
             :isDetails="true"
+            :isReportWork="true"
           ></workOrderBom>
           <jobBom
             :item="objData"

+ 110 - 86
src/views/produce/components/jobBooking/index.vue

@@ -59,8 +59,9 @@
         class="card_box"
         v-if="isLoad"
       >
-        <div class="title_box rx-bc" v-if="!taskObj.isOrderListData">
-          <div class="name">工单信息 </div>
+        <div class="title_box rx-bc">
+          <div class="name" v-if="!taskObj.isOrderListData">工单信息 </div>
+          <div class="name" v-else> </div>
 
           <div class="rx-bc">
             <el-button
@@ -88,6 +89,7 @@
 
         <workOrderBom
           :item="item"
+          :isReportWork="true"
           v-if="!taskObj.isOrderListData"
         ></workOrderBom>
 
@@ -1703,91 +1705,94 @@
         }
 
         for (let item of this.List) {
-          if (item.currentTaskDiagram.isFirstTask == '1') {
-            await checkReportNumber({
-              currentTaskDiagram: item.currentTaskDiagram,
-              workOrderId: item.workOrderId
-            }).then((res) => {
-              const totalNum = Number(item.formingNum);
-              const reportNum = this.add(
-                item.workReportInfo.notFormedNum,
-                item.workReportInfo.formedNum
-              );
-              const totalReportNum = this.add(reportNum, Number(res));
-              if (totalReportNum > totalNum) {
-                this.$confirm('报工数量大于生产数量, 是否继续报工?', '提示', {
-                  confirmButtonText: '确定',
-                  cancelButtonText: '取消',
-                  type: 'warning'
-                })
-                  .then(() => {
-                    // this.$message({
-                    //   type: 'success',
-                    //   message: '删除成功!'
-                    // });
-                    // return true;
-                    this.loadingBtn = true;
-                    jobSave(this.List)
-                      .then((res) => {
-                        this.loadingBtn = false;
-                        this.loading.close();
-                        this.$message.success('报工成功');
-                        this.checked = false;
-                        this.executorIdList = [];
-                        this.teamId = '';
-                        this.getList(this.idsList);
-                        this.$emit('jobSuccess', 'Success');
-                      })
-                      .catch(() => {
-                        this.loadingBtn = false;
-                        this.loading.close();
-                      });
-                  })
-                  .catch(() => {
-                    this.loading.close();
-                    // this.$message({
-                    //   type: 'info',
-                    //   message: '已取消删除'
-                    // });
-                    // return false;
-                  });
-              } else {
-                this.loadingBtn = true;
-                jobSave(this.List)
-                  .then((res) => {
-                    this.loadingBtn = false;
-                    this.loading.close();
-                    this.$message.success('报工成功');
-                    this.checked = false;
-                    this.executorIdList = [];
-                    this.teamId = '';
-                    this.getList(this.idsList);
-                    this.$emit('jobSuccess', 'Success');
-                  })
-                  .catch(() => {
-                    this.loadingBtn = false;
-                    this.loading.close();
-                  });
-              }
-            });
-          } else {
-            this.loadingBtn = true;
-            jobSave(this.List)
-              .then((res) => {
-                this.loadingBtn = false;
-                this.loading.close();
-                this.$message.success('报工成功');
-                this.checked = false;
-                this.executorIdList = [];
-                this.teamId = '';
-                this.getList(this.idsList);
-                this.$emit('jobSuccess', 'Success');
+          // if (item.currentTaskDiagram.isFirstTask == '1') {
+          await checkReportNumber({
+            currentTaskDiagram: item.currentTaskDiagram,
+            workOrderId: item.workOrderId
+          }).then((res) => {
+            const totalNum = Number(item.formingNum);
+            const reportNum = this.add(
+              item.workReportInfo.notFormedNum,
+              item.workReportInfo.formedNum
+            );
+            const totalReportNum = this.add(reportNum, Number(res));
+            if (totalReportNum > totalNum) {
+              this.$confirm('报工数量大于生产数量, 是否继续报工?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
               })
-              .catch(() => {
-                this.loadingBtn = false;
-                this.loading.close();
-              });
-          }
+                .then(() => {
+                  // this.$message({
+                  //   type: 'success',
+                  //   message: '删除成功!'
+                  // });
+                  // return true;
+                  // this.loadingBtn = true;
+                  // jobSave(this.List)
+                  //   .then((res) => {
+                  //     this.loadingBtn = false;
+                  //     this.loading.close();
+                  //     this.$message.success('报工成功');
+                  //     this.checked = false;
+                  //     this.executorIdList = [];
+                  //     this.teamId = '';
+                  //     this.getList(this.idsList);
+                  //     this.$emit('jobSuccess', 'Success');
+                  //   })
+                  //   .catch(() => {
+                  //     this.loadingBtn = false;
+                  //     this.loading.close();
+                  //   });
+                  this.jobBookReport();
+                })
+                .catch(() => {
+                  this.loading.close();
+                  // this.$message({
+                  //   type: 'info',
+                  //   message: '已取消删除'
+                  // });
+                  // return false;
+                });
+            } else {
+              this.jobBookReport();
+              // this.loadingBtn = true;
+              // jobSave(this.List)
+              //   .then((res) => {
+              //     this.loadingBtn = false;
+              //     this.loading.close();
+              //     this.$message.success('报工成功');
+              //     this.checked = false;
+              //     this.executorIdList = [];
+              //     this.teamId = '';
+              //     this.getList(this.idsList);
+              //     this.$emit('jobSuccess', 'Success');
+              //   })
+              //   .catch(() => {
+              //     this.loadingBtn = false;
+              //     this.loading.close();
+              //   });
+            }
+          });
+          // } else {
+          //   this.jobBookReport();
+          //   // this.loadingBtn = true;
+          //   // jobSave(this.List)
+          //   //   .then((res) => {
+          //   //     this.loadingBtn = false;
+          //   //     this.loading.close();
+          //   //     this.$message.success('报工成功');
+          //   //     this.checked = false;
+          //   //     this.executorIdList = [];
+          //   //     this.teamId = '';
+          //   //     this.getList(this.idsList);
+          //   //     this.$emit('jobSuccess', 'Success');
+          //   //   })
+          //   //   .catch(() => {
+          //   //     this.loadingBtn = false;
+          //   //     this.loading.close();
+          //   //   });
+          // }
         }
 
         // this.loadingBtn = true;
@@ -1813,6 +1818,25 @@
         // });
       },
 
+      jobBookReport() {
+        this.loadingBtn = true;
+        jobSave(this.List)
+          .then((res) => {
+            this.loadingBtn = false;
+            this.loading.close();
+            this.$message.success('报工成功');
+            this.checked = false;
+            this.executorIdList = [];
+            this.teamId = '';
+            this.getList(this.idsList);
+            this.$emit('jobSuccess', 'Success');
+          })
+          .catch(() => {
+            this.loadingBtn = false;
+            this.loading.close();
+          });
+      },
+
       checkRecycle() {
         // this.loading.close();
 

+ 7 - 1
src/views/produce/components/routings.vue

@@ -50,6 +50,10 @@
               :curTaskObj="curTaskObj"
             ></jobDetails>
           </el-tab-pane>
+
+          <el-tab-pane label="生产明细">
+            <productionDetails :workOrderInfo="routeObj"></productionDetails>
+          </el-tab-pane>
         </el-tabs>
       </div>
     </ele-modal>
@@ -60,11 +64,13 @@
   import feedDetails from '../components/feeding/details.vue';
   import jobDetails from '../components/jobBooking/details.vue';
   import pickDetails from '../components/picking/details.vue';
+  import productionDetails from '@/views//workOrderList/components/productionDetails.vue';
   export default {
     components: {
       feedDetails,
       jobDetails,
-      pickDetails
+      pickDetails,
+      productionDetails
     },
     props: {
       routeObj: {

+ 26 - 2
src/views/produce/index.vue

@@ -389,7 +389,8 @@
     nextTask,
     singleListTask,
     pleaseEntrustManagement,
-    checkPleaseEntrust
+    checkPleaseEntrust,
+    checkRepeatPick
   } from '@/api/produce/index';
   import prenatalExamination from './components/prenatalExamination/index.vue';
   import { workorderPage2 } from '@/api/produce/workOrder.js';
@@ -1152,7 +1153,30 @@
         } else if (this.workListIds.length < 1) {
           return this.$message.warning('请选择工单!');
         }
-        this.pickingShow = true;
+
+        this.checkPick();
+
+        // this.pickingShow = true;
+      },
+
+      async checkPick() {
+        await checkRepeatPick({
+          workOrderId: this.workListIds[0]
+        }).then((res) => {
+          if (res.data == 0) {
+            this.pickingShow = true;
+          } else {
+            this.$confirm('已经有领料是否继续重复领料?', '提示', {
+              confirmButtonText: '确定',
+              cancelButtonText: '取消',
+              type: 'warning'
+            })
+              .then(() => {
+                this.pickingShow = true;
+              })
+              .catch(() => {});
+          }
+        });
       },
 
       // 关闭领料弹窗

+ 467 - 462
src/views/unacceptedProduct/detail.vue

@@ -251,497 +251,502 @@
 </template>
 
 <script>
-import OrderSearch from './components/detail-search.vue';
-import Edit from './components/edit.vue';
-import { getWarehouseLists } from '@/api/produce/index';
+  import OrderSearch from './components/detail-search.vue';
+  import Edit from './components/edit.vue';
+  import { getWarehouseLists } from '@/api/produce/index';
 
-import dictMixins from '@/mixins/dictMixins';
-import { unacceptedProductStatus } from '@/utils/util';
-import { deepClone } from '@/utils';
-import { disposeApi, refluxTask } from '@/api/unacceptedProduct';
+  import dictMixins from '@/mixins/dictMixins';
+  import { unacceptedProductStatus } from '@/utils/util';
+  import { deepClone } from '@/utils';
+  import { disposeApi, refluxTask } from '@/api/unacceptedProduct';
 
-import {
-  getDetail,
-  deleteUnacceptedProductDetail,
-  dispose,
-  getById
-} from '@/api/unacceptedProduct/index';
-export default {
-  components: {
-    OrderSearch,
-    Edit
-  },
-  mixins: [dictMixins],
-  data() {
-    return {
-      key: '',
-      warehouseList: [],
-      rules: {
-        disposeType: [
-          { required: true, message: '请选择处置方式', trigger: 'change' }
-        ],
-        depotId: [{ required: true, message: '请选择仓库', trigger: 'change' }],
+  import {
+    getDetail,
+    deleteUnacceptedProductDetail,
+    dispose,
+    getById
+  } from '@/api/unacceptedProduct/index';
+  export default {
+    components: {
+      OrderSearch,
+      Edit
+    },
+    mixins: [dictMixins],
+    data() {
+      return {
+        key: '',
+        warehouseList: [],
+        rules: {
+          disposeType: [
+            { required: true, message: '请选择处置方式', trigger: 'change' }
+          ],
+          depotId: [
+            { required: true, message: '请选择仓库', trigger: 'change' }
+          ],
 
-        keepSampleQuantity: [
-          {
-            validator: (rule, value, callback) => {
-              if (
-                this.disposeForm.disposeType === 6 &&
-                this.current &&
-                this.current.measureQuantity !== undefined
-              ) {
-                const inputVal = Number(value);
-                const maxVal = Number(this.current.measureQuantity);
-                if (inputVal > maxVal) {
-                  return callback(new Error(`不能超过原计量数量${maxVal}`));
+          keepSampleQuantity: [
+            {
+              validator: (rule, value, callback) => {
+                if (
+                  this.disposeForm.disposeType === 6 &&
+                  this.current &&
+                  this.current.measureQuantity !== undefined
+                ) {
+                  const inputVal = Number(value);
+                  const maxVal = Number(this.current.measureQuantity);
+                  if (inputVal > maxVal) {
+                    return callback(new Error(`不能超过原计量数量${maxVal}`));
+                  }
                 }
-              }
-              callback();
-            },
-            trigger: 'blur'
-          }
-        ]
-      },
-      disposeType: '',
-      disposeForm: {
+                callback();
+              },
+              trigger: 'blur'
+            }
+          ]
+        },
         disposeType: '',
-        sampleCondition: '',
-        sampleDate: '',
-        samplePlace: '',
-        sampleRemark: '',
-        producerManufacturer: '',
-        depotId: '',
-        depotName: '',
-        taskId: '',
-        keepSampleQuantity: ''
-      },
-      loading: false,
-      selection: [],
-      dialogVisible: false,
-      current: {},
-      formData: {},
-      all: false,
-      qualityType: null,
-      allList: [
-        { value: 1, label: '返工' },
-        { value: 2, label: '返修' },
-        { value: 3, label: '报废' },
-        { value: 4, label: '降级使用' },
-        { value: 5, label: '让步接收' },
-        { value: 6, label: '留样' },
-        { value: 7, label: '消耗' },
-        { value: 8, label: '回用/归批' },
-        { value: 9, label: '转试销' },
-        { value: 10, label: '退货' }
-      ],
-      //来料
-      disposalStatusListType: [
-        {
-          value: 5,
-          label: '让步接收'
+        disposeForm: {
+          disposeType: '',
+          sampleCondition: '',
+          sampleDate: '',
+          samplePlace: '',
+          sampleRemark: '',
+          producerManufacturer: '',
+          depotId: '',
+          depotName: '',
+          taskId: '',
+          keepSampleQuantity: ''
         },
-        {
-          value: 9,
-          label: '退货'
+        loading: false,
+        selection: [],
+        dialogVisible: false,
+        current: {},
+        formData: {},
+        all: false,
+        qualityType: null,
+        allList: [
+          { value: 1, label: '返工' },
+          { value: 2, label: '返修' },
+          { value: 3, label: '报废' },
+          { value: 4, label: '降级使用' },
+          { value: 5, label: '让步接收' },
+          { value: 6, label: '留样' },
+          { value: 7, label: '消耗' },
+          { value: 8, label: '回用/归批' },
+          { value: 9, label: '转试销' },
+          { value: 10, label: '退货' }
+        ],
+        //来料
+        disposalStatusListType: [
+          {
+            value: 5,
+            label: '让步接收'
+          },
+          {
+            value: 9,
+            label: '退货'
+          }
+        ],
+        //生产
+        disposalStatusList: [
+          {
+            value: 1,
+            label: '返工'
+          },
+          {
+            value: 2,
+            label: '返修'
+          },
+          {
+            value: 3,
+            label: '报废'
+          },
+          {
+            value: 4,
+            label: '降级使用'
+          },
+          {
+            value: 5,
+            label: '让步接收'
+          },
+          {
+            value: 6,
+            label: '留样'
+          },
+          {
+            value: 7,
+            label: '消耗'
+          },
+          {
+            value: 8,
+            label: '回用'
+          }
+        ],
+        refluxTaskList: []
+      };
+    },
+    computed: {
+      showBtn() {
+        return !this.$route.query.type;
+      },
+      disposeList() {
+        if (this.$route.query.qualityType == 1) {
+          return this.allList.filter((item) => [5, 10].includes(item.value));
         }
-      ],
-      //生产
-      disposalStatusList: [
-        {
-          value: 1,
-          label: '返工'
-        },
-        {
-          value: 2,
-          label: '返修'
-        },
-        {
-          value: 3,
-          label: '报废'
-        },
-        {
-          value: 4,
-          label: '降级使用'
-        },
-        {
-          value: 5,
-          label: '让步接收'
-        },
-        {
-          value: 6,
-          label: '留样'
-        },
-        {
-          value: 7,
-          label: '消耗'
-        },
-        {
-          value: 8,
-          label: '回用'
+        if (
+          this.$route.query.qualityType == 2 ||
+          this.$route.query.qualityType == 3
+        ) {
+          return this.allList.filter(
+            (item) => item.value !== 8 && item.value !== 10
+          );
+        } else {
+          return this.allList;
         }
-      ],
-      refluxTaskList: []
-    };
-  },
-  computed: {
-    showBtn() {
-      return !this.$route.query.type;
-    },
-    disposeList() {
-      if (this.$route.query.qualityType == 1) {
-        return this.allList.filter((item) => [5, 10].includes(item.value));
-      }
-      if (
-        this.$route.query.qualityType == 2 ||
-        this.$route.query.qualityType == 3
-      ) {
-        return this.allList.filter(
-          (item) => item.value !== 8 && item.value !== 10
-        );
-      } else {
-        return this.allList;
+      },
+      // 表格列配置
+      columns() {
+        const arr = [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            reserveSelection: true,
+            align: 'center',
+            selectable: (row, index) => {
+              return row.disposalStatus !== 2; //
+            }
+          },
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            label: '样品编码',
+            prop: 'sampleCode',
+            width: '150',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'categoryCode',
+            label: '物品编码',
+            width: '150',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'categoryName',
+            label: '物品名称',
+            width: '150',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            label: '规格',
+            prop: 'specification',
+            width: '120',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'brandNum',
+            label: '牌号',
+            align: 'center'
+          },
+          {
+            prop: 'modelType',
+            label: '型号',
+            align: 'center',
+            width: '120',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'batchNo',
+            label: '批次号',
+            align: 'center',
+            width: '120',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'weight',
+            label: '重量',
+            align: 'center',
+            width: '120',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'weightUnit',
+            label: '重量单位',
+            align: 'center',
+            width: '120',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'engrave',
+            label: '刻码',
+            align: 'center'
+          },
+          // {
+          //   prop: 'unqualifiedQuantity',
+          //   label: '数量',
+          //   align: 'center',
+          //   width: 60
+          // },
+          // { label: '包装数量', prop: 'packingQuantity', align: 'center' },
+          // { label: '包装单位', prop: 'packingUnit', align: 'center' },
+          { label: '计量数量', prop: 'measureQuantity', align: 'center' },
+          { label: '计量单位', prop: 'measureUnit', align: 'center' },
+          // { label: '物料代号', prop: 'materielDesignation', align: 'center' },
+          // { label: '客户代号', prop: 'clientCode', align: 'center' },
+          {
+            prop: 'produceRoutingName',
+            label: '工艺路线',
+            align: 'center'
+          },
+          {
+            prop: 'produceTaskName',
+            label: '工序',
+            align: 'center'
+          },
+          {
+            prop: 'unqualifiedReason',
+            label: '原因',
+            align: 'center'
+          },
+          {
+            prop: 'disposeTime',
+            label: '处置时间',
+            align: 'center',
+            width: '180',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'disposalStatus',
+            label: '处置状态',
+            align: 'center',
+            width: '120',
+            showOverflowTooltip: true,
+            formatter: (row, column, cellValue) => {
+              return this.disposalStatustList[cellValue ? cellValue : 0];
+            }
+          },
+          {
+            prop: 'disposeType',
+            label: '处置类型',
+            align: 'center',
+            width: '120',
+            showOverflowTooltip: true,
+            formatter: (row, column, cellValue) => {
+              console.log(this.allList.find((item) => item.value == cellValue));
+
+              return this.allList.find((item) => item.value == cellValue)
+                ?.label;
+            }
+          },
+
+          // {
+          //   prop: 'type',
+          //   label: '处置类型',
+          //   align: 'center',
+          //   // slot: 'SlottingType'
+          //   formatter: (row, column, cellValue) => {
+          //     return this.getDictValue('不良品处理类型', cellValue + '');
+          //   }
+          // },
+          // {
+          //   prop: 'status',
+          //   label: '状态',
+          //   align: 'center',
+          //   formatter: (row, column, cellValue) => {
+          //     return unacceptedProductStatus(cellValue);
+          //   }
+          // },
+
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 150,
+            align: 'center',
+            resizable: false,
+            fixed: 'right',
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ];
+        return this.$route.query.type ? arr.slice(0, -1) : arr;
+      },
+      disposalStatustList() {
+        return { 0: '待处置', 1: '处置中', 2: '处置完成' };
       }
     },
-    // 表格列配置
-    columns() {
-      const arr = [
-        {
-          width: 45,
-          type: 'selection',
-          columnKey: 'selection',
-          reserveSelection: true,
-          align: 'center',
-          selectable: (row, index) => {
-            return row.disposalStatus !== 2; //
-          }
-        },
-        {
-          columnKey: 'index',
-          label: '序号',
-          type: 'index',
-          width: 55,
-          align: 'center',
-          showOverflowTooltip: true,
-          fixed: 'left'
-        },
-        {
-          label: '样品编码',
-          prop: 'sampleCode',
-          width: '150',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'categoryCode',
-          label: '物品编码',
-          width: '150',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'categoryName',
-          label: '物品名称',
-          width: '150',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          label: '规格',
-          prop: 'specification',
-          width: '120',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'brandNum',
-          label: '牌号',
-          align: 'center'
-        },
-        {
-          prop: 'modelType',
-          label: '型号',
-          align: 'center',
-          width: '120',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'batchNo',
-          label: '批次号',
-          align: 'center',
-          width: '120',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'weight',
-          label: '重量',
-          align: 'center',
-          width: '120',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'weightUnit',
-          label: '重量单位',
-          align: 'center',
-          width: '120',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'engrave',
-          label: '刻码',
-          align: 'center'
-        },
-        // {
-        //   prop: 'unqualifiedQuantity',
-        //   label: '数量',
-        //   align: 'center',
-        //   width: 60
-        // },
-        // { label: '包装数量', prop: 'packingQuantity', align: 'center' },
-        // { label: '包装单位', prop: 'packingUnit', align: 'center' },
-        { label: '计量数量', prop: 'measureQuantity', align: 'center' },
-        { label: '计量单位', prop: 'measureUnit', align: 'center' },
-        // { label: '物料代号', prop: 'materielDesignation', align: 'center' },
-        // { label: '客户代号', prop: 'clientCode', align: 'center' },
-        {
-          prop: 'produceRoutingName',
-          label: '工艺路线',
-          align: 'center'
-        },
-        {
-          prop: 'produceTaskName',
-          label: '工序',
-          align: 'center'
-        },
-        {
-          prop: 'unqualifiedReason',
-          label: '原因',
-          align: 'center'
-        },
-        {
-          prop: 'disposeTime',
-          label: '处置时间',
-          align: 'center',
-          width: '180',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'disposalStatus',
-          label: '处置状态',
-          align: 'center',
-          width: '120',
-          showOverflowTooltip: true,
-          formatter: (row, column, cellValue) => {
-            return this.disposalStatustList[cellValue ? cellValue : 0];
-          }
-        },
-        {
-          prop: 'disposeType',
-          label: '处置类型',
-          align: 'center',
-          width: '120',
-          showOverflowTooltip: true,
-          formatter: (row, column, cellValue) => {
-            console.log(this.allList.find((item) => item.value == cellValue));
+    async created() {
+      this.qualityType = this.$route.query.qualityType;
+      this.warehouseList = await getWarehouseLists();
+      if (this.$route.query.workOrderCode) {
+        this.getRefluxTask();
+      }
 
-            return this.allList.find((item) => item.value == cellValue)?.label;
-          }
-        },
+      console.log(this.disposeList, 'disposeListdisposeList');
 
-        // {
-        //   prop: 'type',
-        //   label: '处置类型',
-        //   align: 'center',
-        //   // slot: 'SlottingType'
-        //   formatter: (row, column, cellValue) => {
-        //     return this.getDictValue('不良品处理类型', cellValue + '');
-        //   }
-        // },
-        // {
-        //   prop: 'status',
-        //   label: '状态',
-        //   align: 'center',
-        //   formatter: (row, column, cellValue) => {
-        //     return unacceptedProductStatus(cellValue);
-        //   }
-        // },
+      // console.log(this.warehouseList, 'this.warehouseList');
+    },
 
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 150,
-          align: 'center',
-          resizable: false,
-          fixed: 'right',
-          slot: 'action',
-          showOverflowTooltip: true
+    methods: {
+      disposeTypeChange() {
+        console.log(this.disposeForm.disposeType);
+        console.log(this.current.measureQuantity);
+        if (this.disposeForm.disposeType == 6) {
+          this.disposeForm.keepSampleQuantity =
+            this.current?.measureQuantity || '';
         }
-      ];
-      return this.$route.query.type ? arr.slice(0, -1) : arr;
-    },
-    disposalStatustList() {
-      return { 0: '待处置', 1: '处置中', 2: '处置完成' };
-    }
-  },
-  async created() {
-    this.qualityType = this.$route.query.qualityType;
-    this.warehouseList = await getWarehouseLists();
-    if (this.$route.query.workOrderCode) {
-      this.getRefluxTask();
-    }
+      },
+      // /* 表格数据源 */
+      async datasource({ page, where, limit }) {
+        let id = this.$route.query.id;
+        const arr = await getById(id);
+        // where.unqualifiedProductsId = this.$route.query.id;
+        return arr.poList;
+      },
 
-    // console.log(this.warehouseList, 'this.warehouseList');
-  },
+      async getRefluxTask() {
+        await refluxTask({
+          workOrderCode: this.$route.query.workOrderCode
+        }).then((res) => {
+          this.refluxTaskList = res;
+        });
+      },
 
-  methods: {
-    disposeTypeChange() {
-      console.log(this.disposeForm.disposeType);
-      console.log(this.current.measureQuantity)
-      if (this.disposeForm.disposeType == 6) {
-        this.disposeForm.keepSampleQuantity =
-          this.current?.measureQuantity || '';
-      }
-    },
-    // /* 表格数据源 */
-    async datasource({ page, where, limit }) {
-      let id = this.$route.query.id;
-      const arr = await getById(id);
-      // where.unqualifiedProductsId = this.$route.query.id;
-      return arr.poList;
-    },
+      reload(where) {
+        this.key = Math.random();
+        // this.$nextTick(() => {
+        //   if (this.$refs.searchRef && this.$refs.searchRef.reload)
+        //     this.$refs.searchRef.reload({ page: 1, where: where });
+        // });
+      },
+      remove(row) {
+        let ids = row ? [row.id] : this.selection.map((item) => item.id);
+        deleteUnacceptedProductDetail(ids).then((res) => {
+          this.$message.success('删除' + res);
+          this.getList();
+        });
+      },
+      close() {
+        this.$refs.disposeForm.resetFields();
+        this.dialogVisible = false;
+        this.disposeType = '';
+        this.all = false;
+        this.formData.disposalStatus = '';
+      },
+      // // 处置
+      disposeFn(type, row) {
+        if (type == 1) {
+          this.all = true;
+        } else {
+          this.current = row;
+          console.log(this.current, 'row');
+        }
+        this.formData = { ...row };
+        this.dialogVisible = true;
+        // let ids = this.current ? [this.current.id] : this.selection.map((item) => item.id);
+      },
+      async handleDispose() {
+        this.$refs['disposeForm'].validate(async (valid) => {
+          if (valid) {
+            let params = {
+              disposeType: this.disposeForm.disposeType,
+              poList: [],
+              refluxTask: null
+            };
+            if (this.all) {
+              params.poList = this.selection.map((item) => {
+                return { ...item, ...this.disposeForm };
+              });
+            } else {
+              params.poList = [
+                { ...deepClone(this.current), ...this.disposeForm }
+              ];
+            }
 
-    async getRefluxTask() {
-      await refluxTask({
-        workOrderCode: this.$route.query.workOrderCode
-      }).then((res) => {
-        this.refluxTaskList = res;
-      });
-    },
+            if (this.disposeForm.taskId) {
+              params.refluxTask = this.refluxTaskList.find(
+                (item) => item.taskId == this.disposeForm.taskId
+              );
+            }
 
-    reload(where) {
-      this.key = Math.random();
-      // this.$nextTick(() => {
-      //   if (this.$refs.searchRef && this.$refs.searchRef.reload)
-      //     this.$refs.searchRef.reload({ page: 1, where: where });
-      // });
-    },
-    remove(row) {
-      let ids = row ? [row.id] : this.selection.map((item) => item.id);
-      deleteUnacceptedProductDetail(ids).then((res) => {
-        this.$message.success('删除' + res);
-        this.getList();
-      });
-    },
-    close() {
-      this.$refs.disposeForm.resetFields();
-      this.dialogVisible = false;
-      this.disposeType = '';
-      this.all = false;
-      this.formData.disposalStatus = '';
-    },
-    // // 处置
-    disposeFn(type, row) {
-      if (type == 1) {
-        this.all = true;
-      } else {
-        this.current = row;
-        console.log(this.current, 'row');
-      }
-      this.formData = { ...row };
-      this.dialogVisible = true;
-      // let ids = this.current ? [this.current.id] : this.selection.map((item) => item.id);
-    },
-    async handleDispose() {
-      this.$refs['disposeForm'].validate(async (valid) => {
-        if (valid) {
-          let params = {
-            disposeType: this.disposeForm.disposeType,
-            poList: [],
-            refluxTask: null
-          };
-          if (this.all) {
-            params.poList = this.selection.map((item) => {
-              return { ...item, ...this.disposeForm };
-            });
+            console.log(params);
+            await disposeApi(params);
+            this.dialogVisible = false;
+            this.current = null;
+            this.$message.success('处置成功!');
+            this.reload();
+            return;
           } else {
-            params.poList = [
-              { ...deepClone(this.current), ...this.disposeForm }
-            ];
-          }
-
-          if (this.disposeForm.taskId) {
-            params.refluxTask = this.refluxTaskList.find(
-              (item) => item.taskId == this.disposeForm.taskId
-            );
+            return false;
           }
-
-          console.log(params);
-          await disposeApi(params);
-          this.dialogVisible = false;
-          this.current = null;
-          this.$message.success('处置成功!');
-          this.reload();
           return;
-        } else {
-          return false;
-        }
-        return;
-      });
+        });
 
-      return;
-    },
-    validate() {},
-    async save(data) {
-      if (data.data && data.data.length > 0) {
-        data.data.forEach((item) => {
-          item['fid'] = item.id || this.current.id;
+        return;
+      },
+      validate() {},
+      async save(data) {
+        if (data.data && data.data.length > 0) {
+          data.data.forEach((item) => {
+            item['fid'] = item.id || this.current.id;
+          });
+        }
+        let ids =
+          data.type == 1 ? [this.current.id] : data.data.map((item) => item.id);
+        await dispose({
+          id: ids,
+          disposeType: Number(data.type),
+          poList: data.data
         });
+        this.dialogVisible = false;
+        this.current = null;
+        this.$message.success('处置成功!');
+        this.reload();
+      },
+      chooseWarehouse(item) {
+        console.log(item);
+        this.disposeForm.depotId = item.id;
+        this.disposeForm.depotName = item.name;
       }
-      let ids =
-        data.type == 1 ? [this.current.id] : data.data.map((item) => item.id);
-      await dispose({
-        id: ids,
-        disposeType: Number(data.type),
-        poList: data.data
-      });
-      this.dialogVisible = false;
-      this.current = null;
-      this.$message.success('处置成功!');
-      this.reload();
     },
-    chooseWarehouse(item) {
-      console.log(item);
-      this.disposeForm.depotId = item.id;
-      this.disposeForm.depotName = item.name;
-    }
-  },
-  watch: {
-    'disposeForm.disposeType': {
-      handler(newVal, oldVal) {
-        if (newVal == 6) {
-          this.rules.depotId = [];
-        } else {
-          this.rules.depotId = [
-            { required: true, message: '请选择仓库', trigger: 'change' }
-          ];
+    watch: {
+      'disposeForm.disposeType': {
+        handler(newVal, oldVal) {
+          if (newVal == 6) {
+            this.rules.depotId = [];
+          } else {
+            this.rules.depotId = [
+              { required: true, message: '请选择仓库', trigger: 'change' }
+            ];
+          }
+          this.disposeForm.sampleCondition = '';
+          this.disposeForm.sampleDate = '';
+          this.disposeForm.samplePlace = '';
+          this.disposeForm.sampleRemark = '';
+          this.disposeForm.producerManufacturer = '';
+          this.disposeForm.depotId = '';
+          this.disposeForm.depotName = '';
+          this.disposeForm.taskId = '';
         }
-        this.disposeForm.sampleCondition = '';
-        this.disposeForm.sampleDate = '';
-        this.disposeForm.samplePlace = '';
-        this.disposeForm.sampleRemark = '';
-        this.disposeForm.producerManufacturer = '';
-        this.disposeForm.depotId = '';
-        this.disposeForm.depotName = '';
-        this.disposeForm.taskId = '';
       }
     }
-  }
-};
+  };
 </script>
 
 <style lang="scss" scoped>
-.unacceptedProductSelect {
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-}
+  .unacceptedProductSelect {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+  }
 </style>