8 changed files with 993 additions and 12 deletions
@ -0,0 +1,23 @@
|
||||
import request from '@/axios'; |
||||
|
||||
/** |
||||
* 获取需要装车的零担数据 |
||||
*/ |
||||
export const postFindZeroList = (data = {}) => { |
||||
return request({ |
||||
url: '/api/logpm-trunkline/carsLoad/findZeroList', |
||||
method: 'post', |
||||
data, |
||||
}); |
||||
}; |
||||
|
||||
/** |
||||
* 零担装车 |
||||
*/ |
||||
export const postLoadingZero = (data = {}) => { |
||||
return request({ |
||||
url: '/api/logpm-trunkline/api/carsLoad/loadingZero', |
||||
method: 'post', |
||||
data, |
||||
}); |
||||
}; |
@ -0,0 +1,94 @@
|
||||
/** 三方中转列表 */ |
||||
export const columnList = [ |
||||
{ |
||||
prop: '', |
||||
label: '复选框', |
||||
type: 0, |
||||
width: 55, |
||||
fixed: true, |
||||
}, |
||||
{ |
||||
prop: '', |
||||
label: '序号', |
||||
type: 12, |
||||
values: '', |
||||
width: 55, |
||||
fixed: true, |
||||
}, |
||||
{ |
||||
prop: 'waybillNo', |
||||
label: '运单号', |
||||
type: 1, |
||||
values: '', |
||||
width: '150', |
||||
checkarr: [], |
||||
fixed: false, |
||||
sortable: true, |
||||
head: false, |
||||
}, |
||||
{ |
||||
prop: 'orderCode', |
||||
label: '订单号', |
||||
type: 1, |
||||
values: '', |
||||
width: '150', |
||||
checkarr: [], |
||||
fixed: false, |
||||
sortable: true, |
||||
head: false, |
||||
}, |
||||
{ |
||||
prop: 'planNum', |
||||
label: '计划数', |
||||
type: 1, |
||||
values: '', |
||||
width: '150', |
||||
checkarr: [], |
||||
fixed: false, |
||||
sortable: true, |
||||
head: false, |
||||
}, |
||||
{ |
||||
prop: 'loadingNum', |
||||
label: '装车数', |
||||
type: 1, |
||||
values: '', |
||||
width: '150', |
||||
checkarr: [], |
||||
fixed: false, |
||||
sortable: true, |
||||
head: false, |
||||
}, |
||||
{ |
||||
prop: 'unloadingNum', |
||||
label: '卸车数', |
||||
type: 1, |
||||
values: '', |
||||
width: '150', |
||||
checkarr: [], |
||||
fixed: false, |
||||
sortable: true, |
||||
head: false, |
||||
}, |
||||
{ |
||||
prop: 'goodsName', |
||||
label: '品类', |
||||
type: 1, |
||||
values: '', |
||||
width: '150', |
||||
checkarr: [], |
||||
fixed: false, |
||||
sortable: true, |
||||
head: false, |
||||
}, |
||||
{ |
||||
prop: 'createUserName', |
||||
label: '操作', |
||||
type: 6, |
||||
values: '', |
||||
width: '300', |
||||
checkarr: [], |
||||
fixed: 'right', |
||||
sortable: false, |
||||
}, |
||||
]; |
@ -0,0 +1,783 @@
|
||||
<template> |
||||
<basic-container> |
||||
<div class="avue-crud" v-loading="details.loadingObj.pageLoading"> |
||||
<!-- 搜索模块 --> |
||||
<div v-h5uShow="!search"> |
||||
<!-- 查询模块 --> |
||||
<el-form :inline="true" :model="query" class="header_search"> |
||||
<!-- 查询按钮 --> |
||||
<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> |
||||
</div> |
||||
|
||||
<!-- 控件模块 --> |
||||
<div class="avue-crud__header"> |
||||
<!-- 头部左侧按钮模块 --> |
||||
<div class="avue-crud__left"></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> |
||||
|
||||
<!-- 列表模块 --> |
||||
<tablecmt |
||||
ref="tableNodeRef" |
||||
: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-tag |
||||
:class="{ |
||||
sub: Number(slotProps.scope.row.scanStatus) === 1, |
||||
err: Number(slotProps.scope.row.scanStatus) === 2, |
||||
primary: Number(slotProps.scope.row.scanStatus) === 3, |
||||
}" |
||||
> |
||||
{{ slotProps.scope.row.scanStatusName }} |
||||
</el-tag> |
||||
</template> |
||||
|
||||
<!-- 操作 --> |
||||
<template v-else-if="slotProps.scope.column.label === '操作'"> |
||||
<el-text @click="() => handleZeroLoad(slotProps.scope, 'load')"> 零担装车 </el-text> |
||||
|
||||
<el-text @click="() => handleZeroLoad(slotProps.scope, 'view')"> 零担详情 </el-text> |
||||
|
||||
<!-- 零担二维码 --> |
||||
<el-text @click="() => printOrderByZero(slotProps.scope)">零担二维码</el-text> |
||||
</template> |
||||
</template> |
||||
</tablecmt> |
||||
</div> |
||||
</basic-container> |
||||
|
||||
<!-- 零担卸车 --> |
||||
<el-dialog |
||||
:title="details.zeroItem.type === 'load' ? '零担卸车' : '零担详情'" |
||||
v-model="details.popUpShow.transferVisited" |
||||
width="40%" |
||||
append-to-body |
||||
class="truckLoadingDetailPopUp" |
||||
> |
||||
<div class="editZeroCategoryTitleRowByLine">订单信息</div> |
||||
|
||||
<div class="editZeroCategoryTitleRow mt10"> |
||||
<div class="title"> |
||||
<span>运单号:</span> |
||||
<span>{{ details.zeroItem.waybillNo }}</span> |
||||
</div> |
||||
|
||||
<div class="title"> |
||||
<span>订单号:</span> |
||||
<span>{{ details.zeroItem.orderCode }}</span> |
||||
</div> |
||||
|
||||
<div class="title"> |
||||
<span>计划数:</span> |
||||
<span>{{ details.zeroItem.planNum }}</span> |
||||
</div> |
||||
|
||||
<div class="title"> |
||||
<span>装车数:</span> |
||||
<span>{{ details.zeroItem.loadingNum }}</span> |
||||
</div> |
||||
</div> |
||||
|
||||
<!-- 品类详情 --> |
||||
<div class="editZeroCategoryTitleRowByLine mt10">品类详情</div> |
||||
|
||||
<!-- 列表 --> |
||||
<div class="editZeroCategoryList"> |
||||
<!-- 子项 --> |
||||
<div |
||||
class="editZeroCategoryList_item" |
||||
v-for="item in details.zeroItem.zeroPackageList" |
||||
:key="item.packageId" |
||||
> |
||||
<!-- 标题行 --> |
||||
<div class="editZeroCategoryTitleRow"> |
||||
<div class="title"> |
||||
<span>品类名:</span> |
||||
<span>{{ item.goodsName }}</span> |
||||
</div> |
||||
|
||||
<div class="title"> |
||||
<span>在库数:</span> |
||||
<span>{{ item.stockNum }}</span> |
||||
</div> |
||||
|
||||
<div class="title"> |
||||
<span>装车数:</span> |
||||
<span>{{ item.loadingNum }}</span> |
||||
</div> |
||||
</div> |
||||
|
||||
<template v-if="details.zeroItem.type === 'load'"> |
||||
<el-input-number |
||||
class="inputNum mt10 w100" |
||||
v-model="item.enterNum" |
||||
controls-position="right" |
||||
:precision="0" |
||||
:min="0" |
||||
:max="item.maxNum" |
||||
:step="1" |
||||
:value-on-clear="0" |
||||
:controls="false" |
||||
/> |
||||
</template> |
||||
</div> |
||||
</div> |
||||
|
||||
<!-- <el-form-item label="零担卸车数量" label-width="100px"> |
||||
<el-input-number |
||||
style="width: 100%" |
||||
:precision="0" |
||||
:max="details.zeroItem.num" |
||||
:min="0" |
||||
:controls="false" |
||||
v-model="details.zeroItem.enterNum" |
||||
/> |
||||
</el-form-item> --> |
||||
|
||||
<!-- 表单按钮 --> |
||||
<div class="flex-c-c" v-if="details.zeroItem.type === 'load'"> |
||||
<el-button icon="Close" @click="details.popUpShow.transferVisited = false"> 取 消 </el-button> |
||||
<el-button type="primary" icon="Position" @click="handleZeroUnLoadSubmit"> 提 交 </el-button> |
||||
</div> |
||||
</el-dialog> |
||||
|
||||
<!-- 打印二维码 --> |
||||
|
||||
<MyPrint |
||||
:html="details.html" |
||||
v-model="details.popUpShow.QRCodeVisible" |
||||
width="780px" |
||||
type="titlePrint" |
||||
:isShowExport="false" |
||||
/> |
||||
|
||||
<!-- 列表配置显示 --> |
||||
<edittablehead |
||||
@closce="showdrawer" |
||||
:drawerShow="drawerShow" |
||||
:columnList="details.columnList" |
||||
v-model="details.columnList" |
||||
></edittablehead> |
||||
</template> |
||||
|
||||
<script setup lang="ts"> |
||||
import { ref, reactive, toRefs, computed, onMounted, nextTick, watch } from 'vue'; |
||||
import dayjs from 'dayjs'; |
||||
import { mapGetters, useStore } from 'vuex'; |
||||
import { ElMessage, ElMessageBox } from 'element-plus'; |
||||
import { getMyCurrentWarehouse } from '@/api/work/work'; |
||||
import { |
||||
postTransferUnloadZero, |
||||
postShowOrderCodeByCode, |
||||
postFindZeroDetailByCarsLoadScanId, |
||||
postUnloadZero, |
||||
} from '@/api/distribution/truckLoadingDetails'; |
||||
import { postFindZeroList, postLoadingZero } from '@/api/distribution/VehicleStowageZeroLoading'; |
||||
import { getShowAdvancePackgeCode } from '@/api/waybill/orderPackageListDetails'; |
||||
/** 获取字典 */ |
||||
import { getDictionaryBiz } from '@/api/system/dict'; |
||||
import { |
||||
downloadXls, |
||||
getHtmls, |
||||
debounce, |
||||
setNodeHeight, |
||||
deepClone, |
||||
handleClearTableQuery, |
||||
getObjType, |
||||
ChecksWhetherTheWarehouseIsSelected, |
||||
} from '@/utils/util'; |
||||
import { columnList } from '@/option/distribution/VehicleStowageZeroLoading'; |
||||
import { useRouter, useRoute } from 'vue-router'; |
||||
|
||||
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]; |
||||
}, |
||||
}, |
||||
], |
||||
/** 装车明细表头信息 */ |
||||
columnList: deepClone(columnList), |
||||
/** 列表数据 */ |
||||
data: [], |
||||
/** 页面loading */ |
||||
loadingObj: { |
||||
/** 列表加载loading */ |
||||
list: false, |
||||
/** 页面loading */ |
||||
pageLoading: false, |
||||
/** 查看二维码 */ |
||||
QRCodeVisible: false, |
||||
}, |
||||
/** 列表复选框选中的数据 */ |
||||
selectionList: [], |
||||
/** 是否显示设置表格 */ |
||||
drawerShow: false, |
||||
/** 分页参数 */ |
||||
page: { |
||||
pageNum: 1, |
||||
pageSize: 30, |
||||
total: 0, |
||||
}, |
||||
/** 弹出层显示 */ |
||||
popUpShow: { |
||||
/** 零担补录 */ |
||||
transferVisited: false, |
||||
}, |
||||
form: {}, |
||||
/** 页面数据 */ |
||||
pageInfo: { |
||||
/** 配送ID */ |
||||
loadId: '', |
||||
/** 页面类型 |
||||
* TripartiteTransfer -- 三方中转 |
||||
* VehicleStowage -- 车辆配载 |
||||
* */ |
||||
type: '', |
||||
}, |
||||
/** 被选中的零担数据 */ |
||||
zeroItem: {}, |
||||
/** 个人仓库信息 */ |
||||
myWarehouseData: {}, |
||||
/** 打印的二维码 */ |
||||
html: '', |
||||
}); |
||||
|
||||
const { |
||||
search, |
||||
query, |
||||
shortcuts, |
||||
data, |
||||
loadingObj, |
||||
selectionList, |
||||
drawerShow, |
||||
page, |
||||
trickleLoadingPage, |
||||
} = toRefs(details); |
||||
|
||||
// 获取路由实例 |
||||
const $router = useRouter(); |
||||
const $route = useRoute(); |
||||
|
||||
// vuex |
||||
const $store = useStore(); |
||||
|
||||
/** vuex */ |
||||
const permission = computed(() => mapGetters(['permission', 'tagWel', 'tagList'])); |
||||
|
||||
/** 权限按钮 */ |
||||
const permissionObj = reactive({ |
||||
// VehicleStowage -- 车辆配载; VehicleArrivalManagement -- 到车管理; TripartiteTransfer -- 三方中转 |
||||
|
||||
/** 计划仓更改 */ |
||||
truckLoadingDetails_changePlanWarehouse: computed(() => { |
||||
let _flag = false; |
||||
switch (details.pageInfo.type) { |
||||
case 'VehicleStowage': |
||||
_flag = $store.getters.permission.truckLoadingDetails_VehicleStowage_changePlanWarehouse; |
||||
break; |
||||
|
||||
default: |
||||
break; |
||||
} |
||||
return _flag; |
||||
}), |
||||
|
||||
/** 中转批量签收 */ |
||||
truckLoadingDetails_batchSign: computed(() => { |
||||
let _flag = false; |
||||
switch (details.pageInfo.type) { |
||||
case 'TripartiteTransfer': |
||||
_flag = $store.getters.permission.truckLoadingDetails_TripartiteTransfer_BatchSigin; |
||||
break; |
||||
|
||||
default: |
||||
break; |
||||
} |
||||
return _flag; |
||||
}), |
||||
|
||||
/** 批量卸车 */ |
||||
truckLoadingDetails_batchUnload: computed(() => { |
||||
let _flag = false; |
||||
switch (details.pageInfo.type) { |
||||
case 'VehicleArrivalManagement': |
||||
_flag = $store.getters.permission.truckLoadingDetails_VehicleArrivalManagement_batchUnload; |
||||
break; |
||||
|
||||
case 'TripartiteTransfer': |
||||
_flag = $store.getters.permission.truckLoadingDetails_TripartiteTransfer_batchUnload; |
||||
break; |
||||
|
||||
default: |
||||
break; |
||||
} |
||||
return _flag; |
||||
}), |
||||
|
||||
/** 删除 */ |
||||
truckLoadingDetails_delete: computed(() => { |
||||
let _flag = false; |
||||
switch (details.pageInfo.type) { |
||||
case 'VehicleStowage': |
||||
_flag = $store.getters.permission.truckLoadingDetails_VehicleStowage_delete; |
||||
break; |
||||
|
||||
case 'VehicleArrivalManagement': |
||||
_flag = $store.getters.permission.truckLoadingDetails_VehicleArrivalManagement_delete; |
||||
break; |
||||
|
||||
case 'TripartiteTransfer': |
||||
_flag = $store.getters.permission.truckLoadingDetails_TripartiteTransfer_delete; |
||||
break; |
||||
|
||||
default: |
||||
break; |
||||
} |
||||
return _flag; |
||||
}), |
||||
|
||||
/** 零担卸车 */ |
||||
truckLoadingDetails_zeroUnload: computed(() => { |
||||
let _flag = false; |
||||
switch (details.pageInfo.type) { |
||||
case 'VehicleStowage': |
||||
_flag = $store.getters.permission.truckLoadingDetails_VehicleStowage_zeroUnload; |
||||
break; |
||||
|
||||
case 'VehicleArrivalManagement': |
||||
_flag = $store.getters.permission.truckLoadingDetails_VehicleArrivalManagement_zeroUnload; |
||||
break; |
||||
|
||||
case 'TripartiteTransfer': |
||||
_flag = $store.getters.permission.truckLoadingDetails_TripartiteTransfer_zeroUnload; |
||||
break; |
||||
|
||||
default: |
||||
break; |
||||
} |
||||
return _flag; |
||||
}), |
||||
|
||||
/** 包件卸车 */ |
||||
truckLoadingDetails_packageUnload: computed(() => { |
||||
let _flag = false; |
||||
switch (details.pageInfo.type) { |
||||
case 'VehicleStowage': |
||||
_flag = $store.getters.permission.truckLoadingDetails_VehicleStowage_packageUnload; |
||||
break; |
||||
|
||||
case 'VehicleArrivalManagement': |
||||
_flag = |
||||
$store.getters.permission.truckLoadingDetails_VehicleArrivalManagement_packageUnload; |
||||
break; |
||||
|
||||
case 'TripartiteTransfer': |
||||
_flag = $store.getters.permission.truckLoadingDetails_TripartiteTransfer_packageUnload; |
||||
break; |
||||
|
||||
default: |
||||
break; |
||||
} |
||||
return _flag; |
||||
}), |
||||
}); |
||||
|
||||
// 表格实例 |
||||
const tableNodeRef = ref(); |
||||
|
||||
/** 初始化表格表头 */ |
||||
const initTableSelect = () => { |
||||
for (const iterator of details.columnList) { |
||||
console.log('iterator :>> ', iterator); |
||||
iterator.checkarr = details[iterator.prop.replace('Name', '') + 'Option'] || []; |
||||
} |
||||
}; |
||||
|
||||
initTableSelect(); |
||||
|
||||
getMyCurrentWarehouse({}).then(res => { |
||||
console.log('res :>> ', res); |
||||
const { code, data } = res.data; |
||||
if (code !== 200) return; |
||||
details.myWarehouseData = data; |
||||
}); |
||||
|
||||
/** 请求页面数据 */ |
||||
const onLoad = debounce(async (params = {}) => { |
||||
try { |
||||
// 开启loading |
||||
details.loadingObj.list = true; |
||||
|
||||
details.query.loadId = details.pageInfo.loadId; |
||||
|
||||
const submitData = { ...details.query, ...params }; |
||||
|
||||
// 请求页面数据 |
||||
const res = await postFindZeroList(submitData); |
||||
const { code, data } = res.data; |
||||
if (code !== 200) return; |
||||
details.data = data; |
||||
|
||||
for (let i = 0; i < details.data.length; i++) { |
||||
const value = details.data[i]; |
||||
|
||||
value.goodsName = value.zeroPackageList.map(val => val.goodsName).join(','); |
||||
} |
||||
} catch (error) { |
||||
console.log('error :>> ', error); |
||||
} finally { |
||||
details.loadingObj.list = false; |
||||
} |
||||
}, 10); |
||||
|
||||
/** 搜索 */ |
||||
const searchChange = () => { |
||||
onLoad(); |
||||
}; |
||||
|
||||
/** 清空表单 */ |
||||
const searchReset = () => { |
||||
details.query = {}; |
||||
details.page.pageNum = 1; |
||||
handleClearTableQuery(details.columnList); |
||||
onLoad(); |
||||
}; |
||||
|
||||
/** 展开列表控件 */ |
||||
const showdrawer = (_flag?: boolean) => { |
||||
details.drawerShow = _flag; |
||||
}; |
||||
|
||||
/** 是否开启搜索区 */ |
||||
const searchHide = () => { |
||||
details.search = !details.search; |
||||
|
||||
setNodeHeight(tableNodeRef.value.$el, '', true); |
||||
}; |
||||
|
||||
/** 表格表头输入框搜索 */ |
||||
const inputsc = (index, row) => { |
||||
details.query[row.prop] = index; |
||||
|
||||
if (!index && index !== 0) delete details.query[row.prop]; |
||||
onLoad(); |
||||
}; |
||||
|
||||
/** 表格表头时间选择 */ |
||||
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(); |
||||
}; |
||||
|
||||
/** 表格表头输入框搜索 */ |
||||
const btnsc = () => {}; |
||||
|
||||
/** 表格表头下拉框选择 */ |
||||
const selectsc = (index, row) => { |
||||
const _key = row.prop.replace('Name', ''); |
||||
|
||||
details.query[_key] = index; |
||||
if (!index && index !== 0) delete details.query[_key]; |
||||
|
||||
onLoad(); |
||||
}; |
||||
|
||||
/** 表格表头复选框选择 */ |
||||
const selectionChange = (list: any) => { |
||||
details.selectionList = list; |
||||
}; |
||||
|
||||
/** 每页数量改变执行的回调 */ |
||||
const sizeChange = (pageSize: number) => { |
||||
details.page.pageSize = pageSize; |
||||
onLoad(); |
||||
}; |
||||
|
||||
/** 页码改变执行的回调 */ |
||||
const currentChange = pageNum => { |
||||
details.page.pageNum = pageNum; |
||||
onLoad(); |
||||
}; |
||||
|
||||
/** 装车 -- 零担 */ |
||||
const handleZeroLoad = async ({ row }, type) => { |
||||
if (!ChecksWhetherTheWarehouseIsSelected()) |
||||
return ElMessage.warning('多仓权限无法操作,请选择仓库'); |
||||
|
||||
if (!details.myWarehouseData) { |
||||
const res = await getMyCurrentWarehouse(); |
||||
details.myWarehouseData = res.data.data; |
||||
} |
||||
|
||||
if (!details.myWarehouseData) return ElMessage.warning('请先选择一个仓库'); |
||||
|
||||
details.zeroItem = { ...row, type }; |
||||
details.zeroItem.enterNum = !details.zeroItem.unloadNum ? row.num : details.zeroItem.unloadNum; |
||||
|
||||
details.zeroItem.zeroPackageList = row.zeroPackageList || []; |
||||
|
||||
for (let i = 0; i < details.zeroItem.zeroPackageList.length; i++) { |
||||
const item = details.zeroItem.zeroPackageList[i]; |
||||
|
||||
item.enterNum = item.loadingNum || item.stockNum || 0; |
||||
item.maxNum = (item.loadingNum || 0) + (item.stockNum || 0); |
||||
|
||||
console.log('item :>> ', item); |
||||
} |
||||
|
||||
details.popUpShow.transferVisited = true; |
||||
}; |
||||
|
||||
/** 卸车 -- 零担 -- 提交 */ |
||||
const handleZeroUnLoadSubmit = async () => { |
||||
try { |
||||
details.popUpShow.transferVisited = false; |
||||
details.loadingObj.pageLoading = true; |
||||
|
||||
// let res: any = {}; |
||||
|
||||
const submitData = { |
||||
loadId: details.pageInfo.loadId, |
||||
waybillNo: details.zeroItem.waybillNo, |
||||
orderCode: details.zeroItem.orderCode, |
||||
enterNum: 0, |
||||
|
||||
zeroPackageList: details.zeroItem.zeroPackageList, |
||||
}; |
||||
|
||||
let _loadingNum = 0; |
||||
for (let i = 0; i < submitData.zeroPackageList.length; i++) { |
||||
const val = submitData.zeroPackageList[i]; |
||||
val.enterNum = val.enterNum || 0; |
||||
_loadingNum += val.enterNum; |
||||
} |
||||
|
||||
submitData.enterNum = _loadingNum; |
||||
|
||||
if (submitData.enterNum === 0) return ElMessage.warning('装车总数为零,请填写需要装车的数据'); |
||||
|
||||
const res = await postLoadingZero(submitData); |
||||
|
||||
const { code } = res.data; |
||||
|
||||
if (code !== 200) return; |
||||
ElMessage.success('卸车成功'); |
||||
onLoad(); |
||||
} catch (error) { |
||||
console.log('error :>> ', error); |
||||
} finally { |
||||
details.loadingObj.pageLoading = false; |
||||
} |
||||
}; |
||||
|
||||
/** 查看零担零担码 */ |
||||
const printOrderByZero = async ({ row }) => { |
||||
try { |
||||
details.loadingObj.pageLoading = true; |
||||
|
||||
let ids = [ |
||||
{ |
||||
orderCode: row.orderCode, |
||||
fromWarehouseId: row.fromWarehouseId, |
||||
}, |
||||
]; |
||||
|
||||
details.html = ''; |
||||
const res = await postShowOrderCodeByCode(ids); |
||||
const { code, data } = res.data; |
||||
if (code !== 200 || getObjType(data.moldList) !== 'array') return; |
||||
|
||||
for (let i = 0; i < data.moldList.length; i++) { |
||||
details.html += data.moldList[i]; |
||||
} |
||||
details.popUpShow.QRCodeVisible = true; |
||||
} catch (error) { |
||||
console.log('error :>> ', error); |
||||
} finally { |
||||
details.loadingObj.pageLoading = false; |
||||
} |
||||
}; |
||||
|
||||
watch( |
||||
$route, |
||||
(newVal, oldVal) => { |
||||
if (newVal.path !== '/distribution/artery/VehicleStowageZeroLoading') return; |
||||
details.pageInfo.loadId = $route.query.loadId; |
||||
details.pageInfo.type = $route.query.type; |
||||
onLoad(); |
||||
}, |
||||
{ |
||||
immediate: true, |
||||
} |
||||
); |
||||
</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; |
||||
} |
||||
|
||||
:deep(.el-table tr) { |
||||
&.Abnormal { |
||||
.tabculconte, |
||||
.el-tooltip, |
||||
.el-button--text, |
||||
.el-text { |
||||
// color: #e54b4b !important; |
||||
color: #f00 !important; |
||||
} |
||||
} |
||||
} |
||||
|
||||
:deep(.el-tag) { |
||||
&.err { |
||||
background-color: #f8544b; |
||||
border-color: #f8544b; |
||||
color: #fff; |
||||
} |
||||
|
||||
&.primary { |
||||
background-color: green; |
||||
border-color: green; |
||||
color: #fff; |
||||
} |
||||
|
||||
&.sub { |
||||
background-color: #d3832a; |
||||
border-color: #d3832a; |
||||
color: #fff; |
||||
} |
||||
} |
||||
|
||||
// 编辑零担品类数量 -- 顶部信息 |
||||
.editZeroCategoryTitleRow { |
||||
display: flex; |
||||
flex-wrap: wrap; |
||||
|
||||
.title { |
||||
font-weight: bold; |
||||
|
||||
margin-right: 10px; |
||||
} |
||||
} |
||||
|
||||
// 编辑零担品类数量 -- 分隔线 |
||||
.editZeroCategoryTitleRowByLine { |
||||
display: flex; |
||||
align-items: center; |
||||
font-size: 18px; |
||||
font-weight: bold; |
||||
color: var(--el-color-primary); |
||||
|
||||
&::before { |
||||
content: ''; |
||||
display: block; |
||||
height: 2px; |
||||
flex: 1; |
||||
background-color: var(--el-color-primary); |
||||
margin-right: 10px; |
||||
} |
||||
|
||||
&::after { |
||||
content: ''; |
||||
display: block; |
||||
height: 2px; |
||||
flex: 1; |
||||
background-color: var(--el-color-primary); |
||||
margin-left: 10px; |
||||
} |
||||
} |
||||
|
||||
// 编辑零担品类数量 -- 品类列表 |
||||
.editZeroCategoryList { |
||||
padding: 10px; |
||||
|
||||
.editZeroCategoryList_item { |
||||
padding: 20px; |
||||
border: 2px dashed var(--el-color-primary); |
||||
border-radius: 5px; |
||||
margin-top: 10px; |
||||
|
||||
&:first-child { |
||||
margin-top: 0; |
||||
} |
||||
} |
||||
|
||||
.inputNum { |
||||
:deep(.el-input__inner) { |
||||
text-align: left; |
||||
} |
||||
} |
||||
|
||||
.w100 { |
||||
width: 100% !important; |
||||
} |
||||
} |
||||
</style> |
Loading…
Reference in new issue