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

新增客户退货完整流程

流程提交成功但未往下执行问题解决
Z 2 лет назад
Родитель
Сommit
304e2b5a2b

+ 61 - 0
src/api/bpm/components/saleManage/saleorder.js

@@ -190,3 +190,64 @@ export async function versionPage(params) {
   }
   }
   return Promise.reject(new Error(res.data.message));
   return Promise.reject(new Error(res.data.message));
 }
 }
+/**
+ * 根据退货单编码获取出库单详情
+ */
+export async function getOutInByIdAPI(id) {
+  const res = await request.get(`/wms/outin/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 客户退货处理单-保存
+ */
+export async function saleReturnSaveAPI(data) {
+  const res = await request.post(`/eom/salereturnhandle/save`,data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 客户退货处理单-修改
+ */
+export async function saleReturnUpdateAPI(data) {
+  const res = await request.post(`/eom/salereturnhandle/update`,data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 客户退货处理单-详情
+ */
+export async function saleReturnGetByIdAPI(id) {
+  const res = await request.get(`/eom/salereturnhandle/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 客户退货处理单-提交开启流程
+ */
+export async function salesOrderReturnSubmit(data) {
+  const res = await request.post(`/bpm/salesOrderReturnHandle/submit`,data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 客户退货处理单-审核流程
+ */
+export async function approveTaskWithVariablesAPI(data) {
+  const res = await request.put(`/bpm/task/approveTaskWithVariables`,data);
+  return res.data;
+}
+
+
+

+ 1 - 0
src/views/bpm/handleTask/components/contractBook/detailDialog.vue

@@ -465,6 +465,7 @@
               ...data,
               ...data,
               ...data.contractVO
               ...data.contractVO
             });
             });
+          console.log(this.form.type);
         }
         }
       }
       }
     }
     }

+ 10 - 12
src/views/bpm/handleTask/components/contractBook/inventoryTabledetail.vue

@@ -98,17 +98,19 @@
         default: true,
         default: true,
         type: Boolean
         type: Boolean
       },
       },
-      isSinglePrice: {
-        default: true,
-        type: Boolean
-      },
       contractBookType: {
       contractBookType: {
         default: 1
         default: 1
       }
       }
     },
     },
     data() {
     data() {
       return {
       return {
-        competAnalysisListcolumns: [
+        form: {},
+        productList: []
+      };
+    },
+    computed: {
+      competAnalysisListcolumns(){
+        return  [
           {
           {
             width: 45,
             width: 45,
             type: 'index',
             type: 'index',
@@ -223,7 +225,6 @@
           {
           {
             width: 160,
             width: 160,
             prop: 'customerExpectDeliveryDeadline',
             prop: 'customerExpectDeliveryDeadline',
-            label: '客户期望交期',
             slot: 'customerExpectDeliveryDeadline',
             slot: 'customerExpectDeliveryDeadline',
             label: this.contractBookType == 1 ? '客户期望交期' : '交付日期',
             label: this.contractBookType == 1 ? '客户期望交期' : '交付日期',
           },
           },
@@ -307,14 +308,11 @@
             label: '备注',
             label: '备注',
             slot: 'remark'
             slot: 'remark'
           }
           }
-        ],
-        form: {},
-        productList: []
-      };
+        ]
+      },
     },
     },
