浏览代码

完善填写日报的禁用

Lijy 1 年之前
父节点
当前提交
477b675985
共有 1 个文件被更改,包括 17 次插入17 次删除
  1. 17 17
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue

+ 17 - 17
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue

@@ -71,7 +71,7 @@
                 <!-- <van-icon v-if="index>0&&canEdit" class="form_del" name="delete" @click="delPro(index)" /> -->
                 <!-- <van-icon v-if="index>0&&canEdit" class="form_del" name="delete" @click="delPro(index)" /> -->
                 <van-cell-group :title="(user.companyId == 781 ? '任务' : '项目') + (index + 1)">
                 <van-cell-group :title="(user.companyId == 781 ? '任务' : '项目') + (index + 1)">
                     <van-field readonly name="userReportDeptName" v-if="user.timeType.userWithMultiDept == 1 && userReportDeptList.length > 0"
                     <van-field readonly name="userReportDeptName" v-if="user.timeType.userWithMultiDept == 1 && userReportDeptList.length > 0"
-                        :value="item.userReportDeptName" :label="'填报部门'" placeholder="请选择部门" @click="selectDeptPopup(index, item)">
+                        :value="item.userReportDeptName" :label="'填报部门'" placeholder="请选择部门" :disabled="!item.canEdit" @click="selectDeptPopup(index, item)">
                         <template #input>
                         <template #input>
                             <TranslationOpenDataText type='departmentName' :openid='item.userReportDeptName'></TranslationOpenDataText>
                             <TranslationOpenDataText type='departmentName' :openid='item.userReportDeptName'></TranslationOpenDataText>
                         </template>
                         </template>
@@ -79,11 +79,11 @@
 
 
                     <!-- <div>请选择投入项目</div> -->
                     <!-- <div>请选择投入项目</div> -->
                     <van-field readonly name="projectId" clickable :value="item.projectName"
                     <van-field readonly name="projectId" clickable :value="item.projectName"
-                        :label="user.companyId == 781 ? '工作任务' : '投入项目'"
+                        :label="user.companyId == 781 ? '工作任务' : '投入项目'" :disabled="!item.canEdit"
                         :placeholder="user.companyId == 781 ? '请选择工作任务' : '请选择项目'" @click="clickPicker(index, item)"
                         :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"
+                    <van-field readonly name="subProjectId" :disabled="!item.canEdit"
                         v-if="user.companyId != yuzhongCompId && item.subProjectList != null && item.subProjectList.length > 0 && user.timeType.mainProjectState != 1"
                         v-if="user.companyId != yuzhongCompId && item.subProjectList != null && item.subProjectList.length > 0 && user.timeType.mainProjectState != 1"
                         clickable :value="item.subProjectName" label="子项目" placeholder="请选择子项目"
                         clickable :value="item.subProjectName" label="子项目" placeholder="请选择子项目"
                         @click="clickPickSubProject(index, item)" />
                         @click="clickPickSubProject(index, item)" />
@@ -92,7 +92,7 @@
                             @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
                     <van-field readonly name="extraField1" v-if="user.companyId == yuzhongCompId" clickable
-                        :value="item.extraField1Name" label="角色选择" placeholder="请选择担任的角色"
+                        :value="item.extraField1Name" label="角色选择" placeholder="请选择担任的角色" :disabled="!item.canEdit"
                         @click="clickPickProjectRole(index, item)" />
                         @click="clickPickProjectRole(index, item)" />
                     <van-popup v-model="item.showPickerRole" position="bottom">
                     <van-popup v-model="item.showPickerRole" position="bottom">
                         <van-picker show-toolbar :columns="roleList" value-key="label" @confirm="choseRole"
                         <van-picker show-toolbar :columns="roleList" value-key="label" @confirm="choseRole"
@@ -100,7 +100,7 @@
                     </van-popup>
                     </van-popup>
 
 
                     <!--任务分组 -->
                     <!--任务分组 -->
