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

修改获取登录用户数据detId换成depIds

huang_an 1 год назад
Родитель
Сommit
f976d28c4d
36 измененных файлов с 1632 добавлено и 41 удалено
  1. 2 1
      src/utils/dict/warehouse.js
  2. 144 0
      src/views/bpm/handleTask/components/ingredientOutbound/boxTabPage.vue
  3. 221 0
      src/views/bpm/handleTask/components/ingredientOutbound/detailDialog.vue
  4. 1022 0
      src/views/bpm/handleTask/components/ingredientOutbound/outsourcingOutbound.vue
  5. 203 0
      src/views/bpm/handleTask/components/ingredientOutbound/submit.vue
  6. 1 1
      src/views/bpm/handleTask/components/inoutBound/detailDialog_new.vue
  7. 1 1
      src/views/bpm/handleTask/components/outsourcedWarehousingNoProcurement/procurementStorage.vue
  8. 2 2
      src/views/bpm/handleTask/components/outsourcedWarehousingNoProcurement/procurementWarehousing.vue
  9. 1 1
      src/views/bpm/handleTask/components/productionWarehousing/productionWarehousing.vue
  10. 1 1
      src/views/bpm/handleTask/components/purchaseOrder/invoice/procurementStorage.vue
  11. 1 1
      src/views/bpm/handleTask/components/purchaseOrder/invoice/procurementStorage_new.vue
  12. 2 2
      src/views/bpm/handleTask/components/purchaseOrder/invoice/procurementWarehousing copy 2.vue
  13. 2 2
      src/views/bpm/handleTask/components/purchaseOrder/invoice/procurementWarehousing copy.vue
  14. 2 2
      src/views/bpm/handleTask/components/purchaseOrder/invoice/procurementWarehousing.vue
  15. 1 1
      src/views/bpm/handleTask/components/purchaseOrder/outSourceSend/outsourcingOutbound.vue
  16. 1 1
      src/views/bpm/handleTask/components/purchaseOrder/outSourceSendCk/outsourcingOutbound.vue
  17. 1 1
      src/views/bpm/handleTask/components/purchaseOrder/outsourceSendReturnGoods/entrustedStorage.vue
  18. 1 1
      src/views/bpm/handleTask/components/purchaseOrder/outsourceSendReturnGoods/purchaseReturnsOutboundShipments.vue
  19. 1 1
      src/views/bpm/handleTask/components/purchaseOrder/returnGoods/purchaseReturnsOutboundShipments.vue
  20. 1 1
      src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/inboundDetails.vue
  21. 2 2
      src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/innerFillWeight.vue
  22. 1 1
      src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/interiorProductionStorage.vue
  23. 2 2
      src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/interiorProductionStorageQuality.vue
  24. 1 1
      src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/interiorStorageToOutsourcing.vue
  25. 2 2
      src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/interiorStorageToOutsourcingQuality.vue
  26. 1 1
      src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/outboundToOutsourcing.vue
  27. 2 2
      src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/outerFillWeight.vue
  28. 1 1
      src/views/bpm/handleTask/components/saleOrder/entrustedReceive/entrustedStorage.vue
  29. 1 1
      src/views/bpm/handleTask/components/saleOrder/entrustedReceive/outsourcingOutbound.vue
  30. 2 2
      src/views/bpm/handleTask/components/saleOrder/entrustedReceive/procurementWarehousing.vue
  31. 1 1
      src/views/bpm/handleTask/components/saleOrder/entrustedReceiveReturnGoods/consignmentReturnsOutbound.vue
  32. 1 1
      src/views/bpm/handleTask/components/saleOrder/invoice/saleShipmentsOutbound.vue
  33. 1 1
      src/views/bpm/handleTask/components/saleOrder/saleReturnGoods/salesReturnReceipt.vue
  34. 1 1
      src/views/bpm/handleTask/components/selectedCollectionOutbound/outsourcingOutbound.vue
  35. 1 1
      src/views/bpm/outgoingManagement/add.vue
  36. 1 1
      src/views/bpm/stockManagement/add.vue

+ 2 - 1
src/utils/dict/warehouse.js

