You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1231 lines
35 KiB

<template>
<basic-container>
<div class="avue-crud">
<!-- 搜索模块 -->
<el-row v-if="!search">
<!-- 查询模块 -->
<el-form :inline="true" :model="query" class="el-fr-d">
<el-form-item label="网点:">
<el-input v-model="query.serviceNumber" placeholder="请选择网点" clearable></el-input>
</el-form-item>
<el-form-item label="承运时间:" class="el-times">
<el-date-picker
v-model="stockupDate"
type="daterange"
unlink-panels
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
:shortcuts="shortcuts"
clearable
/>
</el-form-item>
<el-form-item label="发车时间:" class="el-times">
<el-date-picker
v-model="stockupDate"
type="daterange"
unlink-panels
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
:shortcuts="shortcuts"
clearable
/>
</el-form-item>
<el-form-item label="创建时间:" class="el-times">
<el-date-picker
v-model="stockupDate"
type="daterange"
unlink-panels
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
:shortcuts="shortcuts"
clearable
/>
</el-form-item>
<el-form-item label="签收时间:" class="el-times">
<el-date-picker
v-model="stockupDate"
type="daterange"
unlink-panels
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
:shortcuts="shortcuts"
clearable
/>
</el-form-item>
<el-form-item label="车次号:" class="el-times">
<el-input v-model="query.stockupArea" placeholder="请输入车次号"></el-input>
</el-form-item>
<!-- 查询按钮 -->
<el-form-item class="el-btn">
<el-button type="primary" icon="el-icon-search" @click="searchChange"> </el-button>
<el-button icon="el-icon-delete" @click="searchReset()"> </el-button>
</el-form-item>
</el-form>
</el-row>
<!-- 控件模块 -->
<el-row>
<div class="avue-crud__header">
<!-- 头部左侧按钮模块 -->
<div class="avue-crud__left">
<el-button type="primary" icon="Plus" @click="handleShowTransfer('add')"
>新增中转
</el-button>
<el-button type="primary" icon="Printer" @click="searchReset()">装载清单</el-button>
<el-button type="primary" icon="Printer" @click="searchReset()"
>装载卸车清单(财务)</el-button
>
<el-button type="primary" icon="Van" @click="handleConfirmStartCar"> </el-button>
<el-button type="primary" icon="Delete" @click="handleCancelStartCar">
取消发车
</el-button>
<!-- 到达 -->
<el-button type="primary" icon="CircleCheck" @click="handleShowConfirm">
</el-button>
<el-button type="primary" icon="Edit" @click="searchReset()"> </el-button>
</div>
<!-- 头部右侧按钮模块 -->
<div class="avue-crud__right">
<el-button icon="el-icon-refresh" @click="searchChange" circle></el-button>
<el-button icon="Operation" @click="showdrawer(true)" circle></el-button>
<el-button icon="el-icon-search" @click="searchHide" circle></el-button>
</div>
</div>
</el-row>
<!-- 表格 -->
<!-- 列表模块 -->
<tablecmt
:columnList="details.columnList"
:tableData="data"
:loading="loadingObj.list"
@inputTxt="inputsc"
@timeCheck="timesc"
@btnCheck="btnsc"
@selectCheck="selectsc"
@selection="selectionChange"
>
<template #default="slotProps">
<template v-if="slotProps.scope.column.label === '中转批次号'">
<el-text @click="handleGoDetils(slotProps.scope)">{{
slotProps.scope.row.carsNo
}}</el-text>
</template>
<template v-if="slotProps.scope.column.label === '操作'">
<el-button type="text" @click="handleShowzeroAdditionalRecording(slotProps.scope)">
删除
</el-button>
<el-button type="text" @click="handleShowzeroAdditionalRecording(slotProps.scope)">
文员签收
</el-button>
<el-button type="text" @click="handleShowzeroAdditionalRecording(slotProps.scope)">
结算
</el-button>
<el-button type="text" @click="handleShowTruckLoadingDetails(slotProps.scope)"
>装车明细</el-button
>
</template>
</template>
</tablecmt>
<!-- 分页模块 -->
<el-row class="el-fy">
<div class="avue-crud__pagination flex-c-sb" style="width: 100%">
<div style="font-size: 14px">勾选数量: {{ selectionList.length }}</div>
<!-- 分页模块 -->
<el-pagination
align="right"
background
@size-change="sizeChange"
@current-change="currentChange"
:current-page="page.pageNum"
:page-sizes="[30, 50, 80, 120]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total"
>
</el-pagination>
</div>
</el-row>
</div>
</basic-container>
<!-- 编辑弹窗 -->
<el-dialog
title="装车明细"
v-model="details.popUpShow.truckLoadingDetailVisited"
width="80%"
:before-close="beforeClose"
append-to-body
class="truckLoadingDetailPopUp"
>
<el-form :inline="true" :model="query" class="el-fr-d">
<div class="fo-fl">
<el-form-item label="扫码时间:" class="el-times">
<!-- <el-input v-model="query.stockupArea" placeholder="请输入备货区"></el-input>-->
<el-date-picker
v-model="stockupDate"
type="daterange"
unlink-panels
range-separator="-"
start-placeholder="开始时间"
end-placeholder="结束时间"
:shortcuts="shortcuts"
clearable
/>
</el-form-item>
<el-form-item label="卸车时间:" class="el-times">
<!-- <el-input v-model="query.stockupArea" placeholder="请输入备货区"></el-input>-->
<el-date-picker
v-model="stockupDate"
type="daterange"
unlink-panels
range-separator="-"
start-placeholder="开始时间"
end-placeholder="结束时间"
:shortcuts="shortcuts"
clearable
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Edit" @click="searchChange">中转批量签收</el-button>
<el-button type="primary" icon="el-icon-search" @click="searchReset()"> </el-button>
<el-button icon="el-icon-printer" @click="searchReset()">二维码</el-button>
<el-button
icon="Operation"
@click="showdrawer(true, 'truckLoadingDetail')"
circle
></el-button>
</el-form-item>
</div>
</el-form>
<tablecmt
:columnList="details.detailsColumnList"
:tableData="data"
:loading="loadingObj.list"
@inputTxt="inputsc"
@timeCheck="timesc"
@btnCheck="btnsc"
@selectCheck="selectsc"
@selection="selectionChange"
>
<template #default="slotProps"> </template>
</tablecmt>
<!-- 分页模块 -->
<el-pagination
align="right"
background
@size-change="sizeChange"
@current-change="currentChange"
:current-page="trickleLoadingPage.pageNum"
:page-sizes="[30, 50, 80, 120]"
:page-size="trickleLoadingPage.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="trickleLoadingPage.total"
>
</el-pagination>
</el-dialog>
<!-- 编辑弹窗 -->
<el-dialog
title="确认到达信息"
v-model="details.popUpShow.confirmArriveVisited"
width="50%"
:before-close="beforeClose"
append-to-body
class="confirmArriveVisited"
>
<el-form :inline="false" label-width="100px" :model="query">
<el-form-item label="到达时间">
<el-date-picker
v-model="details.form.arriveDateStr"
type="datetime"
placeholder="到达时间"
size="default"
/>
</el-form-item>
<el-form-item label="备注(非必填)">
<el-input v-model="details.form.remark" type="textarea" placeholder="备注" size="default" />
</el-form-item>
</el-form>
<div class="flex-c-c">
<el-button
@click="
() => {
details.form = {};
details.popUpShow.confirmArriveVisited = false;
}
"
>
取消
</el-button>
<el-button type="primary" icon="Promotion" @click="submitConfirmArrive">提交</el-button>
</div>
</el-dialog>
<!-- 创建 && 编辑 中转 -->
<el-dialog
title="新增中转"
v-model="details.popUpShow.transferVisited"
width="80%"
:before-close="beforeClose"
append-to-body
class="transferPopUp"
>
<el-form :inline="true" label-width="100px" :model="query" class="el-fr-d">
<div class="fo-fl">
<el-form-item label="中转承运商">
<el-select
teleported="true"
v-model="query.value"
class="m-2"
placeholder="Select"
size="default"
>
<el-option
v-for="item in details.options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="经办人">
<el-select v-model="query.value" class="m-2" placeholder="Select" size="default">
<el-option
v-for="item in details.options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="送货方式">
<el-select v-model="query.value" class="m-2" placeholder="Select" size="default">
<el-option
v-for="item in details.options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="付款方式">
<el-select v-model="query.value" class="m-2" placeholder="Select" size="default">
<el-option
v-for="item in details.options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="运费分摊方式">
<el-select v-model="query.value" class="m-2" placeholder="Select" size="default">
<el-option
v-for="item in details.options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="送货司机">
<el-select v-model="query.value" class="m-2" placeholder="Select" size="default">
<el-option
v-for="item in details.options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="客户类型">
<el-select v-model="query.value" class="m-2" placeholder="Select" size="default">
<el-option
v-for="item in details.options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="是否结算">
<el-select v-model="query.value" class="m-2" placeholder="Select" size="default">
<el-option
v-for="item in details.options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="代收贷款">
<el-input-number :precision="2" :step="1" controls-position="right" />
</el-form-item>
<el-form-item label="承运单号">
<el-input />
</el-form-item>
<el-form-item label="承运时间">
<el-date-picker
v-model="query.value1"
type="date"
placeholder="承运时间"
size="default"
/>
</el-form-item>
<el-form-item label="客户收货时间">
<el-date-picker
v-model="query.value1"
type="date"
placeholder="客户收货时间"
size="default"
/>
</el-form-item>
<el-form-item label="运费">
<el-input-number :precision="2" :step="1" controls-position="right" />
</el-form-item>
<el-form-item label="司机结算费">
<el-input-number :precision="2" :step="1" controls-position="right" />
</el-form-item>
</div>
<div style="width: 100%">
<el-form-item label="备注"> <el-input type="textarea" placeholder="备注" /></el-form-item>
</div>
</el-form>
<div class="add_row">
<!-- 列表模块 -->
<div style="width: 47%">
<div class="add_row_title">运单池</div>
<div v-if="!search">
<el-form :inline="true" label-width="80px" :model="details.oldQuery" class="el-fr-d">
<div class="fo-fl">
<el-form-item label="备注" class="el-times">
<el-input></el-input>
</el-form-item>
<el-form-item label="托盘码" class="el-times">
<el-input></el-input>
</el-form-item>
<el-form-item class="el-times">
<el-date-picker
v-model="stockupDate"
type="daterange"
unlink-panels
range-separator="-"
start-placeholder="开单日期"
end-placeholder="开单日期"
:shortcuts="shortcuts"
clearable
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="searchReset()"
> </el-button
>
<el-button icon="el-icon-delete" @click="searchReset()">重置</el-button>
</el-form-item>
</div>
</el-form>
</div>
<div style="margin-bottom: 10px" class="flex-c-sb">
<!-- 控件 -->
<div class="avue-crud__right">
<el-button icon="el-icon-refresh" @click="searchChange" circle></el-button>
<el-button icon="Operation" @click="showdrawer(true, 1)" circle></el-button>
<el-button icon="el-icon-search" @click="searchHide" circle></el-button>
</div>
<el-button type="text" style="cursor: pointer" @click="handleAddWaybill">
加入调度池
<el-icon><CaretRight /></el-icon>
</el-button>
</div>
<tablecmt
:columnList="details.oldColumnList"
:tableData="details.oldData"
:loading="loadingObj.oldListLoading"
@inputTxt="inputsc"
@timeCheck="timesc"
@btnCheck="btnsc"
@selectCheck="selectsc"
@selection="selectionChange"
>
</tablecmt>
<!-- 统计行 -->
<div class="statistics_row">
<!-- <div>合计: 选择数: {{ addInfo.oldSelectionList.length }}</div>
<div>件数: {{ selectionList.length }}</div>
<div>重量: {{ selectionList.length }}</div>
<div>体积: {{ selectionList.length }}</div> -->
</div>
<div class="avue-crud__pagination flex-c-sb" style="width: 100%">
<!-- 分页模块 -->
<el-pagination
style="zoom: 0.9"
align="right"
background
@size-change="sizeChange"
@current-change="currentChange"
:current-page="zeroAdditionalRecordingInfo.oldPage.pageNum"
:page-sizes="[30, 50, 80, 120]"
:page-size="zeroAdditionalRecordingInfo.oldPage.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="zeroAdditionalRecordingInfo.oldPage.total"
>
</el-pagination>
</div>
</div>
<!-- 列表模块 -->
<div style="width: 47%">
<div class="add_row_title">调度池</div>
<div v-if="!search">
<el-form :inline="true" label-width="80px" :model="details.newQuery" class="el-fr-d">
<div class="fo-fl">
<el-form-item label="备注" class="el-times">
<el-input></el-input>
</el-form-item>
<el-form-item label="托盘码" class="el-times">
<el-input></el-input>
</el-form-item>
<el-form-item class="el-times">
<el-date-picker
v-model="stockupDate"
type="daterange"
unlink-panels
range-separator="-"
start-placeholder="开单日期"
end-placeholder="开单日期"
:shortcuts="shortcuts"
clearable
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="searchReset()"
> </el-button
>
<el-button icon="el-icon-delete" @click="searchReset()">重置</el-button>
</el-form-item>
</div>
</el-form>
</div>
<div style="margin-bottom: 10px" class="flex-c-sb">
<el-button type="text" class="pointer" @click="handleRemoveWaybill">
<el-icon><CaretLeft /></el-icon>
移除调度池
</el-button>
<!-- 控件 -->
<div class="avue-crud__right">
<el-button icon="el-icon-refresh" @click="searchChange" circle></el-button>
<el-button icon="Operation" @click="showdrawer(true, 2)" circle></el-button>
<el-button icon="el-icon-search" @click="searchHide" circle></el-button>
</div>
</div>
<tablecmt
:columnList="details.newColumnList"
:tableData="details.newData"
:loading="loadingObj.newListLoading"
@inputTxt="newInputsc"
@timeCheck="newTimesc"
@btnCheck="newBtnsc"
@selectCheck="newSelectsc"
@selection="newSelectionChange"
>
</tablecmt>
<div class="statistics_row">
<!-- <div>合计: 选择数: {{ addInfo.oldSelectionList.length }}</div>
<div>件数: {{ selectionList.length }}</div>
<div>重量: {{ selectionList.length }}</div>
<div>体积: {{ selectionList.length }}</div> -->
</div>
</div>
<!-- <el-button></el-button> -->
</div>
</el-dialog>
<!-- 列表配置显示 -->
<edittablehead
@setcolum="setnewcolum"
@closce="showdrawer"
:drawerShow="drawerShow"
:columnList="details.editColumnList"
></edittablehead>
</template>
<script setup lang="ts">
import { ref, reactive, toRefs, computed, onMounted, nextTick } from 'vue';
import functions from '@/utils/functions';
import dayjs from 'dayjs';
import { mapGetters } from 'vuex';
/** 获取字典 */
import { getDictionaryBiz } from '@/api/system/dict';
import { downloadXls } from '@/utils/util';
import {
columnList,
detailsColumnList,
oldColumnList,
newColumnList,
} from '@/option/distribution/TripartiteTransfer';
import {
postArriveCars,
postTripartiteTransferPageList,
postStartCars,
postCancelStartCars,
} from '@/api/distribution/TripartiteTransfer.js';
import { ElMessage, ElMessageBox } from 'element-plus';
import { useRouter } from 'vue-router';
// 获取路由实例
const $router = useRouter();
const details = reactive<any>({
/** 是否开启搜索 */
search: true,
/** 表格搜索条件 */
query: {},
/** 时间快捷选择设置 */
shortcuts: [
{
text: '最近一周',
value: () => {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
return [start, end];
},
},
{
text: '最近一个月',
value: () => {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
return [start, end];
},
},
{
text: '最近三个月',
value: () => {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
return [start, end];
},
},
],
/** 时间选择器数据 */
stockupDate: [],
/** 列表 */
columnList,
/** 装车明细表头信息 */
detailsColumnList,
/** 修改的列表信息 */
editColumnList: [],
/** 运单池 */
oldColumnList,
/** 调度池 */
newColumnList,
/** 列表数据 */
data: [],
newData: [],
oldData: [],
/** 页面loading */
loadingObj: {
/** 列表加载loading */
list: false,
oldListLoading: false,
},
/** 列表复选框选中的数据 */
selectionList: [],
/** 是否显示设置表格 */
drawerShow: false,
/** 分页参数 */
page: {
pageNum: 1,
pageSize: 30,
total: 0,
},
/** 装车明细分页参数 */
trickleLoadingPage: {
pageNum: 1,
pageSize: 30,
total: 0,
},
/** 弹出层显示 */
popUpShow: {
/** 装车详情 */
truckLoadingDetailVisited: false,
/** 零担补录 */
transferVisited: false,
/** 到达确认 */
confirmArriveVisited: false,
},
/** 列表Dom节点 */
listNode: '',
form: {},
/** 零担补录信息 */
zeroAdditionalRecordingInfo: {
oldPage: {
pageSize: 30,
pageNum: 1,
total: 0,
},
},
/** 无用 */
options: [],
/** 付款方式 */
payMethodOptions: [
{ value: 1, label: '现付' },
{ value: 2, label: '回付' },
],
/** 配载状态 */
loadStatusOptions: [
{ value: 0, label: '未装车' },
{ value: 10, label: '已装车' },
{ value: 20, label: '网点到车' },
{ value: 30, label: '网点发车' },
{ value: 40, label: '终点到车' },
{ value: 100, label: '取消配载' },
],
/** 是否结算 */
isSettlementOptions: [
{ value: 1, label: '未结算' },
{ value: 2, label: '已结算' },
],
/** 客户类型 */
customerTypeOptions: [
{ value: 1, label: '商城' },
{ value: 2, label: 'C端客户' },
],
/** 送货方式 */
deliveryTypeOptions: [
{ value: 1, label: '自提' },
{ value: 2, label: '送货' },
],
});
const {
search,
query,
shortcuts,
stockupDate,
data,
loadingObj,
selectionList,
drawerShow,
page,
trickleLoadingPage,
zeroAdditionalRecordingInfo,
popUpShow,
} = toRefs(details);
/** vuex */
const permission = computed(() => mapGetters(['permission', 'tagWel', 'tagList']));
console.log('permission :>> ', permission);
onMounted(() => {
const timer = setTimeout(() => {
details.listNode = document.querySelector('.maboxhi');
details.listNode.style.transition = 'all .5s ease-out';
console.log('details.listNode :>> ', details.listNode);
clearTimeout(timer);
}, 100);
});
/** 转换码值 */
const handleConversionCodeValue = (item, label, Arr) => {
const codes = Arr.map(item => item.value);
const _index = codes.indexOf(Number(item[label]));
item[label + 'Name'] = _index !== -1 ? Arr[_index].label : '未知';
};
/** 请求页面数据 */
const onLoad = async (params = {}) => {
try {
// 开启loading
details.loadingObj.list = true;
// 请求页面数据
const res = await postTripartiteTransferPageList(details.page, { ...details.query, ...params });
const { code, data } = res.data;
if (code !== 200) return;
details.data = data.records;
for (const item of details.data) {
handleConversionCodeValue(item, 'payMethod', details.payMethodOptions);
handleConversionCodeValue(item, 'loadStatus', details.loadStatusOptions);
handleConversionCodeValue(item, 'isSettlement', details.isSettlementOptions);
handleConversionCodeValue(item, 'customerType', details.customerTypeOptions);
handleConversionCodeValue(item, 'deliveryType', details.deliveryTypeOptions);
}
details.page.total = data.total;
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.list = false;
}
};
onLoad();
/** 搜索 */
const searchChange = () => {
onLoad(details.page);
};
/** 清空表单 */
const searchReset = () => {
details.query = {};
details.stockupDate = [];
details.page.pageNum = 1;
onLoad(details.page);
};
/** 展开列表控件 */
const showdrawer = (_flag?: boolean, _type?: string) => {
switch (_type) {
case 'truckLoadingDetail':
details.editColumnList = details.detailsColumnList;
break;
default:
console.log('123 :>> ', 123);
details.editColumnList = details.columnList;
break;
// details.
}
details.drawerShow = _flag;
};
/** 是否开启搜索区 */
const searchHide = () => {
function getWinHight() {
var windowHight = 0;
if (document.body.clientHeight && document.documentElement.clientHeight) {
windowHight =
document.body.clientHeight < document.documentElement.clientHeight
? document.body.clientHeight
: document.documentElement.clientHeight;
} else {
}
return document.documentElement.clientHeight;
}
details.search = !details.search;
const timer = setTimeout(() => {
details.listNode.style.height =
getWinHight() - details.listNode.getBoundingClientRect().top - 70 + 'px';
clearTimeout(timer);
}, 10);
};
/** 表格表头输入框搜索 */
const inputsc = (index, row) => {
details.query[row.prop] = index;
onLoad(details.page);
};
/** 表格表头时间选择 */
const timesc = (index, row) => {
console.log(index, row);
if (!!index) {
index = dayjs(index).format('YYYY-MM-DD');
}
details.query[row.prop] = index;
if (!index) {
delete details.query[row.prop];
}
onLoad(details.page);
};
/** 表格表头输入框搜索 */
const btnsc = () => {};
/** 表格表头下拉框选择 */
const selectsc = (index, row) => {
details.query[row.prop] = index;
if (!index) delete details.query[row.prop];
if (row.prop === 'certificateTypeName') {
details.query['certificateType'] = index;
if (!index) delete details.query['certificateType'];
}
onLoad(details.page);
};
/** 表格表头复选框选择 */
const selectionChange = (list: any) => {
console.log('list :>> ', list);
details.selectionList = list;
};
/** 表格表头输入框搜索 */
const newInputsc = (index, row) => {
details.newQuery[row.prop] = index;
onLoad(details.page);
};
/** 表格表头时间选择 */
const newTimesc = (index, row) => {
console.log(index, row);
if (!!index) {
index = dayjs(index).format('YYYY-MM-DD');
}
details.newQuery[row.prop] = index;
if (!index) {
delete details.newQuery[row.prop];
}
onLoad(details.page);
};
/** 表格表头输入框搜索 */
const newBtnsc = () => {};
/** 表格表头下拉框选择 */
const newSelectsc = (index, row) => {
details.newQuery[row.prop] = index;
if (!index) delete details.newQuery[row.prop];
if (row.prop === 'certificateTypeName') {
details.newQuery['certificateType'] = index;
if (!index) delete details.newQuery['certificateType'];
}
onLoad(details.page);
};
/** 表格表头复选框选择 */
const newSelectionChange = (list: any) => {
details.newSelectionList = list;
};
/** 每页数量改变执行的回调 */
const sizeChange = (pageSize: number) => {
details.page.pageSize = pageSize;
onLoad(details.page);
};
/** 页码改变执行的回调 */
const currentChange = () => {};
/**
* 设置列表 -- 固定函数
* 弹窗的勾选回调用于更改头部数组
* 固定搭配只需要更换 columnList
* */
const setnewcolum = (newarr, headarr, type) => {
if (type == 1) {
details.editColumnList = newarr;
functions.setStorage(window.location.pathname + 'checkList', headarr);
} else if (type == 2) {
details.editColumnList = newarr;
functions.setStorage(window.location.pathname + 'flexList', headarr);
} else if (type == 3) {
details.editColumnList = newarr;
functions.setStorage(window.location.pathname + 'sortlist', headarr);
}
};
/** 弹出层开启前清除数据 */
const beforeClose = done => {
done();
details.form = {};
details.view = false;
};
/** 显示装车详情 */
const handleShowTruckLoadingDetails = ({ row }) => {
details.popUpShow.truckLoadingDetailVisited = true;
nextTick(() => {
// 获取弹窗内表格元素节点, 并设置高度
const _node = document.querySelector('.truckLoadingDetailPopUp .maboxhi');
_node.style.height = '550px';
console.log('_node :>> ', _node);
});
};
/** 跳转零担补录 */
const handleShowzeroAdditionalRecording = ({ row }) => {
// 跳转到零担补录页面
$router.push('/distribution/artery/zeroAdditionalRecording');
};
/** 新增中转 */
const addTransfer = async () => {
$router.push({
path: '/distribution/artery/addTripartiteTransfer',
name: '新增中转',
});
return null;
};
/** 修改中转 */
const editTransfer = async () => {
return null;
};
/** 显示新增或修改中转弹窗 */
const handleShowTransfer = async (_type: string) => {
switch (_type) {
// 新增
case 'add':
await addTransfer();
break;
// 修改
case 'edit':
await editTransfer();
break;
default:
break;
}
// details.popUpShow.transferVisited = true;
// nextTick(() => {
// // 获取弹窗内表格元素节点, 并设置高度
// const _nodeList = document.querySelectorAll('.transferPopUp .maboxhi');
// _nodeList.forEach(val => (val.style.height = '300px'));
// });
};
/** 添加运单 */
const handleAddWaybill = () => {
// if (this.addInfo.oldSelectionList.length === 0) return this.$message.warning('最少选择一条运单');
// this.addInfo.newData = [...this.addInfo.newData, ...this.addInfo.oldSelectionList];
// this.addInfo.haveIds = this.addInfo.map(val => val.id);
};
/** 移除运单 */
const handleRemoveWaybill = () => {
// if (this.addInfo.newSelectionList.length === 0) return this.$message.warning('最少选择一条运单');
// this.addInfo.newData = [...this.addInfo.newData, ...this.addInfo.oldSelectionList];
// this.addInfo.haveIds = this.addInfo.map(val => val.id);
};
/** 开启到达弹窗 */
const handleShowConfirm = () => {
if (details.selectionList.length === 0) {
return ElMessage({
message: '请选择到达数据',
type: 'warning',
});
} else if (details.selectionList.length !== 1) {
return ElMessage({
message: '仅支持单条数据操作',
type: 'warning',
});
}
details.popUpShow.confirmArriveVisited = true;
};
/** 提交到达 */
const submitConfirmArrive = async () => {
if (!details.form.arriveDateStr) {
return ElMessage({
message: '请选择到达日期',
type: 'warning',
});
}
try {
const submitData = {
loadId: details.selectionList.map(val => val.id).join(','),
...details.form,
};
const res = await postArriveCars(submitData);
const { code } = res.data;
if (code !== 200) {
return;
}
ElMessage({
type: 'success',
message: '到达成功',
});
} catch (error) {
} finally {
onLoad();
}
};
/** 发车 */
const handleConfirmStartCar = () => {
if (details.selectionList.length === 0) {
return ElMessage({
message: '请选择发车数据',
type: 'warning',
});
} else if (details.selectionList.length !== 1) {
return ElMessage({
message: '仅支持单条数据操作',
type: 'warning',
});
}
ElMessageBox.confirm('确认发车吗?', 'Warning', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
}).then(async () => {
const submitData = {
loadId: details.selectionList.map(val => val.id).join(','),
};
const res = await postStartCars(submitData);
const { code } = res.data;
if (code !== 200) {
return;
}
ElMessage({
type: 'success',
message: '发车成功',
});
onLoad();
});
};
/** 取消发车 */
const handleCancelStartCar = () => {
if (details.selectionList.length === 0) {
return ElMessage({
message: '请选择发车数据',
type: 'warning',
});
} else if (details.selectionList.length !== 1) {
return ElMessage({
message: '仅支持单条数据操作',
type: 'warning',
});
}
ElMessageBox.confirm('确认取消发车吗?', 'Warning', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
}).then(async () => {
const submitData = {
loadId: details.selectionList.map(val => val.id).join(','),
};
const res = await postCancelStartCars(submitData);
const { code } = res.data;
if (code !== 200) {
return;
}
ElMessage({
type: 'success',
message: '取消发车成功',
});
onLoad();
});
};
/** 查看详情 */
const handleGoDetils = ({ row }) => {
$router.push({
path: '/distribution/artery/TripartiteTransferDetails',
query: {
name: row.carsNo + '-' + '中转详情',
loadId: row.id,
},
});
};
</script>
<style scoped lang="scss">
.fo-fl {
display: flex;
flex-wrap: wrap;
zoom: 0.9;
}
// 日期选择器
:deep(.el-date-editor.el-input) {
height: 100% !important;
width: 100% !important;
}
:deep(.el-range-editor.el-input__wrapper) {
height: 100% !important;
}
// 新增行
.add_row {
display: flex;
justify-content: space-between;
}
.add_row_title {
text-align: center;
margin-bottom: 10px;
font-size: 18px;
font-weight: bold;
}
// 统计行
.statistics_row {
margin: 10px 0;
font-size: 14px;
zoom: 0.9;
display: flex;
> div {
margin-right: 20px;
}
}
// 卡片容器
.crad_container {
display: flex;
.card_container_item {
flex: 1;
// padding: 10px;
border-radius: 5px;
box-shadow: 0 0 5px #ccc;
&:first-child {
margin-right: 20px;
}
.card_container_item_title {
padding: 10px;
border-bottom: 1px solid #ccc;
display: flex;
justify-content: space-between;
align-items: center;
}
.card_container_item_box {
padding: 10px;
}
}
}
.pointer {
cursor: pointer;
}
.transferPopUp :deep(.el-textarea) {
width: 500px;
}
</style>