| | |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="补位时的字符:" :label-width="rightFormLabelWidth"> |
| | | <el-form-item v-if="form.codeFillType!='code_fill_none'" label="补位时的字符:" :label-width="rightFormLabelWidth"> |
| | | <el-select v-model="form.codeFillSeparator" @blur="inputSelectBlur" filterable placeholder="请选择" :disabled="basicSecOnlyRead"> |
| | | <el-option |
| | | v-for="item in enumParam.codeFillSeparator" |
| | |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item id="ShowOrHide" v-mode="showCutLength" v-if="showCutLength==true" label="值截取长度:" :label-width="rightFormLabelWidth"> |
| | | <el-form-item id="ShowOrHide" v-if="form.valueCutType!='code_cut_none'" label="值截取长度:" :label-width="rightFormLabelWidth"> |
| | | <el-input v-model.number="form.valueCutLength" ref="valueCutLength" :readonly="basicSecOnlyRead"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="取值类型:" :label-width="rightFormLabelWidth"> |
| | |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="补位时的字符:" :label-width="rightFormLabelWidth"> |
| | | <el-form-item v-if="form.codeFillType!='code_fill_none'" label="补位时的字符:" :label-width="rightFormLabelWidth"> |
| | | <el-select v-model="form.codeFillSeparator" filterable @blur="inputSelectBlur" placeholder="请选择" :disabled="basicSecOnlyRead"> |
| | | <el-option |
| | | v-for="item in enumParam.codeFillSeparator" |
| | |
| | | total: 0 |
| | | }, |
| | | selectionList: [], |
| | | showCutLength: false, |
| | | /*编码规则表格配置*/ |
| | | optionRule: optionRule, |
| | | data: [], |
| | |
| | | }, |
| | | watch:{ |
| | | |
| | | }, |
| | | mounted(){ |
| | | this.loadTotalEnum(); |
| | | }, |
| | | methods: { |
| | | |
| | |
| | | }); |
| | | }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; |
| | | }, |
| | | |
| | | |
| | |
| | | window.console.log(error); |
| | | }); |
| | | this.loadBasic(this.selectionList[0]); |
| | | // 关闭对话框 |
| | | this.addBasicCodeSettingBox = false |
| | | } |
| | | }, |
| | | // 因为elementui的表单校验设置不上所以采用判断的方式来做表单检验方式 |
| | |
| | | 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", |
| | |
| | | }, |
| | | // 添加 |
| | | rowSave(row, done, loading) { |
| | | console.log(row); |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | |
| | | }, |
| | | changeCutType(value){ |
| | | if (value != 'code_cut_none'){ |
| | | this.showCutLength = true; |
| | | if(this.form.valueCutLength == ''){ |
| | | this.form.valueCutLength = 1; |
| | | } |
| | | }else{ |
| | | this.form.valueCutLength = ''; |
| | | this.showCutLength = false; |
| | | } |
| | | }, |
| | | // 单击编码规则实现行选择 |
| | |
| | | valueCutLength: row!=null&&row.valueCutLength != '' ? row.valueCutLength:'', // |
| | | codeGetValueType: row!=null&&row.codeGetValueType != '' ? row.codeGetValueType:'code_get_value_all_up', //取值类型 枚举查询 |
| | | }); |
| | | if(this.form.valueCutType === 'code_cut_none'){ |
| | | this.showCutLength = false; |
| | | }else{ |
| | | this.showCutLength = true; |
| | | } |
| | | |
| | | this.loadCodeLevelType(); |
| | | this.loadCodeCutType(); |
| | | this.loadCodeGetValueType(); |
| | |
| | | // 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; |
| | | }, |
| | | // 统一加载所有枚举查询,主要是为避免切换码段类型时还未加载完成的情况 |
| | | loadTotalEnum(){ |
| | | this.loadCodeSecType(); |
| | | this.loadCodeSecLength(); |
| | | this.loadCodeFillType(); |
| | | this.loadCodeFillSeparator(); |
| | | this.loadCodeLevelType(); |
| | | this.loadCodeCutType(); |
| | | this.loadCodeGetValueType(); |
| | | }, |
| | | //枚举和可输可选内容查询 |
| | | loadCodeSecType(){ |
| | |
| | | loadCodeGetValueType(){ |
| | | this.enumParam.codeGetValueType = this.getLocalStorageEnum("codeGetValueType"); |
| | | }, |
| | | |
| | | |
| | | } |
| | | }; |
| | | |