| | |
| | | @click="clearAllCodeSec"> |
| | | 清空码值 |
| | | </el-button> |
| | | <el-button |
| | | size="small" |
| | | icon="el-icon-guide" |
| | | plain |
| | | @click="escapeOwner"> |
| | | 转移所有者 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | |
| | | }); |
| | | }else { |
| | | this.codeClassifyForm.oid = this.selectedFixedOrCodeclassifyValue.attributes.oid; |
| | | // 分类码段,子分类和父分类之间不能相互更改 |
| | | if(this.checkClassUpdate(this.codefixedsecOrCodeclassifysecOid,this.codeClassifyForm.codeClassifySecOid)){ |
| | | return; |
| | | } |
| | | this.$delete(this.codeClassifyForm,"parentClassifyValueOid"); |
| | | editCodeClassifyValue(this.codeClassifyForm).then(() => { |
| | | this.loadClassifyValueData({"oid":this.codefixedsecOrCodeclassifysecOid}) |
| | | this.$message({ |
| | |
| | | }); |
| | | }); |
| | | }else{ |
| | | if(this.checkClassUpdate(this.codefixedsecOrCodeclassifysecOid,this.codeClassifyForm.codeClassifySecOid)){ |
| | | return; |
| | | } |
| | | //分类码段码值删除 |
| | | this.$confirm("是否删除这条数据?如果被引用将不能被删除!", { |
| | | confirmButtonText: "确定", |
| | |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | }, |
| | | //对固定码值表进行:上移、下移、移除操作 |
| | | codeFixedValueOpetion(condition,row){ |
| | |
| | | }, |
| | | //对分类码值表进行:上移、下移、移除操作 |
| | | codeClassifyValueOpetion(condition){ |
| | | if(this.checkClassUpdate(this.codefixedsecOrCodeclassifysecOid,this.codeClassifyForm.codeClassifySecOid)){ |
| | | return; |
| | | } |
| | | //此处涉及到深浅拷贝问题,但是执行上下移保存操作之后会重新加载treedata,所以影响不大 |
| | | let currentTreeList = this.getCodeClassifyValueTreeData(); |
| | | let saveData = []; |
| | | console.log(currentTreeList.treeList); |
| | | // console.log(currentTreeList.treeList); |
| | | if(condition == 'up'){ |
| | | if(currentTreeList.index-1>=0){ |
| | | // 调整顺序 |
| | |
| | | this.saveCodeFixedOrClassifyValueOption('classifyValue',saveData); |
| | | } |
| | | } |
| | | console.log(saveData); |
| | | console.log(this.classifyValueTreeData); |
| | | }, |
| | | //选中被调整顺序的两个树的节点 |
| | | getCodeClassifyValueTreeData(){ |
| | |
| | | } |
| | | }, |
| | | //上移下移等操作的保存 |
| | | saveCodeFixedOrClassifyValueOption(condition,editOrderNumdata){ |
| | | async saveCodeFixedOrClassifyValueOption(condition,editOrderNumdata){ |
| | | //保存对固定码段码值的上移下移移出等操作 |
| | | if(condition == "fixedValue"){ |
| | | let data = { |
| | |
| | | }); |
| | | }else { |
| | | //保存对分类码值码段码值的上移下移移出等操作 |
| | | saveCodeClassifyValueOrder({ |
| | | await saveCodeClassifyValueOrder({ |
| | | "codeClassifySecOid": this.codefixedsecOrCodeclassifysecOid, |
| | | "dtoList": JSON.stringify(editOrderNumdata), |
| | | }).then(() => { |
| | |
| | | this.codeClassifyForm.id = node.attributes.id; |
| | | this.codeClassifyForm.name = node.attributes.name; |
| | | this.codeClassifyForm.parentClassifyValueOid = node.attributes.oid; |
| | | //console.log(this.codeClassifyForm); |
| | | // console.log(this.codeClassifyForm); |
| | | }, |
| | | /** |
| | | * 分类码段码值,修改、删除、上下移之前,检查是否为子分类和父分类之间相互更改 |
| | | * @currentRowClassOid 当前选中行oid |
| | | * @updateClassOid 要修改的分类码值oid |
| | | */ |
| | | checkClassUpdate(currentRowClassOid,updateClassOid){ |
| | | if(currentRowClassOid!=updateClassOid){ |
| | | this.$message({ |
| | | type: "error", |
| | | message: "操作失败【子分类与父分类之间不能相互修改码值】!" |
| | | }); |
| | | } |
| | | return currentRowClassOid!=updateClassOid; |
| | | }, |
| | | |
| | | |
| | |
| | | let form = this.form; |
| | | //console.log(form); |
| | | const regNumber = /^[0-9]+\.{0,1}[0-9]*$/; //数字或小数正则校验 |
| | | const regPos = /^[0-9]*[1-9][0-9]*$/; //非负整数正则校验 |
| | | const tipsMsg = "必填项不能为空"; |
| | | if(form.id == ''){ |
| | | this.$message.warning("(码段编号)"+tipsMsg); |
| | |
| | | //固定码段 |
| | | if(form.codeSecLengthType == ''){ |
| | | this.$message.warning("(码段长度类型)"+tipsMsg); |
| | | this.$refs.codeSecLengthType.$el.querySelector('select').focus(); |
| | | // this.$refs.codeSecLengthType.$el.querySelector('select').focus(); |
| | | return false; |
| | | } |
| | | if(form.codeSecLength == ''){ |
| | |
| | | this.$message.warning('(层级类型)'+tipsMsg); |
| | | return false; |
| | | } |
| | | if(!regNumber.test(form.codeLevelValue)){ |
| | | this.$message.warning('层级的值)只能填写数字'); |
| | | if(form.codeLevelType != 'code_level_min'&& !regNumber.test(form.codeLevelValue)){ |
| | | this.$message.warning('(层级的值)只能填写数字'); |
| | | this.$refs.codeLevelValue.$el.querySelector('input').focus(); |
| | | return false; |
| | | } |
| | | if(form.valueCutType == ''){ |
| | | this.$message.warning('(字符截取类型)'+tipsMsg); |
| | | this.$refs.valueCutType.$el.querySelector('select').focus(); |
| | | // this.$refs.valueCutType.$el.querySelector('select').focus(); |
| | | return false; |
| | | } |
| | | if(form.valueCutType != 'code_cut_none' && !regPos.test(form.valueCutLength)){ |
| | | this.$message.warning('(值截取长度)只能填写正整数'); |
| | | this.$refs.valueCutLength.$el.querySelector('input').focus(); |
| | | return false; |
| | | } |
| | | }else if(this.form.secType==='coderefersec'){ |
| | |
| | | this.sendGridCodeBasicSec({"pkCodeRule":this.selectionList[this.selectionList.length-1].oid},false); |
| | | }, |
| | | // 上移下移基础码段 |
| | | upOrderNum(row){ |
| | | async upOrderNum(row){ |
| | | if(!this.tipsMessage(this.selectionList)){ |
| | | return; |
| | | } |
| | |
| | | this.$message.warning("未获取到必填参数!"); |
| | | return; |
| | | } |
| | | upOrderNum(row.oid).then(() => { |
| | | await upOrderNum(row.oid).then(() => { |
| | | this.loadBasic(this.selectionList[0]); |
| | | this.$message({ |
| | | type: "success", |
| | |
| | | // console.log(this.form); |
| | | }, |
| | | // 第一次请求的枚举数据放缓存 |
| | | getLocalStorageEnum(key){ |
| | | let enumCach = JSON.parse(localStorage.getItem(key)); |
| | | getLocalStorageEnum(enumKey){ |
| | | let enumCach = JSON.parse(localStorage.getItem(enumKey)); |
| | | if(enumCach == null) { |
| | | getDictionary({code: key}).then(res=>{ |
| | | getDictionary({code: enumKey}).then(res=>{ |
| | | enumCach = res.data.data; |
| | | localStorage.setItem(key,JSON.stringify(res.data.data)); |
| | | localStorage.setItem(enumKey,JSON.stringify(res.data.data)); |
| | | }) |
| | | } |
| | | return enumCach; |
| | |
| | | loadCodeGetValueType(){ |
| | | this.enumParam.codeGetValueType = this.getLocalStorageEnum("codeGetValueType"); |
| | | }, |
| | | |
| | | |
| | | } |
| | | }; |
| | | |