|
@@ -66,41 +66,27 @@
|
|
<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>
|
|
</el-button>
|
|
</el-button>
|
|
- <el-button type="primary" @click="exportData()"
|
|
|
|
|
|
+ <el-button type="primary" @click="exportAllExcel"
|
|
><i class="el-icon-download"></i>Excel</el-button
|
|
><i class="el-icon-download"></i>Excel</el-button
|
|
>
|
|
>
|
|
- <!-- <span style="margin-left: 1rem;">合计净重:</span>
|
|
|
|
- <el-input
|
|
|
|
- v-model="totalNetWeight"
|
|
|
|
- :disabled="true"
|
|
|
|
- style="width: 120px;"
|
|
|
|
- ></el-input>
|
|
|
|
- <span style="margin-left: 1rem;">合计金额:</span>
|
|
|
|
- <el-input
|
|
|
|
- v-model="totalMoney"
|
|
|
|
- :disabled="true"
|
|
|
|
- style="width: 100px;"
|
|
|
|
- ></el-input> -->
|
|
|
|
</el-form>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
<div class="table">
|
|
<div class="table">
|
|
<el-tabs v-model="activeName" tab-click="handClick">
|
|
<el-tabs v-model="activeName" tab-click="handClick">
|
|
<!-- 未结算 -->
|
|
<!-- 未结算 -->
|
|
<el-tab-pane label="未结算" name="first">
|
|
<el-tab-pane label="未结算" name="first">
|
|
- <div class="table">
|
|
|
|
- <dilTable
|
|
|
|
- v-bind.sync="options1"
|
|
|
|
- ref="excelDom"
|
|
|
|
- @func="func"
|
|
|
|
- ></dilTable>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <dilTable
|
|
|
|
+ v-bind.sync="options1"
|
|
|
|
+ ref="excelDom"
|
|
|
|
+ @func="func"
|
|
|
|
+ ></dilTable>
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
<!-- 已结算 -->
|
|
<!-- 已结算 -->
|
|
<el-tab-pane label="已结算" name="second">
|
|
<el-tab-pane label="已结算" name="second">
|
|
- <dilTable v-bind.sync="options2"> </dilTable>
|
|
|
|
|
|
+ <dilTable v-bind.sync="options2" @func="func2"> </dilTable>
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
<el-tab-pane label="未生成详单" name="third">
|
|
<el-tab-pane label="未生成详单" name="third">
|
|
- <dilTable v-bind.sync="options3"> </dilTable>
|
|
|
|
|
|
+ <dilTable v-bind.sync="options3" @func="func3"> </dilTable>
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
</el-tabs>
|
|
</el-tabs>
|
|
</div>
|
|
</div>
|
|
@@ -190,8 +176,6 @@ export default {
|
|
newAddress: null,
|
|
newAddress: null,
|
|
//新单价Id
|
|
//新单价Id
|
|
priceId: null,
|
|
priceId: null,
|
|
- //是否打开运输单价的模态框
|
|
|
|
- addressDrawer: false,
|
|
|
|
//运输单价的表格
|
|
//运输单价的表格
|
|
Address: {
|
|
Address: {
|
|
requestUrl: "/api/v1/ams/getAddressDeliveryAddress?apiId=255",
|
|
requestUrl: "/api/v1/ams/getAddressDeliveryAddress?apiId=255",
|
|
@@ -201,7 +185,11 @@ export default {
|
|
//缓存当前选中的运输单价
|
|
//缓存当前选中的运输单价
|
|
priceMap: {},
|
|
priceMap: {},
|
|
formLabelWidth: "125px",
|
|
formLabelWidth: "125px",
|
|
- tableTitle: "内转计重详单"
|
|
|
|
|
|
+ tableTitle: "内转计重详单",
|
|
|
|
+ exportAllList: [],
|
|
|
|
+ noSettleDetailsColumn: [],
|
|
|
|
+ settleDetailsColumn: [],
|
|
|
|
+ noDetailsColumn: []
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -211,18 +199,188 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
func(res) {
|
|
func(res) {
|
|
- console.log(res.list);
|
|
|
|
|
|
+ this.noSettleDetailsColumn = res.columnData;
|
|
var totalWeight = 0;
|
|
var totalWeight = 0;
|
|
var totalAllMoney = 0;
|
|
var totalAllMoney = 0;
|
|
res.list.forEach(e => {
|
|
res.list.forEach(e => {
|
|
- console.log(e.resultNetWeight);
|
|
|
|
totalWeight = totalWeight + e.resultNetWeight;
|
|
totalWeight = totalWeight + e.resultNetWeight;
|
|
totalAllMoney = totalAllMoney + e.detailsAmount;
|
|
totalAllMoney = totalAllMoney + e.detailsAmount;
|
|
- console.log(e.detailsAmount);
|
|
|
|
});
|
|
});
|
|
this.totalNetWeight = totalWeight.toFixed(2) + "t";
|
|
this.totalNetWeight = totalWeight.toFixed(2) + "t";
|
|
this.totalMoney = totalAllMoney.toFixed(2) + "元";
|
|
this.totalMoney = totalAllMoney.toFixed(2) + "元";
|
|
},
|
|
},
|
|
|
|
+ func2(res) {
|
|
|
|
+ this.settleDetailsColumn = res.columnData;
|
|
|
|
+ },
|
|
|
|
+ func3(res) {
|
|
|
|
+ this.noDetailsColumn = res.columnData;
|
|
|
|
+ },
|
|
|
|
+ exportAllExcel() {
|
|
|
|
+ let startTime = null;
|
|
|
|
+ let endTime = null;
|
|
|
|
+ let orgCode = null;
|
|
|
|
+ let materialTypeNames = null;
|
|
|
|
+ let transRangeValues = null;
|
|
|
|
+ let shipperNames = null;
|
|
|
|
+ let capacityNo = null;
|
|
|
|
+ let carrierSsoId = null;
|
|
|
|
+ if (this.startTime && this.endTime) {
|
|
|
|
+ startTime = sjTime(this.startTime);
|
|
|
|
+ endTime = sjTime(this.endTime);
|
|
|
|
+ }
|
|
|
|
+ if (getCookie("orgCode") == "chengyunshang") {
|
|
|
|
+ carrierSsoId = getCookie("userId");
|
|
|
|
+ }
|
|
|
|
+ if (
|
|
|
|
+ getCookie("orgCode") == "dagangadmin" ||
|
|
|
|
+ getCookie("orgCode") == "zidonghuabu" ||
|
|
|
|
+ getCookie("orgCode") == "wuliuchuyunzhongxin"
|
|
|
|
+ ) {
|
|
|
|
+ orgCode = null;
|
|
|
|
+ } else {
|
|
|
|
+ orgCode = getCookie("orgCode");
|
|
|
|
+ }
|
|
|
|
+ if (this.screen == "车牌号") {
|
|
|
|
+ capacityNo = this.input;
|
|
|
|
+ }
|
|
|
|
+ if (this.screen == "承运起止范围") {
|
|
|
|
+ transRangeValues = this.input;
|
|
|
|
+ }
|
|
|
|
+ if (this.screen == "货物名称") {
|
|
|
|
+ materialTypeNames = this.input;
|
|
|
|
+ }
|
|
|
|
+ if (this.screen == "用车单位") {
|
|
|
|
+ shipperNames = this.input;
|
|
|
|
+ }
|
|
|
|
+ if (this.screen1 == "车牌号") {
|
|
|
|
+ capacityNo = this.input1;
|
|
|
|
+ }
|
|
|
|
+ if (this.screen1 == "承运起止范围") {
|
|
|
|
+ transRangeValues = this.input1;
|
|
|
|
+ }
|
|
|
|
+ if (this.screen1 == "货物名称") {
|
|
|
|
+ materialTypeNames = this.input1;
|
|
|
|
+ }
|
|
|
|
+ if (this.screen1 == "用车单位") {
|
|
|
|
+ shipperNames = this.input1;
|
|
|
|
+ }
|
|
|
|
+ if (this.activeName == "first") {
|
|
|
|
+ this.tableTitle = "未结算计费详单";
|
|
|
|
+ this.axios
|
|
|
|
+ .post(
|
|
|
|
+ "/api/v1/bms/getInwardWeightDetailsOrder?apiId=461&orderType=11&detailStatus=0" +
|
|
|
|
+ "&startTime=" +
|
|
|
|
+ startTime +
|
|
|
|
+ "&endTime=" +
|
|
|
|
+ endTime +
|
|
|
|
+ "&shipperNames=" +
|
|
|
|
+ shipperNames +
|
|
|
|
+ "&materialTypeNames=" +
|
|
|
|
+ materialTypeNames +
|
|
|
|
+ "&transRangeValues=" +
|
|
|
|
+ transRangeValues +
|
|
|
|
+ "&capacityNo=" +
|
|
|
|
+ capacityNo +
|
|
|
|
+ "&i" +
|
|
|
|
+ new Date() +
|
|
|
|
+ "&isPage=yes"
|
|
|
|
+ )
|
|
|
|
+ .then(res => {
|
|
|
|
+ console.log(res.data.data);
|
|
|
|
+ this.exportAllList = res.data.data;
|
|
|
|
+ this.exportAllReportToExcel(
|
|
|
|
+ this.tableTitle,
|
|
|
|
+ this.exportAllList,
|
|
|
|
+ this.noSettleDetailsColumn
|
|
|
|
+ );
|
|
|
|
+ });
|
|
|
|
+ } else if (this.activeName == "second") {
|
|
|
|
+ this.tableTitle = "已结算计费详单";
|
|
|
|
+ this.axios
|
|
|
|
+ .post(
|
|
|
|
+ "/api/v1/bms/getInwardWeightDetailsOrder?apiId=461&orderType=11&detailStatus=1" +
|
|
|
|
+ "&startTime=" +
|
|
|
|
+ startTime +
|
|
|
|
+ "&endTime=" +
|
|
|
|
+ endTime +
|
|
|
|
+ "&shipperNames=" +
|
|
|
|
+ shipperNames +
|
|
|
|
+ "&materialTypeNames=" +
|
|
|
|
+ materialTypeNames +
|
|
|
|
+ "&transRangeValues=" +
|
|
|
|
+ transRangeValues +
|
|
|
|
+ "&capacityNo=" +
|
|
|
|
+ capacityNo +
|
|
|
|
+ "&i" +
|
|
|
|
+ new Date() +
|
|
|
|
+ "&isPage=yes" +
|
|
|
|
+ "&orgCode=" +
|
|
|
|
+ orgCode
|
|
|
|
+ )
|
|
|
|
+ .then(res => {
|
|
|
|
+ this.exportAllList = res.data.data;
|
|
|
|
+ this.exportAllReportToExcel(
|
|
|
|
+ this.tableTitle,
|
|
|
|
+ this.exportAllList,
|
|
|
|
+ this.settleDetailsColumn
|
|
|
|
+ );
|
|
|
|
+ });
|
|
|
|
+ } else if (this.activeName == "third") {
|
|
|
|
+ this.tableTitle = "未生成计费详单数据";
|
|
|
|
+ this.axios
|
|
|
|
+ .post(
|
|
|
|
+ "/api/v1/bms/getNoInwardDetails?apiId=490" +
|
|
|
|
+ "&startTime=" +
|
|
|
|
+ startTime +
|
|
|
|
+ "&endTime=" +
|
|
|
|
+ endTime +
|
|
|
|
+ "&shipperNames=" +
|
|
|
|
+ shipperNames +
|
|
|
|
+ "&materialTypeNames=" +
|
|
|
|
+ materialTypeNames +
|
|
|
|
+ "&transRangeValues=" +
|
|
|
|
+ transRangeValues +
|
|
|
|
+ "&capacityNo=" +
|
|
|
|
+ capacityNo +
|
|
|
|
+ "&i" +
|
|
|
|
+ new Date() +
|
|
|
|
+ "&orgCode=" +
|
|
|
|
+ orgCode
|
|
|
|
+ )
|
|
|
|
+ .then(res => {
|
|
|
|
+ this.exportAllList = res.data.data;
|
|
|
|
+ this.exportAllReportToExcel(
|
|
|
|
+ this.tableTitle,
|
|
|
|
+ this.exportAllList,
|
|
|
|
+ this.noDetailsColumn
|
|
|
|
+ );
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //导出excel
|
|
|
|
+ exportAllReportToExcel(tableTitle, dataArr, columnData) {
|
|
|
|
+ var title = tableTitle;
|
|
|
|
+ let tHeader = [];
|
|
|
|
+ let filterVal = [];
|
|
|
|
+ columnData.forEach(e1 => {
|
|
|
|
+ if (tHeader.indexOf(e1.label) === -1) {
|
|
|
|
+ tHeader.push(e1.label);
|
|
|
|
+ }
|
|
|
|
+ if (filterVal.indexOf(e1.prop) === -1) {
|
|
|
|
+ filterVal.push(e1.prop);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ //导出为excel
|
|
|
|
+ this.downloadLoading = true;
|
|
|
|
+ require.ensure([], () => {
|
|
|
|
+ const {
|
|
|
|
+ export_json_to_excel
|
|
|
|
+ } = require("@/assets/excel/Export2Excel.js"); //这里必须使用绝对路径,使用@/+存放export2Excel的路径
|
|
|
|
+ // let list = this.$refs.excelDom.dataTabel;
|
|
|
|
+ let data = dataArr.map(v => filterVal.map(j => v[j])); //3.formatJson格式转换
|
|
|
|
+ export_json_to_excel(tHeader, data, title); // (title)导出的表格名称
|
|
|
|
+ });
|
|
|
|
+ },
|
|
//未结算数据
|
|
//未结算数据
|
|
options1GetRequestUrl() {
|
|
options1GetRequestUrl() {
|
|
if (getCookie("orgCode") == "chengyunshang") {
|
|
if (getCookie("orgCode") == "chengyunshang") {
|
|
@@ -344,7 +502,9 @@ export default {
|
|
"&capacityNo=" +
|
|
"&capacityNo=" +
|
|
capacityNo +
|
|
capacityNo +
|
|
"&i" +
|
|
"&i" +
|
|
- new Date();
|
|
|
|
|
|
+ new Date() +
|
|
|
|
+ "&orgCode=" +
|
|
|
|
+ orgCode;
|
|
this.options2.requestUrl =
|
|
this.options2.requestUrl =
|
|
"/api/v1/bms/getInwardWeightDetailsOrder?apiId=461&orderType=11&detailStatus=1" +
|
|
"/api/v1/bms/getInwardWeightDetailsOrder?apiId=461&orderType=11&detailStatus=1" +
|
|
"&startTime=" +
|
|
"&startTime=" +
|
|
@@ -360,7 +520,9 @@ export default {
|
|
"&capacityNo=" +
|
|
"&capacityNo=" +
|
|
capacityNo +
|
|
capacityNo +
|
|
"&i" +
|
|
"&i" +
|
|
- new Date();
|
|
|
|
|
|
+ new Date() +
|
|
|
|
+ "&orgCode=" +
|
|
|
|
+ orgCode;
|
|
this.options3.requestUrl =
|
|
this.options3.requestUrl =
|
|
"/api/v1/bms/getNoInwardDetails?apiId=490" +
|
|
"/api/v1/bms/getNoInwardDetails?apiId=490" +
|
|
"&startTime=" +
|
|
"&startTime=" +
|
|
@@ -376,7 +538,9 @@ export default {
|
|
"&capacityNo=" +
|
|
"&capacityNo=" +
|
|
capacityNo +
|
|
capacityNo +
|
|
"&i" +
|
|
"&i" +
|
|
- new Date();
|
|
|
|
|
|
+ new Date() +
|
|
|
|
+ "&orgCode=" +
|
|
|
|
+ orgCode;
|
|
},
|
|
},
|
|
//运输订单点击浏览的事件
|
|
//运输订单点击浏览的事件
|
|
select() {
|
|
select() {
|