-    computed: {},
     created(){
     created(){
-      console.log('333333333');
+      console.log(this.contractBookType,'=======');
     },
     },
     methods: {
     methods: {
       //修改回显
       //修改回显

+ 798 - 0
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/customerReturnOrder.vue

@@ -0,0 +1,798 @@
+<template>
+  <div>
+    <el-form
+      :rules="rules"
+      ref="formRef"
+      :model="form">
+
+      <header-title title="退货物品明细" size="16px"></header-title>
+
+      <ele-pro-table
+        ref="table"
+        :needPage="false"
+        :columns="columns"
+        :toolkit="[]"
+        :datasource="form.detailList"
+        cache-key="customerReturnOrderDialog"
+        class="time-form"
+      >
+        <!-- 表头工具栏 -->
+        <!--        <template v-slot:toolbar>-->
+        <!--          <el-button-->
+        <!--            size="small"-->
+        <!--            type="primary"-->
+        <!--            icon="el-icon-plus"-->
+        <!--            class="ele-btn-icon"-->
+        <!--            @click="handleSelectGoods"-->
+        <!--            v-if="taskDefinitionKey=='stater'">-->
+        <!--            选择退货物品-->
+        <!--          </el-button>-->
+        <!--        </template>-->
+        <template v-slot:action="{ row,$index }">
+          <el-popconfirm
+            v-if="taskDefinitionKey=='stater'"
+            class="ele-action"
+            title="确定要删除吗?"
+            @confirm="remove(row,$index)"
+          >
+            <template v-slot:reference>
+              <el-link type="danger" :underline="false" icon="el-icon-delete">
+                删除
+              </el-link>
+            </template>
+          </el-popconfirm>
+        </template>
+        <template v-slot:packageCount="{ row ,$index}">
+          <el-form-item
+            :prop="'detailList.'+$index+'.packageCount'"
+            :rules="{required:row.outboundType!=2?true:false,trigger:'blur',message:'请输入'}">
+            <el-input v-if="isTrue&&row.outboundType!=2"
+                      v-model="row.packageCount"></el-input>
+            <div v-else>{{ row.packageCount }}</div>
+          </el-form-item>
+        </template>
+        <template v-slot:measurementCount="{ row,$index }">
+          <el-form-item :prop="'detailList.'+$index+'.measurementCount'"
+                        :rules="{required:true,trigger:'blur',message:'请输入'}">
+            <el-input v-if="isTrue"
+                      v-model="row.measurementCount"></el-input>
+            <div v-else>{{ row.measurementCount }}</div>
+          </el-form-item>
+        </template>
+        <template v-slot:weight="{ row,$index }">
+          <el-form-item :prop="'detailList.'+$index+'.weight'"
+                        :rules="{required:true,trigger:'blur',message:'请输入'}">
+            <el-input v-if="isTrue"
+                      v-model="row.weight"></el-input>
+            <div v-else>{{ row.weight }}</div>
+          </el-form-item>
+        </template>
+        <template v-slot:carveCode="{ row ,$index}">
+          <el-form-item :prop="'detailList.'+$index+'.carveCode'"
+                        :rules="{required:true,trigger:'blur',message:'请输入'}">
+            <el-input v-if="isTrue"
+                      v-model="row.carveCode"></el-input>
+            <div v-else>{{ row.carveCode }}</div>
+          </el-form-item>
+        </template>
+        <!--  ///  发起人展示字段 -->
+        <template v-slot:reason="{ row ,$index}">
+          <el-form-item :prop="'detailList.'+$index+'.reason'"
+                        :rules="{required:true,trigger:'blur',message:'请输入'}">
+            <el-input v-if="isTrue"
+                      v-model="row.reason"></el-input>
+            <div v-else>{{ row.reason }}</div>
+          </el-form-item>
+        </template>
+        <template v-slot:feedbackDate="{ row ,$index}">
+          <el-form-item :prop="'detailList.'+$index+'.feedbackDate'"
+                        :rules="{required:true,trigger:'change',message:'请选择'}">
+            <el-date-picker
+              v-if="isTrue"
+              v-model="row.feedbackDate"
+              style="width: 100%"
+              type="date"
+              value-format="yyyy-MM-dd"
+              placeholder="选择日期">
+            </el-date-picker>
+            <div v-else>{{ row.feedbackDate }}</div>
+          </el-form-item>
+        </template>
+        <template v-slot:sendDate="{ row,$index }">
+          <el-form-item :prop="'detailList.'+$index+'.sendDate'"
+                        :rules="{required:true,trigger:'change',message:'请选择'}">
+            <el-date-picker
+              v-if="isTrue"
+              v-model="row.sendDate"
+              style="width: 100%"
+              value-format="yyyy-MM-dd"
+              type="date"
+              placeholder="选择日期">
+            </el-date-picker>
+            <div v-else>{{ row.sendDate }}</div>
+          </el-form-item>
+        </template>
+        <!--////-->
+        <!--  ///  仓管入库展示字段 -->
+        <template v-slot:ifPackageOk="{ row,$index }">
+          <el-form-item
+            :prop="'detailList.'+$index+'.ifPackageOk'"
+            :rules="{required:true,trigger:'change',message:'请选择'}">
+            <el-select
+              v-if="isTrue"
+              v-model="row.ifPackageOk"
+              placeholder="请选择"
+              clearable
+              style="width: 100%"
+            >
+              <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:unpackUserName="{ row ,$index}">
+          <el-form-item :prop="'detailList.'+$index+'.unpackUserName'"
+                        :rules="{required:true,trigger:'change',message:'请选择'}">
+            <el-input
+              v-if="isTrue"
+              @click.native="handHead(row,$index)"
+              v-model="row.unpackUserName"
+              placeholder="请选择"></el-input>
+            <div v-else>{{ row.unpackUserName }}</div>
+          </el-form-item>
+        </template>
+        <!--////-->
+        <!--  ///  质检员审核展示字段 -->
+        <template v-slot:ifReasonMatch="{ row,$index }">
+          <el-form-item
+            :prop="'detailList.'+$index+'.ifReasonMatch'"
+            :rules="{required:true,trigger:'change',message:'请选择'}">
+            <el-select
+              v-if="isTrue"
+              v-model="row.ifReasonMatch"
+              placeholder="请选择"
+              clearable
+              style="width: 100%"
+            >
+              <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:unqualifiedReasonAnalysis="{ row,$index }">
+          <el-form-item
+            :prop="'detailList.'+$index+'.unqualifiedReasonAnalysis'"
+            :rules="{required:true,trigger:'blur',message:'请输入'}">
+            <el-input v-if="isTrue" v-model="row.unqualifiedReasonAnalysis"></el-input>
+            <div v-else>{{ row.unqualifiedReasonAnalysis }}</div>
+          </el-form-item>
+        </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>
+          </el-form-item>
+        </template>
+        <template v-slot:handleWay="{ row ,$index}">
+          <el-form-item
+            :prop="'detailList.'+$index+'.handleWay'"
+            :rules="{required:true,trigger:'blur',message:'请输入'}">
+            <el-input v-if="isTrue" v-model="row.handleWay"></el-input>
+            <div v-else>{{ row.handleWay }}</div>
+          </el-form-item>
+        </template>
+        <template v-slot:handleOpinion="{ row,$index }">
+          <el-form-item
+            :prop="'detailList.'+$index+'.handleOpinion'"
+            :rules="{required:true,trigger:'blur',message:'请输入'}">
+            <el-input v-if="isTrue" v-model="row.handleOpinion"></el-input>
+            <div v-else>{{ row.handleOpinion }}</div>
+          </el-form-item>
+        </template>
+        <!--////-->
+        <!--  ///  生产员审核 -->
+        <template v-slot:outHelp="{ row }">
+          <el-form-item
+            prop="outHelp">
+            <el-input v-if="isTrue" v-model="row.outHelp"></el-input>
+            <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>
+            <div v-else>{{ row.inHelp }}</div>
+          </el-form-item>
+        </template>
+        <!--////-->
+        <!--  ///  质检员反馈 -->
+        <template v-slot:improveCorrect="{ row,$index }">
+          <el-form-item
+            :prop="'detailList.'+$index+'.improveCorrect'"
+            :rules="{required:true,trigger:'blur',message:'请输入'}">
+            <el-input v-if="isTrue" v-model="row.improveCorrect"></el-input>
+            <div v-else>{{ row.improveCorrect }}</div>
+          </el-form-item>
+        </template>
+        <template v-slot:improveOpinion="{ row,$index }">
+          <el-form-item
+            :prop="'detailList.'+$index+'.improveOpinion'"
+            :rules="{required:true,trigger:'blur',message:'请输入'}">
+            <el-input v-if="isTrue" v-model="row.improveOpinion"></el-input>
+            <div v-else>{{ row.improveOpinion }}</div>
+          </el-form-item>
+        </template>
+        <!--////-->
+
+      </ele-pro-table>
+    </el-form>
+    <!--出库详情-->
+    <outbound-details-dialog v-if="outboundDetailsDialogFlag" ref="outboundDetailsDialogRef"
+                             :outboundDetailsDialogFlag.sync="outboundDetailsDialogFlag"
+                             @saveDate="saveDate"></outbound-details-dialog>
+    <head-list ref="headRef" @changeParent="changeHead"></head-list>
+  </div>
+
+</template>
+
+
+<script>
+
+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";
+
+export default {
+  name: "customerReturnOrder",
+  props: {
+    taskDefinitionKey: {
+      type: String,
+      default: 'stater',
+    },
+    activeComp: {
+      type: String,
+      default: 'stater',
+    },
+    permissionType: {
+      type: String,
+      default: 'view',
+    },
+    businessId: {
+      type: String,
+      default: '',
+    },
+  },
+  components: {outboundDetailsDialog, headList},
+  data() {
+    return {
+      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: 80,
+          prop: 'packageCount',
+          label: '包装数量',
+          align: 'center',
+          slot: 'packageCount',
+          headerSlot: 'headerPackingCount'
+        },
+        {
+          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: 'headerEngrave'
+        },
+      ]
+      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
+    }
+  },
+  mounted() {
+    this.getReturnInfo(this.businessId)
+  },
+  methods: {
+    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)
+        //出库物料明细
+        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)
+            }
+          })
+          //出库物料明细
+          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.$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);
+    },
+
+
+    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)
+          }
+
+        })
+      })
+
+
+    },
+  }
+}
+</script>
+<style scoped lang="scss">
+
+</style>

