huang_an 2 anni fa
parent
commit
889c9d1756

+ 11 - 3
src/api/classifyManage/index.js

@@ -91,7 +91,15 @@ export async function getOutInBySourceBizNo(id) {
 }
 }
 // 质检
 // 质检
 export async function updateOutInRecord(data) {
 export async function updateOutInRecord(data) {
-  const res = await request.post(`wms/outin/updateOutInRecord`,data);
+  const res = await request.post(`wms/outin/updateOutInRecord`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+// 质检wuliao
+export async function updateMaterialById(data) {
+  const res = await request.post(`wms/outin/updateMaterialById`, data);
   if (res.data.code == 0) {
   if (res.data.code == 0) {
     return res.data.data;
     return res.data.data;
   }
   }
@@ -99,7 +107,7 @@ export async function updateOutInRecord(data) {
 }
 }
 // 质检员反馈
 // 质检员反馈
 export async function uploadQualityFile(data) {
 export async function uploadQualityFile(data) {
-  const res = await request.post(`wms/outin/uploadQualityFile`,data);
+  const res = await request.post(`wms/outin/uploadQualityFile`, data);
   if (res.data.code == 0) {
   if (res.data.code == 0) {
     return res.data.data;
     return res.data.data;
   }
   }
@@ -107,7 +115,7 @@ export async function uploadQualityFile(data) {
 }
 }
 // 根据code查询detail
 // 根据code查询detail
 export async function getDetailByCode(data) {
 export async function getDetailByCode(data) {
-  const res = await request.post(`wms/outin/getDetailByCode`,data);
+  const res = await request.post(`wms/outin/getDetailByCode`, data);
   if (res.data.code == 0) {
   if (res.data.code == 0) {
     return res.data.data;
     return res.data.data;
   }
   }

+ 32 - 4
src/views/bpm/handleTask/components/inoutBound/detailDialog.vue

@@ -493,7 +493,8 @@
             </el-table-column>
             </el-table-column>
             <el-table-column width="100" label="重量" prop="weight">
             <el-table-column width="100" label="重量" prop="weight">
               <template slot-scope="{ row }">
               <template slot-scope="{ row }">
-                {{ row.weight }}
+                <el-input v-model="row.weight" v-if="!row.isMeta"></el-input>
+                <span v-else> {{ row.weight }}</span>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
             <el-table-column label="重量单位" prop="weightUnit">
             <el-table-column label="重量单位" prop="weightUnit">
@@ -503,7 +504,13 @@
             </el-table-column>
             </el-table-column>
             <el-table-column label="质检结果" prop="result" width="120">
             <el-table-column label="质检结果" prop="result" width="120">
               <template slot-scope="{ row }">
               <template slot-scope="{ row }">
-                <span>
+                <DictSelection
+                  dictName="质检结果"
+                  clearable
+                  v-model="row.result"
+                  v-if="!row.isMeta"
+                />
+                <span v-else>
                   <span v-if="!row.result"></span>
                   <span v-if="!row.result"></span>
                   <span v-if="row.result == 0">合格</span>
                   <span v-if="row.result == 0">合格</span>
                   <span v-else-if="row.result == 1">不合格</span>
                   <span v-else-if="row.result == 1">不合格</span>
@@ -520,6 +527,16 @@
                 >
                 >
               </template>
               </template>
             </el-table-column>
             </el-table-column>
+            <el-table-column
+              label="操作"
+              width="80"
+              v-if="taskDefinitionKey == 'qualityInspection'"
+            >
+              <template slot-scope="{ row }">
+                <el-button type="text" @click="packMeta(row)"> 提交 </el-button>
+              </template>
+            </el-table-column>
+          </el-table>
           </el-table>
           </el-table>
         </div>
         </div>
       </div>
       </div>
@@ -537,7 +554,8 @@
   import {
   import {
     getTreeByPid,
     getTreeByPid,
     getOutInBySourceBizNo,
     getOutInBySourceBizNo,
-    updateOutInRecord
+    updateOutInRecord,
+    updateMaterialById
   } from '@/api/classifyManage';
   } from '@/api/classifyManage';
 
 
   import {
   import {
@@ -655,6 +673,15 @@
       this._getInfo();
       this._getInfo();
     },
     },
     methods: {
     methods: {
+      //质检物料提交
+      async packMeta(data) {
+        if (!data.result) {
+          return this.$message.error('请选择质检结果!');
+        }
+        data.status = 1;
+        await updateMaterialById(data);
+        this._getInfo();
+      },
       //质检提交
       //质检提交
       async packCout(data) {
       async packCout(data) {
         if (!data.result) {
         if (!data.result) {
@@ -733,7 +760,8 @@
               iArr.push({ ...ele });
               iArr.push({ ...ele });
             });
             });
           });
           });
-          this.metailList = iArr;
+          console.log('==',iArr)
+          this.metailList = iArr.map(item=>{return {...item,result:item.result.toString()}})
         }
         }
         const { data } = await getTreeByPid(0);
         const { data } = await getTreeByPid(0);
         this.codeList = data.map((item) => {
         this.codeList = data.map((item) => {

+ 26 - 15
src/views/bpm/handleTask/components/purchaseOrder/invoice/detailDialog.vue

@@ -167,6 +167,7 @@
   import { getReceiveSaleOrderrecordDetail } from '@/api/bpm/components/purchasingManage/purchaseorderreceive';
   import { getReceiveSaleOrderrecordDetail } from '@/api/bpm/components/purchasingManage/purchaseorderreceive';
   import detailDialog from '@/views/bpm/handleTask/components/inoutBound/detailDialog.vue';
   import detailDialog from '@/views/bpm/handleTask/components/inoutBound/detailDialog.vue';
   import add from '@/views/bpm/stockManagement/add.vue';
   import add from '@/views/bpm/stockManagement/add.vue';
+  import { getOutInBySourceBizNo } from '@/api/classifyManage';
 
 
   export default {
   export default {
     props: {
     props: {
@@ -334,21 +335,31 @@
     async created() {
     async created() {
       await this.getDetailData(this.businessId);
       await this.getDetailData(this.businessId);
 
 
-      if (
-        !['starter', 'deptLeaderApprove', 'storeManagerApprove'].includes(
-          this.taskDefinitionKey
-        )
-      ) {
-        this.tabOptions.push({ key: 'inoutBoundView', name: '入库单详情' });
-        this.activeComp = 'inoutBoundView';
-      }
-      if (this.taskDefinitionKey == 'storeManagerApprove') {
-        this.tabOptions.push({ key: 'inoutBound', name: '入库单' });
-        this.activeComp = 'inoutBound';
-        this.$emit('activeCompChange', 'inoutBound');
-        this.$nextTick(() => {
-          this.$refs.add.pickerSuccess(this.form);
-        });
+      try {
+        const data = await getOutInBySourceBizNo(this.form.receiveNo);
+        console.log('aa==', data);
+        if (data != null) {
+          this.tabOptions.push({ key: 'inoutBoundView', name: '入库单详情' });
+          this.activeComp = 'inoutBoundView';
+          return;
+        }
+      } catch (error) {
+        if (
+          !['starter', 'deptLeaderApprove', 'storeManagerApprove'].includes(
+            this.taskDefinitionKey
+          )
+        ) {
+          this.tabOptions.push({ key: 'inoutBoundView', name: '入库单详情' });
+          this.activeComp = 'inoutBoundView';
+        }
+        if (this.taskDefinitionKey == 'storeManagerApprove') {
+          this.tabOptions.push({ key: 'inoutBound', name: '入库单' });
+          this.activeComp = 'inoutBound';
+          this.$emit('activeCompChange', 'inoutBound');
+          this.$nextTick(() => {
+            this.$refs.add.pickerSuccess(this.form);
+          });
+        }
       }
       }
     },
     },
 
 

+ 89 - 9
src/views/bpm/stockManagement/add.vue

@@ -924,7 +924,14 @@
                   dictName="质检结果"
                   dictName="质检结果"
                   clearable
                   clearable
                   v-model="row.result"
                   v-model="row.result"
+                  v-if="!row.isPack"
                 />
                 />
+                <span v-else>
+                  <span v-if="!row.result"></span>
+                  <span v-if="row.result == 0">合格</span>
+                  <span v-else-if="row.result == 1">不合格</span>
+                  <span v-else>让步接收</span>
+                </span>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
             <el-table-column label="质检状态" prop="status" width="120">
             <el-table-column label="质检状态" prop="status" width="120">
@@ -933,7 +940,13 @@
                   dictName="质检状态"
                   dictName="质检状态"
                   clearable
                   clearable
                   v-model="row.status"
                   v-model="row.status"
+                  v-if="!row.isPack"
                 />
                 />
+                <span v-else
+                  ><span v-if="!row.status"></span>
+                  <span v-if="row.status == 0">未检</span>
+                  <span v-else>已检</span></span
+                >
               </template>
               </template>
             </el-table-column>
             </el-table-column>
 
 
@@ -1041,7 +1054,11 @@
               prop="meterielCode"
               prop="meterielCode"
             >
             >
               <template slot-scope="{ row }">
               <template slot-scope="{ row }">
-                <el-input v-model="row.materielCode"></el-input>
+                <el-input
+                  v-model="row.materielCode"
+                  v-if="!row.isMeta"
+                ></el-input>
+                <span v-else>{{ row.materialCode }}</span>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
             <el-table-column
             <el-table-column
@@ -1050,7 +1067,11 @@
               prop="clientCode"
               prop="clientCode"
             >
             >
               <template slot-scope="{ row }">
               <template slot-scope="{ row }">
-                <el-input v-model="row.clientCode"></el-input>
+                <el-input
+                  v-model="row.clientCode"
+                  v-if="!row.isMeta"
+                ></el-input>
+                <span v-else> {{ row.clientCode }}</span>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
             <el-table-column
             <el-table-column
@@ -1059,7 +1080,8 @@
               prop="engrave"
               prop="engrave"
             >
             >
               <template slot-scope="{ row }">
               <template slot-scope="{ row }">
-                <el-input v-model="row.engrave"></el-input>
+                <el-input v-model="row.engrave" v-if="!row.isMeta"></el-input>
+                <span v-else> {{ row.engrave }}</span>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
             <el-table-column
             <el-table-column
@@ -1069,7 +1091,8 @@
               prop="weight"
               prop="weight"
             >
             >
               <template slot-scope="{ row }">
               <template slot-scope="{ row }">
-                <el-input v-model="row.weight"></el-input>
+                <el-input v-model="row.weight" v-if="!row.isMeta"></el-input>
+                <span v-else>{{ row.weight }}</span>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
             <el-table-column
             <el-table-column
@@ -1087,7 +1110,13 @@
                   dictName="质检结果"
                   dictName="质检结果"
                   clearable
                   clearable
                   v-model="row.result"
                   v-model="row.result"
+                  v-if="!row.isMeta"
                 />
                 />
+                <span v-else
+                  ><span v-if="!row.status"></span>
+                  <span v-if="row.status == 0">未检</span>
+                  <span v-else>已检</span></span
+                >
               </template>
               </template>
             </el-table-column>
             </el-table-column>
             <el-table-column label="质检状态" prop="status" width="120">
             <el-table-column label="质检状态" prop="status" width="120">
@@ -1096,7 +1125,20 @@
                   dictName="质检状态"
                   dictName="质检状态"
                   clearable
                   clearable
                   v-model="row.status"
                   v-model="row.status"
+                  v-if="!row.isMeta"
                 />
                 />
+                <span v-else
+                  ><span v-if="!row.status"></span>
+                  <span v-if="row.status == 0">未检</span>
+                  <span v-else>已检</span></span
+                >
+              </template>
+            </el-table-column>
+            <el-table-column label="操作" width="80">
+              <template slot-scope="{ row }">
+                <el-button type="text" @click="packMeta(row)">
+                  {{ !row.isMeta ? '保存' : '编辑' }}
+                </el-button>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
           </el-table>
           </el-table>
@@ -1156,6 +1198,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
+  import { getProductList } from '@/api/bpm/components/saleManage/contact';
   import { getLoginUser } from '@/api/login';
   import { getLoginUser } from '@/api/login';
   import picker from './components/picker.vue';
   import picker from './components/picker.vue';
   import outin from '@/api/warehouseManagement/outin';
   import outin from '@/api/warehouseManagement/outin';
@@ -1326,7 +1369,8 @@
                 weightUnit: item.weightUnit,
                 weightUnit: item.weightUnit,
                 engrave: item.engrave,
                 engrave: item.engrave,
                 result: item.result,
                 result: item.result,
-                status: item.status
+                status: item.status,
+                isMeta: false
               });
               });
             }
             }
           });
           });
