|
@@ -48,24 +48,29 @@
|
|
</template>
|
|
</template>
|
|
</van-cell>
|
|
</van-cell>
|
|
|
|
|
|
-
|
|
|
|
<!-- 每一周的数据循环 -->
|
|
<!-- 每一周的数据循环 -->
|
|
<div v-if="inbtn != 999">
|
|
<div v-if="inbtn != 999">
|
|
<div class="form_domains" v-for="(item,index) in currentForm.domains" :key="item.id">
|
|
<div class="form_domains" v-for="(item,index) in currentForm.domains" :key="item.id">
|
|
<div style="float:right;margin-top:10px;margin-right:10px;">
|
|
<div style="float:right;margin-top:10px;margin-right:10px;">
|
|
|
|
|
|
- <van-tag v-if="index>0" color="#fff"
|
|
|
|
|
|
+ <van-tag v-if="index > 0 && item.state > 1" color="#fff"
|
|
@click="delPro(index)" style="border: 1px solid #ff0000;padding:5px;margin-left:10px;"
|
|
@click="delPro(index)" style="border: 1px solid #ff0000;padding:5px;margin-left:10px;"
|
|
icon="plus" type="default" ><span style="color:#666;padding: 0 5px;">删除</span></van-tag>
|
|
icon="plus" type="default" ><span style="color:#666;padding: 0 5px;">删除</span></van-tag>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
+ <!-- 当前的状态 -->
|
|
|
|
+ <div class="currentState" :style="`color: ${['#E6A23C', '#5CB87A'][item.state] || '#000'}`">
|
|
|
|
+ {{ ['待审核', '已通过'][item.state] || '' }}
|
|
|
|
+ </div>
|
|
|
|
+
|
|
<van-cell-group :title="(user.companyId==781?'任务':'项目') + (index+1)">
|
|
<van-cell-group :title="(user.companyId==781?'任务':'项目') + (index+1)">
|
|
|
|
+
|
|
<!-- <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)" :disabled="item.state<=1" />
|
|
<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="item.subProjectList != null && item.subProjectList.length > 0 && user.timeType.mainProjectState != 1" clickable
|
|
- :value="item.subProjectName" label="子项目" placeholder="请选择子项目"
|
|
|
|
|
|
+ :value="item.subProjectName" label="子项目" placeholder="请选择子项目" :disabled="item.state<=1"
|
|
@click="clickPickSubProject(index, item)" />
|
|
@click="clickPickSubProject(index, item)" />
|
|
|
|
|
|
<van-popup v-model="item.showPickerSubProject" position="bottom">
|
|
<van-popup v-model="item.showPickerSubProject" position="bottom">
|
|
@@ -75,14 +80,14 @@
|
|
<!--任务分组 -->
|
|
<!--任务分组 -->
|
|
<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="user.timeType.enableNewWeeklyfill == 1 ? '分组' : '任务分组'" :placeholder="user.timeType.enableNewWeeklyfill == 1 ? '请选择分组' : '请选择任务分组'"
|
|
:value="item.groupName" :label="user.timeType.enableNewWeeklyfill == 1 ? '分组' : '任务分组'" :placeholder="user.timeType.enableNewWeeklyfill == 1 ? '请选择分组' : '请选择任务分组'"
|
|
- @click="clickPickTaskGroup(index, item)" />
|
|
|
|
|
|
+ @click="clickPickTaskGroup(index, item)" :disabled="item.state<=1" />
|
|
<van-popup v-model="item.showPickerTaskGroup" position="bottom">
|
|
<van-popup v-model="item.showPickerTaskGroup" position="bottom">
|
|
<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="stage" v-if="user.company.packageProject==1&&item.stages != null && item.stages.length > 0 && user.timeType.enableNewWeeklyfill != 1" clickable
|
|
<van-field readonly name="stage" v-if="user.company.packageProject==1&&item.stages != null && item.stages.length > 0 && user.timeType.enableNewWeeklyfill != 1" clickable
|
|
- :value="item.stage" label="投入阶段" placeholder="请选择投入阶段"
|
|
|
|
|
|
+ :value="item.stage" label="投入阶段" placeholder="请选择投入阶段" :disabled="item.state<=1"
|
|
@click="clickPickStage(index, item)" />
|
|
@click="clickPickStage(index, item)" />
|
|
<van-popup v-model="item.showPickerStage" position="bottom">
|
|
<van-popup v-model="item.showPickerStage" position="bottom">
|
|
<van-picker show-toolbar :columns="item.stages" value-key="stagesName" @confirm="choseStage"
|
|
<van-picker show-toolbar :columns="item.stages" value-key="stagesName" @confirm="choseStage"
|
|
@@ -90,7 +95,7 @@
|
|
</van-popup>
|
|
</van-popup>
|
|
<!-- 预算来源 -->
|
|
<!-- 预算来源 -->
|
|
<van-field readonly name="basecostId" v-if="user.company.packageProject==1&&reportBasecostList &&reportBasecostList.length>0"
|
|
<van-field readonly name="basecostId" v-if="user.company.packageProject==1&&reportBasecostList &&reportBasecostList.length>0"
|
|
- :value="item.basecostName" label="预算来源" placeholder="请选择预算来源"
|
|
|
|
|
|
+ :value="item.basecostName" label="预算来源" placeholder="请选择预算来源" :disabled="item.state<=1"
|
|
@click="clickPickCostId(index, item)" />
|
|
@click="clickPickCostId(index, item)" />
|
|
<van-popup v-model="item.showPickerCostId" position="bottom">
|
|
<van-popup v-model="item.showPickerCostId" position="bottom">
|
|
<van-picker show-toolbar :columns="reportBasecostList" value-key="name" @confirm="choseCostId"
|
|
<van-picker show-toolbar :columns="reportBasecostList" value-key="name" @confirm="choseCostId"
|
|
@@ -99,7 +104,7 @@
|
|
<!-- 审核人 -->
|
|
<!-- 审核人 -->
|
|
<template v-if="user.timeType.reportAuditType != 3">
|
|
<template v-if="user.timeType.reportAuditType != 3">
|
|
<van-field readonly name="projectAuditorId" v-if="item.auditUserList != null && item.auditUserList.length > 0" clickable
|
|
<van-field readonly name="projectAuditorId" v-if="item.auditUserList != null && item.auditUserList.length > 0" clickable
|
|
- :value="item.projectAuditorName" :label="user.companyId==781?'审核人':'项目审核人'" placeholder="请选择审核人"
|
|
|
|
|
|
+ :value="item.projectAuditorName" :label="user.companyId==781?'审核人':'项目审核人'" placeholder="请选择审核人" :disabled="item.state<=1"
|
|
@click="clickPickAuditor(index, item)">
|
|
@click="clickPickAuditor(index, item)">
|
|
<template #input>
|
|
<template #input>
|
|
<span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.projectAuditorName'></ww-open-data></span>
|
|
<span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.projectAuditorName'></ww-open-data></span>
|
|
@@ -191,7 +196,7 @@
|
|
<!-- 全天上下午模式 -->
|
|
<!-- 全天上下午模式 -->
|
|
<div v-if="reportTimeType.multiWorktime==0">
|
|
<div v-if="reportTimeType.multiWorktime==0">
|
|
<van-field v-if="reportTimeType.type < 2" readonly clickable :value="reportTimeType.type==0?item.label:(parseFloat(item.workingTime).toFixed(1)+'h')" label="工作时长" placeholder="请选择工作时长(小时)"
|
|
<van-field v-if="reportTimeType.type < 2" readonly clickable :value="reportTimeType.type==0?item.label:(parseFloat(item.workingTime).toFixed(1)+'h')" label="工作时长" placeholder="请选择工作时长(小时)"
|
|
- @click="clickTimePicker(index, item)"
|
|
|
|
|
|
+ @click="clickTimePicker(index, item)" :disabled="item.state<=1"
|
|
:rules="[{ required: true, message: '请选择工作时长' }]"/>
|
|
:rules="[{ required: true, message: '请选择工作时长' }]"/>
|
|
<van-popup v-model="showPickerTime" position="bottom">
|
|
<van-popup v-model="showPickerTime" position="bottom">
|
|
<van-picker show-toolbar :columns="timeType" value-key="label" @confirm="choseTimePick" @cancel="showPickerTime = false" />
|
|
<van-picker show-toolbar :columns="timeType" value-key="label" @confirm="choseTimePick" @cancel="showPickerTime = false" />
|
|
@@ -206,7 +211,7 @@
|
|
|
|
|
|
<!-- 时间段选择模式 -->
|
|
<!-- 时间段选择模式 -->
|
|
<van-field readonly v-if="reportTimeType.type == 2" clickable name="datetimePicker" :value="item.startTime" label="开始时间" placeholder="点击选择时间"
|
|
<van-field readonly v-if="reportTimeType.type == 2" clickable name="datetimePicker" :value="item.startTime" label="开始时间" placeholder="点击选择时间"
|
|
- @click="showStartTime = true"
|
|
|
|
|
|
+ @click="timePickChange(item, 'showStartTime')" :disabled="item.state<=1"
|
|
:rules="[{ required: true, message: '请选择开始时间' }]"
|
|
:rules="[{ required: true, message: '请选择开始时间' }]"
|
|
/>
|
|
/>
|
|
<van-popup v-model="showStartTime" position="bottom">
|
|
<van-popup v-model="showStartTime" position="bottom">
|
|
@@ -221,7 +226,7 @@
|
|
<!-- :filter="filter" 原本这个属性在里面 -->
|
|
<!-- :filter="filter" 原本这个属性在里面 -->
|
|
</van-popup>
|
|
</van-popup>
|
|
<van-field v-if="reportTimeType.type == 2" readonly clickable name="datetimePicker" :value="item.endTime" label="结束时间" placeholder="点击选择时间"
|
|
<van-field v-if="reportTimeType.type == 2" readonly clickable name="datetimePicker" :value="item.endTime" label="结束时间" placeholder="点击选择时间"
|
|
- @click="showEndTime = true"
|
|
|
|
|
|
+ @click="timePickChange(item, 'showEndTime')" :disabled="item.state<=1"
|
|
:rules="[{ required: true, message: '请选择结束时间' }]" />
|
|
:rules="[{ required: true, message: '请选择结束时间' }]" />
|
|
<van-popup v-model="showEndTime" position="bottom" >
|
|
<van-popup v-model="showEndTime" position="bottom" >
|
|
<van-datetime-picker
|
|
<van-datetime-picker
|
|
@@ -238,7 +243,7 @@
|
|
<template >
|
|
<template >
|
|
<div>
|
|
<div>
|
|
<span>用时占比</span>
|
|
<span>用时占比</span>
|
|
- <van-slider :min="5" :step="5" style="width:120px;display:inline-block;margin-left:50px;" v-model="item.progress" :value="100" @change="item.workingTime = (reportTimeType.allday*item.progress/100).toFixed(1)" >
|
|
|
|
|
|
+ <van-slider :min="5" :step="5" style="width:120px;display:inline-block;margin-left:50px;" :disabled="item.state<=1" v-model="item.progress" :value="100" @change="item.workingTime = (reportTimeType.allday*item.progress/100).toFixed(1)" >
|
|
<template #button>
|
|
<template #button>
|
|
<div class="custom-button">{{ item.progress }}%</div>
|
|
<div class="custom-button">{{ item.progress }}%</div>
|
|
</template>
|
|
</template>
|
|
@@ -261,16 +266,16 @@
|
|
<!-- 时间段选择模式 -->
|
|
<!-- 时间段选择模式 -->
|
|
<van-field readonly v-if="reportTimeType.type == 2" :clickable="true" name="datetimePicker"
|
|
<van-field readonly v-if="reportTimeType.type == 2" :clickable="true" name="datetimePicker"
|
|
:value="timeItem.startTime" label="开始时间" placeholder="点击选择时间"
|
|
:value="timeItem.startTime" label="开始时间" placeholder="点击选择时间"
|
|
- :rules="[{ required: true, message: '必填项' }]"
|
|
|
|
|
|
+ :rules="[{ required: true, message: '必填项' }]" :disabled="item.state<=1"
|
|
@click="showStartDialog(timeItem)" />
|
|
@click="showStartDialog(timeItem)" />
|
|
|
|
|
|
<van-field v-if="reportTimeType.type == 2" readonly :clickable="true" name="datetimePicker"
|
|
<van-field v-if="reportTimeType.type == 2" readonly :clickable="true" name="datetimePicker"
|
|
:value="timeItem.endTime" label="结束时间" placeholder="点击选择时间"
|
|
:value="timeItem.endTime" label="结束时间" placeholder="点击选择时间"
|
|
- :rules="[{ required: true, message: '必填项' }]"
|
|
|
|
|
|
+ :rules="[{ required: true, message: '必填项' }]" :disabled="item.state<=1"
|
|
@click="showEndDialog(timeItem)" />
|
|
@click="showEndDialog(timeItem)" />
|
|
|
|
|
|
<van-field class="form_input" style="color:#333;-webkit-text-fill-color:#646566;"
|
|
<van-field class="form_input" style="color:#333;-webkit-text-fill-color:#646566;"
|
|
-
|
|
|
|
|
|
+ :disabled="item.state<=1"
|
|
v-model="timeItem.content" name="content" type="textarea" label="工作事项" placeholder="请输入工作事项"
|
|
v-model="timeItem.content" name="content" type="textarea" label="工作事项" placeholder="请输入工作事项"
|
|
:rules="user.timeType.workContentState == 1 ? [{ required: true, message: '请填写工作事项' }] : null"
|
|
:rules="user.timeType.workContentState == 1 ? [{ required: true, message: '请填写工作事项' }] : null"
|
|
rows="1" autosize />
|
|
rows="1" autosize />
|
|
@@ -308,8 +313,8 @@
|
|
|
|
|
|
<div class="overtime" v-if="((user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)) || (isCorpWX&&canEdit)) && user.timeType.enableNewWeeklyfill != 1">
|
|
<div class="overtime" v-if="((user.timeType.fillOvertime || (isWeekend && user.timeType.lockWorktime != 1)) || (isCorpWX&&canEdit)) && user.timeType.enableNewWeeklyfill != 1">
|
|
<div class="overTimeClas">
|
|
<div class="overTimeClas">
|
|
- <van-checkbox v-model="item.isOvertime" style="width: 4.3rem;">加班</van-checkbox>
|
|
|
|
- <van-field v-model="item.overtimeHours" type="number" :disabled="item.isOvertime==null||item.isOvertime==0"
|
|
|
|
|
|
+ <van-checkbox v-model="item.isOvertime" :disabled="item.state<=1" style="width: 4.3rem;">加班</van-checkbox>
|
|
|
|
+ <van-field v-model="item.overtimeHours" type="number" :disabled="item.isOvertime==null || item.isOvertime==0 || item.state<=1"
|
|
placeholder="请输入加班时长" style="width: 5rem"></van-field>
|
|
placeholder="请输入加班时长" style="width: 5rem"></van-field>
|
|
<span :class="'overListTime'">小时</span>
|
|
<span :class="'overListTime'">小时</span>
|
|
</div>
|
|
</div>
|
|
@@ -366,8 +371,16 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="form_btn" style="position:fixed; bottom:0px;width:100%;">
|
|
<div class="form_btn" style="position:fixed; bottom:0px;width:100%;">
|
|
- <div style="padding-bottom:10px;">
|
|
|
|
- <van-button square block type="info" @click="submitReport" native-type="submit" style="width:100%;float:left;">
|
|
|
|
|
|
+ <div style="padding-bottom:10px;" v-if="temporaryStorage">
|
|
|
|
+ <van-button square block type="default" @click="submitReport(1)" native-type="submit" style="width:50%;float:left;">
|
|
|
|
+ <div>暂存</div>
|
|
|
|
+ </van-button>
|
|
|
|
+ <van-button square block type="info" @click="submitReport(0)" native-type="submit" style="width:50%;float:right;">
|
|
|
|
+ <div>提交</div>
|
|
|
|
+ </van-button>
|
|
|
|
+ </div>
|
|
|
|
+ <div style="padding-bottom:10px;" v-if="!temporaryStorage">
|
|
|
|
+ <van-button square block type="info" @click="submitReport(0)" native-type="submit" style="width:100%;float:right;">
|
|
<div>提交</div>
|
|
<div>提交</div>
|
|
</van-button>
|
|
</van-button>
|
|
</div>
|
|
</div>
|
|
@@ -516,9 +529,18 @@
|
|
},
|
|
},
|
|
integrationProjectList: [],
|
|
integrationProjectList: [],
|
|
summary: '', // 周总结
|
|
summary: '', // 周总结
|
|
|
|
+
|
|
|
|
+ temporaryStorage: false, // 是否开启暂存
|
|
};
|
|
};
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 时间选择
|
|
|
|
+ timePickChange(item, filed) {
|
|
|
|
+ if(item.state <= 1) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this[filed] = true
|
|
|
|
+ },
|
|
// 获取地址上的参数
|
|
// 获取地址上的参数
|
|
getUrlKey(name) {
|
|
getUrlKey(name) {
|
|
return (
|
|
return (
|
|
@@ -612,7 +634,7 @@
|
|
},
|
|
},
|
|
// 切换星期
|
|
// 切换星期
|
|
switchWeek(item,index){
|
|
switchWeek(item,index){
|
|
- console.log(this.inbtn)
|
|
|
|
|
|
+ console.log(this.inbtn, this.form)
|
|
if(this.inbtn == 999) {
|
|
if(this.inbtn == 999) {
|
|
this.inbtn = index
|
|
this.inbtn = index
|
|
return
|
|
return
|
|
@@ -626,6 +648,8 @@
|
|
}
|
|
}
|
|
this.getKaoqin()
|
|
this.getKaoqin()
|
|
this.getWorkTime()
|
|
this.getWorkTime()
|
|
|
|
+
|
|
|
|
+ this.getEachArray(this.currentForm)
|
|
},
|
|
},
|
|
// 切换按周
|
|
// 切换按周
|
|
switchWeekly(index) {
|
|
switchWeekly(index) {
|
|
@@ -948,20 +972,27 @@
|
|
this.projectss = this.proads
|
|
this.projectss = this.proads
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- fZr(item,index) {
|
|
|
|
|
|
+ fZr(item, index, flag = false, newProIdx) {
|
|
|
|
+ console.log(flag, '《=== 回显')
|
|
|
|
+ if(flag) { // flag 为 true 时,表示回显数据
|
|
|
|
+ this.proIdx = newProIdx
|
|
|
|
+ }
|
|
|
|
+
|
|
var domainItem = this.currentForm.domains[this.proIdx];
|
|
var domainItem = this.currentForm.domains[this.proIdx];
|
|
- domainItem.projectId = item.id;
|
|
|
|
- domainItem.projectName = item.projectName;
|
|
|
|
-
|
|
|
|
- //清空子项目
|
|
|
|
- domainItem.subProjectId = null;
|
|
|
|
- domainItem.subProjectName = null;
|
|
|
|
- //清空任务
|
|
|
|
- domainItem.taskId = null;
|
|
|
|
- domainItem.taskName = null;
|
|
|
|
- //清空分组和阶段
|
|
|
|
- domainItem.stage = null;
|
|
|
|
- domainItem.groupId = null;
|
|
|
|
|
|
+
|
|
|
|
+ if(!flag) { // 选择项目时清空,回显数据不做操作
|
|
|
|
+ domainItem.projectId = item.id;
|
|
|
|
+ domainItem.projectName = item.projectName;
|
|
|
|
+ //清空子项目
|
|
|
|
+ domainItem.subProjectId = null;
|
|
|
|
+ domainItem.subProjectName = null;
|
|
|
|
+ //清空任务
|
|
|
|
+ domainItem.taskId = null;
|
|
|
|
+ domainItem.taskName = null;
|
|
|
|
+ //清空分组和阶段
|
|
|
|
+ domainItem.stage = null;
|
|
|
|
+ domainItem.groupId = null;
|
|
|
|
+ }
|
|
|
|
|
|
this.showPickerUserddp = false;
|
|
this.showPickerUserddp = false;
|
|
//获取子项目
|
|
//获取子项目
|
|
@@ -1007,6 +1038,10 @@
|
|
.then(res => {
|
|
.then(res => {
|
|
if(res.code == "ok") {
|
|
if(res.code == "ok") {
|
|
domainItem.subProjectList = res.data;
|
|
domainItem.subProjectList = res.data;
|
|
|
|
+ const { subProjectId, subProjectName } = domainItem
|
|
|
|
+ if(subProjectId && !subProjectName) {
|
|
|
|
+ domainItem.subProjectName = res.data.filter(item => item.id == subProjectId)[0].name
|
|
|
|
+ }
|
|
}
|
|
}
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
}).catch(err=> {this.$toast.clear();});
|
|
}).catch(err=> {this.$toast.clear();});
|
|
@@ -1503,6 +1538,9 @@
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
},
|
|
},
|
|
clickPickTaskGroup(i, item) {
|
|
clickPickTaskGroup(i, item) {
|
|
|
|
+ if(item.state <= 1) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
this.clickIndex = i;
|
|
this.clickIndex = i;
|
|
item.showPickerTaskGroup = true;
|
|
item.showPickerTaskGroup = true;
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
@@ -1578,16 +1616,22 @@
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
},
|
|
},
|
|
|
|
|
|
- choseTaskGroup(value, index) {
|
|
|
|
|
|
+ choseTaskGroup(value, index, flag = false, newClickIndex) {
|
|
if(!value){
|
|
if(!value){
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if(flag) {
|
|
|
|
+ this.clickIndex = newClickIndex
|
|
|
|
+ }
|
|
|
|
+
|
|
this.currentForm.domains[this.clickIndex].groupId = value.id;
|
|
this.currentForm.domains[this.clickIndex].groupId = value.id;
|
|
this.currentForm.domains[this.clickIndex].groupName = value.name;
|
|
this.currentForm.domains[this.clickIndex].groupName = value.name;
|
|
this.currentForm.domains[this.clickIndex].showPickerTaskGroup = false;
|
|
this.currentForm.domains[this.clickIndex].showPickerTaskGroup = false;
|
|
|
|
+
|
|
var domainItem = this.currentForm.domains[this.clickIndex];
|
|
var domainItem = this.currentForm.domains[this.clickIndex];
|
|
|
|
|
|
- this.getGroupStages(this.currentForm.domains[this.clickIndex], index);
|
|
|
|
|
|
+ this.getGroupStages(this.currentForm.domains[this.clickIndex], index, flag);
|
|
|
|
|
|
//检查当前的项目是否需要获取分组的负责人
|
|
//检查当前的项目是否需要获取分组的负责人
|
|
var curProject = this.project.filter(p=>p.id == this.currentForm.domains[this.clickIndex].projectId)[0];
|
|
var curProject = this.project.filter(p=>p.id == this.currentForm.domains[this.clickIndex].projectId)[0];
|
|
@@ -1616,11 +1660,13 @@
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
- getGroupStages(domain, index) {
|
|
|
|
|
|
+ getGroupStages(domain, index, flag = false) {
|
|
this.$axios.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId})
|
|
this.$axios.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId})
|
|
.then(res => {
|
|
.then(res => {
|
|
if(res.code == "ok") {
|
|
if(res.code == "ok") {
|
|
- domain.stage = '';
|
|
|
|
|
|
+ if(!flag) {
|
|
|
|
+ domain.stage = '';
|
|
|
|
+ }
|
|
domain.stages = res.data;
|
|
domain.stages = res.data;
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
} else {
|
|
} else {
|
|
@@ -1760,10 +1806,13 @@
|
|
},
|
|
},
|
|
|
|
|
|
// 提交日报
|
|
// 提交日报
|
|
- submitReport() {
|
|
|
|
|
|
+ submitReport(isDraft) {
|
|
if(this.inbtn != 999) {
|
|
if(this.inbtn != 999) {
|
|
this.form[this.inbtn] = this.currentForm
|
|
this.form[this.inbtn] = this.currentForm
|
|
}
|
|
}
|
|
|
|
+ console.log(this.form)
|
|
|
|
+ console.log(this.currentForm)
|
|
|
|
+ // return
|
|
const { allday, workContentState, enableNewWeeklyfill, reportAuditType } = this.user.timeType // 系统设置的每日工作时间
|
|
const { allday, workContentState, enableNewWeeklyfill, reportAuditType } = this.user.timeType // 系统设置的每日工作时间
|
|
// 针对物奇做的判断
|
|
// 针对物奇做的判断
|
|
if(this.user.timeType.enableNewWeeklyfill == 1){
|
|
if(this.user.timeType.enableNewWeeklyfill == 1){
|
|
@@ -1944,7 +1993,8 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- formData.append("draft", this.isDraft);
|
|
|
|
|
|
+ // formData.append("draft", this.isDraft);
|
|
|
|
+ formData.append("draft", isDraft);
|
|
//填字段
|
|
//填字段
|
|
for(var i in this.form[formIndex].domains) {
|
|
for(var i in this.form[formIndex].domains) {
|
|
//没有选择项目的,跳过
|
|
//没有选择项目的,跳过
|
|
@@ -2432,9 +2482,101 @@
|
|
const day = newDate.getDate();
|
|
const day = newDate.getDate();
|
|
return `${year}/${month < 10 ? '0' + month : month}/${day < 10 ? '0' + day : day}`;
|
|
return `${year}/${month < 10 ? '0' + month : month}/${day < 10 ? '0' + day : day}`;
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+ // 获取按周填报的数据
|
|
|
|
+ async getWeeklyReportData() {
|
|
|
|
+ if(!this.temporaryStorage) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ const { data } = await this.$axios.post("/report/getWeeklyReportData", { targetDate: this.dateText[0] })
|
|
|
|
+ const { dateList } = data
|
|
|
|
+ this.form = this.handleWeeklyReportData(dateList)
|
|
|
|
+ this.currentForm = this.form[this.inbtn]
|
|
|
|
+ this.getEachArray(this.currentForm)
|
|
|
|
+ },
|
|
|
|
+ // 处理按周填报回显数据
|
|
|
|
+ handleWeeklyReportData(array) {
|
|
|
|
+ console.log(array, 'array')
|
|
|
|
+
|
|
|
|
+ let objectItem = {
|
|
|
|
+ auditorFirst: {id: '', name: ''},
|
|
|
|
+ auditorSec: {id: '', name: ''},
|
|
|
|
+ auditorThird: {id: '', name: ''},
|
|
|
|
+ ccUserid: {id: '', name: ''},
|
|
|
|
+ content: '',
|
|
|
|
+ degreeId: '',
|
|
|
|
+ id: null,
|
|
|
|
+ multiWorktime: 0,
|
|
|
|
+ progress: 100,
|
|
|
|
+ projectId: '',
|
|
|
|
+ projectName: '',
|
|
|
|
+ state: 2,
|
|
|
|
+ workingTime: 8,
|
|
|
|
+ worktimeList: []
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ let dataList = []
|
|
|
|
+ for(var i in array) {
|
|
|
|
+ const arrayItem = array[i]
|
|
|
|
+ let assignoBject = {
|
|
|
|
+ createDate: arrayItem.date
|
|
|
|
+ }
|
|
|
|
+ if(arrayItem.reportList.length > 0) {
|
|
|
|
+ let list = []
|
|
|
|
+ for(var j in arrayItem.reportList) {
|
|
|
|
+ const {
|
|
|
|
+ id,
|
|
|
|
+ endTime, startTime, content, groupId, groupName,
|
|
|
|
+ projectAuditorId, projectAuditorName, projectId,
|
|
|
|
+ projectName, state, taskId, taskName, overtimeHours,
|
|
|
|
+ stage, taskGroups, isOvertime, workingTime, subProjectId, progress
|
|
|
|
+ } = arrayItem.reportList[j]
|
|
|
|
+
|
|
|
|
+ let newObj = {
|
|
|
|
+ ...objectItem, id,
|
|
|
|
+ endTime, startTime, content, groupId, groupName,
|
|
|
|
+ projectAuditorId, projectAuditorName, projectId,
|
|
|
|
+ projectName, state, taskId, taskName, overtimeHours,
|
|
|
|
+ stage, taskGroups, workingTime, subProjectId, progress,
|
|
|
|
+ isOvertime: isOvertime == 1 ? true : false
|
|
|
|
+ }
|
|
|
|
+ list.push(newObj)
|
|
|
|
+ }
|
|
|
|
+ assignoBject.domains = JSON.parse(JSON.stringify(list))
|
|
|
|
+ } else {
|
|
|
|
+ assignoBject.domains = [JSON.parse(JSON.stringify(objectItem))]
|
|
|
|
+ }
|
|
|
|
+ dataList.push(assignoBject)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return dataList
|
|
|
|
+ },
|
|
|
|
+ // 获取回显数据的的各个数组(任务分组,阶段等)
|
|
|
|
+ getEachArray(arrItem) {
|
|
|
|
+ if(!this.temporaryStorage) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ console.log(arrItem, '<=== 处理的数据')
|
|
|
|
+ let newArrItem = JSON.parse(JSON.stringify(arrItem))
|
|
|
|
+ const { domains } = newArrItem
|
|
|
|
+ for(let i in domains) {
|
|
|
|
+ const { projectId, projectName, stage, groupId, groupName } = domains[i]
|
|
|
|
+ if(projectId) {
|
|
|
|
+ this.fZr({ projectId, projectName }, 0, true, i)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(groupId) {
|
|
|
|
+ this.choseTaskGroup({ id: groupId, name: groupName }, 0, true, i)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
mounted() {
|
|
mounted() {
|
|
|
|
+ const { companyId } = this.user
|
|
|
|
+ this.temporaryStorage = [4374, 10].includes(companyId)
|
|
|
|
+ console.log(this.temporaryStorage, '暂存权限', companyId)
|
|
|
|
+
|
|
this.getUrlKey('date')
|
|
this.getUrlKey('date')
|
|
const { enableNewWeeklyfill } = this.user.timeType // 针对物奇
|
|
const { enableNewWeeklyfill } = this.user.timeType // 针对物奇
|
|
// if(enableNewWeeklyfill == 1) {
|
|
// if(enableNewWeeklyfill == 1) {
|
|
@@ -2478,6 +2620,9 @@
|
|
// this.form = JSON.parse(obj)
|
|
// this.form = JSON.parse(obj)
|
|
// localStorage.removeItem('formVal')
|
|
// localStorage.removeItem('formVal')
|
|
// }
|
|
// }
|
|
|
|
+
|
|
|
|
+ // 获取按周填报的数据
|
|
|
|
+ this.getWeeklyReportData()
|
|
},
|
|
},
|
|
beforeDestroy() {
|
|
beforeDestroy() {
|
|
// localStorage.removeItem('formVal')
|
|
// localStorage.removeItem('formVal')
|
|
@@ -2486,6 +2631,11 @@
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="less" scope>
|
|
<style lang="less" scope>
|
|
|
|
+.currentState {
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: 15px;
|
|
|
|
+ left: 112px;
|
|
|
|
+}
|
|
.my-swipe .van-swipe-item {
|
|
.my-swipe .van-swipe-item {
|
|
color: #fff;
|
|
color: #fff;
|
|
font-size: 20px;
|
|
font-size: 20px;
|