ludc
2023-06-15 e14d495581896374cc4be7ec929feb95005e6563
Source/UBCS-WEB/src/views/code/code.vue
@@ -300,6 +300,7 @@
            size="small"
            icon="el-icon-search"
            plain
            :disabled="selectionList.length <= 0"
            @click="openAdvancedQuery('codeBasicSec')">
            高级查询
        </el-button>
@@ -527,7 +528,7 @@
                </el-select>
              </el-form-item>
              <el-form-item label="补位时的字符:" :label-width="rightFormLabelWidth">
                <el-select v-model="form.codeFillSeparatorSelect" @blur="inputSelectBlur" filterable placeholder="请选择" :disabled="basicSecOnlyRead">
                <el-select v-model="form.codeFillSeparator" @blur="inputSelectBlur" filterable placeholder="请选择" :disabled="basicSecOnlyRead">
                  <el-option
                    v-for="item in enumParam.codeFillSeparator"
                    :key="item.itemValue"
@@ -664,7 +665,7 @@
                </el-select>
              </el-form-item>
              <el-form-item label="补位时的字符:" :label-width="rightFormLabelWidth">
                <el-select v-model="form.codeFillSeparatorSelect" filterable @blur="inputSelectBlur" placeholder="请选择" :disabled="basicSecOnlyRead">
                <el-select v-model="form.codeFillSeparator" filterable @blur="inputSelectBlur" placeholder="请选择" :disabled="basicSecOnlyRead">
                  <el-option
                    v-for="item in enumParam.codeFillSeparator"
                    :key="item.itemValue"
