Browse Source

Merge remote-tracking branch 'origin/master'

zhanglei
dimengzhe 2 years ago
parent
commit
a37bf56e3a
  1. 19
      anrui-buscenter/anrui-finmanage-ui/src/api/jichuxinxi/dictcommons.js
  2. 2
      anrui-buscenter/anrui-finmanage-ui/src/layout/components/Navbar.vue
  3. 17
      anrui-buscenter/anrui-finmanage-ui/src/main.js
  4. 10
      anrui-buscenter/anrui-finmanage-ui/src/utils/auth.js
  5. 65
      anrui-buscenter/anrui-finmanage-ui/src/utils/request.js
  6. 8
      anrui-buscenter/anrui-finmanage-ui/src/views/anruifinmanagement/feiyongshenqing/chooseVinNo.vue
  7. 66
      anrui-buscenter/anrui-finmanage-ui/src/views/anruifinmanagement/feiyongshenqing/expense.vue
  8. 60
      anrui-buscenter/anrui-finmanage-ui/src/views/anruifinmanagement/feiyongshenqing/expenseAdd.vue
  9. 8
      anrui-buscenter/anrui-finmanage-ui/src/views/workFlow/feiyongguanliFlow/feiyongguanli/chooseVinNo.vue
  10. 1
      anrui-buscenter/anrui-finmanage-ui/src/views/workFlow/feiyongguanliFlow/feiyongguanli/feiyongDaiBanInfo.vue
  11. 9
      anrui-buscenter/anrui-finmanage-ui/src/views/workFlow/feiyongguanliFlow/feiyongguanli/feiyongEdit.vue
  12. 8
      anrui-buscenter/anrui-finmanage-ui/src/views/workFlow/feiyongguanliFlow/feiyongguanli/feiyongYiBanInfo.vue

19
anrui-buscenter/anrui-finmanage-ui/src/api/jichuxinxi/dictcommons.js