@@ -59,7 +59,8 @@ export const outputSceneState = [
   { code: 8, label: '受托退货出库' },
   { code: 9, label: '仓库委外出库' },
   { code: 10, label: '采购退货出库' },
-  { code: 11, label: '自选领用出库' }
+  { code: 11, label: '自选领用出库' },
+  { code: 12, label: '配料出库' }
 ];
 // 紧急状态
 export const emergencyState = [

+ 144 - 0
src/views/bpm/handleTask/components/ingredientOutbound/boxTabPage.vue

@@ -0,0 +1,144 @@
+<template>
+  <div>
+    <keep-alive>
+      <el-tabs type="border-card" v-model="activeName">
+        <el-tab-pane label="生产配料计划详情" name="tab1">
+          <tab1
+            ref="tab1"
+            :taskDefinitionKey="taskDefinitionKey"
+            :activeComp="activeComp"
+            :businessId="businessId"
+            :infoData="form"
+            :permissionType="permissionType"
+          />
+        </el-tab-pane>
+        <el-tab-pane label="出库" name="tab2">
+          <tab2
+            ref="tab2"
+            :taskDefinitionKey="taskDefinitionKey"
+            :activeComp="activeComp"
+            :businessId="businessId"
+            :infoData="form"
+            :permissionType="permissionType"
+          />
+        </el-tab-pane>
+      </el-tabs>
+    </keep-alive>
+    <!-- <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
+      <el-tab-pane
+        v-for="item in tabOption"
+        :label="item.label"
+        :name="item.name"
+      >
+      </el-tab-pane>
+    </el-tabs>
+    <keep-alive :include="['tab1', 'tab2']">
+      <component
+        v-show="activeName && isValidComponent(activeName)"
+        :is="activeName"
+        :key="cKey"
+        ref="componentRef"
+        :taskDefinitionKey="taskDefinitionKey"
+        :activeComp="activeComp"
+        :businessId="businessId"
+        :infoData="form"
+        :permissionType="permissionType"
+      />
+    </keep-alive> -->
+  </div>
+</template>
+
+<script>
+  import { getById } from '@/api/bpm/components/materialPlan/index';
+  import tab1 from './detailDialog.vue';
+  import tab2 from './outsourcingOutbound.vue';
+  export default {
+    name: 'boxTabPage',
+    components: {
+      tab1,
+      tab2
+    },
+    props: {
+      taskDefinitionKey: {
+        type: String,
+        default: ''
+      },
+      activeComp: {
+        type: String,
+        default: ''
+      },
+      permissionType: {
+        type: String,
+        default: 'view'
+      },
+      businessId: {
+        type: String,
+        default: ''
+      }
+    },
+    data() {
+      return {
+        form: {},
+        activeName: 'tab1',
+        cKey: 1
+      };
+    },
+    computed: {
+      tabOption() {
+        let list = [
+          {
+            label: '生产配料计划详情',
+            name: 'tab1',
+            isShow: true
+          },
+          {
+            label: '出库',
+            name: 'tab2',
+            isShow: true
+          }
+        ];
+        return list.filter((item) => item.isShow);
+      }
+    },
+    async created() {
+      this.getPickOrderDetail();
+    },
+    methods: {
+      isValidComponent(componentName) {
+        const validComponents = ['tab1', 'tab2'];
+        return validComponents.includes(componentName);
+      },
+      handleClick(val) {
+        this.activeName = val.name;
+        if (val.name === 'tab1') {
+          this.$nextTick(() => {
+            this.$refs.componentRef.open(this.form);
+          });
+        }
+      },
+      async getTableValue() {
+        if (this.activeName == 'tab2') {
+          return {
+            form: this.form,
+            returnStorageData: this.$refs.tab2.getReturnStorage
+              ? await this.$refs.tab2.getReturnStorage()
+              : ''
+          };
+        } else {
+          return {
+            form: this.form
+          };
+        }
+      },
+      getPickOrderDetail() {
+        getById(this.businessId).then((data) => {
+          this.form = data;
+          if (this.activeName == 'tab1') {
+            this.$refs.tab1.open(this.form);
+          }
+        });
+      }
+    }
+  };
+</script>
+<style scoped lang="scss"></style>

+ 221 - 0
src/views/bpm/handleTask/components/ingredientOutbound/detailDialog.vue

@@ -0,0 +1,221 @@
+<template>
+  <div style="margin-top: 10px">
+    <headerTitle title="生产配料计划"></headerTitle>
+    <ele-pro-table
+      ref="table"
+      :needPage="false"
+      :columns="columns"
+      :default-expand-all="true"
+      row-key="id"
+    >
+      <!-- 展开内容 -->
+      <template v-slot:expand="{ row, $index }">
+        <div
+          style="width: calc(100% - 95px); min-height: 60px; margin-left: 95px"
+          v-if="row.materialList.length > 0"
+        >
+          <ele-pro-table
+            :toolbar="false"
+            toolsTheme="none"
+            ref="table2"
+            :need-page="false"
+            :datasource="row.materialList"
+            :columns="columns2"
+            :key="row.categoryId + '-' + $index"
+          >
+            <template v-slot:sort="{ $index }">
+              {{ $index }}
+            </template>
+          </ele-pro-table>
+        </div>
+      </template>
+    </ele-pro-table>
+  </div>
+</template>
+
+<script>
+  export default {
+    components: {},
+    props: {
+      businessId: {
+        default: ''
+      },
+      infoData: {
+        default: []
+      }
+    },
+    data() {
+      return {
+        detailId: '',
+        list: [],
+        // 表格列配置
+        columns: [
+          {
+            width: 45,
+            type: 'expand',
+            columnKey: 'materialList',
+            align: 'center',
+            slot: 'expand'
+          },
+          {
+            width: 50,
+            label: '序号',
+            type: 'index',
+            align: 'center',
+            slot: 'index'
+          },
+          {
+            prop: 'code',
+            label: '生产订单号',
+            slot: 'code',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 170
+          },
+          {
+            prop: 'salesOrderCode',
+            label: '销售订单号',
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            prop: 'customerName',
+            label: '客户名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'deliveryNum',
+            label: '客户代号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'productCode',
+            label: '产品编码',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 140
+          },
+          {
+            prop: 'productName',
+            label: '产品名称',
+            align: 'center',
+            minWidth: 120
+          },
+          {
+            prop: 'model',
+            label: '型号',
+            align: 'center',
+            minWidth: 120
+          },
+          {
+            prop: 'brandNo',
+            label: '牌号',
+            align: 'center'
+          },
+          {
+            prop: 'deliveryTime',
+            label: '交付日期',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'formingNum',
+            label: '要求生产数量',
+            align: 'center',
+            minWidth: 120
+          },
+          {
+            prop: 'produceRoutingName',
+            label: '工艺路线',
+            align: 'center',
+            minWidth: 110
+          }
+        ],
+        columns2: [
+          {
+            width: 50,
+            label: '序号',
+            prop: 'sort',
+            slot: 'sort',
+            align: 'center'
+          },
+
+          {
+            label: '工序',
+            slot: 'taskName',
+            prop: 'taskName',
+            width: 150
+          },
+
+          {
+            label: '物料名称',
+            prop: 'name'
+          },
+
+          {
+            label: '物料编码',
+            prop: 'code'
+          },
+          {
+            label: '牌号',
+            prop: 'brandNum'
+          },
+          {
+            label: '型号',
+            prop: 'modelType'
+          },
+          {
+            prop: 'inventoryQuantity',
+            label: '计量库存',
+            sortable: 'custom'
+          },
+
+          {
+            label: '计量单位',
+            prop: 'unit'
+          },
+
+          {
+            label: '需求数量',
+            slot: 'demandQuantity',
+            action: 'demandQuantity'
+          },
+
+          {
+            label: '领料数量',
+            slot: 'purchaseQuantity',
+            action: 'purchaseQuantity',
+            width: 160
+          }
+        ]
+      };
+    },
+    methods: {
+      open(data) {
+        this.$refs.table && this.$refs.table.setData([...data.workOrderList]);
+      }
+    }
+  };
+</script>
+
+<style scoped lang="scss">
+  .ele-dialog-form {
+    .el-form-item {
+      margin-bottom: 10px;
+    }
+  }
+
+  .headbox {
+    display: flex;
+    justify-content: flex-start;
+    align-items: center;
+
+    .amount {
+      font-size: 14px;
+      font-weight: bold;
+      margin-right: 20px;
+    }
+  }
+</style>

+ 1022 - 0
src/views/bpm/handleTask/components/ingredientOutbound/outsourcingOutbound.vue

@@ -0,0 +1,1022 @@
+<!-- 仓库委外申请(配料出库) 出库标识 -->
+<template>
+  <div class="ele-body">
+    <el-card shadow="never">
+      <el-form
+        :model="formData"
+        ref="formName"
+        label-width="110px"
+        :rules="rules"
+      >
+        <el-row :gutter="20">
+          <el-col :span="8">
+            <el-form-item label="出库场景" prop="bizType">
+              <span>{{ outboundTypeMapping[formData.bizType] }}</span>
+            </el-form-item></el-col
+          >
+          <el-col :span="8">
+            <el-form-item label="配料计划单" prop="sourceBizNo">
+              <span>{{ formData.sourceBizNo }}</span>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="出库物品类型" prop="extInfo.assetType">
+              <span>{{ assetTypeMapping[formData.extInfo.assetType] }}</span>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="权属部门" prop="deptName">
+              <el-input
+                v-if="!isStorage"
+                placeholder="权属部门"
+                disabled
+                v-model="formData.extInfo.deptName"
+                clearable
+              />
+              <span v-else>{{ formData.extInfo.deptName }}</span>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="出库登记人">
+              <el-input
+                v-if="!isStorage"
+                placeholder="登记人"
+                disabled
+                v-model="formData.extInfo.createUserName"
+                clearable
+              />
+              <span v-else>{{ formData.extInfo.createUserName }}</span>
+            </el-form-item></el-col
+          >
+          <el-col :span="8">
+            <el-form-item label="领料人部门" prop="verifyDeptName">
+              <selectTree
+                v-if="!isStorage"
+                ref="tree"
+                class="form-ipt"
+                size="medium"
+                style="width: 100%"
+                clearable
+                :options="treeList"
+                :props="{
+                  value: 'code',
+                  label: 'name',
+                  children: 'children'
+                }"
+                @getValue="auditorDeptClick"
+              />
+              <span v-else>{{ formData.extInfo.verifyDeptName }}</span>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="领料人" prop="fromUser">
+              <el-select
+                v-if="!isStorage"
+                v-model="formData.fromUser"
+                filterable
+                placeholder="请选择领料人"
+              >
+                <el-option
+                  v-for="item in llrLsit"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                  @click.native="
+                    () => (formData.extInfo.fromUserPhone = item.phone)
+                  "
+                >
+                </el-option>
+              </el-select>
+              <span v-else>{{ formData.fromUser }}</span>
+            </el-form-item></el-col
+          >
+          <el-col :span="8">
+            <el-form-item label="领料人联系方式" prop="fromUserPhone">
+              <el-input
+                v-if="!isStorage"
+                placeholder="请输入"
+                disabled
+                v-model="formData.extInfo.fromUserPhone"
+                clearable
+              />
+              <span v-else>{{ formData.fromUserPhone }}</span>
+            </el-form-item></el-col
+          >
+          <el-col :span="24">
+            <el-form-item label="备注" prop="remark">
+              <el-input
+                v-if="!isStorage"
+                v-model="formData.remark"
+                clearable
+                type="textarea"
+                placeholder="请详细说明"
+                :rows="4"
+              ></el-input>
+              <span v-else>{{ formData.remark }}</span>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <div v-if="!isStorage">
+        <el-button
+          style="margin-bottom: 20px; float: right; margin-right: 20px"
+          type="primary"
+          @click="addStock"
+          >添加</el-button
+        >
+      </div>
+      <div class="material">
+        <div style="width: 100%; text-align: right"></div>
+        <div>
+          <header-title title="物品清单"></header-title>
+          <div class="mt10 form-table">
+            <el-form
+              ref="warehousingMaterialListRef"
+              :model="{ warehousingMaterialList: warehousingMaterialList }"
+              :show-message="false"
+            >
+              <el-table
+                ref="multipleTable"
+                :data="warehousingMaterialList"
+                tooltip-effect="dark"
+                style="width: 100%"
+                stripe
+                :header-cell-style="{ background: '#EEEEEE', border: 'none' }"
+              >
+                <el-table-column label="序号" type="index" width="50">
+                </el-table-column>
+                <el-table-column
+                  label="编码"
+                  prop="assetCode"
+                  width="150"
+                ></el-table-column>
+
+                <el-table-column
+                  label="名称"
+                  prop="assetName"
+                  width="150"
+                ></el-table-column>
+
+                <el-table-column
+                  v-for="(item, index) in tableHeader"
+                  :key="index"
+                  align="center"
+                  :label="item.label"
+                  width="150"
+                  :prop="item.prop"
+                >
+                  <template slot-scope="{ row }">
+                    <template v-if="item.formatter">{{
+                      item.formatter(row)
+                    }}</template>
+                    <template v-else>{{ row[item.prop] }}</template>
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  label="批号"
+                  prop="manualBatchNo"
+                  width="100"
+                ></el-table-column>
+                <el-table-column
+                  label="批次号"
+                  prop="batchNo"
+                ></el-table-column>
+                <el-table-column label="最小包装单元" width="120">
+                  <template slot-scope="{ row }">
+                    {{ row.minPackingCount }}{{ row.measuringUnit }}/{{
+                      row.minUnit
+                    }}
+                  </template>
+                </el-table-column>
+                <el-table-column label="包装数量" prop="availableCountBase">
+                  <template slot-scope="{ row }">
+                    {{ row.packingCountBase }}{{ row.minUnit }}
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  label="计量数量"
+                  prop="availableCountBase"
+                ></el-table-column>
+                <el-table-column
+                  label="计量单位"
+                  prop="measuringUnit"
+                ></el-table-column>
+                <el-table-column label="重量" prop="weight"></el-table-column>
+                <el-table-column
+                  label="重量单位"
+                  prop="weightUnit"
+                ></el-table-column>
+                <el-table-column
+                  v-if="!isStorage"
+                  label="仓库"
+                  width="300"
+                  prop="warehouseName"
+                ></el-table-column>
+                <el-table-column
+                  v-else
+                  label="仓库"
+                  width="300"
+                  prop="position"
+                >
+                </el-table-column>
+                <!-- <el-table-column v-if="!isStorage" label="操作" width="200">
+                  <template slot-scope="{ row, $index }">
+                    <el-button type="text" @click="listDel(row, $index)"
+                      >删除</el-button
+                    >
+                  </template>
+                </el-table-column> -->
+              </el-table>
+            </el-form>
+          </div>
+          <header-title class="mt20" title="包装清单"></header-title>
+          <div class="mt10 form-table">
+            <el-table
+              ref="multipleTable"
+              :data="batchDetailsVOList"
+              tooltip-effect="dark"
+              style="width: 100%"
+              stripe
+              :header-cell-style="{ background: '#EEEEEE', border: 'none' }"
+            >
+              <el-table-column label="序号" type="index" width="50">
+              </el-table-column>
+              <el-table-column label="编码" prop="code"></el-table-column>
+              <el-table-column label="名称" prop="name"></el-table-column>
+              <el-table-column
+                label="批号"
+                prop="manualBatchNo"
+                width="100"
+              ></el-table-column>
+              <el-table-column label="批次号" prop="batchNo"></el-table-column>
+              <el-table-column
+                label="发货条码"
+                prop="barcodes"
+                width="80"
+                :show-overflow-tooltip="true"
+              ></el-table-column>
+              <el-table-column label="包装编码" prop="code"></el-table-column>
+              <el-table-column
+                label="包装数量"
+                prop="packingCountBase"
+                width="120"
+              >
+              </el-table-column>
+              <el-table-column
+                label="包装单位"
+                prop="packingUnit"
+              ></el-table-column>
+              <el-table-column
+                label="计量数量"
+                prop="availableCountBase"
+              ></el-table-column>
+              <el-table-column
+                label="计量单位"
+                prop="measuringUnit"
+              ></el-table-column>
+              <el-table-column
+                label="物料代号"
+                prop="materielCode"
+                width="130"
+              ></el-table-column>
+              <el-table-column
+                label="客户代号"
+                prop="clientCode"
+              ></el-table-column>
+              <el-table-column label="重量" prop="weight">
+                <template slot-scope="{ row, $index }">
+                  <el-input
+                    v-if="
+                      row.weightUnit == row.measuringUnit &&
+                      clientEnvironmentId == 2
+                    "
+                    @input="wrapWeightChange($event, row)"
+                    v-model="row.weight"
+                  ></el-input>
+                  <span v-else>{{ row.weight }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="重量单位"
+                prop="weightUnit"
+              ></el-table-column>
+            </el-table>
+            <!-- <BatchDetail
+              :assetType="formData.extInfo.assetType"
+              :data="batchDetailsVOList"
+            /> -->
+          </div>
+        </div>
+        <div class="mt20">
+          <el-tabs v-model="activeName" type="card">
+            <el-tab-pane :label="`${title}明细`" name="a">
+              <el-table
+                ref="multipleTable"
+                :data="materialCodeReqList"
+                tooltip-effect="dark"
+                style="width: 100%"
+                stripe
+                :header-cell-style="rowClass"
+              >
+                <el-table-column label="序号" type="index" width="50">
+                </el-table-column>
+
+                <el-table-column
+                  :label="`编码`"
+                  width="150"
+                  prop="assetCode"
+                ></el-table-column>
+                <el-table-column label="名称" prop="name" width="150">
+                </el-table-column>
+                <el-table-column
+                  label="批号"
+                  prop="manualBatchNo"
+                  width="100"
+                ></el-table-column>
+                <el-table-column label="批次号" prop="batchNo">
+                </el-table-column>
+                <el-table-column
+                  label="发货条码"
+                  prop="barcodes"
+                  width="80"
+                  :show-overflow-tooltip="true"
+                ></el-table-column>
+                <el-table-column
+                  v-if="dimension == 4"
+                  label="包装编码"
+                  width="150"
+                  prop="onlyCode"
+                ></el-table-column>
+                <el-table-column
+                  v-for="(item, index) in tableHeader"
+                  :key="index"
+                  align="center"
+                  :label="item.label"
+                  width="150"
+                  :prop="item.prop"
+                >
+                  <template slot-scope="{ row }">
+                    <template v-if="item.formatter">{{
+                      item.formatter(row)
+                    }}</template>
+                    <template v-else>{{ row[item.prop] }}</template>
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  label="物料编码"
+                  width="250"
+                  prop="no"
+                ></el-table-column>
+                <el-table-column label="计量数量" prop="">
+                  <template slot-scope="{ row }">1</template>
+                </el-table-column>
+                <el-table-column
+                  label="计量单位"
+                  prop="measuringUnit"
+                ></el-table-column>
+                <el-table-column
+                  label="物料代号"
+                  prop="materielCode"
+                  width="130"
+                >
+                </el-table-column>
+                <el-table-column
+                  label="客户代号"
+                  prop="clientCode"
+                ></el-table-column>
+                <el-table-column label="刻码" prop="engrave"></el-table-column>
+                <el-table-column label="重量" prop="weight">
+                  <template slot-scope="{ row, $index }">
+                    <el-input v-model="row.weight"></el-input>
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  label="重量单位"
+                  prop="weightUnit"
+                ></el-table-column>
+              </el-table>
+            </el-tab-pane>
+          </el-tabs>
+        </div>
+      </div>
+    </el-card>
+
+    <AssetsDialog
+      ref="assetsDialogRef"
+      :title="title"
+      :warehousingMaterialList="selectionList"
+      :assetType="formData.extInfo.assetType"
+      @detailData="detailData"
+    />
+  </div>
+</template>
+
+<script>
+  import { getById } from '@/api/bpm/components/outsourcedWarehousing/index';
+  import outin from '@/api/warehouseManagement/outin';
+  import { getPurchaseOutSourceSendDetailAPI } from '@/api/bpm/components/purchasingManage/outSourceSend';
+  import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
+  import { deepClone } from '@/components/FormGenerator/utils/index';
+  import {
+    getTreeByPid,
+    getTreeByGroup,
+    allCategoryLevel,
+    getOutInBySourceBizNoOrError
+  } from '@/api/classifyManage';
+  import pickOrder from '@/views/bpm/outgoingManagement/components/pickOrder.vue';
+  import {
+    warehousingType,
+    outputSceneState,
+    emergencyState,
+    materialType
+  } from '@/utils/dict/warehouse';
+  import selectTree from '@/components/selectTree';
+  import AssetsDialog from '@/views/bpm/outgoingManagement/components/AssetsDialog.vue';
+  import { tableHeader } from '@/views/bpm/handleTask/components/inoutBound/common';
+  import BatchDetail from '@/views/bpm/outgoingManagement/components/batchDetail.vue';
+  import { getLoginUser } from '@/api/login';
+  export default {
+    components: {
+      BatchDetail,
+      pickOrder,
+      selectTree,
+      AssetsDialog
+    },
+    props: {
+      taskDefinitionKey: {
+        type: String,
+        default: ''
+      },
+      activeComp: {
+        type: String,
+        default: ''
+      },
+      businessId: {
+        type: String,
+        default: ''
+      },
+      infoData: {
+        type: Object,
+        default: {}
+      }
+    },
+    data() {
+      return {
+        form: {}, // 用于传参
+        outboundTypeMapping: {}, // 出库类型映射表
+        outputSceneState, // 出库类型类型
+        codeList: [], // 物品类型列表
+        assetTypeMapping: {}, // 物品类型映射表
+        isStorage: false, // 是否出库
+        dimension: '3',
+        materialType,
+        warehousingType,
+        emergencyState,
+        title: '',
+        warehousingMaterialList: [],
+        activeName: 'a',
+        treeList: [],
+        formData: {
+          extInfo: {
+            assetType: '', //物品类型
+            deptCode: '', //部门code
+            deptName: '', //部门名称
+            verifyDeptCode: '', //审核部门编码
+            verifyDeptName: '', //审核部门名称
+            deliveryName: '', //送货人名称
+            fromUserPhone: '', //送货人电话
+            sourceBizNo: '', //销售订单
+            urgent: '', //紧急状态
+            supplierId: '', //供应商ID
+            supplierName: '', //供应商名称
+            createUserName: '' //创建人名字
+          },
+          fromUser: '', //送货人
+          bizType: '', //物品类型
+          verifyId: '', //审核人Id
+          verifyName: '', //审核人名称
+          createUserId: '',
+          remark: ''
+        },
+
+        rules: {
+          bizType: {
+            required: true,
+            message: '请选择出库场景',
+            trigger: 'change'
+          }
+        },
+        llrLsit: [],
+        options: [],
+        onSelectTableDataVal: [],
+        batchDetailsVOList: [],
+        materialCodeReqList: [],
+        selectionList: [],
+        materialObj: {},
+        wlParams: {}
+      };
+    },
+    computed: {
+      tableHeader() {
+        return tableHeader(this.formData.extInfo.assetType);
+      },
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      }
+    },
+    async mounted() {
+      await this.initData();
+      // const data = await getById(this.businessId);
+      // console.log(data);
+      //未出库
+      this.isStorage = false;
+      // 物品类型
+      this.formData.extInfo.assetType = '0';
+      // 出库类型(配料出库)
+      this.formData.bizType = '12';
+      // 增加添加物品判断条件
+      this.title = this.assetTypeMapping[this.formData.extInfo.assetType];
+      // 添加单据来源
+      this.formData.sourceBizNo = this.infoData.code;
+      // 将出库状态改成出库状态 2出库 1入库
+      this.formData.type = 2;
+      console.log(this.formData);
+      this.$forceUpdate();
+      // let returnDetailsForm = await getPurchaseOutSourceSendDetailAPI(
+      //   this.businessId
+      // );
+      // this.form = returnDetailsForm;
+      // console.log(returnDetailsForm);
+      // getOutInBySourceBizNoOrError(returnDetailsForm.code)
+      //   .then((data) => {
+      //     // 已经出库(详情)
+      //     console.log('有订单来源');
+      //     this.isStorage = true; // 已经出库
+      //     this.formData = deepClone(data);
+      //     // 填充遍历数据
+      //     console.log('this.formData-----', this.formData);
+      //     if (this.formData.outInDetailVOList?.length > 0) {
+      //       this.warehousingMaterialList = []; // 物品列表
+      //       this.batchDetailsVOList = []; // 包装列表
+      //       this.materialCodeReqList = []; // 物料列表
+      //       this.formData.outInDetailVOList.forEach((goodsiItem) => {
+      //         goodsiItem.assetName = goodsiItem.name;
+      //         goodsiItem.assetCode = goodsiItem.categoryCode;
+      //         goodsiItem.outInNum = goodsiItem.packingCount;
+      //         this.warehousingMaterialList.push(goodsiItem);
+      //         goodsiItem.outInDetailRecordVOList.forEach((wrapItem) => {
+      //           wrapItem.assetName = goodsiItem.name;
+      //           wrapItem.assetCode = goodsiItem.categoryCode;
+      //           // wrapItem.count =
+      //           //   wrapItem.outInDetailRecordMaterialDetailVOList.length; // 增加包装计量数量
+      //           this.batchDetailsVOList.push(wrapItem);
+      //           wrapItem.outInDetailRecordMaterialDetailVOList.forEach(
+      //             (materialItem) => {
+      //               materialItem.isPack = true;
+      //               this.materialCodeReqList.push(materialItem);
+      //             }
+      //           );
+      //         });
+      //       });
+      //     }
+      //   })
+      //   .catch(() => {
+      //     //未出库
+      //     this.isStorage = false;
+      //     // 物品类型
+      //     this.formData.extInfo.assetType =
+      //       returnDetailsForm.categoryLevelTopId;
+      //     // 出库类型(委外出库)
+      //     this.formData.bizType = '6';
+      //     // 增加添加物品判断条件
+      //     this.title = this.assetTypeMapping[this.formData.extInfo.assetType];
+      //     // 添加单据来源
+      //     this.formData.sourceBizNo = returnDetailsForm.code;
+      //     // 将出库状态改成出库状态 2出库 1入库
+      //     this.formData.type = 2;
+      //     this.$forceUpdate();
+      //   });
+    },
+    methods: {
+      wrapWeightChange(val, row) {
+        if (val > row.availableCountBase) {
+          row.weight = row.availableCountBase;
+          this.$message.error('重量不能大于可用数量');
+          return false;
+        }
+        const code = row.onlyCode;
+        const batchNo = row.batchNo;
+        console.log(code);
+        console.log(batchNo);
+        console.log(this.warehousingMaterialList);
+        this.warehousingMaterialList.forEach((item) => {
+          if (item.assetCode == code && item.batchNo == batchNo) {
+            let arr = [];
+            for (const key in this.batchDetailsVOList) {
+              if (
+                this.batchDetailsVOList[key].onlyCode == item.code &&
+                this.batchDetailsVOList[key].batchNo == item.batchNo
+              ) {
+                arr.push({ ...this.batchDetailsVOList[key] });
+              }
+            }
+            const count = arr.reduce((acc, curr) => {
+              return Number(this.$math.format(+acc + +curr.weight, 14));
+            }, 0);
+            this.$set(item, 'weight', count);
+          }
+        });
+        console.log(this.warehousingMaterialList);
+      },
+      //获取回执附件
+      getQualityFile() {
+        return {};
+      },
+      detailData(data, dimension) {
+        this.dimension = dimension;
+        console.log('总数居', data);
+        this.onSelectTableDataVal = data.realTimeInventoryVOList;
+        this.warehousingMaterialList = data.realTimeInventoryVOList.map(
+          (next) => {
+            delete next.updateTime;
+            delete next.createTime;
+            return {
+              ...next,
+              realInventoryAmount: 0,
+              assetType: this.formData.extInfo.assetType,
+              outInNum: '',
+              assetCode: next.code,
+              assetName: next.name,
+              bizStatus: 2,
+              contactCode: next.contactCode
+            };
+          }
+        );
+        // this.batchDetailsVOList = data.batchDetailsVOList;
+
+        if (dimension == 4) {
+          this.materialCodeReqList = data.wlList;
+          this.selectionList = data.wlList;
+
+          //包装维度出库
+          const list = data.realTimeInventoryVOList;
+          //获取包装维度
+          let packArr = [];
+          for (const item of list) {
+            if (item.inventoryDetailsVOList.length != 0) {
+              for (const iterator of item.inventoryDetailsVOList) {
+                packArr.push({ ...iterator, batchNo: iterator.batchNum });
+              }
+            }
+          }
+          this.batchDetailsVOList = packArr.map((item) => {
+            return {
+              ...item
+              // packingCountBase:
+              //   dimension == 4 || dimension == 3 ? 1 : item.packingCountBase
+              // weight: 0
+            };
+          });
+
+          let params = {
+            realTimeInventoryNewPOList: data.realTimeInventoryVOList
+          };
+
+          for (const item of params.realTimeInventoryNewPOList) {
+            item.inventoryDetailsNewPOList = item.inventoryDetailsVOList;
+
+            for (const detail of item.inventoryDetailsNewPOList) {
+              detail.outInMaterialDetailsAddPOList = [];
+
+              for (const wlItem of data.wlList) {
+                if (detail.id === wlItem.recordId) {
+                  detail.outInMaterialDetailsAddPOList.push({
+                    ...wlItem
+                  });
+                }
+              }
+            }
+          }
+          this.wlParams = params;
+
+          this.materialObj = data;
+        } else if (dimension == 3) {
+          //包装维度出库
+          const list = data.realTimeInventoryVOList;
+          //获取包装维度
+          let packArr = [];
+          for (const item of list) {
+            if (item.inventoryDetailsVOList.length != 0) {
+              for (const iterator of item.inventoryDetailsVOList) {
+                packArr.push({ ...iterator, batchNo: iterator.batchNum });
+              }
+            }
+          }
+          this.batchDetailsVOList = packArr.map((item) => {
+            return {
+              ...item
+              // packingCountBase:
+              //   dimension == 4 || dimension == 3 ? 1 : item.packingCountBase
+              // weight: 0
+            };
+          });
+          //物料维度数据
+          let meteArr = [];
+          for (const item of packArr) {
+            if (item.materialDetailsVOList.length != 0) {
+              for (const iterator of item.materialDetailsVOList) {
+                meteArr.push({
+                  ...iterator
+                });
+              }
+            }
+          }
+          this.materialCodeReqList = meteArr;
+          //再次打开选择上
+          this.selectionList = list;
+          //send数据
+          this.wlParams = { realTimeInventoryNewPOList: list };
+          this.wlParams.realTimeInventoryNewPOList.forEach((item) => {
+            item.inventoryDetailsNewPOList = item.inventoryDetailsVOList;
+            item.inventoryDetailsNewPOList.forEach((ite) => {
+              ite.weight = 0;
+              ite.outInMaterialDetailsAddPOList = ite.materialDetailsVOList;
+            });
+          });
+        } else {
+          //   else if (dimension == 2) {
+          //   this.batchDetailsVOList = data.wlList;
+          //   this.selectionList = data.wlList;
+          // }
+          //物品维度出库
+          const list = data.realTimeInventoryVOList;
+          //获取包装维度
+          let packArr = [];
+          for (const item of list) {
+            if (item.inventoryDetailsVOList.length != 0) {
+              for (const iterator of item.inventoryDetailsVOList) {
+                packArr.push({ ...iterator, batchNo: iterator.batchNum });
+              }
+            }
+          }
+          this.batchDetailsVOList = packArr.map((item) => {
+            return {
+              ...item
+              // packingCountBase: dimension == 3 ? 1 : item.packingCountBase
+              // weight: 0
+            };
+          });
+          //物料维度数据
+          let meteArr = [];
+          for (const item of packArr) {
+            if (item.materialDetailsVOList.length != 0) {
+              for (const iterator of item.materialDetailsVOList) {
+                meteArr.push({
+                  ...iterator
+                });
+              }
+            }
+          }
+          this.materialCodeReqList = meteArr;
+          //再次打开选择上
+          this.selectionList = list;
+          //send数据
+          this.wlParams = { realTimeInventoryNewPOList: list };
+          this.wlParams.realTimeInventoryNewPOList.forEach((item) => {
+            item.inventoryDetailsNewPOList = item.inventoryDetailsVOList;
+            item.inventoryDetailsNewPOList.forEach((ite) => {
+              ite.weight = 0;
+              ite.outInMaterialDetailsAddPOList = ite.materialDetailsVOList;
+            });
+          });
+        }
+      },
+      getStatus() {
+        return true;
+      },
+      getReturnStorage() {
+        return new Promise((resolve) => {
+          this.$refs.formName.validate((valid) => {
+            if (valid) {
+              if (!this.warehousingMaterialList?.length) {
+                return this.$message.error('请添加出库明细!');
+              }
+              let obj = { ...this.formData, type: 2 };
+              obj.extInfo.sourceBizNo = obj.sourceBizNo;
+              obj.fromType = obj.type;
+              obj = { ...obj, ...this.wlParams };
+              if (this.dimension == 4) {
+                obj.num = this.materialObj.wlList.length;
+              } else {
+                obj.num = this.materialCodeReqList.length;
+              }
+
+              let selectGoodId = [];
+              obj.realTimeInventoryNewPOList =
+                obj.realTimeInventoryNewPOList.map((goodItem) => {
+                  // 同步物品重量
+                  this.warehousingMaterialList.forEach((item) => {
+                    if (item.id === goodItem.id) {
+                      goodItem.weight = item.weight;
+                    }
+                  });
+                  selectGoodId.push(goodItem.id);
+                  goodItem.inventoryDetailsNewPOList =
+                    goodItem.inventoryDetailsNewPOList.map((wrapItem) => {
+                      // 同步包装重量
+                      this.batchDetailsVOList.forEach((item) => {
+                        if (item.id === wrapItem.id) {
+                          wrapItem.weight = item.weight;
+                        }
+                      });
+                      // wrapItem.workOrderId =
+                      //   this.infoData.detailList[0].workOrderId;
+                      // wrapItem.pickOrderId =
+                      //   this.infoData.detailList[0].pickOrderId;
+                      wrapItem.taskId =
+                        this.infoData.workOrderList[0].materialList[0].taskId;
+                      wrapItem.instanceId = goodItem.id;
+                      wrapItem.demandQuantity = wrapItem.availableCountBase;
+                      return wrapItem;
+                    });
+                  return goodItem;
+                });
+              let boolen = true;
+              this.infoData.workOrderList[0].materialList.forEach((item) => {
+                if (
+                  selectGoodId.indexOf(item.categoryId) == -1 &&
+                  selectGoodId.indexOf(item.instanceId) == -1
+                ) {
+                  boolen = false;
+                }
+              });
+              if (boolen) {
+                resolve(obj);
+              } else {
+                this.$confirm('配料物品与出库物品不一致, 是否继续?', '提示', {
+                  confirmButtonText: '确定',
+                  cancelButtonText: '取消',
+                  type: 'warning'
+                })
+                  .then(() => {
+                    resolve(obj);
+                  })
+                  .catch(() => {
+                    console.log('取消');
+                  });
+              }
+            }
+          });
+        });
+      },
+      rowClass({ row, column, rowIndex, columnIndex }) {
+        if (rowIndex === 1) {
+          return {
+            display: 'none',
+            background: '#EEEEEE',
+            border: 'none'
+          };
+        }
+        return { background: '#EEEEEE', border: 'none' };
+      },
+      // 部门点击事件
+      async auditorDeptClick(data) {
+        console.log(data);
+        this.formData.extInfo.verifyDeptCode = data?.id;
+        this.formData.extInfo.verifyDeptName = data?.name;
+        this.formData.verifyId = '';
+        this.formData.verifyName = '';
+
+        this.$refs.formName.validateField('verifyDeptName');
+        if (data) {
+          this.getStaffList(data);
+        }
+      },
+      // 获取领料人列表
+      async getStaffList(data) {
+        let res = await warehouseDefinition.getUserPage({
+          groupId: data.id,
+          size: 9999,
+          page: 1
+        });
+        this.llrLsit = res.list;
+      },
+      //出库明细删除
+      listDel(row, index) {
+        this.warehousingMaterialList.splice(index, 1);
+        if (this.warehousingMaterialList.length == 0) {
+          this.formData.sourceBizNo = '';
+          this.formData.extInfo.clientName = '';
+          this.formData.extInfo.clientUser = '';
+          this.formData.extInfo.clientUserPhone = '';
+        }
+        // 从 this.batchDetailsVOList 中删除满足条件的对象
+        this.removeItemsFromArray(
+          this.batchDetailsVOList,
+          (item) => item.code.substr(0, 12) === row.code
+        );
+
+        // 从 this.materialCodeReqList 中删除满足条件的对象
+        this.removeItemsFromArray(
+          this.materialCodeReqList,
+          (item) => item.assetCode === row.code
+        );
+      },
+      // 删除数组中满足条件的对象
+      removeItemsFromArray(arr, condition) {
+        for (let i = arr.length - 1; i >= 0; i--) {
+          if (condition(arr[i])) {
+            arr.splice(i, 1);
+          }
+        }
+      },
+      // 获取物品类型列表
+      async getAssetTypeOptions() {
+        const { data } = await allCategoryLevel();
+        this.codeList = data;
+        let obj = {};
+        data.forEach((item) => {
+          obj[item.id] = item.name;
+        });
+        this.assetTypeMapping = obj;
+      },
+      // 出库类型映射表
+      async getOutboundTypeMapping() {
+        let obj = {};
+        this.outputSceneState.forEach((item) => {
+          obj[item.code] = item.label;
+        });
+        this.outboundTypeMapping = obj;
+      },
+      async initData() {
+        await this.getAssetTypeOptions();
+        await this.getOutboundTypeMapping();
+        const res = await warehouseDefinition.tree();
+        this.treeList = this.$util.toTreeData({
+          data: res,
+          idField: 'id',
+          parentIdField: 'parentId'
+        });
+        const info = await getLoginUser();
+        let obj = res.find(
+          (item) => item.id === info.deptIds[info.deptIds.length - 1]
+        );
+        if (!obj) return;
+        this.formData.extInfo.deptCode = obj.id;
+        this.formData.extInfo.deptName = obj.name;
+        this.formData.extInfo.createUserName = info.name;
+        this.formData.createUserId = info.id;
+      },
+      addStock() {
+        if (!this.title) return this.$message.error('请选择出库产品类型');
+        if (!this.formData.bizType && this.formData.bizType !== 0) {
+          return this.$message.error('请选择出库场景');
+        }
+        this.$refs.assetsDialogRef.open();
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  ::v-deep.form-table {
+    .el-form-item {
+      margin-bottom: 0;
+    }
+    .el-input__inner {
+      padding: 0 10px;
+    }
+  }
+
+  .p20 {
+    padding: 20px;
+  }
+  .el-select,
+  .el-date-editor {
+    width: 100%;
+  }
+  .el-form-item {
+    margin-bottom: 22px;
+  }
+  .material {
+    margin-top: 20px;
+    .flex {
+      display: flex;
+      justify-content: space-between;
+      font-size: 14px;
+      align-items: center;
+      .red {
+        color: #ff4949;
+      }
+    }
+  }
+  .mt10 {
+    margin-top: 10px;
+  }
+  .mt20 {
+    margin-top: 20px;
+  }
+  .center {
+    text-align: center;
+  }
+</style>

+ 203 - 0
src/views/bpm/handleTask/components/ingredientOutbound/submit.vue

@@ -0,0 +1,203 @@
+<template>
+  <el-col :span="16" :offset="6">
+    <el-form label-width="100px" ref="formRef" :model="form">
+      <el-form-item
+        label="审批建议"
+        prop="reason"
+        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"
+        :loading="isLoading"
+        @click="handleAudit(1)"
+        >通过
+      </el-button>
+      <el-button
+        icon="el-icon-circle-close"
+        type="danger"
+        size="mini"
+        @click="handleAudit(0)"
+        >驳回
+      </el-button>
+
+      <el-dropdown
+        @command="(command) => handleCommand(command)"
+        style="margin-left: 30px"
+        v-if="taskDefinitionKey != 'deptLeaderApprove'"
+      >
+        <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 outin from '@/api/warehouseManagement/outin';
+  import { cancel } from '@/api/bpm/components/purchasingManage/outSourceSend';
+  import { approveTaskWithVariables } from '@/api/bpm/task';
+
+  // 流程实例的详情页,可用于审批
+  export default {
+    name: '',
+    components: {
+      //   Parser
+    },
+    props: {
+      businessId: {
+        default: ''
+      },
+      taskId: {
+        default: ''
+      },
+      id: {
+        default: ''
+      },
+      taskDefinitionKey: {
+        default: ''
+      }
+    },
+    data() {
+      return {
+        isLoading: false,
+        form: {
+          reason: ''
+        }
+      };
+    },
+    methods: {
+      async handleAudit(status) {
+        // console.log(status);
+        // let storemanIds = '';
+        // let permissionType = this.tabOptions.find(
+        //   (item) => item.key == this.taskDefinitionKey
+        // )?.permissionType;
+        // if (this.taskDefinitionKey === 'deptLeaderApprove') {
+        //   let arr = await this.getTableValue();
+        //   let ids = arr.productList.map((item) => item.warehouseId);
+        //   let data = await getWarehouseListByIds(ids || []);
+        //   storemanIds = [...new Set(data.map((item) => item.ownerId))].join(
+        //     ','
+        //   );
+        // }
+        let data = await this.getTableValue();
+        let storageData = data.returnStorageData;
+        if (!!status) {
+          if (!storageData.extInfo.verifyDeptCode) {
+            this.$message.error('请选择部门');
+            return false;
+          }
+          if (!storageData.fromUser) {
+            this.$message.error('请选择领料人');
+            return false;
+          }
+        }
+        if (!this.form.reason && !!status) {
+          this.$message.error('请输入审批意见');
+          return false;
+        }
+        if (this.taskDefinitionKey === 'storeman' && !!status) {
+          // 入库来源storageSource 0-正常  1-外部(外部跳过内部审核流程)
+          storageData.storageSource = 1;
+          console.log(storageData);
+          try {
+            this.isLoading = true;
+            const res = await outin.saveNew(storageData);
+            if (res.code == 0) {
+              approveTaskWithVariables({
+                id: this.taskId,
+                reason: this.form.reason,
+                variables: {
+                  pass: !!status
+                }
+              }).then((res) => {
+                if (res.code != '-1') {
+                  this.$emit('handleAudit', {
+                    status: status,
+                    title: !status ? '驳回' : ''
+                  });
+                }
+                this.isLoading = false;
+              });
+            }
+          } catch (error) {
+            this.isLoading = false;
+            console.error('保存失败:', error);
+          }
+        } else {
+          // await this._approveTaskWithVariables(status, storemanIds);
+          await this._approveTaskWithVariables(status);
+        }
+      },
+      getTableValue() {
+        return new Promise((resolve, reject) => {
+          this.$emit('getTableValue', async (data) => {
+            resolve(await data);
+          });
+        });
+      },
+      async _approveTaskWithVariables(status, storemanIds) {
+        let variables = {
+          pass: !!status
+        };
+        approveTaskWithVariables({
+          id: this.taskId,
+          reason: this.form.reason,
+          variables
+        }).then((res) => {
+          if (res.data.code != '-1') {
+            this.$emit('handleAudit', {
+              status,
+              title: status === 0 ? '驳回' : ''
+            });
+          }
+        });
+      },
+      //更多
+      handleCommand(command) {
+        if (command === 'cancel') {
+          this.$confirm('是否确认作废?', {
+            type: 'warning',
+            cancelButtonText: '取消',
+            confirmButtonText: '确定'
+          })
+            .then(() => {
+              cancel({
+                id: this.taskId,
+                reason: this.form.reason,
+                businessId: this.businessId
+              })
+                .then(() => {
+                  this.$emit('handleClose');
+                })
+                .catch(() => {
+                  this.$message.error('流程作废失败');
+                });
+            })
+            .catch(() => {});
+        }
+      }
+    }
+  };
+</script>
+
+<style lang="scss"></style>

+ 1 - 1
src/views/bpm/handleTask/components/inoutBound/detailDialog_new.vue

@@ -2252,7 +2252,7 @@
       //   const info = await getLoginUser();
       //   // const info = JSON.parse(localStorage.getItem('info'));
       //   let obj = res.find(
-      //     (item) => item.id === info.deptId[info.deptId.length - 1]
+      //     (item) => item.id === info.deptIds[info.deptIds.length - 1]
       //   );
       //   if (!obj) return;
       //   this.formData.extInfo.deptCode = obj.id;

+ 1 - 1
src/views/bpm/handleTask/components/outsourcedWarehousingNoProcurement/procurementStorage.vue

@@ -2153,7 +2153,7 @@
         const res = await warehouseDefinition.tree();
         const info = await getLoginUser();
         let obj = res.find(
-          (item) => item.id === info.deptId[info.deptId.length - 1]
+          (item) => item.id === info.deptIds[info.deptIds.length - 1]
         );
         if (!obj) return;
         this.formData.extInfo.deptCode = obj.id;

+ 2 - 2
src/views/bpm/handleTask/components/outsourcedWarehousingNoProcurement/procurementWarehousing.vue

@@ -1615,7 +1615,7 @@
         this.formData.bizType = '2'; // 入库场景(销售入库)
         this.formData.type = '1'; // 出入库类型 2出库 1入库
         this.formData.extInfo.deptName = this.user.info.deptName; // 权属部门
-        this.formData.extInfo.deptCode = this.user.info.deptId[0]; // 权属部门id
+        this.formData.extInfo.deptCode = this.user.info.deptIds[0]; // 权属部门id
         this.formData.extInfo.createUserName = this.user.info.name; // 入库登记人
         this.formData.extInfo.supplierName = this.infoData.supplierName; // 供应商
         this.formData.extInfo.contentImage = []; // 内容图片地址URL
@@ -2974,7 +2974,7 @@
       //   const info = await getLoginUser();
       //   // const info = JSON.parse(localStorage.getItem('info'));
       //   let obj = res.find(
-      //     (item) => item.id === info.deptId[info.deptId.length - 1]
+      //     (item) => item.id === info.deptIds[info.deptIds.length - 1]
       //   );
       //   if (!obj) return;
       //   this.formData.extInfo.deptCode = obj.id;

+ 1 - 1
src/views/bpm/handleTask/components/productionWarehousing/productionWarehousing.vue

@@ -1969,7 +1969,7 @@
         const res = await warehouseDefinition.tree();
         const info = await getLoginUser();
         let obj = res.find(
-          (item) => item.id === info.deptId[info.deptId.length - 1]
+          (item) => item.id === info.deptIds[info.deptIds.length - 1]
         );
         if (!obj) return;
         this.formData.extInfo.deptCode = obj.id;

+ 1 - 1
src/views/bpm/handleTask/components/purchaseOrder/invoice/procurementStorage.vue

@@ -2395,7 +2395,7 @@
         const res = await warehouseDefinition.tree();
         const info = await getLoginUser();
         let obj = res.find(
-          (item) => item.id === info.deptId[info.deptId.length - 1]
+          (item) => item.id === info.deptIds[info.deptIds.length - 1]
         );
         if (!obj) return;
         this.formData.extInfo.deptCode = obj.id;

+ 1 - 1
src/views/bpm/handleTask/components/purchaseOrder/invoice/procurementStorage_new.vue

@@ -1787,7 +1787,7 @@
         const res = await warehouseDefinition.tree();
         const info = await getLoginUser();
         let obj = res.find(
-          (item) => item.id === info.deptId[info.deptId.length - 1]
+          (item) => item.id === info.deptIds[info.deptIds.length - 1]
         );
         if (!obj) return;
         this.formData.extInfo.deptCode = obj.id;

+ 2 - 2
src/views/bpm/handleTask/components/purchaseOrder/invoice/procurementWarehousing copy 2.vue

@@ -1217,7 +1217,7 @@
         this.formData.bizType = '2'; // 入库场景(销售入库)
         this.formData.type = '1'; // 出入库类型 2出库 1入库
         this.formData.extInfo.deptName = this.user.info.deptName; // 权属部门
-        this.formData.extInfo.deptCode = this.user.info.deptId[0]; // 权属部门id
+        this.formData.extInfo.deptCode = this.user.info.deptIds[0]; // 权属部门id
         this.formData.extInfo.createUserName = this.user.info.name; // 入库登记人
         this.formData.extInfo.supplierName = this.infoData.supplierName; // 供应商
         this.formData.extInfo.contentImage = []; // 内容图片地址URL
@@ -2352,7 +2352,7 @@
       //   const info = await getLoginUser();
       //   // const info = JSON.parse(localStorage.getItem('info'));
       //   let obj = res.find(
-      //     (item) => item.id === info.deptId[info.deptId.length - 1]
+      //     (item) => item.id === info.deptIds[info.deptIds.length - 1]
       //   );
       //   if (!obj) return;
       //   this.formData.extInfo.deptCode = obj.id;

+ 2 - 2
src/views/bpm/handleTask/components/purchaseOrder/invoice/procurementWarehousing copy.vue

@@ -1268,7 +1268,7 @@
         this.formData.bizType = '2'; // 入库场景(销售入库)
         this.formData.type = '1'; // 出入库类型 2出库 1入库
         this.formData.extInfo.deptName = this.user.info.deptName; // 权属部门
-        this.formData.extInfo.deptCode = this.user.info.deptId[0]; // 权属部门id
+        this.formData.extInfo.deptCode = this.user.info.deptIds[0]; // 权属部门id
         this.formData.extInfo.createUserName = this.user.info.name; // 入库登记人
         this.formData.extInfo.supplierName = this.infoData.supplierName; // 供应商
         this.formData.extInfo.contentImage = []; // 内容图片地址URL
@@ -2423,7 +2423,7 @@
       //   const info = await getLoginUser();
       //   // const info = JSON.parse(localStorage.getItem('info'));
       //   let obj = res.find(
-      //     (item) => item.id === info.deptId[info.deptId.length - 1]
+      //     (item) => item.id === info.deptIds[info.deptIds.length - 1]
       //   );
       //   if (!obj) return;
       //   this.formData.extInfo.deptCode = obj.id;

+ 2 - 2
src/views/bpm/handleTask/components/purchaseOrder/invoice/procurementWarehousing.vue

@@ -1630,7 +1630,7 @@
         this.formData.bizType = '2'; // 入库场景(销售入库)
         this.formData.type = '1'; // 出入库类型 2出库 1入库
         this.formData.extInfo.deptName = this.user.info.deptName; // 权属部门
-        this.formData.extInfo.deptCode = this.user.info.deptId[0]; // 权属部门id
+        this.formData.extInfo.deptCode = this.user.info.deptIds[0]; // 权属部门id
         this.formData.extInfo.createUserName = this.user.info.name; // 入库登记人
         this.formData.extInfo.supplierName = this.infoData.supplierName; // 供应商
         this.formData.extInfo.contentImage = []; // 内容图片地址URL
@@ -2989,7 +2989,7 @@
       //   const info = await getLoginUser();
       //   // const info = JSON.parse(localStorage.getItem('info'));
       //   let obj = res.find(
-      //     (item) => item.id === info.deptId[info.deptId.length - 1]
+      //     (item) => item.id === info.deptIds[info.deptIds.length - 1]
       //   );
       //   if (!obj) return;
       //   this.formData.extInfo.deptCode = obj.id;

+ 1 - 1
src/views/bpm/handleTask/components/purchaseOrder/outSourceSend/outsourcingOutbound.vue

@@ -802,7 +802,7 @@
         });
         const info = await getLoginUser();
         let obj = res.find(
-          (item) => item.id === info.deptId[info.deptId.length - 1]
+          (item) => item.id === info.deptIds[info.deptIds.length - 1]
         );
         if (!obj) return;
         this.formData.extInfo.deptCode = obj.id;

+ 1 - 1
src/views/bpm/handleTask/components/purchaseOrder/outSourceSendCk/outsourcingOutbound.vue

@@ -820,7 +820,7 @@
         });
         const info = await getLoginUser();
         let obj = res.find(
-          (item) => item.id === info.deptId[info.deptId.length - 1]
+          (item) => item.id === info.deptIds[info.deptIds.length - 1]
         );
         if (!obj) return;
         this.formData.extInfo.deptCode = obj.id;

