Lijy 2 月之前
父节点
当前提交
7d6244a678

文件差异内容过多而无法显示
+ 57 - 4
fhKeeper/formulahousekeeper/timesheet/src/components/taskComponent.vue


+ 2 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/task/list.vue

@@ -107,7 +107,7 @@
                     <p :class="idx == 0 ? 'on' : ''" @click="switchs(0)" v-if="permissions.projectView || permissions.projectManagement || permissions.projectViewAllTasks">{{ $t('alltaskss') }}</p>
                     <p :class="idx == 1 ? 'on' : ''" @click="switchs(1)">{{ $t('perform') }}</p>
                     <p :class="idx == 2 ? 'on' : ''" @click="switchs(2)">{{ $t('created') }}</p>
-                    <p :class="idx == 3 ? 'on' : ''" @click="switchs(3)" v-if="user.timeType.taskFileCharge == 1 && permissions.tasksReviewTaskFile">待审核文件</p>
+                    <p :class="idx == 3 ? 'on' : ''" @click="switchs(3)" v-if="(user.timeType.taskFileCharge == 1 || user.timeType.taskFileCharge == 2) && permissions.tasksReviewTaskFile">待审核文件</p>
                 </div>
             </div>
             <div style="max-width: 94%;min-width: 90%">
@@ -156,7 +156,7 @@
                             </div>
                         </template>
                     </el-table-column>
-                    <el-table-column prop="finalChargeStatusText" label="文件审核状态" width="210" sortable v-if="user.timeType.taskFileCharge == 1 && [0, 1, 2].includes(idx)">
+                    <el-table-column prop="finalChargeStatusText" label="文件审核状态" width="210" sortable v-if="(user.timeType.taskFileCharge == 1 || user.timeType.taskFileCharge == 2) && [0, 1, 2].includes(idx)">
                         <template slot-scope="scope">
                             <template v-if="scope.row.fileChargeStatus != 2">
                                 <el-link :type="{'0': 'warning', '1': 'info', '2': 'danger'}[scope.row.fileChargeStatus]" :underline="false">

+ 52 - 5
fhKeeper/formulahousekeeper/timesheet_h5/src/views/task/editask.vue

@@ -59,6 +59,11 @@
                     @confirm="tasktypeChange"
                     @cancel="taskType.show = false;$forceUpdate();"/>
                 </van-popup>
+                <van-field label="任务完成校验" v-if="user.timeType.taskFileCharge" readonly clickable>
+                    <template #input>
+                        <van-checkbox v-model="taskform.attachFileRequired" >是否必须上传成果文件</van-checkbox>
+                    </template>
+                </van-field>
                 <!-- 任务内容 -->
                 <van-field v-model="taskform.name" label="任务内容" placeholder="请输入任务内容" :rules="[{ required: true, message: '请输入任务内容' }]" type="textarea" :disabled="!canEdit" :maxlength="40" show-word-limit></van-field>
                 <!-- 开始时间 -->
@@ -126,6 +131,23 @@
                             </template>
                         </van-cell>
                     </van-cell-group>
+
+                    <template v-if="user.timeType.taskFileCharge == 2">
+                        <van-field v-model="item.fileChargeOneName" :label="'审核人1'" placeholder="请选择" @click="executorChange(item,index, 'fileChargeOneName')" readonly clickable>
+                            <template #input>
+                                <span v-if="!item.fileChargeOneName"></span>
+                                <span v-else-if="user.userNameNeedTranslate != 1">{{item.fileChargeOneName}}</span>
+                                <span v-else><TranslationOpenDataText type='userName' :openid='item.fileChargeOneName'></TranslationOpenDataText></span>
+                            </template>
+                        </van-field>
+                        <van-field v-model="item.fileChargeTwoName" :label="'审核人2'" placeholder="请选择" @click="executorChange(item,index, 'fileChargeTwoName')" readonly clickable>
+                            <template #input>
+                                <span v-if="!item.fileChargeTwoName"></span>
+                                <span v-else-if="user.userNameNeedTranslate != 1">{{item.fileChargeTwoName}}</span>
+                                <span v-else><TranslationOpenDataText type='userName' :openid='item.fileChargeTwoName'></TranslationOpenDataText></span>
+                            </template>
+                        </van-field>
+                    </template>
                 </div>
 
                 <!-- 选择项目服务 -->
@@ -251,7 +273,8 @@ export default {
                 index: 0,
                 list: [],
                 searchList: [],
-                searchText: ''
+                searchText: '',
+                type: ''
             },
 
             select_project_show: false,
@@ -426,11 +449,12 @@ export default {
             this.finishDateShow = false
         },
         
-        executorChange(item,index){  // 选择执行人
+        executorChange(item, index, type){  // 选择执行人
             this.executor.searchText = ''
             this.getOnSearch('')
             this.executor.show = true
             this.executor.index = index
+            this.executor.type = type
             this.executor.searchList.forEach(u=>{if (u.id == item.executorId) {
                 this.executor.item = u
             }})
@@ -485,8 +509,20 @@ export default {
             }).catch(err=> {this.$toast.clear();console.log(err)});
         },
         searchExecutor(){
-            this.taskform.executorList[this.executor.index].executorId = this.executor.item.id
-            this.taskform.executorList[this.executor.index].executorName = this.executor.item.name
+            if(!this.executor.type) {
+                this.taskform.executorList[this.executor.index].executorId = this.executor.item.id
+                this.taskform.executorList[this.executor.index].executorName = this.executor.item.name
+            }
+            
+            if(this.executor.type == 'fileChargeOneName') {
+                this.taskform.executorList[this.executor.index].fileChargeOneId = this.executor.item.id
+                this.taskform.executorList[this.executor.index].fileChargeOneName = this.executor.item.name
+            }
+
+            if(this.executor.type == 'fileChargeTwoName') {
+                this.taskform.executorList[this.executor.index].fileChargeTwoId = this.executor.item.id
+                this.taskform.executorList[this.executor.index].fileChargeTwoName = this.executor.item.name
+            }
             this.executor.show = false
             console.log('searchExecutor',this.executor.item,this.executor.item.name);
         },
@@ -524,7 +560,7 @@ export default {
 
         submitTask(){
             console.log('submitTask');
-            const { companyId } = this.user
+            const { companyId, timeType } = this.user
             if(!this.taskform.name.replace(/^\s*|\s*$/g,"")){
                 return
             }
@@ -543,6 +579,17 @@ export default {
                 }
             }
 
+            if(timeType.taskFileCharge == 2) {
+                let arr = this.taskform.executorList
+                for(let i in arr) {
+                    let item = arr[i]
+                    if(item.executorId && (!item.fileChargeOneId || !item.fileChargeTwoId)) {
+                        this.$toast.fail("审核人必填");
+                        return
+                    }
+                }
+            }
+
             // 针对依斯倍排除执行人相同和项目服务相同的任务
             if(companyId == '3092') {
                 if(!this.executorProjectJudgment(this.taskform.executorList)) {

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/task/index.vue

@@ -180,7 +180,7 @@ export default {
                     this.listReLoading = true
                     this.onDownRefresh()
                 } else {
-                    this.$toast.fail('获取失败');
+                    this.$toast.fail(res.msg);
                 }
             }).catch(err=> {this.$toast.clear();console.log(err)});
         },