Commit 05ddc09a authored by renjintao's avatar renjintao

checkTime

parent 80f449b2
...@@ -1913,6 +1913,7 @@ export default { ...@@ -1913,6 +1913,7 @@ export default {
groupId: '项目组Id', groupId: '项目组Id',
authority:'权限', authority:'权限',
whour:'可用工日', whour:'可用工日',
whourpd:'可用工时/天' whourpd:'可用工时/天',
joindate:'加盟日'
} }
} }
...@@ -13,6 +13,10 @@ ...@@ -13,6 +13,10 @@
<state v-if="edit != index" code="project.group.status" :value="row.status" type="text"></state> <state v-if="edit != index" code="project.group.status" :value="row.status" type="text"></state>
<Dictionary v-else code="project.group.status" v-model="cur.status"></Dictionary> <Dictionary v-else code="project.group.status" v-model="cur.status"></Dictionary>
</template> </template>
<template slot-scope="{ row, index }" slot="joindate">
<span v-if="edit != index" v-text="row.joindate"></span>
<DatePicker v-else v-model="cur.joindate" type="date" transfer placeholder="请选择加入日期" @on-change="getTime"></DatePicker>
</template>
<template slot-scope="{ row, index }" slot="whour"> <template slot-scope="{ row, index }" slot="whour">
<span v-if="edit != index" v-text="row.whour"></span> <span v-if="edit != index" v-text="row.whour"></span>
<InputNumber v-else type="text" v-model.trim="cur.whour" /> <InputNumber v-else type="text" v-model.trim="cur.whour" />
...@@ -100,6 +104,12 @@ export default { ...@@ -100,6 +104,12 @@ export default {
align: "center", align: "center",
slot: 'status' slot: 'status'
}, },
{
key: "joindate",
title: this.l("joindate"),
align: "center",
slot: 'joindate'
},
{ {
key: "whour", key: "whour",
title: this.l("whour"), title: this.l("whour"),
...@@ -155,22 +165,6 @@ export default { ...@@ -155,22 +165,6 @@ export default {
await store.dispatch('loadDictionary') // 加载数据字典 await store.dispatch('loadDictionary') // 加载数据字典
}, },
methods: { methods: {
changeAuthority(val) {
if (this.authorityCur != 1 && this.authorityCount == 1 && val == 1) {
this.$Message.error("已存在项目经理,请选择其他权限!")
this.cur.authority = null
}
},
getAuthority() {
if (this.list.length > 0) {
this.list.forEach(el => {
if (el.authority == 1) {
this.authorityCount = 1
}
})
}
},
load(v) { load(v) {
let params = { let params = {
conditions: [{ conditions: [{
...@@ -186,17 +180,16 @@ export default { ...@@ -186,17 +180,16 @@ export default {
} }
}) })
}, },
ok() { //获取是否权限里有项目经理选项
this.load(this.eid) getAuthority() {
this.modal = false if (this.list.length > 0) {
this.curId = ''; this.list.forEach(el => {
}, if (el.authority == 1) {
add() { this.authorityCount = 1
alert(this.eid) }
this.curId = ''; })
this.title = "新增";
this.detail = () => import('./add') }
this.modal = true;
}, },
addList() { addList() {
this.edit = this.list.length; this.edit = this.list.length;
...@@ -204,6 +197,7 @@ export default { ...@@ -204,6 +197,7 @@ export default {
userId: null, userId: null,
role: null, role: null,
status: null, status: null,
joindate: '',
whour: 14, whour: 14,
whourpd: 7.0, whourpd: 7.0,
authority: null, authority: null,
...@@ -212,24 +206,6 @@ export default { ...@@ -212,24 +206,6 @@ export default {
this.authorityCur = 0 this.authorityCur = 0
this.list.push(this.cur); this.list.push(this.cur);
}, },
copy(id) {
this.curId = id;
this.title = "克隆";
this.detail = () => import('./add')
this.modal = true;
},
view(id) {
this.curId = id;
this.title = "详情";
this.detail = () => import('./detail')
this.modal = true;
},
editRow1(id) {
this.curId = id;
this.title = "编辑";
this.detail = () => import('./edit')
this.modal = true;
},
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) {
...@@ -241,12 +217,28 @@ export default { ...@@ -241,12 +217,28 @@ export default {
this.cur.role = row.role this.cur.role = row.role
this.cur.status = row.status this.cur.status = row.status
this.cur.authority = row.authority this.cur.authority = row.authority
this.cur.joindate = row.joindate ? row.joindate : ''
this.cur.whour = row.whour ? row.whour : 14 this.cur.whour = row.whour ? row.whour : 14
this.cur.whourpd = row.whourpd ? row.whourpd : 7.0 this.cur.whourpd = row.whourpd ? row.whourpd : 7.0
this.cur.note = row.note this.cur.note = row.note
this.authorityCur = row.authority this.authorityCur = row.authority
this.edit = index this.edit = index
}, },
changeAuthority(val) {
if (this.authorityCur != 1 && this.authorityCount == 1 && val == 1) {
this.$Message.error("已存在项目经理,请选择其他权限!")
this.cur.authority = null
}
},
getTime(value) {
if (value != '') {
this.cur.joindate = this.getFormatDateStart(
value
);
} else {
this.cur.joindate = ''
}
},
delRow(id) { delRow(id) {
Api.delete(id).then((r) => { Api.delete(id).then((r) => {
if (r.success) { if (r.success) {
...@@ -263,6 +255,7 @@ export default { ...@@ -263,6 +255,7 @@ export default {
this.edit = -1; this.edit = -1;
}, },
//新增保存或修改保存
save() { save() {
this.cur.groupId = this.eid this.cur.groupId = this.eid
if (this.cur.userId == null || this.cur.userId == '') { if (this.cur.userId == null || this.cur.userId == '') {
...@@ -309,14 +302,60 @@ export default { ...@@ -309,14 +302,60 @@ export default {
}) })
} }
}, },
cancel() {
this.curId = this.eid; getFormatDateStart(dates) {
this.modal = false const d = new Date(dates);
const resDate =
d.getFullYear() +
"-" +
this.p(d.getMonth() + 1) +
"-" +
this.p(d.getDate())
return resDate;
},
p(s) {
return s < 10 ? "0" + s : s;
}, },
l(key) { l(key) {
let vkey = "project_group_user" + "." + key; let vkey = "project_group_user" + "." + key;
return this.$t(vkey) || key return this.$t(vkey) || key
},
//old弹框模式方法start
ok() {
this.load(this.eid)
this.modal = false
this.curId = '';
},
add() {
alert(this.eid)
this.curId = '';
this.title = "新增";
this.detail = () => import('./add')
this.modal = true;
},
copy(id) {
this.curId = id;
this.title = "克隆";
this.detail = () => import('./add')
this.modal = true;
},
view(id) {
this.curId = id;
this.title = "详情";
this.detail = () => import('./detail')
this.modal = true;
},
editRow1(id) {
this.curId = id;
this.title = "编辑";
this.detail = () => import('./edit')
this.modal = true;
},
cancel() {
this.curId = this.eid;
this.modal = false
} }
//old弹框模式方法end
}, },
watch: { watch: {
eid(v) { eid(v) {
......
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