瀏覽代碼

新增划拨库存重量功能

xiaosh 9 月之前
父節點
當前提交
34802ad541
共有 1 個文件被更改,包括 338 次插入3 次删除
  1. 338 3
      src/views/OYE/components/oYeRealTimeInventory.vue

+ 338 - 3
src/views/OYE/components/oYeRealTimeInventory.vue

@@ -43,8 +43,14 @@
           type="primary"
           @click="addEditTime"
           v-privilege="activeMenu + 'addEditTime'"
-          >划分实时库存</el-button
-        >
+          >划分实时库存
+        </el-button>
+        <el-button
+          type="primary"
+          @click="addEditTimeWeight"
+          v-privilege="activeMenu + 'addEditTime'"
+          >划分库存重量
+        </el-button>
         <el-form-item></el-form-item>
       </el-form>
     </div>
@@ -213,6 +219,209 @@
         ></dilTable>
       </el-dialog>
     </div>
+    <!-- 划分吨位 -->
+    <div class="updateInsertForm">
+      <el-dialog :visible.sync="updateWeightVisible">
+        <div style="color: #000000;font-size: 24px;font-weight: 700;">
+          原有实时库存数据:
+        </div>
+        <el-form label-position="left">
+          <el-form-item prop="inventoryId">
+            <span style="color: #000000;font-size: 16px;font-weight: 500;"
+              >库存ID:</span
+            >
+            <span
+              style="color: hsl(184, 80%, 38%);font-size: 16px;font-weight: 500;"
+              >{{ selectedRowData.inventoryId }}</span
+            >
+          </el-form-item>
+          <el-form-item prop="consigneeName">
+            <span style="color: #000000;font-size: 16px;font-weight: 500;"
+              >客户:</span
+            >
+            <span style="color: #000000;font-size: 16px;font-weight: 500;">{{
+              selectedRowData.consigneeName
+            }}</span>
+          </el-form-item>
+          <el-form-item prop="saleArea">
+            <span style="color: #000000;font-size: 16px;font-weight: 500;"
+              >片区:</span
+            >
+            <span style="color: #000000;font-size: 16px;font-weight: 500;">{{
+              selectedRowData.saleArea
+            }}</span>
+          </el-form-item>
+          <el-form-item prop="inboundWarehouse">
+            <span style="color: #000000;font-size: 16px;font-weight: 500;"
+              >仓库:</span
+            >
+            <span style="color: #000000;font-size: 16px;font-weight: 500;">{{
+              selectedRowData.inboundWarehouse
+            }}</span>
+          </el-form-item>
+          <el-form-item prop="materialName">
+            <span style="color: #000000;font-size: 16px;font-weight: 500;"
+              >物资信息:</span
+            >
+            <span style="color: #000000;font-size: 16px;font-weight: 500;"
+              >{{ selectedRowData.materialName }}-{{
+                selectedRowData.materialSpe
+              }}-{{ selectedRowData.materialModel }};</span
+            ><span style="color:red;font-size: 16px;font-weight: 500;"
+              >物资单重为{{ selectedRowData.singleWeight }}t,{{
+                selectedRowData.materialNumber
+              }}件,理重为{{ selectedRowData.theoryWeight }}t,净重为{{
+                selectedRowData.netWeight
+              }}t</span
+            >
+          </el-form-item>
+        </el-form>
+        <div style="color: #000000;font-size: 24px;font-weight: 700;">
+          新增实时库存数据:
+        </div>
+        <el-form label-position="left">
+        <!-- 查询条件 -->
+          <el-form-item prop="qconsigneeName">
+            <span style="color: #000000;font-size: 16px;font-weight: 500;"
+              >客户</span
+            >
+            <el-input
+              v-model="queryWeightForm.consigneeName"
+              style="width: 250px;"
+            ></el-input>
+          </el-form-item>
+          <el-form-item prop="qsaleArea">
+            <span style="color: #000000;font-size: 16px;font-weight: 500;"
+              >片区</span
+            >
+            <el-input
+              v-model="queryWeightForm.saleArea"
+              style="width: 250px;"
+            ></el-input>
+          </el-form-item>
+          <el-form-item prop="qinboundWarehouse">
+            <span style="color: #000000;font-size: 16px;font-weight: 500;"
+              >仓库</span
+            >
+            <el-input
+              v-model="queryWeightForm.inboundWarehouse"
+              style="width: 250px;"
+            ></el-input>
+          </el-form-item>
+
+          <el-form-item>
+            <el-button type="primary" @click="browseWeight">浏览</el-button>
+          </el-form-item>
+        <!-- 查询条件end -->
+          <el-form-item prop="newInventoryId">
+            <span style="color: #000000;font-size: 16px;font-weight: 500;"
+              >库存ID:</span
+            >
+            <span
+              style="color: hsl(184, 80%, 38%);font-size: 16px;font-weight: 500;"
+              >{{ updateWeightForm.newInventoryId }}</span
+            >
+          </el-form-item>
+          <el-form-item prop="consigneeName">
+            <span style="color: #000000;font-size: 16px;font-weight: 500;"
+              >客户:</span
+            >
+            <span style="color: #000000;font-size: 16px;font-weight: 500;">{{
+              updateWeightForm.consigneeName
+            }}</span>
+          </el-form-item>
+          <el-form-item prop="saleArea">
+            <span style="color: #000000;font-size: 16px;font-weight: 500;"
+              >片区:</span
+            >
+            <el-input
+              v-model="updateWeightForm.saleArea"
+              @input="saleAreaChange"
+              style="width: 250px;"
+            ></el-input>
+          </el-form-item>
+          <el-form-item prop="inboundWarehouse">
+            <span style="color: #000000;font-size: 16px;font-weight: 500;"
+              >仓库:</span
+            >
+            <span style="color: #000000;font-size: 16px;font-weight: 500;">{{
+              updateWeightForm.inboundWarehouse
+            }}</span>
+          </el-form-item>
+          <el-form-item prop="materialName">
+            <span style="color: #000000;font-size: 16px;font-weight: 500;"
+              >物资信息:</span
+            >
+            <span style="color: #000000;font-size: 16px;font-weight: 500;"
+              >{{ selectedRowData.materialName }}-{{
+                selectedRowData.materialSpe
+              }}-{{ selectedRowData.materialModel }};</span
+            ><span style="color:#000000;font-size: 16px;font-weight: 500;"
+              >物资单重为{{ selectedRowData.singleWeight }}t</span
+            >
+          </el-form-item>
+          <el-form-item prop="materialWeight">
+            <span style="color: #000000;font-size: 16px;font-weight: 500;"
+              >当前重量:</span>
+              <span style="color:red;font-size: 16px;font-weight: 500;"
+              >{{
+                updateWeightForm.materialNumber
+              }}件,理重为{{ updateWeightForm.theoryWeight }}t,净重为{{
+                updateWeightForm.netWeight
+              }}t</span>
+          </el-form-item>
+          <el-form-item prop="materialNumberEdit">
+            <span style="color: #000000;font-size: 16px;font-weight: 500;"
+              >划拨件数:</span>
+            <el-input-number
+              v-model="updateWeightForm.materialNumberEdit"
+              style="width:250px"
+              :min="0" :max="100"
+            ></el-input-number>
+          </el-form-item>
+          <el-form-item prop="theoryWeightEdit">
+            <span style="color: #000000;font-size: 16px;font-weight: 500;"
+              >划拨理重:</span>
+            <el-input-number
+              v-model="updateWeightForm.theoryWeightEdit"
+              style="width:250px"
+              :precision="3" :step="0.001" :min="0" :max="1000"
+            ></el-input-number>
+          </el-form-item>
+          <el-form-item prop="netWeightEdit">
+            <span style="color: #000000;font-size: 16px;font-weight: 500;"
+              >划拨净重:</span>
+            <el-input-number
+              v-model="updateWeightForm.netWeightEdit"
+              style="width:250px"
+              :precision="3" :step="0.001" :min="0" :max="1000"
+            ></el-input-number>
+          </el-form-item>
+        </el-form>
+        <div style="display: flex;justify-content: center;align-items: center;">
+          <el-button
+            type="primary"
+            @click="makeSureMaterialWeight"
+            style="margin-right: 20px;"
+            >保存</el-button
+          >
+          <el-button @click="updateWeightVisible = false">取消</el-button>
+        </div>
+      </el-dialog>
+      <!-- 浏览框 -->
+      <el-dialog title="浏览" :visible.sync="browseVisibleWeight" width="80%">
+        <el-button type="primary" @click="sureMakeWeight">确定</el-button>
+        <dilTable
+          @func="func"
+          v-bind.sync="options2"
+          @radio-change="radioChange2"
+          :showIndex="false"
+          :row-style="{ height: '30px' }"
+          :cell-style="returnClassName"
+        ></dilTable>
+      </el-dialog>
+    </div>
+
     <div class="exportExcelBefore">
       <el-dialog title="下载点前Excel" :visible.sync="exportExcelBeforeVisible">
         <el-date-picker
