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

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

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