|
@@ -128,7 +128,14 @@
|
|
</el-cascader>
|
|
</el-cascader>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="添加序号" prop="code">
|
|
<el-form-item label="添加序号" prop="code">
|
|
- <el-input v-model="addDialogForm.code" placeholder="未选择指标" maxLength="6" disabled style="width:548px;"/>
|
|
|
|
|
|
+ <div class="code-max-box">
|
|
|
|
+ <el-input v-model="addDialogForm.code" placeholder="未选择指标"
|
|
|
|
+ maxLength="6" disabled style="width:500px;"/>
|
|
|
|
+ <div class="code-button-box">
|
|
|
|
+ <p class="el-icon-arrow-up" @click="codeButton(1)"></p>
|
|
|
|
+ <p class="el-icon-arrow-down" @click="codeButton(2)"></p>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="检查项目" prop="name">
|
|
<el-form-item label="检查项目" prop="name">
|
|
<el-input
|
|
<el-input
|
|
@@ -219,6 +226,7 @@
|
|
{ required: true, message: "请输入检查项目内容", validator: this.spaceJudgment, trigger: "change" },
|
|
{ required: true, message: "请输入检查项目内容", validator: this.spaceJudgment, trigger: "change" },
|
|
],
|
|
],
|
|
},
|
|
},
|
|
|
|
+ checkList:[],
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created(){
|
|
created(){
|
|
@@ -257,6 +265,7 @@
|
|
},
|
|
},
|
|
//添加页面开启
|
|
//添加页面开启
|
|
addDialogOpen(type,row){
|
|
addDialogOpen(type,row){
|
|
|
|
+ console.log('row',row)
|
|
if(type == 1){
|
|
if(type == 1){
|
|
//新增
|
|
//新增
|
|
this.$set(this,'addDialogTitle','添加检查项目');
|
|
this.$set(this,'addDialogTitle','添加检查项目');
|
|
@@ -272,6 +281,7 @@
|
|
//列表新增
|
|
//列表新增
|
|
this.$set(this,'addDialogTitle','添加检查项目');
|
|
this.$set(this,'addDialogTitle','添加检查项目');
|
|
let obj = this.cascaderCheckData(row.id,this.cascaderDataPrimitive);
|
|
let obj = this.cascaderCheckData(row.id,this.cascaderDataPrimitive);
|
|
|
|
+ this.$set(this,'checkList',JSON.parse(JSON.stringify(row.children)));
|
|
this.$set(this,'addDialogLevel',obj.level);
|
|
this.$set(this,'addDialogLevel',obj.level);
|
|
this.$set(this,'addDialogForm',{
|
|
this.$set(this,'addDialogForm',{
|
|
parentId:row.id,
|
|
parentId:row.id,
|
|
@@ -291,6 +301,7 @@
|
|
name:row.name,
|
|
name:row.name,
|
|
mainPoint:row.mainPoint,
|
|
mainPoint:row.mainPoint,
|
|
});
|
|
});
|
|
|
|
+ this.getCodeButton(this.cascaderDataPrimitive,row.parentId,row.id);
|
|
this.$set(this,'addDialogType',true);
|
|
this.$set(this,'addDialogType',true);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -302,6 +313,7 @@
|
|
cascaderCheck(val){
|
|
cascaderCheck(val){
|
|
let obj = this.cascaderCheckData(val,this.cascaderDataPrimitive);
|
|
let obj = this.cascaderCheckData(val,this.cascaderDataPrimitive);
|
|
this.$set(this.addDialogForm,'code',obj.key);
|
|
this.$set(this.addDialogForm,'code',obj.key);
|
|
|
|
+ this.getCodeButton(this.cascaderDataPrimitive,obj.parentId,val);
|
|
this.$set(this,'addDialogLevel',obj.level);
|
|
this.$set(this,'addDialogLevel',obj.level);
|
|
},
|
|
},
|
|
//序号自增
|
|
//序号自增
|
|
@@ -317,7 +329,7 @@
|
|
}
|
|
}
|
|
if(list[i].children){
|
|
if(list[i].children){
|
|
if(list[i].children[0]){
|
|
if(list[i].children[0]){
|
|
- obj.key = list[i].code ? list[i].code + '.' + self.getChekeListKey(list[i].children) : self.getChekeListKey(list[i].children)
|
|
|
|
|
|
+ obj.key = list[i].code ? list[i].code + '.' + self.getListKey(list[i].children) : self.getListKey(list[i].children)
|
|
}else{
|
|
}else{
|
|
obj.key = list[i].code ? list[i].code+'.1':'1'
|
|
obj.key = list[i].code ? list[i].code+'.1':'1'
|
|
}
|
|
}
|
|
@@ -340,7 +352,7 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//自动补位计算
|
|
//自动补位计算
|
|
- getChekeListKey(dataList){
|
|
|
|
|
|
+ getListKey(dataList){
|
|
let num = 0;
|
|
let num = 0;
|
|
for(let i=0;i<dataList.length;i++){
|
|
for(let i=0;i<dataList.length;i++){
|
|
let list = dataList[i].code.split('.');
|
|
let list = dataList[i].code.split('.');
|
|
@@ -356,6 +368,106 @@
|
|
}
|
|
}
|
|
return num+1
|
|
return num+1
|
|
},
|
|
},
|
|
|
|
+ //序号调整按钮
|
|
|
|
+ codeButton(type){
|
|
|
|
+ let obj = this.getListCode(this.addDialogForm.code,type,this.checkList);
|
|
|
|
+ if(obj.type){
|
|
|
|
+ this.$set(this.addDialogForm,'code',obj.value);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ getListCode(code,type,list){
|
|
|
|
+ let codeList = code.split('.');
|
|
|
|
+ let codeNum = parseInt(codeList[codeList.length-1]);
|
|
|
|
+ let codeText = '';
|
|
|
|
+ let obj = {type:false,value:""}
|
|
|
|
+ if(!list[0]){
|
|
|
|
+ return obj
|
|
|
|
+ }
|
|
|
|
+ if(type == 1){
|
|
|
|
+ if(codeNum==1 || !list[0]){
|
|
|
|
+ return obj
|
|
|
|
+ }
|
|
|
|
+ }else if(type == 2){
|
|
|
|
+ let maxList = list[list.length-1].code.split('.')
|
|
|
|
+ let maxCode = parseInt(maxList[maxList.length-1]);
|
|
|
|
+ if(codeNum > maxCode){
|
|
|
|
+ return obj
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ for(let i=0;i<codeList.length-1;i++){
|
|
|
|
+ if(i===0){
|
|
|
|
+ codeText = codeText + codeList[i]
|
|
|
|
+ }else{
|
|
|
|
+ codeText = codeText +'.'+ codeList[i]
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ let age = parseInt(codeNum);
|
|
|
|
+ if(type == 1){
|
|
|
|
+ age--
|
|
|
|
+ for(age;age>0;age--){
|
|
|
|
+ let counter = 0;
|
|
|
|
+ for(let o=0;o<list.length;o++){
|
|
|
|
+ let codeList = list[o].code.split('.');
|
|
|
|
+ let code = parseInt(codeList[codeList.length-1]);
|
|
|
|
+ if(code == age){
|
|
|
|
+ counter++
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(counter == 0){
|
|
|
|
+ return {
|
|
|
|
+ type:true,
|
|
|
|
+ value:codeText?codeText+'.'+age:age+''
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return obj;
|
|
|
|
+ }else if(type == 2){
|
|
|
|
+ age++
|
|
|
|
+ for(age;age<999;age++){
|
|
|
|
+ let counter = 0;
|
|
|
|
+ for(let o=0;o<list.length;o++){
|
|
|
|
+ let codeList = list[o].code.split('.');
|
|
|
|
+ let code = parseInt(codeList[codeList.length-1]);
|
|
|
|
+ if(code == age){
|
|
|
|
+ counter++
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(counter == 0){
|
|
|
|
+ return {
|
|
|
|
+ type:true,
|
|
|
|
+ value:codeText?codeText+'.'+age:age+''
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return obj;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //选中同级数据
|
|
|
|
+ getCodeButton(list,parentId,id){
|
|
|
|
+ let self = this;
|
|
|
|
+ for(let i=0;i<list.length;i++){
|
|
|
|
+ if(list[i].id == parentId){
|
|
|
|
+ if(list[i].children){
|
|
|
|
+ let newList = JSON.parse(JSON.stringify(list[i].children))
|
|
|
|
+ for(let o=0;o<newList.length;o++){
|
|
|
|
+ if(newList[o].id == id){
|
|
|
|
+ newList.splice(o,1)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.$set(this,'checkList',newList);
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ if (list[i].level<3){
|
|
|
|
+ if(list[i].children){
|
|
|
|
+ if(list[i].children[0]){
|
|
|
|
+ self.getCodeButton(list[i].children,parentId,id)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
//删除
|
|
//删除
|
|
delItem(row){
|
|
delItem(row){
|
|
let self = this;
|
|
let self = this;
|
|
@@ -453,6 +565,10 @@
|
|
let type = false;
|
|
let type = false;
|
|
console.log('file',file);
|
|
console.log('file',file);
|
|
if (file.type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' || file.type == 'application/vnd.ms-excel') {
|
|
if (file.type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' || file.type == 'application/vnd.ms-excel') {
|
|
|
|
+ if(file.size> 5250000){
|
|
|
|
+ this.msgError('上传大小不能超过5M')
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
this.getImportData.textName = file.name;
|
|
this.getImportData.textName = file.name;
|
|
type = true;
|
|
type = true;
|
|
this.loading = true;
|
|
this.loading = true;
|
|
@@ -502,7 +618,7 @@
|
|
cancelButtonText: "取消",
|
|
cancelButtonText: "取消",
|
|
type: "warning"
|
|
type: "warning"
|
|
}).then(async () => {
|
|
}).then(async () => {
|
|
- self.download('/system/user/teacher/export/', {...self.queryParams}, '教职工信息-'+this.currentDate+'.xlsx')
|
|
|
|
|
|
+ self.download('/zd-security/checkOption/export/', {...self.queryParams}, '项目检查库.xlsx')
|
|
}).catch(() => {})
|
|
}).catch(() => {})
|
|
}else if(item.command == 2){
|
|
}else if(item.command == 2){
|
|
if(self.ids.length>0) {
|
|
if(self.ids.length>0) {
|
|
@@ -717,5 +833,37 @@
|
|
background: rgba(255,255,255,0.4);
|
|
background: rgba(255,255,255,0.4);
|
|
border-radius:20px;
|
|
border-radius:20px;
|
|
}
|
|
}
|
|
|
|
+ .code-max-box{
|
|
|
|
+ display: flex;
|
|
|
|
+ .code-button-box{
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ margin-left:8px;
|
|
|
|
+ p{
|
|
|
|
+ width:40px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ line-height:19px;
|
|
|
|
+ font-size:14px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ color:#d8d8d8;
|
|
|
|
+ }
|
|
|
|
+ p:nth-child(1){
|
|
|
|
+ border:1px solid #d8d8d8;
|
|
|
|
+ border-top-left-radius: 4px;
|
|
|
|
+ border-top-right-radius: 4px;
|
|
|
|
+ }
|
|
|
|
+ p:nth-child(2){
|
|
|
|
+ border-bottom:1px solid #d8d8d8;
|
|
|
|
+ border-left:1px solid #d8d8d8;
|
|
|
|
+ border-right:1px solid #d8d8d8;
|
|
|
|
+ border-bottom-left-radius: 4px;
|
|
|
|
+ border-bottom-right-radius: 4px;
|
|
|
|
+ }
|
|
|
|
+ p:hover{
|
|
|
|
+ color:#fff;
|
|
|
|
+ background-color: #d8d8d8;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|