liujt 7 месяцев назад
Родитель
Сommit
a32ac80394
31 измененных файлов с 3436 добавлено и 1535 удалено
  1. 10 0
      src/BIZComponents/processSubmitDialog/api.js
  2. 296 0
      src/BIZComponents/processSubmitDialog/components/SHGDListDialog.vue
  3. 99 0
      src/BIZComponents/processSubmitDialog/components/work-search.vue
  4. 706 576
      src/BIZComponents/processSubmitDialog/processSubmitDialog.vue
  5. 59 0
      src/api/bpm/components/salesServiceManagement/return.js
  6. 16 2
      src/enum/dict.js
  7. 4 0
      src/views/bpm/collaborative/detail.vue
  8. 589 562
      src/views/bpm/collaborative/index.vue
  9. 7 2
      src/views/bpm/handleTask/components/bomApproverJSYY/detailDialog.vue
  10. 6 1
      src/views/bpm/handleTask/components/bomApproverJSdevice/detailDialog.vue
  11. 1 0
      src/views/bpm/handleTask/components/businessOpportunity/opportunityDetailDialog.vue
  12. 3 0
      src/views/bpm/handleTask/components/contractBook/detailDialog.vue
  13. 1 1
      src/views/bpm/handleTask/components/materialPlan/detailDialog.vue
  14. 130 61
      src/views/bpm/handleTask/components/mesBatchRecordManage/detailDialog.vue
  15. 2 2
      src/views/bpm/handleTask/components/mesWorkOrderChecklist/detailDialog.vue
  16. 227 242
      src/views/bpm/handleTask/components/outsourcedWarehousing/components/details.vue
  17. 5 5
      src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/customerReturnOrder.vue
  18. 7 7
      src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/customerReturnOrderDialog.vue
  19. 238 0
      src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/purchaseList.vue
  20. 11 5
      src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/repair-tabs-page.vue
  21. 3 1
      src/views/bpm/handleTask/components/saleOrder/detailDialog.vue
  22. 3 0
      src/views/bpm/handleTask/components/saleOrder/invoice/detailDialog.vue
  23. 40 4
      src/views/bpm/handleTask/components/saleOrder/returnGoods/detailDialog.vue
  24. 112 28
      src/views/bpm/handleTask/components/saleOrder/returnGoods/submit.vue
  25. 200 0
      src/views/bpm/handleTask/components/salesServiceManagement/demand/submit.vue
  26. 259 0
      src/views/bpm/handleTask/components/salesServiceManagement/return/recycleDialog.vue
  27. 200 0
      src/views/bpm/handleTask/components/salesServiceManagement/return/submit.vue
  28. 57 4
      src/views/bpm/handleTask/formParser/formParserDialog.vue
  29. 8 5
      src/views/bpm/outgoingManagement/outbound.vue
  30. 135 26
      src/views/bpm/stockManagement/storage.vue
  31. 2 1
      vue.config.js

+ 10 - 0
src/BIZComponents/processSubmitDialog/api.js

