|
@@ -55,17 +55,22 @@
|
|
<!-- <div>请选择投入项目</div> -->
|
|
<!-- <div>请选择投入项目</div> -->
|
|
<van-field readonly name="projectId" clickable :value="item.projectName" :label="user.companyId==781?'工作任务':'投入项目'" :placeholder="user.companyId==781?'请选择工作任务':'请选择项目'" @click="clickPicker(index, item)"
|
|
<van-field readonly name="projectId" clickable :value="item.projectName" :label="user.companyId==781?'工作任务':'投入项目'" :placeholder="user.companyId==781?'请选择工作任务':'请选择项目'" @click="clickPicker(index, item)"
|
|
:rules="[{ required: true, message: user.companyId==781?'请选择任务':'请选择项目' }]" />
|
|
:rules="[{ required: true, message: user.companyId==781?'请选择任务':'请选择项目' }]" />
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- <van-field readonly name="subProjectId" v-if="item.subProjectList != null && item.subProjectList.length > 0 && user.timeType.mainProjectState != 1" clickable
|
|
|
|
|
|
+ <!--昱众不显示子项目-->
|
|
|
|
+ <van-field readonly name="subProjectId" v-if="user.companyId != yuzhongCompId && item.subProjectList != null && item.subProjectList.length > 0 && user.timeType.mainProjectState != 1" clickable
|
|
:value="item.subProjectName" label="子项目" placeholder="请选择子项目"
|
|
:value="item.subProjectName" label="子项目" placeholder="请选择子项目"
|
|
@click="clickPickSubProject(index, item)" />
|
|
@click="clickPickSubProject(index, item)" />
|
|
-
|
|
|
|
<van-popup v-model="item.showPickerSubProject" position="bottom">
|
|
<van-popup v-model="item.showPickerSubProject" position="bottom">
|
|
<van-picker show-toolbar :columns="item.subProjectList" value-key="name" @confirm="choseSubProject"
|
|
<van-picker show-toolbar :columns="item.subProjectList" value-key="name" @confirm="choseSubProject"
|
|
@cancel="item.showPickerSubProject = false;$forceUpdate();" />
|
|
@cancel="item.showPickerSubProject = false;$forceUpdate();" />
|
|
</van-popup>
|
|
</van-popup>
|
|
|
|
+ <van-field readonly name="extraField1" v-if="user.companyId == yuzhongCompId" clickable
|
|
|
|
+ :value="item.extraField1Name" label="角色选择" placeholder="请选择担任的角色"
|
|
|
|
+ @click="clickPickProjectRole(index, item)" />
|
|
|
|
+ <van-popup v-model="item.showPickerRole" position="bottom">
|
|
|
|
+ <van-picker show-toolbar :columns="roleList" value-key="label" @confirm="choseRole"
|
|
|
|
+ @cancel="item.showPickerRole = false;$forceUpdate();" />
|
|
|
|
+ </van-popup>
|
|
|
|
+
|
|
<!--任务分组 -->
|
|
<!--任务分组 -->
|
|
<van-field readonly name="groupId" v-if="user.company.packageProject == 1 && item.taskGroups != null && item.taskGroups.length > 0" clickable
|
|
<van-field readonly name="groupId" v-if="user.company.packageProject == 1 && item.taskGroups != null && item.taskGroups.length > 0" clickable
|
|
:value="item.groupName" label="任务分组" placeholder="请选择任务分组"
|
|
:value="item.groupName" label="任务分组" placeholder="请选择任务分组"
|
|
@@ -74,8 +79,24 @@
|
|
<van-picker show-toolbar :columns="item.taskGroups" value-key="name" @confirm="choseTaskGroup"
|
|
<van-picker show-toolbar :columns="item.taskGroups" value-key="name" @confirm="choseTaskGroup"
|
|
@cancel="item.showPickerTaskGroup = false;$forceUpdate();" />
|
|
@cancel="item.showPickerTaskGroup = false;$forceUpdate();" />
|
|
</van-popup>
|
|
</van-popup>
|
|
|
|
+ <!--工作职责-->
|
|
|
|
+ <van-field readonly name="extraField2" v-if="user.companyId == yuzhongCompId" clickable
|
|
|
|
+ :value="item.extraField2Name" label="工作职责" placeholder="请选择工作职责"
|
|
|
|
+ @click="clickPickRespon(index, item)" />
|
|
|
|
+ <van-popup v-model="item.showPickerRespon" position="bottom">
|
|
|
|
+ <van-picker show-toolbar :columns="item.filteredRespList" value-key="jobRespon" @confirm="onResponseChosen"
|
|
|
|
+ @cancel="item.showPickerRespon = false;$forceUpdate();" />
|
|
|
|
+ </van-popup>
|
|
|
|
+ <!--工作内容-->
|
|
|
|
+ <van-field readonly name="extraField3" v-if="user.companyId == yuzhongCompId" clickable
|
|
|
|
+ :value="item.extraField3Name" label="工作内容" placeholder="请选择工作内容"
|
|
|
|
+ @click="clickPickWorkContent(index, item)" />
|
|
|
|
+ <van-popup v-model="item.showPickerWorkContent" position="bottom">
|
|
|
|
+ <van-picker show-toolbar :columns="item.workContentList" value-key="workContext" @confirm="choseWorkContent"
|
|
|
|
+ @cancel="item.showPickerWorkContent = false;$forceUpdate();" />
|
|
|
|
+ </van-popup>
|
|
<!--任务阶段 -->
|
|
<!--任务阶段 -->
|
|
- <van-field readonly name="stage" v-if="user.company.packageProject==1&&item.stages != null && item.stages.length > 0" clickable
|
|
|
|
|
|
+ <van-field readonly name="stage" v-if="user.companyId != yuzhongCompId && user.company.packageProject==1&&item.stages != null && item.stages.length > 0" clickable
|
|
:value="item.stage" label="投入阶段" placeholder="请选择投入阶段"
|
|
:value="item.stage" label="投入阶段" placeholder="请选择投入阶段"
|
|
@click="clickPickStage(index, item)" />
|
|
@click="clickPickStage(index, item)" />
|
|
<van-popup v-model="item.showPickerStage" position="bottom">
|
|
<van-popup v-model="item.showPickerStage" position="bottom">
|
|
@@ -431,6 +452,9 @@ import timetoolVue from '../timetool/timetool.vue';
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
|
|
|
|
+ jobResponseList:[],
|
|
|
|
+ yuzhongCompId: 3385,
|
|
dailyIndex: 0,
|
|
dailyIndex: 0,
|
|
|
|
|
|
integrationProjectList: [],
|
|
integrationProjectList: [],
|
|
@@ -570,11 +594,95 @@ import timetoolVue from '../timetool/timetool.vue';
|
|
},
|
|
},
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
|
+
|
|
|
|
+ //选中角色
|
|
|
|
+ choseRole(value, index) {
|
|
|
|
+ if(value){
|
|
|
|
+ this.form.domains[this.clickIndex].extraField1 = value.value;
|
|
|
|
+ this.form.domains[this.clickIndex].extraField1Name = value.label;
|
|
|
|
+ }
|
|
|
|
+ this.form.domains[this.clickIndex].showPickerRole = false;
|
|
|
|
+ this.updateResponse(this.form.domains[this.clickIndex]);
|
|
|
|
+ this.$forceUpdate();
|
|
|
|
+ },
|
|
|
|
+ choseWorkContent(value, index) {
|
|
|
|
+ if(value){
|
|
|
|
+ this.form.domains[this.clickIndex].extraField3 = value.id;
|
|
|
|
+ this.form.domains[this.clickIndex].extraField3Name = value.workContext;
|
|
|
|
+ }
|
|
|
|
+ this.form.domains[this.clickIndex].showPickerWorkContent = false;
|
|
|
|
+ this.$forceUpdate();
|
|
|
|
+ },
|
|
|
|
+ onResponseChosen(value, index) {
|
|
|
|
+ if(value){
|
|
|
|
+ this.form.domains[this.clickIndex].extraField2 = value.id;
|
|
|
|
+ this.form.domains[this.clickIndex].extraField2Name = value.jobRespon;
|
|
|
|
+ this.form.domains[this.clickIndex].extraField3 = null;
|
|
|
|
+ this.form.domains[this.clickIndex].extraField3Name = null;
|
|
|
|
+ }
|
|
|
|
+ this.form.domains[this.clickIndex].showPickerRespon = false;
|
|
|
|
+ this.updateJobContent(this.form.domains[this.clickIndex]);
|
|
|
|
+ },
|
|
|
|
+ clickPickWorkContent(i, item) {
|
|
|
|
+ if (!item.canEdit) return;
|
|
|
|
+ this.clickIndex = i;
|
|
|
|
+ item.showPickerWorkContent = true;
|
|
|
|
+ this.$forceUpdate();
|
|
|
|
+ },
|
|
|
|
+ clickPickRespon(i, item) {
|
|
|
|
+ if (!item.canEdit) return;
|
|
|
|
+ this.clickIndex = i;
|
|
|
|
+ item.showPickerRespon = true;
|
|
|
|
+ this.$forceUpdate();
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ //更新工作内容列表
|
|
|
|
+ updateJobContent(domainItem) {
|
|
|
|
+ var that = this;
|
|
|
|
+ this.$axios.post('/project/getFunWorkContextList',{id:domainItem.extraField2})
|
|
|
|
+ .then(res => {
|
|
|
|
+ if(res.code == 'ok'){
|
|
|
|
+ that.$set(domainItem, 'extraField3', null);
|
|
|
|
+ that.$set(domainItem, 'workContentList', res.data);
|
|
|
|
+ }
|
|
|
|
+ }).catch(err => {})
|
|
|
|
+ },
|
|
|
|
+ updateResponse(domainItem) {
|
|
|
|
+ console.log(111);
|
|
|
|
+ var that = this;
|
|
|
|
+ var selectPid = domainItem.projectId;
|
|
|
|
+ domainItem.extraField2 = null;
|
|
|
|
+ domainItem.extraField3 = null;
|
|
|
|
+ domainItem.extraField2Name = null;
|
|
|
|
+ domainItem.extraField3Name = null;
|
|
|
|
+ if (selectPid && domainItem.extraField1) {
|
|
|
|
+ //是否非项目
|
|
|
|
+ var isPublic = this.projectss.filter(p=>p.id == selectPid)[0].isPublic;
|
|
|
|
+ console.log('==========','isPublic=='+isPublic);
|
|
|
|
+ var filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == (this.roleList.filter(r=>r.value==domainItem.extraField1)[0].label));
|
|
|
|
+ domainItem.filteredRespList = filteredRespList;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ getJobResponList() {
|
|
|
|
+ this.$axios.post('/project/getFunctionalDivisionList',{})
|
|
|
|
+ .then(res => {
|
|
|
|
+ if(res.code == 'ok'){
|
|
|
|
+ this.jobResponseList = res.data;
|
|
|
|
+ }
|
|
|
|
+ }).catch(err => {})
|
|
|
|
+ },
|
|
|
|
+
|
|
getRecentlyProject() {
|
|
getRecentlyProject() {
|
|
this.$axios.post('/project/nearProject',{})
|
|
this.$axios.post('/project/nearProject',{})
|
|
.then(res => {
|
|
.then(res => {
|
|
if(res.code == 'ok'){
|
|
if(res.code == 'ok'){
|
|
- this.integrationProjectList = res.data
|
|
|
|
|
|
+ this.integrationProjectList = res.data;
|
|
|
|
+ //去掉全部项目中没有的
|
|
|
|
+ this.setTimeout(()=>{
|
|
|
|
+ this.integrationProjectList = this.integrationProjectList.filter(near=>this.getProjectAuditorList.find(pItem=>pItem.id==near.id)!= null);
|
|
|
|
+ }, 1000);
|
|
|
|
+
|
|
}
|
|
}
|
|
}).catch(err => {this.$toast.clear();this.cardRefLoading = false;})
|
|
}).catch(err => {this.$toast.clear();this.cardRefLoading = false;})
|
|
},
|
|
},
|
|
@@ -820,6 +928,10 @@ import timetoolVue from '../timetool/timetool.vue';
|
|
that.selectDegreeId(item, index, that.form.domains[that.clickIndex])
|
|
that.selectDegreeId(item, index, that.form.domains[that.clickIndex])
|
|
}, 500)
|
|
}, 500)
|
|
}
|
|
}
|
|
|
|
+ //加载昱众的工作职责
|
|
|
|
+ if (this.user.companyId == this.yuzhongCompId) {
|
|
|
|
+ this.updateResponse(domainItem);
|
|
|
|
+ }
|
|
},
|
|
},
|
|
//获取项目下的任务分组
|
|
//获取项目下的任务分组
|
|
getTaskGroups(domainItem, index) {
|
|
getTaskGroups(domainItem, index) {
|
|
@@ -1335,6 +1447,19 @@ import timetoolVue from '../timetool/timetool.vue';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ var targetP = this.project.filter(p=>p.id == list[i].projectId);
|
|
|
|
+ var filteredRespList = [];
|
|
|
|
+ if (targetP.length > 0 && list[i].extraField1) {
|
|
|
|
+ list[i].extraField1Name = this.roleList.find(r=>r.value==list[i].extraField1).label;
|
|
|
|
+ var isPublic = targetP[0].isPublic;
|
|
|
|
+ filteredRespList = this.jobResponseList.filter(j=>j.timeType == (isPublic?'非项目工时':'项目工时') && j.role == this.roleList.filter(r=>r.value == list[i].extraField1)[0].label);
|
|
|
|
+ if (list[i].extraField2) {
|
|
|
|
+ list[i].extraField2Name = filteredRespList.find(f=>f.id = list[i].extraField2).jobRespon;
|
|
|
|
+ }
|
|
|
|
+ if (list[i].extraField3) {
|
|
|
|
+ list[i].extraField3Name = list[i].workContentList.find(w=>w.id = list[i].extraField3).workContext;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
array.push({
|
|
array.push({
|
|
id: list[i].id,
|
|
id: list[i].id,
|
|
projectId: list[i].projectId,
|
|
projectId: list[i].projectId,
|
|
@@ -1382,6 +1507,14 @@ import timetoolVue from '../timetool/timetool.vue';
|
|
auditorSec: list[i].auditorSec ? list[i].auditorSec : {name:'',id:''},
|
|
auditorSec: list[i].auditorSec ? list[i].auditorSec : {name:'',id:''},
|
|
auditorThird: list[i].auditorThird ? list[i].auditorThird : {name:'',id:''},
|
|
auditorThird: list[i].auditorThird ? list[i].auditorThird : {name:'',id:''},
|
|
ccUserid: list[i].ccUserid ? list[i].ccUserid : {name:'',id:''},
|
|
ccUserid: list[i].ccUserid ? list[i].ccUserid : {name:'',id:''},
|
|
|
|
+ extraField1: list[i].extraField1,
|
|
|
|
+ extraField1Name: list[i].extraField1Name,
|
|
|
|
+ extraField2: list[i].extraField2,
|
|
|
|
+ extraField2Name: list[i].extraField2Name,
|
|
|
|
+ extraField3: list[i].extraField3,
|
|
|
|
+ extraField3Name: list[i].extraField3Name,
|
|
|
|
+ workContentList: list[i].workContentList,
|
|
|
|
+ filteredRespList: filteredRespList
|
|
})
|
|
})
|
|
if (list[i].state >= 2) {
|
|
if (list[i].state >= 2) {
|
|
this.canEdit = true;
|
|
this.canEdit = true;
|
|
@@ -1476,6 +1609,14 @@ import timetoolVue from '../timetool/timetool.vue';
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ //点击选择角色
|
|
|
|
+ clickPickProjectRole(i, item) {
|
|
|
|
+ if (!item.canEdit) return;
|
|
|
|
+ this.clickIndex = i;
|
|
|
|
+ item.showPickerRole = true;
|
|
|
|
+ this.$forceUpdate();
|
|
|
|
+ },
|
|
|
|
+
|
|
//点击选择子项目
|
|
//点击选择子项目
|
|
clickPickSubProject(i, item) {
|
|
clickPickSubProject(i, item) {
|
|
if (!item.canEdit) return;
|
|
if (!item.canEdit) return;
|
|
@@ -1489,6 +1630,7 @@ import timetoolVue from '../timetool/timetool.vue';
|
|
item.showPickerCostId = true;
|
|
item.showPickerCostId = true;
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
},
|
|
},
|
|
|
|
+
|
|
clickPickTaskGroup(i, item) {
|
|
clickPickTaskGroup(i, item) {
|
|
if (!item.canEdit) return;
|
|
if (!item.canEdit) return;
|
|
this.clickIndex = i;
|
|
this.clickIndex = i;
|
|
@@ -1505,21 +1647,8 @@ import timetoolVue from '../timetool/timetool.vue';
|
|
// 选择项目
|
|
// 选择项目
|
|
clickPicker(i, item) {
|
|
clickPicker(i, item) {
|
|
if (!item.canEdit) return;
|
|
if (!item.canEdit) return;
|
|
- // this.clickIndex = i;
|
|
|
|
- // this.showPickerProject = true;
|
|
|
|
- // console.log(i, item, this.form)
|
|
|
|
this.clickIndex = i
|
|
this.clickIndex = i
|
|
this.showPickerUserddp = true
|
|
this.showPickerUserddp = true
|
|
- // console.log(item);
|
|
|
|
- // this.dimension()
|
|
|
|
- // this.$router.push({
|
|
|
|
- // path: '/search',
|
|
|
|
- // query: {
|
|
|
|
- // // from: JSON.stringify(this.form)
|
|
|
|
- // from: this.form,
|
|
|
|
- // idx: i
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
},
|
|
},
|
|
clickPickers(i,item) {
|
|
clickPickers(i,item) {
|
|
// console.log('wudulist',item.wuduList);
|
|
// console.log('wudulist',item.wuduList);
|
|
@@ -1568,6 +1697,8 @@ import timetoolVue from '../timetool/timetool.vue';
|
|
this.$forceUpdate();}
|
|
this.$forceUpdate();}
|
|
this.form.domains[this.clickIndex].showPickDegree = false;
|
|
this.form.domains[this.clickIndex].showPickDegree = false;
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
choseSubProject(value, index) {
|
|
choseSubProject(value, index) {
|
|
if(value){
|
|
if(value){
|
|
@@ -1838,6 +1969,25 @@ import timetoolVue from '../timetool/timetool.vue';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ //昱众需要检查新增的角色,工作职责,工作内容是否填写
|
|
|
|
+ if (this.user.companyId == this.yuzhongCompId) {
|
|
|
|
+ for(var p in this.form.domains) {
|
|
|
|
+ var oneProItem = this.form.domains[p]
|
|
|
|
+ if (!oneProItem.extraField1) {
|
|
|
|
+ this.$toast('角色必填,请检查')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (!oneProItem.extraField2) {
|
|
|
|
+ this.$toast('工作职责必填,请检查')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (!oneProItem.extraField3) {
|
|
|
|
+ this.$toast('工作内容必填,请检查')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
// return
|
|
// return
|
|
const toast = this.$toast.loading({
|
|
const toast = this.$toast.loading({
|
|
forbidClick: true,
|
|
forbidClick: true,
|
|
@@ -2105,6 +2255,11 @@ import timetoolVue from '../timetool/timetool.vue';
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+ if (this.user.companyId == this.yuzhongCompId) {
|
|
|
|
+ formData.append('extraField1', this.form.domains[i].extraField1);
|
|
|
|
+ formData.append('extraField2', this.form.domains[i].extraField2);
|
|
|
|
+ formData.append('extraField3', this.form.domains[i].extraField3);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if(!this.flgLg) {
|
|
if(!this.flgLg) {
|
|
return
|
|
return
|
|
@@ -2243,6 +2398,9 @@ import timetoolVue from '../timetool/timetool.vue';
|
|
if(this.user.timeType.lockWorktime){
|
|
if(this.user.timeType.lockWorktime){
|
|
this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
|
|
this.timeRange = this.timeRange.filter(item => {return item <= this.user.timeType.allday})
|
|
}
|
|
}
|
|
|
|
+ if (this.user.companyId == this.yuzhongCompId) {
|
|
|
|
+ this.getJobResponList();
|
|
|
|
+ }
|
|
|
|
|
|
// if(localStorage.getItem("formVal")) {
|
|
// if(localStorage.getItem("formVal")) {
|
|
// var obj = localStorage.getItem("formVal")
|
|
// var obj = localStorage.getItem("formVal")
|