-                    <van-field readonly name="groupId"
+                    <van-field readonly name="groupId" :disabled="!item.canEdit"
                         v-if="user.company.packageProject == 1 && item.taskGroups != null && item.taskGroups.length > 0 && (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&& (item.projectId && projectss.filter(p => p.id == item.projectId)[0].isPublic!=1)))"
                         v-if="user.company.packageProject == 1 && item.taskGroups != null && item.taskGroups.length > 0 && (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&& (item.projectId && projectss.filter(p => p.id == item.projectId)[0].isPublic!=1)))"
                         clickable :rules="[{ required: user.companyId == 3092 ? true : false, message: '请选择任务分组' }]"
                         clickable :rules="[{ required: user.companyId == 3092 ? true : false, message: '请选择任务分组' }]"
                         :value="item.groupName" label="任务分组" placeholder="请选择任务分组"
                         :value="item.groupName" label="任务分组" placeholder="请选择任务分组"
@@ -120,7 +120,7 @@
 
 
                     <!--工作职责-->
                     <!--工作职责-->
                     <van-field readonly name="extraField2" v-if="user.companyId == yuzhongCompId" clickable
                     <van-field readonly name="extraField2" v-if="user.companyId == yuzhongCompId" clickable
-                        :value="item.extraField2Name" label="工作职责" placeholder="请选择工作职责"
+                        :value="item.extraField2Name" label="工作职责" placeholder="请选择工作职责" :disabled="!item.canEdit"
                         @click="clickPickRespon(index, item)" />
                         @click="clickPickRespon(index, item)" />
                     <van-popup v-model="item.showPickerRespon" position="bottom">
                     <van-popup v-model="item.showPickerRespon" position="bottom">
                         <van-picker show-toolbar :columns="item.filteredRespList" value-key="jobRespon"
                         <van-picker show-toolbar :columns="item.filteredRespList" value-key="jobRespon"
@@ -128,14 +128,14 @@
                     </van-popup>
                     </van-popup>
                     <!--工作内容-->
                     <!--工作内容-->
                     <van-field readonly name="extraField3" v-if="user.companyId == yuzhongCompId" clickable
                     <van-field readonly name="extraField3" v-if="user.companyId == yuzhongCompId" clickable
-                        :value="item.extraField3Name" label="工作内容" placeholder="请选择工作内容"
+                        :value="item.extraField3Name" label="工作内容" placeholder="请选择工作内容" :disabled="!item.canEdit"
                         @click="clickPickWorkContent(index, item)" />
                         @click="clickPickWorkContent(index, item)" />
                     <van-popup v-model="item.showPickerWorkContent" position="bottom">
                     <van-popup v-model="item.showPickerWorkContent" position="bottom">
                         <van-picker show-toolbar :columns="item.workContentList" value-key="workContext"
                         <van-picker show-toolbar :columns="item.workContentList" value-key="workContext"
                             @confirm="choseWorkContent" @cancel="item.showPickerWorkContent = false; $forceUpdate();" />
                             @confirm="choseWorkContent" @cancel="item.showPickerWorkContent = false; $forceUpdate();" />
                     </van-popup>
                     </van-popup>
                     <!--任务阶段 -->
                     <!--任务阶段 -->
-                    <van-field readonly name="stage"
+                    <van-field readonly name="stage" :disabled="!item.canEdit"
                         v-if="user.companyId != yuzhongCompId && user.company.packageProject == 1 && !user.timeType.hideStages && item.stages != null && item.stages.length > 0"
                         v-if="user.companyId != yuzhongCompId && user.company.packageProject == 1 && !user.timeType.hideStages && item.stages != null && item.stages.length > 0"
                         clickable :value="item.stage" label="投入阶段" placeholder="请选择投入阶段"
                         clickable :value="item.stage" label="投入阶段" placeholder="请选择投入阶段"
                         @click="clickPickStage(index, item)" />
                         @click="clickPickStage(index, item)" />
@@ -144,7 +144,7 @@
                             @cancel="item.showPickerStage = false; $forceUpdate();" />
                             @cancel="item.showPickerStage = false; $forceUpdate();" />
                     </van-popup>
                     </van-popup>
                     <!-- 预算来源 -->
                     <!-- 预算来源 -->
