Commit 30f12f9f authored by renjintao's avatar renjintao

authorityCount

parent 5f194040
...@@ -191,6 +191,7 @@ export default { ...@@ -191,6 +191,7 @@ export default {
if (el.authority == 1) { if (el.authority == 1) {
this.authorityCount = 1 this.authorityCount = 1
} }
//截取加入日期
if (el.joindate && el.joindate.length >= 10) { if (el.joindate && el.joindate.length >= 10) {
el.joindate = el.joindate.substr(0, 10) el.joindate = el.joindate.substr(0, 10)
} }
...@@ -198,6 +199,7 @@ export default { ...@@ -198,6 +199,7 @@ export default {
} }
}, },
//新增
addList() { addList() {
this.edit = this.list.length; this.edit = this.list.length;
this.cur = { this.cur = {
...@@ -213,6 +215,7 @@ export default { ...@@ -213,6 +215,7 @@ export default {
this.authorityCur = 0 this.authorityCur = 0
this.list.push(this.cur); this.list.push(this.cur);
}, },
//编辑
editRow(row, index) { editRow(row, index) {
let lastListGroupId = this.list[this.list.length - 1].groupId let lastListGroupId = this.list[this.list.length - 1].groupId
if (lastListGroupId == undefined) { if (lastListGroupId == undefined) {
...@@ -231,12 +234,14 @@ export default { ...@@ -231,12 +234,14 @@ export default {
this.authorityCur = row.authority this.authorityCur = row.authority
this.edit = index this.edit = index
}, },
//选择权限
changeAuthority(val) { changeAuthority(val) {
if (this.authorityCur != 1 && this.authorityCount == 1 && val == 1) { if (this.authorityCur != 1 && this.authorityCount == 1 && val == 1) {
this.$Message.error("已存在项目经理,请选择其他权限!") this.$Message.error("已存在权限:项目经理,请选择其他权限!")
this.cur.authority = null this.cur.authority = null
} }
}, },
//选择加入日期
getTime(value) { getTime(value) {
if (value != '') { if (value != '') {
this.cur.joindate = this.getFormatDateStart( this.cur.joindate = this.getFormatDateStart(
...@@ -246,6 +251,7 @@ export default { ...@@ -246,6 +251,7 @@ export default {
this.cur.joindate = '' this.cur.joindate = ''
} }
}, },
//删除
delRow(id) { delRow(id) {
Api.delete(id).then((r) => { Api.delete(id).then((r) => {
if (r.success) { if (r.success) {
...@@ -255,6 +261,7 @@ export default { ...@@ -255,6 +261,7 @@ export default {
} }
}) })
}, },
//新增时取消
remove(row, index) { remove(row, index) {
if (!row.id || !row.groupId) { if (!row.id || !row.groupId) {
this.list.pop(); this.list.pop();
...@@ -314,7 +321,6 @@ export default { ...@@ -314,7 +321,6 @@ export default {
}) })
} }
}, },
getFormatDateStart(dates) { getFormatDateStart(dates) {
const d = new Date(dates); const d = new Date(dates);
const resDate = const resDate =
......
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