فهرست منبع

报损报溢流程

huang_an 1 سال پیش
والد
کامیت
94b43a0ef3

+ 27 - 0
src/api/warehouseManagement/index.js

@@ -219,5 +219,32 @@ export default {
       return res.data;
     }
     return Promise.reject(new Error(res.data.message));
+  },
+  // 获取临时盘点计划详情
+  getReportPlanDetailById: async (id) => {
+    const res = await request.get('/wms/planProfitLoss/getById/' + id);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 报损报溢驳回
+  notProfitLoss: async (data) => {
+    const res = await request.post('/bpm/outinApprove/notProfitLoss', data);
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 报损报溢通过
+  addSubtractStockPacking: async (data) => {
+    const res = await request.post(
+      '/wms/stockpackingtwo/addSubtractStockPacking',
+      data
+    );
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
   }
 };

+ 269 - 0
src/views/bpm/handleTask/components/lossOverflowReport/detailDialog.vue

@@ -0,0 +1,269 @@
+<template>
+  <div>
+    <HeaderTitle title="基本信息" size="16px"></HeaderTitle>
+    <el-form
+      :model="addForm"
+      class="add_form"
+      ref="addFormRef"
+      label-width="110px"
+    >
+      <el-row :gutter="20">
+        <el-col :span="6">
+          <el-form-item label="编码" prop="code">
+            <span>{{ addForm.code }}</span>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="名称" prop="name">
+            <span>{{ addForm.executorName }}</span>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="报损报溢部门" prop="executeGroupId">
+            <span>{{ addForm.executeGroupName }}</span>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="报损报溢人" prop="executorId">
+            <span>{{ addForm.executorName }}</span>
+          </el-form-item>
+        </el-col>
+        <el-col :span="24">
+          <el-form-item label="备注" prop="remark">
+            <span>{{ addForm.remark }}</span>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <HeaderTitle title="报损报溢工单物品信息" size="16px"> </HeaderTitle>
+      <el-table
+        ref="table"
+        :data="productList"
+        :max-height="500"
+        row-key="id"
+        tooltip-effect="dark"
+        border
+      >
+        <el-table-column width="55px" label="序号" type="index">
+        </el-table-column>
+        <el-table-column
+          prop="code"
+          label="盘点单号"
+          :show-overflow-tooltip="true"
+        ></el-table-column>
+        <el-table-column
+          prop="planName"
+          label="计划名称"
+          :show-overflow-tooltip="true"
+        ></el-table-column>
+        <el-table-column label="产品分类" width="180">
+          <template slot-scope="scope">
+            <el-popover trigger="hover" placement="right">
+              <el-table
+                :data="scope.row.planDetailVOList"
+                :max-height="500"
+                border
+              >
+                <el-table-column label="序号" type="index" width="50">
+                </el-table-column>
+                <el-table-column
+                  label="状态"
+                  prop="status"
+                  :show-overflow-tooltip="true"
+                >
+                  <template slot-scope="{ row }">
+                    {{
+                      row.status > 0
+                        ? statusOption.filter(
+                            (item) => item.value == row.status
+                          )[0].label
+                        : ''
+                    }}
+                  </template>
+                </el-table-column>
+                <el-table-column label="数量" :show-overflow-tooltip="true">
+                  <template slot-scope="{ row }">
+                    {{
+                      row.status > 0
+                        ? row[
+                            statusOption.filter(
+                              (item) => item.value == row.status
+                            )[0].numKey
+                          ]
+                        : 0
+                    }}
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  width="150"
+                  label="物品名称"
+                  prop="categoryName"
+                  :show-overflow-tooltip="true"
+                ></el-table-column>
+                <el-table-column
+                  label="批次号"
+                  prop="batchNo"
+                  :show-overflow-tooltip="true"
+                ></el-table-column>
+                <el-table-column
+                  width="150"
+                  label="包装编码"
+                  prop="packageNo"
+                  :show-overflow-tooltip="true"
+                ></el-table-column>
+                <el-table-column
+                  label="包装数量"
+                  prop="info.packingCountBase"
+                  :show-overflow-tooltip="true"
+                ></el-table-column>
+                <el-table-column
+                  label="包装单位"
+                  prop="info.packingUnit"
+                  :show-overflow-tooltip="true"
+                ></el-table-column>
+                <el-table-column
+                  label="重量"
+                  prop="info.weight"
+                  :show-overflow-tooltip="true"
+                >
+                </el-table-column>
+                <el-table-column
+                  label="重量单位"
+                  prop="info.weightUnit"
+                  :show-overflow-tooltip="true"
+                >
+                </el-table-column>
+                <el-table-column
+                  width="200"
+                  label="仓库"
+                  prop="info.warehouseName"
+                  :show-overflow-tooltip="true"
+                ></el-table-column>
+              </el-table>
+              <div slot="reference" class="name-wrapper">
+                <el-tag size="medium">{{ scope.row.categoryLevelId }}</el-tag>
+              </div>
+            </el-popover>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="warehouseName"
+          label="盘点仓库"
+          :show-overflow-tooltip="true"
+        ></el-table-column>
+        <el-table-column
+          prop="executeGroupName"
+          label="盘点部门"
+          :show-overflow-tooltip="true"
+        ></el-table-column>
+        <el-table-column
+          prop="executorName"
+          label="盘点人员"
+          :show-overflow-tooltip="true"
+        ></el-table-column>
+        <el-table-column
+          prop="surplusQuantity"
+          label="盘盈数量"
+          :show-overflow-tooltip="true"
+        ></el-table-column>
+        <el-table-column
+          prop="wornQuantity"
+          label="盘亏数量"
+          :show-overflow-tooltip="true"
+        ></el-table-column>
+        <el-table-column
+          prop="loseQuantity"
+          label="破损数量"
+          :show-overflow-tooltip="true"
+        ></el-table-column>
+        <el-table-column
+          prop="createTime"
+          label="盘点审核时间"
+          :show-overflow-tooltip="true"
+        ></el-table-column>
+      </el-table>
+    </el-form>
+  </div>
+</template>
+
+<script>
+  import storageApi from '@/api/warehouseManagement/index.js';
+  export default {
+    props: {
+      businessId: {
+        default: ''
+      },
+      taskId: {
+        default: ''
+      },
+      taskDefinitionKey: {
+        default: ''
+      }
+    },
+    data() {
+      return {
+        statusOption: [
+          {
+            label: '盘盈',
+            value: '2',
+            numKey: 'surplusQuantity'
+          },
+          {
+            label: '丢失',
+            value: '3',
+            numKey: 'loseQuantity'
+          },
+          {
+            label: '破损',
+            value: '4',
+            numKey: 'wornQuantity'
+          }
+        ],
+        addForm: {
+          name: '', // 规则名称
+          code: '', // 计划配置单号
+          name: '', // 计划配置名称
+          executeGroupId: '', // 执行部门code
+          executeGroupName: '', // 执行部门name
+          executorId: '', // 执行人id
+          executorName: '', // 执行人name
+          warehouseId: '', // 盘点仓库Id
+          remark: '', // 备注
+          approvalUserId: '', // 审核人Id
+          approvalUserName: '' // 审核人name
+        },
+        productList: []
+      };
+    },
+    created() {
+      storageApi.getReportPlanDetailById(this.businessId).then(async (res) => {
+        this.addForm = res;
+        this.productList = res.info;
+      });
+    },
+    computed: {
+      clientEnvironmentId() {
+        return this.$store.state.user.info.clientEnvironmentId;
+      }
+    },
+    methods: {
+      async getTableValue() {
+        return this.addForm;
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  ::v-deep .el-row {
+    display: flex;
+    flex-wrap: wrap;
+  }
+  .add_form {
+    ::v-deep .el-form-item {
+      margin-bottom: 20px !important;
+    }
+  }
+  .table_search {
+    margin-bottom: 5px;
+  }
+</style>

+ 158 - 0
src/views/bpm/handleTask/components/lossOverflowReport/submit.vue

@@ -0,0 +1,158 @@
+<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: 'blur'
+        }"
+      >
+        <el-input
+          type="textarea"
+          v-model="form.reason"
+          placeholder="请输入审批建议"
+        />
+      </el-form-item>
+    </el-form>
+    <div style="margin-left: 10%; margin-bottom: 20px; font-size: 14px">
+      <el-button
+        icon="el-icon-edit-outline"
+        type="success"
+        size="mini"
+        @click="handleAudit(1)"
+        >通过
+      </el-button>
+      <el-button
+        icon="el-icon-circle-close"
+        type="danger"
+        size="mini"
+        @click="handleAudit(0)"
+        >驳回
+      </el-button>
+    </div>
+  </el-col>
+</template>
+
+<script>
+  import { approveTaskWithVariables } from '@/api/bpm/task';
+  import storageApi from '@/api/warehouseManagement';
+  // 流程实例的详情页,可用于审批
+  export default {
+    name: '',
+    props: {
+      businessId: {
+        default: ''
+      },
+      taskId: {
+        default: ''
+      },
+      id: {
+        default: ''
+      },
+      taskDefinitionKey: {
+        default: ''
+      }
+    },
+    data() {
+      return {
+        statusOption: [
+          {
+            label: '盘盈',
+            value: '2',
+            numKey: 'surplusQuantity'
+          },
+          {
+            label: '丢失',
+            value: '3',
+            numKey: 'loseQuantity'
+          },
+          {
+            label: '破损',
+            value: '4',
+            numKey: 'wornQuantity'
+          }
+        ],
+        form: {
+          reason: ''
+        },
+        userOptions: []
+      };
+    },
+    methods: {
+      async handleAudit(status) {
+        await this._approveTaskWithVariables(status);
+      },
+      getTableValue() {
+        return new Promise((resolve) => {
+          this.$emit('getTableValue', async (data) => {
+            resolve(await data);
+          });
+        });
+      },
+      async _approveTaskWithVariables(status) {
+        if (this.taskDefinitionKey == 'Activity_1l4tn01') {
+          // 驳回(主管审核)
+          if (!status) {
+            const data = await storageApi.notProfitLoss({
+              id: this.businessId,
+              reason: this.form.reason,
+              taskId: this.taskId
+            });
+            if (data.data.code != '-1') {
+              this.$emit('handleAudit', {
+                status,
+                title: '驳回'
+              });
+            }
+            return;
+          }
+        } else if (this.taskDefinitionKey == 'Activity_1ftg2hu') {
+          // 通过(仓管审核)
+          if (!!status) {
+            console.log('通过了!!!!');
+            let infoData = await this.getTableValue();
+            let params = infoData.info[0].planDetailVOList.map((item) => {
+              let filterArr = this.statusOption.filter(
+                (ite) => ite.value == item.status
+              )[0];
+              console.log(filterArr.numKey);
+              return {
+                id: this.businessId,
+                isAdd: filterArr.numKey == 'surplusQuantity' ? true : false,
+                packingNo: item.packageNo,
+                quantity: item[filterArr.numKey]
+              };
+            });
+            try {
+              await storageApi.addSubtractStockPacking(params);
+            } catch (error) {
+              this.$message.error('保存失败');
+              return;
+            }
+          }
+        }
+        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 ? '驳回' : ''
+            });
+          }
+        });
+      }
+    }
+  };
+</script>
+
+<style lang="scss"></style>