ludc
2023-05-30 e9b405657b6117a8dcfcf8505cfd5d6eccd39cc8
Source/UBCS-WEB/src/views/code/code.vue
@@ -1,5 +1,5 @@
<template>
  <basic-container style="height: 350px;">
  <basic-container style="height: 100%;">
    <!-- 编码规则信息展示区域 -->
    <basic-container class="code-rule-container">
@@ -149,8 +149,8 @@
        </el-row>
      </div>
      <div slot="footer" class="dialog-footer" style="height: 50px; margin-top: -4vh;">
        <el-button @click="cloneSettingBox = false">取 消</el-button>
        <el-button type="primary" @click="saveCloneCodeRule">保 存</el-button>
        <el-button @click="cloneSettingBox = false">取 消</el-button>
      </div>
    </el-dialog>
    <!-- 编码规则,从其他规则克隆对话框 -->
@@ -190,8 +190,8 @@
        </el-row>
      </div>
      <div slot="footer" class="dialog-footer" style="height: 50px; margin-top: -4vh;">
        <el-button @click="cloneOtherCodeRuleSettingBox = false">取 消</el-button>
        <el-button type="primary" @click="saveOtherCodeBasic">保 存</el-button>
        <el-button @click="cloneOtherCodeRuleSettingBox = false">取 消</el-button>
      </div>
    </el-dialog>
@@ -259,7 +259,7 @@
            size="small"
            icon="el-icon-plus"
            :disabled="selectionList.length <= 0"
            @click="addBasicCodeSec">
            @click="openAddBasicCodeSec">
            新 增
        </el-button>
        <el-button type="danger"
@@ -645,10 +645,10 @@
        </el-form>
      </div>
      <!-- 第一层对话框的按钮和,线条 -->
      <el-divider direction="horizontal"></el-divider>
      <el-divider class="horizontal-line" direction="horizontal"></el-divider>
      <div slot="footer" class="dialog-footer">
        <el-button @click="addBasicCodeSettingBox = false" v-show="showbtn">取 消</el-button>
        <el-button type="primary" @click="saveOrEditBasicCode" v-show="showbtn">保 存</el-button>
        <el-button @click="addBasicCodeSettingBox = false" v-show="showbtn">取 消</el-button>
      </div>
      <!--  第二层对话框,属性码段,属性选择对话框 -->
@@ -664,7 +664,7 @@
              <div class="box">
                <el-scrollbar style="height: auto; border-bottom-right-radius:8px ">
                  <basic-container>
                    <div class="abox">
                    <div class="treeBox">
                      <avue-tree :data="attrClassifyTreeData" :option="treeOption" @node-click="nodeClick"/>
                    </div>
                  </basic-container>
@@ -680,7 +680,7 @@
                  :option="attrOption"
                  :table-loading="selectAttrOptionLoading"
                  ref="selectionAttrCrud"
                  @search-change="selectAttrOptionSearchChange"
                  @search-change="selectAttrSearchChange"
                  @search-reset="searchAttrReset"
                  @row-click="selectionAttrRowClick"
                  @selection-change="selectionChangeAttr">
@@ -691,10 +691,9 @@
          </el-row>
        </div>
        <div slot="footer" class="dialog-footer">
          <el-button @click="isShowSelectAttrOption = false">取 消</el-button>
          <el-button type="primary" @click="selectedListClassifyLinkAttr">确 定</el-button>
          <el-button @click="isShowSelectAttrOption = false">取 消</el-button>
        </div>
      </el-dialog>
      <!-- 第二层对话框,属性码段,公式编辑框对话框组件 -->
@@ -727,8 +726,8 @@
          @on-load="parentClassifyOnLoad">
        </avue-crud>
        <div slot="footer" class="dialog-footer">
          <el-button @click="isShowParentClassifyOption = false">取 消</el-button>
          <el-button type="primary" @click="saveSelectedParentClassify">保 存</el-button>
          <el-button @click="isShowParentClassifyOption = false">取 消</el-button>
        </div>
      </el-dialog>
@@ -753,16 +752,22 @@
          @row-click="referBtmRowClick">
        </avue-crud>
        <div slot="footer" class="dialog-footer">
          <el-button @click="isShowSelectReferBtmOption = false">取 消</el-button>
          <el-button type="primary" @click="saveSelectedreferBtm">保 存</el-button>
          <el-button @click="isShowSelectReferBtmOption = false">取 消</el-button>
        </div>
      </el-dialog>
      <!-- 第二层对话框,参照配置组件 -->
      <refer-config-dialog
        ref="referConfigDialog"
        @echoReferConfig="echoReferConfig" >
      </refer-config-dialog>
      <!-- 第二层对话框,自定义参照配置Form组件 -->
      <refer-config-form-dialog
        ref="referConfigFormDialog"
        @echoReferConfig="echoReferConfig">
      </refer-config-form-dialog>
      <!-- 第二层对话框,直接选择参照配置crud组件 -->
      <refer-config-crud-dialog
        ref="referConfigCrudDialog"
        @openReconfigInterFace="openReconfigInterFace"
        @echoReferConfig="echoReferConfig">
      </refer-config-crud-dialog>
    </el-dialog>
