|
|
@@ -64,7 +64,7 @@
|
|
|
style="height:0.6rem;padding:0 0.16667rem;" :loading="cardRefLoading" loading-size="0.26667rem"
|
|
|
@click.stop.native="cardtimeRefresh(form.createDate, (fillingAgent.id || ''))"
|
|
|
v-if="substitute && fillingAgent.name && (user.timeType.syncDingding == 1 || user.timeType.syncCorpwxTime == 1)"></van-button>
|
|
|
- <template v-if="(user.companyId <= 10 || user.companyId == 8555) && !report.time">
|
|
|
+ <template v-if="user.companyId == 8555 && (!report.time || !report.time.workHours)">
|
|
|
<span style="margin:0 10px;color:#DAA520;">异常填报</span>
|
|
|
<van-switch v-model="form.abnormalTime" size="20px" :disabled="!canEdit" @change="$forceUpdate()"/>
|
|
|
</template>
|
|
|
@@ -94,25 +94,13 @@
|
|
|
:decimal-length="1" />
|
|
|
</template>
|
|
|
</van-cell>
|
|
|
-
|
|
|
- <!-- <van-cell title="待分配时长" :value="report.time + 'h'" size="large"></van-cell> -->
|
|
|
-
|
|
|
<div class="form_domains" v-for="(item, index) in form.domains" :key="item.id">
|
|
|
<div style="float:right;margin-top:10px;margin-right:10px;">
|
|
|
- <!-- <van-tag v-if="canEdit&&item.projectName.length>0" color="#fff"
|
|
|
- @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="item.canEdit && user.companyId == 7536" color="#fff"
|
|
|
@click="scanCodeToFillIn(index)" style="border: 1px solid #409eff;padding:5px;margin-left:10px;" icon="plus"
|
|
|
type="default"><span style="color:#409eff;padding: 0 5px;">扫码填报</span>
|
|
|
</van-tag>
|
|
|
- <!-- <van-tag v-if="item.canEdit && user.companyId == 7536" color="#fff"
|
|
|
- @click="determineQrcode(index)" style="border: 1px solid #409eff;padding:5px;margin-left:10px;" icon="plus"
|
|
|
- type="default"><span style="color:#409eff;padding: 0 5px;">扫码填报</span>
|
|
|
- </van-tag> -->
|
|
|
-
|
|
|
<van-tag v-if="(index > 0 || form.domains.length > 1) && 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>
|
|
|
@@ -182,6 +170,19 @@
|
|
|
<van-picker show-toolbar :columns="item.workContentList" value-key="workContext"
|
|
|
@confirm="choseWorkContent" @cancel="item.showPickerWorkContent = false; $forceUpdate();" />
|
|
|
</van-popup>
|
|
|
+ <!--柘中施工分项工程-->
|
|
|
+ <van-field readonly name="extraField1" v-if="(user.companyId == 4811 || user.companyId == 10) && item.constructionStages != null && item.constructionStages.length > 0" clickable
|
|
|
+ :value="item.constructionStagesStr" label="施工分项工程" placeholder="请录入今日完成数量" :disabled="!item.canEdit"
|
|
|
+ @click="clickPickConstructionStage(index, item)" />
|
|
|
+ <van-popup v-model="item.showPickerConstruction" position="bottom">
|
|
|
+ <!-- <van-picker show-toolbar :columns="item.constructionStages" value-key="name" @confirm="choseConstruction"
|
|
|
+ @cancel="item.showPickerConstruction = false; $forceUpdate();" /> -->
|
|
|
+
|
|
|
+ <van-cell-group>
|
|
|
+ <van-field label-width="70%" v-for="stage in item.constructionStages" type="digit" :label="stage.name+' - 今日完成'" v-model="stage.finishNumber" placeholder="完成数量" ></van-field>
|
|
|
+ </van-cell-group>
|
|
|
+ <van-button style="width:100%" type="primary" @click="choseConstruction">确定</van-button>
|
|
|
+ </van-popup>
|
|
|
<!--任务阶段 -->
|
|
|
<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"
|
|
|
@@ -233,8 +234,8 @@
|
|
|
<!-- 按审批流显示审核人 -->
|
|
|
<template v-if="user.timeType.reportWorkflow">
|
|
|
<div style="display: flex; align-items: center; flex-wrap: wrap;">
|
|
|
- <template v-for="(nodeItem, nodeIndex) in item.auditWorkflow">
|
|
|
- <span :key="'node-' + nodeIndex" style="display: inline-flex; align-items: center;">
|
|
|
+ <template >
|
|
|
+ <span v-for="(nodeItem, nodeIndex) in item.auditWorkflow" :key="'node-' + nodeIndex" style="display: inline-flex; align-items: center;">
|
|
|
<span v-if="nodeItem.isDeptAudit">
|
|
|
<van-tag v-if="user.userNameNeedTranslate != '1'" type="primary">{{ nodeItem.auditDeptManagerName }}</van-tag>
|
|
|
<van-tag v-else type="primary"><TranslationOpenDataText type='userName' :openid='nodeItem.auditDeptManagerName'></TranslationOpenDataText></van-tag>
|
|
|
@@ -360,15 +361,21 @@
|
|
|
</van-popup>
|
|
|
|
|
|
<!-- 自定义数值 -->
|
|
|
- <van-field v-if="user.timeType.customDataActive == 1" type="number" :disabled="!item.canEdit"
|
|
|
+ <van-field v-if="user.timeType.customDataActive == 1 && user.companyId != 4811" 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="!item.canEdit"
|
|
|
+ <van-field v-if="user.timeType.customTextActive == 1 && user.companyId != 4811" :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-field v-if="user.companyId == 4811" :disabled="!item.canEdit"
|
|
|
+ v-model="item.customTextShow" label="人员" placeholder="请选择人员" readonly clickable @click="showEmployeeSelector(index, item)"
|
|
|
+ :rules="[{ required: true, message: '请选择人员'}]" ></van-field>
|
|
|
+
|
|
|
+ <!-- 柘中的施工人数自定义,放人员下面-->
|
|
|
+ <van-cell v-if="user.companyId == 4811" :title="user.timeType.customDataName" :value="item.customData" />
|
|
|
<van-cell title="专业进度" v-if="user.company.packageEngineering == 1">
|
|
|
</van-cell>
|
|
|
<van-field :disabled="!item.canEdit" type="number" :name="'progress_' + pItem.professionId"
|
|
|
@@ -452,8 +459,8 @@
|
|
|
</template>
|
|
|
</van-cell>
|
|
|
<van-field class="form_input" :disabled="!item.canEdit" v-model="item.content" name="content" v-if="!user.timeType.hideContent"
|
|
|
- type="textarea" label="工作事项" placeholder="请输入"
|
|
|
- :rules="user.timeType.workContentState == 1 ? [{ required: true, message: '请填写工作事项' }] : null"
|
|
|
+ type="textarea" label="工作内容" placeholder="请输入"
|
|
|
+ :rules="user.timeType.workContentState == 1 && (user.companyId != 10 || item.constructionStages.length == 0)? [{ required: true, message: '请填写工作内容' }] : null"
|
|
|
rows="3" autosize />
|
|
|
</div>
|
|
|
|
|
|
@@ -521,7 +528,7 @@
|
|
|
<span :class="item.canEdit ? 'overListTime' : 'overListTime hoveOver'">小时</span>
|
|
|
</div>
|
|
|
<!--羲合超导的照片上传-->
|
|
|
- <template v-if="(user.companyId <= 10|| user.companyId == 8555)">
|
|
|
+ <template v-if="user.companyId == 8555">
|
|
|
<van-tag style="position:absolute;right:10px;" v-if="form.abnormalTime && item.canEdit" type="primary"
|
|
|
size="large" @click="takePhoto(index)">图片上传</van-tag>
|
|
|
</template>
|
|
|
@@ -617,42 +624,23 @@
|
|
|
<!-- 选择项目弹窗 -->
|
|
|
<van-popup v-model="showPickerUserddp" position="bottom" style="height: 84%">
|
|
|
<div class="popupDiv">
|
|
|
- <!-- <van-search v-model="userName" placeholder="请输入项目名称/编号" @clear="sea()" @blur="sea()" @search="sea()" @input="sea()"/> -->
|
|
|
<div class="popupSearch">
|
|
|
<van-search v-model="userName" shape="round" background="#F4F4F4" placeholder="请输入项目名称/编号"
|
|
|
@clear="sea()" @blur="sea()" @search="sea()" @input="sea()" />
|
|
|
</div>
|
|
|
-
|
|
|
<div class="popupCon">
|
|
|
- <!-- <div class="ryuan" style="color: rgb(185 185 185);">近期选择项目</div>
|
|
|
- <div v-for="(item, index) in integrationProjectList" :key="index" class="ryuan" @click="fZr(item, index)">
|
|
|
- <p>{{item.projectName}}</p>
|
|
|
- <p style="margin-top: 5px;color: #9697B2;">{{item.projectCode}}</p>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="ryuan" style="color: rgb(185 185 185);">全部项目</div>
|
|
|
- <div v-for="(item, index) in projectss" :key="item.id" class="ryuan" @click="fZr(item, index)">
|
|
|
- <p>{{item.projectName}}</p>
|
|
|
- <p style="margin-top: 5px;color: #9697B2;">{{item.projectCode}}</p>
|
|
|
- </div> -->
|
|
|
-
|
|
|
<div class="popupTitle">近期选择项目</div>
|
|
|
-
|
|
|
<div v-for="(item, index) in integrationProjectList" :key="index" class="popupItem paddingDiv"
|
|
|
- @click="fZr(item, index)">
|
|
|
+ @click="selectProject(item, index)">
|
|
|
<div class="popupItemOne" v-if="item.projectName">{{ item.projectName }}</div>
|
|
|
<p class="popupItemTwo" v-if="item.projectCode">{{ item.projectCode }}</p>
|
|
|
</div>
|
|
|
-
|
|
|
<div class="popupTitle marginTop">全部项目</div>
|
|
|
-
|
|
|
<div v-for="(item, index) in projectss" :key="item.id" class="popupItem paddingDiv"
|
|
|
- @click="fZr(item, index)">
|
|
|
+ @click="selectProject(item, index)">
|
|
|
<div class="popupItemOne" v-if="item.projectName">{{ item.projectName }}</div>
|
|
|
<p class="popupItemTwo" v-if="item.projectCode">{{ item.projectCode }}</p>
|
|
|
</div>
|
|
|
-
|
|
|
- <!-- <div class="popupTitle paddingDiv">全部项目</div> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
</van-popup>
|
|
|
@@ -674,6 +662,44 @@
|
|
|
<div class="qrcodeClass" v-if="showQrcode">
|
|
|
<Qrcode @closeQrcode="closeQrcode" @determineQrcode="determineQrcode" />
|
|
|
</div>
|
|
|
+
|
|
|
+ <!-- 人员选择器弹窗 -->
|
|
|
+ <van-popup v-model="employeeSelector.show" position="bottom" :style="{ height: '80vh' }">
|
|
|
+ <div class="employeeSelectorPopup">
|
|
|
+ <div class="employeeSelectorHeader">
|
|
|
+ <span class="employeeSelectorTitle">选择人员</span>
|
|
|
+ </div>
|
|
|
+ <div class="employeeSelectorContent">
|
|
|
+ <div v-for="(group, groupIndex) in employeeSelector.groupList" :key="groupIndex" class="employeeGroup">
|
|
|
+ <!-- 分组标题 -->
|
|
|
+ <div class="employeeGroupHeader">
|
|
|
+ <van-checkbox
|
|
|
+ v-model="group.checked"
|
|
|
+ :indeterminate="group.indeterminate"
|
|
|
+ @change="onGroupCheckChange(group)">
|
|
|
+ <span class="groupName">{{ group.name || '未分组' }}</span>
|
|
|
+ <span class="groupCount">({{ group.employeeList ? group.employeeList.length : 0 }}人)</span>
|
|
|
+ </van-checkbox>
|
|
|
+ </div>
|
|
|
+ <!-- 人员列表 -->
|
|
|
+ <div class="employeeList" v-if="group.employeeList && group.employeeList.length > 0">
|
|
|
+ <div v-for="(employee, empIndex) in group.employeeList" :key="empIndex"
|
|
|
+ class="employeeItem">
|
|
|
+ <van-checkbox
|
|
|
+ v-model="employee.checked"
|
|
|
+ @change="onEmployeeCheckChange(employee, group)">
|
|
|
+ {{ employee.name }}
|
|
|
+ </van-checkbox>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="employeeSelectorFooter">
|
|
|
+ <van-button class="employeeSelectorBtn" @click="cancelEmployeeSelection">取消</van-button>
|
|
|
+ <van-button class="employeeSelectorBtn" type="info" @click="confirmEmployeeSelection">确定</van-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </van-popup>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
@@ -690,7 +716,7 @@ export default {
|
|
|
jobResponseList: [],
|
|
|
yuzhongCompId: 3385,
|
|
|
dailyIndex: 0,
|
|
|
-
|
|
|
+ allConstructionStages: [],
|
|
|
showQrcode: false,
|
|
|
integrationProjectList: [],
|
|
|
cardRefLoading: false,
|
|
|
@@ -805,6 +831,14 @@ export default {
|
|
|
hideWorkingHours: false,
|
|
|
|
|
|
reportSettingsRow: {},
|
|
|
+
|
|
|
+ // 人员选择器相关数据
|
|
|
+ employeeSelector: {
|
|
|
+ show: false,
|
|
|
+ groupList: [],
|
|
|
+ selectedEmployees: [],
|
|
|
+ currentIndex: 0
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
|
|
|
@@ -891,7 +925,7 @@ export default {
|
|
|
};
|
|
|
const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
|
|
|
const item = { id: trueProjectId, projectName: projectName, projectCode: projectId }
|
|
|
- this.fZr(item, this.scanCodeIndex, true)
|
|
|
+ this.selectProject(item, this.scanCodeIndex, true)
|
|
|
if(reportExtraField4Name || reportExtraField5Name) {
|
|
|
this.getInfoByProjectId(item.projectCode, this.clickIndex, false)
|
|
|
}
|
|
|
@@ -949,8 +983,6 @@ export default {
|
|
|
}).catch(err => { })
|
|
|
},
|
|
|
updateResponse(domainItem) {
|
|
|
- console.log(111);
|
|
|
- var that = this;
|
|
|
var selectPid = domainItem.projectId;
|
|
|
domainItem.extraField2 = null;
|
|
|
domainItem.extraField3 = null;
|
|
|
@@ -959,7 +991,6 @@ export default {
|
|
|
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;
|
|
|
}
|
|
|
@@ -973,7 +1004,14 @@ export default {
|
|
|
}
|
|
|
}).catch(err => { })
|
|
|
},
|
|
|
-
|
|
|
+ getConstructionStageList(){
|
|
|
+ this.$axios.post("/construction-stage/list", null)
|
|
|
+ .then(res => {
|
|
|
+ if(res.code == "ok") {
|
|
|
+ this.allConstructionStages = res.data;
|
|
|
+ }
|
|
|
+ }).catch(err=> {this.$toast.clear();});
|
|
|
+ },
|
|
|
getRecentlyProject(userId) {
|
|
|
this.$axios.post('/project/nearProject', {userId: userId})
|
|
|
.then(res => {
|
|
|
@@ -1246,7 +1284,7 @@ export default {
|
|
|
}).catch(err => { this.$toast.clear(); });
|
|
|
},
|
|
|
|
|
|
- fZr(item, index, flag = false) {
|
|
|
+ selectProject(item, index, flag = false) {
|
|
|
|
|
|
var domainItem = this.form.domains[this.clickIndex];
|
|
|
domainItem.projectId = item.id;
|
|
|
@@ -1295,10 +1333,7 @@ export default {
|
|
|
this.getProjectAuditorList(domainItem, index);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
- console.log(item, '数据')
|
|
|
if (this.user.timeType.customDegreeActive == 1 && item) {
|
|
|
var that = this
|
|
|
setTimeout(() => {
|
|
|
@@ -1309,11 +1344,17 @@ export default {
|
|
|
if (this.user.companyId == this.yuzhongCompId) {
|
|
|
this.updateResponse(domainItem);
|
|
|
}
|
|
|
- // 工单号,行号
|
|
|
- // const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
|
|
|
- // if((reportExtraField4Name || reportExtraField5Name) && !flag) {
|
|
|
- // this.getInfoByProjectId(item.projectCode)
|
|
|
- // }
|
|
|
+ //加载柘中施工分项工程
|
|
|
+ if (this.user.companyId == 4811 || this.user.companyId == 10) {
|
|
|
+ domainItem.constructionStagesStr = null;
|
|
|
+ if (curProject && curProject.plate1 && this.allConstructionStages.length > 0) {
|
|
|
+ domainItem.constructionStages = JSON.parse(JSON.stringify(this.allConstructionStages.filter(
|
|
|
+ stage => curProject.plate1.indexOf(stage.constructionType) != -1
|
|
|
+ )));
|
|
|
+ } else {
|
|
|
+ domainItem.constructionStages = [];
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
getInfoByProjectId(projectCode, index = null, flag = true) {
|
|
|
const { projectId, groupId = '' } = this.form.domains[this.clickIndex];
|
|
|
@@ -1981,12 +2022,14 @@ export default {
|
|
|
let array = [];
|
|
|
var abnormalTime = false;
|
|
|
for (var i in list) {
|
|
|
- if (this.user.companyId <= 10 || this.user.companyId == 8555) {
|
|
|
+ if (this.user.companyId == 8555) {
|
|
|
if (list[i].extraField1) {
|
|
|
abnormalTime = true;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
var projectName = list[i].projectName;
|
|
|
+
|
|
|
var flg = (list[i].isOvertime == 1);
|
|
|
for (var j in this.project) {
|
|
|
if (this.project[j].id == list[i].projectId) {
|
|
|
@@ -2000,11 +2043,12 @@ export default {
|
|
|
tname = filterList[0].taskName;
|
|
|
}
|
|
|
}
|
|
|
- let mmm = !t.customDegreeMultiple ? list[i].degreeId : (list[i].multiDegrIdList || [])
|
|
|
+ let isCustomDegreeMultiple = t.customDegreeMultiple;
|
|
|
+ let mmm = !isCustomDegreeMultiple ? list[i].degreeId : (list[i].multiDegrIdList || [])
|
|
|
let sss = list[i].degreeList || []
|
|
|
let radioPickDegree = ''
|
|
|
let wuduName = ''
|
|
|
- if(!t.customDegreeMultiple) {
|
|
|
+ if(!isCustomDegreeMultiple) {
|
|
|
for (var s in sss) {
|
|
|
if (sss[s].id == mmm) {
|
|
|
wuduName = sss[s].name
|
|
|
@@ -2035,17 +2079,53 @@ export default {
|
|
|
}
|
|
|
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 (this.user.companyId == this.yuzhongCompId) {
|
|
|
+ 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;
|
|
|
+ }
|
|
|
}
|
|
|
- if (list[i].extraField3) {
|
|
|
- list[i].extraField3Name = list[i].workContentList.find(w => w.id == list[i].extraField3).workContext;
|
|
|
+ } else if (this.user.companyId == 10 || this.user.companyId == 4811) {
|
|
|
+ if (targetP.length > 0 && this.allConstructionStages.length > 0) {
|
|
|
+ list[i].constructionStages = JSON.parse(JSON.stringify(this.allConstructionStages.filter(item=>targetP[0].plate1.indexOf(item.constructionType) > -1)));
|
|
|
+ //给完成数量赋值
|
|
|
+ var rpcList = list[i].projectConsStageList;
|
|
|
+ list[i].constructionStages.forEach(stage=>stage.finishNumber =
|
|
|
+ rpcList.find(rpc=>rpc.stageId == stage.id)?rpcList.find(rpc=>rpc.stageId == stage.id).finishNumber:0);
|
|
|
+ var constages = list[i].constructionStages;
|
|
|
+ var str = '';
|
|
|
+ for (var t=0;t<constages.length; t++) {
|
|
|
+ if (constages[t].finishNumber > 0) {
|
|
|
+ str += constages[t].name + '('+constages[t].finishNumber+ '), ';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (str.length > 0) {
|
|
|
+ str = str.substring(0, str.length-2);
|
|
|
+ }
|
|
|
+ list[i].constructionStagesStr = str;
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
+ // 处理 customText,解析出人员姓名
|
|
|
+ let customTextShow = '';
|
|
|
+ if (list[i].customText && list[i].customText !== '-') {
|
|
|
+ // customText 格式: id1-name1,id2-name2
|
|
|
+ const employees = list[i].customText.split(',');
|
|
|
+ const names = employees.map(emp => {
|
|
|
+ const parts = emp.split('-');
|
|
|
+ return parts.length > 1 ? parts[1] : '';
|
|
|
+ }).filter(name => name);
|
|
|
+ customTextShow = names.join(',');
|
|
|
+ }
|
|
|
+
|
|
|
let copyData = {
|
|
|
id: list[i].id,
|
|
|
projectId: list[i].projectId,
|
|
|
@@ -2070,7 +2150,7 @@ export default {
|
|
|
worktimeList: list[i].worktimeList,
|
|
|
wuduList: list[i].degreeList,
|
|
|
weiduName: wuduName,
|
|
|
- degreeId: !t.customDegreeMultiple ? list[i].degreeId : list[i].multiDegrIdList,
|
|
|
+ degreeId: !isCustomDegreeMultiple ? list[i].degreeId : list[i].multiDegrIdList,
|
|
|
radioPickDegree: radioPickDegree,
|
|
|
subProjectId: list[i].subProjectId,
|
|
|
subProjectName: subProjectName,
|
|
|
@@ -2084,6 +2164,7 @@ export default {
|
|
|
auditUserList: list[i].auditUserList,
|
|
|
overtimeHours: list[i].overtimeHours,
|
|
|
customText: list[i].customText,
|
|
|
+ customTextShow: customTextShow,
|
|
|
basecostId: list[i].basecostId,
|
|
|
basecostName: basecostName,
|
|
|
canEdit: list[i].state >= 2 ? true : false,
|
|
|
@@ -2093,6 +2174,8 @@ export default {
|
|
|
ccUserid: list[i].ccUserid ? list[i].ccUserid : { name: '', id: '' },
|
|
|
extraField1: list[i].extraField1,
|
|
|
extraField1Name: list[i].extraField1Name,
|
|
|
+ constructionStages: list[i].constructionStages,
|
|
|
+ extraField1Unit:list[i].extraField1Unit,
|
|
|
extraField2: list[i].extraField2,
|
|
|
extraField2Name: list[i].extraField2Name,
|
|
|
extraField3: list[i].extraField3,
|
|
|
@@ -2106,14 +2189,14 @@ export default {
|
|
|
serviceList: list[i].serviceList,
|
|
|
userReportDeptName: list[i].userReportDeptName,
|
|
|
reportTargetDeptId: list[i].deptId,
|
|
|
- auditWorkflow: list[i].auditWorkflow
|
|
|
+ auditWorkflow: list[i].auditWorkflow,
|
|
|
+ constructionStagesStr: list[i].constructionStagesStr
|
|
|
}
|
|
|
if (this.user.timeType.reportAuditType != 1 && this.user.timeType.reportAuditType != 2 && this.user.timeType.reportAuditType != 9) {
|
|
|
//分组负责人审核的情况下,前端不需要显示,无需设置
|
|
|
copyData.projectAuditorId = list[i].projectAuditorId;
|
|
|
copyData.projectAuditorName = list[i].projectAuditorName;
|
|
|
}
|
|
|
- console.log(copyData);
|
|
|
array.push(copyData);
|
|
|
if (list[i].state >= 2) {
|
|
|
this.canEdit = true;
|
|
|
@@ -2163,7 +2246,7 @@ export default {
|
|
|
multiWorktime: t.multiWorktime,
|
|
|
worktimeList: [{}],
|
|
|
canEdit: true,
|
|
|
-
|
|
|
+ constructionStages: [],
|
|
|
auditorFirst: { name: '', id: '' },
|
|
|
auditorSec: { name: '', id: '' },
|
|
|
auditorThird: { name: '', id: '' },
|
|
|
@@ -2199,13 +2282,12 @@ export default {
|
|
|
const { reportExtraField4Name, reportExtraField5Name } = this.user.timeType
|
|
|
for(let domainsIndex in this.form.domains) {
|
|
|
const projectItens = this.projectss.find(pro => pro.id == this.form.domains[domainsIndex].projectId) || {}
|
|
|
- this.fZr(projectItens, domainsIndex, true)
|
|
|
+ this.selectProject(projectItens, domainsIndex, true)
|
|
|
if(reportExtraField4Name || reportExtraField5Name) {
|
|
|
this.getInfoByProjectId(projectItens.projectCode, domainsIndex, false)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- console.log(this.form.domains, '<===== this.form.domains')
|
|
|
if (this.isWeekend && this.user.timeType.lockWorktime != 1) {
|
|
|
this.$set(this.form.domains[0], 'isOvertime', true)
|
|
|
if (t.type != 2 && t.type != 0) {
|
|
|
@@ -2257,8 +2339,9 @@ export default {
|
|
|
auditorFirst: { name: '', id: '' },
|
|
|
auditorSec: { name: '', id: '' },
|
|
|
auditorThird: { name: '', id: '' },
|
|
|
- ccUserid: { name: '', id: '' }
|
|
|
+ ccUserid: { name: '', id: '' },
|
|
|
}]
|
|
|
+ this.form.abnormalTime = false;
|
|
|
if (this.isWeekend && this.user.timeType.lockWorktime != 1) {
|
|
|
this.$set(this.form.domains[0], 'isOvertime', true)
|
|
|
if (t.type != 2 && t.type != 0) {
|
|
|
@@ -2306,6 +2389,29 @@ export default {
|
|
|
item.showPickerRole = true;
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
+ //点击选择施工分项工程
|
|
|
+ clickPickConstructionStage(i, item) {
|
|
|
+ if (!item.canEdit) return;
|
|
|
+ this.clickIndex = i;
|
|
|
+ item.showPickerConstruction = true;
|
|
|
+ this.$forceUpdate();
|
|
|
+ },
|
|
|
+ //施工分项工程显示
|
|
|
+ choseConstruction() {
|
|
|
+ this.form.domains[this.clickIndex].showPickerConstruction = false;
|
|
|
+ var list = this.form.domains[this.clickIndex].constructionStages;
|
|
|
+ var string = '';
|
|
|
+ for (var i=0;i<list.length; i++) {
|
|
|
+ if (list[i].finishNumber > 0) {
|
|
|
+ string += list[i].name + '('+list[i].finishNumber+ '), ';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (string.length > 0) {
|
|
|
+ string = string.substring(0, string.length-2);
|
|
|
+ }
|
|
|
+ this.form.domains[this.clickIndex].constructionStagesStr = string;
|
|
|
+ this.$forceUpdate();
|
|
|
+ },
|
|
|
|
|
|
//点击选择子项目
|
|
|
clickPickSubProject(i, item) {
|
|
|
@@ -2668,7 +2774,8 @@ export default {
|
|
|
multiWorktime: this.reportTimeType.multiWorktime,
|
|
|
worktimeList: [{}],
|
|
|
degreeId: null,
|
|
|
- canEdit: true
|
|
|
+ canEdit: true,
|
|
|
+ constructionStages: [],
|
|
|
}
|
|
|
if (this.isWeekend && this.user.timeType.lockWorktime != 1) {
|
|
|
this.$set(item, 'isOvertime', true)
|
|
|
@@ -2923,7 +3030,7 @@ export default {
|
|
|
}
|
|
|
//非代填情况下要校验考勤
|
|
|
if (!this.substitute) {
|
|
|
- if ((this.user.companyId <= 10 || this.user.companyId == 8555) && this.form.abnormalTime) {
|
|
|
+ if ((this.user.companyId == 8555) && this.form.abnormalTime) {
|
|
|
//异常上报情况,需要上传图片
|
|
|
var findImg = false;
|
|
|
for (var t=0;t<this.form.domains.length; t++) {
|
|
|
@@ -3006,7 +3113,9 @@ export default {
|
|
|
if(!customDegreeMultiple) { // 单选
|
|
|
formData.append("degreeId", this.form.domains[i].degreeId);
|
|
|
} else {
|
|
|
- let newDegreeId = Array.isArray(this.form.domains[i].degreeId) ? this.form.domains[i].degreeId : this.form.domains[i].degreeId.split(',')
|
|
|
+ // console.log('this.form.domains[i].degreeId', this.form.domains[i].degreeId);
|
|
|
+ let newDegreeId = Array.isArray(this.form.domains[i].degreeId) ? this.form.domains[i].degreeId: this.form.domains[i].degreeId.split(',');
|
|
|
+ // let newDegreeId = this.form[formIndex].domains[i].degreeId.split(',')
|
|
|
formData.append("multiDegrId", JSON.stringify(newDegreeId).replace(/,/g, '@'))
|
|
|
}
|
|
|
} else {
|
|
|
@@ -3178,7 +3287,10 @@ export default {
|
|
|
//有项目审核节点,但是没有选中项目审核人,需要提示
|
|
|
this.$toast.fail("请指定[" + this.form.domains[i].projectName + ']项目的审核人');
|
|
|
return;
|
|
|
- }
|
|
|
+ } else {
|
|
|
+ //没有项目审核节点,也没有设置审核人,需要对齐数组,传一个null过去
|
|
|
+ formData.append("projectAuditorId", null);
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
//无审批流
|
|
|
@@ -3211,6 +3323,10 @@ export default {
|
|
|
formData.append('extraField2', this.form.domains[i].extraField2);
|
|
|
formData.append('extraField3', this.form.domains[i].extraField3);
|
|
|
}
|
|
|
+ if (this.user.companyId == 10 || this.user.companyId == 4811 ) {
|
|
|
+ let constructionStagesStr = JSON.stringify(this.form.domains[i].constructionStages).replace(/,/g,"@");
|
|
|
+ formData.append('constructionStagesStr', constructionStagesStr);
|
|
|
+ }
|
|
|
if (this.user.companyId == 3092) {
|
|
|
formData.append('sapServiceId', this.form.domains[i].sapServiceId);
|
|
|
}
|
|
|
@@ -3234,7 +3350,7 @@ export default {
|
|
|
formData.append('extraField5', this.form.domains[i].extraField5 || '');
|
|
|
}
|
|
|
//羲合超导的异常工时上报
|
|
|
- if (this.user.companyId <= 10 || this.user.companyId == 8555) {
|
|
|
+ if (this.user.companyId == 8555) {
|
|
|
formData.append("abnormalTime", this.form.abnormalTime);
|
|
|
}
|
|
|
}
|
|
|
@@ -3345,6 +3461,160 @@ export default {
|
|
|
this.$toast.fail('获取失败:'+res.msg);
|
|
|
}
|
|
|
}).catch(err=> {this.$toast.clear();});
|
|
|
+ },
|
|
|
+
|
|
|
+ // 显示人员选择器
|
|
|
+ showEmployeeSelector(index, item) {
|
|
|
+ if (!item.canEdit) return;
|
|
|
+
|
|
|
+ this.employeeSelector.currentIndex = index;
|
|
|
+ this.employeeSelector.selectedEmployees = [];
|
|
|
+
|
|
|
+ // 如果已有选中的人员,解析并预设选中状态
|
|
|
+ if (item.customText) {
|
|
|
+ const existingIds = item.customText.split(',').map(emp => {
|
|
|
+ const parts = emp.split('-');
|
|
|
+ return parts[0];
|
|
|
+ });
|
|
|
+ this.employeeSelector.selectedEmployees = existingIds;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 调用接口获取分组人员
|
|
|
+ const toast = this.$toast.loading({
|
|
|
+ forbidClick: true,
|
|
|
+ duration: 0,
|
|
|
+ message: '加载中...'
|
|
|
+ });
|
|
|
+
|
|
|
+ this.$axios.post('/employee/listByGroup', {
|
|
|
+ companyId: this.user.companyId
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ this.$toast.clear();
|
|
|
+ if (res.code == 'ok') {
|
|
|
+ // 处理返回的数据,添加选中状态
|
|
|
+ this.employeeSelector.groupList = (res.data || []).map(group => {
|
|
|
+ return {
|
|
|
+ ...group,
|
|
|
+ checked: false,
|
|
|
+ indeterminate: false,
|
|
|
+ employeeList: (group.employeeList || []).map(emp => {
|
|
|
+ return {
|
|
|
+ ...emp,
|
|
|
+ checked: this.employeeSelector.selectedEmployees.includes(String(emp.id))
|
|
|
+ };
|
|
|
+ })
|
|
|
+ };
|
|
|
+ });
|
|
|
+
|
|
|
+ // 更新分组的选中状态
|
|
|
+ this.updateGroupCheckStatus();
|
|
|
+
|
|
|
+ this.employeeSelector.show = true;
|
|
|
+ } else {
|
|
|
+ this.$toast.fail('获取人员列表失败: ' + res.msg);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ this.$toast.clear();
|
|
|
+ this.$toast.fail('获取人员列表失败');
|
|
|
+ console.error(err);
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 更新分组的选中状态
|
|
|
+ updateGroupCheckStatus() {
|
|
|
+ this.employeeSelector.groupList.forEach(group => {
|
|
|
+ const checkedCount = group.employeeList.filter(emp => emp.checked).length;
|
|
|
+ const totalCount = group.employeeList.length;
|
|
|
+
|
|
|
+ if (checkedCount === 0) {
|
|
|
+ group.checked = false;
|
|
|
+ group.indeterminate = false;
|
|
|
+ } else if (checkedCount === totalCount) {
|
|
|
+ group.checked = true;
|
|
|
+ group.indeterminate = false;
|
|
|
+ } else {
|
|
|
+ group.checked = false;
|
|
|
+ group.indeterminate = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 切换分组选中状态
|
|
|
+ toggleGroupCheck(group) {
|
|
|
+ const newCheckedState = !group.checked;
|
|
|
+ group.checked = newCheckedState;
|
|
|
+ group.indeterminate = false;
|
|
|
+
|
|
|
+ // 同步更新该分组下所有人员的选中状态
|
|
|
+ group.employeeList.forEach(emp => {
|
|
|
+ emp.checked = newCheckedState;
|
|
|
+ });
|
|
|
+
|
|
|
+ this.$forceUpdate();
|
|
|
+ },
|
|
|
+
|
|
|
+ // 分组复选框变化事件
|
|
|
+ onGroupCheckChange(group) {
|
|
|
+ // 当分组复选框状态改变时,同步更新所有子人员
|
|
|
+ group.indeterminate = false;
|
|
|
+ group.employeeList.forEach(emp => {
|
|
|
+ emp.checked = group.checked;
|
|
|
+ });
|
|
|
+ this.$forceUpdate();
|
|
|
+ },
|
|
|
+
|
|
|
+ // 切换人员选中状态
|
|
|
+ toggleEmployeeCheck(employee, group) {
|
|
|
+ employee.checked = !employee.checked;
|
|
|
+ this.updateGroupCheckStatus();
|
|
|
+ this.$forceUpdate();
|
|
|
+ },
|
|
|
+
|
|
|
+ // 人员复选框变化事件
|
|
|
+ onEmployeeCheckChange(employee, group) {
|
|
|
+ this.updateGroupCheckStatus();
|
|
|
+ this.$forceUpdate();
|
|
|
+ },
|
|
|
+
|
|
|
+ // 确认选择人员
|
|
|
+ confirmEmployeeSelection() {
|
|
|
+ const selectedEmployees = [];
|
|
|
+
|
|
|
+ // 收集所有选中的人员
|
|
|
+ this.employeeSelector.groupList.forEach(group => {
|
|
|
+ group.employeeList.forEach(emp => {
|
|
|
+ if (emp.checked) {
|
|
|
+ selectedEmployees.push({
|
|
|
+ id: emp.id,
|
|
|
+ name: emp.name
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ if (selectedEmployees.length === 0) {
|
|
|
+ this.$toast.fail('请至少选择一名人员');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 格式化数据:id-name,多个用中文逗号隔开
|
|
|
+ const customText = selectedEmployees.map(emp => `${emp.id}-${emp.name}`).join(',');
|
|
|
+ const customTextShow = selectedEmployees.map(emp => emp.name).join(',');
|
|
|
+
|
|
|
+ // 更新表单数据
|
|
|
+ this.form.domains[this.employeeSelector.currentIndex].customText = customText;
|
|
|
+ this.form.domains[this.employeeSelector.currentIndex].customTextShow = customTextShow;
|
|
|
+ this.form.domains[this.employeeSelector.currentIndex].customData = selectedEmployees.length;
|
|
|
+ // 关闭弹窗
|
|
|
+ this.employeeSelector.show = false;
|
|
|
+ this.$forceUpdate();
|
|
|
+ },
|
|
|
+
|
|
|
+ // 取消选择人员
|
|
|
+ cancelEmployeeSelection() {
|
|
|
+ this.employeeSelector.show = false;
|
|
|
}
|
|
|
},
|
|
|
|
|
|
@@ -3425,6 +3695,9 @@ export default {
|
|
|
// this.determineQrcode(0)
|
|
|
}, 1000)
|
|
|
}
|
|
|
+ if (this.user.companyId == 10 || this.user.companyId == 4811) {
|
|
|
+ this.getConstructionStageList();
|
|
|
+ }
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
localStorage.removeItem('formVal')
|
|
|
@@ -3604,6 +3877,89 @@ export default {
|
|
|
.van-checkbox__label--disabled {
|
|
|
color: #c8c9cc !important;
|
|
|
}
|
|
|
+
|
|
|
+/* 人员选择器样式 */
|
|
|
+.employeeSelectorPopup {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ height: 100%;
|
|
|
+ background: #f7f8fa;
|
|
|
+}
|
|
|
+
|
|
|
+.employeeSelectorHeader {
|
|
|
+ padding: 16px;
|
|
|
+ background: #fff;
|
|
|
+ border-bottom: 1px solid #ebedf0;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+
|
|
|
+.employeeSelectorTitle {
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #323233;
|
|
|
+}
|
|
|
+
|
|
|
+.employeeSelectorContent {
|
|
|
+ flex: 1;
|
|
|
+ overflow-y: auto;
|
|
|
+ padding: 8px 0;
|
|
|
+}
|
|
|
+
|
|
|
+.employeeGroup {
|
|
|
+ margin-bottom: 8px;
|
|
|
+ background: #fff;
|
|
|
+}
|
|
|
+
|
|
|
+.employeeGroupHeader {
|
|
|
+ padding: 12px 16px;
|
|
|
+ background: #f7f8fa;
|
|
|
+ border-bottom: 1px solid #ebedf0;
|
|
|
+}
|
|
|
+
|
|
|
+.groupName {
|
|
|
+ font-size: 15px;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #323233;
|
|
|
+ margin-right: 4px;
|
|
|
+}
|
|
|
+
|
|
|
+.groupCount {
|
|
|
+ font-size: 13px;
|
|
|
+ color: #969799;
|
|
|
+}
|
|
|
+
|
|
|
+.employeeList {
|
|
|
+ background: #fff;
|
|
|
+}
|
|
|
+
|
|
|
+.employeeItem {
|
|
|
+ padding: 12px 16px;
|
|
|
+ border-bottom: 1px solid #ebedf0;
|
|
|
+}
|
|
|
+
|
|
|
+.employeeItem:last-child {
|
|
|
+ border-bottom: none;
|
|
|
+}
|
|
|
+
|
|
|
+.employeeSelectorFooter {
|
|
|
+ display: flex;
|
|
|
+ padding: 10px 16px;
|
|
|
+ background: #fff;
|
|
|
+ border-top: 1px solid #ebedf0;
|
|
|
+}
|
|
|
+
|
|
|
+.employeeSelectorBtn {
|
|
|
+ flex: 1;
|
|
|
+ margin: 0 4px;
|
|
|
+}
|
|
|
+
|
|
|
+.employeeSelectorBtn:first-child {
|
|
|
+ margin-left: 0;
|
|
|
+}
|
|
|
+
|
|
|
+.employeeSelectorBtn:last-child {
|
|
|
+ margin-right: 0;
|
|
|
+}
|
|
|
</style>
|
|
|
|
|
|
|