+ 108 - 0
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/customerReturnOrderDialog.vue

@@ -0,0 +1,108 @@
+<template>
+  <div>
+    <el-card shadow="never" v-loading="loading">
+      <div class="switch">
+        <div class="switch_left">
+          <ul>
+            <li
+              v-for="item in tabOptions"
+              :key="item.key"
+              :class="{ active: activeComp == item.key }"
+              @click="handleCard(item)"
+            >
+              {{ item.name }}
+            </li>
+          </ul>
+        </div>
+      </div>
+    </el-card>
+    <component :is="customerReturnOrder"
+               :key="key"
+               ref="componentRef"
+               :taskDefinitionKey="taskDefinitionKey"
+               :activeComp="activeComp"
+               :businessId="businessId"
+               :permissionType="permissionType"/>
+  </div>
+
+</template>
+
+
+<script>
+
+
+import {EventBus} from "./eventBus.js";
+
+export default {
+  name: "customerReturnOrderDialog",
+  props: {
+    taskDefinitionKey: {
+      type: String,
+      default: 'stater',
+    },
+    businessId: {
+      type: String,
+      default: ''
+    }
+  },
+  components: {
+    customerReturnOrder: () => import('./customerReturnOrder')
+  },
+
+  data() {
+    return {
+      dialogType: 'add',
+      customerReturnOrder: 'customerReturnOrder',
+      tabOptions: [
+        {key: 'stater', permissionType: 'update', name: '发起人申请'},
+        {key: 'deptLeader', permissionType: 'view', name: '销售主管审批'},
+        {key: 'storeman', permissionType: 'update', name: '仓管入库'},
+        {key: 'QCLeader', permissionType: 'view', name: '质量部主管指派'},
+        {key: 'QCApprove', permissionType: 'update', name: '质检员审核'},
+        {key: 'techLeader', permissionType: 'view', name: '技术部主管指派'},
+        {key: 'techApprove', permissionType: 'update', name: '技术员审核'},
+        {key: 'produceLeader', permissionType: 'view', name: '生产部主管指派'},
+        {key: 'produceApprove', permissionType: 'update', name: '生产员审核'},
+        {key: 'QCApprove2', permissionType: 'update', name: '质检员反馈'},
+      ],
+      activeComp: '',
+      permissionType: '',
+      loading: false,
+      key: 1,
+    }
+  },
+  computed: {},
+  created() {
+    this.activeComp = this.taskDefinitionKey || 'stater'
+    this.permissionType = this.tabOptions.find(item => item.key == this.activeComp).permissionType
+
+  },
+  mounted() {
+   setTimeout(()=>{
+     this.getActiveCompValue()
+   },400)
+  },
+  methods: {
+    getTableValue() {
+      return this.$refs.componentRef.getTableValue()
+    },
+    handleCard(val) {
+      this.activeComp = val.key
+      this.permissionType = val.permissionType
+      this.key++
+      this.getActiveCompValue()
+    },
+    getActiveCompValue() {
+      console.log(1111);
+      EventBus.$emit('getActiveCompValue', {activeComp: this.activeComp, permissionType: this.permissionType})
+    },
+    async getInfo() {
+
+
+    }
+  }
+}
+</script>
+<style scoped lang="scss">
+
+</style>

