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 * unit:单位 days、months、yesrs
*/ */
export function timeDiffTime(startDate, endDate, unit = "days") { export function timeDiffTime(startDate, endDate, unit = "days") {
if(unit=="days"){
endDate=timeFormatDay(endDate);
startDate=timeFormatDay(startDate);
}
return dayjs(endDate).diff(startDate, unit); return dayjs(endDate).diff(startDate, unit);
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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