Redeem 1 年之前
父节点
当前提交
b7ebc4796a
共有 2 个文件被更改,包括 100 次插入29 次删除
  1. 83 13
      src/views/OYE/components/oYeRealTimeInventory.vue
  2. 17 16
      src/views/OYE/components/oYeTransResult.vue

+ 83 - 13
src/views/OYE/components/oYeRealTimeInventory.vue

@@ -88,6 +88,15 @@
               selectedRowData.inboundWarehouse
             }}</span>
           </el-form-item>
+          <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="materialName">
             <span style="color: #000000;font-size: 16px;font-weight: 500;"
               >物资信息</span
@@ -109,6 +118,18 @@
           新增实时库存数据:
         </div>
         <el-form label-position="left">
+          <el-form-item>
+            <el-button type="primary" @click="browse">浏览</el-button>
+          </el-form-item>
+          <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;"
+              >{{ updateInsertForm.newInventoryId }}</span
+            >
+          </el-form-item>
           <el-form-item prop="consigneeName">
             <span style="color: #000000;font-size: 16px;font-weight: 500;"
               >客户</span
@@ -126,6 +147,7 @@
               style="width: 250px;"
             ></el-input>
           </el-form-item>
+
           <el-form-item prop="inboundWarehouse">
             <span style="color: #000000;font-size: 16px;font-weight: 500;"
               >仓库</span
@@ -177,6 +199,17 @@
           <el-button @click="updateInsertVisible = false">取消</el-button>
         </div>
       </el-dialog>
+      <el-dialog title="浏览" :visible.sync="browseVisible" width="80%">
+        <el-button type="primary" @click="sureMake">确定</el-button>
+        <dilTable
+          @func="func"
+          v-bind.sync="options1"
+          @radio-change="radioChange1"
+          :showIndex="false"
+          :row-style="{ height: '30px' }"
+          :cell-style="returnClassName"
+        ></dilTable>
+      </el-dialog>
     </div>
   </div>
 </template>
@@ -212,6 +245,11 @@ export default {
         requestQuery: {},
         selectionType: 'radio'
       },