+ 1 - 1
src/views/bpm/handleTask/components/purchaseOrder/outsourceSendReturnGoods/entrustedStorage.vue

@@ -1842,7 +1842,7 @@
         const res = await warehouseDefinition.tree();
         const info = await getLoginUser();
         let obj = res.find(
-          (item) => item.id === info.deptId[info.deptId.length - 1]
+          (item) => item.id === info.deptIds[info.deptIds.length - 1]
         );
         if (!obj) return;
         this.formData.extInfo.deptCode = obj.id;

+ 1 - 1
src/views/bpm/handleTask/components/purchaseOrder/outsourceSendReturnGoods/purchaseReturnsOutboundShipments.vue

@@ -1495,7 +1495,7 @@
         // const info = JSON.parse(localStorage.getItem('info'));
         const info = await getLoginUser();
         let obj = res.find(
-          (item) => item.id === info.deptId[info.deptId.length - 1]
+          (item) => item.id === info.deptIds[info.deptIds.length - 1]
         );
         // console.log('obj=====', obj);
         this.formData.extInfo.deptName = obj.name;

+ 1 - 1
src/views/bpm/handleTask/components/purchaseOrder/returnGoods/purchaseReturnsOutboundShipments.vue

@@ -1495,7 +1495,7 @@
         // const info = JSON.parse(localStorage.getItem('info'));
         const info = await getLoginUser();
         let obj = res.find(
-          (item) => item.id === info.deptId[info.deptId.length - 1]
+          (item) => item.id === info.deptIds[info.deptIds.length - 1]
         );
         // console.log('obj=====', obj);
         this.formData.extInfo.deptName = obj.name;

