Commit 1f946d7a authored by 高宇's avatar 高宇

删除菜单

parent f4057b84
...@@ -325,7 +325,12 @@ export default { ...@@ -325,7 +325,12 @@ export default {
}, },
methods: { methods: {
replace(value) { replace(value) {
return this.dictList.find(item => item.dictValue === value).dictLabel console.log('value')
if (this.dictList.length>0) {
return this.dictList.find(item => item.dictValue === value).dictLabel
} else {
return value
}
}, },
getCodeDict() { getCodeDict() {
const obj = { const obj = {
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
</el-table-column> </el-table-column>
<el-table-column label="pgx" prop="pgx"> <el-table-column label="pgx" prop="pgx">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{replace(scope.row.pgx)}}</span> <span>{{ replace(scope.row.pgx) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="pnumber" prop="pnumber"> <el-table-column label="pnumber" prop="pnumber">
...@@ -519,6 +519,59 @@ export default { ...@@ -519,6 +519,59 @@ export default {
this.getCodeDict() this.getCodeDict()
}, },
methods: { methods: {
// 判断日期是否相同
isSameMonthDates(datesArray) {
console.log('datesArray',datesArray)
// 如果数组中只有一个元素,返回日期相同
if (datesArray.length === 1) {
return true
}
// 获取第一个日期的月份
const firstMonth = datesArray[0].getMonth()
// 遍历数组中的日期,检查月份是否都相同
for (let i = 1; i < datesArray.length; i++) {
if (datesArray[i].getMonth() !== firstMonth) {
return false
}
}
return true
},
// 符合弹出权限菜单时返回 true,不符合false
condition(list1, list2, number) {
// 所有数据的id的集合
var idList = []
// 前选中的数量id的集合
var checkIdList = []
// 选中的list日期的集合
var checkTimeList = []
idList = list2.map(item => item.businessId)
checkIdList = idList.splice(0, number)
var i = 0
list1.forEach(item => {
checkIdList.forEach(Litem => {
if (item.tempId === Litem) {
i = i + 1
}
})
})
console.log('i', i)
console.log('number',number)
if (i === number) {
console.log('1false')
return false
} else {
list1.forEach(item => {
checkTimeList.push(new Date(item.rkDate))
})
if (this.isSameMonthDates(checkTimeList)) {
console.log('2false')
return false
} else {
console.log('3true')
return true
}
}
},
replace(value) { replace(value) {
return this.dictList.find(item => item.dictValue === value).dictLabel return this.dictList.find(item => item.dictValue === value).dictLabel
}, },
...@@ -590,11 +643,13 @@ export default { ...@@ -590,11 +643,13 @@ export default {
checkPermission(obj).then(res => { checkPermission(obj).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.openLogin = false this.openLogin = false
this.openHandle = false
this.loadingDetail = false
batchAddition(this.canceList).then(res => { batchAddition(this.canceList).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.openHandle = false
this.twoerrorPassword = false this.twoerrorPassword = false
this.loadingDetail = false this.loadingDetail = false
this.openHandle = false
this.isCheck = false this.isCheck = false
this.$message.success('操作成功') this.$message.success('操作成功')
this.queryParams.page = 1 this.queryParams.page = 1
...@@ -619,11 +674,8 @@ export default { ...@@ -619,11 +674,8 @@ export default {
this.canceList = [] this.canceList = []
this.multipleSelection.forEach(item => { this.multipleSelection.forEach(item => {
console.log('item', item) console.log('item', item)
if (!this.isWithinLastMonth(new Date(item.createDate))) {
this.monthDate = true
this.openHandle = false
}
const obj = { const obj = {
tempId: item.businessId,
applyId: this.applyId, applyId: this.applyId,
pn: item.pn, pn: item.pn,
pzl: item.pzl, pzl: item.pzl,
...@@ -642,8 +694,12 @@ export default { ...@@ -642,8 +694,12 @@ export default {
this.loadingDetail = false this.loadingDetail = false
return this.$message.warning('您选择的设备数据不符合您申请设备的数量') return this.$message.warning('您选择的设备数据不符合您申请设备的数量')
} }
console.log('是否打开弹框',this.condition(this.canceList, this.detailApplyList, this.singleDetails.pnumber))
console.log('canceList', this.canceList) if (this.condition(this.canceList, this.detailApplyList, this.singleDetails.pnumber)) {
this.monthDate = true
this.openHandle = false
}
console.log('monthDate',this.monthDate)
if (this.monthDate) { if (this.monthDate) {
this.openLogin = true this.openLogin = true
} }
...@@ -669,6 +725,7 @@ export default { ...@@ -669,6 +725,7 @@ export default {
const obj = { const obj = {
sort: '1', sort: '1',
type: this.radio1, type: this.radio1,
phd: this.phd,
pn: this.pn, pn: this.pn,
ptype: this.ptype, ptype: this.ptype,
pgx: this.pgx, pgx: this.pgx,
...@@ -699,9 +756,11 @@ export default { ...@@ -699,9 +756,11 @@ export default {
handle(row) { handle(row) {
const id = row.businessId const id = row.businessId
this.singleDetails = row this.singleDetails = row
this.monthDate = false
this.number = row.pnumber this.number = row.pnumber
this.openHandle = true this.openHandle = true
this.applyId = row.businessId this.applyId = row.businessId
this.phd = row.phd
this.pn = row.pn this.pn = row.pn
this.pgx = row.pgx this.pgx = row.pgx
this.prank = row.prank this.prank = row.prank
...@@ -709,6 +768,7 @@ export default { ...@@ -709,6 +768,7 @@ export default {
const obj = { const obj = {
sort: '1', sort: '1',
type: this.radio1, type: this.radio1,
phd: row.phd,
pn: row.pn, pn: row.pn,
pgx: row.pgx, pgx: row.pgx,
prank: row.prank, prank: row.prank,
...@@ -806,12 +866,7 @@ export default { ...@@ -806,12 +866,7 @@ export default {
this.handleQuery() this.handleQuery()
}, },
// 菜单权限验证
login() {
this.title = '权限校验'
this.openLogin = true
this.openHandle = false
},
// warehouse的重置按钮 // warehouse的重置按钮
resetQueryWarehouse() { resetQueryWarehouse() {
......
...@@ -364,11 +364,16 @@ ...@@ -364,11 +364,16 @@
{{ scope.row.psm || '-' }} {{ scope.row.psm || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="入库日期" prop="recycleDate"> <el-table-column v-if="this.radio1 == '2'" label="入库日期" prop="recycleDate">
<template slot-scope="scope"> <template slot-scope="scope">
{{ parseTime(scope.row.recycleDate,'{y}-{m}-{d}') }} {{ parseTime(scope.row.recycleDate,'{y}-{m}-{d}') }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="this.radio1 === '1'" label="入库日期" prop="createDate">
<template slot-scope="scope">
{{ parseTime(scope.row.createDate, '{y}-{m}-{d}') || '-' }}
</template>
</el-table-column>
</el-table> </el-table>
<div style="float: right;padding:3px 15px;"> <div style="float: right;padding:3px 15px;">
<el-button <el-button
...@@ -558,6 +563,59 @@ export default { ...@@ -558,6 +563,59 @@ export default {
this.getList() this.getList()
}, },
methods: { methods: {
// 判断日期是否相同
isSameMonthDates(datesArray) {
console.log('datesArray', datesArray)
// 如果数组中只有一个元素,返回日期相同
if (datesArray.length === 1) {
return true
}
// 获取第一个日期的月份
const firstMonth = datesArray[0].getMonth()
// 遍历数组中的日期,检查月份是否都相同
for (let i = 1; i < datesArray.length; i++) {
if (datesArray[i].getMonth() !== firstMonth) {
console.log('111')
return false
}
}
return true
},
// 符合弹出权限菜单时返回 true,不符合false
condition(list1, list2, number) {
// 所有数据的id的集合
var idList = []
// 前选中的数量id的集合
var checkIdList = []
// 选中的list日期的集合
var checkTimeList = []
idList = list2.map(item => item.businessId)
checkIdList = idList.splice(0, number)
var i = 0
list1.forEach(item => {
checkIdList.forEach(Litem => {
if (item.tempId === Litem) {
i = i + 1
}
})
})
console.log('list1', list1)
console.log('checkIdList', checkIdList)
console.log('i', i)
console.log('number', number)
if (i === number) {
return false
} else {
list1.forEach(item => {
checkTimeList.push(new Date(item.rkDate))
})
if (this.isSameMonthDates(checkTimeList)) {
return false
} else {
return true
}
}
},
replace(value) { replace(value) {
let label = '' let label = ''
if (this.dictList.length > 0) { if (this.dictList.length > 0) {
...@@ -604,12 +662,12 @@ export default { ...@@ -604,12 +662,12 @@ export default {
} }
checkPermission(obj).then(res => { checkPermission(obj).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.menu = false
this.loadingDetail = false
this.openHandle = false
this.twoerrorPassword = false this.twoerrorPassword = false
batchAddition(this.canceList).then(res => { batchAddition(this.canceList).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.loadingDetail = false
this.openHandle = false
this.isCheck = false
this.$message.success('操作成功') this.$message.success('操作成功')
this.queryParams.page = 1 this.queryParams.page = 1
this.getList() this.getList()
...@@ -672,16 +730,13 @@ export default { ...@@ -672,16 +730,13 @@ export default {
} }
checkPermission(obj).then(res => { checkPermission(obj).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.isClose = true this.openHandle = false
this.loadingDetail = false
this.errorPassword = false this.errorPassword = false
this.openLogin = false this.openLogin = false
if (this.radio1 === '1') { this.isClose = true
this.$message.success('已切换到设备库')
} else {
this.$message.success('已切换到工艺库')
}
const obj = { const obj = {
sort: '2', sort: '1',
pn: this.pn, pn: this.pn,
type: this.radio1, type: this.radio1,
pgx: this.pgx, pgx: this.pgx,
...@@ -718,12 +773,14 @@ export default { ...@@ -718,12 +773,14 @@ export default {
} else { } else {
this.canceList = [] this.canceList = []
this.multipleSelection.forEach(item => { this.multipleSelection.forEach(item => {
console.log('item', item) let recycleDate = ''
if (!this.isWithinLastMonth(new Date(item.recycleDate))) { if (this.radio1 === '2') {
this.monthDate = true recycleDate = item.recycleDate
this.openHandle = false } else if (this.radio1 === '1') {
recycleDate = item.createDate
} }
const obj = { const obj = {
tempId: item.businessId,
applyId: this.applyId, applyId: this.applyId,
pn: item.pn, pn: item.pn,
pzl: item.pzl, pzl: item.pzl,
...@@ -732,7 +789,7 @@ export default { ...@@ -732,7 +789,7 @@ export default {
phd: item.phd, phd: item.phd,
psm: item.psm, psm: item.psm,
prank: item.prank, prank: item.prank,
rkDate: item.recycleDate rkDate: recycleDate
} }
this.canceList.push(obj) this.canceList.push(obj)
}) })
...@@ -742,8 +799,11 @@ export default { ...@@ -742,8 +799,11 @@ export default {
this.openHandle = true this.openHandle = true
return this.$message.warning('您选择的设备数据不符合您申请设备的数量') return this.$message.warning('您选择的设备数据不符合您申请设备的数量')
} }
console.log('canceList', this.canceList) // 判断是否弹出权限菜单,true是符合条件,false是不符合条件
console.log('monthDate', this.monthDate) if (this.condition(this.canceList, this.detailApplyList, this.singleDetails.pnumber)) {
this.monthDate = true
this.openHandle = false
}
if (this.monthDate) { if (this.monthDate) {
this.twoerrorPassword = false this.twoerrorPassword = false
this.menu = true this.menu = true
...@@ -772,6 +832,7 @@ export default { ...@@ -772,6 +832,7 @@ export default {
sort: '2', sort: '2',
type: this.radio1, type: this.radio1,
pn: this.pn, pn: this.pn,
phd: this.phd,
ptype: this.ptype, ptype: this.ptype,
pgx: this.pgx, pgx: this.pgx,
prank: this.prank, prank: this.prank,
...@@ -808,11 +869,13 @@ export default { ...@@ -808,11 +869,13 @@ export default {
this.pn = row.pn this.pn = row.pn
this.ptype = row.ptype this.ptype = row.ptype
this.pgx = row.pgx this.pgx = row.pgx
this.phd = row.phd
this.prank = row.prank this.prank = row.prank
this.pissb = row.pissb this.pissb = row.pissb
const obj = { const obj = {
sort: '2', sort: '2',
type: this.radio1, type: this.radio1,
phd: row.phd,
pn: row.pn, pn: row.pn,
ptype: row.ptype, ptype: row.ptype,
pgx: row.pgx, pgx: row.pgx,
...@@ -941,6 +1004,7 @@ export default { ...@@ -941,6 +1004,7 @@ export default {
const obj = { const obj = {
sort: '2', sort: '2',
type: this.radio1, type: this.radio1,
phd: this.phd,
pn: this.pn, pn: this.pn,
ptype: this.ptype, ptype: this.ptype,
pgx: this.pgx, pgx: this.pgx,
......
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