master
lion 7 months ago
parent 62ee6f5e9c
commit 7028e87d5d

@ -17,7 +17,8 @@ const getDefaultState = () => {
token: getToken(),
name: '',
avatar: '',
roles: []
roles: [],
myRoles:[]
}
}
@ -38,7 +39,11 @@ const mutations = {
},
SET_ROLES: (state, roles) => {
state.roles = roles
}
},
SET_MYROLES: (state, myRoles) => {
state.myRoles = myRoles
},
}
const actions = {
@ -79,17 +84,23 @@ const actions = {
if (!response) {
reject('身份验证失败请重新登录')
}
}
console.log("response",response)
response["myRoles"]=[]
response["role"].map(item=>{
response["myRoles"].push(item.name)
})
response["roles"] = ["admin"];
const {
const {
myRoles,
roles,
name,
avatar
} = response
commit('SET_ROLES', roles)
commit('SET_ROLES', roles)
commit('SET_MYROLES', myRoles)
commit('SET_NAME', name)
commit('SET_AVATAR', avatar)
resolve(response)

@ -45,7 +45,7 @@
size="small"
type="primary"
ghost
@click="form.audit_admin.splice(scope.$index, 1)"
@click="delRow(scope.$index)"
>删除</Button
>
</template>
@ -95,7 +95,7 @@
audit_admin:[],
remark:""
},
checkList:['一级审核人','二级审核人','三级审核人'],
checkList:[],
rules:{
name:[
{
@ -207,15 +207,65 @@
name:res?.name,
audit_admin:res?.audit_admin,
remark:res?.remark
}
let arr = []
if(res.audit_admin.length>0){
res.audit_admin.map((item,index)=>{
arr.push(`${this.indexToChinese(index)}级审核人`)
})
this.checkList = arr
}
},
addRow(){
if(this.form.audit_admin.length==3){
return
}
// if(this.form.audit_admin.length==3){
// return
// }
this.form.audit_admin.push({ type:'',admin_id:'',level:'',type_name:'',admin_name:'' })
let checkName = `${this.indexToChinese(this.form.audit_admin.length-1)}级审核人`
this.checkList.push(checkName)
console.log("this.checkList",this.checkList)
},
delRow(index){
this.form.audit_admin.splice(index, 1)
this.checkList.splice(index, 1)
let arr = []
this.checkList.map((item,index)=>{
arr.push(`${this.indexToChinese(index)}级审核人`)
})
this.checkList = arr
console.log("this.arr",this.checkList)
},
indexToChinese(index) {
const chineseNumbers = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十'];
if (index >= 0 && index < 10) {
return chineseNumbers[index];
} else if (index === 10) {
return '十';
} else if (index < 20) {
return '十' + chineseNumbers[index - 11];
} else {
const tens = Math.floor(index / 10);
const units = index % 10;
let result = '';
if (tens > 1) {
result += chineseNumbers[tens - 1] + '十';
} else {
result += '十';
}
if (units > 0) {
result += chineseNumbers[units - 1];
}
return result;
}
},
submit() {
if(this.form.audit_admin.length>0){
this.form.audit_admin.map((item,index)=>{
item.level = index+1
})
}
console.log(this.form)
// return
let that = this
@ -241,7 +291,8 @@
}
} else {
this.id = ''
this.type = ''
this.type = ''
this.checkList = []
this.$refs['dialog'].reset()
}
}

@ -22,8 +22,9 @@
:inactive-value="0"
>
</el-switch>
<div style="margin:0 10px;">只看自己审核记</div>
<div v-if="is_admin" style="margin:0 10px;"></div>
<el-switch
v-if="is_admin"
v-model="select.my_audit"
active-color="#004593"
inactive-color="#ddd"
@ -79,7 +80,7 @@
</template>
</el-table-column>
</template>
</xy-table>
</xy-table>
<showVisit ref="showVisit" @refresh="getList"></showVisit>
</div>
</template>
@ -89,7 +90,8 @@
getList,
destroy
} from '@/api/visit/record.js'
import showVisit from '@/views/visit/component/showVisit'
import showVisit from '@/views/visit/component/showVisit'
import store from "@/store/modules/user.js"
export default {
components: {
showVisit
@ -103,9 +105,11 @@
keyword: "",
audit_status: 0,
my_accept_admin: 0,
my_audit: 0,
my_self:0
},
my_audit: 1,
my_self:0,
is_auth:0
},
is_admin:false,
selectRange: [],
statusList: [{
id: -1,
@ -168,7 +172,7 @@
prop: 'follw_people',
width: 80,
formatter:(cell, data, value)=>{
return value?'是':'否'
return value.length>0?'是':'否'
}
},
{
@ -237,7 +241,14 @@
}
},
computed: {},
mounted() {
mounted() {
const state = store.state
console.log("state",state)
if(state.myRoles && state.myRoles.includes('系统管理员')){
this.select.my_audit = 0
this.is_admin = true
}
console.log(this.is_admin,state.myRoles.includes('系统管理员'))
this.getList()
},
methods: {

@ -62,7 +62,8 @@
import addCommon from '@/views/visit/component/addCommon'
import {
download
} from '@/utils/downloadRequest'
} from '@/utils/downloadRequest'
import store from "@/store/modules/user.js"
export default {
components: {
addCommon
@ -74,7 +75,8 @@
page: 1,
page_size: 10,
keyword: "",
audit_status: "",
audit_status: "",
my_accept_admin:'',
start_date: "",
end_date: "",
is_export: 0
@ -244,7 +246,12 @@
}
},
computed: {},
mounted() {
mounted() {
console.log("stote",store)
// const state = store.state
// if(state.role && state.role.includes('')!=-1){
// this.select.my_accept_admin = ''
// }
this.getList()
},
methods: {

Loading…
Cancel
Save