+ 3 - 0
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/eventBus.js

@@ -0,0 +1,3 @@
+// event-bus.js
+import Vue from 'vue'
+export const EventBus = new Vue()

+ 744 - 0
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/outboundDetailsDialog.vue

@@ -0,0 +1,744 @@
+<template>
+  <ele-modal
+    custom-class="ele-dialog-form long-dialog-form"
+    :centered="true"
+    :visible.sync="outboundDetailsDialogFlag"
+    :title="title"
+    append-to-body
+    :close-on-click-modal="false"
+    width="80%"
+    :before-close="cancel">
+    <div>
+      <div class="content-detail">
+        <header-title title="基本信息" size="16px"></header-title>
+
+        <div class="mt20">
+          <el-form label-width="110px">
+            <el-col :span="8">
+              <el-form-item label="出库单号">
+                <span>{{ infoData.bizNo }}</span>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="出库物品类型">
+                  <span>{{
+                      infoData.bizType == 3
+                        ? '物品'
+                        : getDictValue('类型用途', infoData.assetType)
+                    }}</span>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="出库场景">
+                <!--                <span>{{ getSceneState(infoData.bizType) }}</span>-->
+              </el-form-item>
+            </el-col>
+            <el-col :span="8" v-if="infoData.bizType == 3">
+              <el-form-item label="客户名称">
+                <span>{{ infoData.clientName }}</span>
+              </el-form-item>
+            </el-col
+            >
+            <el-col :span="8" v-if="infoData.bizType == 3">
+              <el-form-item label="客户联系人">
+                <span>{{ infoData.clientUser }}</span>
+              </el-form-item>
+            </el-col
+            >
+            <el-col :span="8" v-if="infoData.bizType == 3">
+              <el-form-item label="客户电话">
+                <span>{{ infoData.clientPhone }}</span>
+              </el-form-item>
+            </el-col>
+
+            <el-col :span="8">
+              <el-form-item
+                :label="infoData.bizType == 4 ? '领料单' : '来源单据'"
+              >
+                <span>{{ infoData.sourceBizNo }}</span>
+              </el-form-item>
+            </el-col>
+
+            <el-col :span="8">
+              <el-form-item label="领料人联系方式">
+                <span>{{ infoData.fromUserPhone }}</span>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="出库登记人">
+                <span>{{ infoData.extInfo?.createUserName }}</span>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="权属部门">
+                <span>{{ infoData.extInfo?.deptName }}</span>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="创建时间">
+                <span>{{ infoData.createTime }}</span>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="出库时间">
+                <span>{{ infoData.createTime }}</span>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="状态:">
+                <span>{{ stepsTitle }}</span>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="领料人部门">
+                <span>{{ infoData.verifyDeptName }}</span>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="领料人">
+                <span>{{ infoData.fromUser }}</span>
+              </el-form-item>
+            </el-col>
+            <el-col :span="16">
+              <el-form-item label="备注">
+                <span>{{ infoData.remark }}</span>
+              </el-form-item>
+            </el-col>
+          </el-form>
+        </div>
+      </div>
+      <div class="content-detail mt20">
+        <header-title title="出库物品明细" size="16px"></header-title>
+        <div class="mt20">
+          <div class="mt10">
+            <el-table
+              ref="multipleTable"
+              :data="warehousingMaterialList"
+              tooltip-effect="dark"
+              style="width: 100%"
+
+              stripe
+              :header-cell-style="{ background: '#EEEEEE', border: 'none' }"
+            >
+              <!--              <el-table-column-->
+              <!--                align="center"-->
+              <!--                type="selection"-->
+              <!--                width="55">-->
+              <!--              </el-table-column>-->
+              <el-table-column label="序号" type="index" width="50">
+              </el-table-column>
+              <el-table-column
+                label="编码"
+                prop="categoryCode"
+              ></el-table-column>
+              <el-table-column label="名称" prop="name"></el-table-column>
+              <el-table-column
+                label="批次号"
+                prop="batchNo"
+              ></el-table-column>
+              <el-table-column label="最小包装单元" width="120">
+                <template slot-scope="{ row }">
+                  {{ row.minPackingCount }}{{ row.measuringUnit }}/{{
+                    row.packingUnit
+                  }}
+                </template>
+              </el-table-column>
+              <el-table-column label="包装数量" prop="availableCountBase">
+                <template slot-scope="{ row }">
+                  {{ row.packingCount }}{{ row.packingUnit }}
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="计量数量"
+                prop="count"
+              ></el-table-column>
+              <el-table-column
+                label="计量单位"
+                prop="measuringUnit"
+              ></el-table-column>
+              <el-table-column label="重量" prop="weight"></el-table-column>
+              <el-table-column
+                label="重量单位"
+                prop="weightUnit"
+              ></el-table-column>
+              <el-table-column label="单价">
+                <template slot-scope="{ row }">
+                  {{ row.price ? row.price : '-' }}元/{{ row.measuringUnit }}
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="金额"
+                prop="totalMoney"
+              ></el-table-column>
+              <el-table-column label="领料部门" prop="llbm"></el-table-column>
+            </el-table>
+          </div>
+        </div>
+      </div>
+      <!-- ${
+            infoData.bizType == 3
+              ? '物品'
+              : getDictValue('类型用途', infoData.assetType)
+          }明细 -->
+      <div class="mt20">
+        <header-title :title="`出库包装明细`" size="16px"></header-title>
+        <el-table
+          ref="multipleTable"
+          :data="materialCodeReqList"
+          tooltip-effect="dark"
+          style="width: 100%"
+          @selection-change="selectionChange2"
+          stripe
+          :header-cell-style="{ background: '#EEEEEE', border: 'none' }"
+        >
+          <el-table-column
+            align="center"
+            type="selection"
+            width="55">
+          </el-table-column>
+          <el-table-column label="序号" type="index" width="50">
+          </el-table-column>
+          <!-- ${
+              infoData.bizType == 3
+                ? '物品'
+                : getDictValue('类型用途', infoData.assetType)
+            } -->
+          <el-table-column
+            :label="`编码`"
+            prop="categoryCode"
+          ></el-table-column>
+          <el-table-column :label="`名称`" prop="name"></el-table-column>
+          <el-table-column label="批次号" prop="batchNo"></el-table-column>
+          <el-table-column
+            label="包装编码"
+            prop="code"
+            width="80"
+          ></el-table-column>
+          <el-table-column label="包装数量" prop="packingCount" width="80">
+            <template slot-scope="{ row }">
+              {{ row.packingCount == 0 ? '0' : row.packingCount }}
+            </template>
+          </el-table-column>
+          <el-table-column
+            label="包装单位"
+            prop="packingUnit"
+          ></el-table-column>
+          <el-table-column
+            label="计量数量"
+            prop="totalCount"
+          ></el-table-column>
+          <el-table-column
+            label="计量单位"
+            prop="measuringUnit"
+          ></el-table-column>
+          <!-- <el-table-column label="领料部门" prop=""></el-table-column> -->
+          <el-table-column
+            v-if="infoData.bizType == 2 || infoData.bizType == 1"
+            label="物料代号"
+            prop="materielCode"
+          >
+            <template slot-scope="{ row }">
+              {{ row.materielCode }}
+            </template>
+          </el-table-column>
+          <el-table-column
+            v-if="infoData.bizType == 2 || infoData.bizType == 1"
+            label="客户代号"
+            prop="clientCode"
+          >
+            <template slot-scope="{ row }">
+              {{ row.clientCode }}
+            </template>
+          </el-table-column>
+          <!-- v-if="infoData.bizType == 1" -->
+          <el-table-column label="刻码" prop="engrave">
+            <template slot-scope="{ row }">
+              {{ row.engrave }}
+            </template>
+          </el-table-column>
+          <el-table-column label="重量" prop="weight">
+            <template slot-scope="{ row }">
+              {{ row.weight }}
+            </template>
+          </el-table-column>
+          <el-table-column label="重量单位" prop="weightUtil">
+            <template slot-scope="{ row }">
+              {{ row.weightUtil }}
+            </template>
+          </el-table-column>
+
+          <el-table-column label="日期" prop="createTime" width="200">
+            <template slot="header" slot-scope="scope">
+              <!-- {{ dateTypes != 1 ? '采购日期' : '生产日期' }} -->
+              采购日期
+            </template>
+            <template slot-scope="{ row }">
+              {{ row.createTime }}
+            </template>
+          </el-table-column>
+          <el-table-column label="领料部门" prop="">
+            <template slot-scope="{ row }">
+              {{ row.llbm }}
+            </template>
+          </el-table-column>
+          <!-- <el-table-column label="转消耗" prop="">
+            <template slot-scope="{ row }">
+              <el-checkbox
+                disabled
+                v-model="row.isTransferAsset"
+              ></el-checkbox>
+            </template>
+          </el-table-column> -->
+        </el-table>
+      </div>
+      <div class="mt20">
+        <header-title :title="`出库物料明细`" size="16px"></header-title>
+        <el-table
+          ref="multipleTable1"
+          :data="metaList"
+          tooltip-effect="dark"
+          style="width: 100%"
+          @selection-change="selectionChange3"
+          stripe
+          :header-cell-style="{ background: '#EEEEEE', border: 'none' }"
+        >
+          <el-table-column
+            align="center"
+            type="selection"
+            width="55">
+          </el-table-column>
+          <el-table-column label="序号" type="index" width="50">
+          </el-table-column>
+          <el-table-column label="编码" prop="assetCode"></el-table-column>
+          <el-table-column label="名称" prop="assetName"></el-table-column>
+          <el-table-column label="批次号" prop="batchNo"></el-table-column>
+          <el-table-column label="物料编码" prop="no"></el-table-column>
+          <el-table-column label="计量数量" prop="">
+            <template slot-scope="{ row }">1</template>
+          </el-table-column>
+          <el-table-column label="计量单位" prop="measuringUnit">
+          </el-table-column>
+          <el-table-column label="物料代号" prop="meterielCode">
+          </el-table-column>
+          <el-table-column label="客户代号" prop="clientCode">
+          </el-table-column>
+          <el-table-column label="刻码" prop="engrave"></el-table-column>
+          <el-table-column label="重量" prop="weight"></el-table-column>
+          <el-table-column label="重量单位" prop="weightUnit">
+          </el-table-column>
+        </el-table>
+      </div>
+    </div>
+
+    <div slot="footer">
+      <el-button type="primary" @click="handleSave">保存</el-button>
+      <el-button type="info" @click="cancel">关闭</el-button>
+    </div>
+
+  </ele-modal>
+
+</template>
+
+<script>
+
+// import { getInfo } from '@/api/stockManagement/outgoingManagement' '@/components/PageHeader'
+// import PageHeader from '@/components/PageHeader';
+// import { tableHeader } from '../common';
+import {mapGetters, mapActions} from 'vuex';
+//import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
+
+// import {
+//   materialType,
+//   warehousingType,
+//   useDict,
+//   useDictLabel,
+//   inputStatus,
+//   outputSceneState,
+//   auditStatus
+// } from '@/utils/dict/index';
+import {getUser} from '@/api/system/user';
+import {getOutInByIdAPI} from "@/api/bpm/components/saleManage/saleorder";
+import {deepClone} from "@/utils";
+
+export default {
+  props: {
+    outboundDetailsDialogFlag: {
+      type: Boolean,
+      default: false
+    }
+  },
+  data() {
+    return {
+      title: '信息',
+      selectionChangeList: [],
+      selectionChangeList2: [],
+      selectionChangeList3: [],
+      metaList: [],
+      infoData: {},
+      warehousingMaterialList: [],
+      materialCodeReqList: [],
+      tableData2: [],
+      fromUserList: [],
+
+      num: 1,
+      stepsList: [
+        {status: 'Done', nodeName: '创建'},
+        {status: 'Done', nodeName: '暂存', time: '2023-01-06'},
+        {status: 'Done', nodeName: '收货中'},
+        {status: 'Processing', nodeName: '已收货'}
+      ],
+      list: [
+        {
+          name: '紧急',
+          color: 'red'
+        },
+        {
+          name: '重要',
+          color: 'blue'
+        },
+        {
+          name: '已催办',
+          color: 'red'
+        }
+      ],
+      stepsTitle: '已完成',
+      stepsStatus: 'success',
+      active: 0
+    };
+  },
+  watch: {},
+  computed: {
+    ...mapGetters(['getDictValue']),
+    // tableHeader() {
+    //   return tableHeader(this.infoData?.extInfo?.assetType);
+    // }
+  },
+
+  created() {
+    //
+    // this.getUser();
+    // this._getInfo();
+    // this.requestDict('类型用途');
+  },
+  methods: {
+    async init(row = {}) {
+      const data = await getOutInByIdAPI(row.sendNo)
+      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)
+          }
+        })
+        //出库物料明细
+        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)
+            }
+          })
+        }
+      }
+
+    },
+    getUserName(id) {
+      let obj = this.fromUserList.find((x) => x.id == id);
+      return obj && obj.name;
+    },
+    async getUser() {
+      let res22 = await warehouseDefinition.getUserPage({
+        groupId: 1,
+        size: 9999,
+        page: 1
+      });
+      this.fromUserList = res22.list;
+    },
+    // selectionChange(val){
+    //   this.selectionChangeList = val
+    // },
+    selectionChange2(val) {
+      this.selectionChangeList2 = val
+      console.log(this.selectionChangeList2);
+    },
+    selectionChange3(val) {
+      this.selectionChangeList3 = val
+      console.log(this.selectionChangeList3);
+    },
+    handleSave() {
+      if (!this.selectionChangeList2.length && !this.selectionChangeList3.length) return this.$message.warning('请选择退货明细')
+      let params = [
+        ...this.selectionChangeList2,
+        ...this.selectionChangeList3
+      ]
+      this.$emit('saveDate',params)
+      this.cancel()
+    },
+    cancel() {
+      this.$emit('update:outboundDetailsDialogFlag', false)
+    },
+    ...mapActions('dict', ['requestDict']),
+
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.stepsStatus {
+  width: 40%;
+  margin: 0 auto;
+}
+
+.p20 {
+  padding: 20px;
+}
+
+.flex {
+  display: flex;
+}
+
+.title {
+  justify-content: space-between;
+  border-bottom: 1px solid #ccc;
+  padding-bottom: 5px;
+
+  span {
+    font-size: 16px;
+  }
+
+  .col {
+    padding-left: 40px;
+    font-size: 14px;
+    color: #aaaaaa;
+  }
+}
+
+.degree {
+  margin-right: 10px;
+  padding: 0px 15px;
+  color: #fff;
+  font-size: 13px;
+  line-height: 23px;
+  border-radius: 23px;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+
+  span {
+    width: 5px;
+    height: 5px;
+    border-radius: 100%;
+    margin-right: 6px;
+    background-color: #fff;
+  }
+}
+
+.red {
+  background-color: rgb(163, 0, 20);
+}
+
+.blue {
+  background-color: #1989fa;
+}
+
+.createdInfo {
+  justify-content: space-around;
+  margin-top: 10px;
+  font-size: 14px;
+
+  .col {
+    color: #6e6e6e;
+    padding-right: 10px;
+  }
+}
+
+.mt40 {
+  margin-top: 40px;
+}
+
+.custSteps {
+  margin-top: 20px;
+  margin-left: 70px;
+
+  .box {
+    width: 158px;
+    border: 1px solid #ccc;
+    padding: 10px;
+    flex-direction: row;
+    flex-wrap: wrap;
+    // justify-content: space-between;
+    font-size: 12px;
+    color: #9e9e9e;
+
+    .x {
+      width: 20px;
+      height: 15px;
+      margin-right: 5px;
+    }
+
+    .q {
+      background-color: #d0e4d5;
+    }
+
+    .b {
+      background-color: #1989fa;
+    }
+
+    .g {
+      background-color: #157a2c;
+    }
+
+    .r {
+      background-color: #a30014;
+    }
+
+    .a {
+      align-items: center;
+      margin-bottom: 10px;
+    }
+
+    .mr10 {
+      margin-right: 10px;
+    }
+
+    .mb0 {
+      margin-bottom: 0;
+    }
+  }
+
+  .stepsInfo {
+    // flex: 1;
+    width: 483px;
+  }
+}
+
+.mt20 {
+  margin-top: 20px;
+}
+
+.content-detail {
+  overflow: hidden;
+}
+
+.executor {
+  font-size: 14px;
+
+  .col {
+    color: #6e6e6e;
+    padding-right: 10px;
+  }
+}
+
+.result {
+  justify-content: space-around;
+}
+
+.mr20 {
+  margin-right: 20px;
+}
+
+.details {
+  font-size: 14px;
+  margin-bottom: 10px;
+}
+
+.customSteps {
+  margin-top: 40px;
+  font-size: 14px;
+  margin-left: 80px;
+
+  .time {
+    font-size: 12px;
+    color: #6e6e6e;
+    margin-right: 20px;
+    position: relative;
+
+    &::after {
+      content: '';
+      width: 1px;
+      height: 100%;
+      background-color: #157a2c;
+      position: absolute;
+      right: -26px;
+    }
+  }
+
+  .flex:last-child {
+    .time {
+      &::after {
+        display: none;
+      }
+    }
+  }
+
+  .round {
+    margin-right: 20px;
+    width: 10px;
+    height: 10px;
+    border-radius: 100%;
+    background-color: #157a2c;
+    position: relative;
+
+    span {
+      position: absolute;
+      top: 50%;
+      left: 50%;
+      width: 4px;
+      height: 4px;
+      background-color: #fff;
+      border-radius: 100%;
+      transform: translate(-2px, -2px);
+    }
+  }
+
+  .text {
+    .info {
+      margin-top: 10px;
+      width: 955px;
+      background-color: #f0f3f3;
+      overflow: hidden;
+      padding: 10px;
+      margin-bottom: 10px;
+    }
+  }
+}
+</style>

