| | |
| | | size="small" |
| | | icon="el-icon-search" |
| | | plain |
| | | :disabled="selectionList.length <= 0" |
| | | @click="openAdvancedQuery('codeBasicSec')"> |
| | | 高级查询 |
| | | </el-button> |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="补位时的字符:" :label-width="rightFormLabelWidth"> |
| | | <el-select v-model="form.codeFillSeparatorSelect" @blur="inputSelectBlur" filterable placeholder="请选择" :disabled="basicSecOnlyRead"> |
| | | <el-select v-model="form.codeFillSeparator" @blur="inputSelectBlur" filterable placeholder="请选择" :disabled="basicSecOnlyRead"> |
| | | <el-option |
| | | v-for="item in enumParam.codeFillSeparator" |
| | | :key="item.itemValue" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="补位时的字符:" :label-width="rightFormLabelWidth"> |
| | | <el-select v-model="form.codeFillSeparatorSelect" filterable @blur="inputSelectBlur" placeholder="请选择" :disabled="basicSecOnlyRead"> |
| | | <el-select v-model="form.codeFillSeparator" filterable @blur="inputSelectBlur" placeholder="请选择" :disabled="basicSecOnlyRead"> |
| | | <el-option |
| | | v-for="item in enumParam.codeFillSeparator" |
| | | :key="item.itemValue" |
| | |
| | | //console.log(conditionMaps); |
| | | } |
| | | }, |
| | | |
| | | /* 公式编辑框内容改变,子组件编辑完公式之后内容回显时调用 */ |
| | | updateFormulaContent(content){ |
| | | this.form.getValueClass = content; |
| | |
| | | let parentClsParam = this.parentClsfyParams; |
| | | parentClsParam.classifyDialogLoading = true; |
| | | let oid = this.selectionList.length==0 ? this.form.pkCodeRule:this.selectionList[0].oid; |
| | | let conditionMaps = this.paramsToConditionMa({"pkCodeRule":oid}); |
| | | let conditionMaps = {}; |
| | | conditionMaps['conditionMap[pkCodeRule]'] = oid; |
| | | refDataGridClassifySec( |
| | | page.currentPage, |
| | | page.pageSize, |
| | |
| | | // 关闭对话框 |
| | | this.addBasicCodeSettingBox = false |
| | | } |
| | | |
| | | // 点击新增基础码段,关闭窗口之后触发重新加载 |
| | | this.loadBasic(this.selectionList[0]); |
| | | }else{ |
| | | editSave(this.form).then(() => { |
| | | // 关闭对话框 |
| | |
| | | }, error => { |
| | | window.console.log(error); |
| | | }); |
| | | this.loadBasic(this.selectionList[0]); |
| | | } |
| | | // 点击新增基础码段,关闭窗口之后触发重新加载 |
| | | this.loadBasic(this.selectionList[0]); |
| | | }, |
| | | // 因为elementui的表单校验设置不上所以采用判断的方式来做表单检验方式 |
| | | checkForm(){ |
| | |
| | | this.$message.warning('(编码补位方式)'+tipsMsg); |
| | | return false; |
| | | } |
| | | if(form.codeFillType != '不补位' && form.codeFillSeparatorSelect == ''){ |
| | | if(form.codeFillType != '不补位' && form.codeFillSeparator == ''){ |
| | | this.$message.warning('当补位方式为左补位或者右补位的时候,补位字符不能为空'); |
| | | return false; |
| | | } |
| | |
| | | this.$refs.codeFillLimit.$el.querySelector('input').focus(); |
| | | return false; |
| | | } |
| | | if(form.codeFillFlag == ''){ |
| | | this.$message.warning('(流水是否补码)'+tipsMsg); |
| | | this.$refs.switch.$el.querySelector('input').focus(); |
| | | return false; |
| | | } |
| | | // if(form.codeFillFlag == '' || ){ |
| | | // this.$message.warning('(流水是否补码)'+tipsMsg); |
| | | // return false; |
| | | // } |
| | | }else if(this.form.secType==='codelevelsec'){ |
| | | //层级码段 |
| | | if(form.codeLevelType == ''){ |
| | |
| | | this.$message.warning('(编码补位方式)'+tipsMsg); |
| | | return false; |
| | | } |
| | | if(form.codeFillType != '不补位' && form.codeFillSeparatorSelect == ''){ |
| | | // console.log(form); |
| | | if(form.codeFillType != 'code_fill_none' && form.codeFillSeparator == ''){ |
| | | this.$message.warning('当补位方式为左补位或者右补位的时候,补位字符不能为空'); |
| | | return false; |
| | | } |
| | |
| | | } |
| | | // console.log(row.oid); |
| | | //存储当前关联的编码规则相关信息 |
| | | this.currentCodeRuleOid = row.oid; |
| | | this.currentRuleLcStatus = row.lcStatus; |
| | | this.sendGridCodeBasicSec({"pkCodeRule":row.oid},false); |
| | | if(row!='' || row!=null){ |
| | | this.currentCodeRuleOid = row.oid; |
| | | this.currentRuleLcStatus = row.lcStatus; |
| | | this.sendGridCodeBasicSec({"pkCodeRule":row.oid},false); |
| | | } |
| | | }, |
| | | // 发送加载基础码段的请求 |
| | | sendGridCodeBasicSec(condition,isAdancedQuery/** 是否高级查询 */){ |
| | |
| | | let conditionMaps = {}; |
| | | if(condition && !isAdancedQuery){ |
| | | Object.keys(condition).forEach(key=>{ |
| | | conditionMaps['conditionMap[pl_code_basicsec.'+key+']'] = condition[key].trim(); |
| | | conditionMaps['conditionMap['+key+']'] = condition[key].trim(); |
| | | }); |
| | | } |
| | | if(isAdancedQuery){ |
| | | condition['conditionMap[pl_code_basicsec.pkCodeRule]'] = this.currentCodeRuleOid == null || this.currentCodeRuleOid == '' |
| | | condition['conditionMap[pkCodeRule]'] = this.currentCodeRuleOid == null || this.currentCodeRuleOid == '' |
| | | ? this.selectionList[0].oid:this.currentCodeRuleOid; |
| | | } |
| | | gridCodeBasicSec(1, -1,isAdancedQuery ? condition:conditionMaps).then(res => { |
| | |
| | | }, |
| | | // 基础码段刷新时查询 |
| | | refreshChangeBasicSec(){ |
| | | this.loadBasic({"oid":this.currentCodeRuleOid == null || this.currentCodeRuleOid == '' ? this.selectionList[0].oid:this.currentCodeRuleOid}); |
| | | this.loadBasic(this.selectionList.at(-1)); |
| | | }, |
| | | // 操作基础码段中搜索清空等按钮的显示/隐藏 |
| | | hideBasicTable(hideBoolean){ |
| | |
| | | this.$refs.crudBasic.option.columnBtn = hideBoolean; |
| | | this.$refs.crudBasic.option.column[0].search = hideBoolean; |
| | | this.$refs.crudBasic.option.column[1].search = hideBoolean; |
| | | if(!hideBoolean){ |
| | | this.selectionList = []; |
| | | this.basicData = []; |
| | | } |
| | | }, |
| | | |
| | | |
| | | /** 编码规则相关方法 */ |
| | | // 打开高级查询窗口 |
| | | openAdvancedQuery(condition){ |
| | | // MasterTable({ |
| | | // codeClassifyOid: "D9CF223F-317D-71EB-BD11-433A94CAD9F3", |
| | | // functionId: 5, |
| | | // }).then(res=>{ |
| | | // console.log(res.data.tableDefineVO.seniorQueryColumns); |
| | | // }) |
| | | if(condition=='codeRule'){ |
| | | this.advancedQueryParam.options = [ |
| | | { |
| | |
| | | data: [], |
| | | title: '码段编号', |
| | | fieldType: 'text', |
| | | queryField: 'pl_code_basicsec.id', |
| | | queryField: 'id', |
| | | },{ |
| | | data: [], |
| | | title: '码段名称', |
| | | fieldType: 'text', |
| | | queryField: 'pl_code_basicsec.name', |
| | | queryField: 'name', |
| | | },{ |
| | | data: [], |
| | | title: '描述', |
| | | fieldType: 'text', |
| | | queryField: 'pl_code_basicsec.description', |
| | | queryField: 'description', |
| | | },{ |
| | | data: [], |
| | | title: '码段类型', |
| | | fieldType: 'combox', |
| | | queryField: 'pl_code_basicsec.secType', |
| | | queryField: 'secType', |
| | | comboxKey: 'codeSecType', |
| | | } |
| | | ] |
| | |
| | | // 刷新使用范围列表 |
| | | refreshUseRangeChange(){ |
| | | this.getRangeCodeList(); |
| | | }, |
| | | // 单击编码规则实现行选择 |
| | | codeRuleRowClick (row) { |
| | | // 这儿应该可以不要,因为toggleRowSelection也会触发行选择时间 |
| | | this.selectionList = row; |
| | | this.$refs.crud.toggleSelection(); |
| | | this.$refs.crud.setCurrentRow(row); |
| | | this.$refs.crud.toggleRowSelection(row); //选中当前行 |
| | | if(row!=''){ |
| | | this.loadBasic(row); |
| | | } |
| | | }, |
| | | // 启用与停用 |
| | | enableOrDeactivatse(oId,update){ |
| | |
| | | this.selectionOtherCloneCodeBasicList = list; |
| | | this.$refs.crudCloneCodeBasicOther.setCurrentRow(this.selectionOtherCloneCodeBasicList[list.length-1]); |
| | | }, |
| | | // 从其他编码规则中克隆码段信息 |
| | | // 从其他编码规则中克隆码段信息 |
| | | saveOtherCodeBasic(){ |
| | | let oid = this.selectionList[0].oid; |
| | | let fromDialogPkCodebasic = this.selectionOtherCloneCodeBasicList; |
| | |
| | | //console.log(res); |
| | | let oidArr = []; |
| | | fromDialogPkCodebasic.forEach(ele => { |
| | | oidArr.push(ele.id); |
| | | oidArr.push(ele.oid); |
| | | }); |
| | | let data = { |
| | | "pkCodeRule": oid, |
| | |
| | | let requestData = {}; |
| | | if(params){ |
| | | Object.keys(params).forEach(key=>{ |
| | | requestData["conditionMap"+'['+key+']'] = params[key].trim(); |
| | | requestData["conditionMap"+'['+key+'_like]'] = params[key].trim(); |
| | | }); |
| | | } |
| | | this.query = requestData; |
| | |
| | | // 编码规则当前选中行变化的时候触发 |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | this.$refs.crud.setCurrentRow(this.selectionList[list.length-1]); |
| | | //当前选中行为空的时候就将码段管理表格数据置空,并禁用相关功能 |
| | | if(list == ''){ |
| | | this.basicData = []; |
| | | if(this.selectionList.length <= 0){ |
| | | this.hideBasicTable(false); |
| | | } |
| | | if(this.selectionList.length > 0){ |
| | | if (this.selectionList.length > 0) { |
| | | this.$refs.crud.setCurrentRow(this.selectionList[list.length-1]); |
| | | this.currentCodeRuleOid = this.selectionList[list.length-1].oid; |
| | | this.currentRuleLcStatus = this.selectionList[list.length-1].lcStatus; |
| | | this.loadBasic(this.selectionList[list.length-1]); |
| | | } |
| | | }, |
| | | // 单击编码规则实现行选择 |
| | | codeRuleRowClick (row) { |
| | | // console.log(this.currentRuleLcStatus); |
| | | this.$refs.crud.toggleSelection(); |
| | | this.$refs.crud.toggleRowSelection(row); //选中当前行 |
| | | |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | |
| | | // 查询的值为空时,要将码段管理相关的内容禁用 |
| | | if(data.records.length <= 0) { |
| | | this.hideBasicTable(false); |
| | | this.selectionList = []; |
| | | this.basicData = []; |
| | | return; |
| | | } |
| | | this.loadBasic(this.data[0]) |
| | |
| | | // 补位时的字符,实现可输可选 |
| | | inputSelectBlur(e){ |
| | | if (e.target.value) { |
| | | this.form.codeFillSeparatorSelect = e.target.value; |
| | | this.form.codeFillSeparator = e.target.value; |
| | | } |
| | | }, |
| | | // 码段类型改变时,增加对应的form表单中的属性 |
| | |
| | | serialStart: row!=null&&row.serialStart != '' ? row.serialStart:1, //流水号起始值 |
| | | serialStep: row!=null&&row.serialStep != '' ? row.serialStep:1, //流水的步长 |
| | | codeFillType: row!=null&&row.codeFillType != '' ? row.codeFillType:'code_fill_left', //编码补位方式 |
| | | codeFillSeparatorSelect: row!=null&&row.codeFillSeparator != '' ? row.codeFillSeparatorSelect:0, //补位时的字符,选中的下拉框的下标 |
| | | codeFillSeparator: row!=null&&row.codeFillSeparator != '' ? row.codeFillSeparator:0, //补位时的字符 |
| | | // codeFillSeparatorSelect: row!=null&&row.codeFillSeparatorSelect != '' ? row.codeFillSeparatorSelect:0, //补位时的字符,选中的下拉框的下标 |
| | | codeFillSeparator: row!=null&&row.codeFillSeparator != '' ? row.codeFillSeparator:'0', //补位时的字符 |
| | | codeFillLength: row!=null&&row.codeFillLength != '' ? row.codeFillLength:'', //填充长度 |
| | | codeFillLimit: row!=null&&row.codeFillLimit != '' ? row.codeFillLimit:'', //流水上限 |
| | | codeFillFlag: row!=null&&row.codeFillFlag != '' ? row.codeFillFlag=='true' ? true:false :false, //流水是否补码 |
| | |
| | | this.form = Object.assign({}, this.form,{ |
| | | codeSecLength: row!=null&&row.codeSecLength != '' ? row.codeSecLength:'', //码段的长度 |
| | | codeFillType: row!=null&&row.codeFillType != '' ? row.codeFillType:'code_fill_left', //编码部位方式,枚举查询 |
| | | codeFillSeparatorSelect: row!=null&&row.codeFillSeparatorSelect != '' ? row.codeFillSeparatorSelect:0, //选中的补位时的字符的下标 |
| | | codeFillSeparator: row!=null&&row.codeFillSeparator != '' ? row.codeFillSeparator:'', //补位时的字符,可输可选查询 |
| | | // codeFillSeparatorSelect: row!=null&&row.codeFillSeparatorSelect != '' ? row.codeFillSeparatorSelect:0, //选中的补位时的字符的下标 |
| | | codeFillSeparator: row!=null&&row.codeFillSeparator != '' ? row.codeFillSeparator:'0', //补位时的字符,可输可选查询 |
| | | }); |
| | | this.loadCodeFillType(); |
| | | this.loadCodeFillSeparator(); |