@ -33,6 +33,16 @@ export function getPathSidByUserSid(data) {
params: data
})
}
// 根据当前登录人orgSidPath(全路径sid)查询分公司
export function getOrgSidByPath(data) {
return request({
url: '/portal/v1/sysstafforg/getOrgSidByPath',
method: 'get',
params: data
})
}
// 根据分公司sid查询分公司名称
export function fetchBySid(sid) {
return request({
@ -124,3 +134,12 @@ export function getBankList(data) {
})
}
// 当前用户创建申请时判断该用户是否有该菜单的操作权限
export function selectHaveMessage(data) {
return request({
url: '/portal/v1/sysuser/selectHaveMessage ',
method: 'post',
data: data,
headers: { 'Content-Type': 'application/json' }
})
}

2
anrui-buscenter/anrui-finmanage-ui/src/layout/components/Navbar.vue

@ -29,7 +29,7 @@ export default {
this.Orgname = window.sessionStorage.getItem('Orgname')
this.departmentName = window.sessionStorage.getItem('departmentName')
this.name = window.sessionStorage.getItem('name')
this.pNameAndDepartmentNameAndPostName = window.sessionStorage.getItem('pNameAndDepartmentNameAndPostName')
this.pNameAndDepartmentNameAndPostName = window.sessionStorage.getItem('defaultOrgPathName')
var nowDate = new Date()
this.year = nowDate.getFullYear()
},

17
anrui-buscenter/anrui-finmanage-ui/src/main.js

@ -14,7 +14,7 @@ import Pagination from '@/components/pagination/index.vue'
import tabsearch from '@/components/tab-search/index.vue'
import eimage from '@/components/E-image/index.vue'
import Print from '@/utils/print' // 引入附件的js文件
import { setStorage } from './utils/auth.js'
import { setStorage, setDefaultOrgPathName, setDefaultOrgPath } from './utils/auth.js'
import VueAMap from 'vue-amap'
import request from '@/utils/request'
@ -56,6 +56,17 @@ function GetQueryString(name) {
// if (r != null) return unescape(r[2]); return null
}
var one = window.location.href.indexOf('&organizationData') + 18
if (parseInt(one) > 18) {
const data = window.location.href.substr(one) // url解码unescape()已从web中移除,尽量不使用
var data1 = decodeURIComponent(data)
if (data1 !== undefined) {
const obj = JSON.parse(data1)
setDefaultOrgPath(obj.defaultOrgPath)
setDefaultOrgPathName(obj.defaultOrgPathName)
}
}
// 获取登录用户信息
function getUserInfo() {
return request({
@ -79,8 +90,7 @@ function getUserInfo() {
Orgname: data.organizationName,
dwjb: data.dwjb,
orgNamePath: data.orgNamePath, // 使用组织全路径名称
orgSidPath: data.orgSidPath, // 使用组织全路径Sid
pNameAndDepartmentNameAndPostName:data.pNameAndDepartmentNameAndPostName
orgSidPath: data.orgSidPath // 使用组织全路径Sid
}
// 结果存入缓存
window.sessionStorage.setItem('staffSid', user.staffSid)
@ -94,7 +104,6 @@ function getUserInfo() {
window.sessionStorage.setItem('departmentSid', user.departmentSid)
window.sessionStorage.setItem('orgNamePath', user.orgNamePath)
window.sessionStorage.setItem('orgSidPath', user.orgSidPath)
window.sessionStorage.setItem('pNameAndDepartmentNameAndPostName', user.pNameAndDepartmentNameAndPostName)
new Vue({
el: '#app',
router,

10
anrui-buscenter/anrui-finmanage-ui/src/utils/auth.js

@ -17,13 +17,21 @@ export function removeToken() {
export function getStorage() {
return sessionStorage.getItem('token')
// return 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyTm8iOiIwZDhkODExOS1kNDc2LTQ3Y2UtODljMi0wNzVjZDgwOWRkYTYiLCJpc3MiOiJXQksiLCJleHAiOjE2Mzc4MDIwODh9.zLhMa-pfxK19jB1gXjjxjYQp3wxjMaJsFa_xQrwknps';
// return 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyTm8iOiIwZDhkODExOS1kNDc2LTQ3Y2UtODljMi0wNzVjZDgwOWRkYTYiLCJpc3MiOiJXQksiLCJleHAiOjE2Mzc4MDIwODh9.zLhMa-pfxK19jB1gXjjxjYQp3wxjMaJsFa_xQrwknps'
}
export function setStorage(session) {
return sessionStorage.setItem('token', session)
}
export function setDefaultOrgPathName(data) {
return sessionStorage.setItem('defaultOrgPathName', data)
}
export function setDefaultOrgPath(data) {
return sessionStorage.setItem('defaultOrgPath', data)
}
export function removeStorage() {
return sessionStorage.removeItem('token')
}

65
anrui-buscenter/anrui-finmanage-ui/src/utils/request.js

@ -4,27 +4,33 @@ import store from '@/store'
import { getToken, getStorage } from '@/utils/auth'
// create an axios instance
console.log(process.env.VUE_APP_URL)
const service = axios.create({
baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
// timeout: 5000 // request timeout
headers:{'Content-Type':'application/x-www-form-urlencoded;'}
// withCredentials: true, // send cookies when cross-domain requests
timeout: 30000 // request timeout
})
// request interceptor
service.interceptors.request.use(
config => {
config.params = {
...config.params,
_t: Date.parse(new Date()) / 1000
}
if (getStorage()) {
// do something before request is sent
// if (store.getters.token) {
// // let each request carry token
// // ['X-Token'] is a custom headers key
// // please modify it according to the actual situation
// config.headers['X-Token'] = getToken()
// }
if (getStorage()) {
// let each request carry token
// ['X-Token'] is a custom headers key
// please modify it according to the actual situation
config.headers['token'] = getStorage()
}
return config
},
error => {
// do something with request error
console.log(error) // for debug
return Promise.reject(error)
}
@ -32,23 +38,53 @@ service.interceptors.request.use(
// response interceptor
service.interceptors.response.use(
/**
* If you want to get http information such as headers or status
* Please return response => response
*/
/**
* Determine the request status by custom code
* Here is just an example
* You can also judge the status by HTTP Status Code
*/
response => {
const res = response.data
const statusCode = response.status
// if the custom code is not 20000, it is judged as an error.
if (res.code != 200) {
if (res.msg == "请重新登录") {
// window.location.href = 'http://39.104.100.138:8082/'
} else {
if (statusCode !== 200) {
Message({
message: res.msg || response.message || 'Error',
type: 'error',
showClose: true,
duration: 5 * 1000
})
// 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
if (statusCode === 401 || res.code === '5000' || res.code === 5000 || res.code === 50012 || res.code === 50014) {
// to re-login
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
confirmButtonText: '重新登录',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
store.dispatch('logout').then(() => {
location.href = 'http://120.46.131.15/#/login'
// location.reload()
})
})
}
return Promise.reject(new Error(res.message || 'Error'))
} else {
if (!res.success) {
Message({
message: res.msg || 'Error',
type: 'error',
showClose: true,
duration: 5 * 1000
})
}
return Promise.reject(new Error(res.message || 'Error'))
} else {
return res
}
},
@ -57,6 +93,7 @@ service.interceptors.response.use(
Message({
message: error.message,
type: 'error',
showClose: true,
duration: 5 * 1000
})
return Promise.reject(error)

8
anrui-buscenter/anrui-finmanage-ui/src/views/anruifinmanagement/feiyongshenqing/chooseVinNo.vue

@ -62,21 +62,19 @@ export default {
isSearchShow: false,
searchxianshitit: '隐藏查询条件',
tableKey: 0,
showbackState: 30,
sids: [],
list: [],
number: '',
listLoading: false,
userOrgSid: '',
listQuery: {
current: 1,
size: 10,
params: {
vinNo: '',
userSid: '',
orgPath: '',
sidList: []
},
total: 1
total: 0
}
}
},
@ -103,6 +101,7 @@ export default {
getList() {
this.listLoading = true
this.listQuery.params.userSid = window.sessionStorage.getItem('userSid')
this.listQuery.params.orgPath = window.sessionStorage.getItem('defaultOrgPath')
req.pageList(this.listQuery).then((response) => {
this.listLoading = false
if (response.success) {
@ -123,6 +122,7 @@ export default {
params: {
vinNo: '',
userSid: '',
orgPath: '',
sidList: []
},
total: 1

66
anrui-buscenter/anrui-finmanage-ui/src/views/anruifinmanagement/feiyongshenqing/expense.vue

@ -58,9 +58,10 @@
<el-button type="primary" size="mini" @click="toInfo(scope.row)">查看</el-button>
</template>
</el-table-column>
<el-table-column label="状态" align="center">
<el-table-column label="状态" width="180px" header-align="center">
<template slot-scope="scope">
<span>{{ scope.row.nodeState }}</span>
<span v-if="scope.row.nodeState=='待提交'" type="primary" size="mini">待提交</span>
<span v-else @click="flowRecord(scope.row)" class="bluezi">{{ scope.row.nodeState }}</span>
</template>
</el-table-column>
<el-table-column label="申请日期" align="center">
@ -108,6 +109,9 @@
</div>
<expenseAdd v-show="viewState == 2 || viewState == 3" ref="divAdd" @doback="resetState" @reloadlist="getList"/>
<expenseInfo v-show="viewState == 4" ref="divInfo" @doback="resetState"/>
<el-dialog title="" :visible.sync="centerDialogVisible" width="78%" height="1%" :before-close="closeIt" center>
<iframe frameborder="0" id="iframe" style="width:100%;" scrolling="no" :src="this.centerDialogVisible === true ? url :''"></iframe>
</el-dialog>
</div>
</template>
@ -116,9 +120,10 @@ import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import ButtonBar from '@/components/ButtonBar'
import req from '@/api/anruifinmanagement/expense'
import { typeValues } from '@/api/jichuxinxi/dictcommons'
import { typeValues, selectHaveMessage } from '@/api/jichuxinxi/dictcommons'
import expenseAdd from './expenseAdd.vue'
import expenseInfo from './expenseInfo.vue'
import { getStorage } from '@/utils/auth'
export default {
name: 'feiyongshenqingguaili',
@ -131,6 +136,9 @@ export default {
},
data() {
return {
url: '',
dialogHeight: '80%',
centerDialogVisible: false,
btndisabled: false,
btnList: [
{
@ -185,7 +193,8 @@ export default {
costTypeKey: '',
state: '',
useTypeKey: '',
userSid: ''
userSid: '',
orgPath: ''
},
current: 1,
size: 10,
@ -199,9 +208,40 @@ export default {
this.init()
},
mounted() {
// vuewindowpostMessagehandleMessage
window.addEventListener('message', this.handleMessage)
this.$refs['btnbar'].setButtonList(this.btnList)
},
methods: {
async handleMessage(event) {
var code = ''
if (event.data.params !== null && event.data.params !== undefined) {
code = event.data.params.code
}
if (code === 1) {
this.init()
this.centerDialogVisible = false
} else if (code === 2) {
this.dialogHeight = event.data.params.data
this.setIframeHeight(document.getElementById('iframe'))
}
},
closeIt() {
this.url = ''
this.centerDialogVisible = false
},
setIframeHeight(iframe) {
iframe.height = this.dialogHeight
},
flowRecord(row) {
this.centerDialogVisible = true
var params = {
deployId: row.procDefId,
procInsId: row.procInstId,
token: getStorage()
}
this.url = '/#/flow/flowRecordForBusiness?data=' + encodeURI((JSON.stringify(params)))
},
init() {
typeValues({ type: 'costType' }).then((res) => {
if (res.success) {
@ -264,14 +304,11 @@ export default {
getList() {
this.listLoading = true
this.listQuery.params.userSid = window.sessionStorage.getItem('userSid')
this.listQuery.params.orgPath = window.sessionStorage.getItem('defaultOrgPath')
req.listPage(this.listQuery).then((response) => {
console.log('列表查询结果:', response)
this.listLoading = false
if (
response.success &&
response.data &&
response.data.total > 0
) {
if (response.success) {
this.list = response.data.records
this.listQuery.total = response.data.total
} else {
@ -294,7 +331,8 @@ export default {
costTypeKey: '',
state: '',
useTypeKey: '',
userSid: ''
userSid: '',
orgPath: ''
},
current: 1,
size: 10,
@ -303,8 +341,12 @@ export default {
this.init()
},
toAdd() {
this.viewState = 2
this.$refs['divAdd'].showAdd(this.listQuery.params.createOrgSid)
selectHaveMessage({ menuUrl: this.$route.path, orgPath: window.sessionStorage.getItem('defaultOrgPath') }).then((resp) => {
if (resp.success) {
this.viewState = 2
this.$refs['divAdd'].showAdd(this.listQuery.params.createOrgSid)
}
})
},
//
doDel() {

60
anrui-buscenter/anrui-finmanage-ui/src/views/anruifinmanagement/feiyongshenqing/expenseAdd.vue

@ -103,7 +103,7 @@ import req from '@/api/anruifinmanagement/expense'
import { typeValues } from '@/api/jichuxinxi/dictcommons'
import chooseVinNo from './chooseVinNo'
export default {
name: 'feiyongshenqingAdd',
name: 'FeiyongshenqingAdd',
components: {
chooseVinNo
},
@ -131,6 +131,7 @@ export default {
taskId: '',
useTypeKey: '',
useTypeValue: '',
orgPath: '',
vinNoList: []
},
rules: {},
@ -154,20 +155,15 @@ export default {
this.useType_list = res.data
}
})
this.newDate()
},
newDate() {
let date = new Date()
let year = date.getFullYear() //
let month = date.getMonth() + 1 //
let day = date.getDate() //
if (month < 10) {
month = '0' + month
}
if (day < 10) {
day = '0' + day
var nowDate = new Date()
var date = {
year: nowDate.getFullYear(),
month: nowDate.getMonth() + 1,
day: nowDate.getDate()
}
this.formobj.createTime = year + '-' + month + '-' + day
this.formobj.createTime = date.year + '-' + (date.month >= 10 ? date.month : '0' + date.month) + '-' + (date.day >= 10 ? date.day : '0' + date.day)
},
UpNumber(e) {
e.target.value = e.target.value.replace(/[^\d]/g, '') // ."-"
@ -181,11 +177,13 @@ export default {
},
showAdd() {
this.DataDictionary()
this.newDate()
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
this.formobj.createBySid = window.sessionStorage.getItem('userSid')
this.formobj.name = window.sessionStorage.getItem('name')
this.formobj.orgPath = window.sessionStorage.getItem('defaultOrgPath')
this.viewTitle = '【新增】费用申请'
},
showEdit(row) {
@ -269,7 +267,6 @@ export default {
if (valid) {
this.submitdisabled = true
req.saveOrUpdate(this.formobj).then((resp) => {
this.submitdisabled = false
if (resp.success) {
this.$message({
showClose: true,
@ -277,6 +274,8 @@ export default {
message: resp.msg
})
this.handleReturn('true')
} else {
this.submitdisabled = false
}
}).catch(() => {
this.submitdisabled = false
@ -296,7 +295,6 @@ export default {
if (valid) {
this.submitdisabled = true
req.submitVehicleApply(this.formobj, this.formobj.sid).then((resp) => {
this.submitdisabled = false
if (resp.success) {
this.$message({
showClose: true,
@ -304,6 +302,8 @@ export default {
message: resp.msg
})
this.handleReturn('true')
} else {
this.submitdisabled = false
}
}).catch(() => {
this.submitdisabled = false
@ -320,23 +320,25 @@ export default {
if (isreload === 'true') this.$emit('reloadlist')
this.formobj = {
busSid: '',
cost: '',
costTitleKey: '',
costTitleValue: '',
costTypeKey: '',
costTypeValue: '',
createBySid: '',
instanceId: '',
isOutDoor: '',
isVeh: '',
name: '',
sid: '',
taskId: '',
useTypeKey: '',
useTypeValue: '',
vinNoList: []
cost: '',
costTitleKey: '',
costTitleValue: '',
costTypeKey: '',
costTypeValue: '',
createBySid: '',
instanceId: '',
isOutDoor: '',
isVeh: '',
name: '',
sid: '',
taskId: '',
useTypeKey: '',
useTypeValue: '',
orgPath: '',
vinNoList: []
}
this.checked = false
this.submitdisabled = false
this.$refs['form_obj'].resetFields()
this.$emit('doback')
}

8
anrui-buscenter/anrui-finmanage-ui/src/views/workFlow/feiyongguanliFlow/feiyongguanli/chooseVinNo.vue

@ -62,21 +62,19 @@ export default {
isSearchShow: false,
searchxianshitit: '隐藏查询条件',
tableKey: 0,
showbackState: 30,
sids: [],
list: [],
number: '',
listLoading: false,
userOrgSid: '',
listQuery: {
current: 1,
size: 10,
params: {
vinNo: '',
userSid: '',
orgPath: '',
sidList: []
},
total: 1
total: 0
}
}
},
@ -103,6 +101,7 @@ export default {
getList() {
this.listLoading = true
this.listQuery.params.userSid = window.sessionStorage.getItem('userSid')
this.listQuery.params.orgPath = window.sessionStorage.getItem('defaultOrgPath')
req.pageList(this.listQuery).then((response) => {
this.listLoading = false
if (response.success) {
@ -123,6 +122,7 @@ export default {
params: {
vinNo: '',
userSid: '',
orgPath: '',
sidList: []
},
total: 1

1
anrui-buscenter/anrui-finmanage-ui/src/views/workFlow/feiyongguanliFlow/feiyongguanli/feiyongDaiBanInfo.vue

@ -159,7 +159,6 @@ export default {
}).catch((e) => {
this.formobj = {}
})
console.log('这里是详情回显', row)
},
//
openAgree(val) {

9
anrui-buscenter/anrui-finmanage-ui/src/views/workFlow/feiyongguanliFlow/feiyongguanli/feiyongEdit.vue

@ -102,7 +102,7 @@ import req from '@/api/anruifinmanagement/expense'
import { typeValues } from '@/api/jichuxinxi/dictcommons'
import chooseVinNo from './chooseVinNo'
export default {
name: 'feiyongEdit',
name: 'FeiyongEdit',
components: {
chooseVinNo
},
@ -130,6 +130,7 @@ export default {
taskId: '',
useTypeKey: '',
useTypeValue: '',
orgPath: '',
vinNoList: []
},
rules: {},
@ -263,7 +264,6 @@ export default {
if (valid) {
this.submitdisabled = true
req.saveOrUpdate(this.formobj).then((resp) => {
this.submitdisabled = false
if (resp.success) {
this.$message({
showClose: true,
@ -278,6 +278,8 @@ export default {
code: 1
}
}, '*')
} else {
this.submitdisabled = false
}
}).catch(() => {
this.submitdisabled = false
@ -297,7 +299,6 @@ export default {
if (valid) {
this.submitdisabled = true
req.submitVehicleApply(this.formobj, this.formobj.sid).then((resp) => {
this.submitdisabled = false
if (resp.success) {
this.$message({
showClose: true,
@ -312,6 +313,8 @@ export default {
code: 1
}
}, '*')
} else {
this.submitdisabled = false
}
}).catch(() => {
this.submitdisabled = false

8
anrui-buscenter/anrui-finmanage-ui/src/views/workFlow/feiyongguanliFlow/feiyongguanli/feiyongYiBanInfo.vue

@ -121,7 +121,6 @@ export default {
}).catch((e) => {
this.formobj = {}
})
console.log('这里是详情回显', row)
},
/** 确认撤回任务 */
openRevoke() {
@ -156,13 +155,6 @@ export default {
code: 1
}
}, '*')
} else {
this.$notify({
title: '提示',
message: '执行失败',
type: 'error',
duration: 2000
})
}
})
}

Loading…
Cancel
Save