Browse Source

修复部分bug

dev-xx
qb 11 months ago
parent
commit
5e756a1410
  1. 2
      src/api/distribution/CreateOrder.js
  2. 22
      src/api/distribution/TripartiteTransfer.js
  3. 11
      src/api/distribution/directGoMarket.js
  4. 11
      src/api/waybill/WaybillOrderList.js
  5. 6
      src/components/MyPrint/MyPrint.vue
  6. 1
      src/option/distribution/VehicleStowage.js
  7. 4
      src/styles/common.scss
  8. 5
      src/views/distribution/artery/AddVehicleStowage.vue
  9. 112
      src/views/distribution/artery/TripartiteTransfer.vue
  10. 1
      src/views/distribution/artery/TripartiteTransferDetails.vue
  11. 8
      src/views/distribution/artery/VehicleStowage.vue
  12. 5
      src/views/distribution/artery/addTripartiteTransfer.vue
  13. 219
      src/views/distribution/artery/directGoMarketDetails.vue
  14. 60
      src/views/waybill/WaybillOrderList.vue

2
src/api/distribution/CreateOrder.js

@ -149,7 +149,7 @@ export const postFindCategoryInfo = data => {
*/
export const postFindArrPrice = params => {
return request({
url: '/api/logpm-basicdata-zqb/basicdataPrice/custom',
url: '/api/logpm-basicdata/basicdataPrice/custom',
method: 'get',
params,
});

22
src/api/distribution/TripartiteTransfer.js

@ -98,3 +98,25 @@ export const postSettlementCars = data => {
data,
});
};
/**
* 查询已上传的签收图片
*/
export const postTripartiteTransferFindSignPhoto = data => {
return request({
url: '/api/logpm-trunkline/tripartiteTransfer/tripartiteTransferFindSignPhoto',
method: 'post',
data,
});
};
/**
* 上传签收图片
*/
export const postTripartiteTransferUploadSignPhoto = data => {
return request({
url: '/api/logpm-trunkline/tripartiteTransfer/tripartiteTransferUploadSignPhoto',
method: 'post',
data,
});
};

11
src/api/distribution/directGoMarket.js

@ -98,3 +98,14 @@ export const postSignZero = data => {
data,
});
};
/**
* 上传签收图片
*/
export const postUploadSignPhoto = data => {
return request({
url: '/api/logpm-trunkline/api/carsLoad/uploadSignPhoto',
method: 'post',
data,
});
};

11
src/api/waybill/WaybillOrderList.js

@ -28,3 +28,14 @@ export const postSaveWaybillReturn = data => {
data,
});
};
/**
* 上传回单
*/
export const postPrintBatch = params => {
return request({
url: '/api/logpm-warehouse/warehouseWaybill/printBatch',
method: 'post',
params,
});
};

6
src/components/MyPrint/MyPrint.vue

