|
|
@@ -388,6 +388,14 @@
|
|
|
<!-- 填写日报的dialog -->
|
|
|
<el-dialog :title="isSubstitude?$t('textLink.helpToFillIn'):editTitle[isBatch]" :visible.sync="dialogVisible" width="60%" :close-on-click-modal="false" @closed="guanbi()" :top="'5.5vh'" custom-class="editReportDialog" ref="editReportDialog">
|
|
|
<div style="height: 65vh;overflow: auto;">
|
|
|
+ <div style="margin:0 120px 10px 120px;position:relative;" v-if="user.company.enableAi && this.workForm.domains.filter(item=>!item.canEdit).length == 0 && !isSubstitude && !isBatch">
|
|
|
+ <div style="display:flex;align-items:flex-start;gap:10px;">
|
|
|
+ <el-input v-model="userInputMsg" type="textarea" :rows="2" placeholder="样例:今天/昨天/本周三... 我在[A项目]上投入3小时,做了产品的需求分析;在[B项目]上投入5小时,进行技术文档编写。(按Ctrl+Enter快速提交) 当前免费体验" clearable
|
|
|
+ style="flex:1;" @keydown.native="handleAIInputKeydown"></el-input>
|
|
|
+ <el-button size="mini" type="primary" icon="el-icon-magic-stick" class="ai-parse-btn" @click="handleAIParse" :loading="aiParsing">AI解析</el-button>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top:5px;"><el-tag size="mini" effect="plain" v-for="word in quickWords" @click="fillWord(word)">{{ word }}</el-tag></div>
|
|
|
+ </div>
|
|
|
<el-form ref="workForm" :model="workForm" :rules="workRules" label-width="120px">
|
|
|
<el-form-item :label="$t('screening.selectPeople')" v-if="isSubstitude">
|
|
|
<el-input v-if="user.userNameNeedTranslate != 1" @focus="showChooseMembTree" v-model="workForm.userNames"
|
|
|
@@ -755,13 +763,21 @@
|
|
|
</el-form-item>
|
|
|
|
|
|
<!-- 相关数值 -->
|
|
|
- <el-form-item :label="yonghuUser.customDataName" v-if="yonghuUser.customDataActive == 1" :prop="'domains.' + index + '.customData'" :rules="user.timeType.customDataStatus == 1 ? { type: 'number', required: true, message: $t('defaultText.pleaseFillOut') + yonghuUser.customDataName, trigger: ['change','blur'] } : null">
|
|
|
+ <el-form-item :label="yonghuUser.customDataName" v-if="yonghuUser.customDataActive == 1 && !(user.companyId == 4811)" :prop="'domains.' + index + '.customData'" :rules="user.timeType.customDataStatus == 1 ? { type: 'number', required: true, message: $t('defaultText.pleaseFillOut') + yonghuUser.customDataName, trigger: ['change','blur'] } : null">
|
|
|
<el-input-number :id="'numberData_'+index" :disabled="!domain.canEdit" v-model="domain.customData" style="width:200px;" @keyup.native="restrictNumber('numberData_'+index)" :max="user.timeType.customDataMaxStatus == 1 ? user.timeType.customDataMaxValue : 'infinity'"></el-input-number>
|
|
|
</el-form-item>
|
|
|
<!-- 自定义文本 -->
|
|
|
- <el-form-item :label="yonghuUser.customTextName" v-if="yonghuUser.customTextActive == 1" :prop="'domains.' + index + '.customText'" :rules="user.timeType.customTextStatus == 1 ? { required: true, message: $t('defaultText.pleaseFillOut') + yonghuUser.customTextName, trigger: ['change','blur'] } : null">
|
|
|
+ <el-form-item :label="yonghuUser.customTextName" v-if="yonghuUser.customTextActive == 1 && user.companyId != 4811" :prop="'domains.' + index + '.customText'" :rules="user.timeType.customTextStatus == 1 ? { required: true, message: $t('defaultText.pleaseFillOut') + yonghuUser.customTextName, trigger: ['change','blur'] } : null">
|
|
|
<el-input :disabled="!domain.canEdit" v-model="domain.customText" type="textarea" :rows="1" style="width:75%;margin-right:7%" maxlength="1000" show-word-limit></el-input>
|
|
|
</el-form-item>
|
|
|
+ <!-- 额外人员的选择, 目前针对柘中开放-->
|
|
|
+ <el-form-item label="人员" v-if="user.companyId == 4811" :prop="'domains.' + index + '.customText'" rules="{ required: true, message: '请选择人员', trigger: ['change','blur'] }">
|
|
|
+ <el-input :disabled="!domain.canEdit" v-model="domain.customTextShow" style="width:75%;margin-right:7%" @click.native="showEmployeeSelector(index)" readonly placeholder="请选择人员"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <!-- 针对柘中,相关数值放到额外人员的下面-->
|
|
|
+ <el-form-item :label="yonghuUser.customDataName" v-if="yonghuUser.customDataActive == 1 && (user.companyId == 4811)" :prop="'domains.' + index + '.customData'" :rules="user.timeType.customDataStatus == 1 ? { type: 'number', required: true, message: $t('defaultText.pleaseFillOut') + yonghuUser.customDataName, trigger: ['change','blur'] } : null">
|
|
|
+ {{domain.customData}}
|
|
|
+ </el-form-item>
|
|
|
<!--按比例填报-->
|
|
|
<el-form-item v-if="reportTimeType.type == 3" :label="$t('lable.percentageOfTime')" :prop="'domains.' + index + '.'+timeFields[reportTimeType.type]"
|
|
|
:rules="{ required: true, message: $t('defaultText.pleaseSetTheTimeRatio'), trigger: 'blur' }">
|
|
|
@@ -1311,15 +1327,24 @@
|
|
|
</el-select>
|
|
|
</div>
|
|
|
<!-- 自定义数值 -->
|
|
|
- <div class="zhoFel" v-if="user.timeType.customDataActive">
|
|
|
+ <div class="zhoFel" v-if="user.timeType.customDataActive && !(user.companyId == 4811)">
|
|
|
<p>{{user.timeType.customDataName}}</p>
|
|
|
<el-input-number :id="'weekData_num'" v-model="zhoBao.customData" style="width:200px;margin-right:155px;" @keyup.native="restrictNumber('weekData_num')" :max="user.timeType.customDataMaxStatus == 1 ? user.timeType.customDataMaxValue : 'infinity'"></el-input-number>
|
|
|
</div>
|
|
|
<!-- 自定义文本 -->
|
|
|
- <div class="zhoFel" v-if="user.timeType.customTextActive == 1">
|
|
|
+ <div class="zhoFel" v-if="user.timeType.customTextActive == 1 && user.companyId != 4811">
|
|
|
<p>{{user.timeType.customTextName}}</p>
|
|
|
<el-input v-model="zhoBao.customText" type="textarea" :rows="1" style="width:355px;" maxlength="1000" show-word-limit></el-input>
|
|
|
</div>
|
|
|
+ <!-- 额外人员的选择, 目前针对柘中开放-->
|
|
|
+ <div class="zhoFel" v-if="user.companyId == 4811">
|
|
|
+ <p>人员</p>
|
|
|
+ <el-input v-model="zhoBao.customTextShow" style="width:355px;" @click.native="showEmployeeSelector('zhoBao')" readonly placeholder="请选择人员"></el-input>
|
|
|
+ </div>
|
|
|
+ <!-- 针对柘中,相关数值放到额外人员的下面-->
|
|
|
+ <div class="zhoFel" v-if="user.timeType.customDataActive && (user.companyId == 4811)">
|
|
|
+ <p>{{user.timeType.customDataName}}</p>{{zhoBao.customData}}
|
|
|
+ </div>
|
|
|
<!-- 选择任务 -->
|
|
|
<div class="zhoFel" v-if="user.company.packageProject==1 && !user.timeType.hideTask && user.company.nonProjectSimple==0">
|
|
|
<p>{{ $t('renWuLiChengBei') }}</p>
|
|
|
@@ -2146,7 +2171,7 @@
|
|
|
<el-alert style="position:absolute;bottom:0;z-index:10;" v-if="isMore" :title="$t('message.noMoreData')" type="warning" center show-icon></el-alert>
|
|
|
|
|
|
<!-- <div slot="title" class="dialog-title selectworktime_title">
|
|
|
- <label style="font-size: 16px">员工每日已填报工时数</label>
|
|
|
+ <label style="font-size: 16px">人员每日已填报工时数</label>
|
|
|
<el-link
|
|
|
type="primary"
|
|
|
style="float: right; margin-right: 60px"
|
|
|
@@ -2561,6 +2586,30 @@
|
|
|
</el-dialog>
|
|
|
<!-- 威派格定制 -->
|
|
|
<TransferWorkingHours v-model="transferWorkingHoursVisable" :projectList="projectList" :userList="usersList"></TransferWorkingHours>
|
|
|
+
|
|
|
+ <!-- 人员选择弹窗 -->
|
|
|
+ <el-dialog title="选择人员" :visible.sync="employeeSelectDialog" width="600px" :close-on-click-modal="false">
|
|
|
+ <div style="height:500px;overflow:auto;">
|
|
|
+ <el-tree
|
|
|
+ ref="employeeTree"
|
|
|
+ :data="employeeGroupList"
|
|
|
+ show-checkbox
|
|
|
+ node-key="treeNodeKey"
|
|
|
+ :props="{children: 'employeeList', label: 'groupName'}"
|
|
|
+ @check-change="handleEmployeeCheckChange"
|
|
|
+ :default-checked-keys="getDefaultCheckedKeys()"
|
|
|
+ v-loading="employeeGroupLoading">
|
|
|
+ <span class="custom-tree-node" slot-scope="{ node, data }">
|
|
|
+ <span>{{ data.groupName || data.name }}</span>
|
|
|
+ <span v-if="data.employeeList" style="color:#999;font-size:12px;margin-left:5px;">({{ data.employeeList.length }}人)</span>
|
|
|
+ </span>
|
|
|
+ </el-tree>
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="employeeSelectDialog = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="confirmEmployeeSelection">确定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</section>
|
|
|
</template>
|
|
|
|
|
|
@@ -2599,6 +2648,7 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ quickWords: [],//用于AI解析快速输入的历史日报填报关键字
|
|
|
remindering: false,
|
|
|
onlyHaveAttendance: false,
|
|
|
notFullData:[],
|
|
|
@@ -2852,7 +2902,8 @@
|
|
|
isPass: true,
|
|
|
monthWorkData: [],
|
|
|
monthNotWorkDate: [],
|
|
|
-
|
|
|
+ userInputMsg:null,
|
|
|
+ aiParsing: false,
|
|
|
monthWorkDataS1: [],
|
|
|
monthnotTotal: 0,
|
|
|
monthnotTotalPage: 0,
|
|
|
@@ -2947,7 +2998,14 @@
|
|
|
customConfigurationRow: {
|
|
|
subUserCustomList: []
|
|
|
},
|
|
|
- missingCardTimeUserListData: []
|
|
|
+ missingCardTimeUserListData: [],
|
|
|
+
|
|
|
+ // 人员选择弹窗相关数据
|
|
|
+ employeeSelectDialog: false,
|
|
|
+ employeeGroupList: [],
|
|
|
+ selectedEmployees: [],
|
|
|
+ employeeGroupLoading: false,
|
|
|
+ currentDomainIndex: 0,
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -6954,6 +7012,73 @@
|
|
|
});
|
|
|
|
|
|
},
|
|
|
+ handleAIInputKeydown(event) {
|
|
|
+ // 监听Ctrl+Enter组合键
|
|
|
+ if (event.ctrlKey && event.keyCode === 13) {
|
|
|
+ event.preventDefault();
|
|
|
+ this.handleAIParse();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleAIParse() {
|
|
|
+ if (!this.userInputMsg || this.userInputMsg.trim() === '') {
|
|
|
+ this.$message({
|
|
|
+ message: '请输入工作描述',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.aiParsing = true;
|
|
|
+ this.http.post('/ai/parseWorkTime', {
|
|
|
+ content: this.userInputMsg,
|
|
|
+ timeType: this.user.timeType.type
|
|
|
+ }, res => {
|
|
|
+ this.aiParsing = false;
|
|
|
+ if (res.code == "ok") {
|
|
|
+ var aiResultMap = res.data;
|
|
|
+ this.workForm.createDate = aiResultMap.createDate;
|
|
|
+ this.workForm.totalDuration = aiResultMap.totalDuration;
|
|
|
+ this.workForm.domains = [];//先清空
|
|
|
+ var reports = aiResultMap.reports;
|
|
|
+ for (var i=0;i<reports.length; i++) {
|
|
|
+ this.workForm.domains.push(
|
|
|
+ {id: null,
|
|
|
+ projectId: reports[i].projectId,
|
|
|
+ workingTime: reports[i].workingTime,
|
|
|
+ overtimeHours: reports[i].overtimeHours,
|
|
|
+ content: reports[i].content,
|
|
|
+ progress:100,
|
|
|
+ state: 2,
|
|
|
+ timeType:0,
|
|
|
+ multiWorktime: this.reportTimeType.multiWorktime,
|
|
|
+ worktimeList:[{}],
|
|
|
+ canEdit: true,
|
|
|
+ auditorFirst: '',
|
|
|
+ auditorSec: '',
|
|
|
+ auditorThird: '',
|
|
|
+ startTime: reports[i].startTime,
|
|
|
+ endTime: reports[i].endTime,
|
|
|
+ ccUserid: ''}
|
|
|
+ );
|
|
|
+ if (reports[i].overtimeHours > 0) {
|
|
|
+ this.$set(this.workForm.domains[i],'isOvertime', true);
|
|
|
+ }
|
|
|
+ this.selectProject(this.workForm.domains[i],i);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg || 'AI解析失败',
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }, err => {
|
|
|
+ this.aiParsing = false;
|
|
|
+ this.$message({
|
|
|
+ message: err || 'AI解析失败',
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
getAIReport(createDate) {
|
|
|
this.http.post('/report/getAIReport', {},
|
|
|
res => {
|
|
|
@@ -7007,6 +7132,8 @@
|
|
|
projectAuditorName: aiReportData[i].projectAuditorName,
|
|
|
overtimeHours: aiReportData[i].overtimeHours,
|
|
|
customText: aiReportData[i].customText,
|
|
|
+ customTextShow: (this.user.companyId == 4811) && aiReportData[i].customText && aiReportData[i].customText !== '-' ? aiReportData[i].customText.split(/[,,]/).map(item => { let parts = item.split('-'); return parts.length > 1 ? parts[1] : item; }).join(',') : (aiReportData[i].customText === '-' ? '' : aiReportData[i].customText),
|
|
|
+ selectedEmployees: (this.user.companyId == 4811) && aiReportData[i].customText && aiReportData[i].customText !== '-' ? aiReportData[i].customText.split(/[,,]/).map(item => { let parts = item.split('-'); return parts.length > 1 ? { id: parseInt(parts[0]), name: parts[1] } : { id: null, name: item }; }).filter(emp => emp.id !== null && !isNaN(emp.id)) : [],
|
|
|
basecostId: aiReportData[i].basecostId,
|
|
|
auditorFirst: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorFirst ? aiReportData[i].auditorSetting.auditorFirst : '',
|
|
|
auditorSec: aiReportData[i].auditorSetting && aiReportData[i].auditorSetting.auditorSec ? aiReportData[i].auditorSetting.auditorSec : '',
|
|
|
@@ -7038,6 +7165,24 @@
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
+ //获取最近填写的日报的关键字,用于AI解析的快速输入
|
|
|
+ getUserRecentReportWords() {
|
|
|
+ this.http.post('/user-recent-report/getRecentReportWords', {},
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.quickWords = res.data;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ fillWord(word) {
|
|
|
+ this.userInputMsg = this.userInputMsg?this.userInputMsg + word + ',':word + ',';
|
|
|
+ },
|
|
|
// 获取个人某天的日报 111111
|
|
|
getReport() {
|
|
|
this.http.post( this.port.report.getPort, {
|
|
|
@@ -7115,6 +7260,8 @@
|
|
|
auditUserList: list.report[i].auditUserList,
|
|
|
overtimeHours: list.report[i].overtimeHours,
|
|
|
customText: list.report[i].customText,
|
|
|
+ customTextShow: (this.user.companyId == 4811) && list.report[i].customText && list.report[i].customText !== '-' ? list.report[i].customText.split(/[,,]/).map(item => { let parts = item.split('-'); return parts.length > 1 ? parts[1] : item; }).join(',') : (list.report[i].customText === '-' ? '' : list.report[i].customText),
|
|
|
+ selectedEmployees: (this.user.companyId == 4811) && list.report[i].customText && list.report[i].customText !== '-' ? list.report[i].customText.split(/[,,]/).map(item => { let parts = item.split('-'); return parts.length > 1 ? { id: parseInt(parts[0]), name: parts[1] } : { id: null, name: item }; }).filter(emp => emp.id !== null && !isNaN(emp.id)) : [],
|
|
|
basecostId: list.report[i].basecostId,
|
|
|
auditorFirst: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorFirst ? list.report[i].auditorSetting.auditorFirst : '',
|
|
|
auditorSec: list.report[i].auditorSetting && list.report[i].auditorSetting.auditorSec ? list.report[i].auditorSetting.auditorSec : '',
|
|
|
@@ -7247,10 +7394,10 @@
|
|
|
}
|
|
|
}
|
|
|
if(this.user.timeType.type == 1) {
|
|
|
- var shuzhi = this.user.timeType.allday + ''
|
|
|
- // console.log('执行一次', shuzhi.indexOf('.'))
|
|
|
- this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
|
|
|
- }
|
|
|
+ var shuzhi = this.user.timeType.allday + ''
|
|
|
+ // console.log('执行一次', shuzhi.indexOf('.'))
|
|
|
+ this.workForm.domains[0].workingTime = shuzhi.indexOf('.') == '-1' ? shuzhi + '.0' : shuzhi
|
|
|
+ }
|
|
|
if (this.timeBasecostList && this.timeBasecostList.length > 0) {
|
|
|
//默认给第一个,必填字段
|
|
|
this.workForm.domains[0].basecostId = this.timeBasecostList[0].id;
|
|
|
@@ -7354,6 +7501,9 @@
|
|
|
this.seleChn();
|
|
|
}
|
|
|
this.dialogVisible = true;
|
|
|
+ if (this.user.company.enableAi && i == -1 && !isBatch) {
|
|
|
+ this.getUserRecentReportWords();
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
//按周填报的弹窗口中编辑单项目相关数据
|
|
|
@@ -7657,7 +7807,7 @@
|
|
|
if(this.user.timeType.customDataStatus == 1 && !this.zhoBao.customData){
|
|
|
errtips += this.user.timeType.customDataName + '、'
|
|
|
}
|
|
|
- if(this.user.timeType.customTextStatus == 1 && !this.zhoBao.customText){
|
|
|
+ if(this.user.timeType.customTextStatus == 1 && (!this.zhoBao.customText || this.zhoBao.customText === '-')){
|
|
|
errtips += this.user.timeType.customTextName + '、'
|
|
|
}
|
|
|
if(!this.user.timeType.hideContent && this.user.timeType.workContentState == 1 && !this.zhoBao.content){
|
|
|
@@ -8403,11 +8553,11 @@
|
|
|
}else if(this.user.timeType.customDataActive){
|
|
|
formData.append('customData',0)
|
|
|
}
|
|
|
- if(this.user.timeType.customTextActive && zhoD[j].customText){
|
|
|
- formData.append('customText',zhoD[j].customText)
|
|
|
- }else if(this.user.timeType.customTextActive){
|
|
|
- formData.append('customText','-')
|
|
|
- }
|
|
|
+ if(this.user.timeType.customTextActive && zhoD[j].customText && zhoD[j].customText.trim() !== ''){
|
|
|
+ formData.append('customText',zhoD[j].customText)
|
|
|
+ }else if(this.user.timeType.customTextActive){
|
|
|
+ formData.append('customText','-')
|
|
|
+ }
|
|
|
|
|
|
if(reportExtraField4Name || reportExtraField5Name) {
|
|
|
formData.append('extraField4', zhoD[j].extraField4 || '')
|
|
|
@@ -8501,11 +8651,11 @@
|
|
|
}else if(this.user.timeType.customDataActive){
|
|
|
formData.append('customData',0)
|
|
|
}
|
|
|
- if(this.user.timeType.customTextActive && zhoD[j].customText){
|
|
|
- formData.append('customText',zhoD[j].customText)
|
|
|
- }else if(this.user.timeType.customTextActive){
|
|
|
- formData.append('customText','-')
|
|
|
- }
|
|
|
+ if(this.user.timeType.customTextActive && zhoD[j].customText && zhoD[j].customText.trim() !== ''){
|
|
|
+ formData.append('customText',zhoD[j].customText)
|
|
|
+ }else if(this.user.timeType.customTextActive){
|
|
|
+ formData.append('customText','-')
|
|
|
+ }
|
|
|
|
|
|
if(reportExtraField4Name || reportExtraField5Name) {
|
|
|
formData.append('extraField4', zhoD[j].extraField4 || '')
|
|
|
@@ -8601,7 +8751,7 @@
|
|
|
}else if(this.user.timeType.customDataActive){
|
|
|
formData.append('customData',0)
|
|
|
}
|
|
|
- if(this.user.timeType.customTextActive && zhoD[j].customText){
|
|
|
+ if(this.user.timeType.customTextActive && zhoD[j].customText && zhoD[j].customText.trim() !== ''){
|
|
|
formData.append('customText',zhoD[j].customText)
|
|
|
}else if(this.user.timeType.customTextActive){
|
|
|
formData.append('customText','-')
|
|
|
@@ -9307,7 +9457,7 @@
|
|
|
} else {
|
|
|
formData.append("customData", 0);
|
|
|
}
|
|
|
- if(this.workForm.domains[i].customText) {
|
|
|
+ if(this.workForm.domains[i].customText && this.workForm.domains[i].customText.trim() !== '') {
|
|
|
formData.append("customText", this.workForm.domains[i].customText);
|
|
|
} else {
|
|
|
formData.append("customText", '-');
|
|
|
@@ -10099,6 +10249,113 @@
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ // 员工选择相关方法
|
|
|
+ showEmployeeSelector(index) {
|
|
|
+ this.currentDomainIndex = index;
|
|
|
+ this.employeeSelectDialog = true;
|
|
|
+ if (this.employeeGroupList.length === 0) {
|
|
|
+ this.getEmployeeGroupList();
|
|
|
+ } else {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ var keys = this.getDefaultCheckedKeys();
|
|
|
+ console.log(keys);
|
|
|
+ this.$refs.employeeTree.setCheckedKeys(keys);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getEmployeeGroupList() {
|
|
|
+ this.employeeGroupLoading = true;
|
|
|
+ this.http.post('/employee/listByGroup', {
|
|
|
+ companyId: this.user.companyId
|
|
|
+ }, res => {
|
|
|
+ this.employeeGroupLoading = false;
|
|
|
+ if (res.code === "ok") {
|
|
|
+ this.employeeGroupList = res.data || [];
|
|
|
+ // 为每个节点添加唯一的treeNodeKey(核心逻辑)
|
|
|
+ this.employeeGroupList.forEach(group => {
|
|
|
+ // 分组的唯一key:前缀+原始ID
|
|
|
+ group.treeNodeKey = `group_${group.id}`;
|
|
|
+ // 人员的唯一key:前缀+原始ID(原始id保留不变)
|
|
|
+ if (group.employeeList && group.employeeList.length) {
|
|
|
+ group.employeeList.forEach(emp => {
|
|
|
+ emp.treeNodeKey = emp.id; // 仅新增字段,不修改emp.id
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.employeeTree.setCheckedKeys(this.getDefaultCheckedKeys());
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }, error => {
|
|
|
+ this.employeeGroupLoading = false;
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleEmployeeCheckChange() {
|
|
|
+ const checkedNodes = this.$refs.employeeTree.getCheckedNodes(true);
|
|
|
+ // 树的第二层才是人员,employeeList 是第一层(分组)的属性
|
|
|
+ this.selectedEmployees = checkedNodes.filter(node => !node.employeeList);
|
|
|
+ },
|
|
|
+ getDefaultCheckedKeys() {
|
|
|
+ if (this.currentDomainIndex == 'zhoBao') {
|
|
|
+ if (this.zhoBao.selectedEmployees) {
|
|
|
+ return this.zhoBao.selectedEmployees.map(emp => emp.id);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ const domain = this.workForm.domains[this.currentDomainIndex];
|
|
|
+ if (domain && domain.selectedEmployees) {
|
|
|
+ return domain.selectedEmployees.map(emp => emp.id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return [];
|
|
|
+ },
|
|
|
+ confirmEmployeeSelection() {
|
|
|
+ // 将选中的人员名字拼接成字符串,回显到输入框
|
|
|
+ const employeeNames = this.selectedEmployees.map(emp => emp.name).join(',');
|
|
|
+ var str = '';
|
|
|
+ for (var i=0;i<this.selectedEmployees.length; i++) {
|
|
|
+ var item = this.selectedEmployees[i];
|
|
|
+ str += item.id + '-' + item.name;
|
|
|
+ if (i < this.selectedEmployees.length-1) {
|
|
|
+ str += ',';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.currentDomainIndex == 'zhoBao') {
|
|
|
+ //按周填报的弹窗里面设置人员
|
|
|
+ this.zhoBao.customTextShow = employeeNames;
|
|
|
+ this.zhoBao.customText = str;
|
|
|
+ this.zhoBao.selectedEmployees = this.selectedEmployees;
|
|
|
+ this.zhoBao.customData = this.selectedEmployees.length;
|
|
|
+ } else {
|
|
|
+ const domain = this.workForm.domains[this.currentDomainIndex];
|
|
|
+ this.$set(domain, 'selectedEmployees', [...this.selectedEmployees]);
|
|
|
+ this.$set(domain, 'customText', str);
|
|
|
+ this.$set(domain, 'customTextShow', employeeNames);
|
|
|
+ //设置相关人数
|
|
|
+ this.$set(domain, 'customData', this.selectedEmployees.length);
|
|
|
+ }
|
|
|
+ this.employeeSelectDialog = false;
|
|
|
+ },
|
|
|
+ removeEmployee(index, employeeId) {
|
|
|
+ const domain = this.workForm.domains[index];
|
|
|
+ if (domain && domain.selectedEmployees) {
|
|
|
+ const idx = domain.selectedEmployees.findIndex(emp => emp.id === employeeId);
|
|
|
+ if (idx > -1) {
|
|
|
+ domain.selectedEmployees.splice(idx, 1);
|
|
|
+ // 更新输入框回显
|
|
|
+ const employeeNames = domain.selectedEmployees.map(emp => emp.name).join(',');
|
|
|
+ this.$set(domain, 'customText', employeeNames);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
// 自定义事件
|
|
|
selectCal(obj) {
|
|
|
if(obj.distinction == '1') {
|
|
|
@@ -10131,7 +10388,7 @@
|
|
|
this.usersListId = obj.id
|
|
|
this.showReportTimeLessThanCardTimeList();
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
created() {
|
|
|
this.getUsers()
|
|
|
@@ -10514,4 +10771,19 @@
|
|
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
|
margin: 0 20px;
|
|
|
}
|
|
|
-</style>
|
|
|
+
|
|
|
+ /* AI解析按钮样式 - 蓝紫渐变科技感 */
|
|
|
+ .ai-parse-btn {
|
|
|
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
|
|
|
+ border: none !important;
|
|
|
+ opacity: 0.9;
|
|
|
+ transition: all 0.3s ease;
|
|
|
+ box-shadow: 0 4px 15px 0 rgba(102, 126, 234, 0.4);
|
|
|
+ height:55px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .ai-parse-btn:hover {
|
|
|
+ opacity: 1;
|
|
|
+ box-shadow: 0 6px 20px 0 rgba(102, 126, 234, 0.6);
|
|
|
+ }
|
|
|
+</style>
|