@@ -1334,8 +1378,13 @@
         } else {
         } else {
           this.resultArray = [];
           this.resultArray = [];
         }
         }
+        console.log('this.resultArray', this.resultArray);
       },
       },
       //包装明细保存
       //包装明细保存
+      packMeta(row) {
+        console.log(row);
+        row.isMeta = !row.isMeta;
+      },
       packCout(row) {
       packCout(row) {
         //true保存==》反之
         //true保存==》反之
         if (!row.isPack) {
         if (!row.isPack) {
@@ -1414,11 +1463,41 @@
               ...item,
               ...item,
               assetName: item.productName,
               assetName: item.productName,
               assetCode: item.productCode,
               assetCode: item.productCode,
-              categoryId: item.productCategoryId
+              categoryId: item.productCategoryId,
+              minPackUnit: item.packingUnit
             };
             };
           });
           });
-          this.onSelectTableData(list);
+          this.onSelectTableData(await this.serachMainCode(list));
+        }
+      },
+      async serachMainCode(arr) {
+        let newArr = [];
+        // 使用 Promise.all 来等待所有异步操作完成
+        await Promise.all(
+          arr.map(async (item) => {
+            const data = await getProductList({
+              pageNum: 1,
+              size: 10,
+              categoryLevelId: item.categoryLevelPathIdParent,
+              code: item.assetCode
+            });
+            newArr.push(data.list); // 将结果存储到 newArr 中
+          })
+        );
+        let re = [];
+        for (const item of newArr) {
+          for (const it of item) {
+            re.push(it);
+          }
         }
         }
