wangting
2023-08-28 c98617764afe0ee4e64ebb7b3af6845aeaeeea12
Source/UBCS-WEB/src/views/code/code.vue
@@ -106,6 +106,13 @@
                @click="escapeOwner">
                转移所有者
            </el-button>
            <el-button
                size="small"
                icon="el-icon-guide"
                plain
                @click="maxSerialNum">
                最大流水号
            </el-button>
          </template>
        </avue-crud>
      </basic-container>
@@ -123,11 +130,13 @@
        append-to-body
        :visible.sync="codeRangeSettingBox"
        width="800px"
        style="height: 116vh; margin-top: -10vh;">
        class="avue-dialog avue-dialog--top"
        style="height: 100vh;" top="-3%">
        <avue-crud
          :option="dialogeOption"
          :table-loading="dialogLoading"
          :data="useRangeData"
          style="margin-top:-40px"
          @refresh-change="refreshUseRangeChange">
        </avue-crud>
      </el-dialog>
@@ -137,8 +146,9 @@
        append-to-body
        :visible.sync="cloneSettingBox"
        width="800px"
        style="height: 120vh; margin-top: -14vh; overflow: hidden;">
        <div style="overflow-y: auto; height: 78vh">
        class="avue-dialog avue-dialog--top"
        style="height: 100vh;" top="-3%">
        <div>
          <el-row>
            <el-form ref="form" :model="form" label-width="80px" :inline="true">
              <el-form-item label="编号" required>
@@ -153,7 +163,7 @@
            </el-form>
          </el-row>
          <el-row>
            <p style="margin: -3vh 0px 16px 50%; font-weight: 500; font-size: 16px; color: #000;">码段管理</p>
            <p style="margin: 0 0px 16px 50%; font-weight: 500; font-size: 20px; color: #000;">码段管理</p>
            <avue-crud
              class="clone-avue-crud"
              :option="cloneOption"
@@ -180,7 +190,7 @@
            </avue-crud>
          </el-row>
        </div>
        <div slot="footer" class="dialog-footer" style="height: 50px; margin-top: -4vh;">
        <div slot="footer" class="dialog-footer">
          <el-button type="primary" @click="saveCloneCodeRule">保 存</el-button>
          <el-button @click="cloneSettingBox = false">取 消</el-button>
        </div>
@@ -189,13 +199,14 @@
      <!-- 编码规则,从其他规则克隆对话框 -->
      <el-dialog title="克隆编码规则的基础信息"
        append-to-body
        class="avue-dialog avue-dialog--top"
        :visible.sync="cloneOtherCodeRuleSettingBox"
        width="800px"
        style="height: 150vh; margin-top: -14vh;"
        style="height: 100vh;" top="-3%"
        destroy-on-close>
        <div>
          <el-row>
            <p style="margin-top: -12px; margin-bottom: 4px; font-weight: 570; font-size: 19px; color: #0e2d5f;">编码规则</p>
            <p style="margin-top: -20px; margin-bottom: 4px; font-weight: 570; font-size: 19px; color: #0e2d5f;">编码规则</p>
            <avue-crud
              class="other-clone-coderule-crud"
              :option="cloneCodeRuleOption"
@@ -209,8 +220,8 @@
              @on-load="onLoad">
            </avue-crud>
          </el-row>
          <el-row>
            <p style="margin-top: -12px; margin-bottom: 4px; font-weight: 570; font-size: 19px; color: #0e2d5f;">码段信息</p>
          <el-row style="margin-top:10px;border-top: 1px solid #EBEEF5;">
            <p style="margin-top: 10px; margin-bottom: 4px; font-weight: 570; font-size: 19px; color: #0e2d5f;">码段信息</p>
            <avue-crud
              class="other-clone-codebasic-crud"
              :option="cloneBasicOption"
@@ -222,7 +233,7 @@
            </avue-crud>
          </el-row>
        </div>
        <div slot="footer" class="dialog-footer" style="height: 50px; margin-top: -4vh;">
        <div slot="footer" class="dialog-footer" style="height: 50px;">
          <el-button type="primary" @click="saveOtherCodeBasic">保 存</el-button>
          <el-button @click="cloneOtherCodeRuleSettingBox = false">取 消</el-button>
        </div>