+      options1: {
+        requestUrl: '',
+        requestQuery: {},
+        selectionType: 'radio'
+      },
       selectOptions: [
         {
           value: 'consigneeName',
@@ -248,11 +286,13 @@ export default {
       orgCode: null,
       loginName: null,
       selectedRowData: {},
+      selectedRowData1: {},
       updateInsertVisible: false,
       updateInsertForm: {},
       showSummaryList: ['materialNumber', 'netWeight', 'theoryWeight'],
       tableData: [],
-      tableTop: []
+      tableTop: [],
+      browseVisible: false
     }
   },
   computed: {
@@ -262,17 +302,28 @@ export default {
   },
   watch: {
     materialNumber(val) {
-      this.updateInsertForm.theoryWeight = accMul(
-        val,
-        this.updateInsertForm.singleWeight
-      )
-      this.updateInsertForm.netWeight = accMul(
-        accDiv(
-          this.selectedRowData.netWeight,
-          this.selectedRowData.materialNumber
-        ),
-        val
-      )
+      if (val == this.selectedRowData.materialNumber) {
+        this.updateInsertForm.theoryWeight = this.selectedRowData.theoryWeight
+        this.updateInsertForm.netWeight = this.selectedRowData.netWeight
+      } else {
+        this.updateInsertForm.theoryWeight = accMul(
+          val,
+          this.updateInsertForm.singleWeight
+        )
+        this.updateInsertForm.netWeight = accMul(
+          accDiv(
+            this.selectedRowData.netWeight,
+            this.selectedRowData.materialNumber
+          ),
+          val
+        )
+      }
+    },
+    updateInsertVisible(val) {
+      if (!val) {
+        this.selectedRowData = {}
+        this.updateInsertForm = {}
+      }
     }
   },
   created() {
@@ -280,6 +331,23 @@ export default {
     this.getRequestUrl()
   },
   methods: {
+    sureMake() {
+      this.updateInsertForm.newInventoryId = this.selectedRowData1.inventoryId
+      this.updateInsertForm.saleArea = this.selectedRowData1.saleArea
+      this.browseVisible = false
+    },
+    browse() {
+      let map = JSON.parse(JSON.stringify(this.selectedRowData))
+      this.options1.requestUrl =
+        '/api/v1/wms/getOyeRealTimeResult?apiId=' +
+        this.apiId +
+        '&con=' +
+        this.con +
+        '&i=' +
+        new Date()
+      this.options1.requestQuery = map
+      this.browseVisible = true
+    },
     func(res) {
       console.log(res, 'res')
       this.tableTop = res.columnData
@@ -349,6 +417,9 @@ export default {
     radioChange(row) {
       this.selectedRowData = row
     },
+    radioChange1(row) {
+      this.selectedRowData1 = row
+    },
     getInfo() {
       this.orgCode = getCookie('orgCode')
       if (this.orgCode == 'shouhuokehu' || this.orgCode == 'chengyunshang') {
@@ -390,7 +461,6 @@ export default {
         ',',
         ','
       )
-      console.log(this.updateInsertForm, 'this.updateInsertForm')
       this.$confirm('确定保存吗?', '提示', {
         type: 'warning'
       }).then(() => {

+ 17 - 16
src/views/OYE/components/oYeTransResult.vue

@@ -56,18 +56,18 @@
           </el-select>
           <el-date-picker
             v-model="startTime"
-            type="date"
+            type="datetime"
             placeholder="选择日期"
-            style="width:140px"
+            style="width:200px"
             :picker-options="pickerOptions"
           >
           </el-date-picker>
           <span>至</span>
           <el-date-picker
             v-model="endTime"
-            type="date"
+            type="datetime"
             placeholder="选择日期"
-            style="width:140px"
+            style="width:200px"
             :picker-options="pickerOptions1"
           >
           </el-date-picker>
@@ -1584,7 +1584,7 @@
 
 <script>
 import { sjTime, isVehicleNumber } from '@/utils/sharedJsFile'
-import { getCookie, accMul } from '@/utils/util.js'
+import { getCookie, accMul, formatDate } from '@/utils/util.js'
 import PathView from './mapTest.vue'
 import currentLocation from './currentLocation.vue'
 import { downloadFile, creatImageFile } from '@/utils/base64ToBlob.js'
@@ -1596,16 +1596,17 @@ export default {
   data() {
     const generateStartDate = _ => {
       let startDate = new Date()
-      console.log(startDate, 'generateStartDate')
-      if (
-        new Date(startDate.getTime() - 86400000).getMonth() ===
-          new Date(startDate.getTime() - 8 * 60 * 60 * 1000).getMonth() &&
-        new Date(startDate.getTime() - 86400000).getDate() ===
-          new Date(startDate.getTime() - 8 * 60 * 60 * 1000).getDate()
-      ) {
-        startDate = new Date(startDate.getTime() - 86400000)
-      }
-      return startDate
+      let startDateStr = formatDate(startDate, 'yyyy-MM-dd')
+      let startTimeStr = startDateStr + ' 00:00:00'
+      let startTime = new Date(startTimeStr)
+      return startTime.getTime()
+    }
+    const generateEndDate = _ => {
+      let endDate = new Date()
+      let endDateStr = formatDate(endDate, 'yyyy-MM-dd')
+      let endTimeStr = endDateStr + ' 23:59:59'
+      let endTime = new Date(endTimeStr)
+      return endTime.getTime()
     }
     return {
       dateType: '1',
@@ -1769,7 +1770,7 @@ export default {
         ]
       },
       startTime: generateStartDate(),
-      endTime: generateStartDate(),
+      endTime: generateEndDate(),
       //合计净重
       totalNumber: 0,
       //合计车数