|
@@ -7,7 +7,7 @@
|
|
|
</div>
|
|
|
<div class="content-box scrollbar-box">
|
|
|
<el-form class="add-form-box" :model="newData" ref="form" :rules="rules" label-width="110px">
|
|
|
- <div>
|
|
|
+ <div style="margin-top:20px;">
|
|
|
<el-form-item label="管控名称" prop="name">
|
|
|
<el-input v-model="newData.name" placeholder="请输入管控名称" maxLength="20" style="width:260px;"></el-input>
|
|
|
</el-form-item>
|
|
@@ -44,23 +44,44 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
- <el-form-item label="管控描述" prop="describe">
|
|
|
+ <div>
|
|
|
+ <el-form-item label="执行人员" prop="executionUserId">
|
|
|
+ <el-select
|
|
|
+ style="width:260px;"
|
|
|
+ v-model="newData.executionUserId"
|
|
|
+ filterable
|
|
|
+ remote
|
|
|
+ clearable
|
|
|
+ reserve-keyword
|
|
|
+ @change="userChange"
|
|
|
+ placeholder="请输入姓名/工号/手机号"
|
|
|
+ :remote-method="userSelectList">
|
|
|
+ <el-option
|
|
|
+ v-for="item in optionsUser"
|
|
|
+ :key="item.userId"
|
|
|
+ :label="item.userName"
|
|
|
+ :value="item.userId">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ <el-form-item label="管控描述" prop="manageDes">
|
|
|
<el-input type="textarea" resize="none" style="width:630px;" show-word-limit
|
|
|
:rows="4"
|
|
|
- v-model="newData.describe" placeholder="请输入管控描述" maxlength="100"/>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="执行人员" prop="userList">
|
|
|
- <div class="max-big-user-box" style="width:1400px;">
|
|
|
- <div class="for-user-box" style="display: inline-block;border:1px solid #0045AF;border-radius:4px;padding:0 10px;margin:5px 20px 5px 0;"
|
|
|
- v-for="(item,index) in newData.userList" :key="index">
|
|
|
- <div class="for-user-min-box" style="display: flex;">
|
|
|
- <p class="user-name-p" style="width:200px;line-height:30px;font-size:14px;color:#0045AF;">{{item.userName}}</p>
|
|
|
- <p class="user-del-button el-icon-error" style="cursor: pointer;line-height:30px;color:#999;" @click="delUser(index)"></p>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <p class="add-button-p" style="margin:5px 0 0 0;cursor: pointer;text-align: center;font-size:14px;border-radius:4px;width:140px;line-height:30px;color:#0183FA;border:1px solid #0183FA;" @click="shadeOpen" v-if="!newData.userList[9]">添加人员</p>
|
|
|
+ v-model="newData.manageDes" placeholder="请输入管控描述" maxlength="100"/>
|
|
|
</el-form-item>
|
|
|
+ <!--<el-form-item label="执行人员" prop="userList">-->
|
|
|
+ <!--<div class="max-big-user-box" style="width:1400px;">-->
|
|
|
+ <!--<div class="for-user-box" style="display: inline-block;border:1px solid #0045AF;border-radius:4px;padding:0 10px;margin:5px 20px 5px 0;"-->
|
|
|
+ <!--v-for="(item,index) in newData.userList" :key="index">-->
|
|
|
+ <!--<div class="for-user-min-box" style="display: flex;">-->
|
|
|
+ <!--<p class="user-name-p" style="width:200px;line-height:30px;font-size:14px;color:#0045AF;">{{item.userName}}</p>-->
|
|
|
+ <!--<p class="user-del-button el-icon-error" style="cursor: pointer;line-height:30px;color:#999;" @click="delUser(index)"></p>-->
|
|
|
+ <!--</div>-->
|
|
|
+ <!--</div>-->
|
|
|
+ <!--</div>-->
|
|
|
+ <!--<p class="add-button-p" style="margin:5px 0 0 0;cursor: pointer;text-align: center;font-size:14px;border-radius:4px;width:140px;line-height:30px;color:#0183FA;border:1px solid #0183FA;" @click="shadeOpen" v-if="!newData.userList[9]">添加人员</p>-->
|
|
|
+ <!--</el-form-item>-->
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<el-dialog class="conditionsSettings-dialog" title='添加人员' width="460px" append-to-body
|
|
@@ -106,81 +127,125 @@
|
|
|
laboratoryClassLevelGetList,
|
|
|
systemUserSelect
|
|
|
} from '@/api/commonality/permission'
|
|
|
- //import { getDicts } from "@/api/commonality/noPermission";
|
|
|
- //import { systemUserSelect } from "@/api/commonality/permission";
|
|
|
- //import { getInfo } from "@/api/basicsModules/index";
|
|
|
+ import { laboratoryGradeManageAdd,laboratoryGradeManageUpdate } from "@/api/hierarchicalControl/index";
|
|
|
export default {
|
|
|
name: 'addPage',
|
|
|
- props:{
|
|
|
- propsData:{},
|
|
|
+ props: {
|
|
|
+ propsData: {}
|
|
|
},
|
|
|
- data(){
|
|
|
- return{
|
|
|
- newData:{
|
|
|
- name:'',
|
|
|
- describe:'',
|
|
|
- deptId:'',
|
|
|
- typeId:'',
|
|
|
- levelId:'',
|
|
|
- userList:[],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ newData: {
|
|
|
+ name: '',
|
|
|
+ manageDes: '',
|
|
|
+ deptId: '',
|
|
|
+ typeId: '',
|
|
|
+ levelId: '',
|
|
|
+ executionUserId: '',
|
|
|
},
|
|
|
//下拉列表数据
|
|
|
- deptOptions:[],
|
|
|
- typeList:[],
|
|
|
- levelList:[],
|
|
|
+ deptOptions: [],
|
|
|
+ typeList: [],
|
|
|
+ levelList: [],
|
|
|
rules: {
|
|
|
name: [
|
|
|
- { required: true, message: "请输入管控名称", trigger: "blur" },
|
|
|
- { required: true, message: "请输入管控名称", validator: this.spaceJudgment, trigger: "blur" }
|
|
|
+ { required: true, message: '请输入管控名称', trigger: 'blur' },
|
|
|
+ { required: true, message: '请输入管控名称', validator: this.spaceJudgment, trigger: 'blur' }
|
|
|
],
|
|
|
- describe: [
|
|
|
- { required: true, message: "请输入管控描述", trigger: "blur" },
|
|
|
- { required: true, message: "请输入管控描述", validator: this.spaceJudgment, trigger: "blur" }
|
|
|
+ manageDes: [
|
|
|
+ { required: true, message: '请输入管控描述', trigger: 'blur' },
|
|
|
+ { required: true, message: '请输入管控描述', validator: this.spaceJudgment, trigger: 'blur' }
|
|
|
],
|
|
|
deptId: [
|
|
|
- { required: true, message: "请选择二级单位", trigger: "blur" },
|
|
|
+ { required: true, message: '请选择二级单位', trigger: 'blur' }
|
|
|
],
|
|
|
typeId: [
|
|
|
- { required: true, message: "请选择安全分类", trigger: "blur" },
|
|
|
+ { required: true, message: '请选择安全分类', trigger: 'blur' }
|
|
|
],
|
|
|
levelId: [
|
|
|
- { required: true, message: "请选择安全分级", trigger: "blur" },
|
|
|
- ],
|
|
|
- userList: [
|
|
|
- { required: true, message: "请选择执行人员", trigger: "blur" },
|
|
|
+ { required: true, message: '请选择安全分级', trigger: 'blur' }
|
|
|
],
|
|
|
+ executionUserId: [
|
|
|
+ { required: true, message: '请选择执行人员', trigger: 'blur' }
|
|
|
+ ]
|
|
|
},
|
|
|
shadeRules: {
|
|
|
userId: [
|
|
|
- { required: true, message: "请选择人员", trigger: "blur" },
|
|
|
- ],
|
|
|
+ { required: true, message: '请选择人员', trigger: 'blur' }
|
|
|
+ ]
|
|
|
},
|
|
|
- shadeType:false,
|
|
|
+ shadeType: false,
|
|
|
// 人员查询列表
|
|
|
userName: '',
|
|
|
userId: '',
|
|
|
optionsUser: [],
|
|
|
- shadeForm:{},
|
|
|
+ shadeForm: {}
|
|
|
}
|
|
|
},
|
|
|
- created(){
|
|
|
- this.getDeptDropList();
|
|
|
- this.laboratoryClassTypeGetList();
|
|
|
- this.laboratoryClassLevelGetList();
|
|
|
+ created() {
|
|
|
+ this.getDeptDropList()
|
|
|
+ this.laboratoryClassTypeGetList()
|
|
|
+ this.laboratoryClassLevelGetList()
|
|
|
},
|
|
|
- mounted(){
|
|
|
-
|
|
|
+ mounted() {
|
|
|
+ if(this.propsData.id){
|
|
|
+ this.$set(this,'newData',this.propsData);
|
|
|
+ this.$set(this,'optionsUser',[{
|
|
|
+ userId:this.propsData.executionUserId,
|
|
|
+ userName:this.propsData.executionUser,
|
|
|
+ }]);
|
|
|
+ }
|
|
|
},
|
|
|
- methods:{
|
|
|
+ methods: {
|
|
|
// 返回按钮
|
|
|
- backPage(){
|
|
|
- this.$parent.tableButton(6);
|
|
|
+ backPage() {
|
|
|
+ this.$parent.tableButton(6)
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
+ let self = this;
|
|
|
+ this.$refs['form'].validate(valid => {
|
|
|
if (valid) {
|
|
|
-
|
|
|
+ let obj = {
|
|
|
+ name: this.newData.name, //管控名称
|
|
|
+ deptId: this.newData.deptId, //二级单位ID
|
|
|
+ typeId: this.newData.typeId, //分类ID
|
|
|
+ levelId: this.newData.levelId, //分级ID
|
|
|
+ executionUserId: this.newData.executionUserId, //执行人员ID
|
|
|
+ manageDes: this.newData.manageDes //管控描述
|
|
|
+ }
|
|
|
+ this.deptOptions.forEach((item)=>{
|
|
|
+ if(item.deptId == self.newData.deptId){
|
|
|
+ obj.deptName = item.deptName
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.typeList.forEach((item)=>{
|
|
|
+ if(item.typeId == self.newData.typeId){
|
|
|
+ obj.typeName = item.typeName
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.levelList.forEach((item)=>{
|
|
|
+ if(item.levelId == self.newData.levelId){
|
|
|
+ obj.levelName = item.levelName
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.optionsUser.forEach((item)=>{
|
|
|
+ if(item.userId == self.newData.executionUserId){
|
|
|
+ obj.executionUser = item.userName
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if(this.newData.id){
|
|
|
+ obj.id = this.newData.id;
|
|
|
+ laboratoryGradeManageUpdate(obj).then(response => {
|
|
|
+ this.msgSuccess(response.message)
|
|
|
+ this.backPage();
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ laboratoryGradeManageAdd(obj).then(response => {
|
|
|
+ this.msgSuccess(response.message)
|
|
|
+ this.backPage();
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -220,20 +285,20 @@
|
|
|
},
|
|
|
//弹窗确定
|
|
|
shadeUp() {
|
|
|
- let self = this;
|
|
|
+ let self = this
|
|
|
this.$refs['shadeForm'].validate(valid => {
|
|
|
if (valid) {
|
|
|
- for (let i=0;i<self.newData.userList.length;i++){
|
|
|
- if (self.newData.userList[i].userId == this.userId){
|
|
|
+ for (let i = 0; i < self.newData.userList.length; i++) {
|
|
|
+ if (self.newData.userList[i].userId == this.userId) {
|
|
|
this.msgError('人员已存在')
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
this.newData.userList.push({
|
|
|
- userName:this.userName,
|
|
|
- userId:this.userId,
|
|
|
- });
|
|
|
- this.shadeOut();
|
|
|
+ userName: this.userName,
|
|
|
+ userId: this.userId
|
|
|
+ })
|
|
|
+ this.shadeOut()
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -252,7 +317,7 @@
|
|
|
if (query !== '' && query.length > 1) {
|
|
|
systemUserSelect({
|
|
|
'searchValue': query,
|
|
|
- 'userType': '',
|
|
|
+ 'userType': ''
|
|
|
}).then(response => {
|
|
|
this.$set(this, 'optionsUser', response.data)
|
|
|
})
|
|
@@ -260,21 +325,21 @@
|
|
|
this.$set(this, 'optionsUser', [])
|
|
|
}
|
|
|
},
|
|
|
- delUser(index){
|
|
|
- this.newData.userList.splice(index,1)
|
|
|
- },
|
|
|
- },
|
|
|
+ delUser(index) {
|
|
|
+ this.newData.userList.splice(index, 1)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
- .conditionsSettings-addPage{
|
|
|
- .content-box{
|
|
|
- flex:1;
|
|
|
+ .conditionsSettings-addPage {
|
|
|
+ .content-box {
|
|
|
+ flex: 1;
|
|
|
display: flex;
|
|
|
- padding:20px;
|
|
|
- .add-form-box{
|
|
|
- .el-form-item{
|
|
|
+ padding: 20px;
|
|
|
+ .add-form-box {
|
|
|
+ .el-form-item {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
}
|