+        return re.map((item) => {
+          return {
+            ...item,
+            minPackUnit: item.packingUnit,
+            assetCode: item.code,
+            assetName: item.name
+          };
+        });
       },
       },
       onClear() {
       onClear() {
         this.formData.extInfo.documentSource = '';
         this.formData.extInfo.documentSource = '';
@@ -1943,12 +2022,12 @@
             this.formatWarehouseMaterialList();
             this.formatWarehouseMaterialList();
 
 
             let arr = this.warehousingMaterialList.map((item) => {
             let arr = this.warehousingMaterialList.map((item) => {
-              console.log(item,'item')
+              console.log(item, 'item');
               return {
               return {
                 netWeight: item.netWeight,
                 netWeight: item.netWeight,
                 num: item.num,
                 num: item.num,
                 batchNo: item.batchNo,
                 batchNo: item.batchNo,
-                code:item.productCode,
+                code: item.productCode,
                 categoryId:
                 categoryId:
                   this.formData.bizType == 2
                   this.formData.bizType == 2
                     ? item.categoryId
                     ? item.categoryId
@@ -2052,6 +2131,7 @@
       },
       },
       //添加明细
       //添加明细
       async onSelectTableData(val) {
       async onSelectTableData(val) {
+        console.log('===ssa', val);
         const res = await getCode('lot_number_code');
         const res = await getCode('lot_number_code');
 
 
         this.warehousingMaterialList.push(
         this.warehousingMaterialList.push(