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

删除菜单

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