@@ -1595,4 +1600,16 @@ const handleExportTruckLoadingDetail = () => {
max-height: 85vh;
}
}
+
+:deep(.el-table tr) {
+ &.err_row {
+ .tabculconte,
+ .el-tooltip,
+ .el-button--text,
+ .el-text {
+ // color: #e54b4b !important;
+ color: #f00 !important;
+ }
+ }
+}
diff --git a/src/views/distribution/artery/VehicleArrivalManagement.vue b/src/views/distribution/artery/VehicleArrivalManagement.vue
index 911153ca..4a0b04cd 100644
--- a/src/views/distribution/artery/VehicleArrivalManagement.vue
+++ b/src/views/distribution/artery/VehicleArrivalManagement.vue
@@ -174,6 +174,9 @@
>
卸车报告
+
+
+ 导 出
@@ -670,6 +673,7 @@ import {
postloadCancelArriveCarByLoadId,
postUnloadByLoadId,
postUnloadByLoadIdBefore,
+ postExportCarsPageList,
} from '@/api/distribution/VehicleArrivalManagement';
import {
postStartCarByLoadId,
@@ -915,28 +919,34 @@ const onLoad = debounce(async (params = {}) => {
// 开启loading
details.loadingObj.list = true;
+ const submitData = { ...details.query, ...params };
+
const { startArr, createTimeArr, arriveTimeArr } = details.query;
// 发车时间
if (getObjType(startArr) === 'array' && startArr.length > 0) {
- params.startDate = startArr[0];
- params.endDate = startArr[1];
+ submitData.startDate = startArr[0];
+ submitData.endDate = startArr[1];
}
// 到车时间
if (getObjType(arriveTimeArr) === 'array' && arriveTimeArr.length > 0) {
- params.arriveTimeStartStr = arriveTimeArr[0];
- params.arriveTimeEndStr = arriveTimeArr[1];
+ submitData.arriveTimeStartStr = arriveTimeArr[0];
+ submitData.arriveTimeEndStr = arriveTimeArr[1];
}
// 创建时间
if (getObjType(createTimeArr) === 'array' && createTimeArr.length > 0) {
- params.createTimeStartStr = createTimeArr[0];
- params.createTimeEndStr = createTimeArr[1];
+ submitData.createTimeStartStr = createTimeArr[0];
+ submitData.createTimeEndStr = createTimeArr[1];
}
+ delete submitData.startArr;
+ delete submitData.createTimeArr;
+ delete submitData.arriveTimeArr;
+
// 请求页面数据
- const res = await postloadArriveCarsPageList(details.page, { ...details.query, ...params });
+ const res = await postloadArriveCarsPageList(details.page, submitData);
const { code, data } = res.data;
if (code !== 200) return;
details.data = data.records;
@@ -1685,6 +1695,62 @@ const handleExportTruckLoadingDetail = () => {
/** 配载图片显示 */
const handleShowVehicleImgs = async ({ row }) => {};
+
+/** 导出 */
+const handleExport = () => {
+ ElMessageBox.confirm('确定导出吗?', '提示', {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning',
+ }).then(async () => {
+ try {
+ details.loadingObj.pageLoading = true;
+
+ const submitData = { ...details.query };
+
+ const { startArr, createTimeArr, arriveTimeArr } = details.query;
+
+ // 发车时间
+ if (getObjType(startArr) === 'array' && startArr.length > 0) {
+ submitData.startDate = startArr[0];
+ submitData.endDate = startArr[1];
+ }
+
+ // 到车时间
+ if (getObjType(arriveTimeArr) === 'array' && arriveTimeArr.length > 0) {
+ submitData.arriveTimeStartStr = arriveTimeArr[0];
+ submitData.arriveTimeEndStr = arriveTimeArr[1];
+ }
+
+ // 创建时间
+ if (getObjType(createTimeArr) === 'array' && createTimeArr.length > 0) {
+ submitData.createTimeStartStr = createTimeArr[0];
+ submitData.createTimeEndStr = createTimeArr[1];
+ }
+
+ delete submitData.startArr;
+ delete submitData.createTimeArr;
+ delete submitData.arriveTimeArr;
+
+ if (details.selectionList.length > 0)
+ submitData.ids = details.selectionList.map(val => val.id).join(',');
+
+ const res = await postExportCarsPageList(submitData);
+
+ console.log('res :>> ', res);
+ const { status, data } = res;
+
+ if (status !== 200) return ElMessage.error({ message: '导出失败' });
+ console.log('data :>> ', data);
+
+ downloadXls(data, `到车管理数据 - ${dateNow()}.xlsx`);
+ } catch (error) {
+ console.log('error :>> ', error);
+ } finally {
+ details.loadingObj.pageLoading = false;
+ }
+ });
+};