|
|
|
<template>
|
|
|
|
<basic-container>
|
|
|
|
<div class="avue-crud">
|
|
|
|
<el-tabs type="border-card" v-model="details.activeTab">
|
|
|
|
<el-tab-pane label="详 情 信 息" name="tab1">
|
|
|
|
<!-- 标题 基础信息 -->
|
|
|
|
<el-divider content-position="left">
|
|
|
|
<div class="flex-c-c">
|
|
|
|
<el-icon class="mr10"><Document /></el-icon> 基础信息
|
|
|
|
</div>
|
|
|
|
</el-divider>
|
|
|
|
<!-- 表单 -->
|
|
|
|
<el-form disabled :inline="true" label-width="100px" :model="form" class="el-fr-d">
|
|
|
|
<div class="fo-fl">
|
|
|
|
<el-form-item label="中转承运商" prop="carrierName" style="flex: 1">
|
|
|
|
<el-select
|
|
|
|
v-model="form.carrierName"
|
|
|
|
filterable
|
|
|
|
:teleported="false"
|
|
|
|
remote
|
|
|
|
reserve-keyword
|
|
|
|
placeholder="中转承运商"
|
|
|
|
@change="val => carrierNameChange()"
|
|
|
|
:remote-method="remoteMethod"
|
|
|
|
:loading="details.loadingObj.loading"
|
|
|
|
>
|
|
|
|
<el-option
|
|
|
|
v-for="val in details.carrierNameOptions"
|
|
|
|
:key="val.carrierName"
|
|
|
|
:label="val.carrierName"
|
|
|
|
:value="val.carrierId"
|
|
|
|
/>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="经办人" prop="operator">
|
|
|
|
<el-input v-model="form.operator" />
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="送货方式">
|
|
|
|
<el-select
|
|
|
|
:teleported="false"
|
|
|
|
v-model="form.deliveryType"
|
|
|
|
class="m-2"
|
|
|
|
placeholder="运费分摊方式"
|
|
|
|
size="default"
|
|
|
|
>
|
|
|
|
<el-option
|
|
|
|
v-for="item in details.pageInfo.deliveryType || []"
|
|
|
|
:key="item.dictValue"
|
|
|
|
:label="item.dictValue"
|
|
|
|
:value="item.dictKey"
|
|
|
|
/>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="付款方式">
|
|
|
|
<el-select
|
|
|
|
:teleported="false"
|
|
|
|
v-model="form.payMethod"
|
|
|
|
class="m-2"
|
|
|
|
placeholder="运费分摊方式"
|
|
|
|
size="default"
|
|
|
|
>
|
|
|
|
<el-option
|
|
|
|
v-for="item in details.pageInfo.payMethod || []"
|
|
|
|
:key="item.dictValue"
|
|
|
|
:label="item.dictValue"
|
|
|
|
:value="item.dictKey"
|
|
|
|
/>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="运费分摊方式">
|
|
|
|
<el-select
|
|
|
|
:teleported="false"
|
|
|
|
v-model="form.chargeType"
|
|
|
|
class="m-2"
|
|
|
|
placeholder="运费分摊方式"
|
|
|
|
size="default"
|
|
|
|
>
|
|
|
|
<el-option
|
|
|
|
v-for="item in details.pageInfo.chargeType || []"
|
|
|
|
:key="item.dictValue"
|
|
|
|
:label="item.dictValue"
|
|
|
|
:value="item.dictKey"
|
|
|
|
/>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="送货司机">
|
|
|
|
<el-select
|
|
|
|
v-model="form.driverName"
|
|
|
|
filterable
|
|
|
|
:teleported="false"
|
|
|
|
remote
|
|
|
|
@change="handleNameChange"
|
|
|
|
reserve-keyword
|
|
|
|
placeholder="输入司机名称"
|
|
|
|
:remote-method="remoteMethodDriver"
|
|
|
|
:loading="details.loadingObj.loading"
|
|
|
|
>
|
|
|
|
<el-option
|
|
|
|
v-for="val in details.driverListByName"
|
|
|
|
:key="val.driverName"
|
|
|
|
:label="val.driverName"
|
|
|
|
:value="val.driverId"
|
|
|
|
/>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="客户类型" prop="customerType">
|
|
|
|
<el-select
|
|
|
|
:teleported="false"
|
|
|
|
v-model="form.customerType"
|
|
|
|
class="m-2"
|
|
|
|
placeholder="客户类型"
|
|
|
|
size="default"
|
|
|
|
>
|
|
|
|
<el-option
|
|
|
|
v-for="item in details.pageInfo.customerType || []"
|
|
|
|
:key="item.dictValue"
|
|
|
|
:label="item.dictValue"
|
|
|
|
:value="item.dictKey"
|
|
|
|
/>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="是否结算">
|
|
|
|
<el-select
|
|
|
|
:teleported="false"
|
|
|
|
v-model="form.settlementStatus"
|
|
|
|
class="m-2"
|
|
|
|
placeholder="是否结算"
|
|
|
|
size="default"
|
|
|
|
>
|
|
|
|
<el-option
|
|
|
|
v-for="item in details.pageInfo.settlementStatus || []"
|
|
|
|
:key="item.dictValue"
|
|
|
|
:label="item.dictValue"
|
|
|
|
:value="item.dictKey"
|
|
|
|
/>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="代收贷款">
|
|
|
|
<el-input-number
|
|
|
|
placeholder="代收贷款"
|
|
|
|
:precision="2"
|
|
|
|
:min="0"
|
|
|
|
:step="1"
|
|
|
|
controls-position="right"
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="承运单号" prop="carrierOrderCode">
|
|
|
|
<el-input v-model="form.carrierOrderCode" placeholder="承运单号" />
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="承运时间" prop="carrierTime">
|
|
|
|
<el-date-picker
|
|
|
|
v-model="form.carrierTime"
|
|
|
|
type="date"
|
|
|
|
placeholder="承运时间"
|
|
|
|
size="default"
|
|
|
|
:teleported="false"
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="客户收货时间">
|
|
|
|
<el-date-picker
|
|
|
|
v-model="form.value1"
|
|
|
|
type="date"
|
|
|
|
placeholder="客户收货时间"
|
|
|
|
size="default"
|
|
|
|
:teleported="false"
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="运费" prop="num">
|
|
|
|
<el-input-number
|
|
|
|
v-model="form.num"
|
|
|
|
:precision="2"
|
|
|
|
placeholder="运费"
|
|
|
|
:min="0"
|
|
|
|
:step="1"
|
|
|
|
controls-position="right"
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="司机结算费">
|
|
|
|
<el-input-number
|
|
|
|
:precision="2"
|
|
|
|
:min="0"
|
|
|
|
placeholder="司机结算费"
|
|
|
|
:step="1"
|
|
|
|
controls-position="right"
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
<div style="flex: 1; padding-right: 0">
|
|
|
|
<el-form-item
|
|
|
|
style="width: 100%; margin: 0"
|
|
|
|
label="备注"
|
|
|
|
label-width="100px"
|
|
|
|
:inline="false"
|
|
|
|
>
|
|
|
|
<el-input type="textarea" v-model="form.remark" placeholder="备注"
|
|
|
|
/></el-form-item>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
<!-- 标题 运单信息 -->
|
|
|
|
<el-divider content-position="left">
|
|
|
|
<div class="flex-c-c">
|
|
|
|
<el-icon class="mr10"><Switch /></el-icon> 运单信息
|
|
|
|
</div>
|
|
|
|
</el-divider>
|
|
|
|
|
|
|
|
<!-- 运单池 && 调度池 -->
|
|
|
|
<!-- 列表模块 -->
|
|
|
|
|
|
|
|
<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 class="el-times" label="开单时间">
|
|
|
|
<el-date-picker
|
|
|
|
v-model="stockupDate"
|
|
|
|
type="daterange"
|
|
|
|
unlink-panels
|
|
|
|
range-separator="-"
|
|
|
|
start-placeholder="开单日期"
|
|
|
|
end-placeholder="开单日期"
|
|
|
|
:shortcuts="shortcuts"
|
|
|
|
clearable
|
|
|
|
:teleported="false"
|
|
|
|
/>
|
|
|
|
</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>
|
|
|
|
<el-button type="primary" icon="Promotion" @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, 1)" circle></el-button>
|
|
|
|
<el-button icon="el-icon-search" @click="searchHide" circle></el-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- 表格 -->
|
|
|
|
<tablecmt
|
|
|
|
ref="oldColumnListNode"
|
|
|
|
:columnList="details.columnList"
|
|
|
|
:tableData="details.oldData"
|
|
|
|
:loading="loadingObj.oldListLoading"
|
|
|
|
@inputTxt="inputsc"
|
|
|
|
@timeCheck="timesc"
|
|
|
|
@selectCheck="selectsc"
|
|
|
|
@selection="selectionChange"
|
|
|
|
>
|
|
|
|
</tablecmt>
|
|
|
|
<!-- 分页模块 -->
|
|
|
|
<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="oldPage.pageNum"
|
|
|
|
:page-sizes="[30, 50, 80, 120]"
|
|
|
|
:page-size="oldPage.pageSize"
|
|
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
:total="oldPage.total"
|
|
|
|
>
|
|
|
|
</el-pagination>
|
|
|
|
</div>
|
|
|
|
</el-tab-pane>
|
|
|
|
|
|
|
|
<el-tab-pane label="操 作 日 志" name="tab2">
|
|
|
|
<div style="min-height: 300px">
|
|
|
|
<el-steps direction="vertical" space="80px">
|
|
|
|
<el-step title="32131">
|
|
|
|
<template #description> {{ new Date() }} </template>
|
|
|
|
<template #icon>
|
|
|
|
<el-icon color="#172e60" size="20px"><HelpFilled /></el-icon>
|
|
|
|
</template>
|
|
|
|
</el-step>
|
|
|
|
<el-step title="32131">
|
|
|
|
<template #description> {{ new Date() }} </template>
|
|
|
|
<template #icon>
|
|
|
|
<el-icon color="#172e60" size="20px"><HelpFilled /></el-icon>
|
|
|
|
</template>
|
|
|
|
</el-step>
|
|
|
|
</el-steps>
|
|
|
|
</div>
|
|
|
|
</el-tab-pane>
|
|
|
|
</el-tabs>
|
|
|
|
</div>
|
|
|
|
</basic-container>
|
|
|
|
|
|
|
|
<edittablehead
|
|
|
|
@setcolum="setnewcolum"
|
|
|
|
@closce="showdrawer"
|
|
|
|
:drawerShow="drawerShow"
|
|
|
|
:columnList="columnList"
|
|
|
|
>
|
|
|
|
</edittablehead>
|
|
|
|
</template>
|
|
|
|
<!-- activeTab: 'tab1' -->
|
|
|
|
<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, computeNumber, setNodeHeight, debounce } from '@/utils/util';
|
|
|
|
import { columnList, newColumnList } from '@/option/distribution/addVehicleStowage';
|
|
|
|
import {
|
|
|
|
postloadFindLoadInitData,
|
|
|
|
postFindWarehouseListByName,
|
|
|
|
postFindAllOrderList,
|
|
|
|
postFindCarListByName,
|
|
|
|
postFindDriverListByName,
|
|
|
|
postFindCarrierByName,
|
|
|
|
} from '@/api/distribution/AddVehicleStowage';
|
|
|
|
import { postSaveNewTripartiteTransfer } from '@/api/distribution/addTripartiteTransfer.js';
|
|
|
|
import type { FormInstance, FormRules } from 'element-plus';
|
|
|
|
import { useRouter, useRoute } from 'vue-router';
|
|
|
|
import { useStore } from 'vuex';
|
|
|
|
|
|
|
|
// 获取vuex仓库
|
|
|
|
const $store = useStore();
|
|
|
|
|
|
|
|
// 获取路由实例
|
|
|
|
const $router = useRouter();
|
|
|
|
const $route = useRoute();
|
|
|
|
|
|
|
|
// 表单实例
|
|
|
|
const ruleFormRef = ref();
|
|
|
|
|
|
|
|
// 表格实例
|
|
|
|
const oldColumnListNode = ref();
|
|
|
|
const newColumnListNode = ref();
|
|
|
|
|
|
|
|
const details = reactive<any>({
|
|
|
|
activeTab: 'tab1',
|
|
|
|
/** 是否开启搜索 */
|
|
|
|
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: [],
|
|
|
|
/** 修改的列表信息 */
|
|
|
|
editColumnList: [],
|
|
|
|
/** 运单池 */
|
|
|
|
columnList,
|
|
|
|
/** 调度池 */
|
|
|
|
newColumnList,
|
|
|
|
/** 列表数据 */
|
|
|
|
newData: [],
|
|
|
|
oldData: [],
|
|
|
|
rules: {
|
|
|
|
/** 中转承运商 */
|
|
|
|
carrierName: [
|
|
|
|
{
|
|
|
|
required: true,
|
|
|
|
message: '请选择承运商',
|
|
|
|
trigger: ['change', 'blur'],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
/** 经办人 */
|
|
|
|
operator: [
|
|
|
|
{
|
|
|
|
required: true,
|
|
|
|
message: '请选择经办人',
|
|
|
|
trigger: ['change'],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
/** 客户类型 */
|
|
|
|
customerType: [
|
|
|
|
{
|
|
|
|
required: true,
|
|
|
|
message: '请选择客户类型',
|
|
|
|
trigger: ['change'],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
/** 承运单号 */
|
|
|
|
carrierOrderCode: [
|
|
|
|
{
|
|
|
|
required: true,
|
|
|
|
message: '请选择承运单号',
|
|
|
|
trigger: ['change', 'blur'],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
/** 承运时间 */
|
|
|
|
carrierTime: [
|
|
|
|
{
|
|
|
|
required: true,
|
|
|
|
message: '请选择承运时间',
|
|
|
|
trigger: ['change'],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
/** 运费 */
|
|
|
|
num: [
|
|
|
|
{
|
|
|
|
required: true,
|
|
|
|
message: '请填写运费',
|
|
|
|
trigger: ['change'],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
/** 页面loading */
|
|
|
|
loadingObj: {
|
|
|
|
/** 列表加载loading */
|
|
|
|
list: false,
|
|
|
|
oldListLoading: false,
|
|
|
|
},
|
|
|
|
/** 列表复选框选中的数据 */
|
|
|
|
selectionList: [],
|
|
|
|
newSelectionList: [],
|
|
|
|
/** 是否显示设置表格 */
|
|
|
|
drawerShow: false,
|
|
|
|
/** 分页参数 */
|
|
|
|
page: {
|
|
|
|
pageNum: 1,
|
|
|
|
pageSize: 30,
|
|
|
|
total: 0,
|
|
|
|
},
|
|
|
|
oldPage: {
|
|
|
|
pageNum: 1,
|
|
|
|
pageSize: 30,
|
|
|
|
total: 0,
|
|
|
|
},
|
|
|
|
/** 弹出层显示 */
|
|
|
|
popUpShow: {
|
|
|
|
/** 装车详情 */
|
|
|
|
truckLoadingDetailVisited: false,
|
|
|
|
/** 零担补录 */
|
|
|
|
transferVisited: false,
|
|
|
|
},
|
|
|
|
/** 列表Dom节点 */
|
|
|
|
listNode: '',
|
|
|
|
form: {
|
|
|
|
customerType: '',
|
|
|
|
},
|
|
|
|
/** 页面数据 */
|
|
|
|
pageInfo: {},
|
|
|
|
/** 承运商 */
|
|
|
|
carrierNameOptions: [],
|
|
|
|
/** 客户类型 */
|
|
|
|
customerType: [],
|
|
|
|
/** 送货司机 */
|
|
|
|
driverListByName: [],
|
|
|
|
/** 被选中在调度池的订单列表 */
|
|
|
|
orderCodeList: [],
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
const {
|
|
|
|
search,
|
|
|
|
query,
|
|
|
|
shortcuts,
|
|
|
|
stockupDate,
|
|
|
|
data,
|
|
|
|
loadingObj,
|
|
|
|
selectionList,
|
|
|
|
drawerShow,
|
|
|
|
page,
|
|
|
|
popUpShow,
|
|
|
|
form,
|
|
|
|
oldPage,
|
|
|
|
} = 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);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 初始化获取本地缓存的编辑隐藏的列表
|
|
|
|
* 固定搭配,不能更改
|
|
|
|
*/
|
|
|
|
let checkListnewarr = functions.getStorage(window.location.pathname + 'checkList');
|
|
|
|
let flexListnewarr = functions.getStorage(window.location.pathname + 'flexList');
|
|
|
|
let sortlistnewarr = functions.getStorage(window.location.pathname + 'sortlist');
|
|
|
|
if (checkListnewarr) {
|
|
|
|
details.columnList.map(item => {
|
|
|
|
item.head = false;
|
|
|
|
});
|
|
|
|
checkListnewarr.map(ite => {
|
|
|
|
details.columnList.map(item => {
|
|
|
|
if (ite == item.label) {
|
|
|
|
item.head = true;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
let arr = [];
|
|
|
|
details.columnList.map(item => {
|
|
|
|
if (item.head) {
|
|
|
|
arr.push(item.label);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
functions.setStorage(window.location.pathname + 'checkList', arr);
|
|
|
|
}
|
|
|
|
if (flexListnewarr) {
|
|
|
|
details.columnList.map(item => {
|
|
|
|
item.fixed = false;
|
|
|
|
});
|
|
|
|
flexListnewarr.map(ite => {
|
|
|
|
details.columnList.map(item => {
|
|
|
|
if (ite == item.label) {
|
|
|
|
if (item.type == 6) {
|
|
|
|
item.fixed = 'right';
|
|
|
|
} else {
|
|
|
|
item.fixed = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
let arr = [];
|
|
|
|
details.columnList.map(item => {
|
|
|
|
if (item.fixed) {
|
|
|
|
arr.push(item.label);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
functions.setStorage(window.location.pathname + 'flexList', arr);
|
|
|
|
}
|
|
|
|
if (sortlistnewarr) {
|
|
|
|
details.columnList.map(item => {
|
|
|
|
item.sortable = false;
|
|
|
|
});
|
|
|
|
sortlistnewarr.map(ite => {
|
|
|
|
details.columnList.map(item => {
|
|
|
|
if (ite == item.label) {
|
|
|
|
item.sortable = true;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
let arr = [];
|
|
|
|
details.columnList.map(item => {
|
|
|
|
if (item.sortable) {
|
|
|
|
arr.push(item.label);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
functions.setStorage(window.location.pathname + 'sortlist', arr);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
/** 请求页面数据 */
|
|
|
|
const onLoad = async (page: any) => {
|
|
|
|
const res = await postloadFindLoadInitData();
|
|
|
|
const { code, data } = res.data;
|
|
|
|
if (code !== 200) return;
|
|
|
|
details.pageInfo = data;
|
|
|
|
details.customerType = data.customerType;
|
|
|
|
console.log('data :>> ', data);
|
|
|
|
|
|
|
|
details.form.startWarehouseName = data.startWarehouseInfo.warehouseName;
|
|
|
|
details.form.startWarehouseId = data.startWarehouseInfo.warehouseId;
|
|
|
|
details.form.endWarehouseName = data.startWarehouseInfo.warehouseName;
|
|
|
|
details.form.endWarehouseId = data.startWarehouseInfo.warehouseId;
|
|
|
|
|
|
|
|
initOriginWarehouseOrder();
|
|
|
|
};
|
|
|
|
|
|
|
|
onLoad();
|
|
|
|
|
|
|
|
/** 请求运单数据 */
|
|
|
|
const initOriginWarehouseOrder = async (params = {}) => {
|
|
|
|
try {
|
|
|
|
details.loadingObj.oldListLoading = true;
|
|
|
|
const submitData = {
|
|
|
|
...details.page,
|
|
|
|
loadId: details.pageInfo.startWarehouseInfo.warehouseId,
|
|
|
|
orderCodes: details.orderCodeList,
|
|
|
|
...details.query,
|
|
|
|
...params,
|
|
|
|
};
|
|
|
|
if (submitData.orderCodes.length === 0) delete submitData.orderCodes;
|
|
|
|
const res = await postFindAllOrderList(submitData);
|
|
|
|
console.log('res :>> ', res);
|
|
|
|
const { code, data } = res.data;
|
|
|
|
if (code !== 200) return;
|
|
|
|
details.oldData = data.records;
|
|
|
|
details.page.total = data.total;
|
|
|
|
} catch (error) {
|
|
|
|
console.log('error :>> ', error);
|
|
|
|
} finally {
|
|
|
|
details.loadingObj.oldListLoading = false;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/** 搜索 */
|
|
|
|
const searchChange = () => {
|
|
|
|
onLoad(details.page);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** 清空表单 */
|
|
|
|
const searchReset = () => {
|
|
|
|
details.query = {};
|
|
|
|
details.stockupDate = [];
|
|
|
|
details.page.pageNum = 1;
|
|
|
|
onLoad(details.page);
|
|
|
|
};
|
|
|
|
|
|
|
|
// 清空复选框
|
|
|
|
const clearSelectionList = () => {
|
|
|
|
details.selectionList = [];
|
|
|
|
details.newSelectionList = [];
|
|
|
|
console.log('newColumnListNode :>> ', newColumnListNode);
|
|
|
|
console.log('oldColumnListNode :>> ', oldColumnListNode);
|
|
|
|
newColumnListNode.value.handleCheckSelect([]);
|
|
|
|
oldColumnListNode.value.handleCheckSelect([]);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** 展开列表控件 */
|
|
|
|
const showdrawer = (_flag?: boolean, _type?: number) => {
|
|
|
|
switch (_type) {
|
|
|
|
default:
|
|
|
|
console.log('123 :>> ', 123);
|
|
|
|
details.editColumnList = details.columnList;
|
|
|
|
break;
|
|
|
|
// details.
|
|
|
|
}
|
|
|
|
details.drawerShow = _flag;
|
|
|
|
};
|
|
|
|
|
|
|
|
/** 是否开启搜索区 */
|
|
|
|
const searchHide = async () => {
|
|
|
|
details.search = !details.search;
|
|
|
|
await nextTick();
|
|
|
|
setNodeHeight(details.listNode);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** 远程搜索承运商 */
|
|
|
|
const remoteMethod = value => {
|
|
|
|
if (!value) return;
|
|
|
|
const res = debounce(async () => {
|
|
|
|
const res = await postFindCarrierByName({ carrierName: value });
|
|
|
|
const { code, data } = res.data;
|
|
|
|
if (code !== 200) return;
|
|
|
|
details.carrierNameOptions = data;
|
|
|
|
}, 500);
|
|
|
|
};
|
|
|
|
|
|
|
|
/** 查询司机信息 */
|
|
|
|
const remoteMethodDriver = async val => {
|
|
|
|
const res = await postFindDriverListByName({ driverName: val });
|
|
|
|
console.log('res :>> ', res);
|
|
|
|
const { code, data } = res.data;
|
|
|
|
if (code !== 200) return;
|
|
|
|
details.driverListByName = data;
|
|
|
|
};
|
|
|
|
|
|
|
|
/** 表格表头输入框搜索 */
|
|
|
|
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 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) => {
|
|
|
|
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.columnList = newarr;
|
|
|
|
functions.setStorage(window.location.pathname + 'checkList', headarr);
|
|
|
|
} else if (type == 2) {
|
|
|
|
details.columnList = newarr;
|
|
|
|
functions.setStorage(window.location.pathname + 'flexList', headarr);
|
|
|
|
} else if (type == 3) {
|
|
|
|
details.columnList = newarr;
|
|
|
|
functions.setStorage(window.location.pathname + 'sortlist', headarr);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/** 加入调度池 */
|
|
|
|
const handleAddWaybill = () => {
|
|
|
|
details.newData = details.selectionList.map(val => {
|
|
|
|
val.planNum = val.stockNum;
|
|
|
|
val.loadingNum = 0;
|
|
|
|
|
|
|
|
return val;
|
|
|
|
});
|
|
|
|
details.orderCodeList = [
|
|
|
|
...new Set([
|
|
|
|
...details.orderCodeList,
|
|
|
|
...details.selectionList.map(val => val.orderCode + ',' + val.waybillNo),
|
|
|
|
]),
|
|
|
|
];
|
|
|
|
console.log('details.orderCodeList :>> ', details.orderCodeList);
|
|
|
|
|
|
|
|
const orderCodes = details.selectionList.map(val => val.orderCode);
|
|
|
|
clearSelectionList();
|
|
|
|
details.page.pageNum = 1;
|
|
|
|
initOriginWarehouseOrder();
|
|
|
|
};
|
|
|
|
|
|
|
|
/** 移除调度池 */
|
|
|
|
const handleRemoveWaybill = () => {
|
|
|
|
// 将被选中的数据筛选出去
|
|
|
|
details.newData = details.newData.filter((val, index) => {
|
|
|
|
const _flag = !details.newSelectionList.includes(val);
|
|
|
|
if (!_flag) {
|
|
|
|
const _code = val.orderCode + ',' + val.waybillNo;
|
|
|
|
const _index = details.orderCodeList.indexOf(_code);
|
|
|
|
// 删除映射的订单号+运单号
|
|
|
|
details.orderCodeList.splice(_index, 1);
|
|
|
|
}
|
|
|
|
return _flag;
|
|
|
|
});
|
|
|
|
clearSelectionList();
|
|
|
|
initOriginWarehouseOrder();
|
|
|
|
};
|
|
|
|
|
|
|
|
/** 新增承运商 */
|
|
|
|
const handleAddCarrier = () => {
|
|
|
|
$router.push({ path: '/basicdata/carrier/basicdataCarrier' });
|
|
|
|
};
|
|
|
|
|
|
|
|
/** 选择承运商 */
|
|
|
|
const carrierNameChange = () => {};
|
|
|
|
|
|
|
|
/** 司机改变时 */
|
|
|
|
const handleNameChange = () => {
|
|
|
|
const findValue = form.value.driverName;
|
|
|
|
const _value = details.driverListByName.find(value => value.driverId === findValue);
|
|
|
|
|
|
|
|
form.value.driverName = _value.driverName;
|
|
|
|
form.value.driverId = _value.driverId;
|
|
|
|
form.value.driverMobile = _value.driverPhone;
|
|
|
|
};
|
|
|
|
|
|
|
|
/** 关闭页面 */
|
|
|
|
const back = () => {
|
|
|
|
$store.commit('DEL_TAG_CURRENT');
|
|
|
|
$router.push({ path: '/distribution/artery/TripartiteTransfer' });
|
|
|
|
};
|
|
|
|
|
|
|
|
/** 提交 */
|
|
|
|
const handleSubmit = (formEl: FormInstance | undefined) => {
|
|
|
|
if (!formEl) return;
|
|
|
|
console.log('111 :>> ', 111);
|
|
|
|
formEl.validate(async (valid, fields) => {
|
|
|
|
if (valid) {
|
|
|
|
const submitData = {
|
|
|
|
...form.value,
|
|
|
|
carsLoadLineList: JSON.parse(JSON.stringify(details.newData)),
|
|
|
|
};
|
|
|
|
console.log('submitData :>> ', submitData);
|
|
|
|
|
|
|
|
// 目的仓
|
|
|
|
|
|
|
|
// let _lineCarsOrderList = [];
|
|
|
|
// submitData.carsLoadLineList.forEach((val, i) => {
|
|
|
|
// val.nodeType = '1';
|
|
|
|
// val.sort = i + 1;
|
|
|
|
// delete val.blackList;
|
|
|
|
// if (i === 0) return;
|
|
|
|
// // 删除无用数据
|
|
|
|
// delete val.query;
|
|
|
|
// delete val.selectionList;
|
|
|
|
// delete val.loading;
|
|
|
|
// delete val.data;
|
|
|
|
// delete val.filterData;
|
|
|
|
|
|
|
|
// _lineCarsOrderList = [
|
|
|
|
// ..._lineCarsOrderList,
|
|
|
|
// ...val.lineCarsOrderList.map(value => {
|
|
|
|
// value.nodeId = submitData.startWarehouseId;
|
|
|
|
// value.nodeName = submitData.startWarehouseName;
|
|
|
|
// value.finalNodeId = val.nodeId;
|
|
|
|
// value.totalNum = 20;
|
|
|
|
// return value;
|
|
|
|
// }),
|
|
|
|
// ];
|
|
|
|
// delete val.lineCarsOrderList;
|
|
|
|
// });
|
|
|
|
|
|
|
|
// submitData.carsLoadLineList[0].lineCarsOrderList = _lineCarsOrderList;
|
|
|
|
|
|
|
|
// console.log('submitData :>> ', submitData);
|
|
|
|
// const res = await postSaveNewTripartiteTransfer(submitData);
|
|
|
|
// const { code, msg } = res.data;
|
|
|
|
// if (code !== 200) return;
|
|
|
|
// ElMessage({
|
|
|
|
// message: msg,
|
|
|
|
// type: 'success',
|
|
|
|
// });
|
|
|
|
// back();
|
|
|
|
// console.log('res :>> ', res);
|
|
|
|
} else {
|
|
|
|
console.log('error submit!', fields);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
|
|
.fo-fl {
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
zoom: 0.9;
|
|
|
|
|
|
|
|
> div {
|
|
|
|
min-width: 25%;
|
|
|
|
margin-right: 0px;
|
|
|
|
padding: 0 10px;
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
|
|
&:nth-child(4n) {
|
|
|
|
padding-right: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 日期选择器
|
|
|
|
:deep(.el-date-editor.el-input) {
|
|
|
|
height: 100% !important;
|
|
|
|
width: 100% !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
:deep(.el-range-editor.el-input__wrapper) {
|
|
|
|
height: 100% !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
:deep(.el-select) {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
:deep(.el-input-number) {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 新增行
|
|
|
|
.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;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 页面底部站位
|
|
|
|
.footer {
|
|
|
|
height: 80px;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 提交按钮
|
|
|
|
.button-container {
|
|
|
|
z-index: 99;
|
|
|
|
position: fixed;
|
|
|
|
bottom: 30px;
|
|
|
|
left: 50%;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 标题
|
|
|
|
:deep(.el-divider__text.is-left) {
|
|
|
|
font-size: 20px;
|
|
|
|
font-weight: bold;
|
|
|
|
color: var(--el-color-primary);
|
|
|
|
}
|
|
|
|
|
|
|
|
.mr10 {
|
|
|
|
margin-right: 10px;
|
|
|
|
height: 40px;
|
|
|
|
}
|
|
|
|
|
|
|
|
:deep(.el-table__row) {
|
|
|
|
height: 30px;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 数字输入框
|
|
|
|
:deep(.nodeInfo .el-table .cell) {
|
|
|
|
overflow: initial;
|
|
|
|
}
|
|
|
|
|
|
|
|
:deep(.slotbuts) {
|
|
|
|
height: 30px;
|
|
|
|
|
|
|
|
.el-input-number {
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 错误提示
|
|
|
|
:deep(.el-form-item__error) {
|
|
|
|
z-index: 99;
|
|
|
|
--el-color-danger: #f00;
|
|
|
|
}
|
|
|
|
|
|
|
|
:deep(.el-form-item.is-error .el-input__wrapper) {
|
|
|
|
--el-color-danger: #f00;
|
|
|
|
}
|
|
|
|
|
|
|
|
:deep(
|
|
|
|
.el-form-item.is-required:not(.is-no-asterisk).asterisk-left > .el-form-item__label:before,
|
|
|
|
.el-form-item.is-required:not(.is-no-asterisk).asterisk-left
|
|
|
|
> .el-form-item__label-wrap
|
|
|
|
> .el-form-item__label:before
|
|
|
|
) {
|
|
|
|
--el-color-danger: #f00;
|
|
|
|
}
|
|
|
|
</style>
|