|
@@ -440,6 +440,15 @@
|
|
|
<vueCascader :size="'medium'" :widthStr="'430'" :clearable="true && user.userNameNeedTranslate != 1" :subject="option" :subjectId="insertForm.departmentId" :radios="true" :distinction="'2'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1" ></vueCascader>
|
|
|
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="可填报部门" prop="reportDeptIds" v-if="user.timeType.userWithMultiDept">
|
|
|
+ <template v-if="insertForm.reportDeptIdsList && insertForm.reportDeptIdsList.length > 0">
|
|
|
+ <el-tag v-for="(tag, tagIndex) in insertForm.reportDeptIdsList" :key="tag.id" closable :type="'success'" style="margin-right: 10px;" @close="handleDeptClose(tagIndex)">
|
|
|
+ <TranslationOpenDataText type='departmentName' :openid='tag.label'></TranslationOpenDataText>
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
+ <el-link type="primary" :underline="false" @click="addFilldDepartment(insertForm.reportDeptIdsList)">添加</el-link>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
<el-form-item label="审核层级" v-if="user.timeType.reportAuditType == 6">
|
|
|
<el-radio-group v-model="insertForm.onlyAuditOnce" >
|
|
|
<el-radio :label="0" >两层审核</el-radio>
|
|
@@ -809,6 +818,45 @@
|
|
|
<el-button type="primary" @click="transferActiveMethod">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <!-- 多选部门 -->
|
|
|
+ <el-dialog :title="'请选择部门'" :top="'10vh'" v-if="specialHolidaysDialog" :visible.sync="specialHolidaysDialog" :close-on-click-modal="false" customClass="customWidth" width="600px">
|
|
|
+ <div v-if="user.userNameNeedTranslate == '1'">
|
|
|
+ <el-input placeholder="请输入名字搜索" v-model.trim="wxFilterText" clearable @clear="getWhiteListAll()" class="input-with-select">
|
|
|
+ <el-button slot="append" icon="el-icon-search" @click="echartDepartment()"></el-button>
|
|
|
+ </el-input>
|
|
|
+ </div>
|
|
|
+ <div class="tree" style="height:400px">
|
|
|
+ <el-scrollbar style="height:100%">
|
|
|
+ <el-input v-if="user.userNameNeedTranslate != '1'"
|
|
|
+ :placeholder="$t('keywordfiltering')"
|
|
|
+ v-model="filterText">
|
|
|
+ </el-input>
|
|
|
+ <el-tree :data="whiteListAll" show-checkbox :props="defaultProps" node-key="id"
|
|
|
+ ref="specialHolidaysTree"
|
|
|
+ highlight-current :filter-node-method="filterNode">
|
|
|
+ <span class="custom-tree-node" slot-scope="{ node, data }">
|
|
|
+ <span v-if="user.userNameNeedTranslate == '1'">
|
|
|
+ <span v-if="node.data.children">
|
|
|
+ <TranslationOpenDataText type='departmentName' :openid='node.label'></TranslationOpenDataText>
|
|
|
+ </span>
|
|
|
+ <span v-else>
|
|
|
+ <TranslationOpenDataText type='userName' :openid='node.label'></TranslationOpenDataText>
|
|
|
+ </span>
|
|
|
+ </span>
|
|
|
+ <span v-if="user.userNameNeedTranslate != '1'">
|
|
|
+ {{ node.label }}
|
|
|
+ </span>
|
|
|
+ </span>
|
|
|
+ </el-tree>
|
|
|
+ </el-scrollbar>
|
|
|
+ </div>
|
|
|
+ <!-- <div>已选中 {{chosenMembCount}} 人</div> :default-checked-keys="alreadyPartArray" @check-change="onTreeItemChange" -->
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="specialHolidaysDialog = false">{{ $t('btn.cancel') }}</el-button>
|
|
|
+ <el-button type="primary" @click="specialHolidaysChange()">{{ $t('btn.determine') }}</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -1114,9 +1162,23 @@ export default {
|
|
|
deleteUserFlg: false,
|
|
|
deleteUserFlgData: {},
|
|
|
moveReportUserId: '',
|
|
|
- deleteUserFlgloading: false
|
|
|
+ deleteUserFlgloading: false,
|
|
|
+
|
|
|
+ // 多选部门
|
|
|
+ filterText: '',
|
|
|
+ wxFilterText: '', // 转译搜索
|
|
|
+ whiteListAll: [],
|
|
|
+ whiteListAllTwo: [],
|
|
|
+ specialHolidaysDialog: false,
|
|
|
};
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ filterText(val) {
|
|
|
+ console.log(val)
|
|
|
+ console.log(this.$refs.specialHolidaysTree.filter)
|
|
|
+ this.$refs.specialHolidaysTree.filter(val);
|
|
|
+ }
|
|
|
+ },
|
|
|
filters: {
|
|
|
acquireRoleName(value) {
|
|
|
for (var i in that.acquireRoleList) {
|
|
@@ -2766,6 +2828,15 @@ export default {
|
|
|
(res) => {
|
|
|
if (res.code == "ok") {
|
|
|
this.deleteUserFlgData = res.data
|
|
|
+ if(res.data.userReportDeptList && res.data.userReportDeptList.length > 0) {
|
|
|
+ res.data.userReportDeptList = res.data.userReportDeptList .map(item => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ label: item.departmentName,
|
|
|
+ id: item.departmentId
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
this.insertForm = {
|
|
|
id: res.data.id,
|
|
|
name: res.data.name,
|
|
@@ -2789,7 +2860,8 @@ export default {
|
|
|
plate4: res.data.plate4,
|
|
|
plate5: res.data.plate5,
|
|
|
jobNumber: res.data.jobNumber,
|
|
|
- onlyAuditOnce: res.data.onlyAuditOnce
|
|
|
+ onlyAuditOnce: res.data.onlyAuditOnce,
|
|
|
+ reportDeptIdsList: res.data.userReportDeptList || []
|
|
|
};
|
|
|
this.$set(this.insertForm, 'inductionDate', res.data.inductionDate)
|
|
|
this.getUserCustomConfig(1);
|
|
@@ -2922,6 +2994,14 @@ export default {
|
|
|
];
|
|
|
}
|
|
|
|
|
|
+ if(this.user.timeType.userWithMultiDept == 1) {
|
|
|
+ let list = []
|
|
|
+ if(this.insertForm.reportDeptIdsList && this.insertForm.reportDeptIdsList.length > 0) {
|
|
|
+ list = this.insertForm.reportDeptIdsList.map(item => item.id)
|
|
|
+ }
|
|
|
+ form.reportDeptIds = list.join(',')
|
|
|
+ }
|
|
|
+
|
|
|
if (!ssR && trs) {
|
|
|
this.http.post(
|
|
|
this.port.manage.insert,
|
|
@@ -3775,7 +3855,83 @@ export default {
|
|
|
error => {
|
|
|
this.$message({message: error,type: "error"});
|
|
|
});
|
|
|
- }
|
|
|
+ },
|
|
|
+ getWhiteListAll(){
|
|
|
+ this.http.post('/department/listAllMemb',{
|
|
|
+ },res => {
|
|
|
+ if(res.code == 'ok'){
|
|
|
+ let list = res.data
|
|
|
+ // this.haveUsersList(list)
|
|
|
+ this.whiteListAll = JSON.parse(JSON.stringify(list))
|
|
|
+ this.whiteListAllTwo = JSON.parse(JSON.stringify(list))
|
|
|
+ }
|
|
|
+ },error => {})
|
|
|
+ },
|
|
|
+ // 企业微信选人搜索
|
|
|
+ echartDepartment() {
|
|
|
+ if(this.wxFilterText != '') {
|
|
|
+ this.http.post("/department/listAllMemb", {
|
|
|
+ keyword: this.wxFilterText,
|
|
|
+ cursor: ''
|
|
|
+ },
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ if(!Array.isArray(res.data)) {
|
|
|
+ let list = res.data.data
|
|
|
+ // this.haveUsersList(list)
|
|
|
+ this.whiteListAll = JSON.parse(JSON.stringify(list))
|
|
|
+ this.whiteListAllTwo = JSON.parse(JSON.stringify(list))
|
|
|
+ } else {
|
|
|
+ this.whiteListAll = []
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => { });
|
|
|
+ } else {
|
|
|
+ this.getWhiteListAll()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ haveUsersList(list){
|
|
|
+ for (var i in list) {
|
|
|
+ if (list[i].children != null) {
|
|
|
+ this.haveUsersList(list[i].children);
|
|
|
+ }
|
|
|
+ if (list[i].userList != null) {
|
|
|
+ if (list[i].children == null) {
|
|
|
+ list[i].children = [];
|
|
|
+ }
|
|
|
+ list[i].userList.forEach(element => {
|
|
|
+ var obj = {id: element.id, label:element.name, parentId:element.departmentId, isUser:1};
|
|
|
+ list[i].children.push(obj);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ specialHolidaysChange() {
|
|
|
+ let selectList = this.$refs.specialHolidaysTree.getCheckedNodes();
|
|
|
+ this.specialHolidaysDialog = false
|
|
|
+ this.insertForm.reportDeptIdsList = selectList
|
|
|
+ },
|
|
|
+ addFilldDepartment(item) {
|
|
|
+ this.filterText = ''
|
|
|
+ this.wxFilterText = ''
|
|
|
+ this.whiteListAll = JSON.parse(JSON.stringify(this.whiteListAllTwo));
|
|
|
+ this.specialHolidaysDialog = true
|
|
|
+ if(item) {
|
|
|
+ let key = item.map(item => item.id)
|
|
|
+ console.log(key, '<=== key')
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$refs.specialHolidaysTree.setCheckedKeys(key)
|
|
|
+ }, 500)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleDeptClose(index) {
|
|
|
+ this.insertForm.reportDeptIdsList.splice(index, 1)
|
|
|
+ },
|
|
|
+ filterNode(value, data) {
|
|
|
+ if (!value) return true;
|
|
|
+ return data.label.indexOf(value) !== -1;
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
this.deactiveDate = util.formatDate.format(new Date(), "yyyy-MM-dd");
|
|
@@ -3794,6 +3950,7 @@ export default {
|
|
|
this.getWxManager()
|
|
|
}
|
|
|
this.statesPush();
|
|
|
+ this.getWhiteListAll()
|
|
|
// 获取企业微信的参数
|
|
|
// if(this.user.companyId == '1081' || this.user.companyId == '7') {
|
|
|
// this.agentConfig()
|