@@ -1104,7 +1105,6 @@
            //console.log(conditionMaps);
          }
        },
        /* 公式编辑框内容改变,子组件编辑完公式之后内容回显时调用 */
        updateFormulaContent(content){
          this.form.getValueClass = content;
@@ -1177,7 +1177,8 @@
          let parentClsParam = this.parentClsfyParams;
          parentClsParam.classifyDialogLoading = true;
          let oid = this.selectionList.length==0 ? this.form.pkCodeRule:this.selectionList[0].oid;
          let conditionMaps = this.paramsToConditionMa({"pkCodeRule":oid});
          let conditionMaps = {};
          conditionMaps['conditionMap[pkCodeRule]'] = oid;
          refDataGridClassifySec(
            page.currentPage, 
            page.pageSize, 
@@ -1667,7 +1668,8 @@
              // 关闭对话框
              this.addBasicCodeSettingBox = false
            }
            // 点击新增基础码段,关闭窗口之后触发重新加载
            this.loadBasic(this.selectionList[0]);
          }else{
            editSave(this.form).then(() => {
               // 关闭对话框
@@ -1679,9 +1681,8 @@
              }, error => {
                window.console.log(error);
            });
            this.loadBasic(this.selectionList[0]);
          }
          // 点击新增基础码段,关闭窗口之后触发重新加载
          this.loadBasic(this.selectionList[0]);
        },
        // 因为elementui的表单校验设置不上所以采用判断的方式来做表单检验方式
        checkForm(){
@@ -1755,7 +1756,7 @@
              this.$message.warning('(编码补位方式)'+tipsMsg);
              return false;
            }
            if(form.codeFillType != '不补位' && form.codeFillSeparatorSelect == ''){
            if(form.codeFillType != '不补位' && form.codeFillSeparator == ''){
              this.$message.warning('当补位方式为左补位或者右补位的时候,补位字符不能为空');
              return false;
            }
@@ -1779,11 +1780,10 @@
              this.$refs.codeFillLimit.$el.querySelector('input').focus();
              return false;
            }
            if(form.codeFillFlag == ''){
              this.$message.warning('(流水是否补码)'+tipsMsg);
              this.$refs.switch.$el.querySelector('input').focus();
              return false;
            }
            // if(form.codeFillFlag == '' || ){
            //   this.$message.warning('(流水是否补码)'+tipsMsg);
            //   return false;
            // }
          }else if(this.form.secType==='codelevelsec'){
            //层级码段
            if(form.codeLevelType == ''){
@@ -1851,7 +1851,8 @@
              this.$message.warning('(编码补位方式)'+tipsMsg);
              return false;
            }
            if(form.codeFillType != '不补位' && form.codeFillSeparatorSelect == ''){
            // console.log(form);
            if(form.codeFillType != 'code_fill_none' && form.codeFillSeparator == ''){
              this.$message.warning('当补位方式为左补位或者右补位的时候,补位字符不能为空');
              return false;
            }
@@ -1899,9 +1900,11 @@
          }
          // console.log(row.oid);
          //存储当前关联的编码规则相关信息
          this.currentCodeRuleOid = row.oid;
          this.currentRuleLcStatus = row.lcStatus;
          this.sendGridCodeBasicSec({"pkCodeRule":row.oid},false);
          if(row!='' || row!=null){
            this.currentCodeRuleOid = row.oid;
            this.currentRuleLcStatus = row.lcStatus;
            this.sendGridCodeBasicSec({"pkCodeRule":row.oid},false);
          }
        },
        // 发送加载基础码段的请求
        sendGridCodeBasicSec(condition,isAdancedQuery/** 是否高级查询 */){
@@ -1912,11 +1915,11 @@
          let conditionMaps = {};
          if(condition && !isAdancedQuery){
            Object.keys(condition).forEach(key=>{
              conditionMaps['conditionMap[pl_code_basicsec.'+key+']'] = condition[key].trim();
              conditionMaps['conditionMap['+key+']'] = condition[key].trim();
            });
          }
          if(isAdancedQuery){
            condition['conditionMap[pl_code_basicsec.pkCodeRule]'] = this.currentCodeRuleOid == null || this.currentCodeRuleOid == ''
            condition['conditionMap[pkCodeRule]'] = this.currentCodeRuleOid == null || this.currentCodeRuleOid == ''
            ? this.selectionList[0].oid:this.currentCodeRuleOid;
          }
          gridCodeBasicSec(1, -1,isAdancedQuery ? condition:conditionMaps).then(res => {
@@ -2001,7 +2004,7 @@
        },
        // 基础码段刷新时查询
        refreshChangeBasicSec(){
          this.loadBasic({"oid":this.currentCodeRuleOid == null || this.currentCodeRuleOid == '' ? this.selectionList[0].oid:this.currentCodeRuleOid});
          this.loadBasic(this.selectionList.at(-1));
        },
        // 操作基础码段中搜索清空等按钮的显示/隐藏
        hideBasicTable(hideBoolean){
@@ -2009,18 +2012,16 @@
          this.$refs.crudBasic.option.columnBtn = hideBoolean;
          this.$refs.crudBasic.option.column[0].search = hideBoolean;
          this.$refs.crudBasic.option.column[1].search = hideBoolean;
          if(!hideBoolean){
            this.selectionList = [];
            this.basicData = [];
          }
        },
        /** 编码规则相关方法 */
        // 打开高级查询窗口
        openAdvancedQuery(condition){
          // MasterTable({
          //   codeClassifyOid: "D9CF223F-317D-71EB-BD11-433A94CAD9F3",
          //   functionId: 5,
          // }).then(res=>{
          //   console.log(res.data.tableDefineVO.seniorQueryColumns);
          // })
          if(condition=='codeRule'){
            this.advancedQueryParam.options = [
              {
@@ -2065,22 +2066,22 @@
                data: [],
                title: '码段编号',
                fieldType: 'text',
                queryField: 'pl_code_basicsec.id',
                queryField: 'id',
              },{
                data: [],
                title: '码段名称',
                fieldType: 'text',
                queryField: 'pl_code_basicsec.name',
                queryField: 'name',
              },{
                data: [],
                title: '描述',
                fieldType: 'text',
                queryField: 'pl_code_basicsec.description',
                queryField: 'description',
              },{
                data: [],
                title: '码段类型',
                fieldType: 'combox',
                queryField: 'pl_code_basicsec.secType',
                queryField: 'secType',
                comboxKey: 'codeSecType',
              }
            ]
@@ -2112,17 +2113,6 @@
        // 刷新使用范围列表
        refreshUseRangeChange(){
          this.getRangeCodeList();
        },
        // 单击编码规则实现行选择
        codeRuleRowClick (row) {
          // 这儿应该可以不要,因为toggleRowSelection也会触发行选择时间
          this.selectionList = row;
          this.$refs.crud.toggleSelection();
          this.$refs.crud.setCurrentRow(row);
          this.$refs.crud.toggleRowSelection(row); //选中当前行
          if(row!=''){
            this.loadBasic(row);
          }
        },
        // 启用与停用
        enableOrDeactivatse(oId,update){
@@ -2220,7 +2210,7 @@
          this.selectionOtherCloneCodeBasicList = list;
          this.$refs.crudCloneCodeBasicOther.setCurrentRow(this.selectionOtherCloneCodeBasicList[list.length-1]);
        },
         // 从其他编码规则中克隆码段信息
        // 从其他编码规则中克隆码段信息
        saveOtherCodeBasic(){
          let oid = this.selectionList[0].oid;
          let fromDialogPkCodebasic = this.selectionOtherCloneCodeBasicList;
@@ -2238,7 +2228,7 @@
          //console.log(res);
          let oidArr = [];
          fromDialogPkCodebasic.forEach(ele => {
            oidArr.push(ele.id);
            oidArr.push(ele.oid);
          });
          let data = {
            "pkCodeRule": oid,
@@ -2360,7 +2350,7 @@
          let requestData = {};
          if(params){
            Object.keys(params).forEach(key=>{
              requestData["conditionMap"+'['+key+']'] = params[key].trim();
              requestData["conditionMap"+'['+key+'_like]'] = params[key].trim();
            });
          }
          this.query = requestData;
@@ -2370,17 +2360,23 @@
        // 编码规则当前选中行变化的时候触发
        selectionChange(list) {
          this.selectionList = list;
          this.$refs.crud.setCurrentRow(this.selectionList[list.length-1]);
          //当前选中行为空的时候就将码段管理表格数据置空,并禁用相关功能
          if(list == ''){
            this.basicData = [];
          if(this.selectionList.length <= 0){
            this.hideBasicTable(false);
          }
          if(this.selectionList.length > 0){
          if (this.selectionList.length > 0) {
            this.$refs.crud.setCurrentRow(this.selectionList[list.length-1]);
            this.currentCodeRuleOid = this.selectionList[list.length-1].oid;
            this.currentRuleLcStatus = this.selectionList[list.length-1].lcStatus;
            this.loadBasic(this.selectionList[list.length-1]);
          }
        },
        // 单击编码规则实现行选择
        codeRuleRowClick (row) {
          // console.log(this.currentRuleLcStatus);
          this.$refs.crud.toggleSelection();
          this.$refs.crud.toggleRowSelection(row); //选中当前行
        },
        selectionClear() {
          this.selectionList = [];
@@ -2410,8 +2406,6 @@
            // 查询的值为空时,要将码段管理相关的内容禁用
            if(data.records.length <= 0) {
              this.hideBasicTable(false);
              this.selectionList = [];
              this.basicData = [];
              return;
            }
            this.loadBasic(this.data[0])
@@ -2507,7 +2501,7 @@
        // 补位时的字符,实现可输可选
        inputSelectBlur(e){
          if (e.target.value) {  
            this.form.codeFillSeparatorSelect = e.target.value;
            this.form.codeFillSeparator = e.target.value;
          }
        },
        // 码段类型改变时,增加对应的form表单中的属性
@@ -2568,8 +2562,8 @@
              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_left', //编码补位方式
              codeFillSeparatorSelect: row!=null&&row.codeFillSeparator != '' ? row.codeFillSeparatorSelect:0,    //补位时的字符,选中的下拉框的下标
              codeFillSeparator: row!=null&&row.codeFillSeparator != '' ? row.codeFillSeparator:0,          //补位时的字符
              // codeFillSeparatorSelect: row!=null&&row.codeFillSeparatorSelect != '' ? 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:'',               //流水上限
              codeFillFlag: row!=null&&row.codeFillFlag != '' ? row.codeFillFlag=='true' ?  true:false :false,      //流水是否补码
@@ -2617,8 +2611,8 @@
            this.form = Object.assign({}, this.form,{
              codeSecLength: row!=null&&row.codeSecLength != '' ? row.codeSecLength:'',             //码段的长度
              codeFillType: row!=null&&row.codeFillType != '' ? row.codeFillType:'code_fill_left', //编码部位方式,枚举查询
              codeFillSeparatorSelect: row!=null&&row.codeFillSeparatorSelect != '' ? row.codeFillSeparatorSelect:0,  //选中的补位时的字符的下标
              codeFillSeparator: row!=null&&row.codeFillSeparator != '' ? row.codeFillSeparator:'', //补位时的字符,可输可选查询
              // codeFillSeparatorSelect: row!=null&&row.codeFillSeparatorSelect != '' ? row.codeFillSeparatorSelect:0,  //选中的补位时的字符的下标
              codeFillSeparator: row!=null&&row.codeFillSeparator != '' ? row.codeFillSeparator:'0', //补位时的字符,可输可选查询
            });
            this.loadCodeFillType();
            this.loadCodeFillSeparator();