| | |
| | | <template> |
| | | <basic-container class="code-total" style="height: 100%"> |
| | | <basic-container class="code-total" style=" height: 100%"> |
| | | <!-- 编码规则信息展示区域 --> |
| | | <basic-container class="code-rule-container"> |
| | | <p |
| | |
| | | </template> |
| | | <!-- 表格上方按钮区域 --> |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | | <el-button v-if="permissionList.delBtn" |
| | | <el-button v-if="permissionList.rulDelBtn" |
| | | icon="el-icon-delete" |
| | | plain |
| | | size="small" |
| | |
| | | ref="crudBasic" |
| | | :data="basicData" |
| | | :option="optionBasic" |
| | | :permission="permissionList" |
| | | :permission="basicPermissionList" |
| | | :table-loading="loadingBasic" |
| | | class="code-basic-crud" |
| | | @row-click="codeBasicSecRowClick" |
| | |
| | | > |
| | | <!-- 基础码段表格内操作按钮 --> |
| | | <template slot="menu" slot-scope="scope"> |
| | | <el-button v-if="permissionList.basicViewBtn && (currentRuleLcStatus != 'Editing')" |
| | | <el-button v-if="basicPermissionList.viewBtn && currentRuleLcStatus != 'Editing'" |
| | | icon="el-icon-view" |
| | | plain |
| | | size="small" |
| | |
| | | @click="openBasicDialog('view', scope.row)" |
| | | >查看 |
| | | </el-button> |
| | | <el-button v-if="permissionList.basicEditBtn && (currentRuleLcStatus === 'Editing')" |
| | | <el-button v-if="basicPermissionList.editBtn && currentRuleLcStatus === 'Editing'" |
| | | icon="el-icon-edit" |
| | | plain |
| | | size="small" |
| | |
| | | @click="openBasicDialog('edit', scope.row)" |
| | | >编辑 |
| | | </el-button> |
| | | <el-button v-if="permissionList.basicMgrBtn && (scope.row.secType === 'codeclassifysec' || scope.row.secType == 'codefixedsec')" |
| | | <el-button v-if="basicPermissionList.basicMgrBtn && (scope.row.secType === 'codeclassifysec' || scope.row.secType == 'codefixedsec')" |
| | | icon="el-icon-setting" |
| | | plain |
| | | size="small" |
| | |
| | | @click="openBasicSecCodeValueMgr(scope.row)" |
| | | >码值管理 |
| | | </el-button> |
| | | <el-button v-if="permissionList.basicMoveupBtn && (scope.row.orderNum > 1)" |
| | | <el-button v-if="basicPermissionList.basicMoveupBtn && scope.row.orderNum > 1" |
| | | icon="el-icon-arrow-up" |
| | | plain |
| | | size="small" |
| | |
| | | @click="upOrderNum(scope.row)" |
| | | >上移 |
| | | </el-button> |
| | | <el-button v-if="permissionList.basicDownBtn" |
| | | <el-button v-if="basicPermissionList.basicDownBtn" |
| | | icon="el-icon-arrow-down" |
| | | plain |
| | | size="small" |
| | |
| | | |
| | | <!-- 基础码段表格左上方按钮区域 --> |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | | <el-button v-if="permissionList.basicAddBtn" |
| | | <el-button v-if="basicPermissionList.addBtn" |
| | | :disabled="selectionList.length <= 0" |
| | | icon="el-icon-plus" |
| | | size="small" |
| | |
| | | > |
| | | 新 增 |
| | | </el-button> |
| | | <el-button v-if="permissionList.basicDeleteBtn" |
| | | <el-button v-if="basicPermissionList.basicDelBtn" |
| | | :disabled="selectionList.length <= 0" |
| | | icon="el-icon-delete" |
| | | plain |
| | |
| | | > |
| | | 删 除 |
| | | </el-button> |
| | | <el-button v-if="permissionList.basicAdvancedQueryBtn" |
| | | <el-button v-if="basicPermissionList.basicAdvancedQueryBtn" |
| | | :disabled="selectionList.length <= 0" |
| | | icon="el-icon-search" |
| | | plain |
| | |
| | | </el-row> |
| | | </div> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="selectedListClassifyLinkAttr" |
| | | >确 定</el-button |
| | | > |
| | | <el-button type="primary" @click="selectedListClassifyLinkAttr">确 定</el-button> |
| | | <el-button @click="isShowSelectAttrOption = false">取 消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | |
| | | import { mapGetters } from "vuex"; |
| | | import { getByRoleUserList } from "@/api/system/user"; |
| | | import func from "@/util/func"; |
| | | import secTypeEnum from '@/enumpack/CodeSecTypeEnum'; |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | return { |
| | | // 编码规则相关按钮 |
| | | addBtn: this.vaildData(this.permission.code_rule.code_rule_add, false), |
| | | viewBtn: this.vaildData(this.permission.code_rule.code_rule_view, false), |
| | | delBtn: this.vaildData(this.permission.code_rule.code_rule_delete, false), |
| | | //viewBtn: this.vaildData(this.permission.code_rule.code_rule_view, false), |
| | | rulDelBtn: this.vaildData(this.permission.code_rule.code_rule_delete, false), |
| | | editBtn: this.vaildData(this.permission.code_rule.code_rule_edit, false), |
| | | deactivateBtn: this.vaildData(this.permission.code_rule.code_rule_deactivate, false), |
| | | enableBtn: this.vaildData(this.permission.code_rule.code_rule_enable, false), |
| | |
| | | clearBtn: this.vaildData(this.permission.code_rule.code_rule_clear, false), |
| | | escapeOwnerBtn: this.vaildData(this.permission.code_rule.code_rule_escape_owner, false), |
| | | maxSerialnumBtn: this.vaildData(this.permission.code_rule.code_rule_max_serialnum, false), |
| | | }; |
| | | }, |
| | | basicPermissionList() { |
| | | return{ |
| | | // 基础码段相关按钮 |
| | | basicAddBtn: this.vaildData(this.permission.code_rule.code_basic_add, false), |
| | | basicDeleteBtn: this.vaildData(this.permission.code_rule.code_basic_delete, false), |
| | | addBtn: this.vaildData(this.permission.code_rule.code_basic_add, false), |
| | | editBtn: this.vaildData(this.permission.code_rule.code_basic_edit, false), |
| | | viewBtn: this.vaildData(this.permission.code_rule. code_basic_view, false), |
| | | basicDelBtn: this.vaildData(this.permission.code_rule.code_basic_delete, false), |
| | | basicAdvancedQueryBtn: this.vaildData(this.permission.code_rule.code_basic_advanced_query, false), |
| | | basicMgrBtn: this.vaildData(this.permission.code_rule.code_basic_mgr, false), |
| | | basicEditBtn: this.vaildData(this.permission.code_rule.code_basic_edit, false), |
| | | basicViewBtn: this.vaildData(this.permission.code_rule. code_basic_view, false), |
| | | basicMoveupBtn: this.vaildData(this.permission.code_rule.code_basic_moveup, false), |
| | | basicDownBtn: this.vaildData(this.permission.code_rule.code_basic_down, false), |
| | | }; |
| | | } |
| | | }, |
| | | }, |
| | | watch: {}, |
| | |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | gridCodeRule( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign({},params,this.query), |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign({},params,this.query), |
| | | ).then((res) => { |
| | | //console.log(res.data); |
| | | const data = res.data.data; |
| | |
| | | this.basicSecDialogTitle = "修改码段信息"; |
| | | this.showbtn = true; |
| | | this.basicSecOnlyRead = false; |
| | | //为form绑定值 |
| | | } else { |
| | | this.basicSecDialogTitle = "查看码段信息"; |
| | | this.showbtn = false; |
| | | this.basicSecOnlyRead = true; |
| | | } |
| | | //console.log(this.form); |
| | | //为form绑定值 |
| | | this.changeSectypeFormItems(condition == "add" ? null : row); |
| | | this.addBasicCodeSettingBox = true; |
| | | }, |
| | |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | // 关闭对话框 |
| | | this.addBasicCodeSettingBox = false; |
| | | // 点击新增基础码段,关闭窗口之后触发重新加载 |
| | | this.loadBasic(this.selectionList[0]); |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | } |
| | | ); |
| | | // 关闭对话框 |
| | | this.addBasicCodeSettingBox = false; |
| | | } |
| | | // 点击新增基础码段,关闭窗口之后触发重新加载 |
| | | this.loadBasic(this.selectionList[0]); |
| | | } else { |
| | | // 可能参照引用的业务类型会发生改变所以这儿直接对referConfig的json进行改变 |
| | | if ( |
| | |
| | | // let referValueInfo = JSON.parse(this.form.referValueInfo); |
| | | // referValueInfo.referType = this.form.referBtmId; |
| | | } |
| | | editSave(this.form).then( |
| | | let oldBasicSec = this.selectionBasicList.at(-1); |
| | | let secType = this.form.secType; |
| | | Vue.set(this.form, 'isClearValue', false); |
| | | if((oldBasicSec.secType == "codefixedsec" || oldBasicSec.secType === "codeclassifysec") && oldBasicSec.secType != secType){ |
| | | await this.$confirm("码段类型由【"+oldBasicSec.secTypeText+"】,修改为"+"【"+secTypeEnum.getTextByValue(secType)+"】,请问是否需要清空关联的码值?", "提示", { |
| | | distinguishCancelAndClose: true, |
| | | closeOnClickModal: false, |
| | | confirmButtonText: "清空码值", |
| | | cancelButtonText: "保留码值", |
| | | }).then(() => { |
| | | // 清空码值 |
| | | this.form.isClearValue = true; |
| | | }).catch(action => { |
| | | this.form.isClearValue = false; |
| | | }); |
| | | } |
| | | await editSave(this.form).then( |
| | | () => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | this.loadBasic(this.selectionList[0]); |
| | | // 关闭对话框 |
| | | this.addBasicCodeSettingBox = false; |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | } |
| | | ); |
| | | this.loadBasic(this.selectionList[0]); |
| | | // 关闭对话框 |
| | | this.addBasicCodeSettingBox = false; |
| | | } |
| | | // 取消保存按钮加载效果 |
| | | this.isLoadingSecCodeAddBtn = false; |
| | | }, |
| | | /** 因为elementui的表单校验设置不上所以采用判断的方式来做表单检验方式*/ |
| | |
| | | ) { |
| | | this.loadCodeSecType(); |
| | | } |
| | | if (row != null) { |
| | | this.form = { |
| | | oid: row.oid, |
| | | id: row.id, //编号, |
| | | name: row.name, //名称 |
| | | secType: row.secType, //码段类型 |
| | | description: row.description, //描述 |
| | | serialDependFlag: row.serialDependFlag == "true" ? true : false, //是否流水依赖 |
| | | serialDependOrder: row.serialDependOrder, //流水依赖顺序 |
| | | nullableFlag: row.nullableFlag == "true" ? true : false, //是否为空 |
| | | displayFlag: row.displayFlag == "true" ? true : false, |
| | | componentCodeFlag: row.componentCodeFlag == "true" ? true : false, //是否参与编码 |
| | | pkCodeRule: row.pkCodeRule, //所属编码规则 |
| | | }; |
| | | } else { |
| | | this.form = { |
| | | id: this.form.id, //编号 |
| | | name: this.form.name, //名称 |
| | | secType: this.form.secType, //码段类型 |
| | | description: this.form.description, //描述 |
| | | serialDependFlag: this.form.serialDependFlag, //是否流水依赖 |
| | | serialDependOrder: this.form.serialDependOrder, //流水依赖顺序 |
| | | nullableFlag: this.form.nullableFlag, //是否为空 |
| | | displayFlag: this.form.displayFlag, // |
| | | componentCodeFlag: this.form.componentCodeFlag, //是否参与编码 |
| | | pkCodeRule: this.form.pkCodeRule, //所属编码规则 |
| | | }; |
| | | } |
| | | this.form = { |
| | | oid: row !=null ? row.oid:this.form.oid, |
| | | id: row !=null ? row.id:this.form.id, //编号, |
| | | name: row !=null ? row.name:this.form.name, //名称 |
| | | secType: row !=null ? row.secType:this.form.secType, //码段类型 |
| | | description: row !=null ? row.description:this.form.description, //描述 |
| | | serialDependFlag: this.isNullJsonBoolean(row,this.form, 'serialDependFlag'), //是否流水依赖 |
| | | serialDependOrder: row !=null ? row.serialDependOrder:this.form.serialDependOrder, //流水依赖顺序 |
| | | nullableFlag: this.isNullJsonBoolean(row, this.form, 'nullableFlag'), //是否为空 |
| | | displayFlag: this.isNullJsonBoolean(row, this.form, 'displayFlag'), |
| | | componentCodeFlag: this.isNullJsonBoolean(row, this.form, 'componentCodeFlag'), //是否参与编码 |
| | | pkCodeRule: row !=null ? row.pkCodeRule:this.form.pkCodeRule, //所属编码规则 |
| | | }; |
| | | if (this.form.secType === "codefixedsec") { |
| | | //固定码段 |
| | | this.form = Object.assign({}, this.form, { |
| | |
| | | this.loadCodeFillSeparator(); |
| | | } |
| | | }, |
| | | // 判断Boolean值是否为空,并且对str类型布尔值进行转换 |
| | | isNullJsonBoolean(row,form,attr) { |
| | | //console.log(row[attr],form[attr]); |
| | | if(row != null){ |
| | | return JSON.parse(row[attr]); |
| | | }else { |
| | | return form[attr]; |
| | | } |
| | | }, |
| | | /** 第一次请求的枚举数据放缓存*/ |
| | | getLocalStorageEnum(enumKey) { |
| | | let enumCach = JSON.parse(localStorage.getItem(enumKey)); |