-                    <van-field readonly name="basecostId"
+                    <van-field readonly name="basecostId" :disabled="!item.canEdit"
                         v-if="user.company.packageProject == 1 && reportBasecostList && reportBasecostList.length > 0"
                         v-if="user.company.packageProject == 1 && reportBasecostList && reportBasecostList.length > 0"
                         :value="item.basecostName" label="预算来源" placeholder="请选择预算来源"
                         :value="item.basecostName" label="预算来源" placeholder="请选择预算来源"
                         @click="clickPickCostId(index, item)" />
                         @click="clickPickCostId(index, item)" />
@@ -154,7 +154,7 @@
                     </van-popup>
                     </van-popup>
                     <!-- 审核人 -->
                     <!-- 审核人 -->
                     <template v-if="user.timeType.reportAuditType != 3">
                     <template v-if="user.timeType.reportAuditType != 3">
-                        <van-field readonly name="projectAuditorId"
+                        <van-field readonly name="projectAuditorId" :disabled="!item.canEdit"
                             v-if="item.auditUserList != null && item.auditUserList.length > 0" clickable
                             v-if="item.auditUserList != null && item.auditUserList.length > 0" clickable
                             :value="item.projectAuditorName" :label="user.companyId == 781 ? '审核人' : '项目审核人'"
                             :value="item.projectAuditorName" :label="user.companyId == 781 ? '审核人' : '项目审核人'"
                             placeholder="请选择审核人" @click="clickPickAuditor(index, item)">
                             placeholder="请选择审核人" @click="clickPickAuditor(index, item)">
@@ -178,7 +178,7 @@
 
 
                     <!-- 自选审批人 -->
                     <!-- 自选审批人 -->
                     <template v-if="user.timeType.reportAuditType == 3">
                     <template v-if="user.timeType.reportAuditType == 3">
-                        <van-field readonly clickable label="第一审核人" @click="auditorClick(index, 'auditorFirst')">
+                        <van-field readonly clickable label="第一审核人" :disabled="!item.canEdit" @click="auditorClick(index, 'auditorFirst')">
                             <template #input>
                             <template #input>
                                 <span v-if="!item.auditorFirst"></span>
                                 <span v-if="!item.auditorFirst"></span>
                                 <span v-else-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName'
                                 <span v-else-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName'
@@ -186,7 +186,7 @@
                                 <span v-else>{{ item.auditorFirst.name }}</span>
                                 <span v-else>{{ item.auditorFirst.name }}</span>
                             </template>
                             </template>
                         </van-field>
                         </van-field>
-                        <van-field readonly clickable label="第二审核人" @click="auditorClick(index, 'auditorSec')"
+                        <van-field readonly clickable label="第二审核人" :disabled="!item.canEdit" @click="auditorClick(index, 'auditorSec')"
                             v-if="user.timeType.auditLevel > 1">
                             v-if="user.timeType.auditLevel > 1">
                             <template #input>
                             <template #input>
                                 <span v-if="!item.auditorSec"></span>
                                 <span v-if="!item.auditorSec"></span>
@@ -195,7 +195,7 @@
                                 <span v-else>{{ item.auditorSec.name }}</span>
                                 <span v-else>{{ item.auditorSec.name }}</span>
                             </template>
                             </template>
                         </van-field>
                         </van-field>
-                        <van-field readonly clickable label="第三审核人" @click="auditorClick(index, 'auditorThird')"
+                        <van-field readonly clickable label="第三审核人" :disabled="!item.canEdit" @click="auditorClick(index, 'auditorThird')"
                             v-if="user.timeType.auditLevel > 2">
                             v-if="user.timeType.auditLevel > 2">
                             <template #input>
                             <template #input>
                                 <span v-if="!item.auditorThird"></span>
                                 <span v-if="!item.auditorThird"></span>
@@ -235,7 +235,7 @@
                     <!-- 相关维度 -->
                     <!-- 相关维度 -->
                     <van-field :value="item.weiduName" v-if="item.projectId && user.timeType.customDegreeActive == 1"
                     <van-field :value="item.weiduName" v-if="item.projectId && user.timeType.customDegreeActive == 1"
                         readonly name="id" clickable :label="user.timeType.customDegreeName" placeholder="请选择"
                         readonly name="id" clickable :label="user.timeType.customDegreeName" placeholder="请选择"