@@ -797,7 +802,7 @@
  import referBtmOption from "@/const/code/referBtmDialog";
  import fixedValueOption from "@/const/code/fixedValueMgrDialog";
  import {mapGetters} from "vuex";
  import func from "@/util/func";
  export default {
      data() {
        return {
@@ -1116,9 +1121,14 @@
          this.form.getValueClass = content;
        },
        /* 参照配置,子组件填完参照配置之后内容回显时调用 */
        /* 引用码段参照配置,子组件填完参照配置之后内容回显时调用 */
        echoReferConfig(content){
          this.form.referConfig = content;
          // console.log(content.referTypeName);
          this.form.referBtmId = content.referType;
          this.form.referBtmName = content.referTypeName;
          //转换成JSON字符串进行父组件回显
          let submitFormJson = JSON.stringify(content);
          this.form.referConfig = submitFormJson;
        },
        
        /** 为参照引用的业务类型选取值,第二层嵌套对话框,及其相关方法  */
@@ -1267,19 +1277,13 @@
          //这儿还需要完善
          this.selectAttrOptionLoading = true;
          listClassifyLinkAttr({"page": 1,"limit": -1,'conditionMap[codeClassifyOid]':this.currentSelectTreeData.oid}).then(res=>{
          //console.log(res.data.data);
          //造假数据
          let dataInfo =[
            {"id":"address","name":"会议室地址","oid":"058D840D-1010-A7DE-7C52-B39C03CE89C1","attrLength":"150","description":"","attributeDataTypeText":"字符串"},
            {"id":"businesslicensetype","name":"营业执照类型","oid":"BDAC6D3E-1827-35A0-F3CA-0E58A43F6A07","attrLength":"255","description":"营业执照类型","attributeDataTypeText":"字符串"},
            {"id":"certificatenumber","name":"保密证编号","oid":"E2BC8332-A721-3713-26C3-C9F6340C2C1D","attrLength":"255","description":"保密证编号","attributeDataTypeText":"字符串"},
          ]
          this.selectattrData = dataInfo;
          this.selectAttrOptionLoading = false;
            console.log(res.data.data);
            this.selectattrData = res.data.data;
            this.selectAttrOptionLoading = false;
          })
        },
        // 点击搜索后触发该事件
        selectAttrOptionSearchChange(params, done) {
        selectAttrSearchChange(params, done) {
          this.query = params;
          //console.log(params);  //这儿需要改
          this.loadlistClassifyLinkAttr(Object.assign(params,{'conditionMap[codeClassifyOid]':this.currentSelectTreeData.oid}));
@@ -1656,7 +1660,7 @@
          // this.changeSectypeFormItems(null);
        },
        // 打开新增窗口
        addBasicCodeSec(){
        openAddBasicCodeSec(){
          if(!this.tipsMessage(this.selectionList)){
            return;
          }
@@ -1702,10 +1706,10 @@
          if(this.form.oid == '' || this.form.oid == null){
            if(this.checkForm()){
              addSave(this.form).then(() => {
              this.$message({
                type: "success",
                message: "操作成功!"
              });
                this.$message({
                  type: "success",
                  message: "操作成功!"
                });
              }, error => {
                window.console.log(error);
              });
@@ -2075,6 +2079,7 @@
        },
        // 单击编码规则实现行选择
        codeRuleRowClick (row) {
          // 这儿应该可以不要,因为toggleRowSelection也会触发行选择时间
          this.selectionList = row;
          this.$refs.crud.toggleSelection();
          this.$refs.crud.setCurrentRow(row);
@@ -2365,7 +2370,6 @@
          });
        },
        /** 第一层对话框相关方法 */
        // 打开二层对话框方法
        openAttrSelectOrGetValue(condition){
@@ -2380,11 +2384,52 @@
            this.isShowSelectReferBtmOption = true;
            this.refreshReferBtmDataChange();
          }else if(condition === 'referConfig'){
            this.$refs.referConfigDialog.isShowReferConfig = true;
            //表格错行的问题所
            this.$refs.referConfigDialog.onloadAttrData();
            if(func.notEmpty(this.form.referConfig) || func.notEmpty(this.form.referBtmName)){
              this.openReconfigInterFace(this.form);
            }else{
              this.openTipsChooseOrCust();
            }
             //this.$refs.referConfigFormDialog.onloadAttrData();
          }
        },
        // 当前已存在编辑过的参展配置,所以直接打开参照配置界面
        openReconfigInterFace(preReferConfigForm){
          // console.log(preReferConfigForm);
          this.$refs.referConfigFormDialog.isShowReferConfigForm = true;
              let value = {
                referTypeName: preReferConfigForm.referBtmName,
                referType: preReferConfigForm.referBtmId,
                referConfig: preReferConfigForm.referConfig,
              }
              this.$refs.referConfigFormDialog.initPageData(value);
        },
        // 打开自定义参照配置或直接选择参照配置的提示框
        openTipsChooseOrCust(){
          this.$confirm('请选择参照配置的定义方式?','参照配置的方式', {
            distinguishCancelAndClose: true,
            closeOnClickModal: false,
            confirmButtonText: '自定义参照配置',
            cancelButtonText: '直接选择参照配置'
          })
          .then(() => {
            // 打开自定参照配置对话框
            this.$refs.referConfigFormDialog.isShowReferConfigForm = true;
            // 表格错行的问题
            this.$refs.referConfigFormDialog.onloadAttrData();
          })
          .catch(action => {
            if (action === "cancel") {
              // 打开直接选择参照配置对话框
              this.$refs.referConfigCrudDialog.isShowReferConfigCrud = true;
              this.$refs.referConfigCrudDialog.referConfigOnload();
            }
            //console.log(action);
          });
          // 让参照配置输入框失去焦点,否则该提示框无法被关闭
          this.$refs.referConfig.$el.querySelector('input').blur();
        },
        // 点击输入框的×号,清空输入框中的内容
        clearAttrDataByIcon(condition){
          if(condition === 'attr'){
@@ -2398,8 +2443,10 @@
            this.form.parentClassifySecOid = '';
          }else if(condition === 'referBtmId'){
            this.form.referBtmId = '';
            this.form.referBtmName = '';
            this.form.referConfig = '';
          }else if(condition === 'referConfig'){
            this.form.referBtmId = '';
            this.form.referConfig = '';
          }
        },
        // 补位时的字符,实现可输可选
@@ -2466,7 +2513,7 @@
              serialStart: row!=null&&row.serialStart != '' ? row.serialStart:1,  //流水号起始值
              serialStep: row!=null&&row.serialStep != '' ? row.serialStep:1,   //流水的步长
              codeFillType: row!=null&&row.codeFillType != '' ? row.codeFillType:'code_fill_right', //编码补位方式
              codeFillSeparatorSelect: row!=null&&row.codeFillSeparatorSelect != '' ? row.codeFillSeparatorSelect:0,    //补位时的字符,选中的下拉框的下标
              codeFillSeparatorSelect: row!=null&&row.codeFillSeparator != '' ? row.codeFillSeparatorSelect:0,    //补位时的字符,选中的下拉框的下标
              codeFillSeparator: row!=null&&row.codeFillSeparator != '' ? row.codeFillSeparator:0,          //补位时的字符
              codeFillLength: row!=null&&row.codeFillLength != '' ? row.codeFillLength:'',              //填充长度
              codeFillLimit: row!=null&&row.codeFillLimit != '' ? row.codeFillLimit:'',               //流水上限
@@ -2525,7 +2572,7 @@
        },
        //枚举和可输可选内容查询
        loadCodeSecType(){
          getDictionary({code: "codeBasicSecType"}).then(res=>{
          getDictionary({code: "codeSecType"}).then(res=>{
            this.sectypeList = res.data.data;
          })
          this.loadCodeSecLength();
@@ -2566,7 +2613,7 @@
</script>
<style scope>
<style>
  .code-rule-crud > .avue-crud__search ,.code-basic-crud > .avue-crud__search {
    margin-bottom: -15px;
@@ -2612,14 +2659,14 @@
    padding: 1px 6px;
  }
  .el-divider--horizontal {
  .horizontal-line {
    /* margin-top: 19px !important; */
    margin-bottom: -20px !important;
    width: 100%;
    height: 2px;
  }
  .el-card__body > .abox {
  .el-card__body > .treeBox {
    height: 50vh;
  }
@@ -2631,11 +2678,11 @@
    width:60px;
  }
  .el-input-number {
  .left > .el-form-item > .el-form-item__content > .el-input-number {
    width: 120px;
  }
  .el-input-number >.el-input > .el-input__inner {
  .left > .el-form-item > .el-form-item__content > .el-input-number > .el-input > .el-input__inner {
    width:120px;
  } 
  
@@ -2662,16 +2709,16 @@
    justify-content: space-around;
  }
  .el-divider--vertical {
  .add-basicsec-form > .el-divider--vertical {
    width: 2px;
    height: 72%;
    height: 100%;
    margin: 0 auto;
    position: fixed;
    /* position: fixed; */
  }
 .left {
    /* float: left; */
    width: 49%;
    width: 45%;
    height: 100%;
 }
@@ -2690,6 +2737,6 @@
    /* width: 100%; */
    border-top: 1px solid #E9E7E7;
    padding: 5px 10px 10px;
  }
 }
</style>