|
@@ -119,6 +119,9 @@
|
|
|
<el-table-column prop="costBefore" label="入库前加权成本" >
|
|
|
</el-table-column>
|
|
|
<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 prop="createDate" label="更新日期">
|
|
|
</el-table-column>
|
|
@@ -151,6 +154,7 @@ import { downloadFile } from '@/utils/batchDown'
|
|
|
import Pagination from '@/components/Pagination'
|
|
|
import WsUpload from '@/components/WsUpload'
|
|
|
import { EventBus } from 'base-core-lib'
|
|
|
+import { toFixed } from 'xe-utils/methods'
|
|
|
export default {
|
|
|
name: 'viewSpareMoney',
|
|
|
components: {
|
|
@@ -320,7 +324,7 @@ export default {
|
|
|
selectWarehouse(){
|
|
|
getwarehousebase({
|
|
|
compId: sessionStorage.getItem('ws-pf_compId'),
|
|
|
- warehouseType:1,
|
|
|
+ warehouseType:'',
|
|
|
})
|
|
|
.toPromise()
|
|
|
.then((response) => {
|
|
@@ -331,7 +335,7 @@ export default {
|
|
|
id: response[i].id,
|
|
|
count: response[i].count,
|
|
|
purchasePriceList: response[i].purchasePriceList,
|
|
|
- No:response[i].commonWarehouseNo,
|
|
|
+ No:response[i].commonWarehouseNo,
|
|
|
goodsNameInfos:response[i].goodsNameInfos
|
|
|
})
|
|
|
if (this.cangid&&this.cangid == response[i].id) {
|
|
@@ -340,10 +344,15 @@ export default {
|
|
|
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
|
|
|
- }
|
|
|
+ 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){
|
|
@@ -354,40 +363,18 @@ export default {
|
|
|
this.purchasePriceList = this.warehouseList1[0].purchasePriceList
|
|
|
this.WAREHOUSE[1].payname = this.warehouseList1[0].value
|
|
|
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()
|
|
|
})
|
|
|
- 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() {
|
|
|
weighteddetails({
|
|
@@ -400,6 +387,9 @@ export default {
|
|
|
})
|
|
|
.toPromise()
|
|
|
.then((response) => {
|
|
|
+ for (let i = 0; i < response.records.length; i++) {
|
|
|
+ response.records[i].toFixed(2)
|
|
|
+ }
|
|
|
this.warehouseList = response
|
|
|
this.deptBudgetTotal=response.total
|
|
|
this.counttotal()
|