Bläddra i källkod

部门记录点击详情,关联工单未显示

hezhanp 9 månader sedan
förälder
incheckning
986afbf79b
2 ändrade filer med 422 tillägg och 317 borttagningar
  1. 198 145
      src/views/bpm/collaborative/detail.vue
  2. 224 172
      src/views/bpm/handleTask/formParser/formParserDialog.vue

+ 198 - 145
src/views/bpm/collaborative/detail.vue

@@ -35,7 +35,10 @@
           ref="generateForm"
         >
           <template v-slot:blank_adopzrdd="scope">
-            <div v-for="(item, index) in scope.model.blank_adopzrdd" :key="index">
+            <div
+              v-for="(item, index) in scope.model.blank_adopzrdd"
+              :key="index"
+            >
               <div class="blank_adopzrdd">
                 <span>{{ index + 1 }}报销事项:</span>
                 <el-input
@@ -55,45 +58,89 @@
             </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: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_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:manage_workorder="scope">
+            <div class="manage_workorder">
+              <el-input
+                v-model="scope.model.manage_workorder.code"
+                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_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_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_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_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_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_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_reissue_component="scope">
-              <reissueComponent  ref="blank_reissue_component" id="blank_reissue_component" :generateForm="$refs.generateForm" :info="scope.model" :view="view"></reissueComponent>
-            </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>
       </div>
       <div
@@ -118,14 +165,10 @@
         <span style="writing-mode: vertical-rl">选择流程</span>
       </div>
       <div style="flex: 1" v-if="isRight">
-        <Detail
-          :view="true"
-          :id="form.id"
-          ref="formDetailDialogRef"
-        ></Detail>
+        <Detail :view="true" :id="form.id" ref="formDetailDialogRef"></Detail>
       </div>
     </div>
-    
+
     <outgoingDetails
       v-if="outgoingData.id"
       :business-id="outgoingData.id"
@@ -137,121 +180,131 @@
   </ele-modal>
 </template>
 <script>
