|
@@ -46,6 +46,28 @@
|
|
clearable
|
|
clearable
|
|
></el-input>
|
|
></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item>
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="screen1"
|
|
|
|
+ placeholder="请选择需筛选的内容"
|
|
|
|
+ clearable
|
|
|
|
+ style="width:150px"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in options1"
|
|
|
|
+ :key="item.value"
|
|
|
|
+ :label="item.label"
|
|
|
|
+ :value="item.value"
|
|
|
|
+ >
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ <el-input
|
|
|
|
+ style="width:200px"
|
|
|
|
+ v-model="input1"
|
|
|
|
+ placeholder="请输入查询条件"
|
|
|
|
+ clearable
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
<el-form-item>
|
|
<el-form-item>
|
|
<el-button type="primary" class="btn" @click="onclick">
|
|
<el-button type="primary" class="btn" @click="onclick">
|
|
<i class="el-icon-search"></i>
|
|
<i class="el-icon-search"></i>
|
|
@@ -299,7 +321,12 @@
|
|
width="150px"
|
|
width="150px"
|
|
>
|
|
>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="操作" align="center" width="150px" prop="operation">
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="操作"
|
|
|
|
+ align="center"
|
|
|
|
+ width="150px"
|
|
|
|
+ prop="operation"
|
|
|
|
+ >
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button type="text" @click="operate(scope.row)">保存</el-button>
|
|
<el-button type="text" @click="operate(scope.row)">保存</el-button>
|
|
</template>
|
|
</template>
|
|
@@ -311,8 +338,8 @@
|
|
<script>
|
|
<script>
|
|
//需要设计-发站、移库/直发的表格筛选传递给后端
|
|
//需要设计-发站、移库/直发的表格筛选传递给后端
|
|
//需要设计-件数,重量,理重,标重,计费吨位的合计
|
|
//需要设计-件数,重量,理重,标重,计费吨位的合计
|
|
-import { sjTime } from "@/utils/sharedJsFile";
|
|
|
|
-import { getCookie } from "@/utils/util.js";
|
|
|
|
|
|
+import { sjTime } from '@/utils/sharedJsFile'
|
|
|
|
+import { getCookie } from '@/utils/util.js'
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -320,43 +347,80 @@ export default {
|
|
endTime: null,
|
|
endTime: null,
|
|
options: [
|
|
options: [
|
|
{
|
|
{
|
|
- value: "发站",
|
|
|
|
- lable: "发站"
|
|
|
|
|
|
+ value: '发站',
|
|
|
|
+ lable: '发站'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ value: '收货单位',
|
|
|
|
+ lable: '收货单位'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- value: "收货单位",
|
|
|
|
- lable: "收货单位"
|
|
|
|
|
|
+ value: '车皮号',
|
|
|
|
+ lable: '车皮号'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- value: "车皮号",
|
|
|
|
- lable: "车皮号"
|
|
|
|
|
|
+ value: '到站',
|
|
|
|
+ lable: '到站'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- value: "到站",
|
|
|
|
- lable: "到站"
|
|
|
|
|
|
+ value: '物资名称',
|
|
|
|
+ lable: '物资名称'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ value: '规格型号',
|
|
|
|
+ lable: '规格型号'
|
|
}
|
|
}
|
|
],
|
|
],
|
|
input: null,
|
|
input: null,
|
|
|
|
+ options1: [
|
|
|
|
+ {
|
|
|
|
+ value: '发站',
|
|
|
|
+ lable: '发站'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ value: '收货单位',
|
|
|
|
+ lable: '收货单位'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ value: '车皮号',
|
|
|
|
+ lable: '车皮号'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ value: '到站',
|
|
|
|
+ lable: '到站'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ value: '物资名称',
|
|
|
|
+ lable: '物资名称'
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ value: '规格型号',
|
|
|
|
+ lable: '规格型号'
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ input1: null,
|
|
tableData: [],
|
|
tableData: [],
|
|
screen: null,
|
|
screen: null,
|
|
|
|
+ screen1: null,
|
|
sumList: [
|
|
sumList: [
|
|
- "wagonBillWeight",
|
|
|
|
- "wagonWeight",
|
|
|
|
- "theoryWeight",
|
|
|
|
- "materialWeight",
|
|
|
|
- "materialNum"
|
|
|
|
|
|
+ 'wagonBillWeight',
|
|
|
|
+ 'wagonWeight',
|
|
|
|
+ 'theoryWeight',
|
|
|
|
+ 'materialWeight',
|
|
|
|
+ 'materialNum'
|
|
],
|
|
],
|
|
- operateName: "编辑",
|
|
|
|
|
|
+ operateName: '编辑',
|
|
unloadPointList: [],
|
|
unloadPointList: [],
|
|
spanArr: [],
|
|
spanArr: [],
|
|
- mergeList: ["wagonNo","wagonBillWeight","OutStation"]
|
|
|
|
- };
|
|
|
|
|
|
+ mergeList: ['wagonNo', 'wagonBillWeight', 'OutStation'],
|
|
|
|
+ filterMap: {}
|
|
|
|
+ }
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
- this.getRequestUrl();
|
|
|
|
|
|
+ this.getRequestUrl()
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
- this.showSummariesPosition();
|
|
|
|
|
|
+ this.showSummariesPosition()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
batchOperate() {
|
|
batchOperate() {
|
|
@@ -368,67 +432,67 @@ export default {
|
|
e.consigneeId != null &&
|
|
e.consigneeId != null &&
|
|
e.unloadPointId != null
|
|
e.unloadPointId != null
|
|
) {
|
|
) {
|
|
- item.unloadPointId = e.unloadPointId;
|
|
|
|
- item.unloadPoint = e.unloadPoint;
|
|
|
|
|
|
+ item.unloadPointId = e.unloadPointId
|
|
|
|
+ item.unloadPoint = e.unloadPoint
|
|
}
|
|
}
|
|
- });
|
|
|
|
- });
|
|
|
|
|
|
+ })
|
|
|
|
+ })
|
|
this.$refs.tableRef.data.forEach(row => {
|
|
this.$refs.tableRef.data.forEach(row => {
|
|
- row.personnelSsoId = getCookie("userId");
|
|
|
|
|
|
+ row.personnelSsoId = getCookie('userId')
|
|
if (
|
|
if (
|
|
- (typeof row.EnStation == "object" ||
|
|
|
|
- typeof row.EnStation == "string") &&
|
|
|
|
|
|
+ (typeof row.EnStation == 'object' ||
|
|
|
|
+ typeof row.EnStation == 'string') &&
|
|
row.EnStation != null
|
|
row.EnStation != null
|
|
) {
|
|
) {
|
|
- row.EnStation = sjTime(new Date(row.EnStation));
|
|
|
|
|
|
+ row.EnStation = sjTime(new Date(row.EnStation))
|
|
}
|
|
}
|
|
if (
|
|
if (
|
|
- (typeof row.OutStation == "object" ||
|
|
|
|
- typeof row.OutStation == "string") &&
|
|
|
|
|
|
+ (typeof row.OutStation == 'object' ||
|
|
|
|
+ typeof row.OutStation == 'string') &&
|
|
row.OutStation != null
|
|
row.OutStation != null
|
|
) {
|
|
) {
|
|
- row.OutStation = sjTime(new Date(row.OutStation));
|
|
|
|
|
|
+ row.OutStation = sjTime(new Date(row.OutStation))
|
|
}
|
|
}
|
|
- });
|
|
|
|
|
|
+ })
|
|
this.axios
|
|
this.axios
|
|
- .post("/api/v1/wms/listAfterInwardOutbound", this.$refs.tableRef.data)
|
|
|
|
|
|
+ .post('/api/v1/wms/listAfterInwardOutbound', this.$refs.tableRef.data)
|
|
.then(res => {
|
|
.then(res => {
|
|
- if (res.data.code == "200") {
|
|
|
|
- this.$message.success("批量保存成功");
|
|
|
|
- this.getRequestUrl();
|
|
|
|
|
|
+ if (res.data.code == '200') {
|
|
|
|
+ this.$message.success('批量保存成功')
|
|
|
|
+ this.getRequestUrl()
|
|
}
|
|
}
|
|
- });
|
|
|
|
- console.log(this.$refs.tableRef.data);
|
|
|
|
|
|
+ })
|
|
|
|
+ console.log(this.$refs.tableRef.data)
|
|
},
|
|
},
|
|
handleSelectWarehouse(row, index, item) {
|
|
handleSelectWarehouse(row, index, item) {
|
|
- console.log(item);
|
|
|
|
|
|
+ console.log(item)
|
|
this.unloadPointList.forEach(e => {
|
|
this.unloadPointList.forEach(e => {
|
|
if (e.warehouseName == row.unloadPoint) {
|
|
if (e.warehouseName == row.unloadPoint) {
|
|
- row.unloadPointId = e.warehouseId;
|
|
|
|
- row.unloadPoint = e.warehouseName;
|
|
|
|
|
|
+ row.unloadPointId = e.warehouseId
|
|
|
|
+ row.unloadPoint = e.warehouseName
|
|
}
|
|
}
|
|
- });
|
|
|
|
|
|
+ })
|
|
},
|
|
},
|
|
//边输边查卸货点
|
|
//边输边查卸货点
|
|
querySearchWarehouse(queryString, cb) {
|
|
querySearchWarehouse(queryString, cb) {
|
|
if (queryString.length >= 2) {
|
|
if (queryString.length >= 2) {
|
|
this.axios
|
|
this.axios
|
|
- .post("/api/v1/uc/selectUnloadingPoint?index=" + queryString)
|
|
|
|
|
|
+ .post('/api/v1/uc/selectUnloadingPoint?index=' + queryString)
|
|
.then(res => {
|
|
.then(res => {
|
|
- console.log(res.data);
|
|
|
|
|
|
+ console.log(res.data)
|
|
if (res.data.length > 0) {
|
|
if (res.data.length > 0) {
|
|
- console.log(res);
|
|
|
|
- var restaurantsConsignee = res.data;
|
|
|
|
- this.unloadPointList = res.data;
|
|
|
|
|
|
+ console.log(res)
|
|
|
|
+ var restaurantsConsignee = res.data
|
|
|
|
+ this.unloadPointList = res.data
|
|
var results = queryString
|
|
var results = queryString
|
|
? restaurantsConsignee.filter(
|
|
? restaurantsConsignee.filter(
|
|
this.createFilterConsignee(queryString)
|
|
this.createFilterConsignee(queryString)
|
|
)
|
|
)
|
|
- : restaurantsConsignee;
|
|
|
|
|
|
+ : restaurantsConsignee
|
|
// 调用 callback 返回建议列表的数据
|
|
// 调用 callback 返回建议列表的数据
|
|
- cb(results);
|
|
|
|
|
|
+ cb(results)
|
|
}
|
|
}
|
|
- });
|
|
|
|
|
|
+ })
|
|
}
|
|
}
|
|
},
|
|
},
|
|
createFilterConsignee(queryString) {
|
|
createFilterConsignee(queryString) {
|
|
@@ -437,235 +501,261 @@ export default {
|
|
restaurantsConsignee.value
|
|
restaurantsConsignee.value
|
|
.toLowerCase()
|
|
.toLowerCase()
|
|
.indexOf(queryString.toLowerCase()) > -1
|
|
.indexOf(queryString.toLowerCase()) > -1
|
|
- );
|
|
|
|
- };
|
|
|
|
|
|
+ )
|
|
|
|
+ }
|
|
},
|
|
},
|
|
//修改合并行同步
|
|
//修改合并行同步
|
|
- mergeChange(row){
|
|
|
|
- let index=this.tableData.indexOf(row);
|
|
|
|
- for(let i=index;i<this.tableData.length && row.wagonNo==this.tableData[i].wagonNo && row.OutStation==this.tableData[i].OutStation;i++){
|
|
|
|
- this.tableData[i].wagonBillWeight=row.wagonBillWeight;
|
|
|
|
|
|
+ mergeChange(row) {
|
|
|
|
+ let index = this.tableData.indexOf(row)
|
|
|
|
+ for (
|
|
|
|
+ let i = index;
|
|
|
|
+ i < this.tableData.length &&
|
|
|
|
+ row.wagonNo == this.tableData[i].wagonNo &&
|
|
|
|
+ row.OutStation == this.tableData[i].OutStation;
|
|
|
|
+ i++
|
|
|
|
+ ) {
|
|
|
|
+ this.tableData[i].wagonBillWeight = row.wagonBillWeight
|
|
}
|
|
}
|
|
},
|
|
},
|
|
operate(row) {
|
|
operate(row) {
|
|
- row.personnelSsoId = getCookie("userId");
|
|
|
|
|
|
+ row.personnelSsoId = getCookie('userId')
|
|
if (
|
|
if (
|
|
- (typeof row.EnStation == "object" ||
|
|
|
|
- typeof row.EnStation == "string") &&
|
|
|
|
|
|
+ (typeof row.EnStation == 'object' ||
|
|
|
|
+ typeof row.EnStation == 'string') &&
|
|
row.EnStation != null
|
|
row.EnStation != null
|
|
) {
|
|
) {
|
|
- row.EnStation = sjTime(new Date(row.EnStation));
|
|
|
|
|
|
+ row.EnStation = sjTime(new Date(row.EnStation))
|
|
}
|
|
}
|
|
if (
|
|
if (
|
|
- (typeof row.OutStation == "object" ||
|
|
|
|
- typeof row.OutStation == "string") &&
|
|
|
|
|
|
+ (typeof row.OutStation == 'object' ||
|
|
|
|
+ typeof row.OutStation == 'string') &&
|
|
row.OutStation != null
|
|
row.OutStation != null
|
|
) {
|
|
) {
|
|
- row.OutStation = sjTime(new Date(row.OutStation));
|
|
|
|
|
|
+ row.OutStation = sjTime(new Date(row.OutStation))
|
|
}
|
|
}
|
|
- console.log(typeof row.EnStation);
|
|
|
|
- console.log(typeof row.OutStation);
|
|
|
|
|
|
+ console.log(typeof row.EnStation)
|
|
|
|
+ console.log(typeof row.OutStation)
|
|
this.axios
|
|
this.axios
|
|
- .post("/api/v1/wms/afterInwardOutbound", row)
|
|
|
|
|
|
+ .post('/api/v1/wms/afterInwardOutbound', row)
|
|
.then(res => {
|
|
.then(res => {
|
|
- if (res.data.code == "200") {
|
|
|
|
- this.$message.success("保存成功");
|
|
|
|
- this.getRequestUrl();
|
|
|
|
|
|
+ if (res.data.code == '200') {
|
|
|
|
+ this.$message.success('保存成功')
|
|
|
|
+ this.getRequestUrl()
|
|
} else {
|
|
} else {
|
|
- this.$message.error(res.data.data);
|
|
|
|
- this.getRequestUrl();
|
|
|
|
|
|
+ this.$message.error(res.data.data)
|
|
|
|
+ this.getRequestUrl()
|
|
}
|
|
}
|
|
})
|
|
})
|
|
.catch(e => {
|
|
.catch(e => {
|
|
- this.$message.error(e);
|
|
|
|
- this.getRequestUrl();
|
|
|
|
- });
|
|
|
|
|
|
+ this.$message.error(e)
|
|
|
|
+ this.getRequestUrl()
|
|
|
|
+ })
|
|
},
|
|
},
|
|
//查询事件
|
|
//查询事件
|
|
onclick() {
|
|
onclick() {
|
|
- let startTime = null;
|
|
|
|
- let endTime = null;
|
|
|
|
- let wagonNo = null;
|
|
|
|
- let consigneeName = null;
|
|
|
|
- let sendStation = null;
|
|
|
|
- let toTheStation = null;
|
|
|
|
- if (this.screen == "发站") {
|
|
|
|
- sendStation = this.input;
|
|
|
|
- } else if (this.screen == "到站") {
|
|
|
|
- toTheStation = this.input;
|
|
|
|
- } else if (this.screen == "收货单位") {
|
|
|
|
- consigneeName = this.input;
|
|
|
|
- } else if (this.screen == "车皮号") {
|
|
|
|
- wagonNo = this.input;
|
|
|
|
|
|
+ let startTime = null
|
|
|
|
+ let endTime = null
|
|
|
|
+ let wagonNo = null
|
|
|
|
+ let consigneeName = null
|
|
|
|
+ let sendStation = null
|
|
|
|
+ let toTheStation = null
|
|
|
|
+ if (this.screen == '发站') {
|
|
|
|
+ sendStation = this.input
|
|
|
|
+ } else if (this.screen == '到站') {
|
|
|
|
+ toTheStation = this.input
|
|
|
|
+ } else if (this.screen == '收货单位') {
|
|
|
|
+ consigneeName = this.input
|
|
|
|
+ } else if (this.screen == '车皮号') {
|
|
|
|
+ wagonNo = this.input
|
|
|
|
+ } else if (this.screen == '物资名称') {
|
|
|
|
+ this.filterMap.materialName = this.input
|
|
|
|
+ } else if (this.screen == '规格型号') {
|
|
|
|
+ this.filterMap.materialSpa = this.input
|
|
|
|
+ }
|
|
|
|
+ if (this.screen1 == '发站') {
|
|
|
|
+ sendStation = this.input1
|
|
|
|
+ } else if (this.screen1 == '到站') {
|
|
|
|
+ toTheStation = this.input1
|
|
|
|
+ } else if (this.screen1 == '收货单位') {
|
|
|
|
+ consigneeName = this.input1
|
|
|
|
+ } else if (this.screen1 == '车皮号') {
|
|
|
|
+ wagonNo = this.input1
|
|
|
|
+ } else if (this.screen1 == '物资名称') {
|
|
|
|
+ this.filterMap.materialName = this.input1
|
|
|
|
+ } else if (this.screen1 == '规格型号') {
|
|
|
|
+ this.filterMap.materialSpa = this.input1
|
|
}
|
|
}
|
|
if (this.startTime && this.endTime) {
|
|
if (this.startTime && this.endTime) {
|
|
- startTime = sjTime(this.startTime);
|
|
|
|
- endTime = sjTime(this.endTime);
|
|
|
|
|
|
+ startTime = sjTime(this.startTime)
|
|
|
|
+ endTime = sjTime(this.endTime)
|
|
}
|
|
}
|
|
this.axios
|
|
this.axios
|
|
.post(
|
|
.post(
|
|
- "/api/v1/oms/getWagonShippingDetails?startTime=" +
|
|
|
|
|
|
+ '/api/v1/oms/getWagonShippingDetails?startTime=' +
|
|
startTime +
|
|
startTime +
|
|
- "&endTime=" +
|
|
|
|
|
|
+ '&endTime=' +
|
|
endTime +
|
|
endTime +
|
|
- "&wagonNo=" +
|
|
|
|
|
|
+ '&wagonNo=' +
|
|
wagonNo +
|
|
wagonNo +
|
|
- "&consigneeName=" +
|
|
|
|
|
|
+ '&consigneeName=' +
|
|
consigneeName +
|
|
consigneeName +
|
|
- "&toTheStation=" +
|
|
|
|
|
|
+ '&toTheStation=' +
|
|
toTheStation +
|
|
toTheStation +
|
|
- "&sendStation=" +
|
|
|
|
|
|
+ '&sendStation=' +
|
|
sendStation +
|
|
sendStation +
|
|
- "&i=" +
|
|
|
|
- new Date()
|
|
|
|
|
|
+ '&i=' +
|
|
|
|
+ new Date(),
|
|
|
|
+ this.filterMap
|
|
)
|
|
)
|
|
.then(res => {
|
|
.then(res => {
|
|
- this.tableData = res.data.data;
|
|
|
|
- this.showSummariesPosition();
|
|
|
|
- this.getSpanArr(this.tableData);
|
|
|
|
- });
|
|
|
|
|
|
+ this.tableData = res.data.data
|
|
|
|
+ this.showSummariesPosition()
|
|
|
|
+ this.getSpanArr(this.tableData)
|
|
|
|
+ })
|
|
},
|
|
},
|
|
//获取后台数据
|
|
//获取后台数据
|
|
getRequestUrl() {
|
|
getRequestUrl() {
|
|
this.axios
|
|
this.axios
|
|
.post(
|
|
.post(
|
|
- "/api/v1/oms/getWagonShippingDetails?startTime=null&endTime=null&i=" +
|
|
|
|
|
|
+ '/api/v1/oms/getWagonShippingDetails?startTime=null&endTime=null&i=' +
|
|
new Date()
|
|
new Date()
|
|
)
|
|
)
|
|
.then(res => {
|
|
.then(res => {
|
|
- console.log(res.data.data);
|
|
|
|
- this.tableData = res.data.data;
|
|
|
|
- this.getSpanArr(this.tableData);
|
|
|
|
- this.showSummariesPosition();
|
|
|
|
- });
|
|
|
|
|
|
+ console.log(res.data.data)
|
|
|
|
+ this.tableData = res.data.data
|
|
|
|
+ this.getSpanArr(this.tableData)
|
|
|
|
+ this.showSummariesPosition()
|
|
|
|
+ })
|
|
},
|
|
},
|
|
//刷新
|
|
//刷新
|
|
refresh() {
|
|
refresh() {
|
|
- this.screen = null;
|
|
|
|
- this.input = null;
|
|
|
|
- this.getRequestUrl();
|
|
|
|
|
|
+ this.screen = null
|
|
|
|
+ this.input = null
|
|
|
|
+ this.getRequestUrl()
|
|
},
|
|
},
|
|
//筛选发站
|
|
//筛选发站
|
|
filterSend(value, row, column) {
|
|
filterSend(value, row, column) {
|
|
- return row.sendStation === value;
|
|
|
|
|
|
+ return row.sendStation === value
|
|
},
|
|
},
|
|
//筛选类型
|
|
//筛选类型
|
|
filterType(value, row, column) {
|
|
filterType(value, row, column) {
|
|
- return row.orderType === value;
|
|
|
|
|
|
+ return row.orderType === value
|
|
},
|
|
},
|
|
//筛选是否入库数据
|
|
//筛选是否入库数据
|
|
filterDeleted(value, row, column) {
|
|
filterDeleted(value, row, column) {
|
|
- return row.wgmDelete === value;
|
|
|
|
|
|
+ return row.wgmDelete === value
|
|
},
|
|
},
|
|
//将合计行置顶
|
|
//将合计行置顶
|
|
showSummariesPosition() {
|
|
showSummariesPosition() {
|
|
- const table = document.querySelector(".table");
|
|
|
|
- const footer = document.querySelector(".table .el-table__footer-wrapper");
|
|
|
|
- const body = document.querySelector(".table .el-table__body-wrapper");
|
|
|
|
- table.removeChild(footer); // 移除表格最下方的合计行
|
|
|
|
- table.insertBefore(footer, body); // 把合计行插入到表格body的上面
|
|
|
|
|
|
+ const table = document.querySelector('.table')
|
|
|
|
+ const footer = document.querySelector('.table .el-table__footer-wrapper')
|
|
|
|
+ const body = document.querySelector('.table .el-table__body-wrapper')
|
|
|
|
+ table.removeChild(footer) // 移除表格最下方的合计行
|
|
|
|
+ table.insertBefore(footer, body) // 把合计行插入到表格body的上面
|
|
},
|
|
},
|
|
//表尾合计行
|
|
//表尾合计行
|
|
getSummaries(param) {
|
|
getSummaries(param) {
|
|
- const { columns, data } = param;
|
|
|
|
- const sums = [];
|
|
|
|
|
|
+ const { columns, data } = param
|
|
|
|
+ const sums = []
|
|
columns.forEach((column, index) => {
|
|
columns.forEach((column, index) => {
|
|
//如果索引值为0,则展示‘合计’
|
|
//如果索引值为0,则展示‘合计’
|
|
if (index === 0) {
|
|
if (index === 0) {
|
|
- sums[index] = "合计";
|
|
|
|
- return;
|
|
|
|
|
|
+ sums[index] = '合计'
|
|
|
|
+ return
|
|
}
|
|
}
|
|
if (this.sumList.includes(column.property)) {
|
|
if (this.sumList.includes(column.property)) {
|
|
- const values = data.map(item => Number(item[column.property]));
|
|
|
|
|
|
+ const values = data.map(item => Number(item[column.property]))
|
|
if (!values.every(value => isNaN(value))) {
|
|
if (!values.every(value => isNaN(value))) {
|
|
sums[index] = values.reduce((prev, curr) => {
|
|
sums[index] = values.reduce((prev, curr) => {
|
|
- const value = Number(curr);
|
|
|
|
|
|
+ const value = Number(curr)
|
|
if (!isNaN(value)) {
|
|
if (!isNaN(value)) {
|
|
- return prev + curr;
|
|
|
|
|
|
+ return prev + curr
|
|
} else {
|
|
} else {
|
|
- return prev;
|
|
|
|
|
|
+ return prev
|
|
}
|
|
}
|
|
- }, 0);
|
|
|
|
- sums[index] = sums[index].toFixed(2);
|
|
|
|
|
|
+ }, 0)
|
|
|
|
+ sums[index] = sums[index].toFixed(2)
|
|
// console.log("sums");
|
|
// console.log("sums");
|
|
// console.log(sums[index]);
|
|
// console.log(sums[index]);
|
|
} else {
|
|
} else {
|
|
- sums[index] = "N/A";
|
|
|
|
|
|
+ sums[index] = 'N/A'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//遍历数组,找到符合条件的列
|
|
//遍历数组,找到符合条件的列
|
|
- });
|
|
|
|
- return sums;
|
|
|
|
|
|
+ })
|
|
|
|
+ return sums
|
|
},
|
|
},
|
|
getSpanArr(data) {
|
|
getSpanArr(data) {
|
|
//每次调用方法初始化
|
|
//每次调用方法初始化
|
|
- this.spanArr = [];
|
|
|
|
|
|
+ this.spanArr = []
|
|
for (var i = 0; i < data.length; i++) {
|
|
for (var i = 0; i < data.length; i++) {
|
|
if (i === 0) {
|
|
if (i === 0) {
|
|
- this.spanArr.push(1);
|
|
|
|
- data[i].group = i;
|
|
|
|
- this.pos = 0;
|
|
|
|
|
|
+ this.spanArr.push(1)
|
|
|
|
+ data[i].group = i
|
|
|
|
+ this.pos = 0
|
|
} else {
|
|
} else {
|
|
// 判断当前元素与上一个元素是否相同
|
|
// 判断当前元素与上一个元素是否相同
|
|
- if (data[i].orderId === data[i - 1].orderId
|
|
|
|
- && data[i].wagonNo === data[i - 1].wagonNo
|
|
|
|
- && data[i].OutStation === data[i - 1].OutStation) {
|
|
|
|
- this.spanArr[this.pos] += 1;
|
|
|
|
- data[i].group = data[i - 1].group;
|
|
|
|
- this.spanArr.push(0);
|
|
|
|
|
|
+ if (
|
|
|
|
+ data[i].orderId === data[i - 1].orderId &&
|
|
|
|
+ data[i].wagonNo === data[i - 1].wagonNo &&
|
|
|
|
+ data[i].OutStation === data[i - 1].OutStation
|
|
|
|
+ ) {
|
|
|
|
+ this.spanArr[this.pos] += 1
|
|
|
|
+ data[i].group = data[i - 1].group
|
|
|
|
+ this.spanArr.push(0)
|
|
} else {
|
|
} else {
|
|
- this.spanArr.push(1);
|
|
|
|
- this.pos = i;
|
|
|
|
- data[i].group = data[i - 1].group + 1;
|
|
|
|
|
|
+ this.spanArr.push(1)
|
|
|
|
+ this.pos = i
|
|
|
|
+ data[i].group = data[i - 1].group + 1
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
|
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
|
if (this.mergeList.includes(column.property)) {
|
|
if (this.mergeList.includes(column.property)) {
|
|
- const _row = this.spanArr[rowIndex];
|
|
|
|
- const _col = _row > 0 ? 1 : 0;
|
|
|
|
|
|
+ const _row = this.spanArr[rowIndex]
|
|
|
|
+ const _col = _row > 0 ? 1 : 0
|
|
return {
|
|
return {
|
|
rowspan: _row,
|
|
rowspan: _row,
|
|
colspan: _col
|
|
colspan: _col
|
|
- };
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//导出Excel
|
|
//导出Excel
|
|
exportAllReportToExcel() {
|
|
exportAllReportToExcel() {
|
|
- console.log(this.$refs.tableRef);
|
|
|
|
|
|
+ console.log(this.$refs.tableRef)
|
|
const loading = this.$loading({
|
|
const loading = this.$loading({
|
|
lock: true,
|
|
lock: true,
|
|
- text: "正在导出Excel",
|
|
|
|
- spinner: "el-icon-loading",
|
|
|
|
- background: "rgba(0, 0, 0, 0.7)"
|
|
|
|
- });
|
|
|
|
- var title = "火车发运明细";
|
|
|
|
- let tHeader = [];
|
|
|
|
- let filterVal = [];
|
|
|
|
- console.log(this.$refs.tableRef);
|
|
|
|
|
|
+ text: '正在导出Excel',
|
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
|
+ })
|
|
|
|
+ var title = '火车发运明细'
|
|
|
|
+ let tHeader = []
|
|
|
|
+ let filterVal = []
|
|
|
|
+ console.log(this.$refs.tableRef)
|
|
this.$refs.tableRef.$children.forEach(item => {
|
|
this.$refs.tableRef.$children.forEach(item => {
|
|
if (item.label != undefined && item.prop != undefined) {
|
|
if (item.label != undefined && item.prop != undefined) {
|
|
if (tHeader.indexOf(item.label) === -1) {
|
|
if (tHeader.indexOf(item.label) === -1) {
|
|
- tHeader.push(item.label);
|
|
|
|
|
|
+ tHeader.push(item.label)
|
|
}
|
|
}
|
|
if (filterVal.indexOf(item.prop) === -1) {
|
|
if (filterVal.indexOf(item.prop) === -1) {
|
|
- filterVal.push(item.prop);
|
|
|
|
|
|
+ filterVal.push(item.prop)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- });
|
|
|
|
- this.downloadLoading = true;
|
|
|
|
|
|
+ })
|
|
|
|
+ this.downloadLoading = true
|
|
require.ensure([], () => {
|
|
require.ensure([], () => {
|
|
const {
|
|
const {
|
|
export_json_to_excel
|
|
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)导出的表格名称
|
|
|
|
- });
|
|
|
|
- loading.close();
|
|
|
|
|
|
+ } = 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)导出的表格名称
|
|
|
|
+ })
|
|
|
|
+ loading.close()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-};
|
|
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
#platformStockInfo {
|
|
#platformStockInfo {
|