-                        @click="clickPickers(index, item)" />
+                        @click="clickPickers(index, item)" :disabled="!item.canEdit" />
 
 
                     <!-- <van-popup v-model="item.showPickDegree" position="bottom">
                     <!-- <van-popup v-model="item.showPickDegree" position="bottom">
                         <van-picker show-toolbar :columns="item.wuduList" value-key="name" @confirm="choseProjects"
                         <van-picker show-toolbar :columns="item.wuduList" value-key="name" @confirm="choseProjects"
@@ -284,7 +284,7 @@
                         </template>
                         </template>
                     </van-field>
                     </van-field>
                     <van-field v-if="user.company.packageProject == 1 && !user.timeType.hideTask && (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&& (item.projectId && projectss.filter(p => p.id == item.projectId)[0].isPublic!=1)))" readonly name="taskId" :value="item.taskName"
                     <van-field v-if="user.company.packageProject == 1 && !user.timeType.hideTask && (user.company.nonProjectSimple==0 || (user.company.nonProjectSimple==1&& (item.projectId && projectss.filter(p => p.id == item.projectId)[0].isPublic!=1)))" readonly name="taskId" :value="item.taskName"
-                        :rules="[{ required: reportTimeType.taskRequired? true : false, message: '请选择任务/里程碑' }]" label="任务/里程碑"
+                        :rules="[{ required: reportTimeType.taskRequired? true : false, message: '请选择任务/里程碑' }]" label="任务/里程碑" :disabled="!item.canEdit"
                         placeholder="请选择任务/里程碑" @click="clickPickerTask(index, item)"></van-field>
                         placeholder="请选择任务/里程碑" @click="clickPickerTask(index, item)"></van-field>
                     <van-field v-if="user.companyId == 3092" readonly name="sapServiceId" :value="item.sapServiceName"
                     <van-field v-if="user.companyId == 3092" readonly name="sapServiceId" :value="item.sapServiceName"
                         :rules="[{ required: true, message: '请选择服务' }]" label="服务" placeholder="请选择服务"
                         :rules="[{ required: true, message: '请选择服务' }]" label="服务" placeholder="请选择服务"
@@ -311,7 +311,7 @@
                     <!-- 常规选择时间的方式 -->
                     <!-- 常规选择时间的方式 -->
                     <!-- 全天上下午模式 -->
                     <!-- 全天上下午模式 -->
                     <div v-if="reportTimeType.multiWorktime == 0">
                     <div v-if="reportTimeType.multiWorktime == 0">
-                        <van-field v-if="reportTimeType.type < 2" readonly clickable
+                        <van-field v-if="reportTimeType.type < 2" readonly clickable :disabled="!item.canEdit"
                             :value="reportTimeType.type == 0 ? item.label : (parseFloat(item.workingTime).toFixed(1) + 'h')"
                             :value="reportTimeType.type == 0 ? item.label : (parseFloat(item.workingTime).toFixed(1) + 'h')"
                             label="工作时长" placeholder="请选择工作时长(小时)" @click="clickTimePicker(index, item)"
                             label="工作时长" placeholder="请选择工作时长(小时)" @click="clickTimePicker(index, item)"
                             :rules="[{ required: true, message: '请选择工作时长' }]" />
                             :rules="[{ required: true, message: '请选择工作时长' }]" />
@@ -456,7 +456,7 @@
                 </van-cell-group>
                 </van-cell-group>
 
 
             </div>
             </div>
-            <div style="text-align:center;">
+            <div style="text-align:center;" v-if="canEdit">
                 <van-tag size="large"
                 <van-tag size="large"
                     style="text-align:center;margin:10px;padding:12px;margin-bottom:120px;border: 1px solid #20a0ff;"
                     style="text-align:center;margin:10px;padding:12px;margin-bottom:120px;border: 1px solid #20a0ff;"
                     @click="addNewPro" icon="plus" color="#ffffff"><span
                     @click="addNewPro" icon="plus" color="#ffffff"><span