|
@@ -29,7 +29,7 @@
|
|
|
@click="copyProject(index)" style="border: 1px solid #20a0ff;padding:5px;"
|
|
|
icon="plus" type="default" ><span style="color:#666;padding: 0 5px;">复制项目</span></van-tag> -->
|
|
|
|
|
|
- <van-tag v-if="index>0&&canEdit" color="#fff"
|
|
|
+ <van-tag v-if="index>0&&item.canEdit" color="#fff"
|
|
|
@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>
|
|
|
</div>
|
|
@@ -91,13 +91,13 @@
|
|
|
</van-popup>
|
|
|
|
|
|
<!-- 自定义数值 -->
|
|
|
- <van-field v-if="user.timeType.customDataActive==1" type="number" :disabled="!canEdit" v-model="item.customData" :label="user.timeType.customDataName" placeholder="请输入数字" :rules="user.timeType.customDataStatus == 1 ? [{ required: true, message: '请输入' + user.timeType.customDataName }] : []"></van-field>
|
|
|
+ <van-field v-if="user.timeType.customDataActive==1" type="number" :disabled="!item.canEdit" v-model="item.customData" :label="user.timeType.customDataName" placeholder="请输入数字" :rules="user.timeType.customDataStatus == 1 ? [{ required: true, message: '请输入' + user.timeType.customDataName }] : []"></van-field>
|
|
|
<!-- 自定义文本 -->
|
|
|
- <van-field v-if="user.timeType.customTextActive==1" :disabled="!canEdit" v-model="item.customText" :label="user.timeType.customTextName" placeholder="请输入" maxlength="1000" :rules="user.timeType.customTextStatus ? [{ required: true, message: '请选择' + user.timeType.customTextName }] : []" rows="2" type="textarea" show-word-limit autosize></van-field>
|
|
|
+ <van-field v-if="user.timeType.customTextActive==1" :disabled="!item.canEdit" v-model="item.customText" :label="user.timeType.customTextName" placeholder="请输入" maxlength="1000" :rules="user.timeType.customTextStatus ? [{ required: true, message: '请选择' + user.timeType.customTextName }] : []" rows="2" type="textarea" show-word-limit autosize></van-field>
|
|
|
|
|
|
<van-cell title="专业进度" v-if="user.company.packageEngineering == 1">
|
|
|
</van-cell>
|
|
|
- <van-field :disabled="!canEdit"
|
|
|
+ <van-field :disabled="!item.canEdit"
|
|
|
type="number" :name="'progress_'+pItem.professionId" input-align="right"
|
|
|
v-for="pItem in item.professionProgress" :key="pItem.professionId"
|
|
|
:label="'-- '+pItem.professionName"
|
|
@@ -106,11 +106,11 @@
|
|
|
<van-stepper v-model="pItem.progress" integer min="0" max="100" />%
|
|
|
</template>
|
|
|
</van-field>
|
|
|
- <van-field v-if="user.company.packageProject == 1" readonly name="taskId" :value="item.taskName" label="关联任务" placeholder="请选择关联任务" @click="clickPickerTask(index)"
|
|
|
+ <van-field v-if="user.company.packageProject == 1" readonly name="taskId" :value="item.taskName" label="关联任务" placeholder="请选择关联任务" @click="clickPickerTask(index,item)"
|
|
|
></van-field>
|
|
|
<van-field name="taskFinish" label="是否已完成" v-if="item.taskId != null">
|
|
|
<template #input>
|
|
|
- <van-checkbox :disabled="!canEdit" v-model="item.taskFinish" shape="square">已完成</van-checkbox>
|
|
|
+ <van-checkbox :disabled="!item.canEdit" v-model="item.taskFinish" shape="square">已完成</van-checkbox>
|
|
|
</template>
|
|
|
|
|
|
</van-field>
|
|
@@ -124,7 +124,7 @@
|
|
|
<!-- 常规选择时间的方式 -->
|
|
|
<!-- 全天上下午模式 -->
|
|
|
<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="请选择工作时长(小时)" @click="clickTimePicker(index)"
|
|
|
+ <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)"
|
|
|
:rules="[{ required: true, message: '请选择工作时长' }]"/>
|
|
|
<van-popup v-model="showPickerTime" position="bottom">
|
|
|
<van-picker show-toolbar :columns="timeType" value-key="label" @confirm="choseTimePick" @cancel="showPickerTime = false" />
|
|
@@ -139,7 +139,7 @@
|
|
|
|
|
|
<!-- 时间段选择模式 -->
|
|
|
<van-field readonly v-if="reportTimeType.type == 2" clickable name="datetimePicker" :value="item.startTime" label="开始时间" placeholder="点击选择时间"
|
|
|
- @click="canEdit?showStartTime = true:''" :disabled="!canEdit"
|
|
|
+ @click="item.canEdit?showStartTime = true:''" :disabled="!item.canEdit"
|
|
|
:rules="[{ required: true, message: '请选择开始时间' }]"
|
|
|
/>
|
|
|
<van-popup v-model="showStartTime" position="bottom">
|
|
@@ -154,7 +154,7 @@
|
|
|
<!-- :filter="filter" 原本这个属性在里面 -->
|
|
|
</van-popup>
|
|
|
<van-field v-if="reportTimeType.type == 2" readonly clickable name="datetimePicker" :value="item.endTime" label="结束时间" placeholder="点击选择时间"
|
|
|
- @click="canEdit?showEndTime = true:''" :disabled="!canEdit"
|
|
|
+ @click="item.canEdit?showEndTime = true:''" :disabled="!item.canEdit"
|
|
|
:rules="[{ required: true, message: '请选择结束时间' }]" />
|
|
|
<van-popup v-model="showEndTime" position="bottom" >
|
|
|
<van-datetime-picker
|
|
@@ -171,7 +171,7 @@
|
|
|
<template >
|
|
|
<div>
|
|
|
<span>用时占比</span>
|
|
|
- <van-slider :disabled="!canEdit" :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 :disabled="!item.canEdit" :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)" >
|
|
|
<template #button>
|
|
|
<div class="custom-button">{{ item.progress }}%</div>
|
|
|
</template>
|
|
@@ -180,7 +180,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</van-cell>
|
|
|
- <van-field class="form_input" :disabled = "!canEdit"
|
|
|
+ <van-field class="form_input" :disabled="!item.canEdit"
|
|
|
v-model="item.content" name="content" type="textarea" :label="user.companyId==781?'具体内容与结果':'工作事项'" placeholder="请输入" :rules="user.timeType.workContentState == 1 ? [{ required: true, message: '请填写工作事项' }] : null"
|
|
|
rows="3" autosize />
|
|
|
</div>
|
|
@@ -188,21 +188,21 @@
|
|
|
<!-- 多个时间和工作事项的选择方式 -->
|
|
|
<div v-if="reportTimeType.multiWorktime==1">
|
|
|
<div v-for="(timeItem, tindex) in item.worktimeList" :key="tindex" style="position:relative;border:#ccc 0.5px solid;margin:7px;">
|
|
|
- <van-tag v-if="tindex>0 && canEdit" style="position:absolute; right:-7px;top:-7px;z-index:10;"
|
|
|
+ <van-tag v-if="tindex>0 && item.canEdit" style="position:absolute; right:-7px;top:-7px;z-index:10;"
|
|
|
@click="removeTimeItem(item,tindex)">X</van-tag>
|
|
|
|
|
|
<!-- 时间段选择模式 -->
|
|
|
- <van-field readonly v-if="reportTimeType.type == 2" :clickable="canEdit" name="datetimePicker"
|
|
|
+ <van-field readonly v-if="reportTimeType.type == 2" :clickable="item.canEdit" name="datetimePicker"
|
|
|
:value="timeItem.startTime" label="开始时间" placeholder="点击选择时间"
|
|
|
:rules="[{ required: true, message: '必填项' }]"
|
|
|
- @click="canEdit?showStartDialog(timeItem):''" />
|
|
|
+ @click="item.canEdit?showStartDialog(timeItem):''" />
|
|
|
|
|
|
<van-field v-if="reportTimeType.type == 2" readonly :clickable="canEdit" name="datetimePicker"
|
|
|
:value="timeItem.endTime" label="结束时间" placeholder="点击选择时间"
|
|
|
:rules="[{ required: true, message: '必填项' }]"
|
|
|
- @click="canEdit?showEndDialog(timeItem):''" />
|
|
|
+ @click="item.canEdit?showEndDialog(timeItem):''" />
|
|
|
|
|
|
- <van-field class="form_input" :disabled="!canEdit" style="color:#333;-webkit-text-fill-color:#646566;"
|
|
|
+ <van-field class="form_input" :disabled="!item.canEdit" style="color:#333;-webkit-text-fill-color:#646566;"
|
|
|
|
|
|
v-model="timeItem.content" name="content" type="textarea" label="工作事项" placeholder="请输入工作事项"
|
|
|
:rules="user.timeType.workContentState == 1 ? [{ required: true, message: '请填写工作事项' }] : null"
|
|
@@ -233,27 +233,27 @@
|
|
|
</van-popup>
|
|
|
</div>
|
|
|
|
|
|
- <div style="width:100%;" v-if="canEdit&&reportTimeType.multiWorktime==1">
|
|
|
+ <div style="width:100%;" v-if="item.canEdit&&reportTimeType.multiWorktime==1">
|
|
|
<van-tag style="text-align:center;padding:5px;margin-left:15px;border: 1px solid #20a0ff;"
|
|
|
- :disabled="!canEdit" @click="addNewWorktime(index, item)"
|
|
|
+ :disabled="!item.canEdit" @click="addNewWorktime(index, item)"
|
|
|
icon="plus" color="#ffffff" ><span style="color:#999;text-align:center;padding: 0 5px;"> 添加工时 </span></van-tag>
|
|
|
</div>
|
|
|
|
|
|
<div class="overtime" v-if="((user.timeType.fillOvertime || isWeekend) || (isCorpWX&&canEdit))">
|
|
|
<div class="overTimeClas" v-if="user.timeType.fillOvertime || isWeekend">
|
|
|
- <van-checkbox :disabled="!canEdit" v-model="item.isOvertime" style="width: 4.3rem;">含加班</van-checkbox>
|
|
|
- <van-field v-model="item.overtimeHours" type="number" :disabled="!canEdit || item.isOvertime==null||item.isOvertime==0 || !item.isOvertime"
|
|
|
+ <van-checkbox :disabled="!item.canEdit" v-model="item.isOvertime" style="width: 4.3rem;">含加班</van-checkbox>
|
|
|
+ <van-field v-model="item.overtimeHours" type="number" :disabled="!item.canEdit || item.isOvertime==null||item.isOvertime==0 || !item.isOvertime"
|
|
|
placeholder="请输入加班时长" style="width: 5rem"></van-field>
|
|
|
- <span :class="canEdit ? 'overListTime' : 'overListTime hoveOver'">小时</span>
|
|
|
+ <span :class="item.canEdit ? 'overListTime' : 'overListTime hoveOver'">小时</span>
|
|
|
</div>
|
|
|
- <van-tag style="position:absolute;right:10px;" v-if="isCorpWX&&canEdit" type="primary" size="large" @click="takePhoto(index)">拍照上传</van-tag>
|
|
|
+ <van-tag style="position:absolute;right:10px;" v-if="isCorpWX&&item.canEdit" type="primary" size="large" @click="takePhoto(index)">拍照上传</van-tag>
|
|
|
<!-- <van-tag style="position:absolute;right:10px;" type="primary" size="large" @click="takePhoto(index)">拍照上传</van-tag> -->
|
|
|
<!-- <van-tag style="position:absolute;right:10px;" type="primary" size="large" @click="takePhoto(index)">拍照上传</van-tag> -->
|
|
|
</div>
|
|
|
<div style="padding:5px;text-align:center;" v-if="!isIOSystem">
|
|
|
<span v-for="(p, index) in item.pics" :key="p" style="margin-right:15px;">
|
|
|
<div class="imgList">
|
|
|
- <van-icon v-if="canEdit && user.companyId==7" size="20" name="clear" @click="deleteImg(item, index)" class="imgList_i"/>
|
|
|
+ <van-icon v-if="item.canEdit && user.companyId==7" size="20" name="clear" @click="deleteImg(item, index)" class="imgList_i"/>
|
|
|
<img :src="p" style="width:100px; height:100px;" @click="showLargeImg(item.pics, index)"/>
|
|
|
</div>
|
|
|
</span>
|
|
@@ -261,7 +261,7 @@
|
|
|
<div style="padding:5px;text-align:center;" v-if="isIOSystem">
|
|
|
<span v-for="(p, index) in item.iospics" :key="p" style="margin-right:15px;">
|
|
|
<div class="imgList">
|
|
|
- <van-icon v-if="canEdit && user.companyId==7" size="20" name="clear" @click="deleteImg(item, index)" class="imgList_i"/>
|
|
|
+ <van-icon v-if="item.canEdit && user.companyId==7" size="20" name="clear" @click="deleteImg(item, index)" class="imgList_i"/>
|
|
|
<img :src="p" style="width:100px; height:100px;" @click="showLargeImg(item.iospics, index)"/>
|
|
|
</div>
|
|
|
</span>
|
|
@@ -277,7 +277,7 @@
|
|
|
|
|
|
</div>
|
|
|
<div style="text-align:center;" >
|
|
|
- <van-tag v-if="canEdit" size="large" style="text-align:center;margin:10px;padding:12px;margin-bottom:120px;border: 1px solid #20a0ff;"
|
|
|
+ <van-tag size="large" style="text-align:center;margin:10px;padding:12px;margin-bottom:120px;border: 1px solid #20a0ff;"
|
|
|
:disabled="!canEdit" @click="addNewPro"
|
|
|
icon="plus" color="#ffffff" ><span style="color:#999;text-align:center;padding: 0 50px;"> + 新增{{user.companyId==781?'任务':'项目'}} </span></van-tag>
|
|
|
</div>
|
|
@@ -292,7 +292,7 @@
|
|
|
<van-loading type="spinner" v-if="!flgLg" />
|
|
|
</van-button>
|
|
|
</div>
|
|
|
- <van-button v-if="canEdit&&form.domains.length>0 && form.domains[0].id != null"
|
|
|
+ <van-button v-if="canDeleteReport"
|
|
|
square block type="default" @click="deleteReport" native-type="button"
|
|
|
style=""> 删除 </van-button>
|
|
|
<!-- <div v-if="canEdit&&form.domains.length>0 && form.domains[0].id != null"
|
|
@@ -303,7 +303,7 @@
|
|
|
</div>
|
|
|
</van-form>
|
|
|
<div style="position:fixed; bottom:0px;width:100%;">
|
|
|
- <van-button v-if="canCancel" block type="default" @click="cancel"> 撤销 </van-button>
|
|
|
+ <van-button v-if="canCancelInDialog" block type="default" @click="cancel"> 撤销 </van-button>
|
|
|
</div>
|
|
|
|
|
|
<div class="form_tip" v-if="!canEdit && !canCancel"> 已审核无法修改 </div>
|
|
@@ -343,6 +343,8 @@
|
|
|
isWX: false,
|
|
|
showPickerTask:false,
|
|
|
canCancel:false,
|
|
|
+ canDeleteReport: false,
|
|
|
+ canCancelInDialog: false,
|
|
|
canEdit:false,
|
|
|
showEndTime: false,
|
|
|
showStartTime: false,
|
|
@@ -695,7 +697,9 @@
|
|
|
var data = this.form.domains;
|
|
|
data.forEach(element => {
|
|
|
if (element.id != null && element.id != '') {
|
|
|
- ids +=(element.id+',');
|
|
|
+ if(element.id){
|
|
|
+ ids +=(element.id+',');
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
this.$axios.post("/report/cancel", {userId: this.user.id, reportIds:ids})
|
|
@@ -768,8 +772,8 @@
|
|
|
}
|
|
|
|
|
|
},
|
|
|
- clickTimePicker(i) {
|
|
|
- if (!this.canEdit) {
|
|
|
+ clickTimePicker(i,item) {
|
|
|
+ if (!item.canEdit) {
|
|
|
return;
|
|
|
}
|
|
|
this.clickTimeIndex = i;
|
|
@@ -889,9 +893,11 @@
|
|
|
timeType.push({value:2, label:'下午 - '+t.pm+'小时', hours: t.pm});
|
|
|
}
|
|
|
var list = res.data.report;
|
|
|
+ this.canCancelInDialog = false
|
|
|
if(list.length != 0) {
|
|
|
this.canEdit = false;
|
|
|
this.canCancel = false;
|
|
|
+ this.canDeleteReport = true
|
|
|
let array = [];
|
|
|
for(var i in list) {
|
|
|
var projectName = "";
|
|
@@ -964,12 +970,17 @@
|
|
|
projectAuditorName: list[i].projectAuditorName,
|
|
|
auditUserList: list[i].auditUserList,
|
|
|
overtimeHours: list[i].overtimeHours,
|
|
|
- customText: list[i].customText
|
|
|
+ customText: list[i].customText,
|
|
|
+ canEdit: list[i].state >= 2 ? true : false
|
|
|
})
|
|
|
if (list[i].state >= 2) {
|
|
|
this.canEdit = true;
|
|
|
- } else if (list[i].state == 0) {
|
|
|
+ } else {
|
|
|
+ this.canDeleteReport = false
|
|
|
+ }
|
|
|
+ if (list[i].state == 0) {
|
|
|
this.canCancel = true;
|
|
|
+ this.canCancelInDialog = true
|
|
|
}
|
|
|
}
|
|
|
this.form.domains = array;
|
|
@@ -991,6 +1002,7 @@
|
|
|
professionProgress:[],
|
|
|
multiWorktime:t.multiWorktime,
|
|
|
worktimeList:[{}],
|
|
|
+ canEdit: true
|
|
|
}]
|
|
|
if(this.isWeekend){
|
|
|
this.$set(this.form.domains[0],'isOvertime',true)
|
|
@@ -1023,7 +1035,7 @@
|
|
|
|
|
|
//点击选择审核人
|
|
|
clickPickAuditor(i, item) {
|
|
|
- if (!this.canEdit) return;
|
|
|
+ if (!item.canEdit) return;
|
|
|
if (item.auditUserList.length<=1) return;
|
|
|
this.clickIndex = i;
|
|
|
item.showPickerAuditor = true;
|
|
@@ -1039,25 +1051,25 @@
|
|
|
|
|
|
//点击选择子项目
|
|
|
clickPickSubProject(i, item) {
|
|
|
- if (!this.canEdit) return;
|
|
|
+ if (!item.canEdit) return;
|
|
|
this.clickIndex = i;
|
|
|
item.showPickerSubProject = true;
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
clickPickCostId(i, item) {
|
|
|
- if (!this.canEdit) return;
|
|
|
+ if (!item.canEdit) return;
|
|
|
this.clickIndex = i;
|
|
|
item.showPickerCostId = true;
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
clickPickTaskGroup(i, item) {
|
|
|
- if (!this.canEdit) return;
|
|
|
+ if (!item.canEdit) return;
|
|
|
this.clickIndex = i;
|
|
|
item.showPickerTaskGroup = true;
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
clickPickStage(i, item) {
|
|
|
- if (!this.canEdit) return;
|
|
|
+ if (!item.canEdit) return;
|
|
|
this.clickIndex = i;
|
|
|
item.showPickerStage = true;
|
|
|
this.$forceUpdate();
|
|
@@ -1065,7 +1077,7 @@
|
|
|
|
|
|
// 选择项目
|
|
|
clickPicker(i, item) {
|
|
|
- if (!this.canEdit) return;
|
|
|
+ if (!item.canEdit) return;
|
|
|
// this.clickIndex = i;
|
|
|
// this.showPickerProject = true;
|
|
|
// console.log(i, item, this.form)
|
|
@@ -1084,7 +1096,7 @@
|
|
|
},
|
|
|
clickPickers(i,item) {
|
|
|
// console.log('wudulist',item.wuduList);
|
|
|
- if (!this.canEdit) return;
|
|
|
+ if (!item.canEdit) return;
|
|
|
|
|
|
this.clickIndex = i;
|
|
|
// item.showPickDegree = true;
|
|
@@ -1093,8 +1105,8 @@
|
|
|
// this.dimension(proId)
|
|
|
},
|
|
|
//选择任务
|
|
|
- clickPickerTask(i) {
|
|
|
- if (!this.canEdit) return;
|
|
|
+ clickPickerTask(i,item) {
|
|
|
+ if (!item.canEdit) return;
|
|
|
// console.log(i);
|
|
|
this.clickIndex = i;
|
|
|
// var proId = this.form.domains[this.clickIndex].projectId
|
|
@@ -1251,7 +1263,8 @@
|
|
|
isOvertime:false,
|
|
|
multiWorktime: this.reportTimeType.multiWorktime,
|
|
|
worktimeList:[{}],
|
|
|
- degreeId: null
|
|
|
+ degreeId: null,
|
|
|
+ canEdit: true
|
|
|
}
|
|
|
if(this.isWeekend){
|
|
|
this.$set(item,'isOvertime',true)
|
|
@@ -1262,6 +1275,7 @@
|
|
|
}
|
|
|
}
|
|
|
this.form.domains.push(item)
|
|
|
+ this.canEdit = true
|
|
|
},
|
|
|
|
|
|
// 移除项目
|