@@ -248,6 +259,9 @@
            <el-button type="primary" @click="escapeOwnerConfirm">确 定</el-button>
          </span>
      </el-dialog>
      <!-- 最大流水号对话框 -->
      <max-serialnum-dialog :visible.sync="maxSerial.visible" :ruleOid="maxSerial.ruleOid"></max-serialnum-dialog>
      <!-- 基础码段展示区域 -->
      <basic-container class="code-basicsec-container">
@@ -342,7 +356,8 @@
        :visible.sync="isShowBasicSecCodeValueMgr"
        :width="isShowFixedForm ? '69vw':'50vw'"
        append-to-body
        style="height: 116vh; margin-top: -10vh;"
        class="avue-dialog avue-dialog--top"
        style="height: 100vh;" top="-3%"
        @close="clearFixedOrClassifyForm('close')"
        destroy-on-close>
        <!-- 分类码段码值管理 -->
@@ -356,7 +371,7 @@
                        :data="classifyValueTreeData"
                        :option="classisyValueTreeOption"
                        @node-click="classisyValueTreeOnodeClick"
                        style="overflow-y: auto; height: 54vh"/>
                        style=""/>
                    </div>
                  </basic-container>
              </div>
@@ -391,7 +406,7 @@
        <el-row v-show="isShowFixedForm">
          <el-col :span="15">
            <basic-container>
              <div class="box fixedbox" style="height:65vh; margin-bottom:-40px">
              <div class="box fixedbox" style="height:63vh; margin-bottom:-40px">
                <avue-crud
                  class="fixed-avue-crud"
                  ref="crudFixedValue"
@@ -407,15 +422,15 @@
                  </template>
                </avue-crud>
              </div>
              <div style="margin-top:20px;">
              <div style="margin-top:10px;">
                <el-button size="mini" type="primary" icon="el-icon-success" class="button" @click="saveCodeFixedOrClassifyValueOption('fixedValue')">保存</el-button>
              </div>
            </basic-container>
          </el-col>
          <el-col :span="9">
            <basic-container>
              <div class="box" style="height: 65vh; margin-bottom:-40px; overflow:hidden;" >
                <div style="overflow-y:auto;height: 60vh;">
              <div class="box" style="height: 63vh; margin-bottom:-40px; overflow:hidden;" >
                <div style="overflow-y:auto;height: 58vh;">
                  <el-form>
                    <el-form-item label="码值:" label-width="54px" required>
                      <el-input style="width: 19.5vw" v-model="codeFixdForm.id"></el-input>
@@ -426,7 +441,7 @@
                  </el-form>
                </div>
              </div>
              <div style="margin-top:20px; display: flex; align-items:center; justify-content:center;">
              <div style="margin-top:10px; display: flex; align-items:center; justify-content:center;">
                <el-button :disabled="selectedFixedOrCodeclassifyValue!=''" size="mini" type="primary" icon="el-icon-circle-plus" class="button" @click="addCodeSecValue('codefixedsec')">添加</el-button>
                <el-button :disabled="selectedFixedOrCodeclassifyValue==''" size="mini" type="success" plain icon="el-icon-edit-outline" class="button" @click="editCodeSecValue('codefixedsec')">修改</el-button>
                <el-button :disabled="selectedFixedOrCodeclassifyValue==''" size="mini" type="danger" icon="el-icon-close" class="button" @click="delCodeSecValue('codefixedsec')">删除</el-button>
@@ -440,16 +455,17 @@
      <!-- 基础码段新增相关对话框 -->
      <el-dialog :title="basicSecDialogTitle"
        :visible.sync="addBasicCodeSettingBox"
        width="60vw"
        width="900px"
        append-to-body
        style="height: 115vh; margin-top: -13vh; overflow: hidden"
        class="avue-dialog avue-dialog--top"
        style="height: 100vh;" top="-3%"
        destroy-on-close
        lock-scroll
        :close-on-click-modal="false"
        @close="clearBasicAddForm">
        <!--  第一层对话框,添加码段信息对话框中的内容 -->
        <div class="add-basicsec-total" style="overflow-y: auto; height: 70vh">
        <div class="add-basicsec-total" style="overflow-y: auto; height: 58vh">
          <el-form :model="form" class="add-basicsec-form">
            <span class="left">
              <el-form-item label="码段编号:" :label-width="leftFormLabelWidth" required>
