Browse Source

新增三方发车检测

dev-xx
qb 7 months ago
parent
commit
642881a00f
  1. 11
      src/api/distribution/TripartiteTransfer.js
  2. 9
      src/components/popupnotification/popupnotification.vue
  3. 3
      src/main.js
  4. 417
      src/views/distribution/artery/TripartiteTransfer.vue
  5. 143
      src/views/distribution/deliverylist/distributionDeliveryListedt.vue

11
src/api/distribution/TripartiteTransfer.js

@ -120,3 +120,14 @@ export const postTripartiteTransferUploadSignPhoto = data => {
data,
});
};
/**
* 上传签收图片
*/
export const postTripartiteTransferStartCarsBefore = data => {
return request({
url: '/api/logpm-trunkline/tripartiteTransfer/startCarsBefore',
method: 'post',
data,
});
};

9
src/components/popupnotification/popupnotification.vue

@ -30,8 +30,13 @@
<template #footer>
<div class="dialog-footer">
<el-button @click="onClose">{{ cancelButtonText }}</el-button>
<el-button @click="onConfirm" class="el_delte_button" type="primary">
<el-icon><QuestionFilled /></el-icon>{{ confirmButtonText }}
<el-button
@click="onConfirm"
class="el_delte_button"
icon="QuestionFilled"
type="primary"
>
{{ confirmButtonText }}
</el-button>
</div>
</template>

3
src/main.js

@ -32,6 +32,7 @@ import TripartiteTransferPrintTemplate from './components/TripartiteTransferPrin
import ImgList from './components/ImgList/ImgList.vue';
import MyPrint from './components/MyPrint/MyPrint.vue';
import MyUpload from './components/MyUpload/MyUpload.vue';
import DeleteWarningDialog from './components/popupnotification/popupnotification.vue';
import { message } from './utils/resetMessage';
import FileslicingPlugin from './utils/Fileslicing.js';
import App from './App.vue';
@ -69,6 +70,8 @@ app.component('WaybillPrintTemplate', WaybillPrintTemplate);
app.component('ArteryPrintTemplate', ArteryPrintTemplate);
/** 三方运输打印模版 */
app.component('TripartiteTransferPrintTemplate', TripartiteTransferPrintTemplate);
/** 警告提示 */
app.component('DeleteWarningDialog', DeleteWarningDialog);
app.component('ImgList', ImgList);
app.config.globalProperties.$dayjs = dayjs;
app.config.globalProperties.$functions = functions;

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

