Commit db8a702a authored by 高宇's avatar 高宇

权限修改

parent 3c3507a2
......@@ -43,10 +43,21 @@ export function detail(id) {
})
}
// 菜单权限验证接口
// export function checkPermission(data) {
// return request({
// url: '/wbapply/checkPermission',
// method: 'post',
// data,
// headers: {
// 'Content-Type': 'application/json;charset=UTF-8'
// }
// })
// }
// 菜单权限验证接口
export function checkPermission(data) {
return request({
url: '/wbapply/checkPermission',
url: '/wbwarehouselog/checkPermissionTwo',
method: 'post',
data,
headers: {
......@@ -55,6 +66,7 @@ export function checkPermission(data) {
})
}
// 根据type查询要处理的设备
export function canceListByType(params) {
return request({
......
......@@ -342,9 +342,8 @@
<span style="font-size: 15px">您选择的设备入库时间较早,需要权限验证</span>
</div>
<el-form ref="form" :model="loginform" label-width="80px">
<el-form-item label="密码">
<el-input v-model="loginform.password" type="password" placeholder="请输入密码" />
<span v-if="twoerrorPassword" style="font-size: 14px;color: red">密码错误,请重试</span>
<el-form-item label="用户名">
<el-input v-model="loginform.password" placeholder="请输入用户名" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleConfirm">确定</el-button>
......@@ -490,7 +489,6 @@ export default {
isSameMonths(dateArray, data) {
for (let i = 0; i < dateArray.length; i++) {
if (dateArray[i].getMonth() !== data.getMonth()) {
console.log('111')
return false
}
}
......@@ -636,13 +634,20 @@ export default {
handleConfirm() {
this.twoerrorPassword = false
const obj = {
passWord: this.loginform.password
unlockType: 'time',
unlockUsername: this.loginform.password
}
// 校验密码
checkPermission(obj).then(res => {
if (res.code === 200) {
this.openLogin = false
this.openHandle = false
this.loadingDetail = false
this.canceList.forEach(item => {
item.unlockUsername = res.data.unlockUsername
item.unlockDate = res.data.unlockDate
})
// 提交选择中的数组
batchAddition(this.canceList).then(res => {
if (res.code === 200) {
this.openHandle = false
......@@ -656,7 +661,7 @@ export default {
}
})
} else if (res.code === null) {
this.twoerrorPassword = true
this.$message.error(res.message)
}
})
},
......@@ -683,7 +688,9 @@ export default {
phd: item.phd,
psm: item.psm,
prank: item.prank,
rkDate: item.createDate
rkDate: item.createDate,
unlockUsername: null,
unlockDate: null
}
this.canceList.push(obj)
})
......
......@@ -358,9 +358,8 @@
<span style="font-size: 15px">您选择的设备入库日期较早,需要权限验证 </span>
</div>
<el-form ref="form" :model="menuform" label-width="80px">
<el-form-item label="密码">
<el-input v-model="menuform.passWord" type="password" placeholder="请输入密码" />
<span v-if="twoerrorPassword" style="font-size: 14px;color: red">密码错误,请重试</span>
<el-form-item label="用户名">
<el-input v-model="menuform.passWord" placeholder="请输入用户名" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handlemenuConfirm">确定</el-button>
......@@ -373,9 +372,8 @@
<span style="font-size: 15px">当前选择跨越设备需要权限验证</span>
</div>
<el-form ref="form" :model="loginform" label-width="80px">
<el-form-item label="密码">
<el-input v-model="loginform.password" type="password" placeholder="请输入密码" />
<span v-if="errorPassword" style="font-size: 14px;color: red">密码错误,请重试</span>
<el-form-item label="用户名">
<el-input v-model="loginform.password" placeholder="请输入用户名" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleConfirm">确定</el-button>
......@@ -392,6 +390,12 @@ export default {
name: 'Draw',
data() {
return {
// 选择跨越设备校验
oneTemp: {
check: false,
userName: '',
time: ''
},
twoerrorPassword: false,
errorPassword: false,
// 数据字典列表
......@@ -650,14 +654,20 @@ export default {
},
handlemenuConfirm() {
const obj = {
passWord: this.menuform.passWord
unlockType: 'time',
unlockUsername: this.menuform.passWord
}
console.log('obj', obj)
checkPermission(obj).then(res => {
if (res.code === 200) {
this.menu = false
this.loadingDetail = false
this.openHandle = false
this.twoerrorPassword = false
this.canceList.forEach(item => {
item.unlockUsername = res.data.unlockUsername
item.unlockDate = res.data.unlockDate
})
batchAddition(this.canceList).then(res => {
if (res.code === 200) {
this.openHandle = false
......@@ -667,7 +677,7 @@ export default {
}
})
} else if (res.code === null) {
this.twoerrorPassword = true
this.$message.error(res.message)
}
})
},
......@@ -688,6 +698,9 @@ export default {
this.loadingDetail = false
this.openHandle = false
this.isCheck = false
this.oneTemp.check = false
this.oneTemp.userName = null
this.oneTemp.time = null
},
handcheckPermissionQuery() {
const obj = {
......@@ -718,15 +731,20 @@ export default {
handleConfirm() {
this.isClose = false
const obj = {
passWord: this.loginform.password
unlockType: 'equipment',
unlockUsername: this.loginform.password
}
checkPermission(obj).then(res => {
if (res.code === 200) {
console.log('跨越设备')
this.openHandle = false
this.loadingDetail = false
this.errorPassword = false
this.openLogin = false
this.isClose = true
this.oneTemp.check = true
this.oneTemp.userName = res.data.unlockUsername
this.oneTemp.time = res.data.unlockDate
const obj = {
sort: '1',
pn: this.pn,
......@@ -751,7 +769,7 @@ export default {
})
} else if (res.code === null) {
this.isClose = false
this.errorPassword = true
this.$message.error(res.message)
}
})
},
......@@ -782,7 +800,9 @@ export default {
phd: item.phd,
psm: item.psm,
prank: item.prank,
rkDate: recycleDate
rkDate: recycleDate,
unlockUsername: null,
unlockDate: null
}
this.canceList.push(obj)
})
......@@ -808,6 +828,10 @@ export default {
this.menu = true
}
if (!this.monthDate) {
this.canceList.forEach(item => {
item.unlockUsername = this.oneTemp.userName
item.unlockDate = this.oneTemp.time
})
batchAddition(this.canceList).then(res => {
if (res.code === 200) {
this.loadingDetail = false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment