| | |
| | | <basic-container class="code-total" style=" height: 100%"> |
| | | <!-- 编码规则信息展示区域 --> |
| | | <basic-container class="code-rule-container"> |
| | | <p |
| | | style=" |
| | | <div style="height: 49vh;overflow: auto;"> |
| | | <p |
| | | style=" |
| | | margin-top: -5px; |
| | | margin-bottom: 4px; |
| | | font-weight: 570; |
| | | font-size: 19px; |
| | | color: #0e2d5f; |
| | | " |
| | | > |
| | | 编码规则 |
| | | </p> |
| | | <avue-crud |
| | | ref="crud" |
| | | v-model="ruleForm" |
| | | :before-open="beforeOpen" |
| | | :data="data" |
| | | :option="optionRule" |
| | | :page.sync="page" |
| | | :permission="permissionList" |
| | | :table-loading="loading" |
| | | class="code-rule-crud" |
| | | @row-click="codeRuleRowClick" |
| | | @row-update="rowUpdate" |
| | | @row-save="rowSave" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad" |
| | | > |
| | | <!-- 表格内操作按钮 --> |
| | | <template slot="menu" slot-scope="scope"> |
| | | <el-button v-if="permissionList.editBtn && (scope.row.lcStatus == 'Editing' ? true : false)" |
| | | icon="el-icon-edit" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="openEdit(scope.row)" |
| | | >编 辑 |
| | | </el-button> |
| | | <el-button v-if="permissionList.releaseBtn && (scope.row.lcStatus == 'Editing' ? true : false)" |
| | | :loading="releadDisabled" |
| | | icon="el-icon-position" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="enableOrDeactivatse(scope.row.oid, 'release')" |
| | | >发 布 |
| | | </el-button> |
| | | <el-button v-if="permissionList.deactivateBtn && (scope.row.lcStatus == 'Released' ? true : false)" |
| | | icon="el-icon-video-pause" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="enableOrDeactivatse(scope.row.oid, 'disable')" |
| | | >停 用 |
| | | </el-button> |
| | | <el-button v-if="permissionList.enableBtn && (scope.row.lcStatus == 'Disabled' ? true : false)" |
| | | icon="el-icon-video-play" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="enableOrDeactivatse(scope.row.oid, 'enable')" |
| | | >启 用 |
| | | </el-button> |
| | | </template> |
| | | <!-- 表格上方按钮区域 --> |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | | <el-button v-if="permissionList.rulDelBtn" |
| | | icon="el-icon-delete" |
| | | plain |
| | | size="small" |
| | | type="danger" |
| | | @click="handleDelete" |
| | | > |
| | | 删 除 |
| | | </el-button> |
| | | <el-button v-if="permissionList.advancedQueryBtn" |
| | | icon="el-icon-search" |
| | | plain |
| | | size="small" |
| | | type="primary" |
| | | @click="openAdvancedQuery('codeRule')"> |
| | | 高级查询 |
| | | </el-button> |
| | | <el-button v-if="permissionList.cloneBtn" |
| | | icon="icon-kelong" |
| | | plain |
| | | size="small" |
| | | @click="openCodeRuleDialog" |
| | | > |
| | | 克 隆 |
| | | </el-button> |
| | | <el-button v-if="permissionList.otherCloneBtn" |
| | | icon="icon-lianjiekelong" |
| | | plain |
| | | size="small" |
| | | style="font-size: 12px" |
| | | @click="openOtherCodeRuleDialog" |
| | | > |
| | | 从其他规则中克隆码段 |
| | | </el-button> |
| | | <el-button v-if="permissionList.usescopeBtn" |
| | | icon="el-icon-s-help" |
| | | plain |
| | | size="small" |
| | | @click="handleRange" |
| | | > |
| | | 使用范围 |
| | | </el-button> |
| | | <el-button v-if="permissionList.clearBtn" |
| | | icon="icon-qingkong" |
| | | plain |
| | | size="small" |
| | | @click="clearAllCodeSec" |
| | | > |
| | | 清空码值 |
| | | </el-button> |
| | | <el-button v-if="permissionList.escapeOwnerBtn" |
| | | icon="el-icon-guide" |
| | | plain |
| | | size="small" |
| | | @click="escapeOwner" |
| | | > |
| | | 转移所有者 |
| | | </el-button> |
| | | <el-button v-if="permissionList.maxSerialnumBtn" |
| | | icon="el-icon-data-analysis" |
| | | plain |
| | | size="small" |
| | | @click="maxSerialNum" |
| | | > |
| | | 最大流水号 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | > |
| | | 编码规则 |
| | | </p> |
| | | <avue-crud |
| | | ref="crud" |
| | | v-model="ruleForm" |
| | | :before-open="beforeOpen" |
| | | :data="data" |
| | | :option="optionRule" |
| | | :page.sync="page" |
| | | :permission="permissionList" |
| | | :table-loading="loading" |
| | | class="code-rule-crud" |
| | | @row-click="codeRuleRowClick" |
| | | @row-update="rowUpdate" |
| | | @row-save="rowSave" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad" |
| | | > |
| | | <!-- 表格内操作按钮 --> |
| | | <template slot="menu" slot-scope="scope"> |
| | | <el-button v-if="permissionList.editBtn && (scope.row.lcStatus == 'Editing' ? true : false)" |
| | | icon="el-icon-edit" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="openEdit(scope.row)" |
| | | >编 辑 |
| | | </el-button> |
| | | <el-button v-if="permissionList.releaseBtn && (scope.row.lcStatus == 'Editing' ? true : false)" |
| | | :loading="releadDisabled" |
| | | icon="el-icon-position" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="enableOrDeactivatse(scope.row.oid, 'release')" |
| | | >发 布 |
| | | </el-button> |
| | | <el-button v-if="permissionList.deactivateBtn && (scope.row.lcStatus == 'Released' ? true : false)" |
| | | icon="el-icon-video-pause" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="enableOrDeactivatse(scope.row.oid, 'disable')" |
| | | >停 用 |
| | | </el-button> |
| | | <el-button v-if="permissionList.enableBtn && (scope.row.lcStatus == 'Disabled' ? true : false)" |
| | | icon="el-icon-video-play" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="enableOrDeactivatse(scope.row.oid, 'enable')" |
| | | >启 用 |
| | | </el-button> |
| | | </template> |
| | | <!-- 表格上方按钮区域 --> |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | | <el-button v-if="permissionList.rulDelBtn" |
| | | icon="el-icon-delete" |
| | | plain |
| | | size="small" |
| | | type="danger" |
| | | @click="handleDelete" |
| | | > |
| | | 删 除 |
| | | </el-button> |
| | | <el-button v-if="permissionList.advancedQueryBtn" |
| | | icon="el-icon-search" |
| | | plain |
| | | size="small" |
| | | type="primary" |
| | | @click="openAdvancedQuery('codeRule')"> |
| | | 高级查询 |
| | | </el-button> |
| | | <el-button v-if="permissionList.cloneBtn" |
| | | icon="icon-kelong" |
| | | plain |
| | | size="small" |
| | | @click="openCodeRuleDialog" |
| | | > |
| | | 克 隆 |
| | | </el-button> |
| | | <el-button v-if="permissionList.otherCloneBtn" |
| | | icon="icon-lianjiekelong" |
| | | plain |
| | | size="small" |
| | | style="font-size: 12px" |
| | | @click="openOtherCodeRuleDialog" |
| | | > |
| | | 从其他规则中克隆码段 |
| | | </el-button> |
| | | <el-button v-if="permissionList.usescopeBtn" |
| | | icon="el-icon-s-help" |
| | | plain |
| | | size="small" |
| | | @click="handleRange" |
| | | > |
| | | 使用范围 |
| | | </el-button> |
| | | <el-button v-if="permissionList.clearBtn" |
| | | icon="icon-qingkong" |
| | | plain |
| | | size="small" |
| | | @click="clearAllCodeSec" |
| | | > |
| | | 清空码值 |
| | | </el-button> |
| | | <el-button v-if="permissionList.escapeOwnerBtn" |
| | | icon="el-icon-guide" |
| | | plain |
| | | size="small" |
| | | @click="escapeOwner" |
| | | > |
| | | 转移所有者 |
| | | </el-button> |
| | | <el-button v-if="permissionList.maxSerialnumBtn" |
| | | icon="el-icon-data-analysis" |
| | | plain |
| | | size="small" |
| | | @click="maxSerialNum" |
| | | > |
| | | 最大流水号 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </div> |
| | | </basic-container> |
| | | |
| | | <!-- 高级查询对话框 --> |
| | |
| | | |
| | | <!-- 基础码段展示区域 --> |
| | | <basic-container class="code-basicsec-container"> |
| | | <p |
| | | style="margin-top: -5px; |
| | | <div style="height: 29.3vh;overflow: auto"> |
| | | <p |
| | | style="margin-top: -5px; |
| | | margin-bottom: 4px; |
| | | font-weight: 570; |
| | | font-size: 19px; |
| | | color: #0e2d5f;"> |
| | | 码段管理 |
| | | </p> |
| | | <avue-crud |
| | | ref="crudBasic" |
| | | :data="basicData" |
| | | :option="optionBasic" |
| | | :permission="basicPermissionList" |
| | | :table-loading="loadingBasic" |
| | | class="code-basic-crud" |
| | | @row-click="codeBasicSecRowClick" |
| | | @search-change="basicSearchChange" |
| | | @search-reset="basicSearchReset" |
| | | @selection-change="selectionBasicChange" |
| | | @refresh-change="refreshChangeBasicSec" |
| | | > |
| | | <!-- 基础码段表格内操作按钮 --> |
| | | <template slot="menu" slot-scope="scope"> |
| | | <el-button v-if="basicPermissionList.viewBtn && currentRuleLcStatus != 'Editing'" |
| | | icon="el-icon-view" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="openBasicDialog('view', scope.row)" |
| | | >查看 |
| | | </el-button> |
| | | <el-button v-if="basicPermissionList.editBtn && currentRuleLcStatus === 'Editing'" |
| | | icon="el-icon-edit" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="openBasicDialog('edit', scope.row)" |
| | | >编辑 |
| | | </el-button> |
| | | <el-button |
| | | v-if="basicPermissionList.basicMgrBtn && (scope.row.secType === 'codeclassifysec' || scope.row.secType == 'codefixedsec')" |
| | | icon="el-icon-setting" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="openBasicSecCodeValueMgr(scope.row)" |
| | | >码值管理 |
| | | </el-button> |
| | | <el-button v-if="basicPermissionList.basicMoveupBtn && scope.row.orderNum > 1" |
| | | icon="el-icon-arrow-up" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="upOrderNum(scope.row)" |
| | | >上移 |
| | | </el-button> |
| | | <el-button v-if="basicPermissionList.basicDownBtn" |
| | | icon="el-icon-arrow-down" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="downOrderNum(scope.row)" |
| | | >下移 |
| | | </el-button> |
| | | </template> |
| | | 码段管理 |
| | | </p> |
| | | <avue-crud |
| | | ref="crudBasic" |
| | | :data="basicData" |
| | | :option="optionBasic" |
| | | :permission="basicPermissionList" |
| | | :table-loading="loadingBasic" |
| | | class="code-basic-crud" |
| | | @row-click="codeBasicSecRowClick" |
| | | @search-change="basicSearchChange" |
| | | @search-reset="basicSearchReset" |
| | | @selection-change="selectionBasicChange" |
| | | @refresh-change="refreshChangeBasicSec" |
| | | > |
| | | <!-- 基础码段表格内操作按钮 --> |
| | | <template slot="menu" slot-scope="scope"> |
| | | <el-button v-if="basicPermissionList.viewBtn && currentRuleLcStatus != 'Editing'" |
| | | icon="el-icon-view" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="openBasicDialog('view', scope.row)" |
| | | >查看 |
| | | </el-button> |
| | | <el-button v-if="basicPermissionList.editBtn && currentRuleLcStatus === 'Editing'" |
| | | icon="el-icon-edit" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="openBasicDialog('edit', scope.row)" |
| | | >编辑 |
| | | </el-button> |
| | | <el-button |
| | | v-if="basicPermissionList.basicMgrBtn && (scope.row.secType === 'codeclassifysec' || scope.row.secType == 'codefixedsec')" |
| | | icon="el-icon-setting" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="openBasicSecCodeValueMgr(scope.row)" |
| | | >码值管理 |
| | | </el-button> |
| | | <el-button v-if="basicPermissionList.basicMoveupBtn && scope.row.orderNum > 1" |
| | | icon="el-icon-arrow-up" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="upOrderNum(scope.row)" |
| | | >上移 |
| | | </el-button> |
| | | <el-button v-if="basicPermissionList.basicDownBtn" |
| | | icon="el-icon-arrow-down" |
| | | plain |
| | | size="small" |
| | | type="text" |
| | | @click="downOrderNum(scope.row)" |
| | | >下移 |
| | | </el-button> |
| | | </template> |
| | | |
| | | <!-- 基础码段表格左上方按钮区域 --> |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | | <el-button v-if="basicPermissionList.addBtn" |
| | | :disabled="selectionList.length <= 0" |
| | | icon="el-icon-plus" |
| | | size="small" |
| | | type="primary" |
| | | @click="openAddBasicCodeSec" |
| | | > |
| | | 新 增 |
| | | </el-button> |
| | | <el-button v-if="basicPermissionList.basicDelBtn" |
| | | :disabled="selectionList.length <= 0" |
| | | icon="el-icon-delete" |
| | | plain |
| | | size="small" |
| | | type="danger" |
| | | @click="deleteBasicCode(scope.row)" |
| | | > |
| | | 删 除 |
| | | </el-button> |
| | | <el-button v-if="basicPermissionList.basicAdvancedQueryBtn" |
| | | :disabled="selectionList.length <= 0" |
| | | icon="el-icon-search" |
| | | plain |
| | | size="small" |
| | | type="primary" |
| | | @click="openAdvancedQuery('codeBasicSec')" |
| | | > |
| | | 高级查询 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <!-- 基础码段表格左上方按钮区域 --> |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | | <el-button v-if="basicPermissionList.addBtn" |
| | | :disabled="selectionList.length <= 0" |
| | | icon="el-icon-plus" |
| | | size="small" |
| | | type="primary" |
| | | @click="openAddBasicCodeSec" |
| | | > |
| | | 新 增 |
| | | </el-button> |
| | | <el-button v-if="basicPermissionList.basicDelBtn" |
| | | :disabled="selectionList.length <= 0" |
| | | icon="el-icon-delete" |
| | | plain |
| | | size="small" |
| | | type="danger" |
| | | @click="deleteBasicCode(scope.row)" |
| | | > |
| | | 删 除 |
| | | </el-button> |
| | | <el-button v-if="basicPermissionList.basicAdvancedQueryBtn" |
| | | :disabled="selectionList.length <= 0" |
| | | icon="el-icon-search" |
| | | plain |
| | | size="small" |
| | | type="primary" |
| | | @click="openAdvancedQuery('codeBasicSec')" |
| | | > |
| | | 高级查询 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </div> |
| | | </basic-container> |
| | | |
| | | <!-- 码段码值管理对话框 --> |
| | |
| | | <el-col :span="13"> |
| | | <basic-container> |
| | | <div class="box" style="height: 60vh; margin-bottom: -40px"> |
| | | <el-form> |
| | | <el-form-item :label-width="50" label="码值:" required> |
| | | <el-input |
| | | v-model="codeClassifyForm.id" |
| | | style="width: 18vw" |
| | | ></el-input> |
| | | <el-form label-width="55px"> |
| | | <el-form-item label="名称:" required> |
| | | <el-input v-model="codeClassifyForm.name"></el-input> |
| | | </el-form-item> |
| | | <el-form-item :label-width="50" label="名称:" required> |
| | | <el-input |
| | | v-model="codeClassifyForm.name" |
| | | style="width: 18vw" |
| | | ></el-input> |
| | | <el-form-item label="码值:"> |
| | | <el-input v-model="codeClassifyForm.id"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | |
| | | margin-top: 20px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | " |
| | | > |
| | | justify-content: center;"> |
| | | <el-button |
| | | class="button" |
| | | icon="el-icon-circle-plus" |
| | |
| | | > |
| | | <!-- 第一层对话框,添加码段信息对话框中的内容 --> |
| | | <div class="add-basicsec-total"> |
| | | <el-form :model="form" class="add-basicsec-form" :rules="rules" > |
| | | <el-form :model="form" :rules="rules" class="add-basicsec-form"> |
| | | <span class="left"> |
| | | <el-form-item |
| | | :label-width="leftFormLabelWidth" |
| | |
| | | <el-form-item |
| | | :label-width="leftFormLabelWidth" |
| | | label="前缀:"> |
| | | <el-input |
| | | <!-- <el-input |
| | | v-model="form.prefixCode" |
| | | :readonly="basicSecOnlyRead" |
| | | ></el-input> |
| | | ></el-input> --> |
| | | <el-select v-model="form.prefixCode" :disabled="basicSecOnlyRead" clearable> |
| | | <el-option |
| | | v-for="(option, index) in preFixOrSuffixChars" |
| | | :key="index" |
| | | :label="option.label" |
| | | :value="option.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item |
| | | :label-width="leftFormLabelWidth" |
| | | label="后缀:"> |
| | | <el-input |
| | | <!-- <el-input |
| | | v-model="form.suffixCode" |
| | | :readonly="basicSecOnlyRead"> |
| | | </el-input> |
| | | </el-input> --> |
| | | <el-select v-model="form.suffixCode" :disabled="basicSecOnlyRead" clearable> |
| | | <el-option |
| | | v-for="(option, index) in preFixOrSuffixChars" |
| | | :key="index" |
| | | :label="option.label" |
| | | :value="option.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item :label-width="leftFormLabelWidth" label="描述:"> |
| | |
| | | :disabled="basicSecOnlyRead" |
| | | filterable |
| | | placeholder="请选择" |
| | | @blur="inputSelectBlur" |
| | | clearable |
| | | > |
| | | <el-option |
| | | v-for="item in enumParam.codeFillSeparator" |
| | | :key="item.dictKey" |
| | | :label="item.dictValue" |
| | | :value="item.dictValue" |
| | | :key="item.lable" |
| | | :label="item.lable" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label-width="rightFormLabelWidth" |
| | | label="自定义的流水算法:" |
| | | label="自定义流水算法:" |
| | | > |
| | | <template> |
| | | <vciWebRefer |
| | | ref="refer" |
| | | :referConfig="this.referConfig || {}" |
| | | :disabled="basicSecOnlyRead" |
| | | :display="true" |
| | | :value="form.customCodeSerialClass" |
| | | :text="form.customCodeSerialClassText" |
| | | :referConfig="this.referConfig || {}" |
| | | :serialType="form.serialType" |
| | | :text="form.customCodeSerialClassText" |
| | | :value="form.customCodeSerialClass" |
| | | @setReferValue="setReferValue" |
| | | ></vciWebRefer> |
| | | </template> |
| | | |
| | | |
| | | </el-form-item> |
| | | </div> |
| | | <!-- 层级码段 --> |
| | |
| | | v-model="form.codeLevelType" |
| | | :disabled="basicSecOnlyRead" |
| | | placeholder="请选择" |
| | | @change="changeLevelType" |
| | | > |
| | | <el-option |
| | | v-for="item in enumParam.codeLevelType" |
| | |
| | | ref="codeLevelValue" |
| | | v-model.number="form.codeLevelValue" |
| | | :readonly="basicSecOnlyRead" |
| | | :disabled="form.codeLevelType != 'code_level_special'" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | |
| | | <!-- 日期码段 --> |
| | | <div v-show="form.secType === 'codedatesec' ? true : false"> |
| | | <el-form-item |
| | | prop="Dateformat" |
| | | :label-width="rightFormLabelWidth" |
| | | label="日期格式:" |
| | | prop="Dateformat" |
| | | > |
| | | <el-input |
| | | ref="codeDateFormatStr" |
| | |
| | | :disabled="basicSecOnlyRead" |
| | | filterable |
| | | placeholder="请选择" |
| | | @blur="inputSelectBlur" |
| | | clearable |
| | | > |
| | | <el-option |
| | | v-for="item in enumParam.codeFillSeparator" |
| | | :key="item.dictKey" |
| | | :label="item.dictValue" |
| | | :value="item.dictValue" |
| | | :key="item.lable" |
| | | :label="item.lable" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | |
| | | </refer-config-dialog> |
| | | </el-dialog> |
| | | |
| | | <!-- 自定义流水参照组件--> |
| | | |
| | | |
| | | </basic-container> |
| | | </template> |
| | |
| | | deleteCodeClassifyValue, |
| | | saveCodeClassifyValueOrder, |
| | | } from "@/api/code/codeClassifyValue"; |
| | | import { getSelectList, getRegexStr } from "@/api/code/codeCharcter" |
| | | import {getDictionary} from "@/api/omd/enum"; |
| | | import {getDictionaryBiz} from "@/api/system/dictbiz"; |
| | | // 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 vciWebRefer from "../../components/refer/vciWebRefer"; |
| | | |
| | | export default { |
| | | components: { vciWebRefer }, |
| | | components: {vciWebRefer}, |
| | | data() { |
| | | return { |
| | | rules: { |
| | |
| | | required: true, |
| | | trigger: 'blur', |
| | | validator: (rule, value, callback) => { |
| | | const Formats = ['yy', 'yyyy', 'yyyy-MM', 'yy-MM', 'yyyy-MM-dd','yy-MM-dd', 'yyyy-MM-dd HH:mm:ss', 'yy-MM-dd HH:mm:ss', 'HH:mm:ss']; |
| | | const Formats = [ |
| | | 'yy', |
| | | 'yyyy', |
| | | 'yy-MM', |
| | | 'yyMM', |
| | | 'yyyy-MM', |
| | | 'yyyyMM', |
| | | 'yy-MM-dd', |
| | | 'yyMMdd', |
| | | 'yyyy-MM-dd', |
| | | 'yyyyMMdd', |
| | | 'yyyy-MM-dd HH:mm:ss', |
| | | 'yy-MM-dd HH:mm:ss', |
| | | 'HH:mm:ss', |
| | | 'yyyyMMdd HH:mm:ss', |
| | | 'yyMMdd HH:mm:ss', |
| | | 'yyyy-MM-dd HHmmss', |
| | | 'yy-MM-dd HHmmss', |
| | | 'yyyyMMdd HHmmss', |
| | | 'yyMMdd HHmmss', |
| | | 'HHmmss' |
| | | ]; |
| | | if (!Formats.includes(this.form.codeDateFormatStr)) { |
| | | return callback(new Error('请输入正确日期格式,例如yyyy-MM-dd(并区分大小写)!')); |
| | | } |
| | |
| | | } |
| | | ] |
| | | }, |
| | | referConfig:{ |
| | | referConfig: { |
| | | title: '自定义流水参照', |
| | | showField: 'customCodeSerialClassText', |
| | | field: 'customCodeSerialClass', |
| | | fieldMap: { |
| | | serialType:"serialType" |
| | | fieldMap: { |
| | | serialType: "serialType", |
| | | }, |
| | | placeholder:'请选择自定义流水', |
| | | options: { |
| | | placeholder: '请选择自定义流水', |
| | | options: { |
| | | // 设置默认的属性 |
| | | url: 'api/ubcs-code/codeSerialAlgorithmController/gridCodeSerialAlgorithm', |
| | | textField:'name', |
| | | valueField:'classFullName', |
| | | textField: 'name', |
| | | valueField: 'classFullName', |
| | | isMuti: false, |
| | | type: "grid", |
| | | method: 'get', |
| | |
| | | //引用码段中参照配置组件相关参数 |
| | | referConfigOption: {}, |
| | | referConfigVisble: false, |
| | | |
| | | preFixOrSuffixChars: [], //前后缀字符列表 |
| | | |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | }, |
| | | methods: { |
| | | //自定义流水失焦 |
| | | setReferValue(data){ |
| | | if(data.field){ |
| | | this.form[data.field] = data.value || ""; |
| | | setReferValue(data) { |
| | | if (data.field) { |
| | | // this.form[data.field] = data.value || ""; |
| | | this.form.customCodeSerialClass = data.rawData[0].id || ""; |
| | | console.log(this.form.customCodeSerialClass); |
| | | this.form[data.showField] = data.text || ""; |
| | | this.form.serialType = data.rawData[0].serialType || ""; |
| | | |
| | | this.form.customCodeSerialType = data.rawData[0].serialType || ""; |
| | | } |
| | | }, |
| | | /** 转移规则所有者对话框 */ |
| | |
| | | this.codeFixdForm.codeFixedSecOid = row.codefixedsecoid; |
| | | }, |
| | | /** 新增码值*/ |
| | | addCodeSecValue(condition) { |
| | | async addCodeSecValue(condition) { |
| | | if (condition === "codefixedsec") { |
| | | if (!this.tipsCodeSecValueMessage(this.codeFixdForm.id)) { |
| | | return; |
| | | } |
| | | if(!await this.regexCharacter(this.codeFixdForm.id)){ |
| | | return; |
| | | } |
| | | this.codeFixdForm.codeFixedSecOid = this.codefixedsecOrCodeclassifysec.oid; |
| | |
| | | } |
| | | ); |
| | | } else { |
| | | if (!this.tipsCodeSecValueMessage(this.codeClassifyForm.id)) { |
| | | // if (!this.tipsCodeSecValueMessage(this.codeClassifyForm.id)) { |
| | | // return; |
| | | // } |
| | | if(!this.codeClassifyForm.name){ |
| | | this.$message.error('请输入名称'); |
| | | return; |
| | | } |
| | | if(!await this.regexCharacter(this.codeClassifyForm.id)){ |
| | | return; |
| | | } |
| | | this.codeClassifyForm.codeClassifySecOid = |
| | |
| | | ); |
| | | } |
| | | }, |
| | | /** 清空码值表单 */ |
| | | clearFixedOrClassifyForm(condition) { |
| | | //点击取消时清空表单与当前选中的码值,并禁用按钮 |
| | | this.selectedFixedOrCodeclassifyValue = ""; |
| | | if (condition === "close") { |
| | | this.codeFixdForm = this.$options.data().codeFixdForm; |
| | | this.codeClassifyForm = this.$options.data().codeClassifyForm; |
| | | } |
| | | if (condition === "codefixedsec") { |
| | | this.codeFixdForm.description = ""; |
| | | this.codeFixdForm.codeFixedSecOid = ""; |
| | | } else { |
| | | this.codeClassifyForm = this.$options.data().codeClassifyForm; |
| | | } |
| | | }, |
| | | /** 添加或修改码值之前对码值长度根据规则进行校验 */ |
| | | tipsCodeSecValueMessage(id) { |
| | | if (id.trim() == "") { |
| | | this.$message.warning("码值不能为空!"); |
| | | return false; |
| | | } |
| | | if (id.trim().length > this.codefixedsecOrCodeclassifysec.codeSecLength) { |
| | | this.$message.warning( |
| | | "码值长度不能大于" + this.codefixedsecOrCodeclassifysec.codeSecLength |
| | | ); |
| | | return false; |
| | | } |
| | | return true; |
| | | }, |
| | | /** 修改码值 */ |
| | | editCodeSecValue(condition) { |
| | | async editCodeSecValue(condition) { |
| | | if (condition == "codefixedsec") { |
| | | if (!this.tipsCodeSecValueMessage(this.codeFixdForm.id)) { |
| | | return; |
| | | } |
| | | if(!await this.regexCharacter(this.codeFixdForm.id)){ |
| | | return; |
| | | } |
| | | //以前是直接把当前选中行的所有数据都进行提交,但其实只需要传输一些必要参数即可,这儿做了修改,需要传其他参数的请自行添加 |
| | |
| | | if (!this.tipsCodeSecValueMessage(this.codeClassifyForm.id)) { |
| | | return; |
| | | } |
| | | if(!await this.regexCharacter(this.codeClassifyForm.id)){ |
| | | return; |
| | | } |
| | | this.codeClassifyForm.oid = |
| | | this.selectedFixedOrCodeclassifyValue.attributes.oid; |
| | | // 分类码段,子分类和父分类之间不能相互更改 |
| | |
| | | } |
| | | ); |
| | | } |
| | | }, |
| | | /** |
| | | * 可用字符集码值正则校验 |
| | | * @return true:满足限制,false:不满足限制 |
| | | */ |
| | | async regexCharacter(str){ |
| | | var regex = null; |
| | | // 获取到配置好的可用字符正则 |
| | | await getRegexStr({codeRuleId: this.selectionList[0].oid,chartType: "charset"}).then(res=>{ |
| | | // console.log(res.data.data); |
| | | regex = new RegExp(res.data.data); |
| | | }); |
| | | // console.log(regex); |
| | | // console.log(regex.test(str)); |
| | | if(regex != "" && !regex.test(str)){ |
| | | this.$message.warning("添加的码值未在可用字符集中配置!"); |
| | | return false; |
| | | } |
| | | return true; |
| | | }, |
| | | /** 清空码值表单 */ |
| | | clearFixedOrClassifyForm(condition) { |
| | | //点击取消时清空表单与当前选中的码值,并禁用按钮 |
| | | this.selectedFixedOrCodeclassifyValue = ""; |
| | | if (condition === "close") { |
| | | this.codeFixdForm = this.$options.data().codeFixdForm; |
| | | this.codeClassifyForm = this.$options.data().codeClassifyForm; |
| | | } |
| | | if (condition === "codefixedsec") { |
| | | this.codeFixdForm.description = ""; |
| | | this.codeFixdForm.codeFixedSecOid = ""; |
| | | } else { |
| | | this.codeClassifyForm = this.$options.data().codeClassifyForm; |
| | | } |
| | | }, |
| | | /** 添加或修改码值之前对码值长度根据规则进行校验 */ |
| | | tipsCodeSecValueMessage(id) { |
| | | if (id.trim() == "") { |
| | | this.$message.warning("码值不能为空!"); |
| | | return false; |
| | | } |
| | | if (id.trim().length > this.codefixedsecOrCodeclassifysec.codeSecLength) { |
| | | this.$message.warning( |
| | | "码值长度不能大于" + this.codefixedsecOrCodeclassifysec.codeSecLength |
| | | ); |
| | | return false; |
| | | } |
| | | return true; |
| | | }, |
| | | /** 删除码值 */ |
| | | delCodeSecValue(condition) { |
| | |
| | | /** 发布编码规则 */ |
| | | async enableOrDeactivatse(oid, update) { |
| | | if (update === "release") { |
| | | this.releadDisabled = true; |
| | | // 避免用户重复点击按钮 |
| | | this.releadDisabled = true; |
| | | await checkLikeCodeRule(oid) |
| | | .then((res) => { |
| | | //console.log(res) |
| | |
| | | }, |
| | | /** 打开新增或编辑基础码段对话框*/ |
| | | openBasicDialog(condition, row) { |
| | | //console.log(row); |
| | | if (condition == "add") { |
| | | this.basicSecDialogTitle = "添加码段信息"; |
| | | this.showbtn = true; |
| | |
| | | //console.log(this.form); |
| | | //为form绑定值 |
| | | this.changeSectypeFormItems(condition == "add" ? null : row); |
| | | // 获取前后缀可用字符 |
| | | this.loadPreOrSuffixChars(); |
| | | // 补位时字符 |
| | | // this.loadCodeFillSeparator(); |
| | | this.addBasicCodeSettingBox = true; |
| | | }, |
| | | /** 获取前后缀字符 */ |
| | | loadPreOrSuffixChars(){ |
| | | getSelectList({codeRuleId: this.selectionList[0].oid,chartType: "prefix"}).then(res=>{ |
| | | this.preFixOrSuffixChars = res.data.data; |
| | | // console.log(this.preFixOrSuffixChars); |
| | | }) |
| | | }, |
| | | /** 新增基础码段*/ |
| | | async saveOrEditBasicCode() { |
| | | this.isLoadingSecCodeAddBtn = true; |
| | | if ( |
| | | this.selectionList[0].oid == null || |
| | | this.selectionList[0].oid == "" |
| | |
| | | this.$message.warning("缺失必要参数,请重新选择编码规则后再试!"); |
| | | return; |
| | | } |
| | | if (!this.checkForm()) { |
| | | return; |
| | | } |
| | | this.isLoadingSecCodeAddBtn = true; |
| | | this.form.pkCodeRule = this.selectionList[0].oid; |
| | | if (this.form.oid == "" || this.form.oid == null) { |
| | | if (this.checkForm()) { |
| | | await addSave(this.form).then( |
| | | () => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | console.log(this.form) |
| | | // 关闭对话框 |
| | | this.addBasicCodeSettingBox = false; |
| | | // 点击新增基础码段,关闭窗口之后触发重新加载 |
| | | this.loadBasic(this.selectionList[0]); |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | } |
| | | ); |
| | | } |
| | | await addSave(this.form).then( |
| | | () => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | // console.log(this.form) |
| | | // 关闭对话框 |
| | | this.addBasicCodeSettingBox = false; |
| | | // 点击新增基础码段,关闭窗口之后触发重新加载 |
| | | this.loadBasic(this.selectionList[0]); |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | } |
| | | ); |
| | | } else { |
| | | // 可能参照引用的业务类型会发生改变所以这儿直接对referConfig的json进行改变 |
| | | if ( |
| | |
| | | // let referValueInfo = JSON.parse(this.form.referValueInfo); |
| | | // referValueInfo.referType = this.form.referBtmId; |
| | | } |
| | | let oldBasicSec = this.selectionBasicList.at(-1); |
| | | let oldBasicSec = this.selectionBasicList.slice(-1)[0]; |
| | | let secType = this.form.secType; |
| | | Vue.set(this.form, 'isClearValue', false); |
| | | if ((oldBasicSec.secType == "codefixedsec" || oldBasicSec.secType === "codeclassifysec") && oldBasicSec.secType != secType) { |
| | |
| | | this.$refs.codeDateFormatStr.$el.querySelector("input").focus(); |
| | | return false; |
| | | } |
| | | const Formats = [ |
| | | 'yy', |
| | | 'yyyy', |
| | | 'yy-MM', |
| | | 'yyMM', |
| | | 'yyyy-MM', |
| | | 'yyyyMM', |
| | | 'yy-MM-dd', |
| | | 'yyMMdd', |
| | | 'yyyy-MM-dd', |
| | | 'yyyyMMdd', |
| | | 'yyyy-MM-dd HH:mm:ss', |
| | | 'yy-MM-dd HH:mm:ss', |
| | | 'HH:mm:ss', |
| | | 'yyyyMMdd HH:mm:ss', |
| | | 'yyMMdd HH:mm:ss', |
| | | 'yyyy-MM-dd HHmmss', |
| | | 'yy-MM-dd HHmmss', |
| | | 'yyyyMMdd HHmmss', |
| | | 'yyMMdd HHmmss', |
| | | 'HHmmss' |
| | | ]; |
| | | if (!Formats.includes(this.form.codeDateFormatStr)) { |
| | | this.$message.warning('请检查日期格式!'); |
| | | return; |
| | | } |
| | | } else if (this.form.secType === "codeclassifysec") { |
| | | //分类码段 |
| | | if (form.codeSecLengthType == "") { |
| | |
| | | } |
| | | return true; |
| | | }, |
| | | /** 层级码段选择为最小层级时清空层级的值 */ |
| | | changeLevelType(){ |
| | | if(this.form.codeLevelType === 'code_level_min'){ |
| | | this.form.codeLevelValue = ''; |
| | | } |
| | | }, |
| | | /** 判断数据是否选择以及只能选择单条数据*/ |
| | | tipsMessage(list) { |
| | | if (list.length != 1) { |
| | |
| | | if (!this.tipsMessage(this.selectionBasicList)) { |
| | | return; |
| | | } |
| | | if (this.selectionList.at(-1).lcStatus != "Editing") { |
| | | if (this.selectionList.slice(-1)[0].lcStatus != "Editing") { |
| | | this.$message.warning('编码规则状态不是"编辑中",不允许删除码段!'); |
| | | return; |
| | | } |
| | |
| | | }, |
| | | /** 基础码段刷新时查询*/ |
| | | refreshChangeBasicSec() { |
| | | this.loadBasic(this.selectionList.at(-1)); |
| | | this.loadBasic(this.selectionList.slice(-1)[0]); |
| | | }, |
| | | /** 操作基础码段中搜索清空等按钮的显示/隐藏*/ |
| | | hideBasicTable(hideBoolean) { |
| | |
| | | this.form.referConfig = ""; |
| | | } |
| | | }, |
| | | /** 补位时的字符,实现可输可选*/ |
| | | inputSelectBlur(e) { |
| | | /** 补位时的字符,实现可输可选 TODO:因为增加了可用字符集控制,所以这儿弃用了可用字符集的效果*/ |
| | | /*inputSelectBlur(e) { |
| | | if (e.target.value) { |
| | | this.form.codeFillSeparator = e.target.value; |
| | | } |
| | | }, |
| | | },*/ |
| | | /** 码段类型改变时,增加对应的form表单中的属性*/ |
| | | changeSectypeFormItems(row) { |
| | | console.log(row) |
| | | //console.log(row) |
| | | if ( |
| | | func.isEmpty(this.enumParam.secTypeList) || |
| | | this.enumParam.secTypeList.length == 0 |
| | |
| | | row != null && row.customCodeSerialClass != "" |
| | | ? row.customCodeSerialClass |
| | | : "", //自定义流水算法 |
| | | customCodeSerialClassText: |
| | | row != null && row.customCodeSerialClassText != "" |
| | | ? row.customCodeSerialClassText |
| | | : "", //自定义流水算法显示值 |
| | | customCodeSerialType: |
| | | row != null && row.customCodeSerialType != "" |
| | | ? row.customCodeSerialType |
| | | : "", //自定义流水算法类型 |
| | | }); |
| | | this.loadCodeFillType(); |
| | | this.loadCodeFillSeparator(); |
| | |
| | | if (enumCach == null) { |
| | | getDictionary({code: enumKey}).then((res) => { |
| | | enumCach = res.data.data; |
| | | localStorage.setItem(enumKey, JSON.stringify(res.data.data)); |
| | | localStorage.setItem(enumKey, JSON.stringify(enumCach)); |
| | | }); |
| | | } |
| | | return enumCach; |
| | |
| | | this.loadCodeSecType(); |
| | | this.loadCodeSecLength(); |
| | | this.loadCodeFillType(); |
| | | this.loadCodeFillSeparator(); |
| | | // this.loadCodeFillSeparator(); |
| | | this.loadCodeLevelType(); |
| | | this.loadCodeCutType(); |
| | | this.loadCodeGetValueType(); |
| | |
| | | loadCodeFillSeparator() { |
| | | //let enumCach = JSON.parse(localStorage.getItem("codeFillSeparator")); |
| | | //if (enumCach == null) { |
| | | getDictionaryBiz({code: "codeFillSeparator"}).then((res) => { |
| | | getSelectList({codeRuleId: this.selectionList[0].oid,chartType: "fillerChar"}).then((res) => { |
| | | this.enumParam.codeFillSeparator = res.data.data; |
| | | //console.log(this.enumParam.codeFillSeparator); |
| | | localStorage.setItem( |
| | | "codeFillSeparator", |
| | | JSON.stringify(res.data.data) |
| | | ); |
| | | // localStorage.setItem( |
| | | // "codeFillSeparator", |
| | | // JSON.stringify(res.data.data) |
| | | // ); |
| | | }); |
| | | //} |
| | | }, |
| | | loadCodeLevelType() { |
| | | this.enumParam.codeLevelType = this.getLocalStorageEnum("codeLevelType") || []; |
| | |
| | | font-size: 12px !important; |
| | | } |
| | | |
| | | .code-rule-crud > .avue-crud__search, |
| | | .code-basic-crud > .avue-crud__search { |
| | | margin-bottom: -15px; |
| | | } |
| | | |
| | | .clone-input-textarea > .el-form-item__content { |
| | | width: 495px; |