瀏覽代碼

更新库外调拨流程

huang_an 1 年之前
父節點
當前提交
1c5f7bfaeb

+ 1 - 0
package.json

@@ -20,6 +20,7 @@
     "@bytemd/vue": "^1.17.2",
     "@riophae/vue-treeselect": "0.4.0",
     "axios": "^0.27.2",
+    "bignumber.js": "^9.1.2",
     "bpmn-js": "8.9.0",
     "bpmn-js-properties-panel": "0.46.0",
     "bpmn-js-token-simulation": "0.10.0",

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

@@ -185,5 +185,39 @@ export default {
       return res.data.data;
     }
     return Promise.reject(new Error(res.data.message));
+  },
+  // 库内调拨详情列表
+  getAllotDetailList: async (data) => {
+    const res = await request.get(`/wms/allotDetail/list`, {
+      params: data
+    });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 库内调拨详情
+  getAllotDetail: async (id) => {
+    const res = await request.get(`/wms/allotApply/getById/${id}`);
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 调拨出入库
+  allot: async (data) => {
+    const res = await request.post('/wms/outintwo/allot', data);
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  // 调拨驳回
+  notAllotPass: async (data) => {
+    const res = await request.post('/bpm/outinApprove/notAllotPass', data);
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
   }
 };

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

@@ -46,6 +46,7 @@ export const sceneState = [
   { code: 12, label: '委外入库(非采购)', documentsName: '委外申请单' },
   { code: 13, label: '受托入库', documentsName: '受托收货单' },
   { code: 14, label: '项目入库', documentsName: '项目编码' },
+  { code: 15, label: '调拨入库' },
   { code: 99, label: '其他入库' }
 ];
 export const outputSceneState = [

+ 253 - 0
src/views/bpm/handleTask/components/allocate/detailDialog.vue

@@ -0,0 +1,253 @@
+<template>
+  <div class="content-height p20">
+    <div>
+      <div class="content-detail mt40">
+        <div class="basic-details">
+          <HeaderTitle title="基本信息" size="16px"></HeaderTitle>
+        </div>
+        <div class="mt20">
+          <el-form label-width="110px">
+            <el-col :span="8">
+              <el-form-item label="调拨名称">
+                <span>{{ infoData.name }}</span>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="调拨单号">
+                <span>{{ infoData.id }}</span>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="创建人">
+                <span>{{ infoData.allotName }}</span>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="创建时间">
+                <span>{{ infoData.createTime }}</span>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="调拨类型">
+                <span>{{
+                  allocationType.filter((item) => item.code == infoData.type)[0]
+                    ?.label
+                }}</span>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="调出库">
+                <span>{{ infoData.sourceWarehouse }}</span>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="调入库">
+                <span>{{ infoData.targetWarehouse }}</span>
+              </el-form-item>
+            </el-col>
+          </el-form>
+        </div>
+      </div>
+      <div class="content-detail mt20">
+        <HeaderTitle title="调拨明细" size="16px"></HeaderTitle>
+        <div class="mt20">
+          <!-- <AssetsCell
+            v-for="(item, index) in detailList"
+            :key="index"
+            :item="item"
+            type="detail"
+          /> -->
+          <el-table
+            ref="table"
+            :data="detailList"
+            tooltip-effect="dark"
+            :max-height="500"
+            border
+          >
+            <el-table-column label="序号" type="index" width="50">
+            </el-table-column>
+            <el-table-column
+              label="物品编码"
+              prop="categoryCode"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="物品名称"
+              prop="categoryName"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="调出仓库"
+              prop="warehouseName"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="调出库区"
+              prop="areaName"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="调出货架"
+              prop="goodsShelfName"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="调出货位"
+              prop="goodsAllocationName"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="调入仓库"
+              prop="targetWarehouseName"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="调入库区"
+              prop="targetAreaName"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="调入货架"
+              prop="targetGoodsShelfName"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="调入货位"
+              prop="targetGoodsAllocationName"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="牌号"
+              prop="brandNum"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="型号"
+              prop="categoryModel"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="规格"
+              prop="specification"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="包装编码"
+              prop="packageNo"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="包装数量"
+              prop="packingQuantity"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="包装单位"
+              prop="packingUnit"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="计量数量"
+              prop="measureQuantity"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="计量单位"
+              prop="measureUnit"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
+            <el-table-column
+              label="重量"
+              prop="weight"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="重量单位"
+              prop="weightUnit"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+          </el-table>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+  import storageApi from '@/api/warehouseManagement/index.js';
+  import { allocationType } from '@/utils/dict/warehouse';
+
+  export default {
+    props: {
+      businessId: {
+        default: ''
+      },
+      taskDefinitionKey: {
+        default: ''
+      }
+    },
+    data() {
+      return {
+        allocationType,
+        detailList: [],
+        infoData: {}
+      };
+    },
+    created() {
+      console.log(this.taskDefinitionKey);
+      console.log(this.allocationType);
+      this._getDetail();
+    },
+    methods: {
+      async _getDetail() {
+        const res = await storageApi.getAllotDetailList({
+          applyId: this.businessId
+        });
+        const data = await storageApi.getAllotDetail(this.businessId);
+        this.infoData = data;
+        console.log('this.infoData-------', this.infoData);
+        // 库内调拨
+        this.detailList = res.map((item) => {
+          return {
+            ...item,
+            categoryCode: this.infoData.categoryCode,
+            categoryName: this.infoData.categoryName,
+            brandNum: this.infoData.brandNum,
+            categoryModel: this.infoData.model,
+            specification: this.infoData.specification
+          };
+        });
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .p20 {
+    padding: 20px;
+  }
+  .mt40 {
+    margin-top: 40px;
+  }
+
+  .mt20 {
+    margin-top: 20px;
+  }
+  .content-detail {
+    overflow: hidden;
+  }
+  .content-height {
+    height: auto;
+    background: #fff;
+  }
+</style>

+ 137 - 0
src/views/bpm/handleTask/components/allocate/submit.vue

@@ -0,0 +1,137 @@
+<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"
+        @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 {
+    data() {
+      return {
+        form: {}
+      };
+    },
+    props: {
+      businessId: {
+        default: ''
+      },
+      taskId: {
+        default: ''
+      },
+      id: {
+        default: ''
+      },
+      taskDefinitionKey: {
+        default: ''
+      }
+    },
+    methods: {
+      handleAudit(status) {
+        if (!this.form.reason && status == 1) {
+          this.$message.warning(`请填写审批意见!`);
+          return;
+        }
+
+        this._approveTaskWithVariables(status);
+      },
+      async _approveTaskWithVariables(status) {
+        console.log(status);
+        if (status == 1) {
+          if (this.taskDefinitionKey === 'storage') {
+            const res = await storageApi.allot({ applyId: this.businessId });
+            if (res.data.code != '-1') {
+              const params = {
+                id: this.taskId,
+                reason: this.form.reason,
+                variables: { pass: true }
+              };
+              const data = await approveTaskWithVariables(params);
+              if (data.data.code != '-1') {
+                this.$emit('handleAudit', {
+                  status,
+                  title: '通过'
+                });
+              }
+            }
+          } else {
+            const params = {
+              id: this.taskId,
+              reason: this.form.reason,
+              variables: { pass: true }
+            };
+            const data = await approveTaskWithVariables(params);
+            if (data.data.code != '-1') {
+              this.$emit('handleAudit', {
+                status,
+                title: '通过'
+              });
+            }
+          }
+        } else {
+          if (this.taskDefinitionKey === 'outbound') {
+            const data = await storageApi.notAllotPass({
+              id: this.businessId,
+              reason: this.form.reason,
+              taskId: this.taskId
+            });
+            if (data.data.code != '-1') {
+              this.$emit('handleAudit', {
+                status,
+                title: '驳回'
+              });
+            }
+          } else {
+            const params = {
+              id: this.taskId,
+              reason: this.form.reason,
+              variables: { pass: false }
+            };
+            const data = await approveTaskWithVariables(params);
+            if (data.data.code != '-1') {
+              this.$emit('handleAudit', {
+                status,
+                title: '驳回'
+              });
+            }
+          }
+        }
+      }
+    }
+  };
+</script>

+ 28 - 20
src/views/bpm/stockManagement/storage.vue

@@ -306,9 +306,11 @@
               >
                 <template slot-scope="{ row, $index }">
                   {{
-                    $math.format(
-                      row.minPackingQuantity * row.packingQuantity,
-                      14
+                    changeCount(
+                      $math.format(
+                        row.minPackingQuantity * row.packingQuantity,
+                        14
+                      )
                     )
                   }}
                 </template>
@@ -387,11 +389,13 @@
               >
                 <template slot-scope="{ row, $index }">
                   {{
-                    calcSumTotal(
-                      row.packingQuantity,
-                      row.minPackingQuantity,
-                      row.price,
-                      row
+                    changeCount(
+                      calcSumTotal(
+                        row.packingQuantity,
+                        row.minPackingQuantity,
+                        row.price,
+                        row
+                      )
                     )
                   }}
                 </template>
@@ -912,6 +916,7 @@
   import { sceneState } from '@/utils/dict/index';
   import { getTreeByGroup } from '@/api/classifyManage';
   import { deepClone } from '@/utils';
+  import BigNumber from 'bignumber.js';
   export default {
     components: {
       selectType,
@@ -1027,6 +1032,9 @@
       this.getNowFormatDate();
     },
     methods: {
+      changeCount(number) {
+        return new BigNumber(number).toString();
+      },
       selectSupplier(val, row) {
         row.supplierId = val;
         row.supplierName = row.supplierListOptions.filter(
@@ -1579,8 +1587,8 @@
         const decimalCount = (newValue.match(/\./g) || []).length; // 计算小数点的个数
         if (row.weight < 0) {
           row.weight = 0;
-        } else if (row.weight > 9999) {
-          row.weight = 9999;
+        } else if (row.weight > 999999) {
+          row.weight = 999999;
         } else {
           if (decimalCount > 1) {
             // 如果小数点个数大于1,移除多余的小数点
@@ -1625,8 +1633,8 @@
       minPackingQuantityChange(row, value, index) {
         console.log(value);
         if (row.measureUnit !== 'KG') {
-          if (value.replace(/^(0+)|[^\d]+/g, '') > 9999) {
-            this.$set(this.productList[index], 'minPackingQuantity', 9999);
+          if (value.replace(/^(0+)|[^\d]+/g, '') > 999999) {
+            this.$set(this.productList[index], 'minPackingQuantity', 999999);
           } else {
             this.$set(
               this.productList[index],
@@ -1637,8 +1645,8 @@
         } else {
           if (value < 1) {
             this.$set(this.productList[index], 'minPackingQuantity', 1);
-          } else if (value > 9999) {
-            this.$set(this.productList[index], 'minPackingQuantity', 9999);
+          } else if (value > 999999) {
+            this.$set(this.productList[index], 'minPackingQuantity', 999999);
           }
         }
         if (row.packingQuantity >= 0 && value >= 0) {
@@ -1650,15 +1658,15 @@
         const total = {
           minPackingQuantity: Number(
             row.minPackingQuantity > 0
-              ? row.minPackingQuantity > 9999
-                ? 9999
+              ? row.minPackingQuantity > 999999
+                ? 999999
                 : row.minPackingQuantity
               : 0
           ),
           packingQuantity: Number(
             row.packingQuantity > 0
-              ? row.packingQuantity > 9999
-                ? 9999
+              ? row.packingQuantity > 999999
+                ? 999999
                 : row.packingQuantity
               : 0
           )
@@ -1691,8 +1699,8 @@
         // 清空仓库
         this.$set(this.productList[index], 'warehouseId', '');
         this.$set(this.productList[index], 'warehouseName', '');
-        if (value.replace(/^(0+)|[^\d]+/g, '') > 9999) {
-          this.$set(this.productList[index], 'packingQuantity', 9999);
+        if (value.replace(/^(0+)|[^\d]+/g, '') > 999999) {
+          this.$set(this.productList[index], 'packingQuantity', 999999);
         } else {
           this.$set(
             this.productList[index],