+ 1 - 1
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/inboundDetails.vue

@@ -2056,7 +2056,7 @@
         });
         const info = await getLoginUser();
         let obj = res.find(
-          (item) => item.id === info.deptId[info.deptId.length - 1]
+          (item) => item.id === info.deptIds[info.deptIds.length - 1]
         );
         if (!obj) return;
         this.formData.extInfo.deptCode = obj.id;

+ 2 - 2
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/innerFillWeight.vue

@@ -1483,7 +1483,7 @@
         this.formData.bizType = '2'; // 入库场景(销售入库)
         this.formData.type = '1'; // 出入库类型 2出库 1入库
         this.formData.extInfo.deptName = this.user.info.deptName; // 权属部门
-        this.formData.extInfo.deptCode = this.user.info.deptId[0]; // 权属部门id
+        this.formData.extInfo.deptCode = this.user.info.deptIds[0]; // 权属部门id
         this.formData.extInfo.createUserName = this.user.info.name; // 入库登记人
         this.formData.extInfo.supplierName = this.infoData.supplierName; // 供应商
         this.formData.extInfo.contentImage = []; // 内容图片地址URL
@@ -2801,7 +2801,7 @@
       //   const info = await getLoginUser();
       //   // const info = JSON.parse(localStorage.getItem('info'));
       //   let obj = res.find(
