This commit is contained in:
linfso 2024-08-17 06:13:34 +08:00
parent 02b2a46554
commit 83cac4d757
8 changed files with 77 additions and 49 deletions

View File

@ -8,6 +8,12 @@ import dayjs from "dayjs"; // 导入日期js
* unit:单位 days、months、yesrs
*/
export function timeDiffTime(startDate, endDate, unit = "days") {
if(unit=="days"){
endDate=timeFormatDay(endDate);
startDate=timeFormatDay(startDate);
}
return dayjs(endDate).diff(startDate, unit);
}

View File

@ -362,16 +362,18 @@
</el-table-column>
<el-table-column :label="$t('跟踪预警')" align="center" prop="traceWaring" min-width="100" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<div v-if="scope.row.blSign=='1'" class="link-type" @click="handleShowTraceInfo(scope.row)">
{{calcDeliveryTime(scope.row.sendDate,scope.row.scanDate)}}天
</div>
<div v-else class="link-type" @click="handleShowTraceInfo(scope.row)">
<span v-if="calcDeliveryTime(scope.row.sendDate,scope.row.scanDate)>2" style="color: red" >
轨迹异常:停留超时{{calcDeliveryTime(scope.row.sendDate,scope.row.scanDate)}}天
</span>
<span v-else >
{{calcDeliveryTime(scope.row.sendDate,scope.row.scanDate)}}天
</span>
<div v-if="scope.row.lastScanRecord!=null" >
<div v-if="scope.row.blSign=='1'" >
已签收
</div>
<div v-else >
<span v-if="calcDeliveryTime(new Date(),scope.row.lastScanRecord.scanDate)>2" style="color: red" >
轨迹异常:停留超时{{calcDeliveryTime(new Date(),scope.row.lastScanRecord.scanDate)}} 天
</span>
<span v-else >
{{calcDeliveryTime(new Date(),scope.row.lastScanRecord.scanDate)}}天
</span>
</div>
</div>
</template>
</el-table-column>
@ -900,8 +902,9 @@ export default {
rowKey (row) {
return row.id;
},
calcDeliveryTime(startData,endDate){
return timeDiffTime(startData,endDate)
calcDeliveryTime(endDate,startData){
let days= timeDiffTime(startData,endDate)
return days;
},
//标红table指定行
tableRowClassName({row, rowIndex}) {

View File

@ -364,16 +364,18 @@
</el-table-column>
<el-table-column :label="$t('跟踪预警')" align="center" prop="traceWaring" min-width="100" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<div v-if="scope.row.blSign=='1'" class="link-type" @click="handleShowTraceInfo(scope.row)">
{{calcDeliveryTime(scope.row.sendDate,scope.row.scanDate)}}天
</div>
<div v-else class="link-type" @click="handleShowTraceInfo(scope.row)">
<span v-if="calcDeliveryTime(scope.row.sendDate,scope.row.scanDate)>2" style="color: red" >
轨迹异常:停留超时{{calcDeliveryTime(scope.row.sendDate,scope.row.scanDate)}}天
</span>
<span v-else >
{{calcDeliveryTime(scope.row.sendDate,scope.row.scanDate)}}天
</span>
<div v-if="scope.row.lastScanRecord!=null" >
<div v-if="scope.row.blSign=='1'" >
已签收
</div>
<div v-else >
<span v-if="calcDeliveryTime(new Date(),scope.row.lastScanRecord.scanDate)>2" style="color: red" >
轨迹异常:停留超时{{calcDeliveryTime(new Date(),scope.row.lastScanRecord.scanDate)}} 天
</span>
<span v-else >
{{calcDeliveryTime(new Date(),scope.row.lastScanRecord.scanDate)}}天
</span>
</div>
</div>
</template>
</el-table-column>
@ -884,8 +886,9 @@ export default {
rowKey (row) {
return row.id;
},
calcDeliveryTime(startData,endDate){
return timeDiffTime(startData,endDate)
calcDeliveryTime(endDate,startData){
let days= timeDiffTime(startData,endDate)
return days;
},
//标红table指定行
tableRowClassName({row, rowIndex}) {

View File

@ -328,25 +328,28 @@
</el-table-column>
<el-table-column :label="$t('快件跟踪')" align="left" prop="lastTraceInfo" min-width="350" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<div >{{scope.row.lastTraceInfo}}</div>
</template>
</el-table-column>
<!-- class="link-type" @click="handleShowTraceInfo(scope.row)" class="link-type" @click="handleShowTraceInfo(scope.row)" class="link-type" @click="handleShowTraceInfo(scope.row)" -->
<el-table-column :label="$t('跟踪预警')" align="center" prop="traceWaring" min-width="100" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<div v-if="scope.row.blSign=='1'" >
{{calcDeliveryTime(scope.row.sendDate,scope.row.lastScanRecord.scanDate)}} 天
</div>
<div v-else >
{{scope.row.lastScanRecord.scanDate}}
<span v-if="calcDeliveryTime(new Date(),scope.row.lastScanRecord.scanDate)>2" style="color: red" >
轨迹异常:停留超时{{calcDeliveryTime(new Date(),scope.row.lastScanRecord.scanDate)}} 天
</span>
<span v-else >
{{calcDeliveryTime(new Date(),scope.row.lastScanRecord.scanDate)}}天
</span>
<div v-if="scope.row.lastScanRecord!=null" >
<div v-if="scope.row.blSign=='1'" >
已签收
</div>
<div v-else >
<span v-if="calcDeliveryTime(new Date(),scope.row.lastScanRecord.scanDate)>2" style="color: red" >
轨迹异常:停留超时{{calcDeliveryTime(new Date(),scope.row.lastScanRecord.scanDate)}} 天
</span>
<span v-else >
{{calcDeliveryTime(new Date(),scope.row.lastScanRecord.scanDate)}}天
</span>
</div>
</div>
</template>
</el-table-column>
@ -841,8 +844,9 @@ export default {
handleCopy(row, event) {
clip(row.billCode, event)
},
calcDeliveryTime(startData,endDate){
return timeDiffTime(startData,endDate)
calcDeliveryTime(endDate,startData){
let days= timeDiffTime(startData,endDate)
return days;
},
onSalemanChange(){
this.queryParams.sendSiteCode=null;

View File

@ -337,16 +337,18 @@
</el-table-column>
<el-table-column :label="$t('跟踪预警')" align="center" prop="traceWaring" min-width="100" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<div v-if="scope.row.blSign=='1'">
{{calcDeliveryTime(scope.row.sendDate,scope.row.scanDate)}}天
</div>
<div v-else >
<span v-if="calcDeliveryTime(scope.row.sendDate,scope.row.scanDate)>2" style="color: red" >
轨迹异常:停留超时{{calcDeliveryTime(scope.row.sendDate,scope.row.scanDate)}}天
</span>
<span v-else >
{{calcDeliveryTime(scope.row.sendDate,scope.row.scanDate)}}天
</span>
<div v-if="scope.row.lastScanRecord!=null" >
<div v-if="scope.row.blSign=='1'" >
已签收
</div>
<div v-else >
<span v-if="calcDeliveryTime(new Date(),scope.row.lastScanRecord.scanDate)>2" style="color: red" >
轨迹异常:停留超时{{calcDeliveryTime(new Date(),scope.row.lastScanRecord.scanDate)}} 天
</span>
<span v-else >
{{calcDeliveryTime(new Date(),scope.row.lastScanRecord.scanDate)}}天
</span>
</div>
</div>
</template>
</el-table-column>
@ -874,8 +876,9 @@ export default {
handleCopy(row, event) {
clip(row.billCode, event)
},
calcDeliveryTime(startData,endDate){
return timeDiffTime(startData,endDate)
calcDeliveryTime(endDate,startData){
let days= timeDiffTime(startData,endDate)
return days;
},
onSalemanChange(){
this.queryParams.sendSiteCode=null;

View File

@ -1067,12 +1067,14 @@ methods: {
this.$modal.msgError("输入单号后回车");
return;
}
this.form.billCode=this.form.billCode.replace(/\s+/g, '');
this.billCode=this.form.billCode+"";
this.initData();
},
onBillCodeChange(){
if(this.form.billCode){
this.form.billCode=this.form.billCode.replace(/\s+/g, '');
checkWaybillIsExists(this.form.billCode).then(response => {
const result = response.data;
if(result){

View File

@ -1067,12 +1067,14 @@ methods: {
this.$modal.msgError("输入单号后回车");
return;
}
this.form.billCode=this.form.billCode.replace(/\s+/g, '');
this.billCode=this.form.billCode+"";
this.initData();
},
onBillCodeChange(){
if(this.form.billCode){
this.form.billCode=this.form.billCode.replace(/\s+/g, '');
checkWaybillIsExists(this.form.billCode).then(response => {
const result = response.data;
if(result){

View File

@ -145,12 +145,17 @@ export default {
this.$modal.msgError("输入单号后回车");
return;
}
this.form.billCode=this.form.billCode.replace(/\s+/g, '');
let res=await getWaybillDetail(this.form.billCode);
if(res.code != 200){
this.$modal.msgError(res.msg);
return;
}
this.billDetail=res.data;
if(this.billDetail.orderStatus=='0'){
this.$modal.msgError("未接单");
return;
}
this.form.billCode=this.billDetail.billCode;