田源
2023-11-28 8e8a803c51dce12cc0a974f9ac6cef4883f8ec34
Source/UBCS-WEB/src/views/code/code.vue
@@ -1,5 +1,5 @@
<template>
  <basic-container class="code-total" style="height: 100%">
  <basic-container class="code-total" style=" height: 100%">
    <!-- 编码规则信息展示区域 -->
    <basic-container class="code-rule-container">
      <p
@@ -36,110 +36,105 @@
      >
        <!-- 表格内操作按钮 -->
        <template slot="menu" slot-scope="scope">
          <el-button
            v-show="scope.row.lcStatus == 'Editing' ? true : false"
            icon="el-icon-edit"
            plain
            size="small"
            type="text"
            @click="openEdit(scope.row)"
            >编 辑
          <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-show="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 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-show="scope.row.lcStatus == 'Released' ? true : false"
            icon="el-icon-video-pause"
            plain
            size="small"
            type="text"
            @click="enableOrDeactivatse(scope.row.oid, 'disable')"
            >停 用
          <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-show="scope.row.lcStatus == 'Disabled' ? true : false"
            icon="el-icon-video-play"
            plain
            size="small"
            type="text"
            @click="enableOrDeactivatse(scope.row.oid, 'enable')"
            >启 用
          <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
            icon="el-icon-delete"
            plain
            size="small"
            type="danger"
            @click="handleDelete"
          <el-button v-if="permissionList.rulDelBtn"
                     icon="el-icon-delete"
                     plain
                     size="small"
                     type="danger"
                     @click="handleDelete"
          >
            删 除
          </el-button>
          <el-button
            icon="el-icon-search"
            plain
            size="small"
            type="primary"
            @click="openAdvancedQuery('codeRule')"
          >
          <el-button v-if="permissionList.advancedQueryBtn"
                     icon="el-icon-search"
                     plain
                     size="small"
                     type="primary"
                     @click="openAdvancedQuery('codeRule')">
            高级查询
          </el-button>
          <el-button
            icon="icon-kelong"
            plain
            size="small"
            @click="openCodeRuleDialog"
          <el-button v-if="permissionList.cloneBtn"
                     icon="icon-kelong"
                     plain
                     size="small"
                     @click="openCodeRuleDialog"
          >
            克 隆
          </el-button>
          <el-button
            icon="icon-lianjiekelong"
            plain
            size="small"
            style="font-size: 12px"
            @click="openOtherCodeRuleDialog"
          <el-button v-if="permissionList.otherCloneBtn"
                     icon="icon-lianjiekelong"
                     plain
                     size="small"
                     style="font-size: 12px"
                     @click="openOtherCodeRuleDialog"
          >
            从其他规则中克隆码段
          </el-button>
          <el-button
            icon="el-icon-s-help"
            plain
            size="small"
            @click="handleRange"
          <el-button v-if="permissionList.usescopeBtn"
                     icon="el-icon-s-help"
                     plain
                     size="small"
                     @click="handleRange"
          >
            使用范围
          </el-button>
          <el-button
            icon="icon-qingkong"
            plain
            size="small"
            @click="clearAllCodeSec"
          <el-button v-if="permissionList.clearBtn"
                     icon="icon-qingkong"
                     plain
                     size="small"
                     @click="clearAllCodeSec"
          >
            清空码值
          </el-button>
          <el-button
            icon="el-icon-guide"
            plain
            size="small"
            @click="escapeOwner"
          <el-button v-if="permissionList.escapeOwnerBtn"
                     icon="el-icon-guide"
                     plain
                     size="small"
                     @click="escapeOwner"
          >
            转移所有者
          </el-button>
          <el-button
            icon="el-icon-data-analysis"
            plain
            size="small"
            @click="maxSerialNum"
          <el-button v-if="permissionList.maxSerialnumBtn"
                     icon="el-icon-data-analysis"
                     plain
                     size="small"
                     @click="maxSerialNum"
          >
            最大流水号
          </el-button>
@@ -178,15 +173,15 @@
    <!-- 编码规则,克隆对话框 -->
    <clone-rule-dialog
      :visible.sync="cloneSettingBox"
      :ruleData="selectionList[0]"
      :visible.sync="cloneSettingBox"
      @refreshRuleTable="onLoad">
    </clone-rule-dialog>
    <!-- 编码规则,从其他规则克隆对话框 -->
    <clone-other-basic-sec-dialog
      :visible.sync="cloneOtherCodeRuleSettingBox"
      :quiltCloneCodeRule="selectionList[0]"
      :visible.sync="cloneOtherCodeRuleSettingBox"
      @refreshRuleTable="onLoad">
    </clone-other-basic-sec-dialog>
@@ -194,9 +189,9 @@
    <el-dialog
      :visible.sync="escapeOwnerVisible"
      append-to-body
      class="avue-dialog avue-dialog--top"
      title="转移所有者"
      width="30%"
      class= "avue-dialog avue-dialog--top"
    >
      <el-select v-model="ruleOwner" class="selects" placeholder="请选择">
        <el-option
@@ -223,21 +218,18 @@
    <!-- 基础码段展示区域 -->
    <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"
@@ -248,83 +240,77 @@
      >
        <!-- 基础码段表格内操作按钮 -->
        <template slot="menu" slot-scope="scope">
          <el-button
            v-show="currentRuleLcStatus != 'Editing'"
            icon="el-icon-view"
            plain
            size="small"
            type="text"
            @click="openBasicDialog('view', scope.row)"
            >查看
          <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-show="currentRuleLcStatus === 'Editing'"
            icon="el-icon-edit"
            plain
            size="small"
            type="text"
            @click="openBasicDialog('edit', scope.row)"
            >编辑
          </el-button>
          <el-button
            v-show="
              scope.row.secType === 'codeclassifysec' ||
              scope.row.secType == 'codefixedsec'
            "
            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-show="scope.row.orderNum > 1"
            icon="el-icon-arrow-up"
            plain
            size="small"
            type="text"
            @click="upOrderNum(scope.row)"
            >上移
          <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
            icon="el-icon-arrow-down"
            plain
            size="small"
            type="text"
            @click="downOrderNum(scope.row)"
            >下移
          <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
            :disabled="selectionList.length <= 0"
            icon="el-icon-plus"
            size="small"
            type="primary"
            @click="openAddBasicCodeSec"
          <el-button v-if="basicPermissionList.addBtn"
                     :disabled="selectionList.length <= 0"
                     icon="el-icon-plus"
                     size="small"
                     type="primary"
                     @click="openAddBasicCodeSec"
          >
            新 增
          </el-button>
          <el-button
            :disabled="selectionList.length <= 0"
            icon="el-icon-delete"
            plain
            size="small"
            type="danger"
            @click="deleteBasicCode(scope.row)"
          <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
            :disabled="selectionList.length <= 0"
            icon="el-icon-search"
            plain
            size="small"
            type="primary"
            @click="openAdvancedQuery('codeBasicSec')"
          <el-button v-if="basicPermissionList.basicAdvancedQueryBtn"
                     :disabled="selectionList.length <= 0"
                     icon="el-icon-search"
                     plain
                     size="small"
                     type="primary"
                     @click="openAdvancedQuery('codeBasicSec')"
          >
            高级查询
          </el-button>
@@ -377,7 +363,7 @@
                size="mini"
                type="primary"
                @click="codeClassifyValueOpetion('up')"
                >上移
              >上移
              </el-button>
              <el-button
                class="button"
@@ -385,7 +371,7 @@
                size="mini"
                type="primary"
                @click="codeClassifyValueOpetion('down')"
                >下移
              >下移
              </el-button>
            </div>
          </basic-container>
@@ -422,7 +408,7 @@
                size="mini"
                type="primary"
                @click="addCodeSecValue('codeclassifyvaluesec')"
                >添加
              >添加
              </el-button>
              <el-button
                :disabled="selectedFixedOrCodeclassifyValue == ''"
