Commit 46025f65 authored by 吴志坤's avatar 吴志坤

设备库设备领用菜单权限验证

parent a9d4343f
......@@ -231,7 +231,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
......@@ -259,13 +259,16 @@
clearable
size="small"
style="width: 150px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" style="padding: 8px 7px;" icon="el-icon-search" size="small" @click="handleQueryWarehouse">查询</el-button>
<el-button style="padding: 8px 7px;" icon="el-icon-refresh" size="small" @click="resetQueryWarehouse">重置</el-button>
</el-form-item>
<el-radio-group v-model="radio1" class="ml-4" style="padding: 25px 7px;" @change="login">
<el-radio label="2" size="large">工序库</el-radio>
<el-radio label="1" size="large">设备库</el-radio>
</el-radio-group>
</el-form>
<el-table v-loading="loadingDetail" border :data="detailApplyList" @selection-change="handleSelectionChange">
......@@ -327,16 +330,44 @@
>确定</el-button>
</div>
</el-dialog>
<!-- 登录验证-->
<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 v-model="loginform.password" type="password" placeholder="请输入权限菜单密码" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleConfirm">确定</el-button>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
import { listWbApply, deleteLogical, detailList, batchAddition, detail } from '@/api/equipment/draw'
import {
listWbApply,
deleteLogical,
detailList,
batchAddition,
detail,
canceListByType,
checkPermission
} from '@/api/equipment/draw'
import { parseTime } from '@/utils'
import { getEquipment } from '@/api/equipment/application'
export default {
name: 'Draw',
data() {
return {
// 是否切换库
isCheck: false,
loginform: {
password: ''
},
// 打开登录验证界面
openLogin: false,
radio1: '2',
ptype: '',
pgx: '',
prank: '',
......@@ -436,10 +467,6 @@ export default {
},
// 表单参数
form: {},
defaultProps: {
children: 'children',
label: 'label'
},
deptOptions: [],
// 判断状态显示表单
applyStatus: ''
......@@ -465,9 +492,97 @@ 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() {
const obj = {
passWord: this.loginform.password
}
checkPermission(obj).then(res => {
if (res.code === 200) {
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'
}
}
})
},
// 处理弹窗里的勾选确定
handleCance() {
this.loadingDetail = true
console.log('multipleSelection', this.multipleSelection)
if (this.multipleSelection.length === 0) {
this.$message.warning('请至少选择一个要处理的设备')
} else {
......@@ -488,10 +603,11 @@ export default {
})
console.log('canceList', this.canceList)
batchAddition(this.canceList).then(res => {
console.log('res', res)
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()
......@@ -499,32 +615,42 @@ 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.queryParams.lot,
plocation: this.queryParams.plocation
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()
}
getEquipment(obj).then(res => {
res.rows.createDate = parseTime(res.rows.createDate, '{y}-{m}-{d}')
this.totalDetail = res.total
this.detailApplyList = res.rows
this.loadingDetail = false
})
},
// 处理点击
handle(row) {
console.log('row', row)
this.openHandle = true
this.applyId = row.businessId
this.pn = row.pn
this.ptype = row.ptype
......@@ -532,6 +658,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,
......@@ -540,6 +667,7 @@ export default {
page: this.queryParamsDetail.page,
rows: this.queryParamsDetail.rows
}
// 调warehouse分页查询接口
getEquipment(obj).then(res => {
if (res.code === 200) {
if (res.data.createDate !== null) {
......@@ -561,16 +689,17 @@ export default {
this.singleDetails = row
this.title = '详情'
detail(id).then(res => {
console.log('res', res)
res.data.createDate = parseTime(res.data.createDate, '{y}-{m}-{d}')
// this.totalApplyDetail = res.total
this.applyList = res.data.wbApplyDetailList
this.applyStatus = res.data.pstatus
this.loadingDetail = false
})
},
/** 查询apply列表 */
// 查询apply表单
getList() {
this.isCheck = false
this.radio1 = '2'
this.loading = true
listWbApply(this.queryParams).then(
response => {
......@@ -580,6 +709,7 @@ export default {
}
)
},
// 取消按钮
cancel() {
this.open = false
......@@ -634,12 +764,22 @@ export default {
pstatus: '',
ptype: '1'
}
// this.dateRange = []
this.handleQuery()
},
// 菜单权限验证
login() {
this.title = '菜单权限'
this.openLogin = true
this.openHandle = false
},
// warehouse的重置按钮
resetQueryWarehouse() {
this.resetForm('queryFormWarehouse')
this.queryParamsDetail.pn = null
this.queryParamsDetail.lot = null
this.queryParamsDetail.plocation = null
this.queryParamsDetail.page = 1
this.handleQueryWarehouse()
},
// 多选框选中数据
......
......@@ -480,10 +480,6 @@ export default {
},
// 表单参数
form: {},
defaultProps: {
children: 'children',
label: 'label'
},
deptOptions: [],
// 判断状态显示表单
applyStatus: ''
......
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