Browse Source

完成配载详情页

master
qb 1 year ago
parent
commit
734ecac06b
  1. 245
      src/option/distribution/addVehicleStowage.js
  2. 5
      src/views/distribution/artery/AddVehicleStowage.vue
  3. 214
      src/views/distribution/artery/VehicleStowageDetails.vue
  4. 80
      src/views/distribution/deliverylist/distributionDeliveryListmar.vue
  5. 104
      src/views/distribution/inventory/CreateOrder.vue

245
src/option/distribution/addVehicleStowage.js

@ -583,17 +583,17 @@ export const detailsColumnList = [
fixed: true,
isshowSummary: true,
},
{
prop: 'carsNo',
label: '配载车次号',
type: 1,
values: '',
width: '130',
checkarr: [],
fixed: true,
sortable: true,
isshowSummary: false,
},
// {
// prop: 'carsNo',
// label: '配载车次号',
// type: 1,
// values: '',
// width: '130',
// checkarr: [],
// fixed: true,
// sortable: true,
// isshowSummary: false,
// },
{
prop: 'waybillNo',
label: '运单号',
@ -604,6 +604,7 @@ export const detailsColumnList = [
fixed: true,
sortable: true,
isshowSummary: false,
isColumnMerge: true,
},
{
prop: 'orderCode',
@ -624,6 +625,7 @@ export const detailsColumnList = [
checkarr: [],
fixed: false,
sortable: true,
isColumnMerge: true,
head: false,
},
{
@ -635,6 +637,7 @@ export const detailsColumnList = [
checkarr: [],
fixed: false,
sortable: true,
isColumnMerge: true,
isshowSummary: false,
},
{
@ -646,6 +649,7 @@ export const detailsColumnList = [
checkarr: [],
fixed: false,
sortable: true,
isColumnMerge: true,
isshowSummary: false,
},
{
@ -657,6 +661,7 @@ export const detailsColumnList = [
checkarr: [],
fixed: false,
sortable: true,
isColumnMerge: true,
isshowSummary: false,
},
{
@ -667,6 +672,7 @@ export const detailsColumnList = [
width: '130',
checkarr: [],
fixed: false,
isColumnMerge: true,
sortable: true,
},
{
@ -677,21 +683,24 @@ export const detailsColumnList = [
width: '130',
checkarr: [],
fixed: false,
isColumnMerge: true,
sortable: true,
},
{
prop: 'productName',
label: '品类名称',
prop: 'waybillNum',
label: '运单总件数',
type: 1,
values: '',
width: '130',
checkarr: [],
fixed: false,
isColumnMerge: true,
isshowSummary: true,
sortable: true,
},
{
prop: 'totalNum',
label: '运单总件数',
prop: 'orderNum',
label: '件数',
type: 1,
values: '',
width: '130',
@ -701,8 +710,8 @@ export const detailsColumnList = [
sortable: true,
},
{
prop: 'totalNum',
label: '件数',
prop: 'planNum',
label: '计划件数',
type: 1,
values: '',
width: '130',
@ -712,8 +721,8 @@ export const detailsColumnList = [
sortable: true,
},
{
prop: 'totalNum',
label: '计划件数',
prop: 'loadingNum',
label: '订单装车件数',
type: 1,
values: '',
width: '130',
@ -723,8 +732,8 @@ export const detailsColumnList = [
sortable: true,
},
{
prop: 'totalNum',
label: '订单装车件数',
prop: 'unloadNum',
label: '车件数',
type: 1,
values: '',
width: '130',
@ -734,28 +743,86 @@ export const detailsColumnList = [
sortable: true,
},
{
prop: 'stockNum',
label: '在库数',
prop: 'unloadIncome',
label: '卸车收入',
type: 1,
values: '',
width: '150',
width: '130',
checkarr: [],
fixed: false,
isshowSummary: true,
sortable: true,
},
{
prop: 'price',
label: '单价',
prop: 'orderLineCost',
label: '订单干线成本',
type: 1,
values: '',
width: '150',
width: '130',
checkarr: [],
fixed: false,
isshowSummary: true,
sortable: true,
},
// {
// prop: 'totalNum',
// label: '开单单价',
// type: 1,
// values: '',
// width: '130',
// checkarr: [],
// fixed: false,
// isshowSummary: true,
// isColumnMerge: true,
// sortable: true,
// },
// {
// prop: 'totalNum',
// label: '开单名称',
// type: 1,
// values: '',
// width: '130',
// checkarr: [],
// fixed: false,
// isshowSummary: false,
// isColumnMerge: true,
// sortable: true,
// },
// {
// prop: 'totalNum',
// label: '订单开单名称',
// type: 1,
// values: '',
// width: '130',
// checkarr: [],
// fixed: false,
// isshowSummary: false,
// sortable: true,
// },
// {
// prop: 'productName',
// label: '品类名称',
// type: 1,
// values: '',
// width: '130',
// checkarr: [],
// fixed: false,
// sortable: true,
// },
// {
// prop: 'price',
// label: '单价',
// type: 1,
// values: '',
// width: '150',
// checkarr: [],
// fixed: false,
// isshowSummary: true,
// sortable: true,
// },
{
prop: 'totalWeight',
prop: 'weight',
label: '重量(KG)',
type: 1,
values: '',
@ -766,7 +833,7 @@ export const detailsColumnList = [
sortable: true,
},
{
prop: 'totalVolume',
prop: 'volume',
label: '体积',
type: 1,
values: '',
@ -777,8 +844,8 @@ export const detailsColumnList = [
sortable: true,
},
{
prop: 'freight',
label: '运费',
prop: 'totalFreight',
label: '运单运费',
type: 1,
values: '',
width: '130',
@ -788,24 +855,134 @@ export const detailsColumnList = [
sortable: true,
},
{
prop: 'customerTrain',
label: '客户车次',
prop: 'orderFreight',
label: '订单运费',
type: 1,
values: '',
width: '130',
checkarr: [],
fixed: false,
isshowSummary: true,
isColumnMerge: true,
sortable: true,
},
{
prop: 'deliveryFee',
label: '送货费',
type: 1,
values: '',
width: '130',
checkarr: [],
fixed: false,
isshowSummary: true,
isColumnMerge: true,
sortable: true,
},
{
prop: 'pickupFee',
label: '提货费',
type: 1,
values: '',
width: '130',
checkarr: [],
fixed: false,
isshowSummary: true,
isColumnMerge: true,
sortable: true,
},
{
prop: 'warehouseManagementFee',
label: '仓库管理费',
type: 1,
values: '',
width: '130',
checkarr: [],
fixed: false,
isshowSummary: true,
isColumnMerge: true,
sortable: true,
},
{
prop: 'storageFee',
label: '仓储费',
type: 1,
values: '',
width: '130',
checkarr: [],
fixed: false,
isshowSummary: true,
isColumnMerge: true,
sortable: true,
},
{
prop: 'handlingFee',
label: '装卸费',
type: 1,
values: '',
width: '130',
checkarr: [],
fixed: false,
isshowSummary: true,
isColumnMerge: true,
sortable: true,
},
{
prop: 'otherFee',
label: '其他费用',
type: 1,
values: '',
width: '130',
checkarr: [],
fixed: false,
isshowSummary: true,
isColumnMerge: true,
sortable: true,
},
{
prop: 'insuranceFee',
label: '保价费',
type: 1,
values: '',
width: '130',
checkarr: [],
fixed: false,
isshowSummary: true,
isColumnMerge: true,
sortable: true,
},
{
prop: 'totalFee',
label: '总费用',
type: 1,
values: '',
width: '130',
checkarr: [],
fixed: false,
isshowSummary: true,
isColumnMerge: true,
sortable: true,
},
// {
// prop: 'freight',
// label: '作废运单号',
// type: 1,
// values: '',
// width: '130',
// checkarr: [],
// fixed: false,
// isshowSummary: false,
// sortable: true,
// },
{
prop: 'remark',
label: '运单备注',
type: 1,
values: '',
width: '130',
width: '180',
checkarr: [],
fixed: false,
sortable: true,
isColumnMerge: true,
isshowSummary: false,
},
];

5
src/views/distribution/artery/AddVehicleStowage.vue

@ -113,7 +113,7 @@
<div class="form_row_item">
<el-form-item inline label="副驾司机">
<el-select
v-model="form.name"
v-model="form.assistantName"
filterable
remote
reserve-keyword
@ -1075,7 +1075,8 @@ const handleNameChange = (type: number) => {
form.value.driverId = _value.driverId;
form.value.driverMobile = _value.driverPhone;
} else {
form.value.name = _value.driverName;
form.value.assistantName = _value.driverName;
form.value.assistantMobile = _value.driverPhone;
form.value.assistantId = _value.driverId;
}
};

214
src/views/distribution/artery/VehicleStowageDetails.vue

@ -20,7 +20,7 @@
</el-form-item>
<el-form-item label="分摊方式">
<el-select
readonly
disabled
:teleported="false"
v-model="form.chargeType"
class="m-2"
@ -37,7 +37,7 @@
</el-form-item>
<el-form-item label="直发商家">
<el-select
readonly
disabled
:teleported="false"
v-model="form.payMethod"
class="m-2"
@ -54,7 +54,7 @@
</el-form-item>
<el-form-item label="装车方式">
<el-select
readonly
disabled
:teleported="false"
v-model="form.loadingType"
class="m-2"
@ -180,33 +180,9 @@
@timeCheck="timesc"
@selectCheck="selectsc"
@selection="selectionChange"
:arraySpanMethod="
row => {
console.log('row :>> ', row);
if (row.columnIndex === 0) {
if (row.rowIndex === 0) return [2, 1];
else if (row.rowIndex === 1) return [0, 0];
}
}
"
:arraySpanMethod="row => arraySpanMethod(row)"
>
</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">
@ -355,11 +331,18 @@ import {
postSelectEditDetailByLoadId,
} from '@/api/distribution/AddVehicleStowage';
import { postCarsLoadDetailInfo } from '@/api/distribution/VehicleStowageDetails.js';
import { postSaveNewTripartiteTransfer } from '@/api/distribution/addTripartiteTransfer.js';
import type { FormInstance, FormRules } from 'element-plus';
import { useRouter, useRoute } from 'vue-router';
import { useStore } from 'vuex';
/** 被合并的列 */
const mergeColumn = [];
//
detailsColumnList.map(val => {
if (val.isColumnMerge) mergeColumn.push(val.prop);
});
console.log('mergeColumn :>> ', mergeColumn);
// ,
const nodeInfokeys = nodeInfoColumnList.slice(1).map(val => val.prop);
@ -641,93 +624,82 @@ onMounted(() => {
}
});
/** 设置节点费用禁用 */
const handleEditForbidden = (_arr: any[]) => {
if (_arr.length === 0) return;
// (, )
const _firstChild = _arr[0];
_firstChild.blackList = ['unloadCost', 'unloadOtherCost'];
const _otherList = _arr.slice(1);
//
const _otherwhiteList = ['tollFee', 'reachTransportCost'];
//
const _otherBlackList = nodeInfokeys.filter(val => _otherwhiteList.indexOf(val) === -1);
// ;
for (let item of _otherList) {
item.blackList = _otherBlackList;
}
return [_firstChild, ..._otherList];
};
/** 请求页面数据 */
const onLoad = async () => {
// const res = postCarsLoadDetailInfo({ loadId: $route.query.loadId });
// console.log('res :>> ', res);
// 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();
details.loadId = $route.query.loadId;
const res = await postSelectEditDetailByLoadId({ loadId: details.loadId });
console.log('res :>> ', res);
const { code, data } = res.data;
details.nodeInfoData = data.allCarsLineList;
details.form = data.carsLoadEntity;
details.form.driverNameAndMobile = details.form.driverName + '/' + details.form.driverMobile;
details.pageInfo.loadType = data.loadType;
details.pageInfo.chargeType = data.chargeType;
details.pageInfo.startWarehouseInfo.warehouseId = data.carsLoadEntity.startWarehouseId;
details.pageInfo.startWarehouseInfo.warehouseName = data.carsLoadEntity.startWarehouseName;
//
if (Number(details.pageType) === 2) initOriginWarehouseOrder();
//
setTabelHeight();
};
onLoad();
/** 请求运单数据 */
const initOriginWarehouseOrder = async (params = {}) => {
try {
details.loadingObj.oldListLoading = true;
const submitData = {
...details.page,
loadId: details.pageInfo.startWarehouseInfo.warehouseId,
orderCodes: details.orderCodeList,
loadId: details.loadId,
...details.query,
...params,
};
if (submitData.orderCodes.length === 0) delete submitData.orderCodes;
const res = await postFindAllOrderList(submitData);
const res = await postCarsLoadDetailInfo(submitData);
console.log('res :>> ', res);
const { code, data } = res.data;
if (code !== 200) return;
details.oldData = data.records;
details.nodeInfoData = data.carsLoadLineList;
details.oldData = [];
data.carsLoadWaybillInfoList.forEach(val => {
details.oldData.push(
...val.carsLoadOrderInfoList.map((item, index) => {
item = { ...item, ...val };
delete item.carsLoadOrderInfoList;
if (index === 0) item.mergeColumnIndex = val.carsLoadOrderInfoList.length;
else {
item.mergeColumnIndex = 0;
for (let value of mergeColumn) {
item[value] = '';
}
}
return item;
})
);
});
details.form = data;
details.form.driverNameAndMobile = details.form.driverName + '/' + details.form.driverMobile;
details.form.assistantNameAndMobile =
details.form.assistantName + '/' + details.form.assistantMobile;
details.page.total = data.total;
} catch (error) {
console.log('error :>> ', error);
} finally {
//
await nextTick();
details.loadingObj.oldListLoading = false;
}
};
/** 请求页面数据 */
const onLoad = async () => {
details.loadId = $route.query.loadId;
//
initOriginWarehouseOrder();
//
postSelectEditDetailByLoadId({ loadId: details.loadId }).then(res => {
const { code, data } = res.data;
if (code !== 200) return;
details.pageInfo.loadType = data.loadType;
details.pageInfo.chargeType = data.chargeType;
});
// details.pageInfo.startWarehouseInfo.warehouseId = data.carsLoadEntity.startWarehouseId;
// details.pageInfo.startWarehouseInfo.warehouseName = data.carsLoadEntity.startWarehouseName;
//
//
setTabelHeight();
};
onLoad();
/** 搜索 */
const searchChange = () => {
initOriginWarehouseOrder();
@ -741,12 +713,6 @@ const searchReset = () => {
initOriginWarehouseOrder();
};
//
const clearSelectionList = () => {
details.selectionList = [];
oldColumnListNode.value.handleCheckSelect([]);
};
/** 展开列表控件 */
const showdrawer = (_flag?: boolean, _type?: number) => {
switch (_type) {
@ -766,26 +732,6 @@ const searchHide = async () => {
// 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;
@ -821,17 +767,6 @@ const selectionChange = (list: any) => {
details.selectionList = list;
};
/** 每页数量改变执行的回调 */
const sizeChange = (pageSize: number) => {
details.page.pageSize = pageSize;
initOriginWarehouseOrder();
};
/** 页码改变执行的回调 */
const currentChange = (pageNum: number) => {
initOriginWarehouseOrder();
};
/**
* 设置列表 -- 固定函数
* 弹窗的勾选回调用于更改头部数组
@ -863,11 +798,12 @@ const handleNameChange = () => {
form.value.driverMobile = _value.driverPhone;
};
const arraySpanMethod = (row, column, rowIndex, columnIndex) => {
console.log('row :>> ', row);
console.log('column :>> ', column);
console.log('rowIndex :>> ', rowIndex);
console.log('columnIndex :>> ', columnIndex);
const arraySpanMethod = (row: any) => {
const { column } = row;
if (mergeColumn.indexOf(column.property) !== -1) {
if (row.row.mergeColumnIndex !== 0) return [row.row.mergeColumnIndex, 1];
else return [0, 0];
}
};
/** 关闭页面 */

80
src/views/distribution/deliverylist/distributionDeliveryListmar.vue

@ -161,6 +161,10 @@
</template>
</tablecmt>
</div>
<!-- 勾选合计 -->
<div></div>
<div class="el-fx-btn">
<div class="el_fontsize" style="font-size: 14px">
勾选数量: {{ selectionList.length }}
@ -180,36 +184,6 @@
</el-pagination>
</div>
</el-row>
<el-row>
<!-- <el-table ref="table" v-loading="loading"-->
<!-- @selection-change="selectionChange"-->
<!-- :data="data"-->
<!-- :height="height"-->
<!-- style="width: 100%"-->
<!-- :border="option.border">-->
<!--&lt;!&ndash; <el-table-column type="selection" v-if="option.selection" width="55" align="center"></el-table-column>&ndash;&gt;-->
<!-- <el-table-column type="expand" v-if="option.expand" align="center"></el-table-column>-->
<!--&lt;!&ndash; <el-table-column v-if="option.index" label="#" type="index" width="50" align="center">&ndash;&gt;-->
<!--&lt;!&ndash; </el-table-column>&ndash;&gt;-->
<!-- <template v-for="(item,index) in option.column">-->
<!-- &lt;!&ndash; table字段 &ndash;&gt;-->
<!-- <el-table-column v-if="item.hide!==true"-->
<!-- :prop="item.prop"-->
<!-- :label="item.label"-->
<!-- :width="item.width"-->
<!-- :key="index">-->
<!-- </el-table-column>-->
<!-- </template>-->
<!-- &lt;!&ndash; 操作栏模块 &ndash;&gt;-->
<!-- <el-table-column prop="menu" label="操作" :width="220" align="center">-->
<!-- <template #="{row}">-->
<!--&lt;!&ndash; <el-button type="primary" text icon="el-icon-view" @click="handleView(row)">查看</el-button>&ndash;&gt;-->
<!-- <el-button type="primary" text icon="el-icon-view" @click="handleViewBlank(row)">查看</el-button>-->
<!-- <el-button type="primary" text icon="el-icon-view" @click="handleViewBlank(row)">查看地图</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- </el-table>-->
</el-row>
<!-- 打印模块 -->
<el-dialog title="二维码" :visible.sync="isShow" width="780px" v-model="isShow">
@ -232,46 +206,6 @@
</span>
</el-dialog>
</div>
<!-- <el-dialog v-model="dialogVisible" title="增值服务" width="30%" :model="addvalue" :before-close="handleClose">-->
<!-- <el-form-item label="增值服务" prop="freightMark">-->
<!-- <el-checkbox-group v-model="form.addvalueType" @change="handleCheckedCitiesChange">-->
<!-- <el-checkbox style="width: 100%; margin-bottom: 3%" v-for="(item, index) in addvalueServeTypeData"-->
<!-- :key="item.dictKey" :label="item.dictKey">{{ item.dictValue }}-->
<!-- <span v-if="index === 0 || index === 6 || index === 2 || index === 4">&nbsp;件数:-->
<!-- <el-input type="number" v-model="item.f" :disabled="this.form?.freightMark?.indexOf(item.dictKey) == -1"-->
<!-- @change="textbox($event, index, 1)" style="width: 20%; border: none; border-bottom: 2px solid #eee" />-->
<!-- </span>-->
<!-- <span v-if="index === 1">公里:-->
<!-- <el-input type="primary" v-model="item.a" :disabled="this.form?.freightMark?.indexOf(item.dictKey) == -1"-->
<!-- @change="textbox($event, index, 2)" style="width: 20%; border: none; border-bottom: 2px solid #eee" />-->
<!-- </span>-->
<!-- <span v-if="index === 3">距离:-->
<!-- <el-input type="number" v-model="item.b" :disabled="this.form?.freightMark?.indexOf(item.dictKey) == -1"-->
<!-- @change="textbox($event, index, 3)" style="width: 20%; border: none; border-bottom: 2px solid #eee" />-->
<!-- </span>-->
<!-- <span v-if="index === 5">人数:-->
<!-- <el-input type="number" v-model="item.c" :disabled="this.form?.freightMark?.indexOf(item.dictKey) == -1"-->
<!-- @change="textbox($event, index, 4)" style="width: 20%; border: none; border-bottom: 2px solid #eee" />-->
<!-- </span>-->
<!-- <span v-if="index === 0">楼层:-->
<!-- <el-input type="number" v-model="item.d" :disabled="this.form?.freightMark?.indexOf(item.dictKey) == -1"-->
<!-- @change="textbox($event, index, 5)" style="width: 20%; border: none; border-bottom: 2px solid #eee" />-->
<!-- </span>-->
<!-- <span v-if="item">预计费用:-->
<!-- <el-input type="number" v-model="item.e" :disabled="this.form?.freightMark?.indexOf(item.dictKey) == -1"-->
<!-- @change="textbox($event, index, 6)" style="width: 20%; border: none; border-bottom: 2px solid #eee" />-->
<!-- </span>-->
<!-- </el-checkbox>-->
<!-- </el-checkbox-group>-->
<!-- </el-form-item>-->
<!-- <template #footer>-->
<!-- <span class="dialog-footer">-->
<!-- <el-button @click="dialogVisible = false">取消</el-button>-->
<!-- <el-button type="primary" @click="aaa"> 确定(增值服务) </el-button>-->
<!-- </span>-->
<!-- </template>-->
<!-- </el-dialog>-->
</basic-container>
<edittablehead
@setcolum="setnewcolum"
@ -929,6 +863,10 @@ export default {
async setTableHeight() {
await this.$nextTick();
console.log('this.tableNode :>> ', this.$refs.tableNode.$el);
const elNode = this.$refs.tableNode.$el;
// getWinHeight
console.log('getWinHeight() :>> ', getWinHeight());
setNodeHeight(elNode, getWinHeight() - elNode.getBoundingClientRect().top - 80 + 'px');
},
//tabs
@ -1554,7 +1492,7 @@ export default {
}
.el-fx-btn {
display: flex;
justify-content: flex-end;
justify-content: space-between;
margin-right: 20px;
width: 100%;
}

104
src/views/distribution/inventory/CreateOrder.vue

@ -684,7 +684,11 @@
</el-form-item>
<div class="flex-c-c">
<el-button type="primary" icon="Position" @click="handleSubmit(ruleFormRef)"
<el-button
type="primary"
:loading="details.loadingObj.submitLoadingBtn"
icon="Position"
@click="handleSubmit(ruleFormRef)"
>提交</el-button
>
<el-button type="primary" icon="Refresh" @click="handleRefresh">重置</el-button>
@ -1224,6 +1228,8 @@ const details = reactive<any>({
stowageLoading: false,
/** 收货方 */
consignerLoading: false,
/** 提交按钮 */
submitLoadingBtn: false,
},
/** 列表复选框选中的数据 */
selectionList: [],
@ -1648,54 +1654,64 @@ const handleSubmit = (formEl: FormInstance | undefined) => {
if (!formEl) return;
formEl.validate(async valid => {
if (valid) {
//
const _flag = details.goodsList.every(val => {
console.log('val :>> ', val);
if (!val.goodsName || !isNumer(val.num) || val.num === 0) return false;
return true;
});
if (!_flag) {
return ElMessage({
type: 'warning',
message: '请填写正确的货物名称和件数',
try {
// loading
details.loadingObj.submitLoadingBtn = true;
//
const _flag = details.goodsList.every(val => {
console.log('val :>> ', val);
if (!val.goodsName || !isNumer(val.num) || val.num === 0) return false;
return true;
});
}
console.log('submit!');
const submitData = {
...details.query,
waybillDetailList: details.goodsList,
advanceIds: info.value.advanceIds,
...details.totalObj,
huilaiPay: 1,
};
if (!_flag) {
return ElMessage({
type: 'warning',
message: '请填写正确的货物名称和件数',
});
}
const { destination } = submitData;
console.log('submit!');
const submitData = {
...details.query,
waybillDetailList: details.goodsList,
advanceIds: info.value.advanceIds,
...details.totalObj,
huilaiPay: 1,
};
if (destination.length === 1) {
return ElMessage({ message: '请选择正确到站地址', type: 'warning' });
}
//
const _findeLocation = details.regionOptione
.find(val => val.value === destination[0])
.children.find(val => val.value === destination[1]);
if (destination.length === 2) {
submitData.destination = _findeLocation.label;
} else {
submitData.destination = _findeLocation.children.find(
val => val.value === destination[2]
).label;
const { destination } = submitData;
if (destination.length === 1) {
return ElMessage({ message: '请选择正确到站地址', type: 'warning' });
}
//
const _findeLocation = details.regionOptione
.find(val => val.value === destination[0])
.children.find(val => val.value === destination[1]);
if (destination.length === 2) {
submitData.destination = _findeLocation.label;
} else {
submitData.destination = _findeLocation.children.find(
val => val.value === destination[2]
).label;
}
submitData.goodsName = submitData.waybillDetailList.map(val => val.goodsName).join(',');
submitData.waybillType = 1;
if (typeof submitData.receipt === 'object')
submitData.receipt = submitData.receipt.join(',');
console.log('submitData :>> ', submitData);
const res = await postOpenOrderOpenWaybill(submitData);
const { code } = res.data;
if (code !== 200) return;
back();
console.log('res :>> ', res);
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.submitLoadingBtn = false;
}
submitData.goodsName = submitData.waybillDetailList.map(val => val.goodsName).join(',');
submitData.waybillType = 1;
if (typeof submitData.receipt === 'object') submitData.receipt = submitData.receipt.join(',');
console.log('submitData :>> ', submitData);
const res = await postOpenOrderOpenWaybill(submitData);
const { code } = res.data;
if (code !== 200) return;
back();
console.log('res :>> ', res);
} else {
console.log('error submit!');
return false;

Loading…
Cancel
Save