Browse Source

包件页面新增查看轨迹功能,修复页面消息弹窗重复,修复接口消息弹窗重复

dev-xx
马远东 1 year ago
parent
commit
ac8968793f
  1. 13
      src/axios.js
  2. 2
      src/main.js
  3. 23
      src/utils/resetMessage.js
  4. 10
      src/views/distribution/deliverylist/distributionDeliveryListedt.vue
  5. 14
      src/views/distribution/inventory/distributionStockArticleDetails.vue
  6. 25
      src/views/distribution/inventory/distrilbutionBillLadingView.vue
  7. 18
      src/views/distribution/stockup/distributionStockupDetails.vue
  8. 26
      src/views/warehouse/warehouseRetentionRecord/warehouseRetentionDetails.vue

13
src/axios.js

@ -17,7 +17,8 @@ import 'nprogress/nprogress.css'; // 进度条样式
import { Base64 } from 'js-base64'; // Base64编码工具
import { baseUrl } from '@/config/env'; // API基础URL
import crypto from '@/utils/crypto'; // 加密工具,可能用于加密Token等
import {ref} from 'vue';
let msg = ref(''); // 错误信息
// 存储待取消的HTTP请求的键值对,用于取消重复的请求
const pendingRequests = new Map();
@ -131,13 +132,21 @@ axios.interceptors.response.use(
// 如果response的状态码不是200,则显示消息提示,并返回Promise的reject状态
if (status !== 200) {
if(!msg.value){
ElMessage({
message: message,
type: 'error',
});
}
if(msg.value && (msg.value != message)){
setTimeout(() => {
msg.value = '';
}, 0);
}else{
msg.value=message
}
return Promise.reject(new Error(message));
}
// 正常状态返回responseData
return res;
},

2
src/main.js

@ -25,6 +25,7 @@ import flowDesign from './components/flow-design/main.vue';
import tablecmt from './components/tablecmt/tablecmt.vue';
import SelectBox from './components/SelectBox/SelectBox.vue';
import edittablehead from './components/edittablehead/index.vue';
import {message } from './utils/resetMessage'
import App from './App.vue';
import 'animate.css';
import dayjs from 'dayjs';
@ -64,6 +65,7 @@ app.use(router);
app.use(ElementPlus, {
locale: messages[language],
});
app.config.globalProperties.$message = message;//解决重复弹窗
app.use(Avue, {
axios,
calcHeight: 10,

23
src/utils/resetMessage.js

@ -0,0 +1,23 @@
import { ElMessage } from 'element-plus';
let messageInstance = null;
const resetMessage = (options) => {
if (messageInstance) {
messageInstance.close();
}
messageInstance = ElMessage(options);
};
['error', 'success', 'info', 'warning'].forEach((type) => {
resetMessage[type] = (options) => {
if (typeof options === 'string') {
options = {
message: options,
};
}
options.type = type;
return resetMessage(options);
};
});
export const message = resetMessage;

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

@ -261,6 +261,7 @@
>
<template #default="slotProps">
<el-text size="small" @click="handleQRCode(slotProps.scope.row)">查看二维码</el-text>
<el-text size="small" @click="ViewingTrajectories(slotProps.scope.row)">查看轨迹</el-text>
</template>
</tablecmt>
@ -3998,6 +3999,7 @@ export default {
type: 1,
packageIds: row.id,
};
cancelReservationPackage(data).then(res => {
if (res.data.code === 200) {
this.$message.success(res.data.msg);
@ -4005,6 +4007,14 @@ export default {
}
});
},
ViewingTrajectories(val){
this.$router.push({
path: '/distribution/signdetail/packageNodeSearch',
query: {
orderPackageCode:val.orderPackageCode,
}
})
},
cancelReservationInventoryPackage(row) {
console.log('row', row);
console.log('deliveryId', this.deliveryId);

14
src/views/distribution/inventory/distributionStockArticleDetails.vue

@ -1292,14 +1292,12 @@ export default {
},
handleTrajectory(row) {
console.log('>>>>', row);
this.$message.warning('暂无法显示!!!');
// this.title = ''
// this.view = true;
// this.box = true;
// this.dialogVisible = true;
// getDetail(row.id).then(res => {
// this.form = res.data.data;
// });
this.$router.push({
path: '/distribution/signdetail/packageNodeSearch',
query: {
orderPackageCode:row.orderPackageCode,
}
});
},
handleDelete() {
if (this.selectionList.length === 0) {

25
src/views/distribution/inventory/distrilbutionBillLadingView.vue

@ -102,7 +102,9 @@
@selectCheck="selectsc"
@selection="selectionChange"
>
<template #default="slotProps"> </template>
<template #default="slotProps">
<el-text size="small" @click="ViewingTrajectories(slotProps.scope.row)" >查看轨迹</el-text>
</template>
</tablecmt>
<div class="avue-crud__pagination" style="width: 100%">
<!-- 分页模块 -->
@ -799,6 +801,17 @@ export default {
sortable: true,
head: false,
},
{
prop: '',
label: '操作',
type: 6,
values: '',
width: '150',
checkarr: [],
fixed: 'right',
sortable: true,
head: false,
},
],
},
height: 300,
@ -1550,6 +1563,16 @@ export default {
console.log('sllsls');
this.selectionList = list;
},
//
ViewingTrajectories(scope){
console.log('查看>>>>>轨迹>>', scope);
this.$router.push({
path: '/distribution/signdetail/packageNodeSearch',
query: {
orderPackageCode:scope.orderPackageCode,
}
})
},
selectionClear() {
this.selectionList = [];
this.$refs.table.clearSelection();

18
src/views/distribution/stockup/distributionStockupDetails.vue

@ -102,6 +102,13 @@
@click="handleQRCode(slotProps.scope.row)"
>查看包条码</el-button
>
<el-button
type="primary"
text
icon="el-icon-view"
@click="ViewingTrajectories(slotProps.scope.row)"
>查看轨迹</el-button
>
</template>
</tablecmt>
@ -742,7 +749,7 @@ export default {
label: '操作',
type: 6,
values: '',
width: '150',
width: '230',
checkarr: [],
fixed: 'right',
hide: true,
@ -1327,6 +1334,15 @@ export default {
this.dialogVisible = true;
},
//
ViewingTrajectories(row){
this.$router.push({
path: '/distribution/signdetail/packageNodeSearch',
query: {
orderPackageCode:row.orderPackageCode,
}
})
},
//
callFordelivery() {
let c = false;

26
src/views/warehouse/warehouseRetentionRecord/warehouseRetentionDetails.vue

@ -123,9 +123,16 @@
:width="item.width"
:key="index"
>
<template #default="scope" v-if="item.label == '操作'">
<el-text size="small" @click="ViewingTrajectories(scope)">查看轨迹</el-text>
</template>
</el-table-column>
</template>
</el-table>
</el-tab-pane>
<el-tab-pane label="库存品列表" name="third">
<!-- <el-button-->
@ -560,6 +567,17 @@
fixed: true,
search: true,
head: true
},
{
prop: '',
label: '操作',
type: 4,
values: '',
width: '100',
checkarr: [],
fixed: true,
search: true,
head: true
}
],
zeroPackageColumnList: [
@ -1072,7 +1090,15 @@
});
this.loading = false;
console.log('retentionRcordId<>>>>>>>>>>>>>>>>>>', this.retentionRecordId);
},
ViewingTrajectories(scope){
this.$router.push({
path: '/distribution/signdetail/packageNodeSearch',
query: {
orderPackageCode:scope.row.orderPackageCode,
}
})
},
}
};
</script>

Loading…
Cancel
Save