zhongtianhaoyuan 3 years ago
parent
commit
1713336a43

+ 5 - 5
src/layout/index/top/index.vue

@@ -626,7 +626,7 @@
         console.log('当前已失去焦点状态')
         this.isOpenCodeGun = false
       },
-      goToPage(type) {debugger
+      goToPage(type) {
         var _saomadata = {}
         _saomadata.cangid = this.cangid
         _saomadata.id = this.toPageData.qualityInspectionManagement.id
@@ -638,13 +638,13 @@
            _saomadata.type = 1
            localStorage.setItem('saoma_data',JSON.stringify(_saomadata))
           this.$router.push({
-          	name: 'inspectionManagementNew'
+          	name: 'inspectionManagementNew',query: {  id:this.index++ }
           })
         } else if (type === 2) {
            _saomadata.type = 2
            localStorage.setItem('saoma_data',JSON.stringify(_saomadata))
             this.$router.push({
-          	name: 'inspectionManagementNew'
+          	name: 'inspectionManagementNew',query: {  id:this.index++ }
           })
         } else if (type === 3) {
            _saomadata.type = 3
@@ -652,7 +652,7 @@
           //   this.$router.push({
           // 	name: 'inspectionManagementNew'
           // })
-          this.$router.push({ path: 'inspectionManagement',query: {  id:this.index++ }})
+          this.$router.push({ name: 'inspectionManagementNew',query: {  id:this.index++ }})
         } else if (type === 4) {
            _saomadata.typeNo = 1
            _saomadata.monitorUrl1 = this.toPageData.warehouseBaseInfo.monitorUrl1
@@ -660,7 +660,7 @@
            _saomadata.allowEdit = this.toPageData.warehouseBaseInfo.allowEdit
             localStorage.setItem('saoma_data',JSON.stringify(_saomadata))
              this.$router.push({
-            name: 'newWeighingManagement'
+            name: 'newWeighingManagement',query: {  id:this.index++ }
           })
         } else if (type === 5) {
              localStorage.setItem('paymentManagementReturn', false)

+ 69 - 1
src/views/houseSelfCollect/newWeighingManagement.vue

@@ -291,6 +291,74 @@
       BalanceAlert,
     },
     watch: {
+       '$route' (to, from) {
+         this.isShowBalance = true
+      var _saomaData = JSON.parse(localStorage.getItem('saoma_data')) //判断是否扫码进来的
+      // }
+      //仓库
+      selectWarehouseSelf({
+          compId: localStorage.getItem('ws-pf_compId'),
+        })
+        .toPromise()
+        .then((response) => {
+          this.warehouseList = response
+          if (_saomaData) { //缓存中有值,证明扫码进来的
+            this.warehouseName = _saomaData.warehouseName
+            this.cangid = _saomaData.cangid
+            this.monitorUrl1 = _saomaData.monitorUrl1
+            this.monitorUrl2 = _saomaData.monitorUrl2
+            this.allowEdit = _saomaData.allowEdit
+            this.id = _saomaData.id
+            this.tpyeNo = _saomaData.typeNo
+            if(_saomaData.managementType){
+                this.inWarehouseType = _saomaData.managementType
+            }
+            
+            localStorage.removeItem('saoma_data'); //第一次进来结束后清除缓存
+          } else if (localStorage.getItem('houseSelfCollect_house1')) {
+            this.warehouseName = JSON.parse(localStorage.getItem('houseSelfCollect_house1')).value
+            for (var i = 0; i < response.length; i++) {
+              if (this.warehouseName == this.warehouseList[i].warehouseName) {
+                this.cangid = this.warehouseList[i].id
+                this.monitorUrl1 = this.warehouseList[i].monitorUrl1
+                this.monitorUrl2 = this.warehouseList[i].monitorUrl2
+                this.allowEdit = this.warehouseList[i].allowEdit
+                break
+              }
+            }
+          } else {
+            localStorage.setItem('houseSelfCollect_house1', JSON.stringify({
+              value: this.warehouseList[0].warehouseName,
+              warehouseId: this.warehouseList[0].id,
+              count: this.warehouseList[0].count,
+              No: this.warehouseList[0].commonWarehouseNo,
+              allowEdit: this.warehouseList[0].allowEdit,
+              compId: localStorage.getItem('ws-pf_compId')
+            }))
+            this.warehouseName = this.warehouseList[0].warehouseName
+            localStorage.setItem('ck', this.warehouseName)
+            this.cangid = this.warehouseList[0].id
+            this.allowEdit = this.warehouseList[0].allowEdit
+            this.monitorUrl1 = this.warehouseList[0].monitorUrl1
+            this.monitorUrl2 = this.warehouseList[0].monitorUrl2
+          }
+
+          this.deptBudgetList.warehouseName = this.warehouseName
+          if (this.allowEdit == 0) {
+            this.disabled = true
+          } else if (this.allowEdit == 1) {
+            this.disabled = false
+          }
+          if (this.tpyeNo == 1) {
+            this.information = '毛重'
+            this.weighingList.tare = 0
+          } else if (this.tpyeNo == 2) {
+            this.information = '皮重'
+          }
+          this.getList()
+        })
+
+      },
       weighingList: {
         //深度监听,可监听到对象、数组的变化
         handler(val, oldVal) {
@@ -307,7 +375,7 @@
           }
         },
         deep: true, //true 深度监听
-      },
+      }
     },
     data() {
       return {

+ 3 - 3
src/views/outboundManagement/weighingManagementNew.vue

@@ -936,7 +936,7 @@
               this.weighingList.skinInspector =
                 localStorage.getItem('ws-pf_staffName')
               if (this.weighingList.id) { 
-                var weighingList1 =  JSON.parse(JSON.stringify(this.weighingList))
+                var weighingList1 =  JSON.parse(JSON.stringify(this.weighingList))//为了解除双向绑定问题,不影响this.weighingList的数据
                 weighingList1.id = this.weighingList.warehouseInOutId
                 weighingList1.warehouseInOutDetail.id = this.weighingList.inOutDetailId 
                 addstorageputList(weighingList1)
@@ -1001,7 +1001,7 @@
                 this.weighingList.relationId = this.relationId
                 this.weighingList.warehouseId = this.warehouseId
                 this.weighingList.baseId = this.warehouseId
-                var weighingList1 =  JSON.parse(JSON.stringify(this.weighingList))
+                var weighingList1 =  JSON.parse(JSON.stringify(this.weighingList))//为了解除双向绑定问题,不影响this.weighingList的数据
                 weighingList1.id = this.weighingList.warehouseInOutId
                  weighingList1.warehouseInOutDetail.id = this.weighingList.inOutDetailId 
                 addstorageputList(weighingList1)
@@ -1105,7 +1105,7 @@
                 localStorage.getItem('ws-pf_staffName')
               this.weighingList.warehouseId = this.warehouseId
               this.weighingList.baseId = this.warehouseId
-              var weighingList1 =  JSON.parse(JSON.stringify(this.weighingList))
+              var weighingList1 =  JSON.parse(JSON.stringify(this.weighingList))//为了解除双向绑定问题,不影响this.weighingList的数据
               weighingList1.id = this.weighingList.warehouseInOutId
               weighingList1.warehouseInOutDetail.id = this.weighingList.inOutDetailId 
               addstorageputList(weighingList1)