@ -46,6 +46,10 @@ const props = defineProps({
type: Boolean,
default: true,
},
printFn: {
type: Function,
default: null,
},
});
const $emit = defineEmits(['update:modelValue']);
@ -142,6 +146,8 @@ const handleExport = () => {
/** 打印 */
const printTemplate = () => {
if (props.printFn) return props.printFn();
const printNode = document.querySelectorAll('.printCode > div > div');
console.log('printNode :>> ', printNode);
print(printNode);

1
src/option/distribution/VehicleStowage.js

@ -132,6 +132,7 @@ export const columnList = [
{ label: '网点发车', value: 30 },
{ label: '终点到车', value: 40 },
{ label: '已卸车', value: 80 },
{ label: '已签收', value: 90 },
{ label: '取消配载', value: 100 },
],
fixed: false,

4
src/styles/common.scss

@ -181,6 +181,10 @@ a {
margin-top: 10px;
}
.mt20 {
margin-top: 20px;
}
.mb10 {
margin-bottom: 10px;
}

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

@ -887,6 +887,7 @@ const initOriginWarehouseOrder = debounce(async (params = {}) => {
orderCodes: details.orderCodeList,
...details.query,
...params,
isTransfer: 0,
};
for (const key in submitData) {
@ -894,8 +895,8 @@ const initOriginWarehouseOrder = debounce(async (params = {}) => {
if (!value && value !== false && value !== 0) delete submitData[key];
}
delete submit.enterTime;
delete submit.openTime;
delete submitData.enterTime;
delete submitData.openTime;
if (Number(details.pageType) === 2) submitData.loadId = details.loadId;
if (submitData.orderCodes.length === 0) delete submitData.orderCodes;

112
src/views/distribution/artery/TripartiteTransfer.vue

@ -131,6 +131,7 @@
>
文员签收
</el-text>
<el-text @click="() => handleShowSiginImg(slotProps.scope)"> 上传签收图片 </el-text>
<el-text
v-if="Number(slotProps.scope.row.isSettlement) === 1"
@click="handleShowCloseAnAccount(slotProps.scope)"
@ -435,10 +436,14 @@ import {
postCancelStartCars,
postSignCars,
postSettlementCars,
postTripartiteTransferFindSignPhoto,
postTripartiteTransferUploadSignPhoto,
} from '@/api/distribution/TripartiteTransfer.js';
import { postFindLoadingListData } from '@/api/distribution/VehicleStowage';
import { ElMessage, ElMessageBox } from 'element-plus';
import { useRouter } from 'vue-router';
import type { UploadProps } from 'element-plus';
import { getToken } from '@/utils/auth';
//
const $router = useRouter();
@ -519,6 +524,8 @@ const details = reactive<any>({
closeAnAccountVisited: false,
/** 装载清单 */
listOfLoadedWagons: false,
/** 上传签收图片 */
uploadSiginImg: false,
},
/** 列表Dom节点 */
listNode: '',
@ -532,12 +539,14 @@ const details = reactive<any>({
],
/** 配载状态 */
loadStatusOptions: [
{ value: 0, label: '未装车' },
{ value: 10, label: '已装车' },
{ value: 20, label: '网点到车' },
{ value: 30, label: '网点发车' },
{ value: 40, label: '终点到车' },
{ value: 100, label: '取消配载' },
{ label: '未发车', value: 0 },
{ label: '已发车', value: 10 },
{ label: '网点到车', value: 20 },
{ label: '网点发车', value: 30 },
{ label: '终点到车', value: 40 },
{ label: '已卸车', value: 80 },
{ label: '已签收', value: 90 },
{ label: '取消配载', value: 100 },
],
/** 是否结算 */
isSettlementOptions: [
@ -580,6 +589,14 @@ const details = reactive<any>({
/** 结算金额表单 */
closeAnAccountForm: { number: 0 },
listOfLoadedWagonsData: {},
/** 预览图片地址 */
dialogImageUrl: '',
/** 上传图片文件list */
fileList: [],
viewImgList: [],
viewImgIndex: 0,
// TOKEN
headers: { 'Blade-Auth': 'Bearer ' + getToken() },
});
/** 表格实例 */
@ -1133,6 +1150,89 @@ const handleShowListOfLoadedWagons = async () => {
details.loadingObj.pageLoading = false;
}
};
/** 显示签收图片 */
const handleShowSiginImg = async ({ row }) => {
try {
details.loadingObj.pageLoading = true;
const res = await postTripartiteTransferFindSignPhoto({ loadId: row.id });
details.popUpShow.uploadSiginImg = true;
details.viewImgList = [];
details.fileList = [];
details.viewImgIndex = 0;
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.pageLoading = false;
}
};
/** 已上传的文件 */
const handlePictureCardPreview: UploadProps['onPreview'] = uploadFile => {
details.viewImgList = details.fileList.map(val => val.url);
details.viewImgIndex = details.viewImgList.indexOf(uploadFile.url);
details.dialogImageUrl = uploadFile.url!;
details.popUpShow.dialogVisible = true;
};
/** 上传成功 */
const handleSiginImgSuccess = (response: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => {
details.viewImgList = details.fileList.map(val => val.url);
for (let i = 0; i < details.fileList.length; i++) {
const value = details.fileList[i];
console.log('value :>> ', value);
value.imgUrl = !value.response ? value.imgUrl : value.response.data.link;
}
};
/** 图片删除 */
const handleRemove: UploadProps['onRemove'] = (uploadFile, uploadFiles) => {
for (let i = 0; i < details.fileList.length; i++) {
const value = details.fileList[i];
if (value.url === uploadFile.url) details.fileList.splice(i, 1);
}
};
/** 上传签收图片 */
const handleSubmitSiginImg = async () => {
if (details.fileList.length === 0) return ElMessage.warning('请上传签收图片');
try {
details.loadingObj.pageLoading = true;
const submitData = {
signOrderId: $route.query.loadId,
signPhotoList: [],
};
for (let i = 0; i < details.fileList.length; i++) {
const value = details.fileList[i];
// id, ,
// if (value.id) continue
submitData.signPhotoList.push({
signOrderId: $route.query.loadId,
photoType: 1,
photoUrl: value.imgUrl,
});
}
console.log('submitData :>> ', submitData);
const res = await postUploadSignPhoto(submitData);
const { code, data, msg } = res;
if (code !== 200) return;
ElMessage.success(msg);
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.pageLoading = false;
}
};
</script>
<style scoped lang="scss">

1
src/views/distribution/artery/TripartiteTransferDetails.vue

@ -321,7 +321,6 @@ import { columnList, newColumnList } from '@/option/distribution/addVehicleStowa
import {
postloadFindLoadInitData,
postFindWarehouseListByName,
postFindAllOrderList,
postFindCarListByName,
postFindDriverListByName,
postFindCarrierByName,

8
src/views/distribution/artery/VehicleStowage.vue

@ -165,8 +165,7 @@
<template
v-if="
slotProps.scope.column.label === '操作' &&
Number(slotProps.scope.row.loadStatus) !== 100 &&
Number(slotProps.scope.row.loadStatus) !== 80
Number(slotProps.scope.row.loadStatus) !== 100
"
>
<div class="handleControl">
@ -195,7 +194,7 @@
</span>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item v-if="Mydata.id === slotProps.scope.row.nowWarehouseId">
<el-dropdown-item>
<el-text @click="handleNodeCost(slotProps.scope)"> 节点费用 </el-text>
</el-dropdown-item>
@ -574,6 +573,7 @@ const carStateDictionaries = reactive([
{ label: '网点发车', value: 30 },
{ label: '终点到车', value: 40 },
{ label: '已卸车', value: 80 },
{ label: '已签收', value: 90 },
{ label: '取消配载', value: 100 },
]);
@ -742,7 +742,7 @@ const init = async item => {
/** 能否操作 */
const CanOperate = row => {
const black = [80, 100];
const black = [100];
if (black.includes(Number(row.loadStatus))) return false;
return true;

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

@ -527,7 +527,7 @@ const details = reactive<any>({
operator: [
{
required: true,
message: '请选择经办人',
message: '请输入经办人',
trigger: ['change'],
},
],
@ -667,6 +667,8 @@ const onLoad = async () => {
details.form.endWarehouseIds = data.startWarehouseInfo.warehouseId;
details.form.carsLineName = data.startWarehouseInfo.warehouseName;
details.form.operator = JSON.parse(localStorage.getItem('TWMS-userInfo')).content.nick_name;
return await initOriginWarehouseOrder();
};
@ -772,6 +774,7 @@ const initOriginWarehouseOrder = debounce(async function (params = {}) {
orderCodes: details.orderCodeList,
...details.query,
...params,
isTransfer: 1,
};
if (submitData.orderCodes.length === 0) delete submitData.orderCodes;
const res = await postFindAllOrderList(submitData);

219
src/views/distribution/artery/directGoMarketDetails.vue

@ -2,9 +2,9 @@
<basic-container>
<div class="avue-crud" v-loading="details.loadingObj.pageLoading">
<!-- 搜索模块 -->
<el-row v-if="!search">
<div v-h5uShow="!search">
<!-- 查询模块 -->
<el-form :inline="true" :model="query" class="el-fr-d">
<el-form :inline="true" :model="query" class="header_search">
<el-form-item label="扫码时间:" class="el-times">
<el-date-picker
v-model="stockupDate"
@ -37,28 +37,31 @@
<el-button icon="el-icon-delete" @click="searchReset()"> </el-button>
</el-form-item>
</el-form>
</el-row>
</div>
<!-- 控件模块 -->
<el-row>
<div class="avue-crud__header">
<!-- 头部左侧按钮模块 -->
<div class="avue-crud__left">
<el-button type="primary" icon="Edit" @click="handleEditWarehouse">
修改归属仓库
</el-button>
</div>
<!-- 头部右侧按钮模块 -->
<div class="avue-crud__right">
<el-button icon="el-icon-refresh" @click="searchChange" circle></el-button>
<el-button icon="Operation" @click="showdrawer(true)" circle></el-button>
<el-button icon="el-icon-search" @click="searchHide" circle></el-button>
</div>
<div class="flex-c-sb">
<!-- 头部左侧按钮模块 -->
<div class="avue-crud__left">
<el-button type="primary" icon="Edit" @click="handleEditWarehouse">
修改归属仓库
</el-button>
<el-button type="primary" icon="Picture" @click="handleShowSiginImg">
上传签收图片
</el-button>
</div>
</el-row>
<!-- 头部右侧按钮模块 -->
<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"
@ -240,6 +243,78 @@
</div>
</el-dialog>
<!-- 上传签收图片 -->
<el-dialog
title="上传签收图片"
v-model="details.popUpShow.uploadSiginImg"
width="30%"
append-to-body
class="truckLoadingDetailPopUp"
>
<el-upload
v-model:file-list="details.fileList"
action="/api/blade-resource/oss/endpoint/put-file"
list-type="picture-card"
:on-preview="handlePictureCardPreview"
:on-success="handleSiginImgSuccess"
:headers="details.headers"
:on-remove="handleRemove"
multiple
>
<el-icon><Plus /></el-icon>
<template #file="{ file }">
<div>
<el-image
:src="file.url"
:preview-src-list="details.viewImgList"
:initial-index="details.viewImgIndex"
fit="cover"
/>
<!-- <img class="el-upload-list__item-thumbnail" :src="file.url" alt="" /> -->
<span class="el-upload-list__item-actions">
<span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)">
<el-icon><zoom-in /></el-icon>
</span>
<!-- <span
v-if="!disabled"
class="el-upload-list__item-delete"
@click="handleDownload(file)"
>
<el-icon><Download /></el-icon>
</span> -->
<span v-if="!disabled" class="el-upload-list__item-delete" @click="handleRemove(file)">
<el-icon><Delete /></el-icon>
</span>
</span>
</div>
</template>
</el-upload>
<!-- 表单按钮 -->
<div class="flex-c-c mt20">
<el-button icon="Close" @click="details.popUpShow.uploadSiginImg = false"> </el-button>
<el-button type="primary" icon="Position" @click="handleSubmitSiginImg"> </el-button>
</div>
</el-dialog>
<!-- 图片预览 -->
<el-dialog
v-model="details.popUpShow.dialogVisible"
width="fit-content"
:show-close="false"
:align-center="true"
class="imgDialogVisible"
>
<!-- <img w-full :src="details.dialogImageUrl" alt="Preview Image" /> -->
<el-image
:src="details.dialogImageUrl"
:preview-src-list="details.viewImgList"
:initial-index="details.viewImgIndex"
fit="cover"
/>
</el-dialog>
<!-- 列表配置显示 -->
<edittablehead
@setcolum="setnewcolum"
@ -265,12 +340,15 @@ import {
postBatchSign,
postSignPackage,
postSignZero,
postUploadSignPhoto,
} from '@/api/distribution/directGoMarket';
/** 获取字典 */
import { getDictionaryBiz } from '@/api/system/dict';
import { downloadXls, deepClone, debounce } from '@/utils/util';
import { downloadXls, deepClone, debounce, setNodeHeight } from '@/utils/util';
import { columnList, detailsColumnList } from '@/option/distribution/directGoMarketDetails';
import { useRouter, useRoute } from 'vue-router';
import type { UploadProps } from 'element-plus';
import { getToken } from '@/utils/auth';
const details = reactive<any>({
/** 是否开启搜索 */
@ -351,6 +429,8 @@ const details = reactive<any>({
SiginOrderDetailsVisited: false,
/** 更新签收单归属仓库 */
editWarehouseVisited: false,
/** 上传签收图片 */
uploadSiginImg: false,
},
/** 列表Dom节点 */
listNode: '',
@ -423,6 +503,14 @@ const details = reactive<any>({
},
data: [],
},
/** 预览图片地址 */
dialogImageUrl: '',
/** 上传图片文件list */
fileList: [],
viewImgList: [],
viewImgIndex: 0,
// TOKEN
headers: { 'Blade-Auth': 'Bearer ' + getToken() },
});
const {
@ -442,6 +530,8 @@ const {
const $router = useRouter();
const $route = useRoute();
const tableNodeRef = ref();
// vuex
const $store = useStore();
@ -646,23 +736,9 @@ const showdrawer = (_flag?: boolean, _type?: string) => {
/** 是否开启搜索区 */
const searchHide = () => {
function getWinHight() {
var windowHight = 0;
if (document.body.clientHeight && document.documentElement.clientHeight) {
windowHight =
document.body.clientHeight < document.documentElement.clientHeight
? document.body.clientHeight
: document.documentElement.clientHeight;
} else {
}
return document.documentElement.clientHeight;
}
details.search = !details.search;
const timer = setTimeout(() => {
details.listNode.style.height =
getWinHight() - details.listNode.getBoundingClientRect().top - 70 + 'px';
clearTimeout(timer);
}, 10);
setNodeHeight(tableNodeRef.value.$el, '', true);
};
/** 表格表头输入框搜索 */
@ -911,6 +987,79 @@ const handleEditWarehouseInfo = async () => {
}
};
/** 显示签收图片 */
const handleShowSiginImg = () => {
details.popUpShow.uploadSiginImg = true;
details.viewImgList = [];
details.fileList = [];
details.viewImgIndex = 0;
};
/** 已上传的文件 */
const handlePictureCardPreview: UploadProps['onPreview'] = uploadFile => {
details.viewImgList = details.fileList.map(val => val.url);
details.viewImgIndex = details.viewImgList.indexOf(uploadFile.url);
details.dialogImageUrl = uploadFile.url!;
details.popUpShow.dialogVisible = true;
};
/** 上传成功 */
const handleSiginImgSuccess = (response: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => {
details.viewImgList = details.fileList.map(val => val.url);
for (let i = 0; i < details.fileList.length; i++) {
const value = details.fileList[i];
console.log('value :>> ', value);
value.imgUrl = !value.response ? value.imgUrl : value.response.data.link;
}
};
/** 图片删除 */
const handleRemove: UploadProps['onRemove'] = (uploadFile, uploadFiles) => {
for (let i = 0; i < details.fileList.length; i++) {
const value = details.fileList[i];
if (value.url === uploadFile.url) details.fileList.splice(i, 1);
}
};
/** 上传签收图片 */
const handleSubmitSiginImg = async () => {
if (details.fileList.length === 0) return ElMessage.warning('请上传签收图片');
try {
details.loadingObj.pageLoading = true;
const submitData = {
signOrderId: $route.query.loadId,
signPhotoList: [],
};
for (let i = 0; i < details.fileList.length; i++) {
const value = details.fileList[i];
// id, ,
// if (value.id) continue
submitData.signPhotoList.push({
signOrderId: $route.query.loadId,
photoType: 1,
photoUrl: value.imgUrl,
});
}
console.log('submitData :>> ', submitData);
const res = await postUploadSignPhoto(submitData);
const { code, data, msg } = res;
if (code !== 200) return;
ElMessage.success(msg);
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.pageLoading = false;
}
};
/** 返回上一页 */
const back = () => {
$router.push({

60
src/views/waybill/WaybillOrderList.vue

@ -216,21 +216,18 @@
</el-dialog>
<!-- 打印 -->
<el-dialog
<!-- <el-dialog
title="运单打印"
:visible.sync="details.popUpShow.WaybillPrintTemplate"
width="780px"
:show-close="false"
:fullscreen="details.fullscreenObj.WaybillPrintTemplate"
:align-center="true"
v-model="details.popUpShow.WaybillPrintTemplate"
>
<!-- 头部 -->
<template #header="{ close, titleId, titleClass }">
<div class="my-header flex-c-sb">
<div :id="titleId" :class="titleClass">运单打印</div>
<div class="flex-c-c">
<!-- 全屏显示按钮 -->
<el-button type="text" v-if="!details.fullscreenObj.WaybillPrintTemplate">
<el-icon class="" @click="handleFullScrean('open', 'WaybillPrintTemplate')"
><FullScreen
@ -242,7 +239,6 @@
/></el-icon>
</el-button>
<!-- 弹窗关闭按钮 -->
<el-button type="text">
<el-icon class="" @click="close"><Close /></el-icon>
</el-button>
@ -257,7 +253,14 @@
:waybillInfo="item"
/>
</div>
</el-dialog>
</el-dialog> -->
<MyPrint
v-model="details.popUpShow.WaybillPrintTemplate"
:html="details.html"
:printFn="handlePrint"
width="70%"
/>
<!-- 列表配置显示 -->
<edittablehead
@ -278,6 +281,7 @@ import { getDictionaryBiz } from '@/api/system/dict';
import {
postWarehouseWaybillPageWaybillList,
postSaveWaybillReturn,
postPrintBatch,
} from '@/api/waybill/WaybillOrderList.js';
import { showOrderPackgeCode } from '@/api/distribution/distributionStockArticle';
import { downloadXls, setNodeHeight, getHtmls, deepClone } from '@/utils/util';
@ -381,6 +385,7 @@ const details = reactive<any>({
header: computed(() => {
return { 'Blade-Auth': 'Bearer ' + getToken() };
}),
html: '',
});
const {
@ -579,15 +584,43 @@ const handleFullScrean = (_type: 'open' | 'close', _name: string) => {
};
/** 批量打印 */
const batchPrint = () => {
const batchPrint = async () => {
if (details.selectionList.length === 0) {
return ElMessage({
type: 'warning',
message: '最少选择一条数据',
});
}
try {
details.loadingObj.pageLoading = true;
const res = await postPrintBatch({
ids: details.selectionList.map(val => val.id).join(','),
tempId: 15,
});
const { code, data } = res.data;
if (code !== 200 || !data || data.length === 0) return;
let _html = '';
for (let i = 0; i < data.length; i++) {
const value = data[i];
details.popUpShow.WaybillPrintTemplate = true;
_html += JSON.parse(JSON.stringify(value.templateHtml));
}
console.log('res :>> ', res);
details.html = _html;
details.popUpShow.WaybillPrintTemplate = true;
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.pageLoading = false;
}
};
/** 改单 */
@ -718,6 +751,17 @@ const handleUploadReceiptSubmit = async () => {
details.loadingObj.pageLoading = false;
}
};
const handlePrint = () => {
const printNode = document.querySelectorAll('.printCode > div');
const node = document.querySelectorAll('.image-container');
for (let i = 0; i < node.length; i++) {
const element = node[i];
element.style.setProperty('--aa', '#000');
}
print(printNode);
};
</script>
<style scoped lang="scss">

Loading…
Cancel
Save