Просмотр исходного кода

销售退货处理流程,仓管入库时,包装完好与否、拆包装责任人加星号必填控制
销售退货处理流程,技术员处理时,去掉不合格处理方式,保留不合格处理意见,不合格类型用字典

Z 2 лет назад
Родитель
Сommit
487ec58492

+ 1 - 1
src/api/classifyManage/index.js

@@ -87,7 +87,7 @@ export async function getOutInBySourceBizNo(id) {
   if (res.data.code == 0) {
     return res.data.data;
   }
-  return Promise.reject(new Error(res.data.message));
+  return res.data;
 }
 // 质检
 export async function updateOutInRecord(data) {

+ 2 - 2
src/components/Dict/DictSelection.vue

@@ -26,7 +26,7 @@
     },
     props: {
       value: {
-        type: [String, Number],
+        type: [String, Number, Array],
         default: ''
       },
       dictName: {
@@ -45,7 +45,7 @@
         Boolean,
         default: false
       }
-      
+
     },
     data () {
       return {};

+ 1 - 0
src/enum/dict.js

@@ -57,6 +57,7 @@ export default {
   质检状态: 'quality_control_code',
   质检结果: 'Qc_results_code',
   采购收货单类型: 'purchase_receive_type',
+  产品不合格类型: 'product_unqualified_type'
 };
 
 export const numberList = [

+ 607 - 507
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/customerReturnOrder.vue

@@ -59,6 +59,9 @@
                 <div v-else>{{ row.packageCount }}</div>
               </el-form-item>
             </template>
+            <template v-slot:headerPackageCount="{ column }">
+              <span class="is-required">{{ column.label }}</span>
+            </template>
             <template v-slot:measurementCount="{ row, $index }">
               <el-form-item
                 :prop="'detailList.' + $index + '.measurementCount'"
@@ -71,6 +74,9 @@
                 <div v-else>{{ row.measurementCount }}</div>
               </el-form-item>
             </template>
+            <template v-slot:headerMeasurementCount="{ column }">
+              <span class="is-required">{{ column.label }}</span>
+            </template>
             <template v-slot:weight="{ row, $index }">
               <el-form-item
                 :prop="'detailList.' + $index + '.weight'"
@@ -80,6 +86,9 @@
                 <div v-else>{{ row.weight }}</div>
               </el-form-item>
             </template>
+            <template v-slot:headerWeight="{ column }">
+              <span class="is-required">{{ column.label }}</span>
+            </template>
             <template v-slot:carveCode="{ row, $index }">
               <el-form-item
                 :prop="'detailList.' + $index + '.carveCode'"
@@ -89,6 +98,9 @@
                 <div v-else>{{ row.carveCode }}</div>
               </el-form-item>
             </template>
+            <template v-slot:headerCarveCode="{ column }">
+              <span class="is-required">{{ column.label }}</span>
+            </template>
             <!--  ///  发起人展示字段 -->
             <template v-slot:reason="{ row, $index }">
               <el-form-item
@@ -99,6 +111,9 @@
                 <div v-else>{{ row.reason }}</div>
               </el-form-item>
             </template>
+            <template v-slot:headerReason="{ column }">
+              <span class="is-required">{{ column.label }}</span>
+            </template>
             <template v-slot:feedbackDate="{ row, $index }">
               <el-form-item
                 :prop="'detailList.' + $index + '.feedbackDate'"
@@ -120,6 +135,9 @@
                 <div v-else>{{ row.feedbackDate }}</div>
               </el-form-item>
             </template>
+            <template v-slot:headerFeedbackDate="{ column }">
+              <span class="is-required">{{ column.label }}</span>
+            </template>
             <template v-slot:sendDate="{ row, $index }">
               <el-form-item
                 :prop="'detailList.' + $index + '.sendDate'"
@@ -141,6 +159,9 @@
                 <div v-else>{{ row.sendDate }}</div>
               </el-form-item>
             </template>
+            <template v-slot:headerSendDate="{ column }">
+              <span class="is-required">{{ column.label }}</span>
+            </template>
             <!--////-->
             <!--  ///  仓管入库展示字段 -->
             <template v-slot:ifPackageOk="{ row, $index }">
@@ -159,12 +180,15 @@
                   clearable
                   style="width: 100%"
                 >
-                  <el-option label="是" :value="1" />
-                  <el-option label="否" :value="0" />
+                  <el-option label="是" :value="1"/>
+                  <el-option label="否" :value="0"/>
                 </el-select>
                 <div v-else>{{ row.ifPackageOk ? '是' : '否' }}</div>
               </el-form-item>
             </template>
+            <template v-slot:headerIfPackageOk="{ column }">
+              <span class="is-required">{{ column.label }}</span>
+            </template>
             <template v-slot:unpackUserName="{ row, $index }">
               <el-form-item
                 :prop="'detailList.' + $index + '.unpackUserName'"
@@ -183,6 +207,9 @@
                 <div v-else>{{ row.unpackUserName }}</div>
               </el-form-item>
             </template>
+            <template v-slot:headerUnpackUserName="{ column }">
+              <span class="is-required">{{ column.label }}</span>
+            </template>
             <!--////-->
             <!--  ///  质检员审核展示字段 -->
             <template v-slot:ifReasonMatch="{ row, $index }">
@@ -201,12 +228,15 @@
                   clearable
                   style="width: 100%"
                 >
-                  <el-option label="是" :value="1" />
-                  <el-option label="否" :value="0" />
+                  <el-option label="是" :value="1"/>
+                  <el-option label="否" :value="0"/>
                 </el-select>
                 <div v-else>{{ row.ifReasonMatch ? '是' : '否' }}</div>
               </el-form-item>
             </template>
+            <template v-slot:headerIfReasonMatch="{ column }">
+              <span class="is-required">{{ column.label }}</span>
+            </template>
             <!--////-->
             <!--  ///  技术员审核展示字段 -->
             <template v-slot:unqualifiedReasonAnalysis="{ row, $index }">
@@ -221,18 +251,34 @@
                 <div v-else>{{ row.unqualifiedReasonAnalysis }}</div>
               </el-form-item>
             </template>
+            <template v-slot:headerUnqualifiedReasonAnalysis="{ column }">
+              <span class="is-required">{{ column.label }}</span>
+            </template>
             <template v-slot:unqualifiedType="{ row, $index }">
               <el-form-item
                 :prop="'detailList.' + $index + '.unqualifiedType'"
                 :rules="{ required: true, trigger: 'blur', message: '请输入' }"
               >
-                <el-input
-                  v-if="isTrue"
-                  v-model="row.unqualifiedType"
-                ></el-input>
-                <div v-else>{{ row.unqualifiedType }}</div>
+                <DictSelection dict-name="产品不合格类型"
+                               multiple
+                               collapse-tags
+                               clearable
+                               v-if="isTrue"
+                               v-model="row.unqualifiedTypeList"
+                               @change="(val)=>changeGetValue(val,row,'dictList','unqualifiedType','unqualifiedTypeName',$index)">
+
+                </DictSelection>
+
+                <!--                <el-input-->
+                <!--                  v-if="isTrue"-->
+                <!--                  v-model="row.unqualifiedType"-->
+                <!--                ></el-input>-->
+                                <div v-else>{{ row.unqualifiedTypeName }}</div>
               </el-form-item>
             </template>
+            <template v-slot:headerUnqualifiedType="{ column }">
+              <span class="is-required">{{ column.label }}</span>
+            </template>
             <template v-slot:handleWay="{ row, $index }">
               <el-form-item
                 :prop="'detailList.' + $index + '.handleWay'"
@@ -242,6 +288,9 @@
                 <div v-else>{{ row.handleWay }}</div>
               </el-form-item>
             </template>
+            <template v-slot:headerHandleWay="{ column }">
+              <span class="is-required">{{ column.label }}</span>
+            </template>
             <template v-slot:handleOpinion="{ row, $index }">
               <el-form-item
                 :prop="'detailList.' + $index + '.handleOpinion'"
@@ -251,6 +300,9 @@
                 <div v-else>{{ row.handleOpinion }}</div>
               </el-form-item>
             </template>
+            <template v-slot:headerHandleOpinion="{ column }">
+              <span class="is-required">{{ column.label }}</span>
+            </template>
             <!--////-->
             <!--  ///  生产员审核 -->
             <template v-slot:outHelp="{ row }">
@@ -259,6 +311,7 @@
                 <div v-else>{{ row.outHelp }}</div>
               </el-form-item>
             </template>
+
             <template v-slot:inHelp="{ row }">
               <el-form-item prop="inHelp">
                 <el-input v-if="isTrue" v-model="row.inHelp"></el-input>
@@ -276,6 +329,9 @@
                 <div v-else>{{ row.improveCorrect }}</div>
               </el-form-item>
             </template>
+            <template v-slot:headerImproveCorrect="{ column }">
+              <span class="is-required">{{ column.label }}</span>
+            </template>
             <template v-slot:improveOpinion="{ row, $index }">
               <el-form-item
                 :prop="'detailList.' + $index + '.improveOpinion'"
@@ -285,6 +341,9 @@
                 <div v-else>{{ row.improveOpinion }}</div>
               </el-form-item>
             </template>
+            <template v-slot:headerImproveOpinion="{ column }">
+              <span class="is-required">{{ column.label }}</span>
+            </template>
             <!--////-->
           </ele-pro-table>
         </el-form>
@@ -313,565 +372,606 @@
 </template>
 
 <script>
-  import inboundDetails from './inboundDetails.vue';
-  import outboundDetailsDialog from './outboundDetailsDialog.vue';
-  import headList from '@/components/headList';
-  import {
-    getOutInByIdAPI,
-    saleReturnGetByIdAPI
-  } from '@/api/bpm/components/saleManage/saleorder';
-  import { deepClone } from '@/utils';
-  import { EventBus } from './eventBus.js';
+import inboundDetails from './inboundDetails.vue';
+import outboundDetailsDialog from './outboundDetailsDialog.vue';
+import headList from '@/components/headList';
+import {
+  getOutInByIdAPI,
+  saleReturnGetByIdAPI
+} from '@/api/bpm/components/saleManage/saleorder';
+import {deepClone} from '@/utils';
+import {EventBus} from './eventBus.js';
+import {mapActions, mapGetters} from "vuex";
+import dictEnum from "@/enum/dict";
 
-  export default {
-    name: 'customerReturnOrder',
-    props: {
-      taskDefinitionKey: {
-        type: String,
-        default: 'stater'
-      },
-      activeComp: {
-        type: String,
-        default: 'stater'
-      },
-      permissionType: {
-        type: String,
-        default: 'view'
-      },
-      businessId: {
-        type: String,
-        default: ''
-      }
+export default {
+  name: 'customerReturnOrder',
+  props: {
+    taskDefinitionKey: {
+      type: String,
+      default: 'stater'
     },
-    components: { outboundDetailsDialog, headList, inboundDetails },
-    data() {
-      return {
-        activeName: '退货物品明细',
-        title: '客户退货处理单',
-        outboundDetailsDialogFlag: false,
-        isTrue: false,
-        warehousingMaterialList: [],
-        materialCodeReqList: [],
-        metaList: [],
-        form: {
-          detailList: []
-        },
-        rules: {}
-      };
+    activeComp: {
+      type: String,
+      default: 'stater'
     },
-    computed: {
-      columns() {
-        let basicFields = [
+    permissionType: {
+      type: String,
+      default: 'view'
+    },
+    businessId: {
+      type: String,
+      default: ''
+    }
+  },
+  components: {outboundDetailsDialog, headList, inboundDetails},
+  data() {
+    return {
+      activeName: '退货物品明细',
+      title: '客户退货处理单',
+      outboundDetailsDialogFlag: false,
+      isTrue: false,
+      warehousingMaterialList: [],
+      materialCodeReqList: [],
+      metaList: [],
+      form: {
+        detailList: []
+      },
+      rules: {}
+    };
+  },
+  computed: {
+    columns() {
+      let basicFields = [
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 120,
+          align: 'center',
+          resizable: false,
+          slot: 'action',
+          fixed: 'right',
+          showOverflowTooltip: true
+        },
+        {
+          width: 45,
+          type: 'index',
+          columnKey: 'index',
+          align: 'center',
+          fixed: 'left'
+        },
+        {
+          minWidth: 120,
+          prop: 'name',
+          label: '名称',
+          align: 'center',
+          slot: 'name'
+        },
+        {
+          minWidth: 120,
+          prop: 'categoryCode',
+          label: '编码',
+          align: 'center',
+          slot: 'categoryCode'
+        },
+        // {
+        //   minWidth: 120,
+        //   prop: 'modelType',
+        //   label: '型号',
+        //   align: 'center',
+        //   slot: 'modelType'
+        // },
+        {
+          minWidth: 120,
+          prop: 'specification',
+          label: '规格',
+          align: 'center',
+          slot: 'specification'
+        },
+        {
+          minWidth: 120,
+          prop: 'packageCount',
+          label: '包装数量',
+          align: 'center',
+          slot: 'packageCount',
+          headerSlot: 'headerPackageCount'
+        },
+        {
+          minWidth: 80,
+          prop: 'packingUnit',
+          label: '包装单位',
+          align: 'center',
+          slot: 'packingUnit'
+        },
+        {
+          minWidth: 80,
+          prop: 'measurementCount',
+          label: '计量数量',
+          align: 'center',
+          slot: 'measurementCount',
+          headerSlot: 'headerCount'
+        },
+        {
+          minWidth: 80,
+          prop: 'measuringUnit',
+          label: '计量单位',
+          align: 'center',
+          slot: 'measuringUnit'
+        },
+        {
+          minWidth: 80,
+          prop: 'weight',
+          label: '重量',
+          align: 'center',
+          slot: 'weight',
+          headerSlot: 'headerWeight'
+        },
+        {
+          minWidth: 80,
+          prop: 'weightUtil',
+          label: '重量单位',
+          align: 'center',
+          slot: 'weightUtil'
+        },
+        {
+          minWidth: 120,
+          prop: 'carveCode',
+          label: '刻码',
+          slot: 'carveCode',
+          align: 'center',
+          headerSlot: 'headerCarveCode'
+        }
+      ];
+      let processNodes = {
+        //发起人
+        stater: [
+          {
+            minWidth: 140,
+            prop: 'reason',
+            label: '客户退货理由',
+            align: 'center',
+            slot: 'reason',
+            headerSlot: 'headerReason'
+          },
           {
-            columnKey: 'action',
-            label: '操作',
-            width: 120,
+            minWidth: 180,
+            prop: 'feedbackDate',
+            label: '客户反馈日期',
             align: 'center',
-            resizable: false,
-            slot: 'action',
-            fixed: 'right',
-            showOverflowTooltip: true
+            slot: 'feedbackDate',
+            headerSlot: 'headerFeedbackDate'
           },
           {
-            width: 45,
-            type: 'index',
-            columnKey: 'index',
+            minWidth: 180,
+            prop: 'sendDate',
+            label: '客户发出日期',
+            slot: 'sendDate',
             align: 'center',
-            fixed: 'left'
+            headerSlot: 'headerSendDate'
+          }
+        ],
+        //销售主管审批
+        deptLeader: [
+          {
+            minWidth: 140,
+            prop: 'reason',
+            label: '客户退货理由',
+            align: 'center',
+            slot: 'reason',
+            headerSlot: 'headerReason'
           },
           {
-            minWidth: 120,
-            prop: 'name',
-            label: '名称',
+            minWidth: 140,
+            prop: 'feedbackDate',
+            label: '客户反馈日期',
             align: 'center',
-            slot: 'name'
+            slot: 'feedbackDate',
+            headerSlot: 'headerFeedbackDate'
           },
           {
-            minWidth: 120,
-            prop: 'categoryCode',
-            label: '编码',
+            minWidth: 140,
+            prop: 'sendDate',
+            label: '客户发出日期',
+            slot: 'sendDate',
             align: 'center',
-            slot: 'categoryCode'
+            headerSlot: 'headerSendDate'
+          }
+        ],
+        //仓管入库
+        storeman: [
+          {
+            minWidth: 140,
+            prop: 'ifPackageOk',
+            label: '包装完好与否',
+            align: 'center',
+            slot: 'ifPackageOk',
+            headerSlot: 'headerIfPackageOk'
           },
-          // {
-          //   minWidth: 120,
-          //   prop: 'modelType',
-          //   label: '型号',
-          //   align: 'center',
-          //   slot: 'modelType'
-          // },
           {
-            minWidth: 120,
-            prop: 'specification',
-            label: '规格',
+            minWidth: 140,
+            prop: 'unpackUserName',
+            label: '拆包装责任人',
             align: 'center',
-            slot: 'specification'
+            slot: 'unpackUserName',
+            headerSlot: 'headerUnpackUserName'
+          }
+        ],
+        //质量部主管指派
+        QCLeader: [
+          {
+            minWidth: 140,
+            prop: 'ifPackageOk',
+            label: '包装完好与否',
+            align: 'center',
+            slot: 'ifPackageOk',
+            headerSlot: 'headerIfPackageOk'
           },
           {
-            minWidth: 80,
-            prop: 'packageCount',
-            label: '包装数量',
+            minWidth: 140,
+            prop: 'unpackUserName',
+            label: '拆包装责任人',
             align: 'center',
-            slot: 'packageCount',
-            headerSlot: 'headerPackingCount'
+            slot: 'unpackUserName',
+            headerSlot: 'headerUnpackUserName'
+          }
+        ],
+        //质检员审核
+        QCApprove: [
+          {
+            minWidth: 250,
+            prop: 'ifReasonMatch',
+            label: '退货原因是否与退货信息一致',
+            align: 'center',
+            slot: 'ifReasonMatch',
+            headerSlot: 'headerIfReasonMatch'
           },
           {
-            minWidth: 80,
-            prop: 'packingUnit',
-            label: '包装单位',
+            minWidth: 140,
+            prop: 'reason',
+            label: '客户退货理由',
             align: 'center',
-            slot: 'packingUnit'
+            slot: 'reason',
+            headerSlot: 'headerReason'
           },
+        ],
+        //技术部主管指派
+        techLeader: [
           {
-            minWidth: 80,
-            prop: 'measurementCount',
-            label: '计量数量',
+            minWidth: 250,
+            prop: 'ifReasonMatch',
+            label: '退货原因是否与退货信息一致',
             align: 'center',
-            slot: 'measurementCount',
-            headerSlot: 'headerCount'
+            slot: 'ifReasonMatch',
+            headerSlot: 'headerIfReasonMatch'
           },
           {
-            minWidth: 80,
-            prop: 'measuringUnit',
-            label: '计量单位',
+            minWidth: 140,
+            prop: 'reason',
+            label: '客户退货理由',
             align: 'center',
-            slot: 'measuringUnit'
+            slot: 'reason',
+            headerSlot: 'headerReason'
           },
+        ],
+        //技术员审核
+        techApprove: [
           {
-            minWidth: 80,
-            prop: 'weight',
-            label: '重量',
+            minWidth: 250,
+            prop: 'unqualifiedReasonAnalysis',
+            label: '不合格原因分析',
             align: 'center',
-            slot: 'weight',
-            headerSlot: 'headerWeight'
+            slot: 'unqualifiedReasonAnalysis',
+            headerSlot: 'headerUnqualifiedReasonAnalysis'
           },
           {
-            minWidth: 80,
-            prop: 'weightUtil',
-            label: '重量单位',
+            minWidth: 250,
+            prop: 'unqualifiedType',
+            label: '不合格类型',
             align: 'center',
-            slot: 'weightUtil'
+            slot: 'unqualifiedType',
+            headerSlot: 'headerUnqualifiedType'
           },
+          // {
+          //   minWidth: 250,
+          //   prop: 'handleWay',
+          //   label: '不合格品处理方式',
+          //   align: 'center',
+          //   slot: 'handleWay',
+          //   headerSlot: 'headerHandleWay'
+          // },
           {
-            minWidth: 120,
-            prop: 'carveCode',
-            label: '刻码',
-            slot: 'carveCode',
+            minWidth: 250,
+            prop: 'handleOpinion',
+            label: '对不合格品的处理意见',
             align: 'center',
-            headerSlot: 'headerEngrave'
+            slot: 'handleOpinion',
+            headerSlot: 'headerHandleOpinion'
           }
-        ];
-        let processNodes = {
-          //发起人
-          stater: [
-            {
-              minWidth: 140,
-              prop: 'reason',
-              label: '客户退货理由',
-              align: 'center',
-              slot: 'reason',
-              headerSlot: 'headerReason'
-            },
-            {
-              minWidth: 180,
-              prop: 'feedbackDate',
-              label: '客户反馈日期',
-              align: 'center',
-              slot: 'feedbackDate'
-            },
-            {
-              minWidth: 180,
-              prop: 'sendDate',
-              label: '客户发出日期',
-              slot: 'sendDate',
-              align: 'center',
-              headerSlot: 'headerSendDate'
-            }
-          ],
-          //销售主管审批
-          deptLeader: [
-            {
-              minWidth: 140,
-              prop: 'reason',
-              label: '客户退货理由',
-              align: 'center',
-              slot: 'reason',
-              headerSlot: 'headerReason'
-            },
-            {
-              minWidth: 140,
-              prop: 'feedbackDate',
-              label: '客户反馈日期',
-              align: 'center',
-              slot: 'feedbackDate'
-            },
-            {
-              minWidth: 140,
-              prop: 'sendDate',
-              label: '客户发出日期',
-              slot: 'sendDate',
-              align: 'center',
-              headerSlot: 'headerSendDate'
-            }
-          ],
-          //仓管入库
-          storeman: [
-            {
-              minWidth: 140,
-              prop: 'ifPackageOk',
-              label: '包装完好与否',
-              align: 'center',
-              slot: 'ifPackageOk',
-              headerSlot: 'headerIfPackageOk'
-            },
-            {
-              minWidth: 140,
-              prop: 'unpackUserName',
-              label: '拆包装责任人',
-              align: 'center',
-              slot: 'unpackUserName'
-            }
-          ],
-          //质量部主管指派
-          QCLeader: [
-            {
-              minWidth: 140,
-              prop: 'ifPackageOk',
-              label: '包装完好与否',
-              align: 'center',
-              slot: 'ifPackageOk',
-              headerSlot: 'headerIfPackageOk'
-            },
-            {
-              minWidth: 140,
-              prop: 'unpackUserName',
-              label: '拆包装责任人',
-              align: 'center',
-              slot: 'unpackUserName'
-            }
-          ],
-          //质检员审核
-          QCApprove: [
-            {
-              minWidth: 250,
-              prop: 'ifReasonMatch',
-              label: '退货原因是否与退货信息一致',
-              align: 'center',
-              slot: 'ifReasonMatch',
-              headerSlot: 'headerIfReasonMatch'
-            }
-          ],
-          //技术部主管指派
-          techLeader: [
-            {
-              minWidth: 250,
-              prop: 'ifReasonMatch',
-              label: '退货原因是否与退货信息一致',
-              align: 'center',
-              slot: 'ifReasonMatch',
-              headerSlot: 'headerIfReasonMatch'
-            }
-          ],
-          //技术员审核
-          techApprove: [
-            {
-              minWidth: 250,
-              prop: 'unqualifiedReasonAnalysis',
-              label: '不合格原因分析',
-              align: 'center',
-              slot: 'unqualifiedReasonAnalysis',
-              headerSlot: 'headerUnqualifiedReasonAnalysis'
-            },
-            {
-              minWidth: 250,
-              prop: 'unqualifiedType',
-              label: '不合格类型',
-              align: 'center',
-              slot: 'unqualifiedType',
-              headerSlot: 'headerUnqualifiedType'
-            },
-            {
-              minWidth: 250,
-              prop: 'handleWay',
-              label: '不合格品处理方式',
-              align: 'center',
-              slot: 'handleWay',
-              headerSlot: 'headerHandleWay'
-            },
-            {
-              minWidth: 250,
-              prop: 'handleOpinion',
-              label: '对不合格品的处理意见',
-              align: 'center',
-              slot: 'handleOpinion',
-              headerSlot: 'headerHandleOpinion'
-            }
-          ],
-          //生产部主管指派
-          produceLeader: [
-            {
-              minWidth: 250,
-              prop: 'unqualifiedReasonAnalysis',
-              label: '不合格原因分析',
-              align: 'center',
-              slot: 'unqualifiedReasonAnalysis',
-              headerSlot: 'headerUnqualifiedReasonAnalysis'
-            },
-            {
-              minWidth: 250,
-              prop: 'unqualifiedType',
-              label: '不合格类型',
-              align: 'center',
-              slot: 'unqualifiedType',
-              headerSlot: 'headerUnqualifiedType'
-            },
-            {
-              minWidth: 250,
-              prop: 'handleOpinion',
-              label: '对不合格品的处理意见',
-              align: 'center',
-              slot: 'handleOpinion',
-              headerSlot: 'headerHandleOpinion'
-            }
-          ],
-          //生产员审核
-          produceApprove: [
-            {
-              minWidth: 250,
-              prop: 'outHelp',
-              label: '外部协助',
-              align: 'center',
-              slot: 'outHelp',
-              headerSlot: 'headerOutHelp'
-            },
-            {
-              minWidth: 250,
-              prop: 'inHelp',
-              label: '内部',
-              align: 'center',
-              slot: 'inHelp',
-              headerSlot: 'headerInHelp'
-            }
-          ],
-          //质检员反馈
-          QCApprove2: [
-            {
-              minWidth: 250,
-              prop: 'improveCorrect',
-              label: '不合格原因是否改善到位',
-              align: 'center',
-              slot: 'improveCorrect',
-              headerSlot: 'headerImproveCorrect'
-            },
-            {
-              minWidth: 250,
-              prop: 'improveOpinion',
-              label: '对改善后产品处理意见',
-              align: 'center',
-              slot: 'improveOpinion',
-              headerSlot: 'headerImproveOpinion'
-            }
-          ]
-        };
-        processNodes[this.activeComp] &&
-          basicFields.push(...processNodes[this.activeComp]);
-        //
-        this.isTrue =
-          this.activeComp == this.taskDefinitionKey &&
-          this.permissionType !== 'view';
-        return basicFields;
-      }
+        ],
+        //生产部主管指派
+        produceLeader: [
+          {
+            minWidth: 250,
+            prop: 'unqualifiedReasonAnalysis',
+            label: '不合格原因分析',
+            align: 'center',
+            slot: 'unqualifiedReasonAnalysis',
+            headerSlot: 'headerUnqualifiedReasonAnalysis'
+          },
+          {
+            minWidth: 250,
+            prop: 'unqualifiedType',
+            label: '不合格类型',
+            align: 'center',
+            slot: 'unqualifiedType',
+            headerSlot: 'headerUnqualifiedType'
+          },
+          {
+            minWidth: 250,
+            prop: 'handleOpinion',
+            label: '对不合格品的处理意见',
+            align: 'center',
+            slot: 'handleOpinion',
+            headerSlot: 'headerHandleOpinion'
+          }
+        ],
+        //生产员审核
+        produceApprove: [
+          {
+            minWidth: 250,
+            prop: 'outHelp',
+            label: '外部协助',
+            align: 'center',
+            slot: 'outHelp',
+            headerSlot: 'headerOutHelp'
+          },
+          {
+            minWidth: 250,
+            prop: 'inHelp',
+            label: '内部',
+            align: 'center',
+            slot: 'inHelp',
+            headerSlot: 'headerInHelp'
+          }
+        ],
+        //质检员反馈
+        QCApprove2: [
+          {
+            minWidth: 250,
+            prop: 'improveCorrect',
+            label: '不合格原因是否改善到位',
+            align: 'center',
+            slot: 'improveCorrect',
+            headerSlot: 'headerImproveCorrect'
+          },
+          {
+            minWidth: 250,
+            prop: 'improveOpinion',
+            label: '对改善后产品处理意见',
+            align: 'center',
+            slot: 'improveOpinion',
+            headerSlot: 'headerImproveOpinion'
+          }
+        ]
+      };
+      processNodes[this.activeComp] &&
+      basicFields.push(...processNodes[this.activeComp]);
+      //
+      this.isTrue =
+        this.activeComp == this.taskDefinitionKey &&
+        this.permissionType !== 'view';
+      return basicFields;
     },
-    mounted() {
-      this.getReturnInfo(this.businessId);
+    ...mapGetters(['dict', 'getDict']),
+    dictList() {
+      return this.dict[dictEnum['产品不合格类型']] || [];
     },
-    methods: {
-      handleClick(val) {
-        this.activeName = val.name;
-        if (val.name === '入库明细') {
-          this.$refs.inboundDetails.initialize();
-        }
-      },
-      async getReturnInfo(businessId) {
-        this.form = await saleReturnGetByIdAPI(businessId);
+  },
+  created() {
+  },
+  mounted() {
+    this.getReturnInfo(this.businessId);
+  },
+  methods: {
+    handleClick(val) {
+      this.activeName = val.name;
+      if (val.name === '入库明细') {
+        this.$refs.inboundDetails.initialize();
+      }
+    },
+    async getReturnInfo(businessId) {
+      this.form = await saleReturnGetByIdAPI(businessId);
 
-        let outInIds = [
-          ...new Set(this.form?.detailList?.map((item) => item.outInId))
-        ];
-        for (const outInId of outInIds) {
-          //拼接信息
-          const data = await getOutInByIdAPI(outInId);
-          this.infoData = deepClone(data);
+      let outInIds = [
+        ...new Set(this.form?.detailList?.map((item) => item.outInId))
+      ];
+      for (const outInId of outInIds) {
+        //拼接信息
+        const data = await getOutInByIdAPI(outInId);
+        this.infoData = deepClone(data);
+        //出库物料明细
+        this.warehousingMaterialList = this.infoData?.outInDetailVOList || [];
+        //出库包装明细
+        if (this.warehousingMaterialList.length) {
+          this.materialCodeReqList = [];
+          this.warehousingMaterialList.forEach((item) => {
+            if (item.outInDetailRecordVOList?.length) {
+              item.outInDetailRecordVOList = item.outInDetailRecordVOList.map(
+                (i) => {
+                  return {
+                    ...i,
+                    outInCode: this.infoData.bizNo,
+                    outInId: item.outInId,
+                    measurementCount: i.totalCount,
+                    outboundDetailId: i.id,
+                    outboundType: 1,
+                    packageCount: i.packingCount,
+                    packingUnit: i.packingUnit,
+                    weight: i.weight,
+                    specification: item.specification,
+                    name: i.name,
+                    categoryCode: i.categoryCode,
+                    id: ''
+                  };
+                }
+              );
+              this.materialCodeReqList.push(...item.outInDetailRecordVOList);
+            }
+          });
           //出库物料明细
-          this.warehousingMaterialList = this.infoData?.outInDetailVOList || [];
-          //出库包装明细
-          if (this.warehousingMaterialList.length) {
-            this.materialCodeReqList = [];
-            this.warehousingMaterialList.forEach((item) => {
-              if (item.outInDetailRecordVOList?.length) {
-                item.outInDetailRecordVOList = item.outInDetailRecordVOList.map(
-                  (i) => {
+          if (this.materialCodeReqList.length) {
+            this.metaList = [];
+            this.materialCodeReqList.forEach((item) => {
+              if (item.outInDetailRecordMaterialDetailVOList?.length) {
+                item.outInDetailRecordMaterialDetailVOList =
+                  item.outInDetailRecordMaterialDetailVOList.map((i) => {
                     return {
                       ...i,
-                      outInCode: this.infoData.bizNo,
                       outInId: item.outInId,
-                      measurementCount: i.totalCount,
+                      outInCode: item.outInCode,
+                      measurementCount: 1,
                       outboundDetailId: i.id,
-                      outboundType: 1,
+                      outboundType: 2,
                       packageCount: i.packingCount,
                       packingUnit: i.packingUnit,
                       weight: i.weight,
+                      weightUtil: i.weightUnit,
                       specification: item.specification,
-                      name: i.name,
-                      categoryCode: i.categoryCode,
+                      categoryCode: i.assetCode,
+                      name: i.assetName,
                       id: ''
                     };
-                  }
+                  });
+                this.metaList.push(
+                  ...item.outInDetailRecordMaterialDetailVOList
                 );
-                this.materialCodeReqList.push(...item.outInDetailRecordVOList);
               }
             });
-            //出库物料明细
-            if (this.materialCodeReqList.length) {
-              this.metaList = [];
-              this.materialCodeReqList.forEach((item) => {
-                if (item.outInDetailRecordMaterialDetailVOList?.length) {
-                  item.outInDetailRecordMaterialDetailVOList =
-                    item.outInDetailRecordMaterialDetailVOList.map((i) => {
-                      return {
-                        ...i,
-                        outInId: item.outInId,
-                        outInCode: item.outInCode,
-                        measurementCount: 1,
-                        outboundDetailId: i.id,
-                        outboundType: 2,
-                        packageCount: i.packingCount,
-                        packingUnit: i.packingUnit,
-                        weight: i.weight,
-                        weightUtil: i.weightUnit,
-                        specification: item.specification,
-                        categoryCode: i.assetCode,
-                        name: i.assetName,
-                        id: ''
-                      };
-                    });
-                  this.metaList.push(
-                    ...item.outInDetailRecordMaterialDetailVOList
-                  );
-                }
-              });
-            }
           }
-          this.form.detailList.forEach((item) => {
-            if (item.outboundType == 1) {
-              let find =
-                this.materialCodeReqList.find(
-                  (i) => i.outboundDetailId == item.outboundDetailId
-                ) || {};
-              item.name = find.name;
-              item.categoryCode = find.categoryCode;
-              item.specification = find.specification;
-              item.weightUtil = find.weightUtil;
-              item.packingUnit = find.packingUnit;
-              item.measuringUnit = find.measuringUnit;
-            } else {
-              let find =
-                this.metaList.find(
-                  (i) => i.outboundDetailId == item.outboundDetailId
-                ) || {};
-              item.name = find.name;
-              item.categoryCode = find.categoryCode;
-              item.specification = find.specification;
-              item.weightUtil = find.weightUtil;
-              item.packingUnit = find.packingUnit;
-              item.measuringUnit = find.measuringUnit;
-            }
-          });
         }
+        this.form.detailList.forEach((item) => {
+          if (item.outboundType == 1) {
+            let find =
+              this.materialCodeReqList.find(
+                (i) => i.outboundDetailId == item.outboundDetailId
+              ) || {};
+            item.name = find.name;
+            item.categoryCode = find.categoryCode;
+            item.specification = find.specification;
+            item.weightUtil = find.weightUtil;
+            item.packingUnit = find.packingUnit;
+            item.measuringUnit = find.measuringUnit;
 
-        this.$nextTick(() => {
-          this.$refs.table.reRenderTable();
-        });
-      },
-      handleSelectGoods() {
-        this.outboundDetailsDialogFlag = true;
-        this.$nextTick(() => {
-          this.$refs.outboundDetailsDialogRef.init();
-        });
-      },
-      //删除
-      remove(row, index) {
-        this.form.detailList.splice(index, 1);
-      },
-      //选择退货信息回调
-      saveDate(data) {
-        this.form.detailList.push(...data);
-      },
-      //选择负责人
-      handHead(row, index) {
-        let item = {
-          id: row.unpackUserId
-        };
-        this.$refs.headRef.open(item, index);
-      },
-      //选择负责人回调
-      changeHead(obj, index) {
-        this.$set(this.form.detailList[index], 'unpackUserId', obj.id);
-        this.$set(this.form.detailList[index], 'unpackUserName', obj.name);
-      },
-      // 获取销售退货信息
-      getReturnStorage() {
-        return Promise.resolve(this.$refs.inboundDetails.infoData);
-      },
-      getTableValue() {
-        return new Promise((resolve) => {
-          this.$refs.formRef.validate((validate) => {
-            if (!validate) {
-              resolve(false);
-            } else {
-              let params = {
-                detailList: this.form.detailList.map((i) => {
-                  return {
-                    outInId: i.outInId,
-                    outInCode: i.outInCode,
-                    measurementCount: i.measurementCount,
-                    outboundDetailId: i.outboundDetailId,
-                    outboundType: i.outboundType,
-                    packageCount: i.packageCount,
-                    packingUnit: i.packingUnit,
-                    weight: i.weight,
-                    weightUtil: i.weightUtil,
-                    specification: i.specification,
-                    categoryCode: i.categoryCode,
-                    carveCode: i.carveCode,
-                    name: i.name,
-                    reason: i.reason,
-                    sendDate: i.sendDate,
-                    feedbackDate: i.feedbackDate,
-                    id: i.id,
-                    handleOpinion: i.handleOpinion,
-                    handleWay: i.handleWay,
-                    ifPackageOk: i.ifPackageOk,
-                    ifReasonMatch: i.ifReasonMatch,
-                    improveCorrect: i.improveCorrect,
-                    improveOpinion: i.improveOpinion,
-                    inHelp: i.inHelp,
-                    outHelp: i.outHelp,
-                    remark: i.remark,
-                    unpackUserId: i.unpackUserId,
-                    unpackUserName: i.unpackUserName,
-                    unqualifiedReasonAnalysis: i.unqualifiedReasonAnalysis,
-                    unqualifiedType: i.unqualifiedType
-                  };
-                }),
-                returnRecordId: this.form.returnRecordId
-              };
-              resolve(params);
-            }
-          });
+          } else {
+            let find =
+              this.metaList.find(
+                (i) => i.outboundDetailId == item.outboundDetailId
+              ) || {};
+            item.name = find.name;
+            item.categoryCode = find.categoryCode;
+            item.specification = find.specification;
+            item.weightUtil = find.weightUtil;
+            item.packingUnit = find.packingUnit;
+            item.measuringUnit = find.measuringUnit;
+          }
+          item.unqualifiedTypeList = item.unqualifiedType?.split(',') ?? []
         });
       }
+
+      this.$nextTick(() => {
+        this.$refs.table.reRenderTable();
+      });
+    },
+    changeGetValue(val, row, list, key, value, index) {
+      if (!val.length) {
+        row[value] = ''
+        row[key] = ''
+      }
+      let findList = this[list].filter(item => val.includes(item.dictCode)) || []
+      row[value] = findList.map(item => item.dictValue).join(',')
+      row[key] = val.join(',')
+      this.$set(this.form.detailList, index, row)
+    },
+    handleSelectGoods() {
+      this.outboundDetailsDialogFlag = true;
+      this.$nextTick(() => {
+        this.$refs.outboundDetailsDialogRef.init();
+      });
+    },
+    //删除
+    remove(row, index) {
+      this.form.detailList.splice(index, 1);
+    },
+    //选择退货信息回调
+    saveDate(data) {
+      this.form.detailList.push(...data);
+    },
+    //选择负责人
+    handHead(row, index) {
+      let item = {
+        id: row.unpackUserId
+      };
+      this.$refs.headRef.open(item, index);
+    },
+    //选择负责人回调
+    changeHead(obj, index) {
+      this.$set(this.form.detailList[index], 'unpackUserId', obj.id);
+      this.$set(this.form.detailList[index], 'unpackUserName', obj.name);
+    },
+    // 获取销售退货信息
+    getReturnStorage() {
+      return Promise.resolve(this.$refs.inboundDetails.infoData);
+    },
+    getTableValue() {
+      return new Promise((resolve) => {
+        this.$refs.formRef.validate((validate) => {
+          if (!validate) {
+            resolve(false);
+          } else {
+            let params = {
+              detailList: this.form.detailList.map((i) => {
+                return {
+                  outInId: i.outInId,
+                  outInCode: i.outInCode,
+                  measurementCount: i.measurementCount,
+                  outboundDetailId: i.outboundDetailId,
+                  outboundType: i.outboundType,
+                  packageCount: i.packageCount,
+                  packingUnit: i.packingUnit,
+                  weight: i.weight,
+                  weightUtil: i.weightUtil,
+                  specification: i.specification,
+                  categoryCode: i.categoryCode,
+                  carveCode: i.carveCode,
+                  name: i.name,
+                  reason: i.reason,
+                  sendDate: i.sendDate,
+                  feedbackDate: i.feedbackDate,
+                  id: i.id,
+                  handleOpinion: i.handleOpinion,
+                  handleWay: i.handleWay,
+                  ifPackageOk: i.ifPackageOk,
+                  ifReasonMatch: i.ifReasonMatch,
+                  improveCorrect: i.improveCorrect,
+                  improveOpinion: i.improveOpinion,
+                  inHelp: i.inHelp,
+                  outHelp: i.outHelp,
+                  remark: i.remark,
+                  unpackUserId: i.unpackUserId,
+                  unpackUserName: i.unpackUserName,
+                  unqualifiedReasonAnalysis: i.unqualifiedReasonAnalysis,
+                  unqualifiedType: i.unqualifiedType,
+                  unqualifiedTypeName: i.unqualifiedTypeName
+                };
+              }),
+              returnRecordId: this.form.returnRecordId
+            };
+            resolve(params);
+          }
+        });
+      });
     }
-  };
+  }
+};
 </script>
 <style scoped lang="scss"></style>