@@ -432,7 +418,7 @@
                size="mini"
                type="success"
                @click="editCodeSecValue('codeclassifyvaluesec')"
                >修改
              >修改
              </el-button>
              <el-button
                :disabled="selectedFixedOrCodeclassifyValue == ''"
@@ -441,7 +427,7 @@
                size="mini"
                type="danger"
                @click="delCodeSecValue('codeclassifyvaluesec')"
                >删除
              >删除
              </el-button>
              <el-button
                class="button"
@@ -450,7 +436,7 @@
                size="mini"
                type="warning"
                @click="clearFixedOrClassifyForm('codeclassifyvaluesec')"
                >取消
              >取消
              </el-button>
            </div>
          </basic-container>
@@ -479,21 +465,21 @@
                    size="mini"
                    type="text"
                    @click="codeFixedValueOpetion('up', scope.row)"
                    >上移
                  >上移
                  </el-button>
                  <el-button
                    icon="el-icon-arrow-down"
                    size="mini"
                    type="text"
                    @click="codeFixedValueOpetion('down', scope.row)"
                    >下移
                  >下移
                  </el-button>
                  <el-button
                    icon="el-icon-minus"
                    size="mini"
                    type="text"
                    @click="codeFixedValueOpetion('remove', scope.row)"
                    >移除
                  >移除
                  </el-button>
                </template>
              </avue-crud>
@@ -505,7 +491,7 @@
                size="mini"
                type="primary"
                @click="saveCodeFixedOrClassifyValueOption('fixedValue')"
                >保存
              >保存
              </el-button>
            </div>
          </basic-container>
@@ -549,7 +535,7 @@
                size="mini"
                type="primary"
                @click="addCodeSecValue('codefixedsec')"
                >添加
              >添加
              </el-button>
              <el-button
                :disabled="selectedFixedOrCodeclassifyValue == ''"
@@ -559,7 +545,7 @@
                size="mini"
                type="success"
                @click="editCodeSecValue('codefixedsec')"
                >修改
              >修改
              </el-button>
              <el-button
                :disabled="selectedFixedOrCodeclassifyValue == ''"
@@ -568,7 +554,7 @@
                size="mini"
                type="danger"
                @click="delCodeSecValue('codefixedsec')"
                >删除
              >删除
              </el-button>
              <el-button
                class="button"
@@ -577,7 +563,7 @@
                size="mini"
                type="warning"
                @click="clearFixedOrClassifyForm('codefixedsec')"
                >取消
              >取消
              </el-button>
            </div>
          </basic-container>
@@ -591,17 +577,17 @@
      :title="basicSecDialogTitle"
      :visible.sync="addBasicCodeSettingBox"
      append-to-body
      class="avue-dialog avue-dialog--top"
      class="avue-dialog avue-dialog--top add-basicsec-dialog"
      destroy-on-close
      lock-scroll
      style="height: 100vh"
      style="height: 105vh"
      top="-3%"
      width="900px"
      @close="clearBasicAddForm"
    >
      <!--  第一层对话框,添加码段信息对话框中的内容 -->
      <div class="add-basicsec-total" style="overflow-y: auto; height: 58vh">
        <el-form :model="form" class="add-basicsec-form">
      <div class="add-basicsec-total">
        <el-form :model="form" class="add-basicsec-form" :rules="rules" >
          <span class="left">
            <el-form-item
              :label-width="leftFormLabelWidth"
@@ -629,7 +615,7 @@
            <el-form-item
              :label-width="leftFormLabelWidth"
              label="码段类型"
              label="码段类型:"
              required
            >
              <el-select
@@ -646,6 +632,24 @@
                >
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item
              :label-width="leftFormLabelWidth"
              label="前缀:">
              <el-input
                v-model="form.prefixCode"
                :readonly="basicSecOnlyRead"
              ></el-input>
            </el-form-item>
            <el-form-item
              :label-width="leftFormLabelWidth"
              label="后缀:">
              <el-input
                v-model="form.suffixCode"
                :readonly="basicSecOnlyRead">
              </el-input>
            </el-form-item>
            <el-form-item :label-width="leftFormLabelWidth" label="描述:">
