Преглед изворни кода

解决协调办公用车无法关联工单

hezhanp пре 7 месеци
родитељ
комит
cce6062a7f

+ 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>

+ 614 - 580
src/BIZComponents/processSubmitDialog/processSubmitDialog.vue

@@ -20,7 +20,7 @@
           :model="form"
           label-width="90px"
           :label-position="'left'"
-          style="padding: 10px;"
+          style="padding: 10px"
         >
           <el-row>
             <el-col :span="24">
@@ -115,7 +115,17 @@
               ></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
@@ -390,629 +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: ''
+    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) {
+      
+      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;
-            }
+      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 === 20 || row.type === 21) {
-          for (const deptOption of this.deptOptions) {
-            if (deptOption.id === option) {
-              return deptOption.name;
-            }
+        }
+        if (item.type == 'userSelect') {
+          if (item.options.isDefaultLoginUser) {
+            this.form.valueJson[item.model] = this.user.info.userId;
           }
-        } 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 == '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 === 40) {
-          for (const userGroupOption of this.userGroupOptions) {
-            if (userGroupOption.id === option) {
-              return userGroupOption.name;
-            }
+        }
+      } 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 === 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 === 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;
           }
-        } 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 === 40) {
+        for (const userGroupOption of this.userGroupOptions) {
+          if (userGroupOption.id === option) {
+            return userGroupOption.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 === 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);
 
-        // 检查每个组件的数据是否为空数组
-        let emptyComponents = [];
-        validArr.forEach((item) => {
-          // 检查data[item]是否存在且为数组,并且长度为0
-          if (Array.isArray(data[item]) && data[item].length === 0) {
-            emptyComponents.push(item);
-          }
-        });
+      // 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);
+        }
+      });
 
-        // 如果有未填写的组件,显示提示信息
-        if (emptyComponents.length > 0) {
-          // this.$message.warning(`请填写完整信息:${emptyComponents.map(comp => this.getComponentName(comp)).join('、')}`);
-          this.$message.warning(`请填写完整信息`);
-          return false;
+      // 检查每个组件的数据是否为空数组
+      let emptyComponents = [];
+      validArr.forEach((item) => {
+        // 检查data[item]是否存在且为数组,并且长度为0
+        if (Array.isArray(data[item]) && data[item].length === 0) {
+          emptyComponents.push(item);
         }
+      });
 
-        // 使用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);
+      // 如果有未填写的组件,显示提示信息
+      if (emptyComponents.length > 0) {
+        // this.$message.warning(`请填写完整信息:${emptyComponents.map(comp => this.getComponentName(comp)).join('、')}`);
+        this.$message.warning(`请填写完整信息`);
+        return false;
+      }
 
-        // 计算天数
-        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);
+      // 使用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);
 
-        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();
-      }
+      // 计算天数
+      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>

+ 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>