feiyue.teng

出口撤销单回执日志与登录功能的开发

......@@ -42,6 +42,7 @@
"dependencies": {
"axios": "0.21.1",
"core-js": "3.8.3",
"crypto-js": "^4.2.0",
"docx-preview": "^0.1.20",
"element-ui": "^2.15.14",
"vue": "2.6.14",
......@@ -56,7 +57,7 @@
"babel-eslint": "10.1.0",
"chalk": "4.1.1",
"connect": "3.6.6",
"eslint": "7.30.0",
"eslint": "^6.8.0",
"eslint-plugin-vue": "7.12.1",
"lint-staged": "10.5.4",
"runjs": "4.4.2",
......
......@@ -16,3 +16,13 @@ export function getAllCancellation(data) {
data: data,
})
}
//出口撤销单回执
/**
* @param copNo * 清单总分单号
*/
export function getExportCancellationReceiptData(data) {
return request({
url: '/bus-customer/exportCancellation/receipt/' + data.copNo,
method: 'get',
})
}
\ No newline at end of file
......
import request from '@/utils/request'
// 登录方法
export function login(loginName, password, rememberMe, equipmentType, userAgent, selectedLocale) {
// const data = {
// loginName,
// password,
// rememberMe
// }
const data = {
"email": "247908967@qq.com",
"name": "测试用户",
"phone": 18221643976,
"port": "TSN",
"purpleId": '测试用户',
"role": 170
}
return request({
url: '/bus-customer/login',
method: 'post',
data: data
})
// const data = {
// "loginName":loginName,
// "password":password,
// "email": "247908967@qq.com",
// "name": "测试用户",
// "phone": 18221643976,
// "port": "TSN",
// "purpleId": '测试用户',
// "role": 170
// }
// return request({
// url: '/bus-customer/customerLogin',
// url: '/bus-customer/login',
// method: 'post',
// data: data
// })
const data = {
"loginName":loginName,
"password":password,
}
return request({
url: '/bus-customer/customerLogin',
method: 'post',
data: data
})
}
// 退出方法
......
......@@ -3,11 +3,12 @@ import store from './store'
import { Message, MessageBox } from 'element-ui'
import { getToken, getLoginType } from '@/utils/auth'
import { alertWarningMsg, alertSuccessMsg, alertErrorMsg } from "@/utils/index";
import { getParamsObj } from '@/utils/parseUrlParams'
const whiteList = ['/login', '/auth-redirect', '/bind', '/register', '/relogin']
router.beforeEach((to, from, next) => {
if (to.path == '/relogin') {
next()
} else {
......@@ -44,10 +45,17 @@ router.beforeEach((to, from, next) => {
// 在免登录白名单,直接进入
next()
} else {
if (to.path === '/reportingData') {
const userToken = getParamsObj(location.href).token
store.dispatch('LoginWithoutPassword', userToken).then(()=>{
next(`/reportingData`)
})
} else {
next(`/login`) // 否则全部重定向到登录页
}
}
}
}
})
router.afterEach(() => {
......
......@@ -2,6 +2,7 @@ import { login, logout } from '@/api/login'
import { getInfo } from '@/api/system/user.js'
import { getLogisticsCodeLis, getDictData } from '@/api/system/dict-api.js'
import { getToken, setToken, removeToken, removeUserId, removeTime } from '@/utils/auth'
import { getParamsObj } from '@/utils/parseUrlParams'
import { alertWarningMsg } from '@/utils/index.js'
const user = {
......@@ -77,6 +78,18 @@ const user = {
})
})
},
//非账号密码登录
LoginWithoutPassword({ commit }, token) {
return new Promise((resolve) => {
if (!getToken()) {
setToken(token)
commit('SET_TOKEN', token)
resolve(token)
} else {
resolve(token)
}
})
},
// 获取用户信息
async GetInfo({ commit, state }) {
......
export const getParamsObj = (url) => {
const params = new URLSearchParams(url.split('?')[1]);
const paramObj = {};
for (const [key, value] of params) {
paramObj[key] = value;
}
return paramObj;
}
\ No newline at end of file
......@@ -116,12 +116,32 @@
:selectFixed="false"
:rowSelectDataType="false"
>
<template v-slot:returnStatus="scope">
<TablePopover
ref="returnStatusPopover"
dataKey="returnStatus"
:parentDom="$refs.entryTable"
:receiptDataHead="receiptDataHead"
:rowData="scope.row"
:tableData="tableData"
@popoverChange="popoverChange"
@popoverClose="popoverClose"
>
<div slot="title">
<span style="font-weight: 700; color: #515a6e">运单编号:</span
>{{ scope.row.logisticsNo }}
</div>
<div slot="buttonLabel">
{{ scope.row.returnStatus }}
</div>
</TablePopover>
</template>
</Table>
</div>
</template>
<script>
import { getAllCancellation } from "@/api/exportRevokeBill-api.js";
import { getAllCancellation, getExportCancellationReceiptData } from "@/api/exportRevokeBill-api.js";
export default {
name: "ExportRevokeBillQuery",
......@@ -144,6 +164,7 @@ export default {
value: "returnStatus",
width: "",
align: "left",
slot: true,
},
{
name: "提运单号",
......@@ -191,19 +212,19 @@ export default {
receiptDataHead: [
{
name: "回执状态",
value: "receiptStatus",
value: "returnStatus",
width: "",
align: "left",
},
{
name: "状态时间",
value: "statusTime",
value: "returnTime",
width: "",
align: "left",
},
{
name: "回执描述",
value: "receiptDescription",
value: "returnInfo",
width: "",
align: "left",
},
......@@ -290,7 +311,7 @@ export default {
popoverChange(val) {
console.log(val);
this.tableData = val.tableData;
this.receiptApi(val.data.declareId, val.status)
this.receiptApi(val.data.copNo, val.status)
.then((res) => {
val.tableData.forEach((item) => {
if (item.declareId == val.data.declareId) {
......@@ -306,10 +327,21 @@ export default {
});
},
//查询回执
receiptApi(id, type) {
receiptApi(id) {
return new Promise((resolve, reject) => {
let obj = { declareId: id };
resolve();
let obj = { copNo: id };
getExportCancellationReceiptData(obj)
.then((res) => {
if (res.code === "200") {
resolve(res.data);
} else {
reject();
}
})
.catch((err) => {
console.log(err);
reject();
});
});
},
popoverClose(val) {
......
......@@ -571,6 +571,8 @@ export default {
}
},
//申报
declareData() {
if (this.selected.length > 0) {
......