+ 166 - 0
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/submit.vue

@@ -0,0 +1,166 @@
+<template>
+  <el-col :span="16" :offset="6" v-if="activeComp==taskDefinitionKey">
+    <el-form label-width="100px" ref="formRef" :rules="rules" :model="form">
+
+      <el-form-item
+        v-if="['QCLeader','techLeader','produceLeader'].includes(taskDefinitionKey)"
+        label="负责人"
+        prop="userId"
+        style="margin-bottom: 20px"
+        :rules="{
+          required: true,
+          message: '请选择',
+          trigger: 'change'
+        }"
+      >
+        <el-select
+          v-model="form.userId"
+          clearable
+          style="width: 100%"
+          :filterable="true"
+        >
+          <el-option
+            v-for="item in userOptions"
+            :key="item.id"
+            :label="item.name"
+            :value="item.id"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        label="审批建议"
+        prop="reason"
+        style="margin-bottom: 20px">
+        <el-input
+          type="textarea"
+          v-model="form.reason"
+          placeholder="请输入审批建议"
+        />
+      </el-form-item>
+
+    </el-form>
+    <div style="margin-left: 10%; margin-bottom: 20px; font-size: 14px">
+      <el-button
+        icon="el-icon-edit-outline"
+        type="success"
+        size="mini"
+        @click="handleAudit(1)"
+      >通过
+      </el-button>
+
+      <el-button
+        icon="el-icon-circle-close"
+        type="danger"
+        size="mini"
+        v-if="taskDefinitionKey!=='stater'"
+        @click="handleAudit(0)">驳回
+      </el-button>
+
+    </div>
+  </el-col>
+</template>
+
+<script>
+import {
+  approveTaskWithVariablesAPI, saleReturnUpdateAPI
+} from '@/api/bpm/components/saleManage/saleorder';
+import {listAllUserBind} from '@/api/system/organization';
+import {EventBus} from "./eventBus.js";
+// 流程实例的详情页,可用于审批
+//qcId techId produceId
+export default {
+  name: '',
+  components: {
+    //   Parser
+  },
+  props: {
+    businessId: {
+      default: ''
+    },
+    taskId: {
+      default: ''
+    },
+    id: {
+      default: ''
+    },
+    taskDefinitionKey: {
+      default: ''
+    }
+  },
+  data() {
+    return {
+      form: {
+        userId: '',
+        reason: ''
+      },
+      submitParams: {
+        QCLeader: 'qcId',
+        techLeader: 'techId',
+        produceLeader: 'produceId',
+      },
+      rules: {
+        reason: {required: true, message: '请输入审批建议', trigger: 'blur'},
+        userId: {required: true, message: '请选择指派人', trigger: 'change'}
+      },
+      userOptions: [],
+      activeComp: '',
+      permissionType: '',
+    };
+  },
+  async created() {
+    this.userOptions = [];
+    listAllUserBind().then((data) => {
+      this.userOptions.push(...data);
+    });
+    this.activeComp = this.taskDefinitionKey;
+    EventBus.$on("getActiveCompValue", (row) => {
+      this.activeComp = row.activeComp;
+      this.permissionType = row.permissionType;
+    });
+  },
+  mounted() {
+  },
+  methods: {
+    //保存表格数据
+    async handleAudit(pass) {
+      let data = await this.getTableValue()
+      this.$refs.formRef.validate(async validate => {
+        if ((!validate || !data) && !!pass) return this.$message.warning('有必填项未填,请检查')
+        if (this.permissionType == 'update') await saleReturnUpdateAPI(data)
+        let variables = {
+          pass: !!pass,
+        }
+        if (this.submitParams[this.taskDefinitionKey]) {
+          variables[this.submitParams[this.taskDefinitionKey]] = this.form.userId
+        }
+        approveTaskWithVariablesAPI({
+          id: this.taskId,
+          reason: this.form.reason,
+          variables
+        }).then((res) => {
+          if (res.code != '-1') {
+            this.$emit('handleAudit', {
+              status: pass,
+              title: !pass ? '驳回' : ''
+            });
+          }
+        });
+      })
+
+    },
+
+    getTableValue() {
+      return new Promise((resolve, reject) => {
+        this.$emit('getTableValue', async (data) => {
+          resolve(await data);
+        });
+      });
+    }
+  },
+  beforeDestroy() {
+    EventBus.$off('getActiveCompValue')
+  }
+};
+</script>
+
+<style lang="scss"></style>

+ 2 - 2
src/views/bpm/handleTask/components/saleOrder/returnGoods/submit.vue

@@ -176,7 +176,7 @@
           if (data.code != '0') {
           if (data.code != '0') {
             return;
             return;
           }
           }
-          
+
         }
         }
         this.approveTaskWithVariables(status, returnType);
         this.approveTaskWithVariables(status, returnType);
       },
       },
@@ -190,7 +190,7 @@
           operateType: status == 0 ? 2 : 1,
           operateType: status == 0 ? 2 : 1,
           returnType
           returnType
         }).then((res) => {
         }).then((res) => {
-          if (res.data.code != '-1') {
+          if (res.code != '-1') {
             this.$emit('handleAudit', {
             this.$emit('handleAudit', {
               status,
               status,
               title: status === 0 ? '驳回' : ''
               title: status === 0 ? '驳回' : ''