@@ -476,7 +492,7 @@
              </el-form-item>
              <el-form-item label="是否流水依赖:" :label-width="leftFormLabelWidth">
                <el-switch v-model="form.serialDependFlag" :disabled="basicSecOnlyRead"></el-switch>
                <el-switch v-model="form.serialDependFlag" :disabled="basicSecOnlyRead" style="margin-right: 20px"></el-switch>
                <el-input-number v-show="form.serialDependFlag" v-model="form.serialDependOrder" controls-position="right" :readonly="basicSecOnlyRead"></el-input-number>
              </el-form-item>
@@ -721,7 +737,8 @@
          append-to-body
          :visible.sync="isShowSelectAttrOption"
          width="78%"
          style="height: 100%; margin-top: -8vh; overflow: hidden">
          class="avue-dialog avue-dialog--top" top="-3%"
          style="height: 100%;">
          <div style="overflow-y: auto; height: 60vh">
            <el-row>
              <!-- 左侧主题库分类树 -->
@@ -875,6 +892,12 @@
          ruleOwner: '', // 当前要转移给哪个规则管理员的ID
          releadDisabled: false, // 避免规则发布重复提交
          /*最大流水号*/
          maxSerial:{
            visible:false,
          },
          /*使用范围对话框显示控制*/
          codeRangeSettingBox: false,
          useRangeData: [],
