|
@@ -51,9 +51,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { sjTime } from "@/utils/sharedJsFile";
|
|
|
-import { getCookie } from "@/utils/util.js";
|
|
|
-import { exportExcelAdvanced } from "@/utils/exportExcelAdvanced.js";
|
|
|
+import { sjTime } from '@/utils/sharedJsFile'
|
|
|
+import { exportExcelAdvanced } from '@/utils/exportExcelAdvanced.js'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -62,115 +61,117 @@ export default {
|
|
|
startTime: null,
|
|
|
endTime: null,
|
|
|
input: null,
|
|
|
- tableTitle: "汽车抽查报表",
|
|
|
+ tableTitle: '汽车抽查报表',
|
|
|
option: {
|
|
|
// 表格请求数据的地址
|
|
|
- requestUrl: "",
|
|
|
- comparison: "orderNumber",
|
|
|
+ requestUrl: '',
|
|
|
+ comparison: 'orderNumber',
|
|
|
columnIndexs: [0, 1, 2, 7]
|
|
|
},
|
|
|
tableData: []
|
|
|
- };
|
|
|
+ }
|
|
|
},
|
|
|
created() {
|
|
|
this.option.requestUrl =
|
|
|
- "/api/v1/tms/getCapacityByDefend?apiId=474&startTime=null&endTime=null&i=" +
|
|
|
- new Date();
|
|
|
+ '/api/v1/tms/getCapacityByDefend?apiId=474&startTime=null&endTime=null&i=' +
|
|
|
+ new Date()
|
|
|
},
|
|
|
methods: {
|
|
|
exportExcel() {
|
|
|
- let startTime = null;
|
|
|
- let endTime = null;
|
|
|
+ let startTime = null
|
|
|
+ let endTime = null
|
|
|
if (this.startTime && this.endTime) {
|
|
|
- startTime = sjTime(this.startTime);
|
|
|
- endTime = sjTime(this.endTime);
|
|
|
+ startTime = sjTime(this.startTime)
|
|
|
+ endTime = sjTime(this.endTime)
|
|
|
} else {
|
|
|
- this.$message.info("没有选择时间,将默认导出当天时间");
|
|
|
+ this.$message.info('没有选择时间,将默认导出当天时间')
|
|
|
}
|
|
|
const loading = this.$loading({
|
|
|
lock: true,
|
|
|
- text: "请等待导出",
|
|
|
- spinner: "el-icon-loading",
|
|
|
- background: "rgba(0, 0, 0, 0.7)"
|
|
|
- });
|
|
|
+ text: '请等待导出',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ })
|
|
|
this.axios
|
|
|
.post(
|
|
|
- "/api/v1/tms/getCapacityByDefend?apiId=474&yes=yes&startTime=" +
|
|
|
+ '/api/v1/tms/getCapacityByDefend?apiId=474&yes=yes&startTime=' +
|
|
|
startTime +
|
|
|
- "&endTime=" +
|
|
|
+ '&endTime=' +
|
|
|
endTime +
|
|
|
- "&con=" +
|
|
|
+ '&con=' +
|
|
|
this.input
|
|
|
)
|
|
|
.then(res => {
|
|
|
- this.tableData = res.data.data;
|
|
|
- console.log(res);
|
|
|
- console.log(this.tableData);
|
|
|
+ this.tableData = res.data.data
|
|
|
+ console.log(res)
|
|
|
+ console.log(this.tableData)
|
|
|
exportExcelAdvanced(
|
|
|
this.tableTitle,
|
|
|
this.tableColumnData,
|
|
|
this.tableData
|
|
|
- );
|
|
|
+ )
|
|
|
setTimeout(() => {
|
|
|
- loading.close();
|
|
|
- }, 2000);
|
|
|
- });
|
|
|
+ loading.close()
|
|
|
+ }, 2000)
|
|
|
+ })
|
|
|
},
|
|
|
func(res) {
|
|
|
- this.tableColumnData = res.columnData;
|
|
|
- var resultNetWeightTotal = 0;
|
|
|
- var currentCapacityTotal = 0;
|
|
|
+ this.tableColumnData = res.columnData
|
|
|
+ var resultNetWeightTotal = 0
|
|
|
+ var currentCapacityTotal = 0
|
|
|
res.list.forEach(e => {
|
|
|
- currentCapacityTotal++;
|
|
|
- resultNetWeightTotal = resultNetWeightTotal + e.resultNetWeight;
|
|
|
- });
|
|
|
- this.totalNumber = resultNetWeightTotal.toFixed(2) + "t";
|
|
|
- this.totalCapacity = currentCapacityTotal;
|
|
|
+ currentCapacityTotal++
|
|
|
+ resultNetWeightTotal = resultNetWeightTotal + e.resultNetWeight
|
|
|
+ })
|
|
|
+ this.totalNumber = resultNetWeightTotal.toFixed(2) + 't'
|
|
|
+ this.totalCapacity = currentCapacityTotal
|
|
|
},
|
|
|
onclick() {
|
|
|
this.option.requestUrl =
|
|
|
- "/api/v1/tms/getCapacityByDefend?apiId=474&con=" + this.input;
|
|
|
+ '/api/v1/tms/getCapacityByDefend?apiId=474&con=' + this.input
|
|
|
},
|
|
|
getRequestUrl() {
|
|
|
this.option.requestUrl =
|
|
|
- "/api/v1/tms/getCapacityByDefend?apiId=474&startTime=null&endTime=null&i=" +
|
|
|
+ '/api/v1/tms/getCapacityByDefend?apiId=474&startTime=null&endTime=null&i=' +
|
|
|
new Date() +
|
|
|
- "&con=" + this.input;
|
|
|
+ '&con=' +
|
|
|
+ this.input
|
|
|
},
|
|
|
// 添加开始结束时间筛选
|
|
|
onclickSearch() {
|
|
|
- console.log("aaaa");
|
|
|
- let startTime = null;
|
|
|
- let endTime = null;
|
|
|
+ console.log('aaaa')
|
|
|
+ let startTime = null
|
|
|
+ let endTime = null
|
|
|
if (this.startTime) {
|
|
|
- startTime = sjTime(this.startTime);
|
|
|
+ startTime = sjTime(this.startTime)
|
|
|
// console.log("startTime", startTime);
|
|
|
}
|
|
|
if (this.endTime) {
|
|
|
- endTime = sjTime(this.endTime);
|
|
|
+ endTime = sjTime(this.endTime)
|
|
|
// console.log("endTime", endTime);
|
|
|
}
|
|
|
if (startTime && endTime) {
|
|
|
if (startTime < endTime) {
|
|
|
this.option.requestUrl =
|
|
|
- "/api/v1/tms/getCapacityByDefend?apiId=474&startTime=" +
|
|
|
+ '/api/v1/tms/getCapacityByDefend?apiId=474&startTime=' +
|
|
|
startTime +
|
|
|
- "&endTime=" +
|
|
|
+ '&endTime=' +
|
|
|
endTime +
|
|
|
- "&con=" + this.input +
|
|
|
- "&i=" +
|
|
|
- new Date();
|
|
|
+ '&con=' +
|
|
|
+ this.input +
|
|
|
+ '&i=' +
|
|
|
+ new Date()
|
|
|
} else {
|
|
|
- this.startTime = null;
|
|
|
- this.endTime = null;
|
|
|
- this.$message.warning("开始时间要比结束时间早");
|
|
|
+ this.startTime = null
|
|
|
+ this.endTime = null
|
|
|
+ this.$message.warning('开始时间要比结束时间早')
|
|
|
}
|
|
|
} else {
|
|
|
- this.getRequestUrl();
|
|
|
+ this.getRequestUrl()
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-};
|
|
|
+}
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
.homeworkPath {
|