| | |
| | | > |
| | | <!-- 表格内操作按钮 --> |
| | | <template slot="menu" slot-scope="scope"> |
| | | <el-button |
| | | v-show="scope.row.lcStatus == 'Editing' ? true : false" |
| | | <el-button v-if="permissionList.editBtn && (scope.row.lcStatus == 'Editing' ? true : false)" |
| | | icon="el-icon-edit" |
| | | plain |
| | | size="small" |
| | |
| | | @click="openEdit(scope.row)" |
| | | >编 辑 |
| | | </el-button> |
| | | <el-button |
| | | v-show="scope.row.lcStatus == 'Editing' ? true : false" |
| | | <el-button v-if="permissionList.releaseBtn && (scope.row.lcStatus == 'Editing' ? true : false)" |
| | | :loading="releadDisabled" |
| | | icon="el-icon-position" |
| | | plain |
| | |
| | | @click="enableOrDeactivatse(scope.row.oid, 'release')" |
| | | >发 布 |
| | | </el-button> |
| | | <el-button |
| | | v-show="scope.row.lcStatus == 'Released' ? true : false" |
| | | <el-button v-if="permissionList.deactivateBtn && (scope.row.lcStatus == 'Released' ? true : false)" |
| | | icon="el-icon-video-pause" |
| | | plain |
| | | size="small" |
| | |
| | | @click="enableOrDeactivatse(scope.row.oid, 'disable')" |
| | | >停 用 |
| | | </el-button> |
| | | <el-button |
| | | v-show="scope.row.lcStatus == 'Disabled' ? true : false" |
| | | <el-button v-if="permissionList.enableBtn && (scope.row.lcStatus == 'Disabled' ? true : false)" |
| | | icon="el-icon-video-play" |
| | | plain |
| | | size="small" |
| | |
| | | </template> |
| | | <!-- 表格上方按钮区域 --> |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | | <el-button |
| | | <el-button v-if="permissionList.rulDelBtn" |
| | | icon="el-icon-delete" |
| | | plain |
| | | size="small" |
| | |
| | | > |
| | | 删 除 |
| | | </el-button> |
| | | <el-button |
| | | <el-button v-if="permissionList.advancedQueryBtn" |
| | | icon="el-icon-search" |
| | | plain |
| | | size="small" |
| | | type="primary" |
| | | @click="openAdvancedQuery('codeRule')" |
| | | > |
| | | @click="openAdvancedQuery('codeRule')"> |
| | | 高级查询 |
| | | </el-button> |
| | | <el-button |
| | | <el-button v-if="permissionList.cloneBtn" |
| | | icon="icon-kelong" |
| | | plain |
| | | size="small" |
| | |
| | | > |
| | | 克 隆 |
| | | </el-button> |
| | | <el-button |
| | | <el-button v-if="permissionList.otherCloneBtn" |
| | | icon="icon-lianjiekelong" |
| | | plain |
| | | size="small" |
| | |
| | | > |
| | | 从其他规则中克隆码段 |
| | | </el-button> |
| | | <el-button |
| | | <el-button v-if="permissionList.usescopeBtn" |
| | | icon="el-icon-s-help" |
| | | plain |
| | | size="small" |
| | |
| | | > |
| | | 使用范围 |
| | | </el-button> |
| | | <el-button |
| | | <el-button v-if="permissionList.clearBtn" |
| | | icon="icon-qingkong" |
| | | plain |
| | | size="small" |
| | |
| | | > |
| | | 清空码值 |
| | | </el-button> |
| | | <el-button |
| | | <el-button v-if="permissionList.escapeOwnerBtn" |
| | | icon="el-icon-guide" |
| | | plain |
| | | size="small" |
| | |
| | | > |
| | | 转移所有者 |
| | | </el-button> |
| | | <el-button |
| | | <el-button v-if="permissionList.maxSerialnumBtn" |
| | | icon="el-icon-data-analysis" |
| | | plain |
| | | size="small" |
| | |
| | | <!-- 基础码段展示区域 --> |
| | | <basic-container class="code-basicsec-container"> |
| | | <p |
| | | style=" |
| | | margin-top: -5px; |
| | | style="margin-top: -5px; |
| | | margin-bottom: 4px; |
| | | font-weight: 570; |
| | | font-size: 19px; |
| | | color: #0e2d5f; |
| | | " |
| | | > |
| | | color: #0e2d5f;"> |
| | | 码段管理 |
| | | </p> |
| | | <avue-crud |
| | | 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-show="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-show="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-show=" |
| | | 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-show="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 |
| | | <el-button v-if="basicPermissionList.basicDownBtn" |
| | | icon="el-icon-arrow-down" |
| | | plain |
| | | size="small" |
| | |
| | | |
| | | <!-- 基础码段表格左上方按钮区域 --> |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | | <el-button |
| | | <el-button v-if="basicPermissionList.addBtn" |
| | | :disabled="selectionList.length <= 0" |
| | | icon="el-icon-plus" |
| | | size="small" |
| | |
| | | > |
| | | 新 增 |
| | | </el-button> |
| | | <el-button |
| | | <el-button v-if="basicPermissionList.basicDelBtn" |
| | | :disabled="selectionList.length <= 0" |
| | | icon="el-icon-delete" |
| | | plain |
| | |
| | | > |
| | | 删 除 |
| | | </el-button> |
| | | <el-button |
| | | <el-button v-if="basicPermissionList.basicAdvancedQueryBtn" |
| | | :disabled="selectionList.length <= 0" |
| | | icon="el-icon-search" |
| | | plain |
| | |
| | | > |
| | | <el-option |
| | | v-for="item in enumParam.codeFillSeparator" |
| | | :key="item.itemValue" |
| | | :label="item.itemName" |
| | | :value="item.itemValue" |
| | | :key="item.dictKey" |
| | | :label="item.dictValue" |
| | | :value="item.dictValue" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | |
| | | </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> |
| | |
| | | saveCodeClassifyValueOrder, |
| | | } from "@/api/code/codeClassifyValue"; |
| | | import { getDictionary } from "@/api/omd/enum"; |
| | | import { getDictionaryBiz } from "@/api/system/dictbiz"; |
| | | import optionBasic from "@/const/code/codebasic"; |
| | | import optionRule from "@/const/code/mdmrule"; |
| | | import attrOption from "@/const/code/selectAttrOptionDialog"; |
| | |
| | | import { mapGetters } from "vuex"; |
| | | import { getByRoleUserList } from "@/api/system/user"; |
| | | import func from "@/util/func"; |
| | | import secTypeEnum from '@/enumpack/CodeSecTypeEnum'; |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | ...mapGetters(["permission"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission.codeRule_add, true), |
| | | viewBtn: this.vaildData(this.permission.codeRule_view, false), |
| | | delBtn: this.vaildData(this.permission.plCodeRule_delete, false), |
| | | editBtn: this.vaildData(this.permission.codeRule_edit, true), |
| | | // 编码规则相关按钮 |
| | | addBtn: this.vaildData(this.permission.code_rule.code_rule_add, 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), |
| | | releaseBtn: this.vaildData(this.permission.code_rule. code_rule_release, false), |
| | | advancedQueryBtn: this.vaildData(this.permission.code_rule.code_rule_advanced_query, false), |
| | | cloneBtn: this.vaildData(this.permission.code_rule.code_rule_clone, false), |
| | | otherCloneBtn: this.vaildData(this.permission.code_rule.code_rule_other_clone, false), |
| | | usescopeBtn: this.vaildData(this.permission.code_rule.code_rule_usescope, 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{ |
| | | // 基础码段相关按钮 |
| | | 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), |
| | | basicMoveupBtn: this.vaildData(this.permission.code_rule.code_basic_moveup, false), |
| | | basicDownBtn: this.vaildData(this.permission.code_rule.code_basic_down, false), |
| | | } |
| | | }, |
| | | }, |
| | | watch: {}, |
| | |
| | | this.$refs.crud.doLayout(); |
| | | this.$refs.crudBasic.doLayout(); |
| | | }); |
| | | }, |
| | | // 生命钩子函数 |
| | | beforeDestroy() { |
| | | // 清除指定缓存 |
| | | localStorage.removeItem('codeSecType'); |
| | | localStorage.removeItem('codeSecLength'); |
| | | localStorage.removeItem('codeFillType'); |
| | | localStorage.removeItem('codeLevelType'); |
| | | localStorage.removeItem('codeCutType'); |
| | | localStorage.removeItem('codeGetValueType'); |
| | | }, |
| | | methods: { |
| | | |
| | |
| | | .catch((error) => { |
| | | this.releadDisabled = false; |
| | | }); |
| | | this.releadDisabled = false; |
| | | } else { |
| | | this.updateStatus(oid, update); |
| | | } |
| | | }, |
| | | |
| | | /** 打开编码规则克隆对话框*/ |
| | | openCodeRuleDialog() { |
| | | if (!this.tipsMessage(this.selectionList)) { |
| | |
| | | } |
| | | this.cloneSettingBox = true; |
| | | }, |
| | | |
| | | /** 打开从其他编码规则中克隆码段对话框*/ |
| | | openOtherCodeRuleDialog() { |
| | | if (!this.tipsMessage(this.selectionList)) { |
| | |
| | | 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)); |
| | |
| | | this.enumParam.codeFillType = this.getLocalStorageEnum("codeFillType") || []; |
| | | }, |
| | | loadCodeFillSeparator() { |
| | | let enumCach = JSON.parse(localStorage.getItem("codeFillSeparator")); |
| | | if (enumCach == null) { |
| | | getDictionary("codeFillSeparator").then((res) => { |
| | | this.enumParam.codeFillSeparator = res.data.data; |
| | | localStorage.setItem( |
| | | "codeFillSeparator", |
| | | JSON.stringify(res.data.data) |
| | | ); |
| | | }); |
| | | } |
| | | //let enumCach = JSON.parse(localStorage.getItem("codeFillSeparator")); |
| | | //if (enumCach == null) { |
| | | getDictionaryBiz({code:"codeFillSeparator"}).then((res) => { |
| | | this.enumParam.codeFillSeparator = res.data.data; |
| | | //console.log(this.enumParam.codeFillSeparator); |
| | | localStorage.setItem( |
| | | "codeFillSeparator", |
| | | JSON.stringify(res.data.data) |
| | | ); |
| | | }); |
| | | //} |
| | | }, |
| | | loadCodeLevelType() { |
| | | this.enumParam.codeLevelType = this.getLocalStorageEnum("codeLevelType") || []; |