@@ -882,13 +905,15 @@
          /*使用范围对话框配置*/
          dialogeOption: {
            height: 'auto',
            calcHeight: 30,
            calcHeight: 150,
            tip: false,
            searchShow: false,
            searchMenuSpan: 6,
            border: true,
            index: true,
            disablePage:false,
            refreshBtn:false,
            columnBtn:false,
            viewBtn: false,
            addBtn: false,
            menu: false,
@@ -1811,28 +1836,33 @@
        },
        /** 发布编码规则 */
        async enableOrDeactivatse(oid,update){
          // 避免用户重复点击按钮
          this.releadDisabled = true;
          await checkLikeCodeRule(oid).then(res => {
            if(res.data.success){
              this.updateStatus(oid,update);
            }else{
              this.$confirm('test', '提示', {
                distinguishCancelAndClose: true,
                confirmButtonText: '继续发布',
                cancelButtonText: '取消'
              }).then(() => {
                //this.updateStatus();
              })
              .catch(action => {
                this.$message({
                  type: 'info',
                  message: '取消发布!',
          if(update==="release"){
            // 避免用户重复点击按钮
            this.releadDisabled = true;
            await checkLikeCodeRule(oid).then(res => {
              //console.log(res)
              if(res.data.success){
                this.updateStatus(oid,update);
              }else{
                this.$confirm(res.data.msg, '提示', {
                  distinguishCancelAndClose: true,
                  confirmButtonText: '继续发布',
                  cancelButtonText: '取消'
                }).then(() => {
                  this.updateStatus(oid,update);
                })
              });
            }
          })
          this.releadDisabled = false;
                .catch(action => {
                  this.$message({
                    type: 'info',
                    message: '取消发布!',
                  })
                });
              }
            })
            this.releadDisabled = false;
          }else {
            this.updateStatus(oid,update);
          }
        },
        /** 打开编码规则克隆对话框*/
        openCodeRuleDialog() {
@@ -1882,7 +1912,7 @@
            return;
          }
          if(this.selectionList[0].lcStatus != 'Editing'){
            this.$message.warning("编码规则已被引用,不允许编辑或删除!");
            this.$message.warning("编码规则已被引用,不允许编辑!");
            return;
          }
          this.cloneOtherCodeRuleSettingBox = true;
@@ -1933,7 +1963,6 @@
            this.$message.warning("需要克隆的编码规则与被克隆的编码规则相同!");
            return;
          }
          //console.log(res);
          let oidArr = [];
          fromDialogPkCodebasic.forEach(ele => {
            oidArr.push(ele.oid);
@@ -2400,7 +2429,7 @@
        /** 判断数据是否选择以及只能选择单条数据*/
        tipsMessage(list){
          if(list.length != 1){
            this.$message.warning("请选择一条编码规则数据!");
            this.$message.warning("请选择一条数据!");
            return false;
          }
          return true;
@@ -2464,7 +2493,6 @@
            const data = res.data.data;
            if(this.cloneSettingBox){
              this.cloneData = data.records;
              // console.log(tihs.cloneData);
              this.cloneTableLoading = false;
            }else {
              this.basicData = data.records;
@@ -2477,7 +2505,6 @@
        selectionBasicChange(list) {
          this.selectionBasicList = list;
          this.$refs.crudBasic.setCurrentRow(this.selectionBasicList[list.length-1]);
          //console.log(this.selectionBasicList);
        },
        /** 基础码段被单击表格行时触发*/
        codeBasicSecRowClick(row){
@@ -2487,7 +2514,6 @@
          this.$refs.crudBasic.toggleRowSelection(row); //选中当前行
        },
        basicSearchChange(params, done){
          //console.log(this.$refs.crudBasic);
          this.sendGridCodeBasicSec(Object.assign(params,{"pkCodeRule":this.selectionList[this.selectionList.length-1].oid}),false);
          done();
        },
@@ -2521,7 +2547,6 @@
            return;
          }
          let codeRuleOid = this.selectionList[0].oid;
          //console.log(this.selectionList);
          if (this.selectionList[0].lcStatus != 'Editing') {
            this.$message.warning("只有编码规则的状态是 [编辑中] 的时候,才能调整码段顺序!");
            return;
@@ -2753,14 +2778,18 @@
        },
        /** 枚举和可输可选内容查询 */
        loadCodeSecType(){
          this.enumParam.secTypeList = this.getLocalStorageEnum("codeSecType") | [];
          let enumList = this.getLocalStorageEnum("codeSecType");
          this.enumParam.secTypeList = enumList.length>0 ? enumList:[];
          console.log(this.enumParam.secTypeList);
          this.loadCodeSecLength();
        },
        loadCodeSecLength(){
          this.enumParam.codeSecLengthType = this.getLocalStorageEnum("codeSecLength") | [];
          let enumList = this.getLocalStorageEnum("codeSecLength");
          this.enumParam.codeSecLengthType = enumList.length>0 ? enumList:[];
        },
        loadCodeFillType(){
          this.enumParam.codeFillType = this.getLocalStorageEnum("codeFillType") | [];
          let enumList = this.getLocalStorageEnum("codeFillType");
          this.enumParam.codeFillType = enumList.length>0 ? enumList:[];
        },
        loadCodeFillSeparator(){
          let enumCach = JSON.parse(localStorage.getItem("codeFillSeparator"));
@@ -2772,14 +2801,27 @@
          }
        },
        loadCodeLevelType(){
          this.enumParam.codeLevelType = this.getLocalStorageEnum("codeLevelType") | [];
          let enumList = this.getLocalStorageEnum("codeLevelType");
          this.enumParam.codeLevelType = enumList.length>0 ? enumList:[];
        },
        loadCodeCutType(){
          this.enumParam.codeCutType = this.getLocalStorageEnum("codeCutType") | [];
          let enumList = this.getLocalStorageEnum("codeCutType");
          this.enumParam.codeCutType = enumList.length>0 ? enumList:[];
        },
        loadCodeGetValueType(){
          this.enumParam.codeGetValueType =  this.getLocalStorageEnum("codeGetValueType") | [];
          let enumList = this.getLocalStorageEnum("codeGetValueType");
          this.enumParam.codeGetValueType =  enumList.length>0 ? enumList:[];
        },
        // 最大流水号
        maxSerialNum(){
          console.log(this.selectionList)
          if (this.selectionList.length === 0) {
            this.$message.warning("请选择一条编码规则!");
            return;
          }
          this.maxSerial.visible = true
          this.maxSerial.ruleOid = this.selectionList[0]['oid']
        }
      }
  };
@@ -2792,10 +2834,6 @@
}
  .code-rule-crud > .avue-crud__search ,.code-basic-crud > .avue-crud__search {
    margin-bottom: -15px;
  }
  .code-rule-crud > .avue-crud__pagination {
    padding: 14px 0 2px 20px;
  }
  .clone-input-textarea > .el-form-item__content {
@@ -2869,7 +2907,6 @@
  /** 新增码段 */
  .add-basicsec-total {
    width: 100%;
    padding: 20px 0 0 0;
  }
  .add-basicsec-total .el-input__inner,.add-basicsec-total .el-textarea__inner {