-      //     (item) => item.id === info.deptId[info.deptId.length - 1]
+      //     (item) => item.id === info.deptIds[info.deptIds.length - 1]
       //   );
       //   if (!obj) return;
       //   this.formData.extInfo.deptCode = obj.id;

+ 1 - 1
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/interiorProductionStorage.vue

@@ -2315,7 +2315,7 @@
         });
         const info = await getLoginUser();
         let obj = res.find(
-          (item) => item.id === info.deptId[info.deptId.length - 1]
+          (item) => item.id === info.deptIds[info.deptIds.length - 1]
         );
         if (!obj) return;
         this.formData.extInfo.deptCode = obj.id;

+ 2 - 2
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/interiorProductionStorageQuality.vue

@@ -1570,7 +1570,7 @@
         this.formData.bizType = '2'; // 入库场景(销售入库)
         this.formData.type = '1'; // 出入库类型 2出库 1入库
         this.formData.extInfo.deptName = this.user.info.deptName; // 权属部门
-        this.formData.extInfo.deptCode = this.user.info.deptId[0]; // 权属部门id
+        this.formData.extInfo.deptCode = this.user.info.deptIds[0]; // 权属部门id
         this.formData.extInfo.createUserName = this.user.info.name; // 入库登记人
         this.formData.extInfo.supplierName = this.infoData.supplierName; // 供应商
         this.formData.extInfo.contentImage = []; // 内容图片地址URL
