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

Merge branch 'master' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-wt

yusheng пре 11 месеци
родитељ
комит
221a8819ee

+ 33 - 0
src/api/afterSales/index.js

@@ -10,3 +10,36 @@ export async function getByInfo(id) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+/**
+ * 查询库存仓库列表
+ */
+export async function getIdWarehouseList(params) {
+  const res = await request.get(`/wms/outindetailtwo/getBatchWarehouseList`, {
+    params
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+/**
+ * 查询库存可用数
+ */
+export async function getWarehouseOutStock(params) {
+  const res = await request.get(`/wms/stocktwo/getWarehouseOutStock`, {
+    params
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+// 售后费用 详情
+export async function salesrealcostinfo(id) {
+  const res = await request.get(`/eom/aftersalesrealcost/getById/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 0 - 1
src/views/bpm/handleTask/components/afterSales/spareInfo.vue

@@ -41,7 +41,6 @@
     watch: {
       detailList: {
         handler(newVal) {
-          console.log(this.taskDefinitionKey,'this.taskDefinitionKeythis.taskDefinitionKeythis.taskDefinitionKeythis.taskDefinitionKey00000')
           this.tableList = JSON.parse(JSON.stringify(newVal));
           this.calculatePrice();
         },

+ 93 - 0
src/views/bpm/handleTask/components/cost/costDialog.vue

@@ -0,0 +1,93 @@
+<template>
+  <el-form ref="recyleFormRef" :model="form" label-width="100px">
+    <headerTitle title="基本信息" style="margin-top: 15px"></headerTitle>
+    <el-row>
+      <el-col :span="8">
+        <el-form-item label="编码:" prop="code">
+          <el-input v-model="form.code" disabled />
+        </el-form-item>
+      </el-col>
+      <el-col :span="6">
+        <el-form-item label="工单名称:">
+          <el-input
+            v-model="form.orderWorkName"
+            disabled
+            placeholder="请选择"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col :span="8">
+        <el-form-item label="原因">
+          <el-input v-model="form.remarks" type="textarea" :rows="2" disabled />
+        </el-form-item>
+      </el-col>
+    </el-row>
+    <spareParts obtain="仓库" ref="sparePartsRef" type="view"></spareParts>
+    <div class="title" v-if="!isView && taskDefinitionKey == 'wms_out'">
+      出库单信息</div
+    >
+    <keep-alive>
+      <add
+        ref="add"
+        :form="form"
+        :sourceBizNo="form.code"
+        :bizType="4"
+        :saleProductList="detailList"
+        v-if="!isView && taskDefinitionKey == 'wms_out' && form.id"
+      ></add>
+    </keep-alive>
+  </el-form>
+</template>
+
+<script>
+  import add from '@/views/bpm/outgoingManagement/outbound.vue';
+  import spareParts from './sparePartsList.vue';
+  import { salesrealcostinfo } from '@/api/afterSales/index';
+  export default {
+    props: {
+      businessId: {
+        default: ''
+      },
+      taskDefinitionKey: {
+        type: String,
+        default: ''
+      },
+      isView: ''
+    },
+    components: {
+      spareParts,
+      add
+    },
+    data() {
+      return {
+        form: {
+          remarks: '',
+          orderWorkName: '',
+          code: ''
+        }
+      };
+    },
+    mounted() {
+      this.getDetail(this.businessId);
+    },
+    methods: {
+      async getTableValue() {
+        return {
+          form: this.form,
+          returnStorageData:
+            this.$refs.add && (await this.$refs.add.getReturnStorage())
+        };
+      },
+      async getDetail(id) {
+        const res = await salesrealcostinfo(id);
+        // this.detailList = res.detailList;
+        this.$set(this.form, 'orderWorkName', res.orderWorkName);
+        this.$set(this.form, 'code', res.code);
+        this.$set(this.form, 'remarks', res.remarks);
+         this.$refs.sparePartsRef.setTableValue(res?.detailLst || []);
+        console.log(res,'resresresresresresresresres 123')
+        this.form.id = res.id;
+      }
+    }
+  };
+</script>

+ 632 - 0
src/views/bpm/handleTask/components/cost/sparePartsList.vue

@@ -0,0 +1,632 @@
+<template>
+  <div class="ele-body">
+    <!-- <el-card shadow="never" v-loading="loading"> -->
+    <!-- 数据表格 -->
+    <!-- :rules="[]" -->
+    <el-form ref="form" :model="form" label-width="100px" class="create-form">
+      <ele-pro-table
+        ref="tableRef2"
+        :columns="columnsDetail"
+        :datasource="form.tableList"
+        tool-class="ele-toolbar-form"
+        :initLoad="false"
+        :need-page="false"
+        height="300px"
+      >
+        <template v-slot:toolbar>
+          <div class="toobar" :class="buttonJud ? '' : 'toobar_r'">
+            <el-button v-if="buttonJud" type="primary" @click="addBank"
+              >添加</el-button
+            >
+            <span class="total_price">总计: {{ totalPrice }} (元)</span>
+          </div>
+        </template>
+        <template v-slot:typeId="scope">
+          <el-form-item
+            style="margin-bottom: 20px"
+            :prop="'tableList.' + scope.$index + '.typeId'"
+          >
+            <el-select
+              v-model="scope.row.typeId"
+              placeholder="请选择"
+              class="w100"
+              @change="typeIdChange(scope.row, scope.$index)"
+              disabled
+            >
+              <!-- :disabled="type == 'view' || scope.row.isApply == 1" -->
+              <el-option
+                v-for="item in typeIdList"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+        </template>
+        <template v-slot:code="scope">
+          <el-form-item
+            style="margin-bottom: 20px"
+            :prop="'tableList.' + scope.$index + '.code'"
+          >
+            <el-input
+              v-if="scope.row.typeId != 2"
+              :disabled="type == 'view'"
+              v-model="scope.row.code"
+            ></el-input>
+            <span v-if="scope.row.typeId == 2">{{ scope.row.code }}</span>
+          </el-form-item>
+        </template>
+        <template v-slot:name="scope">
+          <el-form-item
+            style="margin-bottom: 20px"
+            :prop="'tableList.' + scope.$index + '.name'"
+            :rules="{
+              required: true,
+              message:
+                source == '配件回收'
+                  ? '配件回收清单名称不能为空'
+                  : '项目名称不能为空',
+              trigger: 'change'
+            }"
+          >
+            <!--:disabled="type == 'view' || scope.row.typeId == 2" -->
+            <el-input
+              :disabled="type == 'view' || scope.row.typeId == 2"
+              v-model="scope.row.name"
+              style="width: calc(100% - 62px)"
+            ></el-input>
+            <!--    scope.row.typeId == 2 &&
+                scope.row.isApply != 1 &&
+            type == 'edit'-->
+            <!-- <el-button
+              v-if="false"
+              size="small"
+              type="primary"
+              style="margin-left: 4px"
+              @click.native="addEquipment(row, scope.$index)"
+              >选择</el-button
+            > -->
+          </el-form-item>
+        </template>
+        <template v-slot:categoryModel="scope">
+          <el-form-item
+            style="margin-bottom: 20px"
+            :prop="'tableList.' + scope.$index + '.categoryModel'"
+          >
+            <el-input
+              v-if="scope.row.typeId != 2"
+              disabled
+              v-model="scope.row.categoryModel"
+            ></el-input>
+            <span v-if="scope.row.typeId == 2">
+              {{ scope.row.categoryModel }}
+            </span>
+          </el-form-item>
+        </template>
+        <template v-slot:specification="scope">
+          <el-form-item
+            style="margin-bottom: 20px"
+            :prop="'tableList.' + scope.$index + '.specification'"
+          >
+            <el-input
+              v-if="scope.row.typeId != 2"
+              disabled
+              v-model="scope.row.specification"
+            ></el-input>
+            <span v-if="scope.row.typeId == 2">
+              {{ scope.row.specification }}
+            </span>
+          </el-form-item>
+        </template>
+        <template v-slot:content="scope">
+          <el-form-item
+            style="margin-bottom: 20px"
+            :prop="'tableList.' + scope.$index + '.content'"
+          >
+            <el-input
+              v-model="scope.row.content"
+              disabled
+            ></el-input>
+          </el-form-item>
+        </template>
+        <template v-slot:totalCount="scope">
+          <el-form-item
+            style="margin-bottom: 20px"
+            :prop="'tableList.' + scope.$index + '.totalCount'"
+          >
+            <el-input
+              v-model="scope.row.totalCount"
+              @input="totalCountChange(scope.$index, scope.row, 'totalCount')"
+              disabled
+              type="number"
+              :min="1"
+            ></el-input>
+            <!-- :disabled="type == 'view' || scope.row.isApply == 1" -->
+          </el-form-item>
+        </template>
+        <template v-slot:measureUnit="scope">
+          <el-form-item
+            style="margin-bottom: 20px"
+            :prop="'tableList.' + scope.$index + '.measureUnit'"
+          >
+            <el-input
+              v-if="scope.row.typeId != 2"
+              v-model="scope.row.measureUnit"
+              disabled
+            ></el-input>
+            <span v-if="scope.row.typeId == 2">
+              {{ scope.row.measureUnit }}
+            </span>
+          </el-form-item>
+        </template>
+        <template v-slot:singlePrice="scope">
+          <el-form-item
+            style="margin-bottom: 20px"
+            :prop="'tableList.' + scope.$index + '.singlePrice'"
+          >
+            <el-input
+              v-model="scope.row.singlePrice"
+              @input="totalCountChange(scope.$index, scope.row, 'singlePrice')"
+              disabled
+              type="number"
+              :min="0"
+            ></el-input>
+          </el-form-item>
+        </template>
+        <!-- 现在如果是查主数据的话 还可以选择仓库 -->
+        <template v-slot:warehouseId="scope">
+          <el-form-item
+            v-if="scope.row.typeId == '2'"
+            style="margin-bottom: 20px"
+            :prop="'tableList.' + scope.$index + '.warehouseId'"
+          >
+            <el-select
+              v-if="obtain == '主数据'"
+              v-model="scope.row.warehouseId"
+              placeholder="请选择仓库"
+              class="w100"
+              disabled
+            >
+              <el-option
+                v-for="item in scope.row.warehouseList"
+                @click="warehouseChange(item, scope.row, scope.$index)"
+                :key="item.warehouseId"
+                :label="item.warehouseName"
+                :value="item.warehouseId"
+              ></el-option>
+              <!-- :disabled="type == 'view' || scope.row.isApply == 1" -->
+            </el-select>
+            <el-input
+              v-model="scope.row.warehouseName"
+              disabled
+              v-else
+            ></el-input>
+          </el-form-item>
+          <el-form-item
+            v-else
+            style="margin-bottom: 20px"
+            :prop="'tableList.' + scope.$index + '.warehouseId'"
+          >
+            <el-select
+              v-model="scope.row.warehouseId"
+              placeholder="请选择仓库"
+              class="w100"
+              disabled
+            >
+              <!-- :disabled="type == 'view' || scope.row.isApply == 1" -->
+              <el-option
+                v-for="item in scope.row.warehouseList"
+                @click="warehouseChange(item, scope.row, scope.$index)"
+                :key="item.warehouseId"
+                :label="item.warehouseName"
+                :value="item.warehouseId"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+        </template>
+        <template v-slot:headerName="{ column }">
+          <span class="is-required">{{ column.label }}</span>
+        </template>
+      </ele-pro-table>
+    </el-form>
+    <!-- <product-list
+      ref="productListRef"
+      classType="1"
+      :is-get-inventory-total="true"
+      @changeParent="confirmChoose"
+      itemType="5"
+      :isFirstRefreshTable="true"
+    ></product-list> -->
+  </div>
+</template>
+
+<script>
+  import {
+    getWarehouseOutStock,
+    getIdWarehouseList
+  } from '@/api/afterSales/index';
+  import { getByCode } from '@/api/system/dictionary-data';
+
+  export default {
+
+    props: {
+      type: '',
+      // 数据来源
+      source: {
+        default: '',
+        type: String
+      },
+      // 表格权限操作 状态
+      state: {
+        default: '',
+        type: String
+      },
+      detailList: {
+        type: Array,
+        default: () => []
+      },
+      obtain: {
+        type: String,
+        default: '主数据'
+      }
+    },
+    data() {
+      return {
+        loading: false,
+        form: {
+          tableList: []
+        },
+        totalPrice: 0,
+        typeIdList: []
+      };
+    },
+    created() {
+      this.getLevelCode('after_sales_project');
+    },
+    computed: {
+      columnsDetail() {
+        return [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'typeId',
+            label: '项目',
+            align: 'center',
+            width: 120,
+            slot: 'typeId',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'code',
+            label: '编码',
+            align: 'center',
+            slot: 'code',
+            minWidth: 150,
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'name',
+            label: '名称',
+            align: 'center',
+            minWidth: 250,
+            slot: 'name',
+            showOverflowTooltip: true,
+            headerSlot: 'headerName'
+          },
+          {
+            prop: 'categoryModel',
+            label: '型号',
+            width: 150,
+            align: 'center',
+            slot: 'categoryModel',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'specification',
+            width: 150,
+            label: '规格',
+            slot: 'specification',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'content',
+            minWidth: 300,
+            slot: 'content',
+            label: '详细内容',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'warehouseId',
+            minWidth: 170,
+            slot: 'warehouseId',
+            label: '仓库',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'warehouseNum',
+            minWidth: 100,
+            label: '库存',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'totalCount',
+            slot: 'totalCount',
+            width: 100,
+            label: '数量',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'measureUnit',
+            width: 120,
+            slot: 'measureUnit',
+            label: '单位',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'singlePrice',
+            slot: 'singlePrice',
+            width: 120,
+            label: '单价(元)',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'settlementPrice',
+            width: 80,
+            label: '合计(元)',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+        ];
+      },
+      // 添加 按钮显示权限
+      buttonJud() {
+        return false;
+      },
+    },
+    watch: {
+      detailList: {
+        handler(newVal) {
+          this.form.tableList = newVal;
+        },
+        immediate: true
+      }
+    },
+    mounted() {
+      if (this.source == '配件回收') {
+        this.typeIdList = [
+          {
+            label: '零配件',
+            value: '2'
+          }
+        ];
+      }
+      if (this.detailList.length > 0) {
+        this.form.tableList = this.detailList;
+      }
+    },
+    methods: {
+      async getLevelCode(code) {
+        try {
+          const res = await getByCode(code);
+          if (res.code == 0) {
+            let list = Object.values(res.data).map((el) => {
+              let k = Object.keys(el)[0];
+              let v = Object.values(el)[0];
+              return {
+                label: v,
+                value: k
+              };
+            });
+            this.typeIdList = list;
+          }
+        } catch (err) {
+          this.$message.error(err.message);
+        }
+      },
+      typeIdChange(row, index) {
+        let obj = {
+          typeId: row.typeId,
+          code: '',
+          name: '',
+          categoryModel: '',
+          specification: '',
+          content: '',
+          totalCount: 1,
+          measureUnit: '',
+          singlePrice: '',
+          settlementPrice: ''
+        };
+        let o = this.typeIdList.find((item) => item.value == row.typeId);
+        if (o.value != 2) {
+          obj.name = o.label;
+        }
+        this.$set(this.form.tableList, index, obj);
+      },
+      getValidate() {
+        return new Promise((resolve, reject) => {
+          this.$refs.form.validate((valid, obj) => {
+            if (obj) {
+              let messages = Object.keys(obj).map((key) => obj[key][0]);
+              if (messages.length > 0) {
+                this.$message.warning(messages[0].message);
+              }
+            }
+            if (!valid) {
+              reject(false);
+            } else {
+              resolve(true);
+            }
+          });
+        });
+      },
+      addBank() {
+        this.form.tableList.push({
+          typeId: '2',
+          code: '',
+          name: '',
+          categoryModel: '',
+          specification: '',
+          content: '',
+          totalCount: 1,
+          measureUnit: '',
+          singlePrice: '',
+          settlementPrice: ''
+        });
+      },
+      async addEquipment(row, index) {
+        this.currentIndex = index;
+        if (this.obtain == '仓库') {
+          this.$refs.productListRef.open('', index, '0');
+        } else {
+          this.$refs.productListRef.open('', index, '1');
+        }
+      },
+      getTableValue() {
+        return this.form.tableList;
+      },
+      setTableValue(val) {
+        this.$set(this.form, 'tableList', val);
+        this.form.tableList.forEach(async (item, index) => {
+          if (item.typeId == 2) {
+            this.$set(
+              this.form.tableList[index],
+              'warehouseList',
+              await getIdWarehouseList({
+                categoryId: item.categoryId
+              })
+            );
+            if (item.warehouseId) {
+              this.$set(
+                this.form.tableList[index],
+                'warehouseNum',
+                await getWarehouseOutStock({
+                  warehouseId: item.warehouseId,
+                  code: item.code
+                })
+              );
+            }
+          }
+        });
+        // ***
+        this.calculatePrice();
+      },
+      totalCountChange(index, data, name) {
+        data[name] = data[name].replace(/[^\d]/g, '').replace(/^0+/, '') || '0';
+        let row = this.form.tableList[index];
+        if (row.totalCount && row.singlePrice) {
+          row.settlementPrice = row.totalCount * row.singlePrice;
+        } else {
+          row.settlementPrice = 0;
+        }
+        this.$set(
+          this.form.tableList[index],
+          'settlementPrice',
+          row.settlementPrice || 0
+        );
+        this.calculatePrice();
+      },
+      clearList() {
+        this.form.tableList = [];
+      },
+      // 计算汇总价格 ***
+      calculatePrice() {
+        let totlal = 0;
+        this.form.tableList.map((el) => (totlal += el.settlementPrice));
+        this.totalPrice = totlal;
+      },
+      del(row, index) {
+        this.form.tableList.splice(index, 1);
+      },
+      async confirmChoose(data) {
+        this.$set(this.form.tableList, this.currentIndex, data[0]);
+        this.$set(
+          this.form.tableList[this.currentIndex],
+          'categoryModel',
+          data[0].modelType
+        );
+        this.$set(
+          this.form.tableList[this.currentIndex],
+          'categoryId',
+          data[0].id
+        );
+        this.$set(
+          this.form.tableList[this.currentIndex],
+          'measureUnit',
+          data[0].measuringUnit
+        );
+
+        this.$set(
+          this.form.tableList[this.currentIndex],
+          'warehouseList',
+          await getIdWarehouseList({
+            categoryId: data[0].id
+          })
+        );
+        if (this.form.tableList[this.currentIndex]?.warehouseList?.length) {
+          this.warehouseChange(
+            this.form.tableList[this.currentIndex].warehouseList[0],
+            this.form.tableList[this.currentIndex],
+            this.currentIndex
+          );
+        }
+
+        this.$set(this.form.tableList[this.currentIndex], 'typeId', '2');
+        this.$forceUpdate();
+      },
+      async warehouseChange(item, row, index) {
+        this.$set(
+          this.form.tableList[index],
+          'warehouseName',
+          item.warehouseName
+        );
+        this.$set(this.form.tableList[index], 'warehouseId', item.warehouseId);
+        this.$set(
+          this.form.tableList[index],
+          'warehouseNum',
+          await getWarehouseOutStock({
+            warehouseId: item.warehouseId,
+            code: row.code
+          })
+        );
+      }
+    }
+  };
+</script>
+<style lang="scss" scoped>
+  :deep(.el-table__body .el-form-item__content) {
+    margin-left: 0px !important;
+  }
+  :deep(.el-table__body .el-form-item) {
+    margin-bottom: 0px !important;
+  }
+  .total_price {
+    margin-left: 24px;
+  }
+
+  .toobar {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    padding-right: 16px;
+  }
+
+  .toobar_r {
+    justify-content: flex-end;
+  }
+</style>

+ 215 - 0
src/views/bpm/handleTask/components/cost/submit.vue

@@ -0,0 +1,215 @@
+<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"
+        v-if="
+          taskDefinitionKey != 'wms_out' ||
+          (taskDefinitionKey == 'wms_out' &&
+            outInData.verifyStatus == 2)
+        "
+        @click="handleAudit(1)"
+        >通过
+      </el-button>
+      <el-button
+        icon="el-icon-edit-outline"
+        type="success"
+        size="mini"
+        :loading="isSaveLoading"
+        @click="wms_out"
+        v-if="
+          ['wms_out'].includes(taskDefinitionKey) 
+
+        "
+        >申请出库
+      </el-button>
+      <el-button
+        icon="el-icon-circle-close"
+        type="danger"
+        size="mini"
+        @click="rejectTask(0)"
+        >驳回
+      </el-button>
+    </div>
+  </el-col>
+</template>
+
+<script>
+  import {
+    saleSendProcessCancel
+  } from '@/api/bpm/components/saleManage/saleorder';
+  import { approveTaskWithVariables, rejectTask } 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 {
+        isSaveLoading: false,
+        form: {
+          technicianId: '',
+          reason: ''
+        },
+        outInData: { verifyStatus: 0 },
+        activeComp: ''
+      };
+    },
+    async created() {
+     
+    },
+    methods: {
+      async wms_out() {
+        let res = await this.getTableValue();
+        let storageData = res.returnStorageData;
+        console.log(storageData);
+        // 出库来源isSkip 0-正常  1-外部(外部跳过内部审核流程)
+        storageData.isSkip = 1;
+        storageData.isMes = 1;
+        try {
+          this.isSaveLoading = true;
+          await storageApi.outStorage(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;
+          console.error('保存失败:', error);
+        }
+      },
+      activeCompChange(activeComp) {
+        this.activeComp = activeComp;
+      },
+      /** 处理转办审批人 */
+      handleUpdateAssignee() {
+        this.$emit('handleUpdateAssignee');
+      },
+      /** 退回 */
+      handleBackList() {
+        this.$emit('handleBackList');
+      },
+      rejectTask(status) {
+        let variables = {
+          pass: !!status
+        };
+        rejectTask({
+          id: this.taskId,
+          reason: this.form.reason,
+          variables
+        }).then((res) => {
+          if (res.data.code != '-1') {
+            this.$emit('handleAudit', {
+              status,
+              title: status === 0 ? '驳回' : ''
+            });
+          }
+        });
+      },
+      async handleAudit(status) {
+         let variables = {
+          pass: !!status
+        };
+  
+        let API = !!status ? approveTaskWithVariables : rejectTask;
+        API({
+          id: this.taskId,
+          reason: this.form.reason,
+          variables
+        }).then((res) => {
+          if (res.data.code != '-1') {
+            this.$emit('handleAudit', {
+              status,
+              title: status === 0 ? '驳回' : ''
+            });
+          }
+        });
+         
+      },
+      async _approveTaskWithVariables(status, storemanIds) {
+      
+      },
+      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(() => {
+              saleSendProcessCancel({
+                id: this.taskId,
+                reason: this.form.reason,
+                businessId: this.businessId
+              })
+                .then(() => {
+                  this.$emit('handleClose');
+                })
+                .catch(() => {
+                  this.$message.error('流程作废失败');
+                });
+            })
+            .catch(() => {});
+        }
+      }
+    }
+  };
+</script>
+
+<style lang="scss"></style>