|
@@ -88,10 +88,7 @@
|
|
|
<!-- <el-button type="primary" @click="operation()"
|
|
|
><i class="el-icon-edit"></i>更改</el-button
|
|
|
> -->
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click="updateDetailsOrderPrice"
|
|
|
- >
|
|
|
+ <el-button type="primary" @click="updateDetailsOrderPrice">
|
|
|
<i class="el-icon-edit"></i>修改计费详单
|
|
|
</el-button>
|
|
|
<!-- <el-button type="primary" @click="batchoperation()"
|
|
@@ -104,12 +101,15 @@
|
|
|
><i class="el-icon-map-location"></i>实时路径</el-button
|
|
|
> -->
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-show="activeName=='first'">
|
|
|
- <el-button type="primary" @click="makeSurePrice"
|
|
|
- v-if="!notRoutList.includes('capacityNo')"
|
|
|
- ><i class="el-icon-circle-check"></i>确认执行价</el-button>
|
|
|
+ <el-form-item v-show="activeName == 'first'">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="makeSurePrice"
|
|
|
+ v-if="!notRoutList.includes('capacityNo')"
|
|
|
+ ><i class="el-icon-circle-check"></i>确认执行价</el-button
|
|
|
+ >
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-show="activeName=='second'">
|
|
|
+ <el-form-item v-show="activeName == 'second'">
|
|
|
<el-button type="primary" @click="openStatement">
|
|
|
<i class="el-icon-circle-check"></i>生成账单
|
|
|
</el-button>
|
|
@@ -228,11 +228,7 @@
|
|
|
column-key="actualAddress"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="priceValue"
|
|
|
- label="最终运价"
|
|
|
- width="100px"
|
|
|
- >
|
|
|
+ <el-table-column prop="priceValue" label="最终运价" width="100px">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="detailsAmount"
|
|
@@ -318,11 +314,7 @@
|
|
|
:filters="filterSaleAreaList"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="unloadType"
|
|
|
- label="卸货类别"
|
|
|
- width="60px"
|
|
|
- >
|
|
|
+ <el-table-column prop="unloadType" label="卸货类别" width="60px">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="paymentCustomer"
|
|
@@ -369,8 +361,12 @@
|
|
|
id="salesLogisticsStat_saleSteelReports_table"
|
|
|
individual-panel
|
|
|
>
|
|
|
- <el-table-column type="selection" width="30" label="选择"></el-table-column>
|
|
|
- <el-table-column
|
|
|
+ <el-table-column
|
|
|
+ type="selection"
|
|
|
+ width="30"
|
|
|
+ label="选择"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
width="50"
|
|
|
label="序号"
|
|
|
align="center"
|
|
@@ -445,11 +441,7 @@
|
|
|
column-key="actualAddress"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="priceValue"
|
|
|
- label="最终运价"
|
|
|
- width="100px"
|
|
|
- >
|
|
|
+ <el-table-column prop="priceValue" label="最终运价" width="100px">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="detailsAmount"
|
|
@@ -535,11 +527,7 @@
|
|
|
:filters="filterSaleAreaList"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="unloadType"
|
|
|
- label="卸货类别"
|
|
|
- width="60px"
|
|
|
- >
|
|
|
+ <el-table-column prop="unloadType" label="卸货类别" width="60px">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="paymentCustomer"
|
|
@@ -672,7 +660,9 @@
|
|
|
</div>
|
|
|
<div class="opreation">
|
|
|
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="makeSureAll">修改下货地址和单价</el-button>
|
|
|
+ <el-button type="primary" @click="makeSureAll"
|
|
|
+ >修改下货地址和单价</el-button
|
|
|
+ >
|
|
|
<el-button type="primary" @click="makeSure">只修改单价</el-button>
|
|
|
</div>
|
|
|
</el-drawer>
|
|
@@ -683,7 +673,11 @@
|
|
|
>
|
|
|
<el-form style="margin-left:20%">
|
|
|
<el-form-item label="发票金额">
|
|
|
- <el-input v-model="excludeTax" style="width:200px" type="number"></el-input>
|
|
|
+ <el-input
|
|
|
+ v-model="excludeTax"
|
|
|
+ style="width:200px"
|
|
|
+ type="number"
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="发票图片" style="">
|
|
|
<el-upload
|
|
@@ -927,7 +921,7 @@ export default {
|
|
|
startPointName: '',
|
|
|
endPointName: ''
|
|
|
},
|
|
|
- someOnePriceValueList:[],
|
|
|
+ someOnePriceValueList: [],
|
|
|
saleSteelKey: false,
|
|
|
tableRowIndex: '',
|
|
|
isRowClick: 0,
|
|
@@ -976,12 +970,12 @@ export default {
|
|
|
makeSurePriceId: null,
|
|
|
makeSurePlaceId: null,
|
|
|
detailsAmount: null,
|
|
|
- mapValuenew:{},
|
|
|
+ mapValuenew: {},
|
|
|
//存放要执行的单价的位置Id,以及价格
|
|
|
- amsPriceList:[],
|
|
|
- placeIds:[],
|
|
|
+ amsPriceList: [],
|
|
|
+ placeIds: [],
|
|
|
//用于赋予承运商的权限
|
|
|
- userId:'',
|
|
|
+ userId: '',
|
|
|
ops: {
|
|
|
vuescroll: {},
|
|
|
scrollPanel: {},
|
|
@@ -996,13 +990,13 @@ export default {
|
|
|
'overflow-x': 'hidden'
|
|
|
}
|
|
|
},
|
|
|
- excludeTax:null,
|
|
|
- statementList:[],
|
|
|
- showStatementUpLoad:false
|
|
|
+ excludeTax: null,
|
|
|
+ statementList: [],
|
|
|
+ showStatementUpLoad: false
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- this.userId=getCookie('userId')
|
|
|
+ this.userId = getCookie('userId')
|
|
|
if (this.orgCodeList.includes(getCookie('orgCode'))) {
|
|
|
this.isShowOperate = true
|
|
|
}
|
|
@@ -1104,25 +1098,25 @@ export default {
|
|
|
computed: {},
|
|
|
methods: {
|
|
|
handleSelectionChange() {
|
|
|
- this.amsPriceList=[]
|
|
|
+ this.amsPriceList = []
|
|
|
this.makeSurePriceOrderList = []
|
|
|
- this.someOnePriceValueList=[]
|
|
|
+ this.someOnePriceValueList = []
|
|
|
console.log(this.$refs.tableRef.selection, 'selection')
|
|
|
- let mapvalue={
|
|
|
- placeId:"",
|
|
|
- priceValue:"",
|
|
|
- orderId:""
|
|
|
+ let mapvalue = {
|
|
|
+ placeId: '',
|
|
|
+ priceValue: '',
|
|
|
+ orderId: ''
|
|
|
}
|
|
|
- let mapValue1={
|
|
|
- detailsAmount:""
|
|
|
+ let mapValue1 = {
|
|
|
+ detailsAmount: ''
|
|
|
}
|
|
|
this.makeSurePriceOrderList = this.$refs.tableRef.selection.map(e => {
|
|
|
//运价判断
|
|
|
- mapValue1.detailsAmount=e.detailsAmount
|
|
|
+ mapValue1.detailsAmount = e.detailsAmount
|
|
|
this.someOnePriceValueList.push(mapValue1)
|
|
|
- mapvalue.placeId=e.placeId
|
|
|
- mapvalue.priceValue=e.priceValue
|
|
|
- mapvalue.orderId=e.orderId
|
|
|
+ mapvalue.placeId = e.placeId
|
|
|
+ mapvalue.priceValue = e.priceValue
|
|
|
+ mapvalue.orderId = e.orderId
|
|
|
this.amsPriceList.push(mapvalue)
|
|
|
return e.orderId
|
|
|
})
|
|
@@ -1133,28 +1127,28 @@ export default {
|
|
|
makeSurePrice() {
|
|
|
let map = {
|
|
|
orderList: this.makeSurePriceOrderList,
|
|
|
- amsPriceList:this.amsPriceList
|
|
|
+ amsPriceList: this.amsPriceList
|
|
|
}
|
|
|
- console.log("确认执行价的顺序")
|
|
|
+ console.log('确认执行价的顺序')
|
|
|
console.log(this.makeSurePriceOrderList)
|
|
|
console.log(map)
|
|
|
- let flag=0;
|
|
|
- this.someOnePriceValueList.forEach((e)=>{
|
|
|
- if(e.detailsAmount==null){
|
|
|
- console.log("进入了flag++")
|
|
|
+ let flag = 0
|
|
|
+ this.someOnePriceValueList.forEach(e => {
|
|
|
+ if (e.detailsAmount == null) {
|
|
|
+ console.log('进入了flag++')
|
|
|
flag++
|
|
|
}
|
|
|
})
|
|
|
- if(flag!=0){
|
|
|
+ if (flag != 0) {
|
|
|
this.$message({
|
|
|
- type: 'error',
|
|
|
- message: '没有最终运费',
|
|
|
- duration: 2000,
|
|
|
- offset: '250'
|
|
|
- })
|
|
|
+ type: 'error',
|
|
|
+ message: '没有最终运费',
|
|
|
+ duration: 2000,
|
|
|
+ offset: '250'
|
|
|
+ })
|
|
|
return
|
|
|
}
|
|
|
- console.log("确认执行价的顺序")
|
|
|
+ console.log('确认执行价的顺序')
|
|
|
console.log(this.makeSurePriceOrderList)
|
|
|
console.log(map)
|
|
|
this.axios
|
|
@@ -1187,35 +1181,38 @@ export default {
|
|
|
offset: '250'
|
|
|
})
|
|
|
})
|
|
|
- this.amsPriceList=[]
|
|
|
+ this.amsPriceList = []
|
|
|
},
|
|
|
- openStatement(){
|
|
|
- console.log(this.$refs.tableRef1.selection, 'selection');
|
|
|
- if(!this.$refs.tableRef1.selection || this.$refs.tableRef1.selection.length<=0){
|
|
|
- this.$message.warning("请选择需要上传发票的订单");
|
|
|
- }else{
|
|
|
- this.excludeTax=null;
|
|
|
- this.statementList=[];
|
|
|
- this.showStatementUpLoad=true;
|
|
|
+ openStatement() {
|
|
|
+ console.log(this.$refs.tableRef1.selection, 'selection')
|
|
|
+ if (
|
|
|
+ !this.$refs.tableRef1.selection ||
|
|
|
+ this.$refs.tableRef1.selection.length <= 0
|
|
|
+ ) {
|
|
|
+ this.$message.warning('请选择需要上传发票的订单')
|
|
|
+ } else {
|
|
|
+ this.excludeTax = null
|
|
|
+ this.statementList = []
|
|
|
+ this.showStatementUpLoad = true
|
|
|
}
|
|
|
},
|
|
|
- generateStatement(){
|
|
|
- this.isLoading=true;
|
|
|
- if(!this.excludeTax){
|
|
|
+ generateStatement() {
|
|
|
+ this.isLoading = true
|
|
|
+ if (!this.excludeTax) {
|
|
|
this.$message.warning('请填写发票金额')
|
|
|
- this.isLoading=false;
|
|
|
- }else if(this.statementList.length < 1) {
|
|
|
+ this.isLoading = false
|
|
|
+ } else if (this.statementList.length < 1) {
|
|
|
this.$message.warning('请上传发票')
|
|
|
- this.isLoading=false;
|
|
|
- }else{
|
|
|
+ this.isLoading = false
|
|
|
+ } else {
|
|
|
let orderList = this.$refs.tableRef1.selection.map(e => {
|
|
|
- return e.orderId
|
|
|
+ return e.orderId
|
|
|
})
|
|
|
- let formData = new window.FormData();
|
|
|
- formData.append('file0', this.statementList[0].raw);
|
|
|
- formData.append('orderList',orderList);
|
|
|
- formData.append('excludeTax', this.excludeTax);
|
|
|
- formData.append('userId',getCookie('userId'));
|
|
|
+ let formData = new window.FormData()
|
|
|
+ formData.append('file0', this.statementList[0].raw)
|
|
|
+ formData.append('orderList', orderList)
|
|
|
+ formData.append('excludeTax', this.excludeTax)
|
|
|
+ formData.append('userId', getCookie('userId'))
|
|
|
let options = {
|
|
|
url: '/api/v1/bms/addTruckStatement',
|
|
|
data: formData,
|
|
@@ -1226,11 +1223,11 @@ export default {
|
|
|
}
|
|
|
this.axios(options).then(res => {
|
|
|
console.log('uploadRes:', res)
|
|
|
- if(res.data.status=='succeed'){
|
|
|
+ if (res.data.status == 'succeed') {
|
|
|
this.$message.success('上传成功!')
|
|
|
this.closeUpload()
|
|
|
- }else{
|
|
|
- this.$message.error(res.data.data);
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.data.data)
|
|
|
this.isLoading = false
|
|
|
}
|
|
|
})
|
|
@@ -1243,50 +1240,78 @@ export default {
|
|
|
},
|
|
|
selectAddresClick() {
|
|
|
if (this.addresText) {
|
|
|
- if(!this.notRoutList.includes('capacityNo')){
|
|
|
+ if (!this.notRoutList.includes('capacityNo')) {
|
|
|
this.Address.requestUrl =
|
|
|
- '/api/v1/ams/getAmsContractTransportPriceForDetail?apiId=519&con=' +
|
|
|
- this.addresText
|
|
|
- }else{
|
|
|
+ '/api/v1/ams/getAmsContractTransportPriceForDetail?apiId=519&con=' +
|
|
|
+ this.addresText
|
|
|
+ } else {
|
|
|
this.Address.requestUrl =
|
|
|
- '/api/v1/ams/getAmsContractTransportPriceForDetail?apiId=519&con=' +
|
|
|
- this.addresText+
|
|
|
- '&userId='+this.userId
|
|
|
+ '/api/v1/ams/getAmsContractTransportPriceForDetail?apiId=519&con=' +
|
|
|
+ this.addresText +
|
|
|
+ '&userId=' +
|
|
|
+ this.userId
|
|
|
}
|
|
|
} else {
|
|
|
- if(!this.notRoutList.includes('capacityNo')){
|
|
|
+ if (!this.notRoutList.includes('capacityNo')) {
|
|
|
this.Address.requestUrl =
|
|
|
- '/api/v1/ams/getAmsContractTransportPriceForDetail?apiId=519&i=' + new Date()
|
|
|
- }else{
|
|
|
+ '/api/v1/ams/getAmsContractTransportPriceForDetail?apiId=519&i=' +
|
|
|
+ new Date()
|
|
|
+ } else {
|
|
|
this.Address.requestUrl =
|
|
|
- '/api/v1/ams/getAmsContractTransportPriceForDetail?apiId=519&i=' + new Date()
|
|
|
- +'&userId='+this.userId
|
|
|
+ '/api/v1/ams/getAmsContractTransportPriceForDetail?apiId=519&i=' +
|
|
|
+ new Date() +
|
|
|
+ '&userId=' +
|
|
|
+ this.userId
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
updateDetailsOrderPrice() {
|
|
|
- if(this.steelMap.actualAddress==null){
|
|
|
- this.originalAddress =this.steelMap.addressPlace
|
|
|
- }else{
|
|
|
- this.originalAddress =this.steelMap.actualAddress
|
|
|
+ console.log(this.steelMap)
|
|
|
+ if (this.steelMap.actualAddress == null) {
|
|
|
+ this.originalAddress = this.steelMap.addressPlace
|
|
|
+ } else {
|
|
|
+ this.originalAddress = this.steelMap.actualAddress
|
|
|
}
|
|
|
this.originalPriceValue = this.steelMap.priceValue
|
|
|
- if(!this.notRoutList.includes('capacityNo')){
|
|
|
- console.log("进入了1")
|
|
|
- console.log(this.userId)
|
|
|
- this.Address.requestUrl =
|
|
|
- '/api/v1/ams/getAmsContractTransportPriceForDetail?apiId=519&i=' + new Date()
|
|
|
- }else{
|
|
|
- console.log("进入了2")
|
|
|
+ if (!this.notRoutList.includes('capacityNo')) {
|
|
|
+ if (
|
|
|
+ typeof this.steelMap.addressTown != 'undefined' &&
|
|
|
+ this.steelMap.addressTown != null
|
|
|
+ ) {
|
|
|
+ this.Address.requestUrl =
|
|
|
+ '/api/v1/ams/getAmsContractTransportPriceForDetail?apiId=519&i=' +
|
|
|
+ new Date() +
|
|
|
+ '&con=' +
|
|
|
+ this.steelMap.addressTown
|
|
|
+ } else {
|
|
|
+ this.Address.requestUrl =
|
|
|
+ '/api/v1/ams/getAmsContractTransportPriceForDetail?apiId=519&i=' +
|
|
|
+ new Date()
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ console.log('进入了2')
|
|
|
console.log(this.userId)
|
|
|
- this.Address.requestUrl =
|
|
|
- '/api/v1/ams/getAmsContractTransportPriceForDetail?apiId=519&i=' + new Date()
|
|
|
- +'&userId='+this.userId
|
|
|
+ if (
|
|
|
+ typeof this.steelMap.addressTown != 'undefined' &&
|
|
|
+ this.steelMap.addressTown != null
|
|
|
+ ) {
|
|
|
+ this.Address.requestUrl =
|
|
|
+ '/api/v1/ams/getAmsContractTransportPriceForDetail?apiId=519&i=' +
|
|
|
+ new Date() +
|
|
|
+ '&con=' +
|
|
|
+ this.steelMap.addressTown
|
|
|
+ } else {
|
|
|
+ this.Address.requestUrl =
|
|
|
+ '/api/v1/ams/getAmsContractTransportPriceForDetail?apiId=519&i=' +
|
|
|
+ new Date() +
|
|
|
+ '&userId=' +
|
|
|
+ this.userId
|
|
|
+ }
|
|
|
}
|
|
|
this.dialogFormVisible = true
|
|
|
},
|
|
|
currentRadioChange2(val) {
|
|
|
- console.log("进入了该方法")
|
|
|
+ console.log('进入了该方法')
|
|
|
console.log(val)
|
|
|
//若具体地址有值,清空值
|
|
|
if (this.place != null) {
|
|
@@ -1298,16 +1323,16 @@ export default {
|
|
|
this.steelMap.priceId = val.priceid
|
|
|
this.makeSurePriceId = val.priceid
|
|
|
this.makeSurePlaceId = val.placeId
|
|
|
- this.detailsAmount=val.detailsAmount
|
|
|
+ this.detailsAmount = val.detailsAmount
|
|
|
},
|
|
|
//只修改单价
|
|
|
makeSure() {
|
|
|
//若没有单价Id
|
|
|
- console.log("获取数据")
|
|
|
+ console.log('获取数据')
|
|
|
console.log(this.userId)
|
|
|
console.log(this.makeSurePriceOrderList)
|
|
|
if (this.makeSurePriceOrderList.length == 0) {
|
|
|
- this.amsPriceList=[]
|
|
|
+ this.amsPriceList = []
|
|
|
this.$message({
|
|
|
type: 'success',
|
|
|
message: '请先选择需要修改的单价',
|
|
@@ -1326,7 +1351,7 @@ export default {
|
|
|
})
|
|
|
let mapValue = {}
|
|
|
mapValue.mapList = mapList
|
|
|
- mapValue.userId=this.userId
|
|
|
+ mapValue.userId = this.userId
|
|
|
// //是否确定修改详单地址!
|
|
|
// this.$confirm('确定修改', '提示', {
|
|
|
// confirmButtonText: '仅修改单价',
|
|
@@ -1336,7 +1361,7 @@ export default {
|
|
|
// center: true
|
|
|
// })
|
|
|
// .then(() => {
|
|
|
- //初始化修改详单地址对话框的信息
|
|
|
+ //初始化修改详单地址对话框的信息
|
|
|
this.axios
|
|
|
.post('/api/v1/bms/updateBatchDetailsOrder', mapValue)
|
|
|
.then(res => {
|
|
@@ -1348,18 +1373,18 @@ export default {
|
|
|
this.loadNewData()
|
|
|
this.dialogFormVisible = false
|
|
|
} else {
|
|
|
- this.$message.error('修改失败:'+res.data.data)
|
|
|
+ this.$message.error('修改失败:' + res.data.data)
|
|
|
this.dialogFormVisible = false
|
|
|
}
|
|
|
})
|
|
|
- this.amsPriceList=[]
|
|
|
+ this.amsPriceList = []
|
|
|
},
|
|
|
//修改单价和收货地址
|
|
|
- makeSureAll(){
|
|
|
- console.log("获取数据")
|
|
|
+ makeSureAll() {
|
|
|
+ console.log('获取数据')
|
|
|
console.log(this.userId)
|
|
|
if (this.makeSurePriceOrderList.length == 0) {
|
|
|
- this.amsPriceList=[]
|
|
|
+ this.amsPriceList = []
|
|
|
this.$message({
|
|
|
type: 'success',
|
|
|
message: '请先选择需要修改的单价',
|
|
@@ -1379,24 +1404,24 @@ export default {
|
|
|
let mapValue = {}
|
|
|
mapValue.mapList = mapList
|
|
|
mapValue.updatePlace = 1
|
|
|
- mapValue.userId=this.userId
|
|
|
- console.log("要的数据")
|
|
|
+ mapValue.userId = this.userId
|
|
|
+ console.log('要的数据')
|
|
|
console.log(mapValue)
|
|
|
- this.axios
|
|
|
- .post('/api/v1/bms/updateBatchDetailsOrder', mapValue)
|
|
|
- .then(res => {
|
|
|
- if (res.data.code == '200') {
|
|
|
- //this.$refs.tableRef.clearSelection()
|
|
|
- this.$message.success('修改详单单价和地址成功!')
|
|
|
- // this.operation(this.steelMap)
|
|
|
- this.loadNewData()
|
|
|
- this.dialogFormVisible = false
|
|
|
- }else {
|
|
|
- this.$message.error('修改失败:'+res.data.data)
|
|
|
- this.dialogFormVisible = false
|
|
|
- }
|
|
|
- })
|
|
|
- this.amsPriceList=[]
|
|
|
+ this.axios
|
|
|
+ .post('/api/v1/bms/updateBatchDetailsOrder', mapValue)
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.code == '200') {
|
|
|
+ //this.$refs.tableRef.clearSelection()
|
|
|
+ this.$message.success('修改详单单价和地址成功!')
|
|
|
+ // this.operation(this.steelMap)
|
|
|
+ this.loadNewData()
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ } else {
|
|
|
+ this.$message.error('修改失败:' + res.data.data)
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.amsPriceList = []
|
|
|
},
|
|
|
hanleScroll() {
|
|
|
console.log('我滚动了')
|
|
@@ -1870,7 +1895,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
cellClik(row, column, cell, event) {
|
|
|
- console.log("点击事件")
|
|
|
+ console.log('点击事件')
|
|
|
console.log(row)
|
|
|
console.log(column)
|
|
|
if (column.property == 'arrivalAddress') {
|
|
@@ -2015,47 +2040,47 @@ export default {
|
|
|
var title = this.tableTitle
|
|
|
let tHeader = []
|
|
|
let filterVal = []
|
|
|
- if(this.activeName==='first'){
|
|
|
- console.log("进入了1")
|
|
|
+ if (this.activeName === 'first') {
|
|
|
+ console.log('进入了1')
|
|
|
console.log(this.$refs.tableRef)
|
|
|
this.$refs.tableRef.$children.forEach(item => {
|
|
|
- if (item.label != undefined && item.prop != undefined) {
|
|
|
- if (tHeader.indexOf(item.label) === -1) {
|
|
|
- tHeader.push(item.label)
|
|
|
- }
|
|
|
- if (filterVal.indexOf(item.prop) === -1) {
|
|
|
- filterVal.push(item.prop)
|
|
|
+ if (item.label != undefined && item.prop != undefined) {
|
|
|
+ if (tHeader.indexOf(item.label) === -1) {
|
|
|
+ tHeader.push(item.label)
|
|
|
+ }
|
|
|
+ if (filterVal.indexOf(item.prop) === -1) {
|
|
|
+ filterVal.push(item.prop)
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- })
|
|
|
- this.downloadLoading = true
|
|
|
- require.ensure([], () => {
|
|
|
- const {
|
|
|
- export_json_to_excel
|
|
|
- } = require('@/assets/excel/Export2Excel.js') //这里必须使用绝对路径,使用@/+存放export2Excel的路径
|
|
|
- let data = this.tableData.map(v => filterVal.map(j => v[j])) //3.formatJson格式转换
|
|
|
- export_json_to_excel(tHeader, data, title) // (title)导出的表格名称
|
|
|
- })
|
|
|
- }else if(this.activeName === 'second'){
|
|
|
+ })
|
|
|
+ this.downloadLoading = true
|
|
|
+ require.ensure([], () => {
|
|
|
+ const {
|
|
|
+ export_json_to_excel
|
|
|
+ } = require('@/assets/excel/Export2Excel.js') //这里必须使用绝对路径,使用@/+存放export2Excel的路径
|
|
|
+ let data = this.tableData.map(v => filterVal.map(j => v[j])) //3.formatJson格式转换
|
|
|
+ export_json_to_excel(tHeader, data, title) // (title)导出的表格名称
|
|
|
+ })
|
|
|
+ } else if (this.activeName === 'second') {
|
|
|
console.log(this.$refs.tableRef1)
|
|
|
this.$refs.tableRef1.$children.forEach(item => {
|
|
|
- if (item.label != undefined && item.prop != undefined) {
|
|
|
- if (tHeader.indexOf(item.label) === -1) {
|
|
|
- tHeader.push(item.label)
|
|
|
- }
|
|
|
- if (filterVal.indexOf(item.prop) === -1) {
|
|
|
- filterVal.push(item.prop)
|
|
|
+ if (item.label != undefined && item.prop != undefined) {
|
|
|
+ if (tHeader.indexOf(item.label) === -1) {
|
|
|
+ tHeader.push(item.label)
|
|
|
+ }
|
|
|
+ if (filterVal.indexOf(item.prop) === -1) {
|
|
|
+ filterVal.push(item.prop)
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- })
|
|
|
- this.downloadLoading = true
|
|
|
- require.ensure([], () => {
|
|
|
- const {
|
|
|
- export_json_to_excel
|
|
|
- } = require('@/assets/excel/Export2Excel.js') //这里必须使用绝对路径,使用@/+存放export2Excel的路径
|
|
|
- let data = this.tableData1.map(v => filterVal.map(j => v[j])) //3.formatJson格式转换
|
|
|
- export_json_to_excel(tHeader, data, title) // (title)导出的表格名称
|
|
|
- })
|
|
|
+ })
|
|
|
+ this.downloadLoading = true
|
|
|
+ require.ensure([], () => {
|
|
|
+ const {
|
|
|
+ export_json_to_excel
|
|
|
+ } = require('@/assets/excel/Export2Excel.js') //这里必须使用绝对路径,使用@/+存放export2Excel的路径
|
|
|
+ let data = this.tableData1.map(v => filterVal.map(j => v[j])) //3.formatJson格式转换
|
|
|
+ export_json_to_excel(tHeader, data, title) // (title)导出的表格名称
|
|
|
+ })
|
|
|
}
|
|
|
loading.close()
|
|
|
},
|
|
@@ -2844,12 +2869,12 @@ export default {
|
|
|
// e.detailsAmount=e.detailsAmount.toFixed(2);
|
|
|
// }
|
|
|
// } catch (error) {
|
|
|
-
|
|
|
+
|
|
|
// }
|
|
|
// })
|
|
|
this.totalHeight += this.itemHeight
|
|
|
this.visibleList = res.data.data
|
|
|
- console.log(this.visibleList);
|
|
|
+ console.log(this.visibleList)
|
|
|
console.log(this.visibleList, 'this.visibleList')
|
|
|
this.getSpanArr(this.visibleList)
|
|
|
this.getTotalNum(this.tableData)
|
|
@@ -2891,7 +2916,7 @@ export default {
|
|
|
// e.detailsAmount=e.detailsAmount.toFixed(2);
|
|
|
// }
|
|
|
// } catch (error) {
|
|
|
-
|
|
|
+
|
|
|
// }
|
|
|
// })
|
|
|
this.totalHeight += this.itemHeight
|
|
@@ -2901,14 +2926,14 @@ export default {
|
|
|
this.getTotalNum(this.tableData)
|
|
|
console.log(this.visibleList1)
|
|
|
})
|
|
|
- loading.close()
|
|
|
+ loading.close()
|
|
|
},
|
|
|
//重新获取表格数据
|
|
|
refresh() {
|
|
|
this.getSteelReport()
|
|
|
},
|
|
|
//仅仅更新变更数据
|
|
|
- loadNewData(){
|
|
|
+ loadNewData() {
|
|
|
const loading = this.$loading({
|
|
|
lock: true,
|
|
|
text: '正在更新数据,请稍候',
|
|
@@ -2921,33 +2946,33 @@ export default {
|
|
|
startTime = sjTime(this.startTime)
|
|
|
endTime = sjTime(this.endTime)
|
|
|
}
|
|
|
- let map= {
|
|
|
- saleMaterialIds:this.visibleList.map(e=>{
|
|
|
+ let map = {
|
|
|
+ saleMaterialIds: this.visibleList.map(e => {
|
|
|
return e.saleMaterialId
|
|
|
})
|
|
|
}
|
|
|
- console.log("map:",map);
|
|
|
+ console.log('map:', map)
|
|
|
this.axios
|
|
|
.post(
|
|
|
'/api/v1/tms/getSaleSteelReportNew?startTime=' +
|
|
|
startTime +
|
|
|
'&endTime=' +
|
|
|
endTime,
|
|
|
- map
|
|
|
+ map
|
|
|
)
|
|
|
.then(res => {
|
|
|
//遍历旧数组
|
|
|
- this.visibleList.forEach(e1=>{
|
|
|
+ this.visibleList.forEach(e1 => {
|
|
|
//遍历新数组
|
|
|
- let temp = res.data.data.find(e2=>{
|
|
|
- return e1.saleMaterialId==e2.saleMaterialId
|
|
|
+ let temp = res.data.data.find(e2 => {
|
|
|
+ return e1.saleMaterialId == e2.saleMaterialId
|
|
|
})
|
|
|
//赋值
|
|
|
- e1.priceValue=temp.priceValue;
|
|
|
- e1.detailsAmount=temp.detailsAmount;
|
|
|
- e1.actualAddress=temp.actualAddress;
|
|
|
+ e1.priceValue = temp.priceValue
|
|
|
+ e1.detailsAmount = temp.detailsAmount
|
|
|
+ e1.actualAddress = temp.actualAddress
|
|
|
})
|
|
|
- loading.close();
|
|
|
+ loading.close()
|
|
|
})
|
|
|
.catch(() => {
|
|
|
loading.close()
|
|
@@ -2955,7 +2980,7 @@ export default {
|
|
|
},
|
|
|
//获取钢材统计报表
|
|
|
getSteelReport() {
|
|
|
- this.amsPriceList=[]
|
|
|
+ this.amsPriceList = []
|
|
|
const loading = this.$loading({
|
|
|
lock: true,
|
|
|
text: '正在获取数据,请稍候',
|
|
@@ -3045,8 +3070,7 @@ export default {
|
|
|
this.getTotalNum(this.tableData)
|
|
|
loading.close()
|
|
|
})
|
|
|
- .catch(() => {
|
|
|
- })
|
|
|
+ .catch(() => {})
|
|
|
|
|
|
this.axios
|
|
|
.post(
|
|
@@ -3083,10 +3107,8 @@ export default {
|
|
|
this.getTotalNum(this.tableData1)
|
|
|
loading.close()
|
|
|
})
|
|
|
- .catch(() => {
|
|
|
- })
|
|
|
- loading.close();
|
|
|
-
|
|
|
+ .catch(() => {})
|
|
|
+ loading.close()
|
|
|
}
|
|
|
}
|
|
|
}
|