@@ -665,12 +669,12 @@
                :disabled="basicSecOnlyRead"
                style="margin-right: 20px"
              ></el-switch>
              <el-input-number
              <!-- <el-input-number
                v-show="form.serialDependFlag"
                v-model="form.serialDependOrder"
                :readonly="basicSecOnlyRead"
                controls-position="right"
              ></el-input-number>
              ></el-input-number> -->
            </el-form-item>
            <el-form-item :label-width="leftFormLabelWidth" label="是否为空:">
@@ -833,9 +837,9 @@
                >
                  <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>
@@ -876,10 +880,19 @@
                :label-width="rightFormLabelWidth"
                label="自定义的流水算法:"
              >
                <el-input
                  v-model="form.customCodeSerialClass"
                  :readonly="basicSecOnlyRead"
                ></el-input>
                  <template>
                      <vciWebRefer
                        ref="refer"
                        :referConfig="this.referConfig || {}"
                        :display="true"
                        :value="form.customCodeSerialClass"
                        :text="form.customCodeSerialClassText"
                        :serialType="form.serialType"
                        @setReferValue="setReferValue"
                      ></vciWebRefer>
                  </template>
              </el-form-item>
            </div>
            <!-- 层级码段 -->
@@ -1010,9 +1023,9 @@
            <!-- 日期码段 -->
            <div v-show="form.secType === 'codedatesec' ? true : false">
              <el-form-item
                prop="Dateformat"
                :label-width="rightFormLabelWidth"
                label="日期格式:"
                required
              >
                <el-input
                  ref="codeDateFormatStr"
@@ -1128,9 +1141,9 @@
                >
                  <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>
@@ -1140,13 +1153,14 @@
        </el-form>
      </div>
      <!-- 第一层对话框的按钮和分隔线条 -->
      <el-divider class="horizontal-line" direction="horizontal"></el-divider>
      <!-- <el-divider class="horizontal-line" direction="horizontal"></el-divider> -->
      <div slot="footer" class="dialog-footer">
        <el-button
          :disabled="!showbtn"
          type="primary"
          :loading="isLoadingSecCodeAddBtn"
          @click="saveOrEditBasicCode">保 存</el-button>
          type="primary"
          @click="saveOrEditBasicCode">保 存
        </el-button>
        <el-button @click="addBasicCodeSettingBox = false">取 消</el-button>
      </div>
@@ -1201,9 +1215,7 @@
          </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>
@@ -1245,11 +1257,13 @@
        </avue-crud>
        <div slot="footer" class="dialog-footer">
          <el-button type="primary" @click="saveSelectedParentClassify"
            >保 存</el-button
          >保 存
          </el-button
          >
          <el-button
            @click="parentClsfyParams.isShowParentClassifySettingBox = false"
            >取 消</el-button
          >取 消
          </el-button
          >
        </div>
      </el-dialog>
@@ -1270,6 +1284,10 @@
      >
      </refer-config-dialog>
    </el-dialog>
    <!--    自定义流水参照组件-->
  </basic-container>
