Merge remote-tracking branch 'origin/dev_third_stage' into dev_third_stage

This commit is contained in:
wangzhijiang
2022-11-01 16:46:40 +08:00
24 changed files with 215 additions and 128 deletions
@@ -250,10 +250,14 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
@Override @Override
public IPage<DummyInventoryBaseEO> getPageInfo(Page<DummyInventoryBaseEO> page, QueryWrapper<DummyInventoryBaseEO> queryWrapper) { public IPage<DummyInventoryBaseEO> getPageInfo(Page<DummyInventoryBaseEO> page, QueryWrapper<DummyInventoryBaseEO> queryWrapper) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
queryWrapper.and(query->{ //系统管理
query.in("create_by",sysUser.getUsername()).in("state",InventoryStateEnum.DRAFT.getValue()) boolean administrator = sysUserService.isAdministrator();
.or().in("state",InventoryStateEnum.ISSUE.getValue()); if(!administrator){
}); queryWrapper.and(query->{
query.in("create_by",sysUser.getUsername()).in("state",InventoryStateEnum.DRAFT.getValue())
.or().in("state",InventoryStateEnum.ISSUE.getValue());
});
}
// queryWrapper.or(query->{ // queryWrapper.or(query->{
// query.in("state",InventoryStateEnum.ISSUE.getValue()); // query.in("state",InventoryStateEnum.ISSUE.getValue());
// }); // });
@@ -319,19 +323,19 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
DummyInventoryBaseEO baseEO = queryById(dummyInventoryBaseEO.getId()); DummyInventoryBaseEO baseEO = queryById(dummyInventoryBaseEO.getId());
List<String> createByNameList =new ArrayList<>(); List<String> createByNameList =new ArrayList<>();
if (StringUtils.isNotBlank(baseEO.getCreateBy())) { // if (StringUtils.isNotBlank(baseEO.getCreateBy())) {
createByNameList = Arrays.asList(baseEO.getCreateBy().split(",")); // createByNameList = Arrays.asList(baseEO.getCreateBy().split(","));
//
if (CollectionUtils.isNotEmpty(createByNameList)){ // if (CollectionUtils.isNotEmpty(createByNameList)){
if (!createByNameList.contains(loginUserName)) { // if (!createByNameList.contains(loginUserName)) {
if (CutEnum.CN.getValue().equals(dummyInventoryBaseEO.getCut())) { // if (CutEnum.CN.getValue().equals(dummyInventoryBaseEO.getCut())) {
throw new JeroBootException("当前用户非创建者,无法发布"); // throw new JeroBootException("当前用户非创建者,无法发布");
} else { // } else {
throw new JeroBootException("The current user is not the creator and cannot be issued."); // throw new JeroBootException("The current user is not the creator and cannot be issued.");
} // }
} // }
} // }
} // }
Date now = new Date(); Date now = new Date();
UpdateWrapper<DummyInventoryBaseEO> baseWrapper=new UpdateWrapper<>(); UpdateWrapper<DummyInventoryBaseEO> baseWrapper=new UpdateWrapper<>();
baseWrapper.set("state",dummyInventoryBaseEO.getState()); baseWrapper.set("state",dummyInventoryBaseEO.getState());
+12 -3
View File
@@ -21,11 +21,11 @@
<!-- <span v-if="ol.text==$t('check')">--> <!-- <span v-if="ol.text==$t('check')">-->
<!-- {{record.resultContent=='转换成功'&&record.syncState=='未同步'?ol.text:''}}--> <!-- {{record.resultContent=='转换成功'&&record.syncState=='未同步'?ol.text:''}}-->
<!-- </span>--> <!-- </span>-->
<span v-if="ol.text==$t('download') && record.createBy == userData.username" <span v-if="ol.text==$t('download') && (record.createBy == userData.username || administrators)"
v-has="'ocr:ocrRestful:downFile'"> v-has="'ocr:ocrRestful:downFile'">
{{record.resultContent=='转换成功'?ol.text:''}} {{record.resultContent=='转换成功'?ol.text:''}}
</span> </span>
<span v-if="ol.text==$t('delete') && record.createBy == userData.username" v-has="'ocr:ocrRecord:delete'"> <span v-if="ol.text==$t('delete') && (record.createBy == userData.username || administrators)" v-has="'ocr:ocrRecord:delete'">
{{ol.text}} {{ol.text}}
</span> </span>
</a> </a>
@@ -105,7 +105,8 @@
searchParmes: {}, searchParmes: {},
loading: false, loading: false,
orderBy: '1', orderBy: '1',
orderByField: '' orderByField: '',
administrators:false
} }
}, },
mounted() { mounted() {
@@ -131,6 +132,14 @@
this.getData() this.getData()
this.getTableList() this.getTableList()
this.userData = this.userInfo() this.userData = this.userInfo()
this.administrators = false
if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) {
this.userInfo().userRoleList.forEach(res => {
if (res.roleCode == 'admin') {
this.administrators = true
}
})
}
}, },
beforeDestroy(){ beforeDestroy(){
eventBUs.$off('searchQuery') eventBUs.$off('searchQuery')
+12 -3
View File
@@ -18,7 +18,7 @@
<!-- <span class="text">--> <!-- <span class="text">-->
<!-- {{ol.text}}--> <!-- {{ol.text}}-->
<!-- </span>--> <!-- </span>-->
<span v-if="ol.text==$t('backDocument')&&record.flag==0 && record.createBy == userData.username" <span v-if="ol.text==$t('backDocument') && record.flag==0 && (record.createBy == userData.username || administrators)"
class="text" class="text"
v-has="'split:sarFileSplitInfo:bind'"> v-has="'split:sarFileSplitInfo:bind'">
{{ol.text}} {{ol.text}}
@@ -27,7 +27,7 @@
v-has="'split:sarFileSplitItems:page'"> v-has="'split:sarFileSplitItems:page'">
{{ol.text}} {{ol.text}}
</span> </span>
<span v-if="ol.text==$t('delete') && record.createBy == userData.username" <span v-if="ol.text==$t('delete') && (record.createBy == userData.username || administrators)"
v-has="'split:sarFileSplitInfo:delete'"> v-has="'split:sarFileSplitInfo:delete'">
{{ol.text}} {{ol.text}}
</span> </span>
@@ -109,7 +109,8 @@
loading: false, loading: false,
orderBy: '1', orderBy: '1',
userData: {}, userData: {},
orderByField: '' orderByField: '',
administrators:false,
} }
}, },
mounted() { mounted() {
@@ -141,6 +142,14 @@
this.getData() this.getData()
this.getTableList() this.getTableList()
this.userData = this.userInfo() this.userData = this.userInfo()
this.administrators = false
if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) {
this.userInfo().userRoleList.forEach(res => {
if (res.roleCode == 'admin') {
this.administrators = true
}
})
}
}, },
beforeDestroy() { beforeDestroy() {
eventBUs.$off('searchQuery') eventBUs.$off('searchQuery')
@@ -125,14 +125,16 @@
</span> </span>
</a-select-option> </a-select-option>
</a-select> </a-select>
<a-button class="box-button-index"
:title="$t('addStandardInformation')"
type="primary" @click="bringInDocumentInformationClick">
{{$t('addStandardInformation')}}
</a-button>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
<a-col :span="8">
<a-button class="box-button-index"
:title="$t('addStandardInformation')"
type="primary" @click="bringInDocumentInformationClick">
{{$t('addStandardInformation')}}
</a-button>
</a-col>
</a-row> </a-row>
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="24" style="height: 380px"> <a-col :span="24" style="height: 380px">
@@ -799,8 +801,9 @@
width: 120px; width: 120px;
overflow: hidden; overflow: hidden;
padding: 0 0; padding: 0 0;
float: right; /*float: right;*/
text-align: center; text-align: center;
margin-top: 2px;
} }
::v-deep .box-button-index span { ::v-deep .box-button-index span {
@@ -843,8 +846,9 @@
} }
.box-input-index { .box-input-index {
width: calc(100% - 130px); /*width: calc(100% - 130px);*/
display: inline-block; display: inline-block;
width: 100%;
height: 48px; height: 48px;
margin-right: 10px; margin-right: 10px;
} }
@@ -65,16 +65,16 @@
<span slot="operation" slot-scope="text,record"> <span slot="operation" slot-scope="text,record">
<a class="text-operation" @click="edit(record)" <a class="text-operation" @click="edit(record)"
v-has="'dummyInventoryBase:deleteBatch'" v-has="'dummyInventoryBase:deleteBatch'"
v-if="record.createBy == userData.username" v-if="record.createBy == userData.username || administrators"
:disabled="record.state == 1?true:false">{{$t('edit')}}</a> :disabled="record.state == 1?true:false">{{$t('edit')}}</a>
<a class="text-operation" <a class="text-operation"
v-if="record.createBy == userData.username" v-if="record.createBy == userData.username || administrators"
v-has="'dummyInventoryBase:issue'" v-has="'dummyInventoryBase:issue'"
@click="withdraw(record)"> @click="withdraw(record)">
{{record.state == 2 ? $t('release') : $t('withdraw')}} {{record.state == 2 ? $t('release') : $t('withdraw')}}
</a> </a>
<a class="text-operation" :disabled="record.state == 1?true:false" <a class="text-operation" :disabled="record.state == 1?true:false"
v-if="record.createBy == userData.username" v-if="record.createBy == userData.username || administrators"
v-has="'dummyInventoryBase:deleteBatch'" v-has="'dummyInventoryBase:deleteBatch'"
@click="maintenanceList(record)">{{$t('maintenanceList')}}</a> @click="maintenanceList(record)">{{$t('maintenanceList')}}</a>
<a class="text-operation" <a class="text-operation"
@@ -84,7 +84,7 @@
</a> </a>
<a class="text-operation" :disabled="record.state == 1?true:false" <a class="text-operation" :disabled="record.state == 1?true:false"
v-has="'dummyInventoryBase:deleteBatch'" v-has="'dummyInventoryBase:deleteBatch'"
v-if="record.createBy == userData.username" v-if="record.createBy == userData.username || administrators"
@click="deleteLib(record)">{{$t('deleteLib')}}</a> @click="deleteLib(record)">{{$t('deleteLib')}}</a>
</span> </span>
</a-table> </a-table>
@@ -244,13 +244,21 @@
scopedSlots: { customRender: 'operation' } scopedSlots: { customRender: 'operation' }
} }
], ],
queryParam: {} queryParam: {},
administrators:false,
} }
}, },
mounted() { mounted() {
this.getList() this.getList()
this.userData = this.userInfo() this.userData = this.userInfo()
this.administrators = false
if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) {
this.userInfo().userRoleList.forEach(res => {
if (res.roleCode == 'admin') {
this.administrators = true
}
})
}
}, },
methods: { methods: {
...mapGetters(['userInfo']), ...mapGetters(['userInfo']),
@@ -107,7 +107,7 @@
line-height: 40px; line-height: 40px;
.header-text { .header-text {
font-size: 16px; font-size: 18px;
font-weight: 400; font-weight: 400;
color: #000F16; color: #000F16;
} }
@@ -356,7 +356,7 @@
line-height: 40px; line-height: 40px;
.header-text { .header-text {
font-size: 16px; font-size: 18px;
font-weight: 400; font-weight: 400;
color: #000F16; color: #000F16;
} }
@@ -389,7 +389,7 @@
line-height: 40px; line-height: 40px;
.header-text { .header-text {
font-size: 16px; font-size: 18px;
font-weight: 400; font-weight: 400;
color: #000F16; color: #000F16;
} }
@@ -223,7 +223,7 @@
line-height: 40px; line-height: 40px;
.header-text { .header-text {
font-size: 16px; font-size: 18px;
font-weight: 400; font-weight: 400;
color: #000F16; color: #000F16;
} }
@@ -231,7 +231,7 @@
line-height: 40px; line-height: 40px;
.header-text { .header-text {
font-size: 16px; font-size: 18px;
font-weight: 400; font-weight: 400;
color: #000F16; color: #000F16;
} }
@@ -111,7 +111,7 @@
line-height: 80px; line-height: 80px;
.header-text { .header-text {
font-size: 16px; font-size: 18px;
font-weight: 400; font-weight: 400;
color: #000F16; color: #000F16;
} }
@@ -127,7 +127,7 @@
line-height: 40px; line-height: 40px;
.header-text { .header-text {
font-size: 16px; font-size: 18px;
font-weight: 400; font-weight: 400;
color: #000F16; color: #000F16;
} }
@@ -312,7 +312,7 @@
line-height: 40px; line-height: 40px;
.header-text { .header-text {
font-size: 16px; font-size: 18px;
font-weight: 400; font-weight: 400;
color: #000F16; color: #000F16;
} }
@@ -116,7 +116,7 @@
line-height: 40px; line-height: 40px;
.header-text { .header-text {
font-size: 16px; font-size: 18px;
font-weight: 400; font-weight: 400;
color: #000F16; color: #000F16;
} }
@@ -110,7 +110,7 @@
line-height: 40px; line-height: 40px;
.header-text { .header-text {
font-size: 16px; font-size: 18px;
font-weight: 400; font-weight: 400;
color: #000F16; color: #000F16;
} }
@@ -335,7 +335,7 @@
}) })
} else { } else {
this.loading = false this.loading = false
this.$message.warning(this.$t('operationFailed')) this.$message.warning(res.message)
} }
}) })
} }
@@ -263,7 +263,7 @@
} }
} else { } else {
this.loading = false this.loading = false
this.$message.warning(this.$t('operationFailed')) this.$message.warning(res.message)
} }
}) })
}, },
@@ -199,7 +199,7 @@
}) })
} else { } else {
this.loading = false this.loading = false
this.$message.warning(this.$t('operationFailed')) this.$message.warning(res.message)
} }
}) })
} }
@@ -362,7 +362,7 @@
this.edit() this.edit()
} else { } else {
this.loading = false this.loading = false
this.$message.warning(this.$t('operationFailed')) this.$message.warning(res.message)
} }
}) })
}, },
@@ -5,7 +5,7 @@
{{$t('basicInformationOfParameters')}} {{$t('basicInformationOfParameters')}}
</div> </div>
<div class="header-tight"> <div class="header-tight">
<a-button v-if="this.$route.query.studioEngineer == this.userInfo().id" class="box-button" <a-button v-if="this.$route.query.studioEngineer == this.userInfo().id || administrators" class="box-button"
style="line-height: 32px" @click="edit"> style="line-height: 32px" @click="edit">
{{$t('edit')}} {{$t('edit')}}
</a-button> </a-button>
@@ -93,7 +93,8 @@
{{$t('regulatoryCertificationTaskPlan')}} {{$t('regulatoryCertificationTaskPlan')}}
</div> </div>
<div class="header-tight"> <div class="header-tight">
<a-button class="box-button" v-if="this.$route.query.studioEngineer == this.userInfo().id" <a-button class="box-button"
v-if="this.$route.query.studioEngineer == this.userInfo().id || administrators"
style="line-height: 32px" style="line-height: 32px"
@click="settingClick">{{$t('setting')}} @click="settingClick">{{$t('setting')}}
</a-button> </a-button>
@@ -161,6 +162,7 @@
data() { data() {
return { return {
queryForm: {}, queryForm: {},
administrators:false,
activeKey: this.$t('CurrentStatusOfTheProject'), activeKey: this.$t('CurrentStatusOfTheProject'),
url: { url: {
queryById: 'project/projectLibraryBase/queryById', queryById: 'project/projectLibraryBase/queryById',
@@ -177,6 +179,14 @@
mounted() { mounted() {
this.getForm() this.getForm()
this.getSetting() this.getSetting()
this.administrators = false
if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) {
this.userInfo().userRoleList.forEach(res => {
if (res.roleCode == 'admin') {
this.administrators = true
}
})
}
}, },
methods: { methods: {
...mapGetters(['userInfo']), ...mapGetters(['userInfo']),
@@ -173,7 +173,8 @@
</div> </div>
</div> </div>
<div v-if="!isDisplay" style="float: right;margin-top: 1px;margin-bottom: 0px"> <div v-if="!isDisplay" style="float: right;margin-top: 1px;margin-bottom: 0px">
<div @click="handleExport" v-has="'projectLawsInventory:exportData'" v-if="isRoleSwitching" <div @click="handleExport" v-has="'projectLawsInventory:exportData'"
v-if="isRoleSwitching || formInlineRoleSwitching.roleSwitchingCode == '12'"
class="operator-text"> class="operator-text">
<a-icon type="export" :rotate="-90"/> <a-icon type="export" :rotate="-90"/>
{{ $t('export') }} {{ $t('export') }}
@@ -83,14 +83,14 @@
</div> </div>
<div class="operator-text" <div class="operator-text"
v-has="'projectRelatedPersonnel:importExcel'" v-has="'projectRelatedPersonnel:importExcel'"
v-if="this.$route.query.studioEngineer == this.userInfo().id"> v-if="this.$route.query.studioEngineer == this.userInfo().id || administrators">
<ImportFile :url="url" :projectId="$route.query.id" :isTrue="true" :accept="'.xls'" <ImportFile :url="url" :projectId="$route.query.id" :isTrue="true" :accept="'.xls'"
@getList="getPersonnelList"/> @getList="getPersonnelList"/>
</div> </div>
<div class="operator-text" <div class="operator-text"
@click="batSettingClick" @click="batSettingClick"
v-has="'projectRelatedPersonnel:setting'" v-has="'projectRelatedPersonnel:setting'"
v-if="this.$route.query.studioEngineer == this.userInfo().id"> v-if="this.$route.query.studioEngineer == this.userInfo().id || administrators">
<a-icon type="setting"/> <a-icon type="setting"/>
{{$t('batSetting')}} {{$t('batSetting')}}
</div> </div>
@@ -388,13 +388,15 @@
queryCertificationEngineer: '/project/projectRelatedPersonnel/queryCertificationEngineer' queryCertificationEngineer: '/project/projectRelatedPersonnel/queryCertificationEngineer'
}, },
selectedRowKeys: [], selectedRowKeys: [],
dictOptionsValue: [] dictOptionsValue: [],
administrators: false
} }
}, },
computed: { computed: {
columns() { columns() {
let columnResult = JSON.parse(JSON.stringify(this.columnsAll)) let columnResult = JSON.parse(JSON.stringify(this.columnsAll))
if (this.$route.query.studioEngineer != this.userInfo().id) { if (this.$route.query.studioEngineer == this.userInfo().id || this.administrators) {
} else {
for (var i = 0; i < columnResult.length; i++) { for (var i = 0; i < columnResult.length; i++) {
if (columnResult[i].title === this.$t('operation')) { if (columnResult[i].title === this.$t('operation')) {
columnResult.splice(i, 1) columnResult.splice(i, 1)
@@ -441,6 +443,14 @@
getData() { getData() {
this.visible = true this.visible = true
this.queryParam = {} this.queryParam = {}
this.administrators = false
if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) {
this.userInfo().userRoleList.forEach(res => {
if (res.roleCode == 'admin') {
this.administrators = true
}
})
}
this.getList() this.getList()
this.queryCertificationEngineer() this.queryCertificationEngineer()
}, },
@@ -131,7 +131,7 @@
<!-- <a class="text-operation" @click="edit(record)">{{$t('edit')}}</a>--> <!-- <a class="text-operation" @click="edit(record)">{{$t('edit')}}</a>-->
<a class="text-operation" <a class="text-operation"
v-has="'projectLibraryBase:delete'" v-has="'projectLibraryBase:delete'"
v-if="record.createBy == userInfoQuery.username" v-if="record.createBy == userInfoQuery.username || administrators"
@click="deleteLib(record)">{{$t('deleteLib')}}</a> @click="deleteLib(record)">{{$t('deleteLib')}}</a>
<!-- <a class="text-operation" @click="entryNameClick(record)">{{$t('see')}}</a>--> <!-- <a class="text-operation" @click="entryNameClick(record)">{{$t('see')}}</a>-->
</span> </span>
@@ -246,12 +246,21 @@
} }
], ],
userInfoQuery: {}, userInfoQuery: {},
queryParam: {} queryParam: {},
administrators: false
} }
}, },
mounted() { mounted() {
this.getList() this.getList()
this.userInfoQuery = this.userInfo() this.userInfoQuery = this.userInfo()
this.administrators = false
if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) {
this.userInfo().userRoleList.forEach(res => {
if (res.roleCode == 'admin') {
this.administrators = true
}
})
}
}, },
methods: { methods: {
...mapGetters(['userInfo']), ...mapGetters(['userInfo']),
+92 -69
View File
@@ -21,29 +21,32 @@
<a-spin :spinning="confirmLoading"> <a-spin :spinning="confirmLoading">
<a-form :form="form"> <a-form :form="form">
<!-- v-if="!disabled"--> <!-- v-if="!disabled"-->
<a-form-item :label="$t('userAccount')" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item :label="$t('userAccount')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('enterUserAccount')" v-decorator.trim="[ 'username', validatorRules.username]" :disabled='isdisabled' <a-input :placeholder="$t('enterUserAccount')" v-decorator.trim="[ 'username', validatorRules.username]"
:disabled='isdisabled'
:readOnly="!!model.id"/> :readOnly="!!model.id"/>
</a-form-item> </a-form-item>
<!-- v-if="!model.id && !disabled"--> <!-- v-if="!model.id && !disabled"-->
<template> <template>
<!-- <a-form-item :label="$t('LoginPassword')" :labelCol="labelCol" :wrapperCol="wrapperCol">--> <!-- <a-form-item :label="$t('LoginPassword')" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<!-- <a-input type="password" :placeholder="$t('enterLoginPassword')" autocomplete='new-password'--> <!-- <a-input type="password" :placeholder="$t('enterLoginPassword')" autocomplete='new-password'-->
<!-- v-decorator="[ 'password',validatorRules.password]"/>--> <!-- v-decorator="[ 'password',validatorRules.password]"/>-->
<!-- </a-form-item>--> <!-- </a-form-item>-->
<!-- v-if="!disabled"--> <!-- v-if="!disabled"-->
<!-- <a-form-item :label="$t('ConfirmPassword')" :labelCol="labelCol" :wrapperCol="wrapperCol">--> <!-- <a-form-item :label="$t('ConfirmPassword')" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<!-- <a-input type="password" @blur="handleConfirmBlur" :placeholder="$t('reenterLoginPassword')"--> <!-- <a-input type="password" @blur="handleConfirmBlur" :placeholder="$t('reenterLoginPassword')"-->
<!-- v-decorator="[ 'confirmpassword', validatorRules.confirmpassword]"/>--> <!-- v-decorator="[ 'confirmpassword', validatorRules.confirmpassword]"/>-->
<!-- </a-form-item>--> <!-- </a-form-item>-->
</template> </template>
<!-- v-if="!disabled"--> <!-- v-if="!disabled"-->
<a-form-item :label="$t('userName')" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item :label="$t('userName')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('enterUserName')" :disabled='isdisabled' v-decorator.trim="[ 'realname', validatorRules.realname]"/> <a-input :placeholder="$t('enterUserName')" :disabled='isdisabled'
v-decorator.trim="[ 'realname', validatorRules.realname]"/>
</a-form-item> </a-form-item>
<a-form-item :label="$t('position')" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item :label="$t('position')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input type="textarea" style='height: 100px' :placeholder="$t('pleaseEnter')+$t('position')" :disabled='isdisabled' v-decorator.trim="[ 'jobTitle', validatorRules.jobTitle]"/> <a-input type="textarea" style='height: 100px' :placeholder="$t('pleaseEnter')+$t('position')"
:disabled='isdisabled' v-decorator.trim="[ 'jobTitle', validatorRules.jobTitle]"/>
</a-form-item> </a-form-item>
<!--<a-form-item label="工号" :labelCol="labelCol" :wrapperCol="wrapperCol">--> <!--<a-form-item label="工号" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
@@ -53,9 +56,9 @@
<!--<a-form-item label="职务" :labelCol="labelCol" :wrapperCol="wrapperCol">--> <!--<a-form-item label="职务" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<!--<j-select-position placeholder="请选择职务" :multiple="false" v-decorator="['post', {}]"/>--> <!--<j-select-position placeholder="请选择职务" :multiple="false" v-decorator="['post', {}]"/>-->
<!--</a-form-item>--> <!--</a-form-item>-->
<!-- v-show="!roleDisabled"--> <!-- v-show="!roleDisabled"-->
<a-form-item :label="$t('RoleAssignment')" :labelCol="labelCol" :wrapperCol="wrapperCol" <a-form-item :label="$t('RoleAssignment')" :labelCol="labelCol" :wrapperCol="wrapperCol"
> >
<a-select <a-select
mode="multiple" mode="multiple"
style="width: 100%" style="width: 100%"
@@ -63,7 +66,7 @@
:placeholder="$t('selectUserRole')" :placeholder="$t('selectUserRole')"
optionFilterProp="children" optionFilterProp="children"
v-model="selectedRole" v-model="selectedRole"
:disabled='isdisabled' :disabled='false'
:getPopupContainer="(target) => target.parentNode"> :getPopupContainer="(target) => target.parentNode">
<a-select-option v-for="(role,roleindex) in roleList" :key="roleindex.toString()" :value="role.id"> <a-select-option v-for="(role,roleindex) in roleList" :key="roleindex.toString()" :value="role.id">
{{ role.roleName }} {{ role.roleName }}
@@ -72,9 +75,9 @@
</a-form-item> </a-form-item>
<!--部门分配--> <!--部门分配-->
<!-- v-show="!departDisabled && !disabled"--> <!-- v-show="!departDisabled && !disabled"-->
<a-form-item :label="$t('DepartmentAllocation')" :labelCol="labelCol" :wrapperCol="wrapperCol" <a-form-item :label="$t('DepartmentAllocation')" :labelCol="labelCol" :wrapperCol="wrapperCol"
> >
<a-input-search <a-input-search
:placeholder="$t('ClickSelectDepartment')" :placeholder="$t('ClickSelectDepartment')"
v-model="checkedDepartNameString" v-model="checkedDepartNameString"
@@ -101,34 +104,34 @@
<!--</a-form-item>--> <!--</a-form-item>-->
<!-- update--begin--autor:wangshuai-----date:20200108------for:新增身份和负责部门------ --> <!-- update--begin--autor:wangshuai-----date:20200108------for:新增身份和负责部门------ -->
<!-- v-if="!disabled"--> <!-- v-if="!disabled"-->
<!-- <a-form-item :label="$t('identity')" :labelCol="labelCol" :wrapperCol="wrapperCol">--> <!-- <a-form-item :label="$t('identity')" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<!-- <a-radio-group--> <!-- <a-radio-group-->
<!-- v-model="identity"--> <!-- v-model="identity"-->
<!-- @change="identityChange">--> <!-- @change="identityChange">-->
<!-- <a-radio value="1">{{$t('OrdinaryUsers')}}</a-radio>--> <!-- <a-radio value="1">{{$t('OrdinaryUsers')}}</a-radio>-->
<!-- <a-radio value="2">{{$t('superior')}}</a-radio>--> <!-- <a-radio value="2">{{$t('superior')}}</a-radio>-->
<!-- </a-radio-group>--> <!-- </a-radio-group>-->
<!-- </a-form-item>--> <!-- </a-form-item>-->
<!-- v-if="departIdShow==true && !disabled"--> <!-- v-if="departIdShow==true && !disabled"-->
<!-- <a-form-item :label="$t('ResponsibleDepartment')" :labelCol="labelCol" :wrapperCol="wrapperCol"--> <!-- <a-form-item :label="$t('ResponsibleDepartment')" :labelCol="labelCol" :wrapperCol="wrapperCol"-->
<!-- >--> <!-- >-->
<!-- <a-select--> <!-- <a-select-->
<!-- :disabled="disabled"--> <!-- :disabled="disabled"-->
<!-- mode="multiple"--> <!-- mode="multiple"-->
<!-- style="width: 100%"--> <!-- style="width: 100%"-->
<!-- :placeholder="$t('selectResponsibleDepartment')"--> <!-- :placeholder="$t('selectResponsibleDepartment')"-->
<!-- v-model="departIds"--> <!-- v-model="departIds"-->
<!-- optionFilterProp="children"--> <!-- optionFilterProp="children"-->
<!-- :getPopupContainer="(target) => target.parentNode"--> <!-- :getPopupContainer="(target) => target.parentNode"-->
<!-- :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"--> <!-- :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"-->
<!-- >--> <!-- >-->
<!-- <a-select-option v-for="item in resultDepartOptions" :key="item.key" :value="item.key"--> <!-- <a-select-option v-for="item in resultDepartOptions" :key="item.key" :value="item.key"-->
<!-- >{{item.title}}--> <!-- >{{item.title}}-->
<!-- </a-select-option--> <!-- </a-select-option-->
<!-- >--> <!-- >-->
<!-- </a-select>--> <!-- </a-select>-->
<!-- </a-form-item>--> <!-- </a-form-item>-->
<!-- update--end--autor:wangshuai-----date:20200108------for:新增身份和负责部门------ --> <!-- update--end--autor:wangshuai-----date:20200108------for:新增身份和负责部门------ -->
<!-- <a-form-item label="头像" :labelCol="labelCol" :wrapperCol="wrapperCol">--> <!-- <a-form-item label="头像" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<!-- <j-image-upload class="avatar-uploader" text="上传" v-model="fileList" ></j-image-upload>--> <!-- <j-image-upload class="avatar-uploader" text="上传" v-model="fileList" ></j-image-upload>-->
@@ -141,20 +144,21 @@
<!--v-decorator="['birthday', {initialValue:!model.birthday?null:moment(model.birthday,dateFormat)}]"--> <!--v-decorator="['birthday', {initialValue:!model.birthday?null:moment(model.birthday,dateFormat)}]"-->
<!--:getCalendarContainer="node => node.parentNode"/>--> <!--:getCalendarContainer="node => node.parentNode"/>-->
<!--</a-form-item>--> <!--</a-form-item>-->
<!-- v-if="!disabled"--> <!-- v-if="!disabled"-->
<!-- <a-form-item :label="$t('Gender')" :labelCol="labelCol" :wrapperCol="wrapperCol">--> <!-- <a-form-item :label="$t('Gender')" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
<!-- <a-select v-decorator="[ 'sex', {}]" :placeholder="$t('selectGender')"--> <!-- <a-select v-decorator="[ 'sex', {}]" :placeholder="$t('selectGender')"-->
<!-- :getPopupContainer="(target) => target.parentNode">--> <!-- :getPopupContainer="(target) => target.parentNode">-->
<!-- <a-select-option :value="1">{{$t('male')}}</a-select-option>--> <!-- <a-select-option :value="1">{{$t('male')}}</a-select-option>-->
<!-- <a-select-option :value="2">{{$t('female')}}</a-select-option>--> <!-- <a-select-option :value="2">{{$t('female')}}</a-select-option>-->
<!-- </a-select>--> <!-- </a-select>-->
<!-- </a-form-item>--> <!-- </a-form-item>-->
<!-- v-if="!disabled"--> <!-- v-if="!disabled"-->
<a-form-item :label="$t('mailbox')" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item :label="$t('mailbox')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('enterEmailAddress')" v-decorator="[ 'email', validatorRules.email]" :disabled='isdisabled'/> <a-input :placeholder="$t('enterEmailAddress')" v-decorator="[ 'email', validatorRules.email]"
:disabled='isdisabled'/>
</a-form-item> </a-form-item>
<!-- v-if="!disabled"--> <!-- v-if="!disabled"-->
<!-- :disabled="isDisabledAuth('user:form:phone')"--> <!-- :disabled="isDisabledAuth('user:form:phone')"-->
<a-form-item :label="$t('phoneNumber')" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item :label="$t('phoneNumber')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('enterMobileNumber')" :disabled='isdisabled' <a-input :placeholder="$t('enterMobileNumber')" :disabled='isdisabled'
v-decorator="[ 'telephone', validatorRules.telephone]"/> v-decorator="[ 'telephone', validatorRules.telephone]"/>
@@ -173,11 +177,11 @@
<depart-window ref="departWindow" @ok="modalFormOk"></depart-window> <depart-window ref="departWindow" @ok="modalFormOk"></depart-window>
<div class="drawer-bootom-button" v-show="!disableSubmit"> <div class="drawer-bootom-button" v-show="!disableSubmit">
<!-- <a-popconfirm :title="$t('AreYouWantDiscardEditing')" @confirm="handleCancel" :okText="$t('determine')"--> <!-- <a-popconfirm :title="$t('AreYouWantDiscardEditing')" @confirm="handleCancel" :okText="$t('determine')"-->
<!-- :cancelText="$t('cancel')">--> <!-- :cancelText="$t('cancel')">-->
<a-button style="margin-right: .8rem" @click="handleSubmit">{{$t('cancel')}}</a-button> <a-button style="margin-right: .8rem" @click="handleSubmit">{{$t('cancel')}}</a-button>
<!-- </a-popconfirm>--> <!-- </a-popconfirm>-->
<!-- <a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>--> <a-button @click="handleSubmitOk" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
</div> </div>
</a-drawer> </a-drawer>
</template> </template>
@@ -189,7 +193,7 @@
// 引入搜索部门弹出框的组件 // 引入搜索部门弹出框的组件
import departWindow from './DepartWindow' import departWindow from './DepartWindow'
import { ACCESS_TOKEN } from '@/store/mutation-types' import { ACCESS_TOKEN } from '@/store/mutation-types'
import { getAction } from '@/api/manage' import { getAction, postAction } from '@/api/manage'
import { addUser, editUser, queryUserRole, queryall } from '@/api/api' import { addUser, editUser, queryUserRole, queryall } from '@/api/api'
import { disabledAuthFilter } from '@/utils/authFilter' import { disabledAuthFilter } from '@/utils/authFilter'
import { duplicateCheck } from '@/api/api' import { duplicateCheck } from '@/api/api'
@@ -347,6 +351,25 @@
} }
}) })
}, },
handleSubmitOk() {
this.confirmLoading = true
let selectedRole = JSON.parse(JSON.stringify(this.selectedRole))
let param = {
ids: this.userId,
selectedroles: selectedRole.join(',')
}
postAction('/sys/user/setRole', param).then((res) => {
if (res.success) {
this.$emit('ok')
this.confirmLoading = false
this.visible = false
this.$message.success(res.message)
} else {
this.confirmLoading = false
this.$message.warning(res.message)
}
})
},
refresh() { refresh() {
this.selectedDepartKeys = [] this.selectedDepartKeys = []
this.checkedDepartKeys = [] this.checkedDepartKeys = []
@@ -383,7 +406,7 @@
that.visible = true that.visible = true
that.model = Object.assign({}, record) that.model = Object.assign({}, record)
that.$nextTick(() => { that.$nextTick(() => {
that.form.setFieldsValue(pick(this.model, 'username', 'sex', 'realname', 'jobTitle','email', 'phone', 'activitiSync', 'workNo', 'telephone', 'post')) that.form.setFieldsValue(pick(this.model, 'username', 'sex', 'realname', 'jobTitle', 'email', 'phone', 'activitiSync', 'workNo', 'telephone', 'post'))
}) })
//身份为上级显示负责部门,否则不显示 //身份为上级显示负责部门,否则不显示
if (this.model.userIdentity == '2') { if (this.model.userIdentity == '2') {
@@ -728,7 +751,7 @@
.drawer-bootom-button { .drawer-bootom-button {
position: absolute; position: absolute;
bottom: -8px; bottom: -8px;
z-index:100; z-index: 100;
width: 100%; width: 100%;
border-top: 1px solid #e8e8e8; border-top: 1px solid #e8e8e8;
padding: 10px 16px; padding: 10px 16px;
@@ -740,6 +763,6 @@
</style> </style>
<style> <style>
.selectUserRole .ant-select-selection--multiple { .selectUserRole .ant-select-selection--multiple {
height: 100px!important; height: 100px !important;
} }
</style> </style>