Commit d9a999ba authored by 高宇's avatar 高宇

删除菜单

parent 1eabb4c4
......@@ -44,13 +44,22 @@ export function detail(id) {
}
// 菜单权限验证接口
export function checkPermission(password) {
export function checkPermission(data) {
return request({
url: '/wbapply/checkPermission',
method: 'post',
password,
data,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
}
// 根据type查询要处理的设备
export function canceListByType(params) {
return request({
url: '/wbwarehouse/canceListByType',
method: 'get',
params
})
}
......@@ -237,7 +237,7 @@
</el-dialog>
<!-- TODO: 处理 -->
<el-dialog :title="title" :visible.sync="openHandle" width="1200px" append-to-body>
<el-dialog :title="title" :visible.sync="openHandle" width="1200px" append-to-body :close-on-click-modal="false" @close="handlecanceClose">
<el-form ref="queryFormWarehouse" style="padding: 0 0 0 10px" :model="queryParamsDetail" :inline="true">
<el-form-item label="pn" prop="pn">
<el-input
......@@ -337,11 +337,11 @@
</div>
</el-dialog>
<!-- 登录验证-->
<el-dialog :title="title" :visible.sync="openLogin" width="500px" append-to-body>
<!-- 登录验证-->
<el-dialog :title="title" :visible.sync="openLogin" width="500px" append-to-body :close-on-click-modal="false">
<el-form ref="form" :model="loginform" label-width="80px">
<el-form-item label="密码">
<el-input type="password" v-model="loginform.password"></el-input>
<el-input v-model="loginform.password" type="password" placeholder="请输入权限菜单密码" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleConfirm">确定</el-button>
......@@ -352,14 +352,15 @@
</template>
<script>
import { getEquipment } from '@/api/equipment/application'
import { listWbApply, deleteLogical, batchAddition, detail, checkPermission } from '@/api/equipment/draw'
import { listWbApply, deleteLogical, batchAddition, detail, checkPermission, canceListByType } from '@/api/equipment/draw'
import { parseTime } from '@/utils'
export default {
name: 'Draw',
data() {
return {
// 是否切换库
isCheck: false,
loginform: {
username: '',
password: ''
},
// 打开登录验证界面
......@@ -487,12 +488,90 @@ export default {
this.getList()
},
methods: {
handlecanceClose() {
this.loadingDetail = false
this.openHandle = false
this.isCheck = false
},
handcheckPermissionQuery() {
const obj = {
pn: this.pn,
type: this.radio1,
pgx: this.pgx,
prank: this.prank,
pissb: this.pissb,
page: this.queryParamsDetail.page,
rows: this.queryParamsDetail.rows,
tempPn: this.queryParamsDetail.pn,
lot: this.queryParamsDetail.lot,
plocation: this.queryParamsDetail.plocation
}
canceListByType(obj).then(res => {
if (res.code === 200) {
if (res.data.createDate !== null) {
res.data.createDate = parseTime(res.data.createDate, '{y}-{m}-{d}')
}
this.detailApplyList = res.data
this.loadingDetail = false
this.openHandle = true
}
})
},
// 菜单权限验证确定
handleConfirm() {
checkPermission(this.loginform.password).then(res => {
const obj = {
passWord: this.loginform.password
}
checkPermission(obj).then(res => {
if (res.code === 200) {
this.$message.warning('已切换到设备库')
this.openLogin = false
if (this.radio1 === '1') {
this.$message.success('已切换到设备库')
} else {
this.$message.success('已切换到工艺库')
}
const obj = {
pn: this.pn,
type: this.radio1,
pgx: this.pgx,
prank: this.prank,
pissb: this.pissb
}
canceListByType(obj).then(res => {
console.log('res', res)
if (res.code === 200) {
this.isCheck = true
if (res.data.createDate !== null) {
res.data.createDate = parseTime(res.data.createDate, '{y}-{m}-{d}')
}
this.detailApplyList = res.data
this.loadingDetail = false
this.openHandle = true
} else if (res.code === null) {
this.$message.warning(res.message)
if (this.radio1 === '1') {
this.radio1 = '1'
} else {
this.radio1 = '2'
}
this.loadingDetail = false
this.openHandle = true
}
})
} else if (res.code === null) {
this.$message.warning(res.$message)
if (this.radio1 === '2') {
this.radio1 = '1'
} else {
this.radio1 = '2'
}
} else if (res.code === 500) {
this.$message.warning(res.$message)
if (this.radio1 === '2') {
this.radio1 = '1'
} else {
this.radio1 = '2'
}
}
})
},
......@@ -522,6 +601,8 @@ export default {
if (res.code === 200) {
this.loadingDetail = false
this.openHandle = false
this.radio1 = '2'
this.isCheck = false
this.$message.success('操作成功')
this.queryParams.page = 1
this.getList()
......@@ -532,28 +613,33 @@ export default {
/** 查询warehouse列表 */
getDeviceList() {
this.loadingDetail = true
const obj = {
pn: this.pn,
ptype: this.ptype,
pgx: this.pgx,
prank: this.prank,
pissb: this.pissb,
page: this.queryParamsDetail.page,
rows: this.queryParamsDetail.rows,
tempPn: this.queryParamsDetail.pn,
lot: this.queryParamsDetail.lot,
plocation: this.queryParamsDetail.plocation
}
getEquipment(obj).then(res => {
if (res.code === 200) {
if (res.data.createDate !== null) {
res.data.createDate = parseTime(res.data.createDate, '{y}-{m}-{d}')
}
this.detailApplyList = res.data
this.loadingDetail = false
this.openHandle = true
if (!this.isCheck) {
const obj = {
type: this.radio1,
pn: this.pn,
ptype: this.ptype,
pgx: this.pgx,
prank: this.prank,
pissb: this.pissb,
page: this.queryParamsDetail.page,
rows: this.queryParamsDetail.rows,
tempPn: this.queryParamsDetail.pn,
lot: this.queryParamsDetail.lot,
plocation: this.queryParamsDetail.plocation
}
})
getEquipment(obj).then(res => {
if (res.code === 200) {
if (res.data.createDate !== null) {
res.data.createDate = parseTime(res.data.createDate, '{y}-{m}-{d}')
}
this.detailApplyList = res.data
this.loadingDetail = false
this.openHandle = true
}
})
} else {
this.handcheckPermissionQuery()
}
},
handle(row) {
console.log('row', row)
......@@ -564,6 +650,7 @@ export default {
this.prank = row.prank
this.pissb = row.pissb
const obj = {
type: this.radio1,
pn: row.pn,
ptype: row.ptype,
pgx: row.pgx,
......@@ -600,6 +687,8 @@ export default {
},
/** 查询apply列表 */
getList() {
this.isCheck = false
this.radio1 = '2'
this.loading = true
listWbApply(this.queryParams).then(
response => {
......@@ -670,6 +759,7 @@ export default {
login() {
this.title = '菜单权限'
this.openLogin = true
this.openHandle = false
},
// warehouse的重置按钮
resetQueryWarehouse() {
......
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