|
|
|
|
@ -45,7 +45,7 @@
|
|
|
|
|
size="small"
|
|
|
|
|
type="primary"
|
|
|
|
|
ghost
|
|
|
|
|
@click="form.audit_admin.splice(scope.$index, 1)"
|
|
|
|
|
@click="delRow(scope.$index)"
|
|
|
|
|
>删除</Button
|
|
|
|
|
>
|
|
|
|
|
</template>
|
|
|
|
|
@ -95,7 +95,7 @@
|
|
|
|
|
audit_admin:[],
|
|
|
|
|
remark:""
|
|
|
|
|
},
|
|
|
|
|
checkList:['一级审核人','二级审核人','三级审核人'],
|
|
|
|
|
checkList:[],
|
|
|
|
|
rules:{
|
|
|
|
|
name:[
|
|
|
|
|
{
|
|
|
|
|
@ -207,15 +207,65 @@
|
|
|
|
|
name:res?.name,
|
|
|
|
|
audit_admin:res?.audit_admin,
|
|
|
|
|
remark:res?.remark
|
|
|
|
|
}
|
|
|
|
|
let arr = []
|
|
|
|
|
if(res.audit_admin.length>0){
|
|
|
|
|
res.audit_admin.map((item,index)=>{
|
|
|
|
|
arr.push(`${this.indexToChinese(index)}级审核人`)
|
|
|
|
|
})
|
|
|
|
|
this.checkList = arr
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
addRow(){
|
|
|
|
|
if(this.form.audit_admin.length==3){
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
// if(this.form.audit_admin.length==3){
|
|
|
|
|
// return
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
this.form.audit_admin.push({ type:'',admin_id:'',level:'',type_name:'',admin_name:'' })
|
|
|
|
|
let checkName = `${this.indexToChinese(this.form.audit_admin.length-1)}级审核人`
|
|
|
|
|
this.checkList.push(checkName)
|
|
|
|
|
console.log("this.checkList",this.checkList)
|
|
|
|
|
},
|
|
|
|
|
delRow(index){
|
|
|
|
|
this.form.audit_admin.splice(index, 1)
|
|
|
|
|
this.checkList.splice(index, 1)
|
|
|
|
|
let arr = []
|
|
|
|
|
this.checkList.map((item,index)=>{
|
|
|
|
|
arr.push(`${this.indexToChinese(index)}级审核人`)
|
|
|
|
|
})
|
|
|
|
|
this.checkList = arr
|
|
|
|
|
console.log("this.arr",this.checkList)
|
|
|
|
|
},
|
|
|
|
|
indexToChinese(index) {
|
|
|
|
|
const chineseNumbers = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十'];
|
|
|
|
|
if (index >= 0 && index < 10) {
|
|
|
|
|
return chineseNumbers[index];
|
|
|
|
|
} else if (index === 10) {
|
|
|
|
|
return '十';
|
|
|
|
|
} else if (index < 20) {
|
|
|
|
|
return '十' + chineseNumbers[index - 11];
|
|
|
|
|
} else {
|
|
|
|
|
const tens = Math.floor(index / 10);
|
|
|
|
|
const units = index % 10;
|
|
|
|
|
let result = '';
|
|
|
|
|
if (tens > 1) {
|
|
|
|
|
result += chineseNumbers[tens - 1] + '十';
|
|
|
|
|
} else {
|
|
|
|
|
result += '十';
|
|
|
|
|
}
|
|
|
|
|
if (units > 0) {
|
|
|
|
|
result += chineseNumbers[units - 1];
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
submit() {
|
|
|
|
|
|
|
|
|
|
if(this.form.audit_admin.length>0){
|
|
|
|
|
this.form.audit_admin.map((item,index)=>{
|
|
|
|
|
item.level = index+1
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
console.log(this.form)
|
|
|
|
|
// return
|
|
|
|
|
let that = this
|
|
|
|
|
@ -241,7 +291,8 @@
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.id = ''
|
|
|
|
|
this.type = ''
|
|
|
|
|
this.type = ''
|
|
|
|
|
this.checkList = []
|
|
|
|
|
this.$refs['dialog'].reset()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|