</template>
@@ -1294,7 +1312,7 @@
  addSave,
  refDataGridClassifySec,
} from "@/api/code/codebasic";
import { listClassifyLinkAttr } from "@/api/code/codeclassify";
import {listClassifyLinkAttr} from "@/api/code/codeclassify";
import {
  gridCodeFixedValue,
  addSaveCodeFixedValue,
@@ -1309,7 +1327,8 @@
  deleteCodeClassifyValue,
  saveCodeClassifyValueOrder,
} from "@/api/code/codeClassifyValue";
import { getDictionary } from "@/api/omd/enum";
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";
@@ -1317,14 +1336,67 @@
import classisyValueTreeOption from "@/const/code/classisyValueTreeDialog";
import parentClassifyParentOption from "@/const/code/parentClassifyParentOptionDialog";
import fixedValueOption from "@/const/code/fixedValueMgrDialog";
import { mapGetters } from "vuex";
import { getByRoleUserList } from "@/api/system/user";
import {mapGetters} from "vuex";
import {getByRoleUserList} from "@/api/system/user";
import func from "@/util/func";
import secTypeEnum from '@/enumpack/CodeSecTypeEnum';
import vciWebRefer from "../../components/refer/vciWebRefer";
export default {
  components: { vciWebRefer },
  data() {
    return {
      crudOption:{...optionRule},
      rules: {
        Dateformat: [
          {
            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'];
              if (!Formats.includes(this.form.codeDateFormatStr)) {
                return callback(new Error('请输入正确日期格式,例如yyyy-MM-dd(并区分大小写)!'));
              }
              callback();
            }
          }
        ]
      },
      referConfig:{
        title: '自定义流水参照',
        showField: 'customCodeSerialClassText',
        field: 'customCodeSerialClass',
        fieldMap:  {
          serialType:"serialType"
        },
        placeholder:'请选择自定义流水',
        options:   {
          // 设置默认的属性
          url: 'api/ubcs-code/codeSerialAlgorithmController/gridCodeSerialAlgorithm',
          textField:'name',
          valueField:'classFullName',
          isMuti: false,
          type: "grid",
          method: 'get',
          tableConfig: {
            page: {
              limit: 15,
              page: 1
            },
            cols: [
              {title: '算法编号', field: 'id', width: 200},
              {title: '算法名称', field: 'name', width: 150},
              {title: '自定义流水Bean', field: 'classFullName', width: 300},
              {title: '类型', field: 'serialType', width: 300},
              {title: '描述', field: 'description'}
            ],
            queryColumns: [
              // {field: 'id', title: '算法编号'},
              // {field: 'name', title: '算法名称'}
            ]
          }
        }
      },
      crudOption: {...optionRule},
      ruleForm: {},
      query: {},
      loading: true,
@@ -1547,8 +1619,10 @@
        secType: "codefixedsec", //码段类型
        description: "", //描述
        serialDependFlag: false, //是否流水依赖
        serialDependOrder: "", //流水依赖顺序
        //serialDependOrder: "", //流水依赖顺序
        nullableFlag: false, //是否为空
        prefixCode: "", //前缀
        suffixCode: "", //后缀
        displayFlag: false, //
        componentCodeFlag: false, //是否参与编码
        pkCodeRule: "", //所属编码规则
@@ -1587,11 +1661,35 @@
    ...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: {},
@@ -1605,8 +1703,26 @@
      this.$refs.crudBasic.doLayout();
    });
  },
  // 生命钩子函数
  beforeDestroy() {
    // 清除指定缓存
    localStorage.removeItem('codeSecType');
    localStorage.removeItem('codeSecLength');
    localStorage.removeItem('codeFillType');
    localStorage.removeItem('codeLevelType');
    localStorage.removeItem('codeCutType');
    localStorage.removeItem('codeGetValueType');
  },
  methods: {
    //自定义流水失焦
    setReferValue(data){
      if(data.field){
        this.form[data.field] = data.value || "";
        this.form[data.showField] = data.text || "";
        this.form.serialType = data.rawData[0].serialType || "";
      }
    },
    /** 转移规则所有者对话框 */
    escapeOwner() {
      if (this.selectionList.length === 0) {
@@ -1665,7 +1781,7 @@
      //转换成JSON字符串进行父组件回显
      let submitFormJson = JSON.stringify(content);
      this.form.referConfig = submitFormJson || "";
      debugger;
      // debugger;
    },
    /** 引用码段为【参照引用的业务类型】选取值之后的内容回显时调用 */
    echoReferBtmType(content) {
@@ -1845,7 +1961,7 @@
    /** 加载固定码段码值表数据*/
    loadFixedValueTableData(row) {
      this.fixedValueOptionLoading = true;
      gridCodeFixedValue(1, -1, { codeFixedSecOid: row.oid }).then((res) => {
      gridCodeFixedValue(1, -1, {codeFixedSecOid: row.oid}).then((res) => {
        this.fixedValueData = res.data.data.records;
        this.fixedValueOptionLoading = false;
      });
@@ -1949,7 +2065,7 @@
          description: this.codeFixdForm.description,
          id: this.codeFixdForm.id,
          codeFixedSecOid:
            this.selectedFixedOrCodeclassifyValue.codefixedsecoid,
          this.selectedFixedOrCodeclassifyValue.codefixedsecoid,
        };
        editCodeFixedValue(editData).then(
          () => {
@@ -2370,7 +2486,7 @@
    },
    /** 修改规则状态:启用、停用、发布 */
    updateStatus(oid, update) {
      updateStatus({ oid: oid, ts: new Date().getTime, update: update }).then(
      updateStatus({oid: oid, ts: new Date().getTime, update: update}).then(
        () => {
          this.releadDisabled = false;
          this.onLoad(this.page);
@@ -2394,7 +2510,7 @@
            //console.log(res)
            if (res.data.data.success) {
              this.updateStatus(oid, update);
            }else {
            } else {
              this.$confirm(res.data.data.msg, "提示", {
                distinguishCancelAndClose: true,
                confirmButtonText: "继续发布",
@@ -2410,15 +2526,14 @@
                this.releadDisabled = false;
              });
            }
          })
          .catch((error) => {
          }).catch((error) => {
            this.releadDisabled = false;
          });
        this.releadDisabled = false;
      } else {
        this.updateStatus(oid, update);
      }
    },
    /** 打开编码规则克隆对话框*/
    openCodeRuleDialog() {
      if (!this.tipsMessage(this.selectionList)) {
@@ -2426,7 +2541,6 @@
      }
      this.cloneSettingBox = true;
    },
    /** 打开从其他编码规则中克隆码段对话框*/
    openOtherCodeRuleDialog() {
      if (!this.tipsMessage(this.selectionList)) {
@@ -2457,7 +2571,7 @@
      })
        .then(() => {
          let ts = new Date(currentData.ts).getTime();
          return clearAllCode({ oid: currentData.oid, ts: ts });
          return clearAllCode({oid: currentData.oid, ts: ts});
        })
        .then(() => {
          this.this.onLoad(this.page);
@@ -2519,7 +2633,7 @@
          // 只支持每次单条记录删除
          let oid = this.selectionList[0].oid;
          let ts = new Date(this.selectionList[0].ts).getTime();
          return remove({ oid: oid, ts: ts });
          return remove({oid: oid, ts: ts});
        })
        .then(() => {
          this.onLoad(this.page);
@@ -2600,9 +2714,9 @@
    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;
@@ -2658,13 +2772,13 @@
        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;
    },
@@ -2687,16 +2801,17 @@
                type: "success",
                message: "操作成功!",
              });
              console.log(this.form)
              // 关闭对话框
              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 (
@@ -2710,21 +2825,38 @@
          // 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的表单校验设置不上所以采用判断的方式来做表单检验方式*/
@@ -2946,7 +3078,7 @@
      })
        .then(() => {
          let ts = new Date(this.selectionBasicList[0].ts).getTime();
          return deleteData({ oid: oid, ts: ts });
          return deleteData({oid: oid, ts: ts});
        })
        .then(() => {
          this.loadBasic({
@@ -2970,7 +3102,7 @@
        //存储当前关联的编码规则相关信息
        this.currentCodeRuleOid = row.oid;
        this.currentRuleLcStatus = row.lcStatus;
        this.sendGridCodeBasicSec({ pkCodeRule: row.oid }, false);
        this.sendGridCodeBasicSec({pkCodeRule: row.oid}, false);
      }
    },
    /** 发送加载基础码段的请求*/
@@ -3027,7 +3159,7 @@
    },
    basicSearchReset() {
      this.sendGridCodeBasicSec(
        { pkCodeRule: this.selectionList[this.selectionList.length - 1].oid },
        {pkCodeRule: this.selectionList[this.selectionList.length - 1].oid},
        false
      );
    },
@@ -3071,7 +3203,7 @@
        return;
      }
      downOrderNum(row.oid).then(() => {
        this.loadBasic({ oid: codeRuleOid });
        this.loadBasic({oid: codeRuleOid});
        this.$message({
          type: "success",
          message: "操作成功!",
@@ -3156,40 +3288,29 @@
    },
    /** 码段类型改变时,增加对应的form表单中的属性*/
    changeSectypeFormItems(row) {
      console.log(row)
      if (
        func.isEmpty(this.enumParam.secTypeList) ||
        this.enumParam.secTypeList.length == 0
      ) {
        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, //所属编码规则
        prefixCode: row != null ? row.prefixCode : this.form.prefixCode, //前缀
        suffixCode: row != null ? row.suffixCode : this.form.suffixCode, //后缀
        // customCodeSerialClass: row != null ? row.customCodeSerialClass : this.form.customCodeSerialClass
      };
      if (this.form.secType === "codefixedsec") {
        //固定码段
        this.form = Object.assign({}, this.form, {
@@ -3232,8 +3353,8 @@
            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", //编码补位方式
            ? row.codeFillType
            : "code_fill_left", //编码补位方式
          // codeFillSeparatorSelect: row!=null&&row.codeFillSeparatorSelect != '' ? row.codeFillSeparatorSelect:0,    //补位时的字符,选中的下拉框的下标
          codeFillSeparator:
            row != null && row.codeFillSeparator != ""
@@ -3246,8 +3367,8 @@
          codeFillFlag:
            row != null && row.codeFillFlag != ""
              ? row.codeFillFlag == "true"
                ? true
                : false
              ? true
              : false
              : false, //流水是否补码
          customCodeSerialClass:
            row != null && row.customCodeSerialClass != ""
@@ -3310,8 +3431,8 @@
          matchClassifyValueFlag:
            row != null && row.matchClassifyValueFlag != ""
              ? row.matchClassifyValueFlag == "true"
                ? true
                : false
              ? true
              : false
              : false, //是否自动匹配值
          parentClassifySecOid:
            row != null && row.parentClassifySecOid != ""
@@ -3342,11 +3463,20 @@
        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));
      if (enumCach == null) {
        getDictionary({ code: enumKey }).then((res) => {
        getDictionary({code: enumKey}).then((res) => {
          enumCach = res.data.data;
          localStorage.setItem(enumKey, JSON.stringify(res.data.data));
        });
@@ -3375,16 +3505,17 @@
      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") || [];
@@ -3401,7 +3532,7 @@
        this.$message.warning("请选择一条编码规则!");
        return;
      }
      if(this.selectionList.length> 1){
      if (this.selectionList.length > 1) {
        this.$message.warning("只能选择一条编码规则!");
        return;
      }
@@ -3484,11 +3615,11 @@
}
.left
  > .el-form-item
  > .el-form-item__content
  > .el-input-number
  > .el-input
  > .el-input__inner {
> .el-form-item
> .el-form-item__content
> .el-input-number
> .el-input
> .el-input__inner {
  width: 120px;
}
@@ -3498,8 +3629,14 @@
}
/** 新增码段 */
.add-basicsec-dialog > .el-dialog > .el-dialog__body {
  padding: 20px 20px 4px;
  margin-bottom: 30px;
}
.add-basicsec-total {
  width: 100%;
  height: 500px;
}
.add-basicsec-total .el-input__inner,
@@ -3518,9 +3655,11 @@
.add-basicsec-form > .el-divider--vertical {
  width: 2px;
  height: 100%;
  margin: 0 auto;
  /* position: fixed; */
  height: 78%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.left {
@@ -3531,13 +3670,14 @@
.right {
  /* float: right; */
  margin-right: 2vw;
  /* margin-right: 1vw; */
  height: 100%;
  width: auto;
}
.right > .el-form > .el-form-item {
  margin-bottom: 8px;
.add-basicsec-form > .left > .el-form-item,
.add-basicsec-form > .right > div > .el-form-item {
  margin-bottom: 12px;
}
/* 对话框底部按钮边框样式 */
@@ -3554,4 +3694,5 @@
/* .code-total > .basic-container__card {
    height: 100%;
  } */
</style>