gjy 3 years ago
parent
commit
610c0fbd52

+ 1 - 1
src/views/warehouse/warehouselocation.vue

@@ -483,7 +483,7 @@ this.cangid=this.$route.query.cangId
     selectWarehouse(){
     selectWarehouse(){
        getwarehousebase({
        getwarehousebase({
         compId: sessionStorage.getItem('ws-pf_compId'),
         compId: sessionStorage.getItem('ws-pf_compId'),
-        warehouseType:1
+        warehouseType:''
       })
       })
         .toPromise()
         .toPromise()
         .then((response) => {
         .then((response) => {

+ 22 - 36
src/views/warehouse/weightedsubsidiary.vue

@@ -119,6 +119,9 @@
         <el-table-column prop="costBefore" label="入库前加权成本" >
         <el-table-column prop="costBefore" label="入库前加权成本" >
         </el-table-column>
         </el-table-column>
         <el-table-column prop="costAfter" label="入库后加权成本" >
         <el-table-column prop="costAfter" label="入库后加权成本" >
+          <template slot-scope="scope">
+            <div>{{scope.row.costAfter}}<span v-if='scope.row.grainType'>(改)</span></div>
+          </template>
         </el-table-column>
         </el-table-column>
         <el-table-column  prop="createDate" label="更新日期">
         <el-table-column  prop="createDate" label="更新日期">
         </el-table-column>
         </el-table-column>
@@ -320,7 +323,7 @@ export default {
     selectWarehouse(){
     selectWarehouse(){
        getwarehousebase({
        getwarehousebase({
         compId: sessionStorage.getItem('ws-pf_compId'),
         compId: sessionStorage.getItem('ws-pf_compId'),
-        warehouseType:1,
+        warehouseType:'',
       })
       })
         .toPromise()
         .toPromise()
         .then((response) => {
         .then((response) => {
@@ -331,7 +334,7 @@ export default {
               id: response[i].id,
               id: response[i].id,
               count: response[i].count,
               count: response[i].count,
               purchasePriceList: response[i].purchasePriceList,
               purchasePriceList: response[i].purchasePriceList,
-              No:response[i].commonWarehouseNo,
+              No:response[i].commonWarehouseNo, 
               goodsNameInfos:response[i].goodsNameInfos
               goodsNameInfos:response[i].goodsNameInfos
             })
             })
             if (this.cangid&&this.cangid == response[i].id) {
             if (this.cangid&&this.cangid == response[i].id) {
@@ -340,10 +343,15 @@ export default {
               this.warehouseNo =  response[i].commonWarehouseNo
               this.warehouseNo =  response[i].commonWarehouseNo
               this.purchasePriceList =  response[i].purchasePriceList
               this.purchasePriceList =  response[i].purchasePriceList
               this.goodnameList=response[i].goodsNameInfos
               this.goodnameList=response[i].goodsNameInfos
-              if(this.goodnameList){
-              this.goodsName=this.goodnameList[0].goodsName
-              this.goodsNameKey=this.goodnameList[0].goodsNameKey
-            }
+              if(this.goodnameList.length>0){
+                if(this.goodnameList.some( function( item, index, array ){ return item.goodsName == '玉米'})){
+                  this.goodsName='玉米'
+                  this.goodsNameKey=1
+                }else{
+                  this.goodsName=this.goodnameList[0].goodsName
+                  this.goodsNameKey=this.goodnameList[0].goodsNameKey
+                }
+              }
             } 
             } 
           }
           }
           if(this.warehouseList1.length > 0 && !this.cangid){
           if(this.warehouseList1.length > 0 && !this.cangid){
@@ -354,40 +362,18 @@ export default {
             this.purchasePriceList =  this.warehouseList1[0].purchasePriceList
             this.purchasePriceList =  this.warehouseList1[0].purchasePriceList
             this.WAREHOUSE[1].payname = this.warehouseList1[0].value
             this.WAREHOUSE[1].payname = this.warehouseList1[0].value
             this.goodnameList=this.warehouseList1[0].goodsNameInfos
             this.goodnameList=this.warehouseList1[0].goodsNameInfos
-            if(this.goodnameList){
-              this.goodsName=this.goodnameList[0].goodsName
-              this.goodsNameKey=this.goodnameList[0].goodsNameKey
+            if(this.goodnameList.length>0){
+              if(this.goodnameList.some( function( item, index, array ){ return item.goodsName == '玉米'})){
+                  this.goodsName='玉米'
+                  this.goodsNameKey=1
+                }else{
+                  this.goodsName=this.goodnameList[0].goodsName
+                  this.goodsNameKey=this.goodnameList[0].goodsNameKey
+                }
             }
             }
           }
           }
           this.getList()
           this.getList()
         })
         })
-        getwarehousebase({
-        compId: sessionStorage.getItem('ws-pf_compId'),
-        warehouseType:2
-      })
-        .toPromise()
-        .then((response) => {
-          for (let i = 0; i < response.length; i++) {
-            this.warehouseList1.push({
-              value: response[i].warehouseName,
-              id: response[i].id,
-              count: response[i].count,
-              purchasePriceList: response[i].purchasePriceList,
-              No:response[i].commonWarehouseNo
-            })
-            if (this.cangid&&this.cangid == response[i].id) {
-              this.warehouseName = response[i].warehouseName
-              this.warehouseCount =  response[i].count
-              this.warehouseNo =  response[i].commonWarehouseNo
-              this.purchasePriceList =  response[i].purchasePriceList
-              this.goodnameList=response[i].goodsNameInfos
-              if(this.goodnameList){
-              this.goodsName=this.goodnameList[0].goodsName
-              this.goodsNameKey=this.goodnameList[0].goodsNameKey
-            }
-            } 
-          }
-        })
     },
     },
     getList() {
     getList() {
       weighteddetails({
       weighteddetails({