From bf8271651ba46c20cd262262d02f7a7edf2b0165 Mon Sep 17 00:00:00 2001 From: qb <1191961160@qq.com> Date: Sat, 16 Dec 2023 00:23:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88=E6=8F=90=E8=B4=A7=E6=96=87?= =?UTF-8?q?=E5=91=98=E4=B8=8A=E4=BC=A0=E5=9B=BE=E7=89=87=E9=99=90=E5=88=B6?= =?UTF-8?q?,=20=E8=A1=A8=E6=A0=BC=E6=96=B0=E5=A2=9E=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E8=A1=8C=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/tablecmt/tablecmt.vue | 24 ++ src/option/distribution/addVehicleStowage.js | 245 ++++++++++++++++++ .../goodsArea/basicdataGoodsArea.vue | 5 + .../artery/VehicleStowageDetails.vue | 115 +++----- .../delivery/distributionStockArticle.vue | 57 ++-- .../inventory/distrilbutionBillLading.vue | 8 +- src/views/distribution/reservation/atlas.vue | 23 +- .../reservation/reservationAddFrom.vue | 10 +- 8 files changed, 374 insertions(+), 113 deletions(-) diff --git a/src/components/tablecmt/tablecmt.vue b/src/components/tablecmt/tablecmt.vue index d658c038..18902e42 100644 --- a/src/components/tablecmt/tablecmt.vue +++ b/src/components/tablecmt/tablecmt.vue @@ -5,6 +5,7 @@ style="width: 100%" :show-summary="shownm" :summary-method="getSummaries" + :span-method="arraySpanMethod" v-loading="loading" @selection-change="handleSelectionChange" border @@ -297,13 +298,32 @@ let props = defineProps({ required: false, default: null, }, + /** 设置列表行类名 */ tableRowClassName: { type: Function as PropType<(row: TableDataType, rowIndex: number) => string>, required: false, default: null, }, + /** + * 设置行合并和列合并 + * @return [行合并, 列合并] + * */ + arraySpanMethod: { + type: Function as PropType< + (row: { + row: TableDataType; + column: TableColumnType; + rowIndex: number; + columnIndex: number; + }) => number[] + >, + required: false, + default: null, + }, }); +// row, column, rowIndex, columnIndex let selectarr = ref([]); +/** 设置每行颜色 */ const tableRowClassName = ({ row, rowIndex }: { row: TableDataType; rowIndex: number }) => { let sfcheck = false; selectarr.value.map(item => { @@ -482,6 +502,10 @@ const getSummaries = (param: any) => { // console.log(columns) return newarr; }; +/** 设置合并行和列 */ +const arraySpanMethod = row => { + if (props.arraySpanMethod) return props.arraySpanMethod(row); +}; watchEffect(() => { props.columnList.map(item => { if (item.isshowSummary) { diff --git a/src/option/distribution/addVehicleStowage.js b/src/option/distribution/addVehicleStowage.js index 1e040dd4..4b8c4b7c 100644 --- a/src/option/distribution/addVehicleStowage.js +++ b/src/option/distribution/addVehicleStowage.js @@ -564,3 +564,248 @@ export const newColumnList = [ isshowSummary: false, }, ]; + +/** 配载详情表头 */ +export const detailsColumnList = [ + // { + // prop: '', + // label: '复选框', + // type: 0, + // width: 55, + // fixed: true, + // }, + { + prop: '', + label: '序号', + type: 12, + values: '', + width: 55, + fixed: true, + isshowSummary: true, + }, + { + prop: 'carsNo', + label: '配载车次号', + type: 1, + values: '', + width: '130', + checkarr: [], + fixed: true, + sortable: true, + isshowSummary: false, + }, + { + prop: 'waybillNo', + label: '运单号', + type: 1, + values: '', + width: '130', + checkarr: [], + fixed: true, + sortable: true, + isshowSummary: false, + }, + { + prop: 'orderCode', + label: '订单自编号', + type: 1, + values: '', + width: '150', + checkarr: [], + fixed: true, + sortable: true, + }, + { + prop: 'createTime', + label: '开单日期', + type: 1, + values: '', + width: '130', + checkarr: [], + fixed: false, + sortable: true, + head: false, + }, + { + prop: 'destination', + label: '到站', + type: 1, + values: '', + width: '130', + checkarr: [], + fixed: false, + sortable: true, + isshowSummary: false, + }, + { + prop: 'destinationWarehouseName', + label: '目的站', + type: 1, + values: '', + width: '130', + checkarr: [], + fixed: false, + sortable: true, + isshowSummary: false, + }, + { + prop: 'shipper', + label: '发货单位', + type: 1, + values: '', + width: '130', + checkarr: [], + fixed: false, + sortable: true, + isshowSummary: false, + }, + { + prop: 'consignee', + label: '收货单位', + type: 1, + values: '', + width: '130', + checkarr: [], + fixed: false, + sortable: true, + }, + { + prop: 'consigneeName', + label: '收货人', + type: 1, + values: '', + width: '130', + checkarr: [], + fixed: false, + sortable: true, + }, + { + prop: 'productName', + label: '品类名称', + type: 1, + values: '', + width: '130', + checkarr: [], + fixed: false, + sortable: true, + }, + { + prop: 'totalNum', + label: '运单总件数', + type: 1, + values: '', + width: '130', + checkarr: [], + fixed: false, + isshowSummary: true, + sortable: true, + }, + { + prop: 'totalNum', + label: '件数', + type: 1, + values: '', + width: '130', + checkarr: [], + fixed: false, + isshowSummary: true, + sortable: true, + }, + { + prop: 'totalNum', + label: '计划件数', + type: 1, + values: '', + width: '130', + checkarr: [], + fixed: false, + isshowSummary: true, + sortable: true, + }, + { + prop: 'totalNum', + label: '订单装车件数', + type: 1, + values: '', + width: '130', + checkarr: [], + fixed: false, + isshowSummary: true, + sortable: true, + }, + { + prop: 'stockNum', + label: '在库数', + type: 1, + values: '', + width: '150', + checkarr: [], + fixed: false, + isshowSummary: true, + sortable: true, + }, + { + prop: 'price', + label: '单价', + type: 1, + values: '', + width: '150', + checkarr: [], + fixed: false, + sortable: true, + }, + { + prop: 'totalWeight', + label: '重量(KG)', + type: 1, + values: '', + width: '130', + checkarr: [], + fixed: false, + isshowSummary: true, + sortable: true, + }, + { + prop: 'totalVolume', + label: '体积', + type: 1, + values: '', + width: '130', + checkarr: [], + fixed: false, + isshowSummary: true, + sortable: true, + }, + { + prop: 'freight', + label: '运费', + type: 1, + values: '', + width: '130', + checkarr: [], + fixed: false, + isshowSummary: true, + sortable: true, + }, + { + prop: 'customerTrain', + label: '客户车次', + type: 1, + values: '', + width: '130', + checkarr: [], + fixed: false, + sortable: true, + }, + { + prop: 'remark', + label: '运单备注', + type: 1, + values: '', + width: '130', + checkarr: [], + fixed: false, + sortable: true, + isshowSummary: false, + }, +]; diff --git a/src/views/basicdata/warehouse/goodsArea/basicdataGoodsArea.vue b/src/views/basicdata/warehouse/goodsArea/basicdataGoodsArea.vue index be5566dd..c65f3c47 100644 --- a/src/views/basicdata/warehouse/goodsArea/basicdataGoodsArea.vue +++ b/src/views/basicdata/warehouse/goodsArea/basicdataGoodsArea.vue @@ -836,6 +836,11 @@ export default { this.page.pageSize = pageSize; this.onLoad(this.page); }, + inputsc(index, row) { + this.query[row.prop] = index; + this.page.currentPage = 1; + this.onLoad(this.page); + }, onLoad(page, params = {}) { this.loading = true; getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { diff --git a/src/views/distribution/artery/VehicleStowageDetails.vue b/src/views/distribution/artery/VehicleStowageDetails.vue index 9a4d82e8..6dcc28e3 100644 --- a/src/views/distribution/artery/VehicleStowageDetails.vue +++ b/src/views/distribution/artery/VehicleStowageDetails.vue @@ -172,20 +172,7 @@ :loading="loadingObj.stowageLoading" ref="nodeInfoRef" > - + @@ -240,13 +227,22 @@ @@ -388,7 +384,7 @@ @setcolum="setnewcolum" @closce="showdrawer" :drawerShow="drawerShow" - :columnList="details.columnList" + :columnList="details.detailsColumnList" > @@ -401,11 +397,7 @@ import { mapGetters } from 'vuex'; /** 获取字典 */ import { getDictionaryBiz } from '@/api/system/dict'; import { downloadXls, computeNumber, setNodeHeight, debounce } from '@/utils/util'; -import { - columnList, - newColumnList, - nodeInfoColumnList, -} from '@/option/distribution/addVehicleStowage'; +import { detailsColumnList, nodeInfoColumnList } from '@/option/distribution/addVehicleStowage'; import { postloadFindLoadInitData, @@ -477,9 +469,7 @@ const details = reactive({ /** 修改的列表信息 */ editColumnList: [], /** 运单池 */ - columnList, - /** 调度池 */ - newColumnList, + detailsColumnList, /** 节点列表 */ nodeInfoColumnList, nodeInfoData: [], @@ -632,11 +622,11 @@ onMounted(() => { let flexListnewarr = functions.getStorage(window.location.pathname + 'flexList'); let sortlistnewarr = functions.getStorage(window.location.pathname + 'sortlist'); if (checkListnewarr) { - details.columnList.map(item => { + details.detailsColumnList.map(item => { item.head = false; }); checkListnewarr.map(ite => { - details.columnList.map(item => { + details.detailsColumnList.map(item => { if (ite == item.label) { item.head = true; } @@ -644,7 +634,7 @@ onMounted(() => { }); } else { let arr = []; - details.columnList.map(item => { + details.detailsColumnList.map(item => { if (item.head) { arr.push(item.label); } @@ -652,11 +642,11 @@ onMounted(() => { functions.setStorage(window.location.pathname + 'checkList', arr); } if (flexListnewarr) { - details.columnList.map(item => { + details.detailsColumnList.map(item => { item.fixed = false; }); flexListnewarr.map(ite => { - details.columnList.map(item => { + details.detailsColumnList.map(item => { if (ite == item.label) { if (item.type == 6) { item.fixed = 'right'; @@ -668,7 +658,7 @@ onMounted(() => { }); } else { let arr = []; - details.columnList.map(item => { + details.detailsColumnList.map(item => { if (item.fixed) { arr.push(item.label); } @@ -676,11 +666,11 @@ onMounted(() => { functions.setStorage(window.location.pathname + 'flexList', arr); } if (sortlistnewarr) { - details.columnList.map(item => { + details.detailsColumnList.map(item => { item.sortable = false; }); sortlistnewarr.map(ite => { - details.columnList.map(item => { + details.detailsColumnList.map(item => { if (ite == item.label) { item.sortable = true; } @@ -688,7 +678,7 @@ onMounted(() => { }); } else { let arr = []; - details.columnList.map(item => { + details.detailsColumnList.map(item => { if (item.sortable) { arr.push(item.label); } @@ -765,7 +755,7 @@ const showdrawer = (_flag?: boolean, _type?: number) => { switch (_type) { default: console.log('123 :>> ', 123); - details.editColumnList = details.columnList; + details.editColumnList = details.detailsColumnList; break; // details. } @@ -852,61 +842,17 @@ const currentChange = (pageNum: number) => { * */ const setnewcolum = (newarr, headarr, type) => { if (type == 1) { - details.columnList = newarr; + details.detailsColumnList = newarr; functions.setStorage(window.location.pathname + 'checkList', headarr); } else if (type == 2) { - details.columnList = newarr; + details.detailsColumnList = newarr; functions.setStorage(window.location.pathname + 'flexList', headarr); } else if (type == 3) { - details.columnList = newarr; + details.detailsColumnList = 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 = () => {}; @@ -920,6 +866,13 @@ 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 back = () => { $store.commit('DEL_TAG_CURRENT'); diff --git a/src/views/distribution/inventory/delivery/distributionStockArticle.vue b/src/views/distribution/inventory/delivery/distributionStockArticle.vue index d0d561e7..bd68c15f 100644 --- a/src/views/distribution/inventory/delivery/distributionStockArticle.vue +++ b/src/views/distribution/inventory/delivery/distributionStockArticle.vue @@ -162,16 +162,28 @@ @selection="selectionChange" > @@ -463,14 +475,22 @@ export default { columnList: [ { prop: '', - label: '序号', + label: '复选框', type: 0, values: '', width: 55, checkarr: [], fixed: true, }, - + { + prop: '', + label: '序号', + type: 12, + values: '', + width: 55, + checkarr: [], + fixed: true, + }, { prop: 'waybillNumber', label: '运单号', @@ -563,7 +583,7 @@ export default { fixed: false, sortable: true, }, - + { prop: 'consigneeUnit', label: '收货单位', @@ -693,9 +713,9 @@ export default { { prop: 'allocation', label: '货位信息', - type: 1, + type: 13, values: '', - width: '140', + width: '250', checkarr: [], fixed: false, sortable: true, @@ -1844,4 +1864,11 @@ export default { display: flex; align-items: flex-end; } + +// 标签 +:deep(.el-tag) { + margin: 0 3px; + --el-tag-bg-color: var(--el-color-info-light-9); + color: var(--el-color-primary); +} diff --git a/src/views/distribution/inventory/distrilbutionBillLading.vue b/src/views/distribution/inventory/distrilbutionBillLading.vue index c9f03335..5f17aa09 100644 --- a/src/views/distribution/inventory/distrilbutionBillLading.vue +++ b/src/views/distribution/inventory/distrilbutionBillLading.vue @@ -2406,10 +2406,10 @@ export default { this.$refs.form.validate(async valid => { if (valid) { if (!this.form.id) { - if (this.fileListSell.length === 0) { - this.$message.warning('请上传提货证件!!!'); - return; - } + // if (this.fileListSell.length === 0) { + // this.$message.warning('请上传提货证件!!!'); + // return; + // } let fei = new Map(); console.log('123 :>> ', 123); this.bianLier(this.costListName, this.clientType, this.costList, fei); diff --git a/src/views/distribution/reservation/atlas.vue b/src/views/distribution/reservation/atlas.vue index 8ae78b2f..7dc8da05 100644 --- a/src/views/distribution/reservation/atlas.vue +++ b/src/views/distribution/reservation/atlas.vue @@ -40,6 +40,7 @@ import { getDictionaryBiz } from '@/api/system/dict'; import { onMounted, reactive, toRefs, watchEffect } from 'vue'; import { useRouter } from 'vue-router'; import { selectStockArticleAtlasInfo } from '@/api/distribution/distributionDeliveryList'; +import { ElMessage } from 'element-plus'; // import { getReservationAddr } from '@/api/distribution/distributionReservation'; let router = useRouter(); let useStores = useStore(); @@ -90,28 +91,23 @@ watchEffect(() => { // }, 5000); }); function initmap() { - - AMap.plugin("AMap.Geocoder",function(){ + AMap.plugin('AMap.Geocoder', function () { details.mapLoc = new AMap.Map('container', { - viewMode: '2D', // 默认使用 2D 模式 - zoom: 9, //初始化地图层级 - center: [104.293242, 30.582939], //初始化地图中心点 + viewMode: '2D', // 默认使用 2D 模式 + zoom: 9, //初始化地图层级 + center: [104.293242, 30.582939], //初始化地图中心点 + }); }); - - }) - - - } function checkgoto() { let ids = []; details.datalists.map(item => { - console.log('item>>>>>>>>>>>>>>',item); + console.log('item>>>>>>>>>>>>>>', item); if (item.isck) { ids.push(item.items.id); } }); - console.log("ids>>>>>>>>>>>",ids); + console.log('ids>>>>>>>>>>>', ids); if (ids.length == 0) { return; } @@ -130,6 +126,9 @@ function init(data) { let geocodess = []; var geocoder = new AMap.Geocoder({}); data.map(async (item, index) => { + if (!item.jingdu || !item.weidu) { + return ElMessage.warning('地址有问题'); + } var marker = new AMap.Marker({ map: details.mapLoc, position: [item.jingdu, item.weidu], diff --git a/src/views/distribution/reservation/reservationAddFrom.vue b/src/views/distribution/reservation/reservationAddFrom.vue index 5bff8f26..867a7e55 100644 --- a/src/views/distribution/reservation/reservationAddFrom.vue +++ b/src/views/distribution/reservation/reservationAddFrom.vue @@ -2920,7 +2920,9 @@ export default { this.onLoadOrder(this.page); }, async onLoadOrder(page, params = {}) { - this.query.typeService = 2; + try { + this.loading = true + this.query.typeService = 2; this.query.genre = '1'; if (this.marketName) this.query.marketName = this.marketName; if (this.orderData.length !== 0) { @@ -2949,6 +2951,12 @@ export default { } this.orderList = []; return null; + } catch (error) { + console.log('error :>> ', error); + }finally{ + this.loading = false + return null + } }, onLoad() {