@@ -2892,7 +2892,7 @@
       //   const info = await getLoginUser();
       //   // const info = JSON.parse(localStorage.getItem('info'));
       //   let obj = res.find(
-      //     (item) => item.id === info.deptId[info.deptId.length - 1]
+      //     (item) => item.id === info.deptIds[info.deptIds.length - 1]
       //   );
       //   if (!obj) return;
       //   this.formData.extInfo.deptCode = obj.id;

+ 1 - 1
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/interiorStorageToOutsourcing.vue

@@ -2299,7 +2299,7 @@
         });
         const info = await getLoginUser();
         let obj = res.find(
-          (item) => item.id === info.deptId[info.deptId.length - 1]
+          (item) => item.id === info.deptIds[info.deptIds.length - 1]
         );
         if (!obj) return;
         this.formData.extInfo.deptCode = obj.id;

+ 2 - 2
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/interiorStorageToOutsourcingQuality.vue

@@ -1561,7 +1561,7 @@
         this.formData.bizType = '2'; // 入库场景(销售入库)
         this.formData.type = '1'; // 出入库类型 2出库 1入库
         this.formData.extInfo.deptName = this.user.info.deptName; // 权属部门
-        this.formData.extInfo.deptCode = this.user.info.deptId[0]; // 权属部门id
+        this.formData.extInfo.deptCode = this.user.info.deptIds[0]; // 权属部门id
         this.formData.extInfo.createUserName = this.user.info.name; // 入库登记人
         this.formData.extInfo.supplierName = this.infoData.supplierName; // 供应商
         this.formData.extInfo.contentImage = []; // 内容图片地址URL