-  import dictMixins from '@/mixins/dictMixins';
-  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';
-  import productSpecificationComponent from '@/BIZComponents/processSubmitDialog/components/productSpecificationComponent.vue';
-  import eventComponent from '@/BIZComponents/processSubmitDialog/components/eventComponent.vue';
-  import reissueComponent from '@/BIZComponents/processSubmitDialog/components/reissueComponent.vue';
-  import Detail from '@/views/bpm/processInstance/detailNew.vue';
+import dictMixins from '@/mixins/dictMixins';
+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';
+import productSpecificationComponent from '@/BIZComponents/processSubmitDialog/components/productSpecificationComponent.vue';
+import eventComponent from '@/BIZComponents/processSubmitDialog/components/eventComponent.vue';
+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},
-    props: {
-      formDetailDialogFlag: {
-        type: Boolean,
-        default: false
-      },
-      view: {
-        type: Boolean,
-        default: false
-      },
+export default {
+  name: 'formDetailDialog',
+  components: {
+    outgoingDetails,
+    businessComponent,
+    useSealComponent,
+    useQualificationComponent,
+    productSpecificationComponent,
+    eventComponent,
+    reissueComponent,
+    Detail
+  },
+  props: {
+    formDetailDialogFlag: {
+      type: Boolean,
+      default: false
     },
-    mixins: [dictMixins],
-    data() {
-      return {
-        form: {},
-        jsonData: {},
-        outgoingData:{},
-        isRight: false,
-      };
-    },
-    computed: {
-      // modelWidth() {
-      //   return (this.outgoingData?.id || this.jsonData.config?.platform && this.jsonData.config.platform === 'pc') ? '80%' : '400px';
-      // }
-      modelWidth() {
-        let width = this.jsonData.config?.platform && this.jsonData.config.platform === 'pc' ? 1100 : 450;
-        if(this.isRight) {
-          return width + 750 + 'px'
-        } else {
-          return width + 'px'
-        }
+    view: {
+      type: Boolean,
+      default: false
+    }
+  },
+  mixins: [dictMixins],
+  data() {
+    return {
+      form: {},
+      jsonData: {},
+      outgoingData: {},
+      isRight: false
+    };
+  },
+  computed: {
+    // modelWidth() {
+    //   return (this.outgoingData?.id || this.jsonData.config?.platform && this.jsonData.config.platform === 'pc') ? '80%' : '400px';
+    // }
+    modelWidth() {
+      let width =
+        this.jsonData.config?.platform && this.jsonData.config.platform === 'pc'
+          ? 1100
+          : 450;
+      if (this.isRight) {
+        return width + 750 + 'px';
+      } else {
+        return width + 'px';
+      }
+    }
+  },
+  methods: {
+    open(row) {
+      this.form = _.cloneDeep(row);
+      if (this.form.id) {
+        storageApi.getInfoBySourceBizNo(this.form.id).then((res) => {
+          this.outgoingData = res;
+        });
       }
+      this.jsonData = JSON.parse(this.form.formJson.makingJson);
+      this.jsonData.config.dataSource &&
+        this.jsonData.config.dataSource.forEach((item) => {
+          item.headers = {
+            Authorization: getToken()
+          };
+          // item.url = item.url && item.url.replace('/api', this.APIUrl);
+        });
     },
-    methods: {
-       open(row) {
-        this.form = _.cloneDeep(row);
-        if(this.form.id){
-          storageApi.getInfoBySourceBizNo(this.form.id).then(res=>{
-          this.outgoingData=res
-        })
-        }
-        this.jsonData = JSON.parse(this.form.formJson.makingJson);
-        this.jsonData.config.dataSource &&
-          this.jsonData.config.dataSource.forEach((item) => {
-            item.headers = {
-              Authorization: getToken()
-            };
-            // item.url = item.url && item.url.replace('/api', this.APIUrl);
-          });
-      },
-      getTimelineItemType(result) {
-        if (result === '通过') {
-          return 'success';
-        }
-        if (result === '不通过') {
-          return 'danger';
-        }
-        if (result === '取消') {
-          return 'info';
-        }
-        if (result === '处理中') {
-          return 'warning';
-        }
-
-        return '';
-      },
-      cancel() {
-        this.$emit('update:formDetailDialogFlag', false);
+    getTimelineItemType(result) {
+      if (result === '通过') {
+        return 'success';
+      }
+      if (result === '不通过') {
+        return 'danger';
+      }
+      if (result === '取消') {
+        return 'info';
+      }
+      if (result === '处理中') {
+        return 'warning';
       }
+
+      return '';
+    },
+    cancel() {
+      this.$emit('update:formDetailDialogFlag', false);
     }
-  };
+  }
+};
 </script>
 <style scoped lang="scss">
-  .eleModalBox {
-    height: 100%;
-    min-width: 300px;
-    overflow: auto;
-  }
+.eleModalBox {
+  height: 100%;
+  min-width: 300px;
+  overflow: auto;
+}
 
-  .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__header {
-    display: flex;
-    justify-content: space-between;
-  }
-  .blank_adopzrdd {
-    display: flex;
-    align-items: center;
-    > span {
-      display: inline-block;
-      width: 80px;
-    }
-    margin-bottom: 10px;
+::v-deep .el-dialog__header {
+  display: flex;
+  justify-content: space-between;
+}
+.blank_adopzrdd {
+  display: flex;
+  align-items: center;
+  > span {
+    display: inline-block;
+    width: 80px;
   }
+  margin-bottom: 10px;
+}
 </style>

+ 224 - 172
src/views/bpm/handleTask/formParser/formParserDialog.vue

@@ -35,48 +35,91 @@
               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: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:manage_workorder="scope">
+        <div class="manage_workorder">
+          <el-input
+            v-model="scope.model.manage_workorder.code"
+            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_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_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_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_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>
+      <!-- 补发 -->
+      <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
@@ -144,165 +187,174 @@
   </ele-modal>
 </template>
 <script>
-  import Parser from '@/components/FormGenerator/components/parser/Parser.vue';
-  import outboundXTBG from '@/views/bpm/outgoingManagement/outboundXTBG.vue';
-  import {
-    approveTaskWithVariables,
-    cancelTask,
-    rejectTask
-  } from '@/api/bpm/task';
-  import { getToken } from '@/utils/token-util';
-  import storageApi from '@/api/warehouseManagement';
+import Parser from '@/components/FormGenerator/components/parser/Parser.vue';
+import outboundXTBG from '@/views/bpm/outgoingManagement/outboundXTBG.vue';
+import {
+  approveTaskWithVariables,
+  cancelTask,
+  rejectTask
+} from '@/api/bpm/task';
+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';
+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: ''
-      },
-      formParserDialogFlag: {
-        type: Boolean,
-        default: false
-      }
+export default {
+  name: 'formParserDialog',
+  components: { Parser, outboundXTBG },
+  components: {
+    businessComponent,
+    useSealComponent,
+    useQualificationComponent,
+    productSpecificationComponent,
+    eventComponent,
+    reissueComponent
+  },
+  props: {
+    businessId: {
+      default: ''
     },
-    data() {
-      return {
-        form: {},
-        index: '',
-        jsonData: {},
-        width: '30%',
-        isSaveLoading: false
-      };
+    formParserDialogFlag: {
+      type: Boolean,
+      default: false
+    }
+  },
+  data() {
+    return {
+      form: {},
+      index: '',
+      jsonData: {},
+      width: '30%',
+      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');
+
+      this.jsonData = JSON.parse(this.form.formJson.makingJson);
+      this.jsonData.config.dataSource &&
+        this.jsonData.config.dataSource.forEach((item) => {
+          item.headers = {
+            Authorization: getToken()
+          };
+          // item.url = item.url && item.url.replace('/api', this.APIUrl);
+        });
     },
-    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'
+    cancel() {
+      this.$emit('update:formParserDialogFlag', false);
+    },
+    async handleAudit(status) {
+      await this._approveTaskWithVariables(status);
     },
-    methods: {
-      open(row) {
-        this.form = _.cloneDeep(row);
-        console.log(this.form.taskDefinitionKey, 'this.form.taskDefinitionKey');
-        
-        this.jsonData = JSON.parse(this.form.formJson.makingJson);
-        this.jsonData.config.dataSource &&
-          this.jsonData.config.dataSource.forEach((item) => {
-            item.headers = {
-              Authorization: getToken()
-            };
-            // item.url = item.url && item.url.replace('/api', this.APIUrl);
-          });
-      },
-      cancel() {
-        this.$emit('update:formParserDialogFlag', false);
-      },
-      async handleAudit(status) {
-        await this._approveTaskWithVariables(status);
-      },
-
-      async storemanApprove(status) {
-        let storageData = await this.$refs.outboundXTBGRef.getReturnStorage();
-        console.log(storageData);
-
-        // 出库来源isSkip 0-正常  1-外部(外部跳过内部审核流程)
-        storageData.isSkip = 1;
-        storageData.isMes = 1;
-        try {
-          this.isSaveLoading = true;
-          await storageApi.outStorage(storageData);
-          approveTaskWithVariables({
-            id: this.form.id,
-            reason: this.form.reason,
-            businessId: this.businessId,
-            variables: {
-              pass: true
-            }
-          }).then((res) => {
-            if (res.data.code != '-1') {
-       
-              this.$message.success(`出库成功!`);
-              this.$emit('reload');
-              this.cancel();
-            }
-            this.isSaveLoading = false;
-          });
-        } catch (error) {
-          this.isSaveLoading = false;
-          console.error('出库失败:', error);
-        }
-      },
 
-      async _approveTaskWithVariables(status) {
-        let variables = {
-          pass: !!status
-        };
-        let API = !!status ? approveTaskWithVariables : rejectTask;
+    async storemanApprove(status) {
+      let storageData = await this.$refs.outboundXTBGRef.getReturnStorage();
+      console.log(storageData);
 
-        API({
+      // 出库来源isSkip 0-正常  1-外部(外部跳过内部审核流程)
+      storageData.isSkip = 1;
+      storageData.isMes = 1;
+      try {
+        this.isSaveLoading = true;
+        await storageApi.outStorage(storageData);
+        approveTaskWithVariables({
           id: this.form.id,
           reason: this.form.reason,
           businessId: this.businessId,
-          variables
+          variables: {
+            pass: true
+          }
         }).then((res) => {
           if (res.data.code != '-1') {
-            let params = {
-              status,
-              title: status === 0 ? '驳回' : ''
-            };
-            this.$message.success(`审批${params.title}成功!`);
+            this.$message.success(`出库成功!`);
             this.$emit('reload');
             this.cancel();
           }
+          this.isSaveLoading = false;
         });
-      },
+      } catch (error) {
+        this.isSaveLoading = false;
+        console.error('出库失败:', error);
+      }
+    },
 
-      //更多
-      handleCommand(command) {
-        if (command === 'cancel') {
-          this.$confirm('是否确认作废?', {
-            type: 'warning',
-            cancelButtonText: '取消',
-            confirmButtonText: '确定'
-          })
-            .then(() => {
-              cancelTask({
-                taskId: this.form.id,
-                id: this.form.processInstance.id,
-                reason: this.form.reason
-              })
-                .then(() => {
-                  this.$emit('reload');
-                  this.cancel();
-                })
-                .catch(() => {
-                  this.$message.error('流程作废失败');
-                });
-            })
-            .catch(() => {});
+    async _approveTaskWithVariables(status) {
+      let variables = {
+        pass: !!status
+      };
+      let API = !!status ? approveTaskWithVariables : rejectTask;
+
+      API({
+        id: this.form.id,
+        reason: this.form.reason,
+        businessId: this.businessId,
+        variables
+      }).then((res) => {
+        if (res.data.code != '-1') {
+          let params = {
+            status,
+            title: status === 0 ? '驳回' : ''
+          };
+          this.$message.success(`审批${params.title}成功!`);
+          this.$emit('reload');
+          this.cancel();
         }
+      });
+    },
+
+    //更多
+    handleCommand(command) {
+      if (command === 'cancel') {
+        this.$confirm('是否确认作废?', {
+          type: 'warning',
+          cancelButtonText: '取消',
+          confirmButtonText: '确定'
+        })
+          .then(() => {
+            cancelTask({
+              taskId: this.form.id,
+              id: this.form.processInstance.id,
+              reason: this.form.reason
+            })
+              .then(() => {
+                this.$emit('reload');
+                this.cancel();
+              })
+              .catch(() => {
+                this.$message.error('流程作废失败');
+              });
+          })
+          .catch(() => {});
       }
     }
-  };
+  }
+};
 </script>
 <style scoped lang="scss">
-  .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>