@ -136,14 +136,14 @@
</el-button>
<!-- 取消发车 -->
<el-button
<!-- <el-button
v-if="permissionObj.TripartiteTransfer_cancelStartCar"
type="primary"
icon="CircleClose"
@click="handleCancelStartCar"
>
取消发车
</el-button>
</el-button> -->
<!-- 到达 -->
<el-button
@ -368,118 +368,6 @@
</div>
</el-dialog>
<!-- 配置装车目的地 -->
<el-dialog
title="配置装车目的地"
v-model="details.popUpShow.truckLoadingDetailVisited"
width="80%"
:before-close="beforeClose"
append-to-body
:fullscreen="details.fullscreenObj.truckLoadingDetailPopUp"
:show-close="false"
class="truckLoadingDetailPopUp"
v-loading="details.loadingObj.truckLoadingDetailPopUpTable"
>
<!-- 标题 -- 头部控件区 -->
<template #header="{ close, titleId, titleClass }">
<div class="my-header flex-c-sb">
<div class="fwb" :id="titleId" :class="titleClass">配置装车目的地</div>
<div class="flex-c-c">
<!-- 全屏显示按钮 -->
<el-button type="text" v-if="!details.fullscreenObj.truckLoadingDetailPopUp">
<el-icon class="" @click="handleFullScrean('open', 'truckLoadingDetailPopUp')"
><FullScreen
/></el-icon>
</el-button>
<el-button type="text" v-else>
<el-icon class="" @click="handleFullScrean('close', 'truckLoadingDetailPopUp')"
><CopyDocument
/></el-icon>
</el-button>
<!-- 弹窗关闭按钮 -->
<el-button type="text">
<el-icon class="" @click="close"><Close /></el-icon>
</el-button>
</div>
</div>
</template>
<div v-loading="details.loadingObj.truckLoadingDetailPopUpLoading">
<el-button
icon="Edit"
type="primary"
v-if="details.nextNodeData.length > 1"
@click="handleOpenConfiguration('batch')"
>
配置目的地
</el-button>
<tablecmt
class="truckLoadingDetailPopUpTable mt10"
:columnList="details.packageColumnList"
:tableData="details.packageRenderData"
:loading="loadingObj.list"
@inputTxt="packageInputsc"
@selection="list => (details.packageSelectedData = list)"
>
<template #default="slotProps">
<el-text
v-if="details.nextNodeData.length > 1"
@click="handleOpenConfiguration('one', slotProps.scope)"
>配置目的地</el-text
>
<el-text @click="removePackage(slotProps.scope)">移除</el-text>
</template>
</tablecmt>
<div class="dialog-footer">
<el-button
icon="el-icon-circle-close"
@click="details.popUpShow.truckLoadingDetailVisited = false"
> </el-button
>
<el-button type="primary" icon="el-icon-circle-check" @click="handleSubmit"
> </el-button
>
</div>
</div>
</el-dialog>
<!-- 配置装车目的地 -->
<el-dialog
title="配置装车目的地"
v-model="details.popUpShow.chooseDestinationVisited"
width="30%"
append-to-body
class="truckLoadingDetailPopUp"
>
<el-form-item label="目的地" prop="region">
<el-select v-model="details.chooseNodeId" placeholder="请选择目的地" class="w100">
<el-option
v-for="item in details.nextNodeData"
:key="item"
:label="item.warehouseName"
:value="item.warehouseId"
/>
</el-select>
</el-form-item>
<!-- 表单按钮 -->
<template #footer>
<div class="dialog-footer">
<el-button
icon="el-icon-circle-close"
@click="details.popUpShow.chooseDestinationVisited = false"
> </el-button
>
<el-button type="primary" icon="el-icon-circle-check" @click="handleEditSubmit">
</el-button>
</div>
</template>
</el-dialog>
<!-- 配载清单 -->
<el-dialog
title="配载清单"
@ -534,6 +422,24 @@
</div>
</el-dialog>
<!-- 发车提示 -->
<DeleteWarningDialog
v-model="details.popUpShow.tipVisted"
:width="'600'"
title="取消计划警告!"
confirmButtonText="确认取消"
@close="details.popUpShow.tipVisted = false"
@confirm="startCar"
>
<template #content>
<el-text class="mx-1" size="large">
<el-icon><StarFilled /></el-icon>
数据存在<strong>已备货</strong>状态,<strong>仔细核验数据</strong>,避免误操作<br />
如果核验无误请继续执行...
</el-text>
</template>
</DeleteWarningDialog>
<!-- 图片预览 -->
<el-dialog
v-model="details.popUpShow.dialogVisible"
@ -576,7 +482,6 @@ import {
getObjType,
} from '@/utils/util';
import { columnList, detailsColumnList } from '@/option/distribution/TripartiteTransfer';
import { packageColumnList } from '@/option/distribution/VehicleStowage';
import {
postArriveCars,
postTripartiteTransferPageList,
@ -586,6 +491,7 @@ import {
postSettlementCars,
postTripartiteTransferFindSignPhoto,
postTripartiteTransferUploadSignPhoto,
postTripartiteTransferStartCarsBefore,
} from '@/api/distribution/TripartiteTransfer.js';
import {
postFindLoadingListData,
@ -674,10 +580,6 @@ const details = reactive<any>({
popUpShow: {
/** 到达确认 */
confirmArriveVisited: false,
/** 配置目的地 */
truckLoadingDetailVisited: false,
/** 选择目的地弹窗 */
chooseDestinationVisited: false,
/** 结算弹窗 */
closeAnAccountVisited: false,
/** 装载清单 */
@ -731,20 +633,6 @@ const details = reactive<any>({
/** 装载清单 */
listOfLoadedWagonsPopUp: false,
},
packageColumnList: deepClone(packageColumnList),
/** 配置装车目的地数据 */
packageData: [],
/** 配置装车目的地数据 -- 渲染数据 */
packageRenderData: [],
/** 后续装车目的地 */
nextNodeData: [],
/** 配置目的地 -- 被选中的数据 */
packageSelectedData: [],
/** 被修改的数据 */
modifyData: [],
/** 被选中的数据 */
chooseNodeId: '',
packageQuery: {},
/** 结算金额表单 */
closeAnAccountForm: { number: 0 },
listOfLoadedWagonsData: {},
@ -964,7 +852,6 @@ const showdrawer = (_flag?: boolean, _type?: string) => {
console.log('123 :>> ', 123);
details.editColumnList = details.columnList;
break;
// details.
}
details.drawerShow = _flag;
};
@ -982,11 +869,11 @@ const inputsc = (index, row) => {
if (index === '') delete details.query[row.prop];
if (row.prop === 'carsNo') {
details.query.loadCarsNo = index;
if (!index && index !== 0) delete details.query[row.prop];
if (!index && index !== 0) delete details.query['loadCarsNo'];
}
if (row.prop === 'carsLineName') {
details.query.warehouseName = index;
if (!index && index !== 0) delete details.query[row.prop];
if (!index && index !== 0) delete details.query['carsLineName'];
}
onLoad();
};
@ -1119,7 +1006,11 @@ const submitConfirmArrive = async () => {
type: 'warning',
});
}
details.popUpShow.confirmArriveVisited = false;
try {
details.loadingObj.pageLoading = true;
const submitData = {
loadId: details.selectionList.map(val => val.id).join(','),
...details.form,
@ -1135,42 +1026,31 @@ const submitConfirmArrive = async () => {
type: 'success',
message: '到达成功',
});
details.popUpShow.confirmArriveVisited = false;
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.pageLoading = false;
}
};
/** 发车 */
const handleConfirmStartCar = () => {
if (details.selectionList.length === 0) {
return ElMessage({
message: '请选择发车数据',
type: 'warning',
});
} else if (details.selectionList.length !== 1) {
return ElMessage({
message: '仅支持单条数据操作',
type: 'warning',
});
}
ElMessageBox.confirm('确认发车吗?', '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
}).then(async () => {
const _arr = [];
/** 发车提交 */
const startCar = async () => {
try {
details.popUpShow.tipVisted = true;
details.loadingObj.pageLoading = true;
for (let index = 0; index < details.selectionList.length; index++) {
const item = details.selectionList[index];
// const _arr = [];
if (item.realLoadingNumber === 0) return ElMessage.warning('存在未装车数据');
// for (let index = 0; index < details.selectionList.length; index++) {
// const item = details.selectionList[index];
_arr.push(item.id);
}
// if (item.realLoadingNumber === 0) return ElMessage.warning('');
// _arr.push(item.id);
// }
const submitData = {
loadId: _arr.join(','),
loadId: details.selectionList[0].id,
};
const res = await postStartCars(submitData);
@ -1183,99 +1063,62 @@ const handleConfirmStartCar = () => {
message: '发车成功',
});
onLoad();
});
};
/** 开启弹窗 */
const handleOpenConfiguration = (type: 'one' | 'batch', data = {} as any) => {
if (type === 'batch' && details.packageSelectedData.length === 0)
return ElMessage.warning('最少选择一条数据');
details.modifyData = type === 'one' ? [data.row] : details.packageSelectedData;
details.popUpShow.chooseDestinationVisited = true;
};
/** 配置装车目的地 */
const handleEditSubmit = () => {
const chooseItem = details.nextNodeData.find(val => val.warehouseId === details.chooseNodeId);
for (const iterator of details.modifyData) {
iterator.nodeName = chooseItem.warehouseName;
iterator.nodeId = chooseItem.warehouseId;
}
details.popUpShow.chooseDestinationVisited = false;
};
/** 移除 */
const removePackage = async ({ row }) => {
try {
details.loadingObj.truckLoadingDetailPopUpLoading = true;
const submitData = {
orderCode: row.orderCode,
carsLoadScanIds: row.id,
};
const res = await postRemoveCarsLoadScan(submitData);
if (res.data.code !== 200) return;
ElMessage.success(res.data.msg || '移除成功');
await handleConfirmStartCar();
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.truckLoadingDetailPopUpLoading = false;
details.loadingObj.pageLoading = false;
}
};
/** 确认配置 */
const handleSubmit = async () => {
details.loadingObj.truckLoadingDetailPopUpLoading = true;
/** 发车 */
const handleConfirmStartCar = async () => {
try {
const submitData = {
loadId: details.selectionList[0].id,
loadScanFinalNodeIdList: [],
};
details.packageData.forEach(val => {
if (val.nodeId)
submitData.loadScanFinalNodeIdList.push({ loadScanId: val.id, finalNodeId: val.nodeId });
});
const res = await postUpdateLoadScanFinalNodeIdById(submitData);
details.loadingObj.pageLoading = true;
if (res.data.code !== 200) return;
details.popUpShow.truckLoadingDetailVisited = false;
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.truckLoadingDetailPopUpLoading = false;
}
};
if (details.selectionList.length === 0) {
return ElMessage({
message: '请选择发车数据',
type: 'warning',
});
} else if (details.selectionList.length !== 1) {
return ElMessage({
message: '仅支持单条数据操作',
type: 'warning',
});
}
/** 输入筛选 */
const packageInputsc = (value, row) => {
//
const reg = new RegExp('^' + value);
const res = await postTripartiteTransferStartCarsBefore({
loadId: details.selectionList[0].id,
});
details.packageQuery[row.prop] = reg;
const { code, data } = res.data;
if (value === '') delete details.packageQuery[row.prop];
if (code !== 200 || getObjType(data) !== 'object') return;
if (Object.keys(details.packageQuery).length === 0)
return (details.packageRenderData = details.packageData);
if (!data.loadingNum) return ElMessage.warning('未存在装车数据,无法发车');
if (!data.unloadNum) return ElMessage.warning('未存在卸车数据,无法发车');
const _data = details.packageData.filter(item => {
let _flag = true;
for (let key in details.packageQuery) {
if (!details.packageQuery[key].test(item[key])) _flag = false;
if (!_flag) break;
// ,
if (data.loadingNum === data.unloadNum) {
ElMessageBox.confirm('确认发车吗?', '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
}).then(async () => {
startCar();
});
return;
}
return _flag;
});
//
details.popUpShow.tipVisted = true;
details.packageRenderData = _data;
// ElMessage.warning('')
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.pageLoading = false;
}
};
/** 取消发车 */
@ -1296,20 +1139,28 @@ const handleCancelStartCar = () => {
cancelButtonText: '取消',
type: 'warning',
}).then(async () => {
const submitData = {
loadId: details.selectionList.map(val => val.id).join(','),
};
try {
details.loadingObj.pageLoading = true;
const res = await postCancelStartCars(submitData);
const { code } = res.data;
if (code !== 200) {
return;
const submitData = {
loadId: details.selectionList.map(val => val.id).join(','),
};
const res = await postCancelStartCars(submitData);
const { code } = res.data;
if (code !== 200) {
return;
}
ElMessage({
type: 'success',
message: '取消发车成功',
});
onLoad();
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.pageLoading = false;
}
ElMessage({
type: 'success',
message: '取消发车成功',
});
onLoad();
});
};
@ -1331,20 +1182,28 @@ const handleTheClerkSignsForIt = ({ row }) => {
cancelButtonText: '取消',
type: 'success',
}).then(async () => {
const submitData = {
loadId: row.id,
};
try {
details.loadingObj.pageLoading = true;
const res = await postSignCars(submitData);
const { code } = res.data;
if (code !== 200) {
return;
const submitData = {
loadId: row.id,
};
const res = await postSignCars(submitData);
const { code } = res.data;
if (code !== 200) {
return;
}
ElMessage({
type: 'success',
message: '签收成功',
});
onLoad();
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.pageLoading = false;
}
ElMessage({
type: 'success',
message: '签收成功',
});
onLoad();
});
};
@ -1358,18 +1217,26 @@ const handleShowCloseAnAccount = ({ row }) => {
/** 结算提交 */
const handleSubmitCloseAnAccount = async () => {
try {
const submitData = {
loadId: details.closeAnAccountForm.id,
settlementValue: details.closeAnAccountForm.number,
};
const res = await postSettlementCars(submitData);
const { code, data } = res.data;
if (code !== 200) return;
ElMessage.success('结算成功');
details.popUpShow.closeAnAccountVisited = false;
initPage();
try {
details.loadingObj.pageLoading = true;
const submitData = {
loadId: details.closeAnAccountForm.id,
settlementValue: details.closeAnAccountForm.number,
};
const res = await postSettlementCars(submitData);
const { code, data } = res.data;
if (code !== 200) return;
ElMessage.success('结算成功');
details.popUpShow.closeAnAccountVisited = false;
initPage();
} catch (error) {
console.log('error :>> ', error);
} finally {
details.loadingObj.pageLoading = false;
}
} catch (error) {
console.log('error :>> ', error);
} finally {

143
src/views/distribution/deliverylist/distributionDeliveryListedt.vue

@ -966,27 +966,22 @@
</el-dialog>
<!-- 备货删除提示 -->
<DeleteWarningDialog
:modelValue="popupnotification"
:width="'600'"
title="取消计划警告!"
confirmButtonText="确认取消"
@close="handleDialogClose"
@confirm="handleDialogConfirm"
>
<template #content>
<el-text class="mx-1" size="large">
<el-icon><StarFilled /></el-icon>
数据存在<strong>已备货</strong>状态,<strong>仔细核验数据</strong>,避免误操作<br />
如果核验无误请继续执行...
</el-text>
</template>
</DeleteWarningDialog>
<DeleteWarningDialog
:modelValue="popupnotification"
:width="'600'"
title="取消计划警告!"
confirmButtonText="确认取消"
@close="handleDialogClose"
@confirm="handleDialogConfirm"
>
<template #content>
<el-text class="mx-1" size="large">
<el-icon><StarFilled /></el-icon>
数据存在<strong>已备货</strong>状态,<strong>仔细核验数据</strong>,避免误操作<br />
如果核验无误请继续执行...
</el-text>
</template>
</DeleteWarningDialog>
</basic-container>
</template>
@ -1014,10 +1009,10 @@ import {
$_loadingAbnormalPackageListTurnDown,
$_retentionScan,
} from '@/api/distribution/distributionDeliveryList';
import{compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js'
import { compressImageBlob } from '@/components/IMGcompressor/imgcompressor.js';
import { showOrderPackgeCode } from '@/api/distribution/distributionStockArticle';
import { exportBlob } from '@/api/common';
import DeleteWarningDialog from '@/components/popupnotification/popupnotification.vue'
import DeleteWarningDialog from '@/components/popupnotification/popupnotification.vue';
import { downloadXls } from '@/utils/util';
import { dateNow } from '@/utils/date';
import NProgress from 'nprogress';
@ -1047,16 +1042,16 @@ import { setNodeHeight } from '@/utils/util.js';
import { AbnormalReview } from '@/option/distribution/DeliveryExceptionReview.js';
import print from '@/utils/print';
import { useStore } from 'vuex';
import { Delete, Edit, Search, Share, Upload } from '@element-plus/icons-vue'
import { Delete, Edit, Search, Share, Upload } from '@element-plus/icons-vue';
export default {
components: {
DeleteWarningDialog
DeleteWarningDialog,
},
data() {
return {
DataRwo:{},
popupnotification:false,//
Deleteloading:false,
DataRwo: {},
popupnotification: false, //
Deleteloading: false,
ViRejectselect: [
{
value: true,
@ -4605,56 +4600,53 @@ export default {
},
//
Cancelstocking(data){
Cancelstocking(data) {
this.loading = true;
cancelReservationPackage(data)
.then(res => {
if (res.data.code === 200) {
this.$message.success(res.data.msg);
this.getReservationInventoryPackageListInfo(this.page);
}
})
.catch(error => {
console.log(error);
}).finally(()=>{
this.loading = false;
});
},
//
confirmdelete(){
.then(res => {
if (res.data.code === 200) {
this.$message.success(res.data.msg);
this.getReservationInventoryPackageListInfo(this.page);
}
})
.catch(error => {
console.log(error);
})
.finally(() => {
this.loading = false;
});
},
//
confirmdelete() {},
//
handleDialogClose(){
this.popupnotification=false
handleDialogClose() {
this.popupnotification = false;
},
//
handleDialogConfirm(){
handleDialogConfirm() {
this.loading = true; //
let data = {
deliveryId: this.deliveryId,
reservationId: this.wid,
type: 2,
packageIds:'',
};
if(this.selectionList.length){
data.packageIds= this.selectionList.map(item => item.id).join(',');//
}else{
data.packageIds= this.DataRwo.id;//
}
this.Cancelstocking(data)
this.popupnotification=false;
let data = {
deliveryId: this.deliveryId,
reservationId: this.wid,
type: 2,
packageIds: '',
};
if (this.selectionList.length) {
data.packageIds = this.selectionList.map(item => item.id).join(','); //
} else {
data.packageIds = this.DataRwo.id; //
}
this.Cancelstocking(data);
this.popupnotification = false;
},
//
cancelReservationInventoryPackage(row) {
this.DataRwo=row
console.log(row)
if(row.stockStatus ==20 || row.stockStatusName =="已备货"){
this.popupnotification=true
return
}
this.DataRwo = row;
console.log(row);
if (row.stockStatus == 20 || row.stockStatusName == '已备货') {
this.popupnotification = true;
return;
}
this.$confirm('是否计划取消?')
.then(() => {
this.loading = true; //
@ -4664,7 +4656,7 @@ export default {
type: 2,
packageIds: row.id,
};
this.Cancelstocking(data)
this.Cancelstocking(data);
})
.catch(() => {});
},
@ -5085,11 +5077,13 @@ export default {
return;
}
//
let StockupState= this.selectionList.find(item=>item.stockStatus == 20 || item.stockStatusName =="已备货")
if(StockupState){
this.popupnotification=true
return
}
let StockupState = this.selectionList.find(
item => item.stockStatus == 20 || item.stockStatusName == '已备货'
);
if (StockupState) {
this.popupnotification = true;
return;
}
this.$confirm('是否进行批量计划取消?')
.then(() => {
@ -5693,7 +5687,6 @@ export default {
});
},
//
handleSignone(row) {
if (row.isHaveAbnormalPackage == 2) {

Loading…
Cancel
Save