@@ -86,3 +86,13 @@ export async function contactPageUsages(params) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+//获取工单
+export async function getSalesWorkOrder(data) {
+  const res = await request.get('/eom/afterSalesWorkOrder/page', {
+    params: data
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 296 - 0
src/BIZComponents/processSubmitDialog/components/SHGDListDialog.vue

@@ -0,0 +1,296 @@
+<template>
+  <ele-modal
+    title="售后工单查询"
+    custom-class="ele-dialog-form long-dialog-form"
+    :visible.sync="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    width="70%"
+    :maxable="true"
+    :resizable="true"
+  >
+    <el-card shadow="never" v-loading="loading">
+      <work-search
+        class="seep-search"
+        ref="workSearch"
+        :levelList="levelList"
+        @search="reload"
+      ></work-search>
+
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        row-key="id"
+        height="calc(100vh - 500px)"
+        class="dict-table"
+      >
+        <template v-slot:toolbar></template>
+        <template v-slot:faultLevel="{ row }">
+          {{ levelData[row.faultLevel] || '' }}
+        </template>
+       <template v-slot:selection="{ row }">
+  <div class="radio-container">
+    <el-radio
+      v-model="selectedRowId"
+      :label="row.id"
+      @change="() => selectedRow = row"
+    ><span></span></el-radio>
+  </div>
+</template>
+      </ele-pro-table>
+    </el-card>
+
+    <div class="btns" slot="footer">
+      <el-button 
+        type="primary" 
+        size="small" 
+        :disabled="!selectedRow"
+        @click="handleConfirm"
+      >
+        确认
+      </el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+import workSearch from './work-search.vue';
+import { getSalesWorkOrder } from '@/BIZComponents/processSubmitDialog/api';
+import { getByCode } from '@/api/system/dictionary-data';
+import dictMixins from '@/mixins/dictMixins';
+
+export default {
+  mixins: [dictMixins],
+  components: {
+    workSearch
+  },
+  data() {
+    return {
+      visible: false,
+      loading: false,
+      levelData: {},
+      levelList: [],
+      selectedRowId: null,
+      selectedRow: null,  // 存储选中的完整行数据
+      columns: [
+        {
+          columnKey: 'selection',
+          label: '选择',
+          slot: 'selection',
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'  // 固定选择列在左侧,避免滚动后看不到
+        },
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          prop: 'code',
+          label: '工单编号',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 150
+        },
+        {
+          prop: 'planCode',
+          label: '计划单号',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'planName',
+          label: '计划名称',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'executeUserName',
+          label: '报工人',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'accepterUserName',
+          label: '验收人',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          slot: 'faultLevel',
+          prop: 'faultLevel',
+          label: '故障等级',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'contactName',
+          label: '客户名称',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'categoryName',
+          label: '设备名称',
+          align: 'center',
+          minWidth: 110,
+          showOverflowTooltip: true,
+          formatter: (row) => {
+            if (!row.deviceDetails) return '';
+            return row.deviceDetails.map((el) => el.categoryName).join(',');
+          }
+        },
+        {
+          prop: 'accepterTime',
+          label: '验收时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'totalCost',
+          label: '费用( 元 )',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          columnKey: 'inFactDuration',
+          label: '工时',
+          align: 'center',
+          resizable: false,
+          showOverflowTooltip: true,
+          minWidth: 120,
+          formatter: (row) => {
+            if (row.inFactDuration || row.inFactDuration === 0) {
+              return `${((row.inFactDuration - 0) / 60).toFixed(1)} 小时`;
+            }
+            return '';
+          }
+        },
+        {
+          prop: 'orderStatus',
+          label: '状态',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110,
+          formatter: (row) => {
+            const statusMap = {
+              0: '待执行',
+              1: '已接收',
+              2: '执行中',
+              3: '待验收',
+              4: '待评价',
+              5: '已完成',
+              6: '验收不通过'
+            };
+            return statusMap[row.orderStatus] || '';
+          }
+        }
+      ]
+    };
+  },
+  created() {
+    this.getLevelCode('fault_level');
+  },
+  methods: {
+    open() {
+      this.visible = true;
+      this.reload();
+    },
+    async getLevelCode(code) {
+      const res = await getByCode(code);
+      if (res?.code === '0') {
+        this.levelData = res.data.reduce((obj, el) => {
+          const key = Object.keys(el)[0];
+          obj[key] = Object.values(el)[0];
+          return obj;
+        }, {});
+        this.levelList = res.data.map((el) => ({
+          label: Object.values(el)[0],
+          value: Object.keys(el)[0]
+        }));
+      }
+    },
+    datasource({ page, limit, where }) {
+      this.loading = true;
+      const params = {
+        pageNum: page,
+        size: limit,
+        ...where
+      };
+      return getSalesWorkOrder(params).finally(() => {
+        this.loading = false;
+      });
+    },
+    reload(where = {}) {
+      this.$refs.table?.reload({
+        pageNum: 1,
+        where: where
+      });
+    },
+    handleConfirm() {
+      if (this.selectedRow) {
+        console.log(this.selectedRow)
+        
+        this.$emit('changeParent', this.selectedRow);
+        this.handleClose();  // 确认后关闭弹窗
+      }
+    },
+    handleClose() {
+      this.visible = false;
+      // 重置选中状态,避免下次打开残留选中
+      this.selectedRowId = null;
+      this.selectedRow = null;
+      this.$refs.table?.reload({ pageNum: 1 });
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.seep-search {
+  margin-bottom: 16px;
+  ::v-deep .el-input__inner {
+    padding: 0 5px 0 10px;
+  }
+}
+
+.btns {
+  text-align: center;
+  padding: 10px 0;
+  button:first-child {  // 给确认按钮加右边距,和关闭按钮分隔
+    margin-right: 8px;
+  }
+}
+
+::v-deep .ele-pro-table {
+  margin-top: 8px;
+}
+
+::v-deep .el-radio {
+  vertical-align: middle;
+}
+.radio-container {
+  text-align: center; /* 让单选框居中 */
+  line-height: 1;     /* 消除行高导致的多余空间 */
+}
+::v-deep .radio-container .el-radio {
+  display: inline-block; /* 确保单选框独占空间 */
+}
+</style>

+ 99 - 0
src/BIZComponents/processSubmitDialog/components/work-search.vue

@@ -0,0 +1,99 @@
+<!-- 搜索表单 -->
+<template>
+  <seekPage ref="seekPage" :seekList="seekList" :formLength="3" @search="search"></seekPage>
+</template>
+<script>
+  export default {
+    data() {
+      return {};
+    },
+    props: {
+      levelList: {
+        type: Array,
+        default: () => []
+      }
+    },
+    computed: {
+      // 表格列配置
+      seekList() {
+        return [
+          {
+            label: '关键字:',
+            value: 'keyWord',
+            type: 'input',
+            placeholder: '单号/客户名称/设备名称'
+          },
+          {
+            label: '工单编号:',
+            value: 'code',
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '需求编码:',
+            value: 'demandCode',
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '客户名称:',
+            value: 'contactName',
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '设备名称:',
+            value: 'deviceName',
+            width: 380,
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '故障等级:',
+            value: 'faultLevel',
+            width: 380,
+            type: 'select',
+            planList: this.levelList,
+            placeholder: ''
+          },
+          {
+            label: '计划单号:',
+            value: 'planCode',
+            width: 380,
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '计划名称:',
+            value: 'planName',
+            width: 380,
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '报工人:',
+            value: 'executeUserName',
+            width: 380,
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '验收人:',
+            value: 'accepterUserName',
+            width: 380,
+            type: 'input',
+            placeholder: ''
+          }
+        ];
+      }
+    },
+    methods: {
+      /* 搜索 */
+      search(e) {
+        this.$emit('search', {
+          ...e
+        });
+      }
+    }
+  };
+</script>

+ 706 - 576
src/BIZComponents/processSubmitDialog/processSubmitDialog.vue

@@ -13,9 +13,51 @@
   >
     <div style="display: flex; height: 100%; justify-content: space-between">
       <div class="form-box">
-        <!--        <div style="text-align: center; padding: 5px">-->
-        <!--          {{ form.name }}-->
-        <!--        </div>-->
+        <el-form
+          ref="form1"
+          :rules="rules"
+          class="el-form-box"
+          :model="form"
+          label-width="90px"
+          :label-position="'left'"
+          style="padding: 10px"
+        >
+          <el-row>
+            <el-col :span="24">
+              <el-form-item label="流程分类">
+                <ele-tree-select
+                  @change="changeLCFL"
+                  clearable
+                  ref="processTypeRef"
+                  filterable
+                  :data="LCFLList"
+                  v-model="form.LCFL"
+                  childrenKey="children"
+                  valueKey="id"
+                  labelKey="name"
+                  placeholder="请选择"
+                  default-expand-all
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="发起流程">
+                <el-select
+                  filterable
+                  v-model="form.FQLC"
+                  @change="changeFQLC"
+                  style="width: 100%"
+                >
+                  <el-option
+                    v-for="item in processList"
+                    :key="item.id"
+                    :value="item.id"
+                    :label="item.name"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col> </el-row
+        ></el-form>
         <fm-generate-form
           :preview="true"
           class="el-form-box"
@@ -62,48 +104,87 @@
               </div>
             </div>
           </template>
-          
+
           <!-- 客户名称 -->
           <template v-slot:eom_contact="scope">
             <div class="eom_contact">
               <el-input
-                  v-model="scope.model.eom_contact.name"
-                  style="width: 100%"
-                  @click.native="addContact('eom_contact')"
-                ></el-input>
+                v-model="scope.model.eom_contact.name"
+                style="width: 100%"
+                @click.native="addContact('eom_contact')"
+              ></el-input>
+            </div>
+          </template>
+          <!-- 关联工单 -->
+          <template v-slot:manage_workorder="scope">
+            <div class="manage_workorder">
+              <el-input
+                v-model="scope.model.manage_workorder.code"
+                style="width: 100%"
+                @click.native="addWorkOrder('manage_workorder')"
+                placeholder="点击选择关联工单"
+              ></el-input>
             </div>
           </template>
-
           <!-- 差旅交通 -->
           <template v-slot:blank_business_component="scope">
-            <businessComponent  ref="blank_business_component" id="blank_business_component" :generateForm="$refs.generateForm" :info="scope.model"></businessComponent>
+            <businessComponent
+              ref="blank_business_component"
+              id="blank_business_component"
+              :generateForm="$refs.generateForm"
+              :info="scope.model"
+            ></businessComponent>
           </template>
 
           <!-- 印章使用 -->
           <template v-slot:blank_use_seal="scope">
-            <useSealComponent  ref="blank_use_seal" id="blank_use_seal" :generateForm="$refs.generateForm" :info="scope.model"></useSealComponent>
+            <useSealComponent
+              ref="blank_use_seal"
+              id="blank_use_seal"
+              :generateForm="$refs.generateForm"
+              :info="scope.model"
+            ></useSealComponent>
           </template>
 
           <!-- 资质使用 -->
           <template v-slot:blank_use_qualification="scope">
-            <useQualificationComponent  ref="blank_use_qualification" id="blank_use_qualification" :generateForm="$refs.generateForm" :info="scope.model"></useQualificationComponent>
+            <useQualificationComponent
+              ref="blank_use_qualification"
+              id="blank_use_qualification"
+              :generateForm="$refs.generateForm"
+              :info="scope.model"
+            ></useQualificationComponent>
           </template>
 
           <!-- 产品规格 -->
           <template v-slot:blank_product_specification="scope">
-            <productSpecificationComponent  ref="blank_product_specification" id="blank_product_specification" :generateForm="$refs.generateForm" :info="scope.model"></productSpecificationComponent>
+            <productSpecificationComponent
+              ref="blank_product_specification"
+              id="blank_product_specification"
+              :generateForm="$refs.generateForm"
+              :info="scope.model"
+            ></productSpecificationComponent>
           </template>
 
           <!-- 事件 -->
           <template v-slot:blank_event_component="scope">
-            <eventComponent  ref="blank_event_component" id="blank_event_component" :generateForm="$refs.generateForm" :info="scope.model"></eventComponent>
+            <eventComponent
+              ref="blank_event_component"
+              id="blank_event_component"
+              :generateForm="$refs.generateForm"
+              :info="scope.model"
+            ></eventComponent>
           </template>
 
           <!-- 补发 -->
           <template v-slot:blank_reissue_component="scope">
-            <reissueComponent  ref="blank_reissue_component" id="blank_reissue_component" :generateForm="$refs.generateForm" :info="scope.model"></reissueComponent>
+            <reissueComponent
+              ref="blank_reissue_component"
+              id="blank_reissue_component"
+              :generateForm="$refs.generateForm"
+              :info="scope.model"
+            ></reissueComponent>
           </template>
-
         </fm-generate-form>
       </div>
       <div
@@ -225,7 +306,11 @@
 
                 <el-tag
                   size="medium"
-                  v-if="scope.row.type === 60 || scope.row.type === 70|| scope.row.type === 80"
+                  v-if="
+                    scope.row.type === 60 ||
+                    scope.row.type === 70 ||
+                    scope.row.type === 80
+                  "
                 >
                   {{ getAssignRuleOptionName(scope.row) }}
                 </el-tag>
@@ -315,608 +400,653 @@
       ref="parentRef"
       @changeParent="handleConcatConfirm"
     ></parentList>
+    
+    <SHGDListDialog
+      ref="SHGDListDialogRef"
+      @changeParent="getSHGDData"
+    ></SHGDListDialog>
   </ele-modal>
 </template>
 <script>
-  import {
-    getModelPage,
-    getProcessDefinitionBpmnXML,
-    getProcessDefinitionInfo,
-    getTaskAssignRuleList,
-    listAllUserBind,
-    listSimpleUserGroups,
-    processInstanceCreateAPI
-  } from './api';
-  import { treeClassifyCodeEnum } from '@/enum/dict';
-  import { listRoles } from '@/api/system/role';
-  import { listOrganizations } from '@/api/system/organization';
-  import dictMixins from '@/mixins/dictMixins';
-  import { getByCode } from '@/api/system/dictionary-data';
-  import { getGroupUserTree, getProduceTreeByCode } from '@/api/main';
-  import visibilityRangeDialog from './visibilityRangeDialog.vue';
-  import { getModel } from '@/api/bpm/model';
-  import { getProcessDefinitionList } from '@/api/bpm/definition';
-  import { getToken } from '@/utils/token-util';
-  import { mapGetters } from 'vuex';
-  import staffSelection from '@/components/staffSelection/staffSelection.vue';
-  import { topLevel1, topLevel2, topLevel3 } from '@/enum/dict';
-  import dayjs from 'dayjs';
-  import parentList from './components/parentList.vue';
-  import { number } from 'echarts';
-  import { del } from 'vue';
-  import businessComponent from './components/businessComponent.vue';
-  import useSealComponent from './components/useSealComponent.vue';
-  import useQualificationComponent from './components/useQualificationComponent.vue';
-  import productSpecificationComponent from './components/productSpecificationComponent.vue';
-  import eventComponent from './components/eventComponent.vue';
-  import reissueComponent from './components/reissueComponent.vue';
-  export default {
-    name: 'processSubmitDialog',
-    components: { visibilityRangeDialog, staffSelection, parentList, businessComponent, useSealComponent, useQualificationComponent, productSpecificationComponent, eventComponent, reissueComponent },
-    mixins: [dictMixins],
-    props: {
-      processSubmitDialogFlag: {
-        type: Boolean,
-        default: false
-      }
-    },
-    watch: {
-      filterText(val) {
-        this.$refs.tree.filter(val);
-      }
-    },
-    data() {
-      return {
-        visibilityRangeDialogFlag: false,
-        isRight: false,
-        jsonData: {},
-        form: {
-          LCFL: '',
-          FQLC: '',
-          processDefinitionId: '',
-          name: '',
-          businessId: '',
-          noticeScope: [],
-          formJson: {},
-          valueJson: {},
-          businessKey: ''
-        },
-        title: '',
-        active: 0,
-        bpmnXML: null,
-        filterText: null,
-        treeList: [],
-        treeData: [],
-        defaultProps: {
-          children: 'children',
-          label: 'name'
-        },
-        LCFLList: [],
-        processList: [],
-        datasource: [],
-        roleOptions: [],
-        deptOptions: [],
-        deptTreeOptions: [],
-        postOptions: [],
-        userOptions: [],
-        userGroupOptions: [],
-        dictList: {},
-        rules: {},
-        editForm: {
-          start: '',
-          end: '',
-          days: ''
-        },
-        componentRef: ['blank_business_component', 'blank_use_seal', 'blank_use_qualification', 'blank_product_specification', 'blank_event_component', 'blank_reissue_component']
-      };
-    },
-    computed: {
-      ...mapGetters(['user']),
-      modelWidth() {
-        let width = this.jsonData.config?.platform && this.jsonData.config.platform === 'pc' ? 1100 : 450;
-        if(this.isRight) {
-          return width + 350 + 'px'
-        } else {
-          return width + 'px'
-        }
+import {
+  getModelPage,
+  getProcessDefinitionBpmnXML,
+  getProcessDefinitionInfo,
+  getTaskAssignRuleList,
+  listAllUserBind,
+  listSimpleUserGroups,
+  processInstanceCreateAPI
+} from './api';
+import { treeClassifyCodeEnum } from '@/enum/dict';
+import { listRoles } from '@/api/system/role';
+import { listOrganizations } from '@/api/system/organization';
+import dictMixins from '@/mixins/dictMixins';
+import { getByCode } from '@/api/system/dictionary-data';
+import { getGroupUserTree, getProduceTreeByCode } from '@/api/main';
+import visibilityRangeDialog from './visibilityRangeDialog.vue';
+import { getModel } from '@/api/bpm/model';
+import { getProcessDefinitionList } from '@/api/bpm/definition';
+import { getToken } from '@/utils/token-util';
+import { mapGetters } from 'vuex';
+import staffSelection from '@/components/staffSelection/staffSelection.vue';
+import { topLevel1, topLevel2, topLevel3 } from '@/enum/dict';
+import dayjs from 'dayjs';
+import parentList from './components/parentList.vue';
+import { number } from 'echarts';
+import { del } from 'vue';
+import businessComponent from './components/businessComponent.vue';
+import useSealComponent from './components/useSealComponent.vue';
+import useQualificationComponent from './components/useQualificationComponent.vue';
+import productSpecificationComponent from './components/productSpecificationComponent.vue';
+import eventComponent from './components/eventComponent.vue';
+import reissueComponent from './components/reissueComponent.vue';
+import SHGDListDialog from './components/SHGDListDialog.vue';
+export default {
+  name: 'processSubmitDialog',
+  components: {
+    visibilityRangeDialog,
+    staffSelection,
+    parentList,
+    businessComponent,
+    useSealComponent,
+    useQualificationComponent,
+    productSpecificationComponent,
+    eventComponent,
+    reissueComponent,
+    SHGDListDialog
+  },
+  mixins: [dictMixins],
+  props: {
+    processSubmitDialogFlag: {
+      type: Boolean,
+      default: false
+    }
+  },
+  watch: {
+    filterText(val) {
+      this.$refs.tree.filter(val);
+    }
+  },
+  data() {
+    return {
+      visibilityRangeDialogFlag: false,
+      isRight: false,
+      jsonData: {},
+      form: {
+        LCFL: '',
+        FQLC: '',
+        processDefinitionId: '',
+        name: '',
+        businessId: '',
+        noticeScope: [],
+        formJson: {},
+        valueJson: {},
+        businessKey: ''
+      },
+      title: '',
+      active: 0,
+      bpmnXML: null,
+      filterText: null,
+      treeList: [],
+      treeData: [],
+      defaultProps: {
+        children: 'children',
+        label: 'name'
+      },
+      LCFLList: [],
+      processList: [],
+      datasource: [],
+      roleOptions: [],
+      deptOptions: [],
+      deptTreeOptions: [],
+      postOptions: [],
+      userOptions: [],
+      userGroupOptions: [],
+      dictList: {},
+      rules: {},
+      editForm: {
+        start: '',
+        end: '',
+        days: ''
+      },
+      componentRef: [
+        'blank_business_component',
+        'blank_use_seal',
+        'blank_use_qualification',
+        'blank_product_specification',
+        'blank_event_component',
+        'blank_reissue_component'
+      ]
+    };
+  },
+  computed: {
+    ...mapGetters(['user']),
+    modelWidth() {
+      let width =
+        this.jsonData.config?.platform && this.jsonData.config.platform === 'pc'
+          ? 1100
+          : 450;
+      if (this.isRight) {
+        return width + 350 + 'px';
+      } else {
+        return width + 'px';
       }
-    },
-    async created() {
-      let typeObj = await getProduceTreeByCode(
-        treeClassifyCodeEnum['PROCESSTYPE']
-      );
-      //  await this.getTreeData();
-      this.LCFLList = typeObj[0].children;
+    }
+  },
+  async created() {
+    let typeObj = await getProduceTreeByCode(
+      treeClassifyCodeEnum['PROCESSTYPE']
+    );
+    //  await this.getTreeData();
+    this.LCFLList = typeObj[0].children;
 
-      // 获得角色列表
-      this.roleOptions = [];
-      listRoles({
-        current: 1,
-        size: 9999
-      }).then((data) => {
-        this.roleOptions.push(...data.list);
-      });
-      // 获得部门列表
-      this.deptOptions = [];
-      this.deptTreeOptions = [];
-      listOrganizations().then((data) => {
-        this.deptOptions.push(...data);
-        this.deptTreeOptions.push(...this.handleTree(data, 'id'));
-      });
-      // 获得岗位列表 暂无岗位概念
-      this.postOptions = [];
-      /*listSimplePosts().then(response => {
+    // 获得角色列表
+    this.roleOptions = [];
+    listRoles({
+      current: 1,
+      size: 9999
+    }).then((data) => {
+      this.roleOptions.push(...data.list);
+    });
+    // 获得部门列表
+    this.deptOptions = [];
+    this.deptTreeOptions = [];
+    listOrganizations().then((data) => {
+      this.deptOptions.push(...data);
+      this.deptTreeOptions.push(...this.handleTree(data, 'id'));
+    });
+    // 获得岗位列表 暂无岗位概念
+    this.postOptions = [];
+    /*listSimplePosts().then(response => {
 this.postOptions.push(...response.data);
 });*/
-      // 获得用户列表
-      this.userOptions = [];
-      listAllUserBind().then((data) => {
-        this.userOptions.push(...data);
+    // 获得用户列表
+    this.userOptions = [];
+    listAllUserBind().then((data) => {
+      this.userOptions.push(...data);
+    });
+    // 获得用户组列表
+    this.userGroupOptions = [];
+    listSimpleUserGroups().then((response) => {
+      this.userGroupOptions.push(...response);
+    });
+
+    //this.dictEnum['工作流任务分配自定义脚本']
+    await this.getDictList(this.dictEnum['工作流任务分配自定义脚本']);
+    await this.getDictList(this.dictEnum['工种类型']);
+  },
+  mounted() {
+    //this.isRight = false
+  },
+  methods: {
+    async addNewRow(key) {
+      console.log(key);
+      let data = await this.$refs.generateForm.getData(false);
+      data[key].push({
+        price: '',
+        remark: ''
       });
-      // 获得用户组列表
-      this.userGroupOptions = [];
-      listSimpleUserGroups().then((response) => {
-        this.userGroupOptions.push(...response);
+      this.$refs.generateForm.setData({
+        key: data[key]
       });
-
-      //this.dictEnum['工作流任务分配自定义脚本']
-      await this.getDictList(this.dictEnum['工作流任务分配自定义脚本']);
-      await this.getDictList(this.dictEnum['工种类型']);
     },
-    mounted() {
-      //this.isRight = false
+    async delNewRow(key, index) {
+      let data = await this.$refs.generateForm.getData(false);
+      data[key] = data[key].filter((item, index1) => index1 != index);
+      this.$refs.generateForm.setData({
+        [key]: data[key]
+      });
+      this.changePrice(data[key]);
+    },
+    changePrice(data) {
+      let num = 0;
+      data.forEach((item) => {
+        num += Number(item.price);
+      });
+      this.$refs.generateForm.setData({
+        input_jd9ouzyh: num
+      });
     },
-    methods: {
-      async addNewRow(key) {
-        console.log(key);
-        let data = await this.$refs.generateForm.getData(false);
-        data[key].push({
-          price: '',
-          remark: ''
-        });
-        this.$refs.generateForm.setData({
-          key: data[key]
-        });
-      },
-      async delNewRow(key, index) {
-        let data = await this.$refs.generateForm.getData(false);
-        data[key] = data[key].filter((item, index1) => index1 != index);
-        this.$refs.generateForm.setData({
-          [key]: data[key]
-        });
-        this.changePrice(data[key]);
-      },
-      changePrice(data) {
-        let num = 0;
-        data.forEach((item) => {
-          num += Number(item.price);
-        });
-        this.$refs.generateForm.setData({
-          input_jd9ouzyh: num
-        });
-      },
 
-      // 获取组件的中文名称,用于错误提示
-      getComponentName(componentKey) {
-        const nameMap = {
-          'blank_business_component': '差旅交通',
-          'blank_use_seal': '印章使用',
-          'blank_use_qualification': '资质使用',
-          'blank_product_specification': '产品规格',
-          'blank_event_component': '事件',
-          'blank_reissue_component': '补发信息'
-        }
-        return nameMap[componentKey] || componentKey;
-      },
+    // 获取组件的中文名称,用于错误提示
+    getComponentName(componentKey) {
+      const nameMap = {
+        blank_business_component: '差旅交通',
+        blank_use_seal: '印章使用',
+        blank_use_qualification: '资质使用',
+        blank_product_specification: '产品规格',
+        blank_event_component: '事件',
+        blank_reissue_component: '补发信息'
+      };
+      return nameMap[componentKey] || componentKey;
+    },
+
+    async addContact(type) {
+      console.log(type);
+      let data = await this.$refs.generateForm.getData(false);
+      console.log('data', data);
+      data[type] = {
+        id: '',
+        name: ''
+      };
+      this.$refs.generateForm.setData({
+        type: data[type]
+      });
+      let item = {
+        id: data[type].id
+      };
+      this.$refs.parentRef.open(item);
+    },
+    
+    async addWorkOrder(type) {
       
-      async addContact(type) {
-        console.log(type);
-        let data = await this.$refs.generateForm.getData(false);
-        console.log('data', data);
-        data[type] = {
-          id: '',
-          name: ''
+      this.$refs.SHGDListDialogRef.open();
+    },
+    getSHGDData(workOrder) {
+      if (!workOrder?.code) {
+        this.$message.warning('选中的工单缺少编码,请重新选择');
+        return;
+      }
+      this.$refs.generateForm.getData(false).then((currentFormData) => {
+        currentFormData.manage_workorder = {
+          code: workOrder.code,
+          id: workOrder.id || '',
+          name: workOrder.name || ''
         };
         this.$refs.generateForm.setData({
-          type: data[type]
+          manage_workorder: currentFormData.manage_workorder
         });
-        let item = {
-          id: data[type].id
-        };
-        this.$refs.parentRef.open(item);
-      },
-
-      async handleConcatConfirm(item) {
-        console.log('选择的客户', item);
+        this.form.valueJson.manage_workorder = currentFormData.manage_workorder;
+      });
+    },
+    async handleConcatConfirm(item) {
+      console.log('选择的客户', item);
 
-        let data = await this.$refs.generateForm.getData(false);
-        data['eom_contact'] = {
-          id: item.id,
-          name: item.name
-        }
-        this.$refs.generateForm.setData({
-          'eom_contact': data['eom_contact']
-        });
-        console.log('data~~~~', data);
-      },
-      async init(row = {}) {
-        this.title = row.name; //'新建' + row.name + '单';
-        this.form = _.cloneDeep(row);
-        this.form.formId = row.id;
-        this.$set(this.form, 'noticeScope', []);
-        this.$set(this.form, 'LCFL', '');
-        this.$set(this.form, 'FQLC', '');
-        this.$set(this.form, 'name', '');
-        this.$set(this.form, 'key', '');
-        this.$set(this.form, 'valueJson', {});
-        this.jsonData = JSON.parse(this.form.formJson.makingJson);
-        console.log('jsonData', this.jsonData);
+      let data = await this.$refs.generateForm.getData(false);
+      data['eom_contact'] = {
+        id: item.id,
+        name: item.name
+      };
+      this.$refs.generateForm.setData({
+        eom_contact: data['eom_contact']
+      });
+      console.log('data~~~~', data);
+    },
+    async init(row = {}) {
+      this.title = row.name; //'新建' + row.name + '单';
+      this.form = _.cloneDeep(row);
+      this.form.formId = row.id;
+      this.$set(this.form, 'noticeScope', []);
+      this.$set(this.form, 'LCFL', '');
+      this.$set(this.form, 'FQLC', '');
+      this.$set(this.form, 'name', '');
+      this.$set(this.form, 'key', '');
+      this.$set(this.form, 'valueJson', {});
+      this.jsonData = JSON.parse(this.form.formJson.makingJson);
+      console.log('jsonData', this.jsonData);
 
-        this.jsonData.config.dataSource &&
-          this.jsonData.config.dataSource.forEach((item) => {
-            item.headers = {
-              Authorization: getToken()
-            };
-            // item.url = item.url && item.url.replace('/api', this.APIUrl);
-          });
-        this.jsonData.list.forEach((item) => {
-          if (item.type == 'deptAndUserCascader') {
-          }
-          if (item.type == 'deptCascader') {
-            if (item.options.isDefaultLoginUser) {
-              this.form.valueJson[item.model] = this.user.info.groupIdList;
-            }
-          }
-          if (item.type == 'userSelect') {
-            if (item.options.isDefaultLoginUser) {
-              this.form.valueJson[item.model] = this.user.info.userId;
-            }
-          }
-          if (item.type == 'imgupload') {
-            // this.form.valueJson[item.model].length &&
-            //   this.form.valueJson[item.model].forEach((item) => {
-            //     //item.objectUrl = this.APIUrl +'/kd-aiot' + item.storePath
-            //     // item.objectUrl = item.url;
-            //     // console.log(item);
-            //   });
-          }
-        });
-        await this.getProcessDefinitionBpmnXMLInfo(this.form.processModelId);
-        await this.getTaskAssignRuleListInfo({
-          modelId: this.form.processModelId,
-          processDefinitionId: this.form.processDefinitionId
-        });
-        await this.getDefaultInfo(row.processModelId);
-      },
-      async getDefaultInfo(businessKey) {
-        let info = await getModel(businessKey);
-        //let info = await getProcessDefinitionInfo({ id: businessKey });
-        this.form.LCFL = info?.category;
-        this.form.FQLC = info?.id;
-        this.form.name = this.title;
-        this.form.key = info?.key;
-        if (this.form.LCFL) await this.getProcessList(this.form.LCFL);
-      },
-      async getProcessList(val) {
-        let params = {
-          pageNo: 1,
-          pageSize: 999,
-          processTypeId: val
-        };
-        const { list } = await getModelPage(params);
-        this.processList = list.filter((item) => item.processDefinition);
-      },
-      async getProcessDefinitionBpmnXML(val) {
-        this.bpmnXML = await getProcessDefinitionBpmnXML(val);
-      },
-      async getProcessDefinitionBpmnXMLInfo(val) {
-        // 加载流程图
-        let res = await getModel(val);
-        this.bpmnXML = res.bpmnXml;
-      },
-      async getTaskAssignRuleListInfo(find) {
-        this.datasource = await getTaskAssignRuleList({
-          modelId: find.modelId,
-          processDefinitionId: find.processDefinitionId
-        });
-      },
-      handleEditDataScope() {
-        this.$refs.staffSelection.open(this.form.noticeScope);
-        // this.visibilityRangeDialogFlag = true;
-        // this.$nextTick(() => {
-        //   this.$refs.visibilityRangeDialogRef.init(this.form);
-        // });
-      },
-      getTreeList(list) {
-        list.forEach((item) => {
-          item.type = 1;
+      this.jsonData.config.dataSource &&
+        this.jsonData.config.dataSource.forEach((item) => {
+          item.headers = {
+            Authorization: getToken()
+          };
+          // item.url = item.url && item.url.replace('/api', this.APIUrl);
         });
-        this.form.noticeScope = list;
-      },
-      handleCloseTag(index) {
-        this.form.noticeScope.splice(index, 1);
-      },
-      getAssignRuleOptionName(row, option) {
-        if (row.type == 10) {
-          for (const roleOption of this.roleOptions) {
-            if (roleOption.id === option) {
-              return roleOption.name;
-            }
-          }
-        } else if (row.type === 20 || row.type === 21) {
-          for (const deptOption of this.deptOptions) {
-            if (deptOption.id === option) {
-              return deptOption.name;
-            }
+      this.jsonData.list.forEach((item) => {
+        if (item.type == 'deptAndUserCascader') {
+        }
+        if (item.type == 'deptCascader') {
+          if (item.options.isDefaultLoginUser) {
+            this.form.valueJson[item.model] = this.user.info.groupIdList;
           }
-        } else if (row.type === 22) {
-          option = option + ''; // 转换成 string
-          return this.getDictV(this.dictEnum['工种类型'], option);
-        } else if (row.type === 30 || row.type === 31 || row.type === 32) {
-          for (const userOption of this.userOptions) {
-            if (userOption.id === option) {
-              return userOption.nickname || userOption.name;
-            }
+        }
+        if (item.type == 'userSelect') {
+          if (item.options.isDefaultLoginUser) {
+            this.form.valueJson[item.model] = this.user.info.userId;
           }
-        } else if (row.type === 40) {
-          for (const userGroupOption of this.userGroupOptions) {
-            if (userGroupOption.id === option) {
-              return userGroupOption.name;
-            }
+        }
+        if (item.type == 'imgupload') {
+          // this.form.valueJson[item.model].length &&
+          //   this.form.valueJson[item.model].forEach((item) => {
+          //     //item.objectUrl = this.APIUrl +'/kd-aiot' + item.storePath
+          //     // item.objectUrl = item.url;
+          //     // console.log(item);
+          //   });
+        }
+      });
+      await this.getProcessDefinitionBpmnXMLInfo(this.form.processModelId);
+      await this.getTaskAssignRuleListInfo({
+        modelId: this.form.processModelId,
+        processDefinitionId: this.form.processDefinitionId
+      });
+      await this.getDefaultInfo(row.processModelId);
+    },
+    async getDefaultInfo(businessKey) {
+      let info = await getModel(businessKey);
+      //let info = await getProcessDefinitionInfo({ id: businessKey });
+      this.form.LCFL = info?.category;
+      this.form.FQLC = info?.id;
+      this.form.name = this.title;
+      this.form.key = info?.key;
+      if (this.form.LCFL) await this.getProcessList(this.form.LCFL);
+    },
+    async getProcessList(val) {
+      let params = {
+        pageNo: 1,
+        pageSize: 999,
+        processTypeId: val
+      };
+      const { list } = await getModelPage(params);
+      this.processList = list.filter((item) => item.processDefinition);
+    },
+    async getProcessDefinitionBpmnXML(val) {
+      this.bpmnXML = await getProcessDefinitionBpmnXML(val);
+    },
+    async getProcessDefinitionBpmnXMLInfo(val) {
+      // 加载流程图
+      let res = await getModel(val);
+      this.bpmnXML = res.bpmnXml;
+    },
+    async getTaskAssignRuleListInfo(find) {
+      this.datasource = await getTaskAssignRuleList({
+        modelId: find.modelId,
+        processDefinitionId: find.processDefinitionId
+      });
+    },
+    handleEditDataScope() {
+      this.$refs.staffSelection.open(this.form.noticeScope);
+      // this.visibilityRangeDialogFlag = true;
+      // this.$nextTick(() => {
+      //   this.$refs.visibilityRangeDialogRef.init(this.form);
+      // });
+    },
+    getTreeList(list) {
+      list.forEach((item) => {
+        item.type = 1;
+      });
+      this.form.noticeScope = list;
+    },
+    handleCloseTag(index) {
+      this.form.noticeScope.splice(index, 1);
+    },
+    getAssignRuleOptionName(row, option) {
+      if (row.type == 10) {
+        for (const roleOption of this.roleOptions) {
+          if (roleOption.id === option) {
+            return roleOption.name;
           }
-        } else if (row.type === 50) {
-          option = option + ''; // 转换成 string
-          return this.getDictV(
-            this.dictEnum['工作流任务分配自定义脚本'],
-            option
-          );
-        } else if (row.type === 60) {
-          return row.variableName;
-        } else if (row.type === 70) {
-          let data = JSON.parse(row.variableName);
-          if (data.direction == 1) {
-            return topLevel2.find((item) => item.value == data.topLevel)?.label;
-          } else {
-            return topLevel1.find((item) => item.value == data.topLevel)?.label;
+        }
+      } else if (row.type === 20 || row.type === 21) {
+        for (const deptOption of this.deptOptions) {
+          if (deptOption.id === option) {
+            return deptOption.name;
           }
-        } else if (row.type === 80) {
-          let data = JSON.parse(row.variableName);
-          return topLevel3.find((item) => item.value == data.topLevel)?.label;
         }
-        return '未知(' + option + ')';
-      },
-      async getTreeData() {
-        this.treeData = await getGroupUserTree();
-      },
-      filterNode(value, data) {
-        if (!value) return true;
-        return data.name.indexOf(value) !== -1;
-      },
-      /**
-       * 构造树型结构数据
-       * @param {*} data 数据源
-       * @param {*} id id字段 默认 'id'
-       * @param {*} parentId 父节点字段 默认 'parentId'
-       * @param {*} children 孩子节点字段 默认 'children'
-       * @param {*} rootId 根Id 默认 0
-       */
-      handleTree(data, id, parentId, children, rootId) {
-        id = id || 'id';
-        parentId = parentId || 'parentId';
-        children = children || 'children';
-        rootId =
-          rootId ||
-          Math.min.apply(
-            Math,
-            data.map((item) => {
-              return item[parentId];
-            })
-          ) ||
-          0;
-        //对源数据深度克隆
-        const cloneData = JSON.parse(JSON.stringify(data));
-        //循环所有项
-        const treeData = cloneData.filter((father) => {
-          let branchArr = cloneData.filter((child) => {
-            //返回每一项的子级数组
-            return father[id] == child[parentId];
-          });
-          branchArr.length > 0 ? (father.children = branchArr) : '';
-          //返回第一层
-          return father[parentId] == rootId;
-        });
-        return treeData !== '' ? treeData : data;
-      },
-      getDictV(code, val) {
-        if (!this.dictList[code]) return '';
-        return this.dictList[code].find((item) => item.value == val)?.label;
-      },
-      async getDictList(code) {
-        let { data: res } = await getByCode(code);
-        this.dictList[code] = res.map((item) => {
-          let values = Object.keys(item);
-          return {
-            value: values[0],
-            label: item[values[0]]
-          };
-        });
-      },
-      generateFormValid(validate = true) {
-        return this.$refs.generateForm.getData(validate).then((data) => {
-          return data;
-        });
-      },
-      handleTreeChange() {
-        this.$nextTick(() => {
-          this.form.noticeScope =
-            this.$refs.treeSelect.$refs.tree.getCheckedNodes();
-          console.log(this.form.noticeScope);
-        });
-      },
-      async changeLCFL(val) {
-        this.bpmnXML = null;
-        this.form.processDefinitionId = null;
-        this.form.FQLC = null;
-        await this.getProcessList(val);
-      },
-      async changeFQLC(val) {
-        if (!val) return;
-        let find = this.processList.find((item) => item.id === val) || {};
-        this.form.name = find.name;
-        this.form.key = find.key;
-        this.form.processDefinitionId = find.processDefinition.id;
-        this.form.processModelId = val;
-        await this.getProcessDefinitionBpmnXML(find.processDefinition.id);
-        await this.getTaskAssignRuleListInfo({
-          modelId: find.id,
-          processDefinitionId: find.processDefinition.id
-        });
-      },
-      async submit() {
-        // console.log('this.form~~~', this.$refs.businessComponentRef.form);
-        
-        // const businessComponentForm = this.$refs.businessComponentRef.form;
-        let data = await this.$refs.generateForm.getData(false);
-        // data['blank_business_component'] = businessComponentForm.blank_business_component;
-        // this.$refs.generateForm.setData({
-        //   'blank_business_component': data['blank_business_component']
-        // });
-        // 获取所有组件的引用
-        let validArr = []
-        // 过滤出存在于componentRef中的键
-        Object.keys(data).forEach((key) => {
-          if (this.componentRef.includes(key)) {
-            validArr.push(key)
+      } else if (row.type === 22) {
+        option = option + ''; // 转换成 string
+        return this.getDictV(this.dictEnum['工种类型'], option);
+      } else if (row.type === 30 || row.type === 31 || row.type === 32) {
+        for (const userOption of this.userOptions) {
+          if (userOption.id === option) {
+            return userOption.nickname || userOption.name;
           }
-        })
-        
-        // 检查每个组件的数据是否为空数组
-        let emptyComponents = []
-        validArr.forEach(item => {
-          // 检查data[item]是否存在且为数组,并且长度为0
-          if (Array.isArray(data[item]) && data[item].length === 0) {
-            emptyComponents.push(item)
+        }
+      } else if (row.type === 40) {
+        for (const userGroupOption of this.userGroupOptions) {
+          if (userGroupOption.id === option) {
+            return userGroupOption.name;
           }
-        })
-        
-        // 如果有未填写的组件,显示提示信息
-        if (emptyComponents.length > 0) {
-          // this.$message.warning(`请填写完整信息:${emptyComponents.map(comp => this.getComponentName(comp)).join('、')}`);
-          this.$message.warning(`请填写完整信息`);
-          return false;
         }
-        
-        // 使用Promise.all并行校验所有组件
-        // try {
-        //   await Promise.all(validArr.map(key => {
-        //     if (this.$refs[key] && typeof this.$refs[key].validateForm === 'function') {
-        //       return this.$refs[key].validateForm();
-        //     }
-        //     return Promise.resolve(true); // 如果组件不存在或没有validateForm方法,默认通过
-        //   }));
-        //   console.log('所有组件校验通过');
-        // } catch (error) {
-        //   console.error('表单校验失败:', error);
-        //   this.$message.error('表单校验失败,请检查必填项');
-        //   return false; // 任一组件校验失败则整体失败
-        // }
-        // console.log('data~~~~', data);
-        this.form.valueJson = await this.generateFormValid()
-        this.form.processType = '1';
-        console.log('formformformform', this.form);
-        await processInstanceCreateAPI({
-          ...this.form,
-          variables: { ...this.form.valueJson }
+      } else if (row.type === 50) {
+        option = option + ''; // 转换成 string
+        return this.getDictV(this.dictEnum['工作流任务分配自定义脚本'], option);
+      } else if (row.type === 60) {
+        return row.variableName;
+      } else if (row.type === 70) {
+        let data = JSON.parse(row.variableName);
+        if (data.direction == 1) {
+          return topLevel2.find((item) => item.value == data.topLevel)?.label;
+        } else {
+          return topLevel1.find((item) => item.value == data.topLevel)?.label;
+        }
+      } else if (row.type === 80) {
+        let data = JSON.parse(row.variableName);
+        return topLevel3.find((item) => item.value == data.topLevel)?.label;
+      }
+      return '未知(' + option + ')';
+    },
+    async getTreeData() {
+      this.treeData = await getGroupUserTree();
+    },
+    filterNode(value, data) {
+      if (!value) return true;
+      return data.name.indexOf(value) !== -1;
+    },
+    /**
+     * 构造树型结构数据
+     * @param {*} data 数据源
+     * @param {*} id id字段 默认 'id'
+     * @param {*} parentId 父节点字段 默认 'parentId'
+     * @param {*} children 孩子节点字段 默认 'children'
+     * @param {*} rootId 根Id 默认 0
+     */
+    handleTree(data, id, parentId, children, rootId) {
+      id = id || 'id';
+      parentId = parentId || 'parentId';
+      children = children || 'children';
+      rootId =
+        rootId ||
+        Math.min.apply(
+          Math,
+          data.map((item) => {
+            return item[parentId];
+          })
+        ) ||
+        0;
+      //对源数据深度克隆
+      const cloneData = JSON.parse(JSON.stringify(data));
+      //循环所有项
+      const treeData = cloneData.filter((father) => {
+        let branchArr = cloneData.filter((child) => {
+          //返回每一项的子级数组
+          return father[id] == child[parentId];
         });
-        this.$message('提交审核成功');
-        this.$emit('reload');
-        this.cancel();
-      },
-      cancel() {
-        this.$emit('update:processSubmitDialogFlag', false);
-      },
-      getDays(start, end) {
-        const startDay = dayjs(start);
-        const endDay = dayjs(end);
-        const diffInMilliseconds = endDay.diff(startDay);
+        branchArr.length > 0 ? (father.children = branchArr) : '';
+        //返回第一层
+        return father[parentId] == rootId;
+      });
+      return treeData !== '' ? treeData : data;
+    },
+    getDictV(code, val) {
+      if (!this.dictList[code]) return '';
+      return this.dictList[code].find((item) => item.value == val)?.label;
+    },
+    async getDictList(code) {
+      let { data: res } = await getByCode(code);
+      this.dictList[code] = res.map((item) => {
+        let values = Object.keys(item);
+        return {
+          value: values[0],
+          label: item[values[0]]
+        };
+      });
+    },
+    generateFormValid(validate = true) {
+      return this.$refs.generateForm.getData(validate).then((data) => {
+        return data;
+      });
+    },
+    handleTreeChange() {
+      this.$nextTick(() => {
+        this.form.noticeScope =
+          this.$refs.treeSelect.$refs.tree.getCheckedNodes();
+        console.log(this.form.noticeScope);
+      });
+    },
+    async changeLCFL(val) {
+      this.bpmnXML = null;
+      this.form.processDefinitionId = null;
+      this.form.FQLC = null;
+      await this.getProcessList(val);
+    },
+    async changeFQLC(val) {
+      if (!val) return;
+      let find = this.processList.find((item) => item.id === val) || {};
+      this.form.name = find.name;
+      this.form.key = find.key;
+      this.form.processDefinitionId = find.processDefinition.id;
+      this.form.processModelId = val;
+      await this.getProcessDefinitionBpmnXML(find.processDefinition.id);
+      await this.getTaskAssignRuleListInfo({
+        modelId: find.id,
+        processDefinitionId: find.processDefinition.id
+      });
+    },
+    async submit() {
+      // console.log('this.form~~~', this.$refs.businessComponentRef.form);
 
-        // 计算天数
-        const days = Math.floor(diffInMilliseconds / (1000 * 60 * 60 * 24));
-        // 计算剩余小时数
-        const hours = Math.floor(
-          (diffInMilliseconds % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)
-        );
-        // 计算剩余分钟数
-        const minutes = Math.floor(
-          (diffInMilliseconds % (1000 * 60 * 60)) / (1000 * 60)
-        );
-        // 计算剩余秒数
-        const seconds = Math.floor((diffInMilliseconds % (1000 * 60)) / 1000);
+      // const businessComponentForm = this.$refs.businessComponentRef.form;
+      let data = await this.$refs.generateForm.getData(false);
+      // data['blank_business_component'] = businessComponentForm.blank_business_component;
+      // this.$refs.generateForm.setData({
+      //   'blank_business_component': data['blank_business_component']
+      // });
+      // 获取所有组件的引用
+      let validArr = [];
+      // 过滤出存在于componentRef中的键
+      Object.keys(data).forEach((key) => {
+        if (this.componentRef.includes(key)) {
+          validArr.push(key);
+        }
+      });
 
-        let result = '';
-        if (days > 0) result += `${days} 天 `;
-        if (hours > 0) result += `${hours} 小时 `;
-        if (minutes > 0) result += `${minutes} 分钟 `;
-        if (seconds > 0) result += `${seconds} 秒`;
-        return result.trim();
+      // 检查每个组件的数据是否为空数组
+      let emptyComponents = [];
+      validArr.forEach((item) => {
+        // 检查data[item]是否存在且为数组,并且长度为0
+        if (Array.isArray(data[item]) && data[item].length === 0) {
+          emptyComponents.push(item);
+        }
+      });
+
+      // 如果有未填写的组件,显示提示信息
+      if (emptyComponents.length > 0) {
+        // this.$message.warning(`请填写完整信息:${emptyComponents.map(comp => this.getComponentName(comp)).join('、')}`);
+        this.$message.warning(`请填写完整信息`);
+        return false;
       }
+
+      // 使用Promise.all并行校验所有组件
+      // try {
+      //   await Promise.all(validArr.map(key => {
+      //     if (this.$refs[key] && typeof this.$refs[key].validateForm === 'function') {
+      //       return this.$refs[key].validateForm();
+      //     }
+      //     return Promise.resolve(true); // 如果组件不存在或没有validateForm方法,默认通过
+      //   }));
+      //   console.log('所有组件校验通过');
+      // } catch (error) {
+      //   console.error('表单校验失败:', error);
+      //   this.$message.error('表单校验失败,请检查必填项');
+      //   return false; // 任一组件校验失败则整体失败
+      // }
+      // console.log('data~~~~', data);
+      this.form.valueJson = await this.generateFormValid();
+      this.form.processType = '1';
+      console.log('formformformform', this.form);
+      await processInstanceCreateAPI({
+        ...this.form,
+        variables: { ...this.form.valueJson }
+      });
+      this.$message('提交审核成功');
+      this.$emit('reload');
+      this.cancel();
+    },
+    cancel() {
+      this.$emit('update:processSubmitDialogFlag', false);
+    },
+    getDays(start, end) {
+      const startDay = dayjs(start);
+      const endDay = dayjs(end);
+      const diffInMilliseconds = endDay.diff(startDay);
+
+      // 计算天数
+      const days = Math.floor(diffInMilliseconds / (1000 * 60 * 60 * 24));
+      // 计算剩余小时数
+      const hours = Math.floor(
+        (diffInMilliseconds % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)
+      );
+      // 计算剩余分钟数
+      const minutes = Math.floor(
+        (diffInMilliseconds % (1000 * 60 * 60)) / (1000 * 60)
+      );
+      // 计算剩余秒数
+      const seconds = Math.floor((diffInMilliseconds % (1000 * 60)) / 1000);
+
+      let result = '';
+      if (days > 0) result += `${days} 天 `;
+      if (hours > 0) result += `${hours} 小时 `;
+      if (minutes > 0) result += `${minutes} 分钟 `;
+      if (seconds > 0) result += `${seconds} 秒`;
+      return result.trim();
     }
-  };
+  }
+};
 </script>
 <style scoped lang="scss">
-  .box {
-    display: flex;
-    height: 450px;
+.box {
+  display: flex;
+  height: 450px;
 
-    .left-box {
-      width: 55%;
-      border-right: 1px solid #e2e4e7;
-      padding-right: 15px;
-      height: 100%;
+  .left-box {
+    width: 55%;
+    border-right: 1px solid #e2e4e7;
+    padding-right: 15px;
+    height: 100%;
 
-      .el-tree {
-        height: 85%;
-        overflow-y: auto;
-      }
+    .el-tree {
+      height: 85%;
+      overflow-y: auto;
     }
+  }
 
-    .right-box {
-      flex: 1;
-      padding-left: 20px;
-      height: 100%;
+  .right-box {
+    flex: 1;
+    padding-left: 20px;
+    height: 100%;
 
-      .right-box-item {
-        margin-top: 5px;
-        display: flex;
-        justify-content: space-between;
-        align-items: center;
-      }
+    .right-box-item {
+      margin-top: 5px;
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
     }
   }
+}
 
-  .form-box {
-    // max-height: 500px;
-    min-width: 400px;
-    overflow: auto;
-    background: #4298fd0d;
+.form-box {
+  // max-height: 500px;
+  min-width: 400px;
+  overflow: auto;
+  background: #4298fd0d;
+}
+::v-deep .el-dialog {
+  min-width: 400px;
+  .el-dialog__header {
+    background: #1890ffd6;
   }
-  ::v-deep .el-dialog {
-    min-width: 400px;
-    .el-dialog__header {
-      background: #1890ffd6;
-    }
-    .el-dialog__title,
-    .el-dialog__close {
-      color: #ffffff;
-    }
+  .el-dialog__title,
+  .el-dialog__close {
+    color: #ffffff;
   }
-  .blank_adopzrdd {
-    display: flex;
-    align-items: center;
-    > span {
-      display: inline-block;
-      width: 80px;
-    }
-    margin-bottom: 10px;
+}
+.blank_adopzrdd {
+  display: flex;
+  align-items: center;
+  > span {
+    display: inline-block;
+    width: 80px;
   }
+  margin-bottom: 10px;
+}
 </style>

+ 59 - 0
src/api/bpm/components/salesServiceManagement/return.js

@@ -0,0 +1,59 @@
+import request from '@/utils/request';
+import { download } from '@/utils/file';
+
+//列表---------------------------------------------------------------
+export async function getPage(data) {
+  const res = await request.get('/eom/aftersalessparepartsreturnapply/page', {
+    params: data
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+//新增
+export async function save(data) {
+  const res = await request.post(
+    '/eom/aftersalessparepartsreturnapply/save',
+    data
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//根据id查询详情
+export async function getById(id) {
+  const res = await request.get(
+    `/eom/aftersalessparepartsreturnapply/getById/${id}`
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//修改
+export async function update(data) {
+  const res = await request.put(
+    '/eom/aftersalessparepartsreturnapply/update',
+    data
+  );
+  if (res.data.code === '0') {
+    return res.data.message;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//删除
+export async function deleteList(data) {
+  const res = await request.delete(
+    '/eom/aftersalessparepartsreturnapply/delete',
+    {
+      data
+    }
+  );
+  if (res.data.code == 0) {
+    return res.data.message;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 16 - 2
src/enum/dict.js

@@ -118,7 +118,7 @@ export const acceptUnpackoptions = [
 //发货审核状态
 export const reviewStatusEnum = [
   { value: 0, label: '未提交' },
-  { value: 1, label: '审核' },
+  { value: 1, label: '审核' },
   { value: 2, label: '已审核' },
   { value: 3, label: '审核未通过' }
 ];
@@ -132,8 +132,10 @@ export const reviewStatus = {
   0: '未提交',
   1: '审核中',
   2: '已审核',
-  3: '审核不通过'
+  3: '审核不通过',
+  7: '作废'
 };
+
 //项目管理——项目、计划、任务状态
 export const proStatusEnum = [
   { value: 0, label: '未开始' },
@@ -314,3 +316,15 @@ export const topLevel2 = [
     value: '9'
   }
 ];
+
+
+//采购订单整体进度
+export const purchaseOrderProgressStatusEnum = [
+  { value: 0, label: '未开始' },
+  { value: 100, label: '在途' },
+  { value: 101, label: '部分入库' },
+  { value: 102, label: '待质检' },
+  { value: 103, label: '质检中' },
+  { value: 200, label: '已入库' },
+  { value: 1000, label: '完成' }
+];

+ 4 - 0
src/views/bpm/collaborative/detail.vue

@@ -141,6 +141,8 @@
   import { getToken } from '@/utils/token-util';
   import outgoingDetails from '@/views/bpm/outgoingManagement/details.vue';
   import storageApi from '@/api/warehouseManagement';
+
+  // 流程组件  需要在三个地方使用,审批流程,详情,提交流程
   import businessComponent from '@/BIZComponents/processSubmitDialog/components/businessComponent.vue';
   import useSealComponent from '@/BIZComponents/processSubmitDialog/components/useSealComponent.vue';
   import useQualificationComponent from '@/BIZComponents/processSubmitDialog/components/useQualificationComponent.vue';
@@ -149,6 +151,8 @@
   import reissueComponent from '@/BIZComponents/processSubmitDialog/components/reissueComponent.vue';
   import Detail from '@/views/bpm/processInstance/detailNew.vue';
 
+  
+
   export default {
     name: 'formDetailDialog',
     components: {outgoingDetails, businessComponent, useSealComponent, useQualificationComponent, productSpecificationComponent, eventComponent, reissueComponent, Detail},

+ 589 - 562
src/views/bpm/collaborative/index.vue

@@ -53,7 +53,11 @@
         <!-- 表格 -->
         <template v-slot:content>
           <div class="tab-box el-form-box">
-            <el-tabs type="border-card" @tab-click="tabClick" v-model="activeName">
+            <el-tabs
+              type="border-card"
+              @tab-click="tabClick"
+              v-model="activeName"
+            >
               <el-tab-pane label="个人记录" name="user">
                 <ele-pro-table
                   ref="table"
@@ -218,7 +222,13 @@
                     </div>
 
                     <div v-else-if="item.type == 'userSelect'">
-                      {{ getUserName(row[item.model]) }}
+                      <el-link
+                        type="primary"
+                        :underline="false"
+                        @click="handleDetail(row)"
+                      >
+                        {{ getUserName(row[item.model]) }}
+                      </el-link>
                     </div>
                     <div v-else-if="item.type == 'deptAndUserCascader'">
                       {{ getDeptAndUserName(row[item.model]) }}
@@ -227,7 +237,7 @@
                       {{ getDeptName(row[item.model]) }}
                     </div>
                     <div v-else>
-                      {{ row[item.model] }}
+                      {{ formatValue(row[item.model]) }}
                     </div>
                   </template>
                   <!-- 操作列 -->
@@ -321,7 +331,9 @@
                               prop="startUserName"
                               label-width="70px"
                             >
-                              <el-input v-model="params.startUserName"></el-input>
+                              <el-input
+                                v-model="params.startUserName"
+                              ></el-input>
                             </el-form-item>
                           </el-col>
                           <el-col v-bind="{ span: 6 }">
@@ -386,7 +398,7 @@
                         >下载
                       </el-button>
                     </div>
-                    <div v-else-if="item.type == 'userSelect'">
+                     <div v-else-if="item.type == 'userSelect'">
                       {{ getUserName(row[item.model]) }}
                     </div>
                     <div v-else-if="item.type == 'deptAndUserCascader'">
@@ -396,7 +408,7 @@
                       {{ getDeptName(row[item.model]) }}
                     </div>
                     <div v-else>
-                      {{ row[item.model] }}
+                      {{ formatValue(row[item.model]) }}
                     </div>
                   </template>
                   <template v-slot:result="{ row }">
@@ -514,7 +526,9 @@
                               prop="startUserName"
                               label-width="70px"
                             >
-                              <el-input v-model="params.startUserName"></el-input>
+                              <el-input
+                                v-model="params.startUserName"
+                              ></el-input>
                             </el-form-item>
                           </el-col>
                           <el-col v-bind="{ span: 6 }">
@@ -589,7 +603,7 @@
                       {{ getDeptName(row[item.model]) }}
                     </div>
                     <div v-else>
-                      {{ row[item.model] }}
+                      {{ formatValue(row[item.model]) }}
                     </div>
                   </template>
                   <template v-slot:result="{ row }">
@@ -651,602 +665,615 @@
   </div>
 </template>
 <script>
-  import {
-    getBpmCustomFormList,
-    getProcessInstanceDeptPage,
-    getProcessInstanceNoticePage,
-    getProcessInstancePage
-  } from '@/api/bpm/task';
-  import { getDate } from '@/utils/dateUtils';
-  import dictMixins from '@/mixins/dictMixins';
-  import detail from '@/views/bpm/processInstance/detail.vue';
-  import formDetail from './detail.vue';
-  import { getByCode } from '@/api/system/dictionary-data';
-  import { getFile } from '@/api/system/file';
-  import { getUserPage } from '@/api/tickets';
-  import { listOrganizations } from '@/api/system/organization';
-  import tabMixins from '@/mixins/tableColumnsMixin';
+import {
+  getBpmCustomFormList,
+  getProcessInstanceDeptPage,
+  getProcessInstanceNoticePage,
+  getProcessInstancePage
+} from '@/api/bpm/task';
+import { getDate } from '@/utils/dateUtils';
+import dictMixins from '@/mixins/dictMixins';
+import detail from '@/views/bpm/processInstance/detail.vue';
+import formDetail from './detail.vue';
+import { getByCode } from '@/api/system/dictionary-data';
+import { getFile } from '@/api/system/file';
+import { getUserPage } from '@/api/tickets';
+import { listOrganizations } from '@/api/system/organization';
+import tabMixins from '@/mixins/tableColumnsMixin';
 
-  // 默认表单数据
-  const defaultParams = {
-    dictType: '',
-    status: '',
-    name: '',
-    formId: ''
-  };
-  export default {
-    name: 'index',
-    components: {
-      detail,
-      formDetail
-    },
-    mixins: [dictMixins, tabMixins],
-    data() {
-      return {
-        cacheKeyUrl: 'wt-eaf1548b-collaborative',
-        configFormDialogFlag: false,
-        processSubmitDialogFlag: false,
-        formDetailDialogFlag: false,
-        templateList: {},
-        dictList: {},
-        defaultTemplateList: [],
-        userList: [],
-        deptList: [],
-        params: { ...defaultParams },
-        statusList: [],
-        formColumnList: [],
-        createTime1: [],
-        // 个人 / 部门 / 通知我的
-        activeName: 'user'
-      };
+// 默认表单数据
+const defaultParams = {
+  dictType: '',
+  status: '',
+  name: '',
+  formId: ''
+};
+export default {
+  name: 'index',
+  components: {
+    detail,
+    formDetail
+  },
+  mixins: [dictMixins, tabMixins],
+  data() {
+    return {
+      cacheKeyUrl: 'wt-eaf1548b-collaborative',
+      configFormDialogFlag: false,
+      processSubmitDialogFlag: false,
+      formDetailDialogFlag: false,
+      templateList: {},
+      dictList: {},
+      defaultTemplateList: [],
+      userList: [],
+      deptList: [],
+      params: { ...defaultParams },
+      statusList: [],
+      formColumnList: [],
+      createTime1: [],
+      // 个人 / 部门 / 通知我的
+      activeName: 'user'
+    };
+  },
+  computed: {
+    // 是否开启响应式布局
+    styleResponsive() {
+      return this.$store.state.theme.styleResponsive;
     },
-    computed: {
-      // 是否开启响应式布局
-      styleResponsive() {
-        return this.$store.state.theme.styleResponsive;
-      },
-      columns() {
-        let list = this.formColumnList.map((item) => {
-          return {
-            prop: item.model,
-            label: item.name,
-            align: 'center',
-            slot: item.model,
-            showOverflowTooltip: true,
-            minWidth: 120
-          };
-        });
-        return [
-          {
-            columnKey: 'index',
-            label: '序号',
-            type: 'index',
-            width: 55,
-            align: 'center',
-            showOverflowTooltip: true,
-            fixed: 'left'
-          },
-          {
-            prop: 'dictType',
-            label: '分类',
-            align: 'center',
-            slot: 'dictType',
-            showOverflowTooltip: true,
-            minWidth: 70
-          },
-          {
-            prop: 'formName',
-            label: '单据',
-            align: 'center',
-            slot: 'formName',
-            showOverflowTooltip: true,
-            minWidth: 70
-          },
-          {
-            prop: 'name',
-            label: '名称',
-            align: 'center',
-            slot: 'name',
-            showOverflowTooltip: true,
-            minWidth: 80
-          },
-          ...list,
-          {
-            prop: 'result',
-            slot: 'result',
-            label: '结果',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 80
-          },
-          {
-            prop: 'endTime',
-            label: '审批时间',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 120
-          },
-          {
-            prop: 'createTime',
-            label: '创建时间',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 120
-          },
-
-          // {
-          //   prop: 'durationInMillis',
-          //   slot: 'durationInMillis',
-          //   label: '耗时',
-          //   align: 'center',
-          //   showOverflowTooltip: true,
-          //   minWidth: 130
-          // },
-          {
-            columnKey: 'action',
-            label: '操作',
-            width: 100,
-            align: 'center',
-            resizable: false,
-            slot: 'action',
-            showOverflowTooltip: true,
-            fixed: 'right'
-          }
-        ];
-      },
-      deptColumns() {
-        let list = this.formColumnList.map((item) => {
-          return {
-            prop: item.model,
-            label: item.name,
-            align: 'center',
-            slot: item.model,
-            showOverflowTooltip: true,
-            minWidth: 120
-          };
-        });
-        return [
-          {
-            columnKey: 'index',
-            label: '序号',
-            type: 'index',
-            width: 55,
-            align: 'center',
-            showOverflowTooltip: true,
-            fixed: 'left'
-          },
-          {
-            prop: 'dictType',
-            label: '分类',
-            align: 'center',
-            slot: 'dictType',
-            showOverflowTooltip: true,
-            minWidth: 70
-          },
-          {
-            prop: 'formName',
-            label: '单据',
-            align: 'center',
-            slot: 'formName',
-            showOverflowTooltip: true,
-            minWidth: 70
-          },
-          {
-            prop: 'name',
-            label: '名称',
-            align: 'center',
-            slot: 'name',
-            showOverflowTooltip: true,
-            minWidth: 150
-          },
-          {
-            prop: 'startUserName',
-            label: '发起人',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 180
-          },
-          ...list,
-          {
-            prop: 'result',
-            slot: 'result',
-            label: '结果',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 100
-          },
-          {
-            prop: 'endTime',
-            label: '审批时间',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 180
-          },
-          {
-            prop: 'createTime',
-            label: '创建时间',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 180
-          }
-
-          // {
-          //   prop: 'durationInMillis',
-          //   slot: 'durationInMillis',
-          //   label: '耗时',
-          //   align: 'center',
-          //   showOverflowTooltip: true,
-          //   minWidth: 130
-          // },
-          // {
-          //   columnKey: 'action',
-          //   label: '操作',
-          //   width: 230,
-          //   align: 'center',
-          //   resizable: false,
-          //   slot: 'action',
-          //   showOverflowTooltip: true,
-          //   fixed: 'right'
-          // }
-        ];
-      },
-      getUserName() {
-        return (id) => {
-          if (!id) return '';
-          let find = this.userList.find((item) => item.id == id) || {};
-          return find.name;
-        };
-      },
-      getDeptAndUserName() {
-        return (id = []) => {
-          if (!id.length) return '';
-          id = Array.isArray(id) ? id : [id];
-          let find =
-            this.userList.find((item) => item.id == id[id.length - 1]) || {};
-          return find.name;
+    columns() {
+      let list = this.formColumnList.map((item) => {
+        return {
+          prop: item.model,
+          label: item.name,
+          align: 'center',
+          slot: item.model,
+          showOverflowTooltip: true,
+          minWidth: 120
         };
-      },
-      getDeptName() {
-        return (id = []) => {
-          if (!id.length) return '';
-          id = Array.isArray(id) ? id : [id];
-          let find =
-            this.deptList.find((item) => item.id == id[id.length - 1]) || {};
-          return find.name;
+      });
+      return [
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          prop: 'dictType',
+          label: '分类',
+          align: 'center',
+          slot: 'dictType',
+          showOverflowTooltip: true,
+          minWidth: 70
+        },
+        {
+          prop: 'formName',
+          label: '单据',
+          align: 'center',
+          slot: 'formName',
+          showOverflowTooltip: true,
+          minWidth: 70
+        },
+        // {
+        //   prop: 'name',
+        //   label: '名称',
+        //   align: 'center',
+        //   slot: 'name',
+        //   showOverflowTooltip: true,
+        //   minWidth: 80
+        // },
+        ...list,
+        {
+          prop: 'result',
+          slot: 'result',
+          label: '结果',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 80
+        },
+        {
+          prop: 'endTime',
+          label: '审批时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120
+        },
+        {
+          prop: 'createTime',
+          label: '创建时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120
+        },
+
+        // {
+        //   prop: 'durationInMillis',
+        //   slot: 'durationInMillis',
+        //   label: '耗时',
+        //   align: 'center',
+        //   showOverflowTooltip: true,
+        //   minWidth: 130
+        // },
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 100,
+          align: 'center',
+          resizable: false,
+          slot: 'action',
+          showOverflowTooltip: true,
+          fixed: 'right'
+        }
+      ];
+    },
+    deptColumns() {
+      let list = this.formColumnList.map((item) => {
+        return {
+          prop: item.model,
+          label: item.name,
+          align: 'center',
+          slot: item.model,
+          showOverflowTooltip: true,
+          minWidth: 120
         };
+      });
+      return [
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          prop: 'dictType',
+          label: '分类',
+          align: 'center',
+          slot: 'dictType',
+          showOverflowTooltip: true,
+          minWidth: 70
+        },
+        {
+          prop: 'formName',
+          label: '单据',
+          align: 'center',
+          slot: 'formName',
+          showOverflowTooltip: true,
+          minWidth: 70
+        },
+        {
+          prop: 'name',
+          label: '名称',
+          align: 'center',
+          slot: 'name',
+          showOverflowTooltip: true,
+          minWidth: 150
+        },
+        {
+          prop: 'startUserName',
+          label: '发起人',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 180
+        },
+        ...list,
+        {
+          prop: 'result',
+          slot: 'result',
+          label: '结果',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 100
+        },
+        {
+          prop: 'endTime',
+          label: '审批时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 180
+        },
+        {
+          prop: 'createTime',
+          label: '创建时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 180
+        }
+
+        // {
+        //   prop: 'durationInMillis',
+        //   slot: 'durationInMillis',
+        //   label: '耗时',
+        //   align: 'center',
+        //   showOverflowTooltip: true,
+        //   minWidth: 130
+        // },
+        // {
+        //   columnKey: 'action',
+        //   label: '操作',
+        //   width: 230,
+        //   align: 'center',
+        //   resizable: false,
+        //   slot: 'action',
+        //   showOverflowTooltip: true,
+        //   fixed: 'right'
+        // }
+      ];
+    },
+    getUserName() {
+      return (id) => {
+        if (!id) return '';
+        let find = this.userList.find((item) => item.id == id) || {};
+        return find.name;
+      };
+    },
+    getDeptAndUserName() {
+      return (id = []) => {
+        if (!id.length) return '';
+        id = Array.isArray(id) ? id : [id];
+        let find =
+          this.userList.find((item) => item.id == id[id.length - 1]) || {};
+        return find.name;
+      };
+    },
+    getDeptName() {
+      return (id = []) => {
+        if (!id.length) return '';
+        id = Array.isArray(id) ? id : [id];
+        let find =
+          this.deptList.find((item) => item.id == id[id.length - 1]) || {};
+        return find.name;
+      };
+    }
+  },
+  watch: {
+    'params.formId': {
+      handler(val) {
+        this.reload();
+        this.deptReload();
+        this.reload();
+        this.noticeReload();
       }
     },
-    watch: {
-      'params.formId': {
-        handler(val) {
-          this.reload();
-          this.deptReload();
-          this.reload();
-          this.noticeReload();
-        }
-      },
-      'params.dictType': {
-        handler(val) {
-          this.params.formId = this.templateList[val][0].id;
-          this.reload();
-          this.deptReload();
-          this.reload();
-          this.noticeReload();
+    'params.dictType': {
+      handler(val) {
+        this.params.formId = this.templateList[val][0].id;
+        this.reload();
+        this.deptReload();
+        this.reload();
+        this.noticeReload();
+      }
+    }
+  },
+  async created() {
+    await this.getDictList('collaborative_type');
+    await this.getTemplateList();
+    await this.getUserList();
+    await this.getDeptList();
+  },
+  methods: {
+    formatValue(value) {
+      if (value === null || value === undefined) {
+        return ''; // 空值处理
+      }
+      if (typeof value === 'object' && value !== null) {
+        if ('id' in value && 'code' in value && 'name' in value) {
+          return value.code;
+        } else {
+          return JSON.stringify(value, null, 2);
         }
       }
+      return value;
+    },
+    getDictV(code, val) {
+      if (!this.dictList[code]) return '';
+      return this.dictList[code].find((item) => item.value == val)?.label;
+    },
+    async getDictList(code) {
+      let { data: res } = await getByCode(code);
+      this.dictList[code] = res.map((item) => {
+        let values = Object.keys(item);
+        return {
+          value: values[0],
+          label: item[values[0]]
+        };
+      });
+    },
+    //获取人员数据
+    async getUserList() {
+      let params = { pageNum: 1, size: -1 };
+      let { list } = await getUserPage(params);
+      this.userList = list;
+    },
+    //获取部门数据
+    async getDeptList() {
+      this.deptList = await listOrganizations();
     },
-    async created() {
-      await this.getDictList('collaborative_type');
-      await this.getTemplateList();
-      await this.getUserList();
-      await this.getDeptList();
+    getFiles(row = []) {
+      row.forEach((item) => {
+        getFile({ objectName: item.storePath }, item.name);
+      });
     },
-    methods: {
-      getDictV(code, val) {
-        if (!this.dictList[code]) return '';
-        return this.dictList[code].find((item) => item.value == val)?.label;
-      },
-      async getDictList(code) {
-        let { data: res } = await getByCode(code);
-        this.dictList[code] = res.map((item) => {
-          let values = Object.keys(item);
-          return {
-            value: values[0],
-            label: item[values[0]]
-          };
-        });
-      },
-      //获取人员数据
-      async getUserList() {
-        let params = { pageNum: 1, size: -1 };
-        let { list } = await getUserPage(params);
-        this.userList = list;
-      },
-      //获取部门数据
-      async getDeptList() {
-        this.deptList = await listOrganizations();
-      },
-      getFiles(row = []) {
-        row.forEach((item) => {
-          getFile({ objectName: item.storePath }, item.name);
-        });
-      },
-      async getTemplateList() {
-        this.defaultTemplateList = await getBpmCustomFormList({ status: 1 });
-        this.templateList = _.groupBy(this.defaultTemplateList, 'dictType');
-        this.params.dictType = this.dictList['collaborative_type'][0].value;
-        this.params.formId = this.defaultTemplateList[0]?.id;
-        let makingJson =
-          JSON.parse(this.defaultTemplateList[0].formJson.makingJson) || {};
-        this.formColumnList = makingJson.list;
-        console.log(this.formColumnList);
-      },
-      handleStartProcess(i) {
-        this.processSubmitDialogFlag = true;
-        this.$nextTick(() => {
-          this.$refs.processSubmitDialogRef.init(i);
-        });
-      },
-      /* 表格数据源 */
-      async datasource({ page, limit, where, order }) {
-        let [createTimeBegin, createTimeEnd] = this.createTime1 || [];
+    async getTemplateList() {
+      this.defaultTemplateList = await getBpmCustomFormList({ status: 1 });
+      this.templateList = _.groupBy(this.defaultTemplateList, 'dictType');
+      this.params.dictType = this.dictList['collaborative_type'][0].value;
+      this.params.formId = this.defaultTemplateList[0]?.id;
+      let makingJson =
+        JSON.parse(this.defaultTemplateList[0].formJson.makingJson) || {};
+      this.formColumnList = makingJson.list;
+      console.log(this.formColumnList);
+    },
+    handleStartProcess(i) {
+      this.processSubmitDialogFlag = true;
+      this.$nextTick(() => {
+        this.$refs.processSubmitDialogRef.init(i);
+      });
+    },
+    /* 表格数据源 */
+    async datasource({ page, limit, where, order }) {
+      let [createTimeBegin, createTimeEnd] = this.createTime1 || [];
 
-        let data = await getProcessInstancePage({
-          pageNo: page,
-          pageSize: limit,
-          ...this.params,
-          processType: '1',
-          createTimeBegin,
-          createTimeEnd
-        });
-        data = data.list.map((item) => {
-          return {
-            ...item,
-            ...item.valueJson
-          };
-        });
-        return data;
-      },
-      /* 刷新表格 */
-      reload(where) {
-        let find =
-          this.defaultTemplateList.find(
-            (item) => item.id == this.params.formId
-          ) || {};
-        let makingJson = JSON.parse(find.formJson.makingJson) || {};
-        this.formColumnList = makingJson.list;
-        this.$refs.table.reload({ page: 1, where });
-        this.$refs.table.reRenderTable();
-      },
+      let data = await getProcessInstancePage({
+        pageNo: page,
+        pageSize: limit,
+        ...this.params,
+        processType: '1',
+        createTimeBegin,
+        createTimeEnd
+      });
+      data = data.list.map((item) => {
+        return {
+          ...item,
+          ...item.valueJson
+        };
+      });
+      return data;
+    },
+    /* 刷新表格 */
+    reload(where) {
+      let find =
+        this.defaultTemplateList.find(
+          (item) => item.id == this.params.formId
+        ) || {};
+      let makingJson = JSON.parse(find.formJson.makingJson) || {};
+      this.formColumnList = makingJson.list;
+      this.$refs.table.reload({ page: 1, where });
+      this.$refs.table.reRenderTable();
+    },
 
-      /*  重置 */
-      reset() {
-        this.params = { ...defaultParams };
-        this.createTime1 = [];
-        this.params.dictType = this.dictList['collaborative_type'][0].value;
-        this.params.formId = this.templateList[this.params.dictType][0]?.id;
+    /*  重置 */
+    reset() {
+      this.params = { ...defaultParams };
+      this.createTime1 = [];
+      this.params.dictType = this.dictList['collaborative_type'][0].value;
+      this.params.formId = this.templateList[this.params.dictType][0]?.id;
 
-        this.reload();
-      },
-      /* 表格数据源 */
-      async deptDatasource({ page, limit, where, order }) {
-        let [createTimeBegin, createTimeEnd] = this.createTime1 || [];
-        let data = await getProcessInstanceDeptPage({
-          pageNo: page,
-          pageSize: limit,
-          ...this.params,
-          processType: '1',
-          createTimeBegin,
-          createTimeEnd
-        });
-        data = data.list.map((item) => {
-          return {
-            ...item,
-            ...item.valueJson
-          };
-        });
-        return data;
-      },
-      /* 刷新表格 */
-      deptReload(where) {
-        let find =
-          this.defaultTemplateList.find(
-            (item) => item.id == this.params.formId
-          ) || {};
-        let makingJson = JSON.parse(find.formJson.makingJson) || {};
-        this.formColumnList = makingJson.list;
+      this.reload();
+    },
+    /* 表格数据源 */
+    async deptDatasource({ page, limit, where, order }) {
+      let [createTimeBegin, createTimeEnd] = this.createTime1 || [];
+      let data = await getProcessInstanceDeptPage({
+        pageNo: page,
+        pageSize: limit,
+        ...this.params,
+        processType: '1',
+        createTimeBegin,
+        createTimeEnd
+      });
+      data = data.list.map((item) => {
+        return {
+          ...item,
+          ...item.valueJson
+        };
+      });
+      return data;
+    },
+    /* 刷新表格 */
+    deptReload(where) {
+      let find =
+        this.defaultTemplateList.find(
+          (item) => item.id == this.params.formId
+        ) || {};
+      let makingJson = JSON.parse(find.formJson.makingJson) || {};
+      this.formColumnList = makingJson.list;
 
-        this.$refs.deptTable.reload({ page: 1, where });
-      },
-      /*  重置 */
-      deptReset() {
-        this.params = { ...defaultParams };
-        this.createTime1 = [];
-        this.params.formId = this.defaultTemplateList[0]?.id;
-        this.params.dictType = this.dictList['collaborative_type'][0].value;
-        this.deptReload();
-      },
-      /* 表格数据源 */
-      async noticeDatasource({ page, limit, where, order }) {
-        let [createTimeBegin, createTimeEnd] = this.createTime1 || [];
+      this.$refs.deptTable.reload({ page: 1, where });
+    },
+    /*  重置 */
+    deptReset() {
+      this.params = { ...defaultParams };
+      this.createTime1 = [];
+      this.params.formId = this.defaultTemplateList[0]?.id;
+      this.params.dictType = this.dictList['collaborative_type'][0].value;
+      this.deptReload();
+    },
+    /* 表格数据源 */
+    async noticeDatasource({ page, limit, where, order }) {
+      let [createTimeBegin, createTimeEnd] = this.createTime1 || [];
 
-        let data = await getProcessInstanceNoticePage({
-          pageNo: page,
-          pageSize: limit,
-          ...this.params,
-          processType: '1',
-          createTimeBegin,
-          createTimeEnd
-        });
-        data = data.list.map((item) => {
-          return {
-            ...item,
-            ...item.valueJson
-          };
-        });
-        return data;
-      },
-      /* 刷新表格 */
-      noticeReload(where) {
-        let find =
-          this.defaultTemplateList.find(
-            (item) => item.id == this.params.formId
-          ) || {};
-        let makingJson = JSON.parse(find.formJson.makingJson) || {};
-        this.formColumnList = makingJson.list;
-        this.$refs.noticeTable.reload({ page: 1, where });
-      },
-      /*  重置 */
-      noticeReset() {
-        this.params = { ...defaultParams };
-        this.createTime1 = [];
+      let data = await getProcessInstanceNoticePage({
+        pageNo: page,
+        pageSize: limit,
+        ...this.params,
+        processType: '1',
+        createTimeBegin,
+        createTimeEnd
+      });
+      data = data.list.map((item) => {
+        return {
+          ...item,
+          ...item.valueJson
+        };
+      });
+      return data;
+    },
+    /* 刷新表格 */
+    noticeReload(where) {
+      let find =
+        this.defaultTemplateList.find(
+          (item) => item.id == this.params.formId
+        ) || {};
+      let makingJson = JSON.parse(find.formJson.makingJson) || {};
+      this.formColumnList = makingJson.list;
+      this.$refs.noticeTable.reload({ page: 1, where });
+    },
+    /*  重置 */
+    noticeReset() {
+      this.params = { ...defaultParams };
+      this.createTime1 = [];
 
-        this.params.formId = this.defaultTemplateList[0]?.id;
-        this.params.dictType = this.dictList['collaborative_type'][0].value;
-        this.noticeReload();
-      },
-      /**  */
-      handleAudit(row) {
-        this.$refs.detailRef.open(row.id);
-      },
-      /**  */
-      handleDetail(row) {
-        this.formDetailDialogFlag = true;
-        this.$nextTick(() => {
-          this.$refs.formDetailDialogRef.open(row);
-        });
-      },
-      getTimelineItemType(result) {
-        if (result === '通过') {
-          return 'success';
-        }
-        if (result === '不通过') {
-          return 'danger';
-        }
-        if (result === '取消') {
-          return 'info';
-        }
-        if (result === '处理中') {
-          return 'warning';
-        }
+      this.params.formId = this.defaultTemplateList[0]?.id;
+      this.params.dictType = this.dictList['collaborative_type'][0].value;
+      this.noticeReload();
+    },
+    /**  */
+    handleAudit(row) {
+      this.$refs.detailRef.open(row.id);
+    },
+    /**  */
+    handleDetail(row) {
+      this.formDetailDialogFlag = true;
+      this.$nextTick(() => {
+        this.$refs.formDetailDialogRef.open(row);
+      });
+    },
+    getTimelineItemType(result) {
+      if (result === '通过') {
+        return 'success';
+      }
+      if (result === '不通过') {
+        return 'danger';
+      }
+      if (result === '取消') {
+        return 'info';
+      }
+      if (result === '处理中') {
+        return 'warning';
+      }
 
-        return '';
-      },
-      getDateTime(ms) {
-        return getDate(ms);
-      },
-      tabClick() {
-        if (this.activeName == 'user') {
-          this.reset();
-        } else if (this.activeName == 'dept') {
-          this.deptReset();
-        } else if (this.activeName == 'notice') {
-          this.noticeReset();
-        }
+      return '';
+    },
+    getDateTime(ms) {
+      return getDate(ms);
+    },
+    tabClick() {
+      if (this.activeName == 'user') {
+        this.reset();
+      } else if (this.activeName == 'dept') {
+        this.deptReset();
+      } else if (this.activeName == 'notice') {
+        this.noticeReset();
       }
     }
-  };
+  }
+};
 </script>
 <style scoped lang="scss">
-  .ele-body {
-    padding: 15px;
-  }
+.ele-body {
+  padding: 15px;
+}
 
-  .content-box {
+.content-box {
+  width: 100%;
+  //max-width: 273px;
+  //min-width: 90px;
+  // margin-right: 10px;
+  display: flex;
+  flex-direction: row;
+  flex-wrap: wrap;
+  //justify-content: space-between;
+
+  .category_box {
+    border-left: 1px solid #e1e1e1;
+    border-bottom: 1px solid #e1e1e1;
+    border-radius: 1px;
+    // flex: 1 0 25%;
+    margin-top: 5px;
+    overflow: auto;
     width: 100%;
-    //max-width: 273px;
-    //min-width: 90px;
-    // margin-right: 10px;
-    display: flex;
-    flex-direction: row;
-    flex-wrap: wrap;
-    //justify-content: space-between;
 
-    .category_box {
-      border-left: 1px solid #e1e1e1;
+    .category_box_title {
+      font-size: 14px;
+      font-weight: bold;
+      color: #fff8f8;
+      height: 39px;
+      display: flex;
+      padding: 5px 20px;
+      align-items: center;
+      background: #1890ffd6;
       border-bottom: 1px solid #e1e1e1;
-      border-radius: 1px;
-      // flex: 1 0 25%;
-      margin-top: 5px;
+    }
+
+    .category_box_content {
+      display: flex;
+      flex-direction: row;
+      flex-wrap: wrap;
+      // height: 60px;
       overflow: auto;
-      width: 100%;
 
-      .category_box_title {
-        font-size: 14px;
-        font-weight: bold;
-        color: #fff8f8;
-        height: 39px;
+      .category_content {
+        min-width: 33%;
+        min-height: 60px;
+        //flex: 1 1 0;
         display: flex;
-        padding: 5px 20px;
-        align-items: center;
-        background: #1890ffd6;
+        flex-direction: column;
+        border-right: 1px solid #e1e1e1;
         border-bottom: 1px solid #e1e1e1;
-      }
-
-      .category_box_content {
-        display: flex;
-        flex-direction: row;
-        flex-wrap: wrap;
-        // height: 60px;
-        overflow: auto;
-
-        .category_content {
-          min-width: 33%;
-          min-height: 60px;
-          //flex: 1 1 0;
-          display: flex;
-          flex-direction: column;
-          border-right: 1px solid #e1e1e1;
-          border-bottom: 1px solid #e1e1e1;
-          align-items: center;
-          justify-content: center;
-          //  font-weight: bold;
+        align-items: center;
+        justify-content: center;
+        //  font-weight: bold;
 
-          &:nth-child(n) {
-            span:nth-child(1) {
-              transform: scale(2);
-            }
+        &:nth-child(n) {
+          span:nth-child(1) {
+            transform: scale(2);
+          }
 
-            span:nth-child(2) {
-              padding-top: 5px;
-            }
+          span:nth-child(2) {
+            padding-top: 5px;
           }
         }
+      }
 
-        .category_content:hover {
-          cursor: pointer;
-          background-color: rgba(135, 181, 243, 0.29);
-        }
+      .category_content:hover {
+        cursor: pointer;
+        background-color: rgba(135, 181, 243, 0.29);
       }
     }
+  }
 
-    .category_box:last-child {
-      border-right: 1px solid #e1e1e1;
-    }
+  .category_box:last-child {
+    border-right: 1px solid #e1e1e1;
   }
+}
 
-  .tab-box {
-    width: calc(100vw - 552px);
-    //max-width: 1100px;
-    //min-width: 600px;
-    margin-top: 6px;
-    height: 98%;
+.tab-box {
+  width: calc(100vw - 552px);
+  //max-width: 1100px;
+  //min-width: 600px;
+  margin-top: 6px;
+  height: 98%;
 
-    .el-tabs--border-card {
-      height: 100%;
-    }
+  .el-tabs--border-card {
+    height: 100%;
   }
+}
 
-  ::v-deep .card_box {
-    .el-card__body {
-      padding: 10px;
-      height: 86vh;
-    }
+::v-deep .card_box {
+  .el-card__body {
+    padding: 10px;
+    height: 86vh;
   }
+}
 
-  ::v-deep .ele-table-tool {
-    display: flex;
-    flex-direction: row;
-    flex-wrap: nowrap !important;
-  }
+::v-deep .ele-table-tool {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: nowrap !important;
+}
 </style>

+ 7 - 2
src/views/bpm/handleTask/components/bomApproverJSYY/detailDialog.vue

@@ -109,6 +109,10 @@
         </el-select>
       </template>
 
+      <template v-slot:versions="{ row }">
+        <span>V{{ row.versions }}.0</span>
+      </template>
+
       <template v-slot:materielDesignation="{ row }">
         <el-input
           size="mini"
@@ -122,7 +126,7 @@
 </template>
 
 <script>
-import BOMSearch from './BOM-search.vue';
+  import BOMSearch from './BOM-search.vue';
   import {
     getBomPageCategoryId,
     contactList,
@@ -208,6 +212,7 @@ import BOMSearch from './BOM-search.vue';
           },
           {
             prop: 'versions',
+            slot: 'versions',
             label: '版本'
           },
 
@@ -273,7 +278,7 @@ import BOMSearch from './BOM-search.vue';
       handBomDetails(id) {
         if (id) {
           getBomGetById(id).then((res) => {
-            this.form=res;
+            this.form = res;
             this.baseCount = res.baseCount;
             this.unit = res.category.measuringUnit;
           });

+ 6 - 1
src/views/bpm/handleTask/components/bomApproverJSdevice/detailDialog.vue

@@ -15,7 +15,7 @@
       </div>
       <div> 编码:{{ this.form.code }} </div>
       <div> 名称:{{ this.form.name }} </div>
-      <div> 版本:V{{ this.form.versions }} </div>
+      <div> 版本:V{{ this.form.versions }}.0 </div>
     </div>
 
     <BOMSearch @search="reload" :statusOpt="statusOpt" />
@@ -118,6 +118,10 @@
           :disabled="taskDefinitionKey != 'Activity_0uypakw'"
         ></el-input>
       </template>
+
+      <template v-slot:versions="{ row }">
+        <span>V{{ row.versions }}.0</span>
+      </template>
     </ele-pro-table>
   </div>
 </template>
@@ -207,6 +211,7 @@
           },
           {
             prop: 'versions',
+            slot: 'versions',
             label: '版本'
           },
 

+ 1 - 0
src/views/bpm/handleTask/components/businessOpportunity/opportunityDetailDialog.vue

@@ -98,6 +98,7 @@
       :isDiscount="false"
       :isProduceDeliveryDeadline="taskDefinitionKey === 'productionSupervisorApprove2'"
       :pricing-way="form.pricingWay"
+      
     ></inventoryTable>
 
     <inventoryTabledetail

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

@@ -93,6 +93,9 @@
           <el-form-item prop="contractFile" label="合同附件:">
             <fileMain v-model="form.fileId" type="view"></fileMain>
           </el-form-item>
+          <el-form-item label="生产要求:" prop="productionRequirements">
+            {{ form.productionRequirements }}
+          </el-form-item>
         </el-col>
       </el-row>
       <headerTitle title="基本信息"></headerTitle>

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

@@ -50,7 +50,7 @@
               row-key="id"
             >
               <template v-slot:sort="{ $index }">
-                {{ $index }}
+                {{ $index + 1 }}
               </template>
 
               <template v-slot:deliveryMethod="{ row }">

+ 130 - 61
src/views/bpm/handleTask/components/mesBatchRecordManage/detailDialog.vue

@@ -129,72 +129,70 @@
       ></header-title>
       <!-- 记录规则 -->
       <div v-if="details.executeMethod == 2">
-        <el-table
+        <ele-pro-table
           v-loading="loading"
-          :data="details.details"
-          style="width: 100%"
+          ref="table"
+          row-key="id"
+          :columns="detailsColumns"
+          :datasource="details.details"
+          cacheKey="mes-releaseRulesDialong-2510291358"
+          :needPage="false"
         >
-          <el-table-column type="index" label="序号" width="50">
-          </el-table-column>
-          <el-table-column label="检查内容">
-            <template slot-scope="scope">
-              <div>
-                {{ scope.row.paramValue }}
-              </div>
-            </template>
-          </el-table-column>
-
-          <el-table-column label="检查工具">
-            <template slot-scope="scope">
-              <div>
-                {{ scope.row.toolNames }}
-              </div>
-            </template>
-          </el-table-column>
-          <el-table-column label="检查人">
-            <template slot-scope="scope">
-              <div style="display: flex; align-items: center; cursor: pointer">
-                <div>{{ showCheckUserNames(scope.row.checkUsers) }}</div>
-              </div>
-            </template>
-          </el-table-column>
-          <el-table-column label="检查情况">
-            <template slot-scope="scope">
-              <div>
+          <template v-slot:paramValue="{ row }">
+            <div v-if="details.recordRulesClassify == 4">
+              {{ row.productName || row.name }}
+            </div>
+            <div v-else>
+              {{ row.paramValue }}
+            </div>
+          </template>
+          <template v-slot:toolNames="{ row }">
+            <el-link :underline="false" style="cursor: pointer">
+              <div class="ele-cell">
                 <div>
-                  <el-radio-group v-model="scope.row.checkStatus" disabled>
-                    <el-radio :label="1">已检查</el-radio>
-                    <el-radio :label="0">未检查</el-radio>
-                  </el-radio-group>
+                  {{ row.toolNames }}
                 </div>
               </div>
-            </template>
-          </el-table-column>
-          <el-table-column label="检查结果">
-            <template slot-scope="scope">
-              <div>
-                <el-radio-group v-model="scope.row.checkResult" disabled>
-                  <el-radio :label="1">合格</el-radio>
-                  <el-radio :label="0">不合格</el-radio>
-                </el-radio-group>
-              </div>
-            </template>
-          </el-table-column>
-          <el-table-column label="异常描述">
-            <template slot-scope="scope">
-              <div>
-                <el-input
-                  type="textarea"
-                  :rows="1"
-                  placeholder="请输入"
-                  v-model="scope.row.errorMsg"
-                  disabled
-                >
-                </el-input>
+            </el-link>
+          </template>
+          <template v-slot:checkUsersIds="{ row }">
+            <div>
+              <div style="display: flex; align-items: center; cursor: pointer">
+                <div>{{ showCheckUserNames(row.checkUsers) }}</div>
               </div>
-            </template>
-          </el-table-column>
-        </el-table>
+            </div>
+          </template>
+          <template v-slot:checkStatus="{ row }">
+            <div>
+              <el-radio-group v-model="row.checkStatus">
+                <el-radio :label="1">已检查</el-radio>
+                <el-radio :label="0">未检查</el-radio>
+              </el-radio-group>
+            </div>
+          </template>
+          <template v-slot:errorMsg="{ row }">
+            <div>
+              <el-input
+                type="text"
+                :rows="1"
+                placeholder="请输入"
+                v-model="row.errorMsg"
+              >
+                <template v-if="row.unitName" slot="append">
+                  <div>{{ row.unitName }}</div>
+                </template>
+              </el-input>
+            </div></template
+          >
+          <template v-slot:checkResult="{ row }">
+            <div>
+              <el-radio-group v-model="row.checkResult">
+                <el-radio :label="1">合格</el-radio>
+                <el-radio :label="0">不合格</el-radio>
+              </el-radio-group>
+            </div>
+          </template>
+        </ele-pro-table>
       </div>
       <!-- 事项规则 -->
       <div v-if="details.executeMethod == 1 && eamPlanInfo">
@@ -499,6 +497,69 @@
         ruleInfo: ''
       };
     },
+    computed: {
+      // 规则详情表头
+      detailsColumns() {
+        let list = [
+          {
+            width: 45,
+            type: 'index',
+            columnKey: 'index',
+            align: 'center'
+          },
+          {
+            label: '检查内容',
+            prop: 'paramValue',
+            minWidth: 120,
+            slot: 'paramValue'
+          }
+        ];
+
+        if (this.details && this.details.recordRulesClassify != '4') {
+          list = [
+            ...list,
+            {
+              label: '检查工具',
+              prop: 'toolNames',
+              minWidth: 120,
+              slot: 'toolNames'
+            },
+            {
+              label: '检查人',
+              prop: 'checkUsersIds',
+              minWidth: 120,
+              slot: 'checkUsersIds'
+            },
+            {
+              label: '检查情况',
+              prop: 'checkStatus',
+              minWidth: 120,
+              slot: 'checkStatus'
+            },
+            {
+              label: '描述',
+              prop: 'errorMsg',
+              minWidth: 120,
+              slot: 'errorMsg'
+            },
+            {
+              label: '检查结果',
+              prop: 'checkResult',
+              minWidth: 120,
+              slot: 'checkResult'
+            }
+          ];
+        } else {
+          list.push({
+            label: '描述',
+            prop: 'errorMsg',
+            minWidth: 120,
+            slot: 'errorMsg'
+          });
+        }
+        return list;
+      }
+    },
     mounted() {
       console.log('this.businessId', this.businessId);
       this.getDatails(this.businessId);
@@ -516,6 +577,10 @@
           const data = await getById(id);
           console.log('data 详情数据', data);
           data.recordRulesClassify = data.recordRulesClassify + '';
+          data.details = data.details.map((i) => {
+            i.toolNames = i.tools.map((i) => i.toolName).join(',');
+            return i;
+          });
           this.details = data;
           this.loading = false;
         } catch (error) {
@@ -527,7 +592,7 @@
 
         return userList
           .map((i) => {
-            return i.groupName + '-' + i.userName;
+            return (i.groupName || i.teamName) + '-' + i.userName;
           })
           .join(',');
       },
@@ -654,4 +719,8 @@
       }
     }
   }
+
+  ::v-deep .el-form-item--medium .el-form-item__content {
+    line-height: initial;
+  }
 </style>

+ 2 - 2
src/views/bpm/handleTask/components/mesWorkOrderChecklist/detailDialog.vue

@@ -52,7 +52,7 @@
         <template v-slot:isPass="{ row }">
           <el-radio-group v-model="row.isPass">
             <el-radio :label="1">是</el-radio>
-            <el-radio :label="2">否</el-radio>
+            <el-radio :label="0">否</el-radio>
           </el-radio-group>
         </template>
         <template v-slot:remark="{ row }">
@@ -116,7 +116,7 @@
         <template v-slot:isPass="{ row }">
           <el-radio-group v-model="row.isPass">
             <el-radio :label="1">是</el-radio>
-            <el-radio :label="2">否</el-radio>
+            <el-radio :label="0">否</el-radio>
           </el-radio-group>
         </template>
         <template v-slot:remark="{ row }">

+ 227 - 242
src/views/bpm/handleTask/components/outsourcedWarehousing/components/details.vue

@@ -1,256 +1,241 @@
 <template>
-    <el-dialog title="详情" :visible.sync="visible" :before-close="handleClose" :close-on-click-modal="false"
-        :close-on-press-escape="false" append-to-body width="80%">
-
-        <!-- 数据表格 -->
-        <ele-pro-table ref="table" v-if="detailType == 1" :columns="columns" cache-key="detailsTable"
-            height="calc(100vh - 350px)">
-            <template v-slot:totalCount="{ row }">
-                {{ row.totalCount }}{{ row.measuringUnit }}
-            </template>
-
-            
-            <template v-slot:sourceType="{ row }">
-                 <el-tag v-if="row.sourceType == 1" size="mini" type="success">物品清单</el-tag>
-                 <el-tag v-if="row.sourceType == 2" size="mini" type="warning">带料清单</el-tag>
-                 <el-tag v-if="row.sourceType == 3" size="mini" type="danger">产出清单</el-tag>
-            </template>
-
-        </ele-pro-table>
-
-
-        <ele-pro-table ref="table2" v-if="detailType == 2" :columns="columns2" cache-key="detailsTable2"
-            height="calc(100vh - 350px)">
-            <template v-slot:totalCount="{ row }">
-                {{ row.totalCount }}{{ row.measuringUnit }}
-            </template>
-
-            
-            <template v-slot:sourceType="{ row }">
-                <el-tag v-if="row.sourceType == 1" size="mini" type="success">物品清单</el-tag>
-                 <el-tag v-if="row.sourceType == 2" size="mini" type="warning">带料清单</el-tag>
-                 <el-tag v-if="row.sourceType == 3" size="mini" type="danger">产出清单</el-tag>
-            </template>
-
-        </ele-pro-table>
-
-
-
-    </el-dialog>
+  <el-dialog
+    title="详情"
+    :visible.sync="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    width="80%"
+  >
+    <!-- 数据表格 -->
+    <ele-pro-table
+      ref="table"
+      v-if="detailType == 1"
+      :columns="columns"
+      :datasource="dataList"
+      cache-key="detailsTable"
+      height="calc(100vh - 350px)"
+    >
+      <template v-slot:totalCount="{ row }">
+        {{ row.totalCount }}{{ row.measuringUnit }}
+      </template>
+
+      <template v-slot:sourceType="{ row }">
+        <el-tag v-if="row.sourceType == 1" size="mini" type="success"
+          >物品清单</el-tag
+        >
+        <el-tag v-if="row.sourceType == 2" size="mini" type="warning"
+          >带料清单</el-tag
+        >
+        <el-tag v-if="row.sourceType == 3" size="mini" type="danger"
+          >产出清单</el-tag
+        >
+      </template>
+    </ele-pro-table>
+
+    <ele-pro-table
+      ref="table2"
+      v-if="detailType == 2"
+      :columns="columns2"
+      cache-key="detailsTable2"
+      :datasource="dataList"
+      height="calc(100vh - 350px)"
+    >
+      <template v-slot:totalCount="{ row }">
+        {{ row.totalCount }}{{ row.measuringUnit }}
+      </template>
+
+      <template v-slot:sourceType="{ row }">
+        <el-tag v-if="row.sourceType == 1" size="mini" type="success"
+          >物品清单</el-tag
+        >
+        <el-tag v-if="row.sourceType == 2" size="mini" type="warning"
+          >带料清单</el-tag
+        >
+        <el-tag v-if="row.sourceType == 3" size="mini" type="danger"
+          >产出清单</el-tag
+        >
+      </template>
+    </ele-pro-table>
+  </el-dialog>
 </template>
-  
-<script>
-
 
-export default {
-    components: {
-    },
+<script>
+  export default {
+    components: {},
     data() {
-        return {
-            visible: false,
-            detailType: null,
-
-        }
+      return {
+        visible: false,
+        detailType: null,
+        dataList: []
+      };
     },
 
     computed: {
-        // 表格列配置
-        columns() {
-            return [
-                {
-                    columnKey: 'index',
-                    label: '序号',
-                    type: 'index',
-                    width: 55,
-                    align: 'center',
-                    showOverflowTooltip: true,
-                    fixed: 'left'
-                },
-
-
-                {
-                    prop: 'categoryCode',
-                    label: '编码',
-                    align: 'center'
-                },
-                {
-                    prop: 'categoryName',
-                    label: '名称',
-                    align: 'center'
-                },
-
-                {
-                    prop: 'sourceType',
-                    slot: 'sourceType',
-                    label: '类型',
-                    align: 'center'
-                },
-
-                {
-                    prop: 'brandNum',
-                    label: '牌号',
-                    align: 'center'
-                },
-
-
-                {
-                    prop: 'modelType',
-                    label: '型号',
-                    align: 'center'
-                },
-
-
-
-                {
-                    prop: 'specification',
-                    label: '规格',
-                    align: 'center'
-                },
-
-
-                {
-                    slot: 'totalCount',
-                    label: '数量',
-                    align: 'center'
-                },
-
-
-
-
-
-
-
-
-
-            ];
-        },
-
-        columns2() {
-            return [
-                {
-                    columnKey: 'index',
-                    label: '序号',
-                    type: 'index',
-                    width: 55,
-                    align: 'center',
-                    showOverflowTooltip: true,
-                    fixed: 'left'
-                },
-
-
-                {
-                    prop: 'categoryCode',
-                    label: '编码',
-                    align: 'center'
-                },
-                {
-                    prop: 'categoryName',
-                    label: '名称',
-                    align: 'center'
-                },
-
-                {
-                    prop: 'sourceType',
-                    slot: 'sourceType',
-                    label: '类型',
-                    align: 'center'
-                },
-
-                {
-                    prop: 'brandNum',
-                    label: '牌号',
-                    align: 'center'
-                },
-
-
-                {
-                    prop: 'modelType',
-                    label: '型号',
-                    align: 'center'
-                },
-
-
-
-                {
-                    prop: 'specification',
-                    label: '规格',
-                    align: 'center'
-                },
-
-
-                {
-                    label: '物料代号',
-                    prop: 'extInfo.materielCode',
-                    align: 'center'
-                },
-                {
-                    label: '客户代号',
-                    prop: 'extInfo.clientCode',
-                    align: 'center'
-                },
-                {
-                    label: '刻码',
-                    prop: 'extInfo.engrave',
-                    align: 'center'
-                },
-
-
-                {
-                    slot: 'totalCount',
-                    label: '数量',
-                    align: 'center'
-                },
-
-
-            ];
-        },
-
-        clientEnvironmentId() {
-            return this.$store.state.user.info.clientEnvironmentId;
-        },
+      // 表格列配置
+      columns() {
+        return [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+
+          {
+            prop: 'categoryCode',
+            label: '编码',
+            align: 'center'
+          },
+          {
+            prop: 'categoryName',
+            label: '名称',
+            align: 'center'
+          },
+
+          {
+            prop: 'sourceType',
+            slot: 'sourceType',
+            label: '类型',
+            align: 'center'
+          },
+
+          {
+            prop: 'brandNum',
+            label: '牌号',
+            align: 'center'
+          },
+
+          {
+            prop: 'modelType',
+            label: '型号',
+            align: 'center'
+          },
+
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center'
+          },
+
+          {
+            slot: 'totalCount',
+            label: '数量',
+            align: 'center'
+          }
+        ];
+      },
+
+      columns2() {
+        return [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+
+          {
+            prop: 'categoryCode',
+            label: '编码',
+            align: 'center'
+          },
+          {
+            prop: 'categoryName',
+            label: '名称',
+            align: 'center'
+          },
+
+          {
+            prop: 'sourceType',
+            slot: 'sourceType',
+            label: '类型',
+            align: 'center'
+          },
+
+          {
+            prop: 'brandNum',
+            label: '牌号',
+            align: 'center'
+          },
+
+          {
+            prop: 'modelType',
+            label: '型号',
+            align: 'center'
+          },
+
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center'
+          },
+
+          {
+            label: '物料代号',
+            prop: 'extInfo.materielCode',
+            align: 'center'
+          },
+          {
+            label: '客户代号',
+            prop: 'extInfo.clientCode',
+            align: 'center'
+          },
+          {
+            label: '刻码',
+            prop: 'extInfo.engrave',
+            align: 'center'
+          },
+
+          {
+            slot: 'totalCount',
+            label: '数量',
+            align: 'center'
+          }
+        ];
+      },
+
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      }
     },
 
-    watch: {
-
-    },
+    watch: {},
     methods: {
+      open(row) {
+        this.visible = true;
+        if (row.detailType == 1) {
+          this.detailType = 1;
+          this.dataList = row.detailList.map((item) => {
+            return item;
+          });
+          // this.$nextTick(() => {
+          //   this.$refs.table.setData([...row.detailList]);
+          // });
+        } else if (row.detailType == 2) {
+          this.detailType = 2;
+          // this.$nextTick(() => {
+          this.dataList = row.detailList.map((item) => {
+            return item;
+          });
+          // console.log(row.detailList, 'row.detailList2');
+          // this.$refs.table2.setData([...row.detailList]);
+          // });
+        }
+      },
 
-
-
-        open(row) {
-            this.visible = true
-            if (row.detailType == 1) {
-                this.detailType = 1
-                this.$nextTick(() => {
-                    this.$refs.table.setData([...row.detailList]);
-                })
-            } else if (row.detailType == 2) {
-                this.detailType = 2
-                this.$nextTick(() => {
-                    this.$refs.table2.setData([...row.detailList]);
-                })
-            }
-
-
-
-        },
-
-
-
-
-
-
-
-        handleClose() {
-            this.visible = false
-
-
-
-        },
-
+      handleClose() {
+        this.visible = false;
+      }
     }
-}
+  };
 </script>
-  
+
 <style lang="scss" scoped></style>
-  

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

@@ -116,7 +116,7 @@
         <!--  ///  仓管入库展示字段 -->
         <template v-slot:ifPackageOk="{ row, $index }">
           <el-form-item :prop="'detailList.' + $index + '.ifPackageOk'" :rules="{
-            required: true,
+            required: false,
             trigger: 'change',
             message: '请选择包装完好与否'
           }">
@@ -129,11 +129,11 @@
           </el-form-item>
         </template>
         <template v-slot:headerIfPackageOk="{ column }">
-          <span class="is-required">{{ column.label }}</span>
+          <span>{{ column.label }}</span>
         </template>
         <template v-slot:unpackUserName="{ row, $index }">
           <el-form-item :prop="'detailList.' + $index + '.unpackUserName'" :rules="{
-            required: true,
+            required: false,
             trigger: 'change',
             message: '请选择拆包装责任人'
           }">
@@ -143,7 +143,7 @@
           </el-form-item>
         </template>
         <template v-slot:headerUnpackUserName="{ column }">
-          <span class="is-required">{{ column.label }}</span>
+          <span>{{ column.label }}</span>
         </template>
         <!--////-->
         <!--  ///  质检员审核展示字段 -->
@@ -621,7 +621,7 @@ export default {
             headerSlot: 'headerUnpackUserName'
           }
         ],
-        //质检员审核
+        //质检员审核  
         QCApprove: [
           {
             minWidth: 250,

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

@@ -131,13 +131,13 @@
             name: '销售主管审批',
             isShow: true
           },
-          {
-            key: 'storeman',
-            permissionType: 'update',
-            isShowReturnOrder: true,
-            name: '仓管入库',
-            isShow: true
-          },
+          // {
+          //   key: 'storeman',
+          //   permissionType: 'update',
+          //   isShowReturnOrder: true,
+          //   name: '仓管入库',
+          //   isShow: true
+          // },
           {
             key: 'QCLeader',
             permissionType: 'view',

+ 238 - 0
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/purchaseList.vue

@@ -0,0 +1,238 @@
+<template>
+  <div>
+    <ele-pro-table
+      ref="table"
+      :needPage="false"
+      :datasource="tableList"
+      :columns="columns"
+    >
+    </ele-pro-table>
+  </div>
+</template>
+<script>
+  import { getTableList } from '@/api/bpm/components/purchasingManage/purchaseOrder';
+  import { purchaseOrderProgressStatusEnum, reviewStatus } from '@/enum/dict';
+  export default {
+    props: {
+      relationId: {
+        default: () => []
+      }
+    },
+    watch: {
+      relationId(val) {
+        // alert(1)
+        if (val.length) {
+          this.productionplanByIds();
+        }
+      }
+    },
+    data() {
+      return {
+        tableList:[],
+        columns: [
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          prop: 'orderNo',
+          label: '订单编码',
+          align: 'center',
+          sortable: true,
+          slot: 'orderNo',
+          showOverflowTooltip: true,
+          minWidth: 200,
+          fixed: 'left'
+        },
+        {
+          prop: 'sourceTypeName',
+          label: '订单类型',
+          align: 'center',
+          sortable: true,
+          showOverflowTooltip: true,
+          minWidth: 200,
+          fixed: 'left'
+        },
+        {
+          prop: 'progress',
+          label: '订单进度',
+          align: 'center',
+          showOverflowTooltip: true,
+          formatter: (_row, _column, cellValue) => {
+            return purchaseOrderProgressStatusEnum.find(
+              (val) => val.value == _row.progress
+            )?.label;
+          },
+          minWidth: 120
+        },
+
+        {
+          prop: 'relationType',
+          label: '来源单据类型',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 150,
+          formatter: (_row, _column, cellValue) => {
+            return _row.relationType == 1
+              ? '采购需求单'
+              : _row.relationType == 2
+              ? '采购计划单'
+              : _row.relationType == 3
+              ? '采购核价单'
+              : _row.relationType == 4
+              ? '采购合同'
+              : '';
+          }
+        },
+        {
+          prop: 'relationName',
+          label: '来源单据',
+          align: 'center',
+          slot: 'relationName',
+          showOverflowTooltip: true,
+          minWidth: 250
+        },
+        {
+          prop: 'partaName',
+          label: '采购方名称',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 200
+        },
+        {
+          prop: 'partaLinkName',
+          label: '采购方联系人',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 130
+        },
+
+        {
+          prop: 'partaTel',
+          label: '采购方联系电话',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 130
+        },
+        {
+          prop: 'productNames',
+          label: '名称',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 200
+        },
+        {
+          prop: 'productCodes',
+          label: '编码',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 140
+        },
+        {
+          prop: 'batchNos',
+          label: '批次号',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 140
+        },
+        {
+          prop: 'productCount',
+          label: '数量',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 140
+        },
+        {
+          prop: 'inboundCount',
+          label: '收货数量',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 140
+        },
+
+        {
+          prop: 'partbName',
+          label: '供应商名称',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 250
+        },
+        {
+          prop: 'partbLinkName',
+          label: '供应商联系人',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120
+        },
+        {
+          prop: 'partbTel',
+          label: '供应商联系电话',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 130
+        },
+        {
+          prop: 'isInspection',
+          label: '是否来料检',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 130,
+          formatter: (_row, _column, cellValue) => {
+            return cellValue == 1 ? '是' : '否';
+          }
+        },
+        {
+          prop: 'payAmount',
+          label: '金额(元)',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 140
+        },
+        {
+          prop: 'createUserName',
+          label: '创建人',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 170
+        },
+        {
+          prop: 'createTime',
+          label: '创建时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 170
+        },
+        {
+          prop: 'orderStatus',
+          label: '审核状态',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 100,
+          formatter: (_row, _column, cellValue) => {
+            return reviewStatus[_row.orderStatus];
+          }
+        },
+      ],
+      };
+    },
+    computed: {},
+    created() {
+      console.log('this.relationId~~~', this.relationId);
+      this.productionplanByIds()
+    },
+    methods: {
+      productionplanByIds(){
+        getTableList({relationId:this.relationId}).then(res=>{
+          console.log('res~~~', res);
+          this.tableList=res.list
+        })
+      }
+    }
+  };
+</script>
+<style lang="scss" scoped></style>

+ 11 - 5
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/repair-tabs-page.vue

@@ -29,10 +29,14 @@
     name: 'repairTabsPage',
     components: {
       // outerStoremanOut: () => import('./outboundToOutsourcing.vue'),
+      // outerStoremanOut: () =>
+      //   import('@/views/bpm/outgoingManagement/outbound.vue'),
+      // outerStoremanOutDetails: () =>
+      //   import('@/views/bpm/outgoingManagement/details.vue'),
       outerStoremanOut: () =>
-        import('@/views/bpm/outgoingManagement/outbound.vue'),
+        import('@/views/bpm/handleTask/components/saleOrder/customerReturnGoods/purchaseList.vue'),
       outerStoremanOutDetails: () =>
-        import('@/views/bpm/outgoingManagement/details.vue'),
+        import('@/views/bpm/handleTask/components/saleOrder/customerReturnGoods/purchaseList.vue'),
       // outerStoremanIn: () => import('./interiorStorageToOutsourcing.vue'),
       outerStoremanIn: () => import('@/views/bpm/stockManagement/storage.vue'),
       outerStoremanInDetails: () =>
@@ -85,6 +89,7 @@
     },
     watch: {
       activeName(val) {
+        console.log('componentName~~~', val);
         let componentName = val;
         const detailsArr = ['outerStoremanOut', 'outerStoremanIn','outerFillWeight'];
         if (
@@ -121,7 +126,7 @@
           //   isOutOrIn: 'innerStore'
           // },
           {
-            label: '物品出库给外协',
+            label: '采购单',
             name: 'outerStoremanOut',
             isOutOrIn: 'outerStore'
           },
@@ -176,12 +181,13 @@
               bizType: 6,
               sourceBizNo: this.form.returnHandleNo,
               detailList: this.detailList,
-              
+               relationId: this.businessId
             };
           case 'outerStoremanOutDetails':
             return {
               businessId: this.form.outerOutReceiptId,
-              isIds: true
+              isIds: true,
+              relationId: this.businessId
             };
 
           case 'outerInQC':

+ 3 - 1
src/views/bpm/handleTask/components/saleOrder/detailDialog.vue

@@ -42,6 +42,9 @@
             <el-form-item label="客户收货地址:" prop="receiveAddress">
               {{ form.receiveAddress }}
             </el-form-item>
+            <el-form-item label="生产要求:" prop="productionRequirements">
+              {{ form.productionRequirements }}
+            </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item
@@ -100,7 +103,6 @@
             <el-form-item label="订单备注:" prop="remark">
               {{ form.remark }}
             </el-form-item>
-
             <el-form-item
               label="总数"
               prop="totalPlanNum"

+ 3 - 0
src/views/bpm/handleTask/components/saleOrder/invoice/detailDialog.vue

@@ -83,6 +83,9 @@
           <el-form-item prop="orderNo" label="订单编码:">
             {{ form.orderNo }}
           </el-form-item>
+          <el-form-item label="生产要求:" prop="productionRequirements">
+            {{ form.productionRequirements }}
+          </el-form-item>
         </el-col>
         <el-col :span="8">
           <el-form-item prop="replied" label="是否回执:">

+ 40 - 4
src/views/bpm/handleTask/components/saleOrder/returnGoods/detailDialog.vue

@@ -93,10 +93,10 @@
           </el-form-item>
           <el-form-item
             label="回执附件:"
-            prop="sendFiles"
+            prop="repliedFiles"
             style="margin-bottom: 16px"
           >
-            <fileMain v-model="form.sendFiles" type="view"></fileMain>
+            <fileMain v-model="form.repliedFiles" type="view"></fileMain>
           </el-form-item>
         </el-col>
       </el-row>
@@ -150,6 +150,25 @@
       :isProduceDeliveryDeadline="taskDefinitionKey == 'produceLeader'"
       :isDiscount="false"
     ></inventoryTable>
+
+    <div style="margin-top: 20px">
+      <add
+        v-if="taskDefinitionKey == 'warehouseManager'" 
+        ref="add"
+        :form="form"
+        :sourceBizNo="form.returnNo"
+        :detailList="form?.productList?.filter((item) => item.packageId)"
+        :saleProductList="form?.productList?.filter((item) => !item.packageId)"
+        :isShowPackage="true"
+        :bizType="6"
+        :isMoreProduct="true"
+      ></add>
+      <detailDialog
+        v-if="taskDefinitionKey == 'warehouseManager' && isView"
+        :businessId="form.returnNo"
+        ref="detailDialog"
+      ></detailDialog>
+    </div>
   </div>
 </template>
 
@@ -164,12 +183,16 @@
   import inventoryTabledetail from '@/BIZComponents/inventoryTableDetails.vue';
   import inventoryTable from '@/BIZComponents/inventoryTable.vue';
   // import fileMain from '@/components/addDoc/index.vue';
+  import add from '@/views/bpm/stockManagement/storage.vue';
+  import detailDialog from '@/views/bpm/stockManagement/details.vue';
 
   export default {
     mixins: [dictMixins],
     components: {
       inventoryTabledetail,
-      inventoryTable
+      inventoryTable,
+      add,
+      detailDialog
       // fileMain
     },
     data() {
@@ -706,18 +729,22 @@
       },
       taskDefinitionKey: {
         default: ''
+      },
+      isView: {
+        default: false
       }
     },
     created() {
       this.getDetailData(this.businessId);
       this.requestDict('产地');
+      console.log(this.isView, 'isView');
     },
     methods: {
       downloadFile(file) {
         getFile({ objectName: file.storePath }, file.name);
       },
       async getTableValue() {
-        console.log(await this.getValidate());
+        // console.log(await this.getValidate());
         try {
           // 表单验证通过,执行保存操作
           this.loading = true;
@@ -730,9 +757,14 @@
             redressProductList = redressProductList.productList;
           }
 
+          if (this.taskDefinitionKey == 'warehouseManager') {
+            this.form.returnStorageData = await this.$refs.add.getReturnStorage();
+          }
+
           let commitData = Object.assign({}, this.form, {
             redressProductList
           });
+          
           return commitData;
         } catch (error) {
           console.log(error);
@@ -765,6 +797,10 @@
         if (data) {
           this.detailData = data;
           this.form = data;
+          this.form.productList.forEach((item) => {
+            item['packingWeight'] = item.receiveTotalWeight;
+            item['quantity'] = item.totalCount;
+          });
           this.form.pricingWay = data?.saleOrder?.pricingWay;
           this.$nextTick(() => {
             this.$refs.inventoryTabledetailRef &&

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

@@ -23,7 +23,7 @@
         type="success"
         size="mini"
         @click="handleAudit(1)"
-        v-if="outInData.verifyStatus==2"
+        v-if="outInData.verifyStatus == 2 || !['warehouseManager'].includes(taskDefinitionKey)"
         >通过
       </el-button>
       <el-button
@@ -32,21 +32,31 @@
         size="mini"
         @click="storemanApprove"
         v-if="
-          ['storemanApprove'].includes(taskDefinitionKey) &&
-          activeComp == 'main'&&[0,3].includes(outInData.verifyStatus)
+          (['storemanApprove'].includes(taskDefinitionKey) &&
+          activeComp == 'main' &&
+          [0, 3].includes(outInData.verifyStatus)) || ['warehouseManager'].includes(taskDefinitionKey)
         "
-        >申请
+        >申请
       </el-button>
       <el-button
         icon="el-icon-circle-close"
         type="danger"
         size="mini"
         @click="handleAudit(0)"
-        v-if="!['starter'].includes(taskDefinitionKey)&&outInData.verifyStatus!=1"
+        v-if="
+          !((['starter'].includes(taskDefinitionKey) &&
+          outInData.verifyStatus != 1) || 
+          ['warehouseManager'].includes(taskDefinitionKey))
+        "
         >驳回
       </el-button>
-      <el-dropdown @command="(command) => handleCommand(command)" style="margin-left: 30px;">
-        <span class="el-dropdown-link">更多<i class="el-icon-arrow-down el-icon--right"></i></span>
+      <el-dropdown
+        @command="(command) => handleCommand(command)"
+        style="margin-left: 30px"
+      >
+        <span class="el-dropdown-link"
+          >更多<i class="el-icon-arrow-down el-icon--right"></i
+        ></span>
         <el-dropdown-menu slot="dropdown">
           <el-dropdown-item command="cancel">作废</el-dropdown-item>
         </el-dropdown-menu>
@@ -85,9 +95,16 @@
     getWarehouseListByIds,
     approve,
     saleReturnProcessCancel,
+    getReturnSaleOrderrecordDetail
+
   } from '@/api/bpm/components/saleManage/saleorder';
-  import { approveTaskWithVariables,rejectTask,cancelTask } from '@/api/bpm/task';
+  import {
+    approveTaskWithVariables,
+    rejectTask,
+    cancelTask
+  } from '@/api/bpm/task';
   import { listAllUserBind } from '@/api/system/organization';
+  import storageApi from '@/api/warehouseManagement';
 
   // 流程实例的详情页,可用于审批
   export default {
@@ -119,8 +136,9 @@
           reason: ''
         },
         userOptions: [],
-        activeComp:'',
-        outInData:{verifyStatus:2},
+        activeComp: '',
+        outInData: { verifyStatus: 2 },
+        isSaveLoading: false
       };
     },
     async created() {
@@ -128,12 +146,12 @@
       listAllUserBind().then((data) => {
         this.userOptions.push(...data);
       });
-      if (this.taskDefinitionKey == 'storemanApprove') {
+      if (this.taskDefinitionKey == 'storemanApprove' || this.taskDefinitionKey == 'warehouseManager') {
         let data = await getReturnSaleOrderrecordDetail(this.businessId);
         try {
           this.outInData = await getOutInBySourceBizNo(data.orderNo);
         } catch (error) {}
-          this.outInData.verifyStatus=0
+        this.outInData.verifyStatus = 0;
       }
     },
     methods: {
@@ -146,7 +164,54 @@
         this.$emit('handleBackList');
       },
       async storemanApprove() {
-        this.$emit('submit');
+        // this.$emit('submit');
+        let res = await this.getTableValue();
+        let storageData = res.returnStorageData;
+   
+        if (!storageData) {
+          return;
+        }
+
+        // 入库来源isSkip 0-正常  1-外部(外部跳过内部审核流程)
+        storageData.isSkip = 1;
+
+        try {
+          this.isSaveLoading = true;
+
+          // 用于回显
+          if (storageData?._packingList?.length) {
+            res.productList.forEach((val, index) => {
+              val.receiveTotalWeight = storageData._packingList[index].weight;
+              val.materielDesignation =
+                storageData._packingList[index].materielDesignation;
+              val.clientCode = storageData._packingList[index].clientCode;
+              val.engrave = storageData._packingList[index].engrave;
+            });
+          }
+          await UpdateReturnInformation(res);
+
+
+          await storageApi.storage(storageData);
+          // approveTaskWithVariables({
+          //   id: this.taskId,
+          //   reason: this.form.reason,
+          //   variables: {
+          //     pass: true
+          //   }
+          // }).then((res) => {
+          //   if (res.code != '-1') {
+          //     this.$emit('handleAudit', {
+          //       status: 1,
+          //       title: '入库'
+          //     });
+          //   }
+          //   this.isSaveLoading = false;
+          // });
+          this.approveTaskWithVariables(1, res.type)
+        } catch (error) {
+          this.isSaveLoading = false;
+          this.$message.error('保存失败');
+        }
       },
       async handleAudit(status) {
         let returnType = '';
@@ -192,12 +257,28 @@
       activeCompChange(activeComp) {
         this.activeComp = activeComp;
       },
+      rejectTask(status) {
+        rejectTask({
+          id: this.taskId,
+          reason: this.form.reason,
+
+          returnType
+        }).then((res) => {
+          if (res.code != '-1') {
+            this.$emit('handleAudit', {
+              status,
+              title: status === 0 ? '驳回' : ''
+            });
+          }
+        });
+      },
       async approveTaskWithVariables(status, returnType) {
         let API = !!status ? approve : rejectTask;
         approve({
           id: this.taskId,
           reason: this.form.reason,
           operateType: status == 0 ? 2 : 1,
+          businessId: this.businessId,
           returnType
         }).then((res) => {
           if (res.code != '-1') {
@@ -220,25 +301,28 @@
       //更多
       handleCommand(command) {
         if (command === 'cancel') {
-          this.$confirm("是否确认作废?", {
+          this.$confirm('是否确认作废?', {
             type: 'warning',
             cancelButtonText: '取消',
             confirmButtonText: '确定'
-          }).then(() => {
-            cancelTask({
-              id: this.id,
-              taskId: this.taskId,
-              reason: this.form.reason,
-              businessId: this.businessId,
-            }).then(() => {
-              this.$emit('handleClose');
-            }).catch(() => {
-              this.$message.error("流程作废失败");
-            });
-          }).catch(() => {});
+          })
+            .then(() => {
+              cancelTask({
+                id: this.id,
+                taskId: this.taskId,
+                reason: this.form.reason,
+                businessId: this.businessId
+              })
+                .then(() => {
+                  this.$emit('handleClose');
+                })
+                .catch(() => {
+                  this.$message.error('流程作废失败');
+                });
+            })
+            .catch(() => {});
         }
-      },
-
+      }
     }
   };
 </script>

+ 200 - 0
src/views/bpm/handleTask/components/salesServiceManagement/demand/submit.vue

@@ -0,0 +1,200 @@
+<template>
+  <el-col :span="16" :offset="6">
+    <el-form label-width="100px" ref="formRef" :model="form">
+      <el-form-item
+        label="审批建议"
+        style="margin-bottom: 20px"
+        :rules="{
+          required: true,
+          message: '请选择',
+          trigger: 'change'
+        }"
+      >
+        <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)"
+        v-if="taskDefinitionKey != 'storemanApprove'"
+        >通过
+      </el-button>
+      <el-button
+        icon="el-icon-edit-outline"
+        type="success"
+        size="mini"
+        @click="storemanApprove"
+        v-if="taskDefinitionKey == 'storemanApprove'"
+        >申请入库
+      </el-button>
+      <el-button
+        icon="el-icon-circle-close"
+        type="danger"
+        size="mini"
+        @click="approveTaskWithVariables(0)"
+        >驳回
+      </el-button>
+      <el-dropdown
+        @command="(command) => handleCommand(command)"
+        style="margin-left: 30px"
+      >
+        <span class="el-dropdown-link"
+          >更多<i class="el-icon-arrow-down el-icon--right"></i
+        ></span>
+        <el-dropdown-menu slot="dropdown">
+          <el-dropdown-item command="cancel">作废</el-dropdown-item>
+        </el-dropdown-menu>
+      </el-dropdown>
+    </div>
+  </el-col>
+</template>
+
+<script>
+  import {
+    approveTaskWithVariables,
+    rejectTask,
+    cancelTask
+  } from '@/api/bpm/task';
+
+  import storageApi from '@/api/warehouseManagement';
+  // 流程实例的详情页,可用于审批
+  export default {
+    name: '',
+    components: {
+      //   Parser
+    },
+    props: {
+      businessId: {
+        default: ''
+      },
+      taskId: {
+        default: ''
+      },
+      id: {
+        default: ''
+      },
+      taskDefinitionKey: {
+        default: ''
+      }
+    },
+    data() {
+      return {
+        form: {
+          technicianId: '',
+          reason: ''
+        },
+        activeComp: ''
+      };
+    },
+    async created() {},
+    methods: {
+      /** 处理转办审批人 */
+      handleUpdateAssignee() {
+        this.$emit('handleUpdateAssignee');
+      },
+      /** 退回 */
+      handleBackList() {
+        this.$emit('handleBackList');
+      },
+      async storemanApprove() {
+        let res = await this.getTableValue();
+        let storageData = res.returnStorageData;
+
+        if (!storageData) {
+          return;
+        }
+        // 入库来源isSkip 0-正常  1-外部(外部跳过内部审核流程)
+        storageData.isSkip = 1;
+
+        try {
+          this.isSaveLoading = true;
+          await storageApi.storage(storageData);
+          approveTaskWithVariables({
+            id: this.taskId,
+            reason: this.form.reason,
+            variables: {
+              pass: true
+            }
+          }).then((res) => {
+            if (res.code != '-1') {
+              this.$emit('handleAudit', {
+                status: 1,
+                title: '入库'
+              });
+            }
+            this.isSaveLoading = false;
+          });
+        } catch (error) {
+          this.isSaveLoading = false;
+          this.$message.error('保存失败');
+        }
+      },
+
+      async handleAudit(status) {
+        await this.approveTaskWithVariables(status);
+      },
+
+      async approveTaskWithVariables(status) {
+        let variables = {
+          pass: !!status
+        };
+        let API = !!status ? approveTaskWithVariables : rejectTask;
+        API({
+          id: this.taskId,
+          reason: this.form.reason,
+          variables
+        }).then((res) => {
+          if (res.code != '-1') {
+            this.$emit('handleAudit', {
+              status,
+              title: status === 0 ? '驳回' : ''
+            });
+          }
+        });
+      },
+
+      getTableValue() {
+        return new Promise((resolve, reject) => {
+          this.$emit('getTableValue', async (data) => {
+            resolve(await data);
+          });
+        });
+      },
+
+      //更多
+      handleCommand(command) {
+        if (command === 'cancel') {
+          this.$confirm('是否确认作废?', {
+            type: 'warning',
+            cancelButtonText: '取消',
+            confirmButtonText: '确定'
+          })
+            .then(() => {
+              cancelTask({
+                id: this.id,
+                taskId: this.taskId,
+                reason: this.form.reason,
+                businessId: this.businessId
+              })
+                .then(() => {
+                  this.$emit('handleClose');
+                })
+                .catch(() => {
+                  this.$message.error('流程作废失败');
+                });
+            })
+            .catch(() => {});
+        }
+      }
+    }
+  };
+</script>
+
+<style lang="scss"></style>

+ 259 - 0
src/views/bpm/handleTask/components/salesServiceManagement/return/recycleDialog.vue

@@ -0,0 +1,259 @@
+<template>
+  <div>
+    <el-form ref="recyleFormRef" :model="form" label-width="100px">
+      <headerTitle title="基本信息" style="margin-top: 15px"></headerTitle>
+      <el-row>
+        <el-col :span="12">
+          <el-form-item label="编码:" prop="code">
+            <el-input v-model="form.code" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item
+            label="名称:"
+            prop="name"
+            :rules="{
+              required: true,
+              message: '请输入名称',
+              trigger: 'change'
+            }"
+          >
+            <el-input v-model="form.name" disabled />
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item
+            label="配件申请单:"
+            prop="sparePartsApplyCode"
+            :rules="{
+              required: true,
+              message: '请选择配件申请单',
+              trigger: 'change'
+            }"
+          >
+            <el-input
+              v-model="form.sparePartsApplyCode"
+              disabled
+              placeholder="请选择"
+            />
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="备注:" prop="remark">
+            <el-input
+              v-model="form.remark"
+              disabled
+              type="textarea"
+              placeholder="请输入"
+            />
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <headerTitle title="归还配件明细" style="margin-top: 15px"> </headerTitle>
+      <ele-pro-table
+        ref="table"
+        :needPage="false"
+        :columns="columns"
+        :datasource="form.detailList"
+        class="time-form"
+        :maxHeight="400"
+        full-height="calc(100vh - 116px)"
+      >
+      </ele-pro-table>
+    </el-form>
+    <headerTitle
+      title="入库信息"
+      style="margin-top: 15px"
+      v-if="taskDefinitionKey == 'storemanApprove' && form.code"
+    >
+    </headerTitle>
+
+    <add
+      ref="add"
+      :form="form"
+      v-if="taskDefinitionKey == 'storemanApprove' && form.code && !isView"
+      :sourceBizNo="form.code"
+      :detailList="
+        form.detailList
+          .filter((item) => item.packageId)
+          .map((item) => {
+            item.productCode = item.categoryCode;
+            item.quantity = item.measureQuantity;
+            return item;
+          })
+      "
+      :saleProductList="
+        form.detailList
+          .filter((item) => !item.packageId)
+          .map((item) => {
+            item.productCode = item.categoryCode;
+            item.quantity = item.measureQuantity;
+            return item;
+          })
+      "
+      :bizType="3"
+      :isMoreProduct="true"
+    ></add>
+    <detailDialog :businessId="form.code" v-if="isView&&form.code"></detailDialog>
+  </div>
+</template>
+
+<script>
+  import { getById } from '@/api/bpm/components/salesServiceManagement/return';
+  import add from '@/views/bpm/stockManagement/storage.vue';
+  import detailDialog from '@/views/bpm/stockManagement/details.vue';
+
+  const defForm = {
+    code: '',
+    name: '',
+    sparePartsApplyId: '',
+    sparePartsApplyCode: '',
+    workOrderId: '',
+    remark: '',
+    detailList: []
+  };
+
+  export default {
+    components: {
+      add,
+      detailDialog
+    },
+    props: {
+      businessId: {
+        default: ''
+      },
+      taskDefinitionKey: {
+        default: ''
+      },
+      isView: ''
+    },
+
+    data() {
+      return {
+        loading: false,
+
+        form: {
+          ...defForm
+        },
+        columns: [
+          {
+            width: 45,
+            type: 'index',
+            columnKey: 'index',
+            align: 'center',
+            fixed: 'left'
+          },
+
+          {
+            minWidth: 160,
+            prop: 'categoryCode',
+            label: '编码',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            minWidth: 120,
+            prop: 'categoryName',
+            label: '名称',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+
+          {
+            minWidth: 160,
+            prop: 'batchNo',
+            label: '批次号',
+            showOverflowTooltip: true,
+            slot: 'batchNo',
+            align: 'center'
+          },
+          {
+            minWidth: 150,
+            prop: 'measureQuantity',
+            slot: 'measureQuantity',
+            label: '归还数量',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            minWidth: 150,
+            prop: 'measureUnit',
+            label: '计量单位',
+            showOverflowTooltip: true,
+            align: 'center'
+          },
+          {
+            minWidth: 160,
+            prop: 'sendCode',
+            label: '发货条码',
+            showOverflowTooltip: true,
+            slot: 'barcodes',
+            align: 'center'
+          },
+
+          {
+            minWidth: 160,
+            prop: 'packageNo',
+            align: 'center',
+            label: '包装编码',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 160,
+            prop: 'categoryModel',
+            align: 'center',
+            label: '型号',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 160,
+            prop: 'specification',
+            align: 'center',
+            label: '规格',
+            showOverflowTooltip: true
+          },
+          {
+            minWidth: 160,
+            prop: 'brandNum',
+            align: 'center',
+            label: '牌号',
+            showOverflowTooltip: true
+          }
+        ]
+      };
+    },
+    mounted() {
+      this.getDetail();
+    },
+
+    methods: {
+      async getDetail() {
+        this.form = await getById(this.businessId);
+      },
+      async getTableValue() {
+        try {
+          this.form.returnStorageData = await this.$refs.add.getReturnStorage();
+          return Object.assign({}, this.form);
+        } catch (error) {
+          return '';
+          // 表单验证未通过,不执行保存操作
+        }
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .device_name {
+    .el-select-dropdown__wrap {
+      .el-select-dropdown__item {
+        padding: 0 !important;
+      }
+    }
+
+    .option_ {
+      width: 100%;
+      padding: 0 20px;
+    }
+  }
+</style>

+ 200 - 0
src/views/bpm/handleTask/components/salesServiceManagement/return/submit.vue

@@ -0,0 +1,200 @@
+<template>
+  <el-col :span="16" :offset="6">
+    <el-form label-width="100px" ref="formRef" :model="form">
+      <el-form-item
+        label="审批建议"
+        style="margin-bottom: 20px"
+        :rules="{
+          required: true,
+          message: '请选择',
+          trigger: 'change'
+        }"
+      >
+        <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)"
+        v-if="taskDefinitionKey != 'storemanApprove'"
+        >通过
+      </el-button>
+      <el-button
+        icon="el-icon-edit-outline"
+        type="success"
+        size="mini"
+        @click="storemanApprove"
+        v-if="taskDefinitionKey == 'storemanApprove'"
+        >申请入库
+      </el-button>
+      <el-button
+        icon="el-icon-circle-close"
+        type="danger"
+        size="mini"
+        @click="approveTaskWithVariables(0)"
+        >驳回
+      </el-button>
+      <el-dropdown
+        @command="(command) => handleCommand(command)"
+        style="margin-left: 30px"
+      >
+        <span class="el-dropdown-link"
+          >更多<i class="el-icon-arrow-down el-icon--right"></i
+        ></span>
+        <el-dropdown-menu slot="dropdown">
+          <el-dropdown-item command="cancel">作废</el-dropdown-item>
+        </el-dropdown-menu>
+      </el-dropdown>
+    </div>
+  </el-col>
+</template>
+
+<script>
+  import {
+    approveTaskWithVariables,
+    rejectTask,
+    cancelTask
+  } from '@/api/bpm/task';
+
+  import storageApi from '@/api/warehouseManagement';
+  // 流程实例的详情页,可用于审批
+  export default {
+    name: '',
+    components: {
+      //   Parser
+    },
+    props: {
+      businessId: {
+        default: ''
+      },
+      taskId: {
+        default: ''
+      },
+      id: {
+        default: ''
+      },
+      taskDefinitionKey: {
+        default: ''
+      }
+    },
+    data() {
+      return {
+        form: {
+          technicianId: '',
+          reason: ''
+        },
+        activeComp: ''
+      };
+    },
+    async created() {},
+    methods: {
+      /** 处理转办审批人 */
+      handleUpdateAssignee() {
+        this.$emit('handleUpdateAssignee');
+      },
+      /** 退回 */
+      handleBackList() {
+        this.$emit('handleBackList');
+      },
+      async storemanApprove() {
+        let res = await this.getTableValue();
+        let storageData = res.returnStorageData;
+
+        if (!storageData) {
+          return;
+        }
+        // 入库来源isSkip 0-正常  1-外部(外部跳过内部审核流程)
+        storageData.isSkip = 1;
+
+        try {
+          this.isSaveLoading = true;
+          await storageApi.storage(storageData);
+          approveTaskWithVariables({
+            id: this.taskId,
+            reason: this.form.reason,
+            variables: {
+              pass: true
+            }
+          }).then((res) => {
+            if (res.code != '-1') {
+              this.$emit('handleAudit', {
+                status: 1,
+                title: '入库'
+              });
+            }
+            this.isSaveLoading = false;
+          });
+        } catch (error) {
+          this.isSaveLoading = false;
+          this.$message.error('保存失败');
+        }
+      },
+
+      async handleAudit(status) {
+        await this.approveTaskWithVariables(status);
+      },
+
+      async approveTaskWithVariables(status) {
+        let variables = {
+          pass: !!status
+        };
+        let API = !!status ? approveTaskWithVariables : rejectTask;
+        API({
+          id: this.taskId,
+          reason: this.form.reason,
+          variables
+        }).then((res) => {
+          if (res.code != '-1') {
+            this.$emit('handleAudit', {
+              status,
+              title: status === 0 ? '驳回' : ''
+            });
+          }
+        });
+      },
+
+      getTableValue() {
+        return new Promise((resolve, reject) => {
+          this.$emit('getTableValue', async (data) => {
+            resolve(await data);
+          });
+        });
+      },
+
+      //更多
+      handleCommand(command) {
+        if (command === 'cancel') {
+          this.$confirm('是否确认作废?', {
+            type: 'warning',
+            cancelButtonText: '取消',
+            confirmButtonText: '确定'
+          })
+            .then(() => {
+              cancelTask({
+                id: this.id,
+                taskId: this.taskId,
+                reason: this.form.reason,
+                businessId: this.businessId
+              })
+                .then(() => {
+                  this.$emit('handleClose');
+                })
+                .catch(() => {
+                  this.$message.error('流程作废失败');
+                });
+            })
+            .catch(() => {});
+        }
+      }
+    }
+  };
+</script>
+
+<style lang="scss"></style>

+ 57 - 4
src/views/bpm/handleTask/formParser/formParserDialog.vue

@@ -2,7 +2,7 @@
   <ele-modal
     :visible="formParserDialogFlag"
     title="审批"
-    :width="width"
+    :width="modelWidth"
     :centered="true"
     :close-on-click-modal="false"
     append-to-body
@@ -35,8 +35,48 @@
               style="width: calc(100% - 80px)"
             ></el-input>
           </div>
+
         </div>
       </template>
+      <!-- 客户名称 -->
+            <template v-slot:eom_contact="scope">
+              <div class="eom_contact">
+                <el-input
+                    v-model="scope.model.eom_contact.name"
+                    style="width: 100%"
+                  ></el-input>
+              </div>
+            </template>
+
+            <!-- 差旅 -->
+            <template v-slot:blank_business_component="scope">
+              <businessComponent  ref="blank_business_component" id="blank_business_component" :generateForm="$refs.generateForm" :info="scope.model" :view="view"></businessComponent>
+            </template>
+
+            <!-- 印章使用 -->
+            <template v-slot:blank_use_seal="scope">
+              <useSealComponent  ref="blank_use_seal" id="blank_use_seal" :generateForm="$refs.generateForm" :info="scope.model" :view="view"></useSealComponent>
+            </template>
+
+            <!-- 资质使用 -->
+            <template v-slot:blank_use_qualification="scope">
+              <useQualificationComponent  ref="blank_use_qualification" id="blank_use_qualification" :generateForm="$refs.generateForm" :info="scope.model" :view="view"></useQualificationComponent>
+            </template>
+
+            <!-- 产品规格 -->
+            <template v-slot:blank_product_specification="scope">
+              <productSpecificationComponent  ref="blank_product_specification" id="blank_product_specification" :generateForm="$refs.generateForm" :info="scope.model" :view="view"></productSpecificationComponent>
+            </template>
+
+            <!-- 事件 -->
+            <template v-slot:blank_event_component="scope">
+              <eventComponent  ref="blank_event_component" id="blank_event_component" :generateForm="$refs.generateForm" :info="scope.model" :view="view"></eventComponent>
+            </template>
+
+            <!-- 补发 -->
+            <template v-slot:blank_reissue_component="scope">
+              <reissueComponent  ref="blank_reissue_component" id="blank_reissue_component" :generateForm="$refs.generateForm" :info="scope.model" :view="view"></reissueComponent>
+            </template>
     </fm-generate-form>
 
     <outboundXTBG
@@ -114,9 +154,17 @@
   import { getToken } from '@/utils/token-util';
   import storageApi from '@/api/warehouseManagement';
 
+  import businessComponent from '@/BIZComponents/processSubmitDialog/components/businessComponent.vue';
+  import useSealComponent from '@/BIZComponents/processSubmitDialog/components/useSealComponent.vue';
+  import useQualificationComponent from '@/BIZComponents/processSubmitDialog/components/useQualificationComponent.vue';
+  import productSpecificationComponent from '@/BIZComponents/processSubmitDialog/components/productSpecificationComponent.vue';
+  import eventComponent from '@/BIZComponents/processSubmitDialog/components/eventComponent.vue';
+  import reissueComponent from '@/BIZComponents/processSubmitDialog/components/reissueComponent.vue';
+
   export default {
     name: 'formParserDialog',
     components: { Parser, outboundXTBG },
+    components: {businessComponent, useSealComponent, useQualificationComponent, productSpecificationComponent, eventComponent, reissueComponent},
     props: {
       businessId: {
         default: ''
@@ -135,13 +183,18 @@
         isSaveLoading: false
       };
     },
+    modelWidth() {
+      let width = this.jsonData.config?.platform && this.jsonData.config.platform === 'pc' ? 1100 : 450;
+      if (this.form?.taskDefinitionKey == 'CGYSP') {
+        return width = '70%';
+      }
+      return width + 'px'
+    },
     methods: {
       open(row) {
         this.form = _.cloneDeep(row);
         console.log(this.form.taskDefinitionKey, 'this.form.taskDefinitionKey');
-        if (this.form.taskDefinitionKey == 'CGYSP') {
-          this.width = '70%';
-        }
+        
         this.jsonData = JSON.parse(this.form.formJson.makingJson);
         this.jsonData.config.dataSource &&
           this.jsonData.config.dataSource.forEach((item) => {

+ 8 - 5
src/views/bpm/outgoingManagement/outbound.vue

@@ -150,8 +150,8 @@
           <el-col :span="6">
             <el-form-item label="客户名称">
               <span>{{ formData.clientName }}</span>
-            </el-form-item> </el-col
-          >
+            </el-form-item>
+          </el-col>
           <el-col :span="12">
             <el-form-item label="备注" prop="remark">
               <el-input
@@ -830,6 +830,8 @@
           ).values()
         ];
         this.productList = uniqueProducts;
+        console.log('111111111111111');
+        console.log(this.productList);
         // 排序
         this.productList.sort((a, b) => a.categoryCode - b.categoryCode);
 
@@ -1033,6 +1035,7 @@
         console.log(this.detailList, 'this.detailList');
         console.log(this.saleProductList, 'this.saleProductList');
         console.log(this.productList, 'this.productList');
+        console.log('11111111111111111111');
 
         if (this.detailList?.length > 0) {
           // 获取领料人列表
@@ -1064,7 +1067,7 @@
             builders: this.detailList.map((item) => {
               return {
                 categoryId:
-                  item.instanceId || item.categoryId || item.productId,
+                  item.categoryId || item.instanceId || item.productId,
                 num: item.demandQuantity || item.measurementCount,
                 warehouseId: this.bizType == 11 ? item.warehouseId : ''
               };
@@ -1107,8 +1110,8 @@
         }
         // 销售相关逻辑
         if (this.saleProductList?.length > 0) {
-          this.formData.clientName=this.form.contactName;
-          this.formData.clientCode=this.form.contactCode;
+          this.formData.clientName = this.form.contactName;
+          this.formData.clientCode = this.form.contactCode;
           // 获取领料人列表
           this.getStaffList({ id: this.form.deptId }).then(() => {
             // 获取领料人和领料部门

+ 135 - 26
src/views/bpm/stockManagement/storage.vue

@@ -83,7 +83,15 @@
               <el-input
                 placeholder="登记人"
                 disabled
-                v-model="formData.extInfo.createUserName"
+                v-model="formData.createUserName"
+                clearable /></el-form-item
+          ></el-col>
+          <el-col :span="6">
+            <el-form-item label="审核人">
+              <el-input
+                placeholder="审核人"
+                disabled
+                v-model="formData.approvalUserName"
                 clearable /></el-form-item
           ></el-col>
           <!-- <el-col :span="6" v-if="formData.bizType == 2">
@@ -112,6 +120,18 @@
               ></el-input>
             </el-form-item>
           </el-col>
+          <el-col :span="6">
+            <el-form-item label="生产要求" prop="productionRequirements">
+              <el-input
+                v-model="formData.productionRequirements"
+                clearable
+                type="textarea"
+                placeholder=""
+                :rows="1"
+                disabled
+              ></el-input>
+            </el-form-item>
+          </el-col>
         </el-row>
       </el-form>
       <div class="inbound_details">
@@ -202,6 +222,50 @@
                 :prop="item.prop"
                 :show-overflow-tooltip="item.showOverflowTooltip"
               ></el-table-column>
+
+              <el-table-column
+                label="包装完好与否"
+                align="center"
+                width="100"
+                prop="ifPackageOk"
+              > 
+                <template slot-scope="{ row, $index }">
+                  <template v-if="row.isSave">
+                    {{ row.ifPackageOk ? '是' : '否' }}
+                  </template>
+                  <el-form-item
+                    v-else
+                    :prop="`productList.${$index}.ifPackageOk`"
+                    required
+                  >
+                    <el-select v-model="row.ifPackageOk" placeholder="请选择" clearable style="width: 100%">
+                      <el-option label="是" :value="1" />
+                      <el-option label="否" :value="0" />
+                    </el-select>
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="拆包装责任人"
+                align="center"
+                width="100"
+                prop="unpackUserName"
+              >
+                <template slot-scope="{ row, $index }">
+                  <template v-if="row.isSave">
+                    {{ row.unpackUserName }}
+                  </template>
+                  <el-form-item
+                    v-else
+                    :prop="`productList.${$index}.unpackUserName`"
+                    required
+                  >
+                    <el-input @click.native="handHead(row, $index)" v-model="row.unpackUserName"
+              placeholder="请选择"></el-input>
+                  </el-form-item>
+                </template>
+              </el-table-column>
+
               <el-table-column
                 label="批次号"
                 align="center"
@@ -1135,6 +1199,8 @@
       ref="wareHouseDailogRef"
       @selection="wareHouseSelection"
     ></WarehousingDialog>
+    <!-- 包装负责人 -->
+    <head-list ref="headRef" @changeParent="changeHead"></head-list>
     <!-- 生产日期、采购日期弹框 -->
     <el-dialog
       :visible.sync="dateVisible"
@@ -1178,12 +1244,14 @@
   import { deepClone } from '@/utils';
   import { mapActions, mapGetters } from 'vuex';
   import BigNumber from 'bignumber.js';
+  import headList from '@/components/headList';
 
   // import dictMixins from '@/mixins/dictMixins';
   export default {
     components: {
       selectType,
-      WarehousingDialog
+      WarehousingDialog,
+      headList
     },
     // mixins: [dictMixins],
     // 虚拟列表滚动方法
@@ -1197,7 +1265,9 @@
       detailList: { type: Array, default: () => [] },
       saleProductList: { type: Array, default: () => [] },
       detailProductList: { type: Array, default: () => [] },
-      isMoreProduct: { type: Boolean, default: false } //多产品包装明细
+      isMoreProduct: { type: Boolean, default: false }, //多产品包装明细
+      processInstance: { type: Object, default: () => {} },
+      isShowPackage: { type: Boolean, default: false }  //售后退货单仓管审批显示
     },
     data() {
       return {
@@ -1466,12 +1536,25 @@
         }
 
         // 入库登记人
-        this.formData.extInfo.createUserId = this.$store.state.user.info.userId;
-        this.formData.extInfo.createUserName = this.$store.state.user.info.name;
-        this.formData.extInfo.deliveryPhone = this.$store.state.user.info.phone;
-        this.formData.createUserId = this.$store.state.user.info.userId;
-        this.formData.extInfo.deptName = this.$store.state.user.info.deptName;
-
+        // this.formData.extInfo.createUserId = this.$store.state.user.info.userId;
+        // this.formData.extInfo.createUserName = this.$store.state.user.info.name;
+        // this.formData.extInfo.deliveryPhone = this.$store.state.user.info.phone;
+        // this.formData.createUserId = this.$store.state.user.info.userId;
+        // this.formData.extInfo.deptName = this.$store.state.user.info.deptName;
+      
+           // 入库登记人
+        // const startUser = this.processInstance?.startUser || {};
+        const userInfo = this.$store.state.user.info || {};
+
+        // 确保所有值都是原始类型,防止对象被绑定到DOM属性
+        this.formData.extInfo.createUserId = this.form.createUserId || userInfo.userId || '';
+        this.formData.extInfo.createUserName = this.form.createUserName || userInfo.name || '';
+        this.formData.extInfo.deliveryPhone = userInfo.phone || '';
+        this.formData.createUserId = this.form.createUserId || userInfo.userId || '';
+        this.formData.createUserName = this.form.createUserName || userInfo.name || '';
+        this.formData.extInfo.deptName = this.form.deptName || userInfo.deptName || '';
+        this.formData.approvalUserName = this.form.approvalUserName ||userInfo.name;
+        this.formData.approvalUserId = this.form.approvalUserId || userInfo.userId;
         // this.formData.extInfo.supplierName = this.form.supplierName;
         // this.formData.extInfo.supplierId = this.form.supplierId;
         console.log('saleProductList-------------------', this.saleProductList);
@@ -1666,7 +1749,7 @@
             });
             console.log(this.productList, 'this.productListtttttttttttt');
             this.$nextTick(() => {
-              this.batchSave();
+              // this.batchSave();
               // this.listSaveArrs()
             });
           });
@@ -1822,11 +1905,7 @@
               }
               let packingUnit = item.packingUnit;
               let singleWeight = item.singleWeight || 0; // 单重重量
-              console.log(
-                this.isMoreProduct,
-                this.detailList,
-                'this.isMoreProduct'
-              );
+
               return {
                 index: this.productList.length + index,
                 isSave: true,
@@ -1837,7 +1916,7 @@
                 specification: item.specification, // 规格
                 brandNum: item.brandNum, // 牌号
                 batchNo:
-                  this.bizType == 1
+                  this.bizType == 1 || this.bizType == 3
                     ? this.detailList[0]?.batchNo || batchNo
                     : batchNo, // 批次号
                 supplierListOptions: supplierList[item.id], // 供应商列表
@@ -1867,8 +1946,8 @@
                 measureUnit: item.measuringUnit, // 计量单位
                 measureType: item.measureType, // 计量方式
                 netWeight: item.netWeight > -1 ? item.netWeight : 0, // 净重
-                weight: weight, // 重量
-                singleWeight: singleWeight,
+                weight: weight || 0, // 重量
+                singleWeight: singleWeight || 0,
                 weightUnit: item.weightUnit, // 重量单位
                 totalMoney: item.totalPrice, // 总价
                 unitPrice: item.unitPrice, // 单价
@@ -2034,13 +2113,13 @@
                   packingCodeList[index]?.onlyCode, // 包装编码
                 packingQuantity: 1, // 包装数量
                 packingUnit: item.packingUnit, // 单位
-                measureQuantity: item.quantity, // 计量数量
-                measureUnit: item.measuringUnit, // 计量单位
+                measureQuantity: item.quantity || item.measureQuantity, // 计量数量
+                measureUnit: item.measuringUnit || item.measureUnit, // 计量单位
                 supplierCode: item.supplierCode,
                 supplierId: item.supplierId,
                 supplierName: item.supplierName,
-                weight: item.packingWeight, // 重量
-                singleWeight: item.singleWeight,
+                weight: item.packingWeight || 0, // 重量
+                singleWeight: item.singleWeight || 0,
                 pricingWay: item.pricingWay,
                 weightUnit: item.weightUnit || this.productList[0].weightUnit, // 重量单位
                 packingSpecificationOption: this.isMoreProduct
@@ -2118,6 +2197,18 @@
           if (obj[key] < 10) obj[key] = `0${obj[key]}`;
         });
         return obj;
+      },
+       //选择负责人
+      handHead(row, index) {
+        let item = {
+          id: row.unpackUserId
+        };
+        this.$refs.headRef.open(item, index);
+      },
+      //选择负责人回调
+      changeHead(obj, index) {
+        this.$set(this.productList[index], 'unpackUserId', obj.id);
+        this.$set(this.productList[index], 'unpackUserName', obj.name);
       },
       // 赋值入库时间
       getNowFormatDate() {
@@ -2509,11 +2600,17 @@
           },
           0
         );
-        this.$set(this.productList[productIndex], 'weight', totalWeight);
+
+        if (totalWeight != 'NaN') {
+          this.$set(this.productList[productIndex], 'weight', totalWeight);
+        } else {
+          this.$set(this.productList[productIndex], 'weight', 0);
+        }
+
         this.$set(
           this.productList[productIndex],
           'singleWeight',
-          totalWeight / this.productList[productIndex].measureQuantity
+          totalWeight / this.productList[productIndex].measureQuantity || 0
         );
         // 修改拆分物料
         // this.materialList.map((item, index) => {
@@ -2824,8 +2921,13 @@
               `productList.${index}.batchNo`,
               `productList.${index}.packingQuantity`,
               `productList.${index}.packingUnit`,
-              `productList.${index}.warehouseId`
+              `productList.${index}.warehouseId`,
+              
             ];
+            if(this.isShowPackage) {
+              fileds.push(`productList.${index}.unpackUserName`,
+              `productList.${index}.ifPackageOk`,)
+            }
             if (row.isSave) {
               return Promise.resolve(true);
             } else {
@@ -2970,6 +3072,13 @@
             `productList.${index}.packingUnit`,
             `productList.${index}.warehouseId`
           ];
+
+          if(this.isShowPackage) {
+            fileds.push(
+              `productList.${index}.unpackUserName`,
+              `productList.${index}.ifPackageOk`,
+            )
+          }
           Promise.all(
             fileds.map(
               (item) =>
@@ -3058,7 +3167,7 @@
             }
           }
         } catch (error) {
-          this.$message.error('批量保存失败,请检查必填项');
+          // this.$message.error('批量保存失败,请检查必填项');
         }
       },
       listSave(row, index) {

+ 2 - 1
vue.config.js

@@ -40,9 +40,10 @@ module.exports = {
         // target: 'http://192.168.1.105:18086',
 
         // target: 'http://192.168.1.251:18186',
+        target: 'http://192.168.1.125:18086',
         // target: 'http://192.168.1.125:18086',
 
-        target: 'http://192.168.1.3:18086',
+        // target: 'http://192.168.1.3:18086',
         // target: 'http://192.168.1.116:18086', // 赵沙金
 
         changeOrigin: true, // 只有这个值为true的情况下 s才表示开启跨域