Commit 05ddc09a authored by renjintao's avatar renjintao

checkTime

parent 80f449b2
......@@ -1913,6 +1913,7 @@ export default {
groupId: '项目组Id',
authority:'权限',
whour:'可用工日',
whourpd:'可用工时/天'
whourpd:'可用工时/天',
joindate:'加盟日'
}
}
......@@ -13,6 +13,10 @@
<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>
</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">
<span v-if="edit != index" v-text="row.whour"></span>
<InputNumber v-else type="text" v-model.trim="cur.whour" />
......@@ -100,6 +104,12 @@ export default {
align: "center",
slot: 'status'
},
{
key: "joindate",
title: this.l("joindate"),
align: "center",
slot: 'joindate'
},
{
key: "whour",
title: this.l("whour"),
......@@ -155,22 +165,6 @@ export default {
await store.dispatch('loadDictionary') // 加载数据字典
},
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) {
let params = {
conditions: [{
......@@ -186,17 +180,16 @@ export default {
}
})
},
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;
//获取是否权限里有项目经理选项
getAuthority() {
if (this.list.length > 0) {
this.list.forEach(el => {
if (el.authority == 1) {
this.authorityCount = 1
}
})
}
},
addList() {
this.edit = this.list.length;
......@@ -204,6 +197,7 @@ export default {
userId: null,
role: null,
status: null,
joindate: '',
whour: 14,
whourpd: 7.0,
authority: null,
......@@ -212,24 +206,6 @@ export default {
this.authorityCur = 0
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) {
let lastListGroupId = this.list[this.list.length - 1].groupId
if (lastListGroupId == undefined) {
......@@ -241,12 +217,28 @@ export default {
this.cur.role = row.role
this.cur.status = row.status
this.cur.authority = row.authority
this.cur.joindate = row.joindate ? row.joindate : ''
this.cur.whour = row.whour ? row.whour : 14
this.cur.whourpd = row.whourpd ? row.whourpd : 7.0
this.cur.note = row.note
this.authorityCur = row.authority
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) {
Api.delete(id).then((r) => {
if (r.success) {
......@@ -263,6 +255,7 @@ export default {
this.edit = -1;
},
//新增保存或修改保存
save() {
this.cur.groupId = this.eid
if (this.cur.userId == null || this.cur.userId == '') {
......@@ -309,14 +302,60 @@ export default {
})
}
},
cancel() {
this.curId = this.eid;
this.modal = false
getFormatDateStart(dates) {
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) {
let vkey = "project_group_user" + "." + 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: {
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