695593266@qq.com 9 kuukautta sitten
vanhempi
commit
d3831a1442

+ 12 - 3
src/api/unacceptedProduct/index.js

@@ -74,7 +74,7 @@ export async function deleteUnacceptedProductDetail(data) {
  * 返工返修台账
  */
 export async function getReworkList(data) {
-   let par = new URLSearchParams(data);
+  let par = new URLSearchParams(data);
   const res = await request.get('/qms/qmsreturnrepairwork/page?' + par);
   if (res.data.code == 0) {
     return res.data.data;
@@ -113,7 +113,7 @@ export async function transformation(data, type) {
  * 试销品台账
  */
 export async function trialProducts(data) {
-   let par = new URLSearchParams(data);
+  let par = new URLSearchParams(data);
   const res = await request.get('/qms/qmstrialproducts/page?' + par);
   if (res.data.code == 0) {
     return res.data.data;
@@ -214,10 +214,19 @@ export async function getDowngradeuseList(data) {
 /* 留样
  */
 export async function getKeepsampleList(data) {
-   let par = new URLSearchParams(data);
+  let par = new URLSearchParams(data);
   const res = await request.get('/qms/keepsample/page?' + par);
   if (res.data.code == 0) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+//获取回流工序
+export async function refluxTask(data) {
+  const res = await request.post('/mes/workorder/refluxTask', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 46 - 4
src/views/unqualifiedProduct/unqualifiedList/detailList.vue

@@ -90,6 +90,25 @@
           </el-select>
         </el-form-item>
 
+        <template
+          v-if="disposeForm.disposeType == 1 || disposeForm.disposeType == 2"
+        >
+          <el-form-item label="回流工序" prop="taskId" align="center">
+            <el-select
+              style="width: 100%"
+              v-model="disposeForm.taskId"
+              clearable
+            >
+              <el-option
+                v-for="item in refluxTaskList"
+                :key="item.taskId"
+                :value="item.taskId"
+                :label="item.taskTypeName"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+        </template>
+
         <template v-if="disposeForm.disposeType == 6">
           <el-row>
             <el-col :span="24">
@@ -217,7 +236,7 @@
   import dictMixins from '@/mixins/dictMixins';
   import { unacceptedProductStatus } from '@/utils/util';
   import { deepClone } from '@/utils';
-  import { disposeApi } from '@/api/unacceptedProduct';
+  import { disposeApi, refluxTask } from '@/api/unacceptedProduct';
 
   import {
     getDetail,
@@ -252,7 +271,8 @@
           sampleRemark: '',
           producerManufacturer: '',
           depotId: '',
-          depotName: ''
+          depotName: '',
+          taskId: ''
         },
         loading: false,
         selection: [],
@@ -318,7 +338,8 @@
             value: 8,
             label: '回用'
           }
-        ]
+        ],
+        refluxTaskList: []
       };
     },
     computed: {
@@ -536,6 +557,9 @@
     async created() {
       this.qualityType = this.$route.query.qualityType;
       this.warehouseList = await getWarehouseList();
+      if (this.$route.query.workOrderCode) {
+        this.getRefluxTask();
+      }
     },
 
     methods: {
@@ -553,6 +577,15 @@
         //     this.$refs.searchRef.reload({ page: 1, where: where });
         // });
       },
+
+      async getRefluxTask() {
+        await refluxTask({
+          workOrderCode: this.$route.query.workOrderCode
+        }).then((res) => {
+          this.refluxTaskList = res;
+        });
+      },
+
       remove(row) {
         let ids = row ? [row.id] : this.selection.map((item) => item.id);
         deleteUnacceptedProductDetail(ids).then((res) => {
@@ -584,7 +617,8 @@
           if (valid) {
             let params = {
               disposeType: this.disposeForm.disposeType,
-              poList: []
+              poList: [],
+              refluxTask: null
             };
             if (this.all) {
               params.poList = this.selection.map((item) => {
@@ -595,6 +629,13 @@
                 { ...deepClone(this.current), ...this.disposeForm }
               ];
             }
+
+            if (this.disposeForm.taskId) {
+              params.refluxTask = this.refluxTaskList.find(
+                (item) => item.taskId == this.disposeForm.taskId
+              );
+            }
+
             console.log(params);
             await disposeApi(params);
             this.dialogVisible = false;
@@ -652,6 +693,7 @@
           this.disposeForm.producerManufacturer = '';
           this.disposeForm.depotId = '';
           this.disposeForm.depotName = '';
+          this.disposeForm.taskId = '';
         }
       }
     }

+ 2 - 1
src/views/unqualifiedProduct/unqualifiedList/index.vue

@@ -243,7 +243,7 @@
           }
           // 获取当前时间
           const now = new Date();
-    
+
           // 处置完成,不标红
           if (status == 2) {
             return '';
@@ -278,6 +278,7 @@
           query: {
             id: row.id,
             qualityType: row.qualityType,
+            workOrderCode: row.workOrderCode,
             type
           }
         });