作者 shenhailong

HomeNew.vue添加版本号

修改出港业务 用户信息获取方式
出港装载 理货  代码优化以及测试
... ... @@ -66,6 +66,8 @@
import ElFormItem from "element-ui/packages/form/src/form-item";
import TabMenu from "@/components/TabMenu"
import NavMenu from "@/components/NavMenu"
import loginuserInfo from "@/api/base";
import axios from "axios";
import {mapActions, mapGetters} from 'vuex'
import jsutil from "@/common/js/util";
... ... @@ -223,6 +225,17 @@
collapse:function(){
this.collapsed=!this.collapsed;
},
checkUpdate() {
axios.get('http://localhost:12021/static/nmmsVer.json').then(function(response) {
// 判断版本号是否与本地一致
if (response.data.nmmsVer != localStorage.getItem('nmmsVer')) {
localStorage.setItem('nmmsVer', response.data.nmmsVer)
location.reload()
} else {
}
}).catch(function(error) {
})
},
submitEdit(formName){
this.$refs[formName].validate((valid) => {
if (valid) {
... ... @@ -254,16 +267,33 @@
this.dialogFormVisible=true;
},
},
computed: {
...mapGetters(['getUserInfoStore','getUserMenuStore']) // 动态计算属性,相当于this.$store.getters.resturantName
},
mounted() {
this.checkUpdate();
var _this = this;
var user = loginuserInfo;
if (user) {
this.sysUserName = user.username || '';
this.sysUserId=user.userId||'';
this.sysUserAvatar = user.userface || '~img/faceDefault.jpg';
}
//操作路由,判断本地存储的用户栏目列表是否存在,如果存在则加载路由
var userRouters = sessionStorage.getItem('menu');
if (userRouters) {
userRouters = JSON.parse(userRouters);
_this.$router.options.routes = userRouters;
}
// 定时获取版本号
setInterval(() => {
this.checkUpdate();
}, 30000);
this.$nextTick(function(){
this.initUserInfo();
})
... ...
... ... @@ -371,7 +371,7 @@
validatorNum
} from "@/utils/validate";
import {getResponseForParam} from '@/api/responseDetail';
import loginUserInfo from '../../api/base';
import {loginedUserInfo} from "../../api/user";
export default {
name: "ExitArrive",
... ... @@ -472,7 +472,7 @@
arrivetime: undefined,
messageType: 'MT3201',
user :{
username : loginUserInfo.username
username : loginedUserInfo().username
}
},
respModel: {
... ... @@ -518,7 +518,7 @@
this.arriveQuery.destinationstation = this.$route.params.flightData.destinationstation
this.getList()
}
let username = loginUserInfo.username
let username = loginedUserInfo().username
if (username === 'admin') {
this.isAdmin = true
}
... ... @@ -654,7 +654,7 @@
this.fenStatus = 'addAwbh'
this.dialogFormVisible = true,
row.user = {
username: loginUserInfo.username
username: loginedUserInfo().username
}
this.$nextTick(() => {
this.$refs.arriveFormData.clearValidate()
... ... @@ -697,7 +697,7 @@
customcode: undefined,
arrivetime: undefined,
user: {
username: loginUserInfo.username
username: loginedUserInfo().username
}
}
},
... ... @@ -720,7 +720,7 @@
var _this = this
this.$refs.arriveFormData.validate(valid => {
_this.arriveModel.user= {
username : loginUserInfo.username
username : loginedUserInfo().username
}
if (valid) {
updateMT3201(this.arriveModel).then(res => {
... ... @@ -754,7 +754,7 @@
delete row.children
row.user = {
username : loginUserInfo.username
username : loginedUserInfo().username
}
sendCreateMt3201(row).then(res => {
... ... @@ -783,7 +783,7 @@
customCode: undefined,
flightDate: undefined,
awbh: undefined,
username: loginUserInfo.username,
username: loginedUserInfo().username,
}
this.dialogDeleteVisible = true
this.respModel.flightNo = row.flightno
... ... @@ -835,7 +835,7 @@
//删除运单
handleAwbDelete(row) {
row.user = {
username: loginUserInfo.username
username: loginedUserInfo().username
}
this.$confirm("是否删除", "确认消息", {
distinguishCancelAndClose: true,
... ...
... ... @@ -32,7 +32,9 @@
<div class="grid-content">
<el-col :span="4">
<div class="grid-content">
<el-input clearable v-model="loadingQuery.awba" placeholder="请输入主单号"></el-input>
<el-input clearable v-model="loadingQuery.awba" placeholder="请输入主单号">
<template slot="prepend">主单号</template>
</el-input>
</div>
</el-col>
<div class="el-btn">
... ... @@ -54,7 +56,7 @@
<el-table-column type="selection" width="60"></el-table-column>
<el-table-column label="主单号" width="160" align="center">
<template slot-scope="scope">
<span>{{scope.row.awba}}</span>
<a type="text" style="color: #409eff;text-decoration: underline" class="tableInline" @click="handleEdit(scope.row)">{{scope.row.awba}}</a>
</template>
</el-table-column>
<el-table-column label="运载件数" width="70" align="center">
... ... @@ -110,8 +112,8 @@
<template slot-scope="scope">
<el-button size="mini" @click="handleSend(scope.row)">收发明细</el-button>
<el-button size="mini" type="success" @click="handleEdit(scope.row)" >编辑
</el-button>
<!-- <el-button size="mini" type="success" @click="handleEdit(scope.row)" >编辑-->
<!-- </el-button>-->
<el-button size="mini" type="primary" @click="handleSendAwb(scope.row)"
:disabled="scope.row.status ==='23'">发送出港装载报
... ... @@ -317,9 +319,9 @@
</el-table>
</el-dialog>
<el-dialog title="删除原因" :visible.sync="dialogDeleteVisible" width="50%">
<div style="">
<el-button type="success" @click="historyList()">选择历史消息</el-button>
</div>
<!-- <div style="">-->
<!-- <el-button type="success" @click="historyList()">选择历史消息</el-button>-->
<!-- </div>-->
<el-form ref="loadingDeleteForm" :model="respModel" :rules="loadingDeleteRules"
label-width="120px" style="margin-right: 50px">
<el-form-item label="删除原因" prop="reason">
... ... @@ -369,6 +371,7 @@
} from '@/api/exitLoading'
import {getHistoryList} from '@/api/history/history';
import {Message} from "element-ui"
import {loginedUserInfo} from "../../api/user";
import {
validAwb,
validAlphabets,
... ... @@ -493,7 +496,7 @@
contactTel: undefined,
content: undefined,
user: {
username : JSON.parse(sessionStorage.getItem('user')).username
username : loginedUserInfo().username
}
},
respModel: {
... ... @@ -509,9 +512,20 @@
awbh: '',
},
loadingDeleteRules: {
reason: [{required: true, message: '删除原因不能为空', trigger: 'blur'}],
contactName: [{required: true, message: '删除操作人不能为空', trigger: 'blur'}],
contactTel: [{required: true, message: '操作人联系方式不能为空', trigger: 'blur'}]
reason:[{required:true,message:'原因不能为空',trigger:'blur'}],
contactName:[{required:true,message:'操作人不能为空',trigger:'blur'}],
contactTel:[
{ required: true, message: '手机号不能为空', trigger: 'blur' },
{ type: 'number', message: '手机号格式不正确', trigger: 'blur',
transform(value){
var phone = 11 && /^((13|14|15|16|17|18|19)[0-9]{1}\d{8})$/
if (!phone.test(value)){
return false;
}else {
return Number(value);
}
}}
],
},
}
},
... ... @@ -528,7 +542,7 @@
this.loadingQuery.destinationstation = this.$route.params.flightData.destinationstation
this.getList()
}
let username = JSON.parse(sessionStorage.getItem('user')).username
let username = loginedUserInfo().username
if (username === 'admin') {
this.isAdmin = true
}
... ... @@ -652,7 +666,7 @@
this.$refs.loadingFormData.validate(valid => {
if (valid) {
_this.loadingModel.user= {
username : JSON.parse(sessionStorage.getItem('user')).username
username : loginedUserInfo().username
}
updateMT4201(this.loadingModel).then(res => {
if (res.data.count > 0) {
... ... @@ -679,7 +693,7 @@
row.awbh = ''
}
row.user = {
username : JSON.parse(sessionStorage.getItem('user')).username
username : loginedUserInfo().username
}
sendCreateMt4201(row).then(res => {
if (res.data.count > 0) {
... ... @@ -728,7 +742,7 @@
customCode: undefined,
flightDate: undefined,
awbh: '',
username: JSON.parse(sessionStorage.getItem('user')).username,
username: loginedUserInfo().username,
}
this.dialogDeleteVisible = true
this.respModel.carrier = row.carrier
... ... @@ -763,22 +777,25 @@
},
// 删除
handleAwbDelete(row) {
row.user = {
username : loginedUserInfo().username
}
this.$confirm("是否删除", "确认消息", {
distinguishCancelAndClose: true,
confirmButtonText: '删除',
cancelButtonText: '取消'
}).then(() => {
deleteByIsDelete(row).then(res => {
if (res.data.count > 0) {
if (res.data.code == "200") {
this.$message({
type: 'success',
message: '删除成功'
message: res.data.msg
})
this.getList()
} else {
this.$message({
type: 'danger',
message: '删除异常,请稍后重试'
message: res.data.msg
})
}
})
... ... @@ -844,7 +861,7 @@
awbprice: undefined,
awbweight: undefined,
user: {
username : JSON.parse(sessionStorage.getItem('user')).username,
username : loginedUserInfo().username,
}
}
},
... ...
... ... @@ -816,7 +816,7 @@
sendUpdateMt2201,
uploadFileExcel
} from '@/api/exitPre';
import loginUserInfo from '../../api/base';
import {loginedUserInfo} from "../../api/user";
import {Message} from "element-ui";
import {getResponseForParam} from '@/api/responseDetail'
import { getList} from '../../api/consigner/consigner';
... ... @@ -889,7 +889,7 @@
limitSize: 5,
},
dialogSelectVisible: false,
loginUserInfo: loginUserInfo,
loginUserInfo: loginedUserInfo(),
preQuery: {
pageSize: 1,
limitSize: 30,
... ... @@ -899,9 +899,9 @@
flightdate: '',
originstation: '',
destinationstation: '',
userId:loginUserInfo.userId,
userId:loginedUserInfo().userId,
customCode:'',
enterpriseId:loginUserInfo.companyId,
enterpriseId:loginedUserInfo().companyId,
messageType: ''
},
dialogMap: {
... ... @@ -1077,7 +1077,7 @@
awbtype: undefined
},
user: {
username: loginUserInfo.username
username: loginedUserInfo().username
}
},
respModel: {
... ... @@ -1495,7 +1495,7 @@
pageSize: this.consignerQuery.pageSize,
limitSize: this.consignerQuery.limitSize,
companyName: this.consignerQuery.companyName,
enterpriseId: loginUserInfo.companyId
enterpriseId: loginedUserInfo().companyId
};
getList(para).then((res) => {
this.consignerQuery.total = res.data.data.total;
... ... @@ -1521,7 +1521,7 @@
pageSize: this.consigneeQuery.pageSize,
limitSize: this.consigneeQuery.limitSize,
companyName: this.consigneeQuery.companyName,
enterpriseId: loginUserInfo.companyId
enterpriseId: loginedUserInfo().companyId
};
neeList(para).then((res) => {
this.consigneeQuery.total = res.data.data.total;
... ... @@ -1612,7 +1612,7 @@
cancelButtonText: '取消'
}).then(() => {
const form = new FormData()
form.append("username", loginUserInfo.username);
form.append("username", loginedUserInfo().username);
form.append("ids", ids);
sendCreateMt2201(form).then(res => {
if (res.data.code == "200") {
... ... @@ -1712,7 +1712,7 @@
})
}
const form = new FormData()
form.append("username", loginUserInfo.username);
form.append("username", loginedUserInfo().username);
form.append("ids", ids);
form.append("reason", this.respModel.reason);
form.append("contactName", this.respModel.contactName);
... ... @@ -1763,7 +1763,7 @@
})
}
const form = new FormData()
form.append("username", loginUserInfo.username);
form.append("username", loginedUserInfo().username);
form.append("ids", ids);
form.append("reason", this.respModel.reason);
form.append("contactName", this.respModel.contactName);
... ... @@ -1970,9 +1970,9 @@
uploadFile (item) {
const form = new FormData()
form.append('file', item.file)
form.append('userId', loginUserInfo.userId);
form.append('enterpriseId', loginUserInfo.companyId);
form.append("username", loginUserInfo.username);
form.append('userId', loginedUserInfo().userId);
form.append('enterpriseId', loginedUserInfo().companyId);
form.append("username", loginedUserInfo().username);
uploadFileExcel(form).then(res =>{
if(res.data.code =='200'){
Message.success(res.data.msg)
... ... @@ -1988,8 +1988,8 @@
},
// 用户id 企业id 赋值
userId(){
this.preModel.userId = loginUserInfo.userId;
this.preModel.enterpriseId = loginUserInfo.companyId;
this.preModel.userId = loginedUserInfo().userId;
this.preModel.enterpriseId = loginedUserInfo().companyId;
},
// 远程查询运输工具申报是否成功
... ...
... ... @@ -32,7 +32,9 @@
<div class="grid-content">
<el-col :span="4">
<div class="grid-content">
<el-input v-model="tidyQuery.awba" placeholder="请输入主单号" clearable></el-input>
<el-input v-model="tidyQuery.awba" placeholder="请输入主单号" clearable>
<template slot="prepend">主单号</template>
</el-input>
</div>
</el-col>
<div class="grid-content el-btn">
... ... @@ -62,27 +64,38 @@
</el-table-column>
<el-table-column label="运单号" width="150" align="center">
<template slot-scope="scope">
<span>{{scope.row.awba}}</span>
</template>
</el-table-column>
<el-table-column label="分单号" width="120" align="center">
<template slot-scope="scope">
<span>{{scope.row.awbh}}</span>
<a type="text" style="color: #409eff;text-decoration: underline" class="tableInline" @click="handleEdit(scope.row)" v-if="scope.row.awbh !==''">{{scope.row.awbh}}</a>
<a type="text" style="color: #409eff;text-decoration: underline" class="tableInline" @click="handleEdit(scope.row)" v-else>{{scope.row.awba}}</a>
</template>
</el-table-column>
<!-- <el-table-column label="分单号" width="120" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{scope.row.awbh}}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="运单件数/重量" width="100" align="center">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{scope.row.awbpiece}} / {{scope.row.awbweight}}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="理货件数/重量" width="100" align="center">
<el-table-column label="理货件数" width="100" align="center">
<template slot-scope="scope">
<span>{{scope.row.piece}}</span>
</template>
</el-table-column>
<el-table-column label="理货重量" width="100" align="center">
<template slot-scope="scope">
<span>{{scope.row.weight}}</span>
</template>
</el-table-column>
<el-table-column label="装载开始时间" width="160" align="center">
<template slot-scope="scope">
<span>{{scope.row.piece}} / {{scope.row.weight}}</span>
<span>{{scope.row.starttime}}</span>
</template>
</el-table-column>
<el-table-column label="装载开始/结束时间" width="260" align="center">
<el-table-column label="装载结束时间" width="160" align="center">
<template slot-scope="scope">
<span>{{scope.row.starttime}} - {{scope.row.endtime}}</span>
<span>{{scope.row.endtime}}</span>
</template>
</el-table-column>
<el-table-column label="状态" width="100" align="center">
... ... @@ -117,7 +130,7 @@
<el-table-column prop="operation" label="操作" width="420px" align="center">
<template slot-scope="scope">
<el-button size="mini" @click="handleSend(scope.row)">收发明细</el-button>
<el-button size="mini" type="success" @click="handleEdit(scope.row)">编辑</el-button>
<!-- <el-button size="mini" type="success" @click="handleEdit(scope.row)">编辑</el-button>-->
<el-button size="mini" type="primary" @click="handleAwbSend(scope.row)"
:disabled="addStatus(scope.row.status)">发送出港理货报</el-button>
... ... @@ -366,6 +379,7 @@
import {validAwb, validAlphabets, validAlphabetsAndNum, validAlphabetsAndSpanceKey,validatorNum} from "@/utils/validate"
import {getCustomCode,getAirportCode} from "@/api/country";
import util from "@/common/js/util.js";
import {loginedUserInfo} from "../../api/user";
export default {
name: "ExitTidy",
... ... @@ -437,6 +451,8 @@
destinationstation: [{required: true, message:"目的站不能为空"}, { trigger: 'blur', validator: validatorAlphabets}],
weight: [{required: true, message:"重量不能为空"}, { trigger: 'change', validator: validatorNums}],
piece: [{required: true, message:"件数不能为空"}, { trigger: 'change', validator: validatorNums}],
customcode: [{required: true, message:"关区不能为空",trigger:'change'}],
starttime: [{required: true, message:"关区不能为空",trigger:'change'}],
},
tidyData: [],
... ... @@ -485,9 +501,20 @@
rcfdep: 'MT5202',
},
tidyDeleteRules: {
reason: [{required: true, message: '删除原因不能为空', trigger: 'blur'}],
contactName: [{required: true, message: '删除操作人不能为空', trigger: 'blur'}],
contactTel: [{required: true, message: '操作人联系方式不能为空', trigger: 'blur'}]
reason:[{required:true,message:'原因不能为空',trigger:'blur'}],
contactName:[{required:true,message:'操作人不能为空',trigger:'blur'}],
contactTel:[
{ required: true, message: '手机号不能为空', trigger: 'blur' },
{ type: 'number', message: '手机号格式不正确', trigger: 'blur',
transform(value){
var phone = 11 && /^((13|14|15|16|17|18|19)[0-9]{1}\d{8})$/
if (!phone.test(value)){
return false;
}else {
return Number(value);
}
}}
],
},
rows:{},
... ... @@ -763,12 +790,15 @@
confirmButtonText: '删除',
cancelButtonText: '取消'
}).then(() => {
row.userinfo = {
username : loginedUserInfo().username
}
deleteByIsDelete(row).then(res => {
if (res.data.count > 0) {
Message.success("删除成功")
if (res.data.code == "200") {
Message.success(res.data.msg)
this.getList()
} else {
Message.success("删除异常,请稍后重试")
Message.success(res.data.msg)
}
})
}).catch(action => {
... ... @@ -857,12 +887,12 @@
this.$refs.tidyFormData.validate(valid => {
if (valid) {
addMt520X(this.tidyModel).then(res => {
if (res.data.count > 0) {
Message.success("出港理货新增成功")
if (res.data.code == "200") {
Message.success(res.data.msg);
this.dialogFormVisible = false
this.getList()
} else {
Message.error("出港理货新增失败,请检查数据")
Message.error(res.data.msg);
}
})
}
... ... @@ -893,6 +923,9 @@
_this.tidyModel.user= {
username : JSON.parse(sessionStorage.getItem('user')).username
}
this.tidyModel.userinfo = {
username : loginUserInfo().username
}
updateMt520X(this.tidyModel).then(res => {
console.log(res.data)
... ...
{
"nmmsVer": "1.0"
}
... ...