@@ -2883,7 +2883,7 @@
       //   const info = await getLoginUser();
       //   // const info = JSON.parse(localStorage.getItem('info'));
       //   let obj = res.find(
-      //     (item) => item.id === info.deptId[info.deptId.length - 1]
+      //     (item) => item.id === info.deptIds[info.deptIds.length - 1]
       //   );
       //   if (!obj) return;
       //   this.formData.extInfo.deptCode = obj.id;

+ 1 - 1
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/outboundToOutsourcing.vue

@@ -1326,7 +1326,7 @@
         });
         const info = await getLoginUser();
         let obj = res.find(
-          (item) => item.id === info.deptId[info.deptId.length - 1]
+          (item) => item.id === info.deptIds[info.deptIds.length - 1]
         );
         if (!obj) return;
         this.formData.extInfo.deptCode = obj.id;

+ 2 - 2
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/outerFillWeight.vue

@@ -1483,7 +1483,7 @@
         this.formData.bizType = '2'; // 入库场景(销售入库)
         this.formData.type = '1'; // 出入库类型 2出库 1入库
         this.formData.extInfo.deptName = this.user.info.deptName; // 权属部门
-        this.formData.extInfo.deptCode = this.user.info.deptId[0]; // 权属部门id
+        this.formData.extInfo.deptCode = this.user.info.deptIds[0]; // 权属部门id
         this.formData.extInfo.createUserName = this.user.info.name; // 入库登记人
         this.formData.extInfo.supplierName = this.infoData.supplierName; // 供应商
         this.formData.extInfo.contentImage = []; // 内容图片地址URL