@@ -307,12 +516,24 @@ export default {
       loginName: null,
       selectedRowData: {},
       selectedRowData1: {},
+      selectedRowData2: {},
       updateInsertVisible: false,
       updateInsertForm: {},
       showSummaryList: ['materialNumber', 'netWeight', 'theoryWeight'],
       tableData: [],
       tableTop: [],
-      browseVisible: false
+      browseVisible: false,
+      updateWeightVisible: false,
+      updateWeightForm: {
+        saleArea:''
+      },
+      queryWeightForm: {},
+      browseVisibleWeight: false,
+      options2: {
+        requestUrl: '',
+        requestQuery: {},
+        selectionType: 'radio'
+      },
     }
   },
   computed: {
@@ -344,6 +565,15 @@ export default {
         this.selectedRowData = {}
         this.updateInsertForm = {}
       }
+    },
+    updateWeightVisible(val) {
+      if (!val) {
+        this.selectedRowData = {}
+        this.updateWeightForm = {
+          saleArea:''
+        }
+        this.selectedRowData2 = {}
+      }
     }
   },
   created() {
@@ -386,6 +616,47 @@ export default {
       console.log(res, 'res')
       this.tableTop = res.columnData
     },
+    browseWeight() {
+      this.queryWeightForm.materialId = this.selectedRowData.materialId
+      this.queryWeightForm.materialName = this.selectedRowData.materialName
+      this.queryWeightForm.materialSpe = this.selectedRowData.materialSpe
+      this.queryWeightForm.materialModel = this.selectedRowData.materialModel
+      let map = JSON.parse(JSON.stringify(this.queryWeightForm))
+      console.log(map, 'res')
+      this.options2.requestUrl =
+        '/api/v1/wms/getOyeRealTimeResult?apiId=' +
+        this.apiId +
+        '&con=' +
+        this.con +
+        '&i=' +
+        new Date()
+      this.options2.requestQuery = map
+      this.browseVisibleWeight = true
+    },
+    sureMakeWeight() {
+      this.updateWeightForm.newInventoryId = this.selectedRowData2.inventoryId
+      this.updateWeightForm.consigneeId = this.selectedRowData2.consigneeId
+      this.updateWeightForm.consigneeName = this.selectedRowData2.consigneeName
+      this.updateWeightForm.inboundWarehouse = this.selectedRowData2.inboundWarehouse
+      this.updateWeightForm.saleArea = this.selectedRowData2.saleArea
+      this.updateWeightForm.materialId = this.selectedRowData2.materialId
+      this.updateWeightForm.materialName = this.selectedRowData2.materialName
+      this.updateWeightForm.materialSpe = this.selectedRowData2.materialSpe
+      this.updateWeightForm.materialModel = this.selectedRowData2.materialModel
+      this.updateWeightForm.singleWeight = this.selectedRowData2.singleWeight
+      this.updateWeightForm.meter = this.selectedRowData2.meter
+      this.updateWeightForm.materialNumber = this.selectedRowData2.materialNumber
+      this.updateWeightForm.theoryWeight = this.selectedRowData2.theoryWeight
+      this.updateWeightForm.netWeight = this.selectedRowData2.netWeight
+      this.browseVisibleWeight = false
+    },
+    saleAreaChange(){
+      if(this.updateWeightForm.saleArea != this.selectedRowData2.saleArea){
+        this.updateWeightForm.newInventoryId = '';
+      } else {
+        this.updateWeightForm.newInventoryId = this.selectedRowData2.inventoryId
+      }
+    },
     exportExcel() {
       //创建工作簿对象
       let wb = XLSX.utils.book_new()
@@ -448,12 +719,41 @@ export default {
       this.updateInsertForm.inboundArea = '欧冶库'
       this.updateInsertVisible = true
     },
+    addEditTimeWeight(){
+      if (Object.keys(this.selectedRowData).length == 0) {
+        this.$message({
+          type: 'error',
+          message: '请选择实时库存数据'
+        })
+        return
+      }
+      if(this.selectedRowData.materialName.indexOf('定尺') !== -1){
+        this.$message({
+          type: 'error',
+          message: '定尺类钢材无法划拨重量'
+        })
+        return
+      }
+      this.updateWeightForm.inventoryId = this.selectedRowData.inventoryId
+      this.updateWeightForm.inboundArea = '欧冶库'
+      this.updateWeightForm.oldConsigneeId = this.selectedRowData.consigneeId
+      this.updateWeightForm.oldConsigneeName = this.selectedRowData.consigneeName
+      this.updateWeightForm.oldInboundWarehouse = this.selectedRowData.inboundWarehouse
+      this.updateWeightForm.oldSaleArea = this.selectedRowData.saleArea
+      this.updateWeightForm.materialNumberEdit = 0
+      this.updateWeightForm.theoryWeightEdit = 0
+      this.updateWeightForm.netWeightEdit = 0
+      this.updateWeightVisible = true
+    },
     radioChange(row) {
       this.selectedRowData = row
     },
     radioChange1(row) {
       this.selectedRowData1 = row
     },
+    radioChange2(row) {
+      this.selectedRowData2 = row
+    },
     getInfo() {
       this.orgCode = getCookie('orgCode')
       if (this.orgCode == 'shouhuokehu' || this.orgCode == 'chengyunshang') {
@@ -512,6 +812,41 @@ export default {
             }
           })
       })
+    },
+    makeSureMaterialWeight() {
+      this.updateWeightForm.saleArea = this.updateWeightForm.saleArea.replace(
+        ',',
+        ','
+      )
+      this.updateWeightForm.userName = getCookie('loginName')
+      if(this.selectedRowData.materialId !== this.updateWeightForm.materialId){
+        this.$message({
+          type: 'error',
+          message: '必须选择同一物资才能进行重量划拨'
+        })
+        return
+      }
+      this.$confirm('确定保存吗?', '提示', {
+        type: 'warning'
+      }).then(() => {
+        this.axios
+          .post('/api/v1/wms/updateInsertRealTimeWeight', this.updateWeightForm)
+          .then(res => {
+            if (res.data.status == 'succeed') {
+              this.$message({
+                type: 'success',
+                message: '保存成功'
+              })
+              this.updateWeightVisible = false
+              this.getRequestUrl()
+            } else if (res.data.status == 'failed') {
+              this.$message({
+                type: 'error',
+                message: res.data.data
+              })
+            }
+          })
+      })
     }
   }
 }