@@ -2790,7 +2790,7 @@
       //   const info = await getLoginUser();
       //   // const info = JSON.parse(localStorage.getItem('info'));
       //   let obj = res.find(
-      //     (item) => item.id === info.deptId[info.deptId.length - 1]
+      //     (item) => item.id === info.deptIds[info.deptIds.length - 1]
       //   );
       //   if (!obj) return;
       //   this.formData.extInfo.deptCode = obj.id;

+ 1 - 1
src/views/bpm/handleTask/components/saleOrder/entrustedReceive/entrustedStorage.vue

@@ -1843,7 +1843,7 @@
         const res = await warehouseDefinition.tree();
         const info = await getLoginUser();
         let obj = res.find(
-          (item) => item.id === info.deptId[info.deptId.length - 1]
+          (item) => item.id === info.deptIds[info.deptIds.length - 1]
         );
         if (!obj) return;
         this.formData.extInfo.deptCode = obj.id;

+ 1 - 1
src/views/bpm/handleTask/components/saleOrder/entrustedReceive/outsourcingOutbound.vue

@@ -802,7 +802,7 @@
         });
         const info = await getLoginUser();
         let obj = res.find(
-          (item) => item.id === info.deptId[info.deptId.length - 1]
+          (item) => item.id === info.deptIds[info.deptIds.length - 1]
         );
         if (!obj) return;
         this.formData.extInfo.deptCode = obj.id;

+ 2 - 2
src/views/bpm/handleTask/components/saleOrder/entrustedReceive/procurementWarehousing.vue

@@ -1612,7 +1612,7 @@
         this.formData.bizType = '2'; // 入库场景(销售入库)
         this.formData.type = '1'; // 出入库类型 2出库 1入库
         this.formData.extInfo.deptName = this.user.info.deptName; // 权属部门
-        this.formData.extInfo.deptCode = this.user.info.deptId[0]; // 权属部门id
+        this.formData.extInfo.deptCode = this.user.info.deptIds[0]; // 权属部门id
         this.formData.extInfo.createUserName = this.user.info.name; // 入库登记人
         this.formData.extInfo.supplierName = this.infoData.supplierName; // 供应商
         this.formData.extInfo.contentImage = []; // 内容图片地址URL
@@ -2971,7 +2971,7 @@
       //   const info = await getLoginUser();
       //   // const info = JSON.parse(localStorage.getItem('info'));
       //   let obj = res.find(
-      //     (item) => item.id === info.deptId[info.deptId.length - 1]
+      //     (item) => item.id === info.deptIds[info.deptIds.length - 1]
       //   );
       //   if (!obj) return;
       //   this.formData.extInfo.deptCode = obj.id;

+ 1 - 1
src/views/bpm/handleTask/components/saleOrder/entrustedReceiveReturnGoods/consignmentReturnsOutbound.vue

@@ -804,7 +804,7 @@
         });
         const info = await getLoginUser();
         let obj = res.find(
-          (item) => item.id === info.deptId[info.deptId.length - 1]
+          (item) => item.id === info.deptIds[info.deptIds.length - 1]
         );
         if (!obj) return;
         this.formData.extInfo.deptCode = obj.id;

+ 1 - 1
src/views/bpm/handleTask/components/saleOrder/invoice/saleShipmentsOutbound.vue

@@ -1495,7 +1495,7 @@
         // const info = JSON.parse(localStorage.getItem('info'));
         const info = await getLoginUser();
         let obj = res.find(
-          (item) => item.id === info.deptId[info.deptId.length - 1]
+          (item) => item.id === info.deptIds[info.deptIds.length - 1]
         );
         // console.log('obj=====', obj);
         this.formData.extInfo.deptName = obj.name;

+ 1 - 1
src/views/bpm/handleTask/components/saleOrder/saleReturnGoods/salesReturnReceipt.vue

@@ -1842,7 +1842,7 @@
         const res = await warehouseDefinition.tree();
         const info = await getLoginUser();
         let obj = res.find(
-          (item) => item.id === info.deptId[info.deptId.length - 1]
+          (item) => item.id === info.deptIds[info.deptIds.length - 1]
         );
         if (!obj) return;
         this.formData.extInfo.deptCode = obj.id;

+ 1 - 1
src/views/bpm/handleTask/components/selectedCollectionOutbound/outsourcingOutbound.vue

@@ -962,7 +962,7 @@
         });
         const info = await getLoginUser();
         let obj = res.find(
-          (item) => item.id === info.deptId[info.deptId.length - 1]
+          (item) => item.id === info.deptIds[info.deptIds.length - 1]
         );
         if (!obj) return;
         this.formData.extInfo.deptCode = obj.id;

+ 1 - 1
src/views/bpm/outgoingManagement/add.vue

@@ -1458,7 +1458,7 @@
         // const info = JSON.parse(localStorage.getItem('info'));
         const info = await getLoginUser();
         let obj = res.find(
-          (item) => item.id === info.deptId[info.deptId.length - 1]
+          (item) => item.id === info.deptIds[info.deptIds.length - 1]
         );
         // console.log('obj=====', obj);
         this.formData.extInfo.deptName = obj.name;

+ 1 - 1
src/views/bpm/stockManagement/add.vue

@@ -2518,7 +2518,7 @@
         const info = await getLoginUser();
         // const info = JSON.parse(localStorage.getItem('info'));
         let obj = res.find(
-          (item) => item.id === info.deptId[info.deptId.length - 1]
+          (item) => item.id === info.deptIds[info.deptIds.length - 1]
         );
         if (!obj) return;
         this.formData.extInfo.deptCode = obj.id;