ludc
2023-07-11 728546f4621e893019dea545f14b6e617301b15b
Source/UBCS-WEB/src/views/code/code.vue
@@ -1394,6 +1394,11 @@
            });
          }else {
            this.codeClassifyForm.oid = this.selectedFixedOrCodeclassifyValue.attributes.oid;
            // 分类码段,子分类和父分类之间不能相互更改
            if(this.checkClassUpdate(this.codefixedsecOrCodeclassifysecOid,this.codeClassifyForm.codeClassifySecOid)){
              return;
            }
            this.$delete(this.codeClassifyForm,"parentClassifyValueOid");
            editCodeClassifyValue(this.codeClassifyForm).then(() => {
                this.loadClassifyValueData({"oid":this.codefixedsecOrCodeclassifysecOid})
                this.$message({
@@ -1430,6 +1435,9 @@
              });
            });
          }else{
            if(this.checkClassUpdate(this.codefixedsecOrCodeclassifysecOid,this.codeClassifyForm.codeClassifySecOid)){
              return;
            }
            //分类码段码值删除
            this.$confirm("是否删除这条数据?如果被引用将不能被删除!", {
              confirmButtonText: "确定",
@@ -1450,7 +1458,6 @@
              });
            });
          }
        },
        //对固定码值表进行:上移、下移、移除操作
        codeFixedValueOpetion(condition,row){
@@ -1490,10 +1497,13 @@
        },
        //对分类码值表进行:上移、下移、移除操作
        codeClassifyValueOpetion(condition){
          if(this.checkClassUpdate(this.codefixedsecOrCodeclassifysecOid,this.codeClassifyForm.codeClassifySecOid)){
            return;
          }
          //此处涉及到深浅拷贝问题,但是执行上下移保存操作之后会重新加载treedata,所以影响不大
          let currentTreeList = this.getCodeClassifyValueTreeData();
          let saveData = [];
          console.log(currentTreeList.treeList);
          // console.log(currentTreeList.treeList);
          if(condition == 'up'){
            if(currentTreeList.index-1>=0){
              // 调整顺序
@@ -1513,8 +1523,6 @@
              this.saveCodeFixedOrClassifyValueOption('classifyValue',saveData);
            }
          }
          console.log(saveData);
          console.log(this.classifyValueTreeData);
        },
        //选中被调整顺序的两个树的节点
        getCodeClassifyValueTreeData(){
@@ -1553,7 +1561,7 @@
          }
        },
        //上移下移等操作的保存
        saveCodeFixedOrClassifyValueOption(condition,editOrderNumdata){
        async saveCodeFixedOrClassifyValueOption(condition,editOrderNumdata){
          //保存对固定码段码值的上移下移移出等操作
          if(condition == "fixedValue"){
            let data = {
@@ -1572,7 +1580,7 @@
            });
          }else {
            //保存对分类码值码段码值的上移下移移出等操作
            saveCodeClassifyValueOrder({
            await saveCodeClassifyValueOrder({
              "codeClassifySecOid": this.codefixedsecOrCodeclassifysecOid,
              "dtoList": JSON.stringify(editOrderNumdata),
            }).then(() => {
@@ -1611,7 +1619,21 @@
          this.codeClassifyForm.id = node.attributes.id;
          this.codeClassifyForm.name = node.attributes.name;
          this.codeClassifyForm.parentClassifyValueOid = node.attributes.oid;
          //console.log(this.codeClassifyForm);
          // console.log(this.codeClassifyForm);
        },
        /**
         * 分类码段码值,修改、删除、上下移之前,检查是否为子分类和父分类之间相互更改
         * @currentRowClassOid 当前选中行oid
         * @updateClassOid 要修改的分类码值oid
         */
         checkClassUpdate(currentRowClassOid,updateClassOid){
          if(currentRowClassOid!=updateClassOid){
            this.$message({
              type: "error",
              message: "操作失败【子分类与父分类之间不能相互修改码值】!"
            });
          }
          return currentRowClassOid!=updateClassOid;
        },
@@ -1708,6 +1730,7 @@
          let form = this.form;
          //console.log(form);
          const regNumber = /^[0-9]+\.{0,1}[0-9]*$/; //数字或小数正则校验
          const regPos =  /^[0-9]*[1-9][0-9]*$/; //非负整数正则校验
          const tipsMsg = "必填项不能为空";
          if(form.id == ''){
            this.$message.warning("(码段编号)"+tipsMsg);
@@ -1728,7 +1751,7 @@
            //固定码段
            if(form.codeSecLengthType == ''){
              this.$message.warning("(码段长度类型)"+tipsMsg);
              this.$refs.codeSecLengthType.$el.querySelector('select').focus();
              // this.$refs.codeSecLengthType.$el.querySelector('select').focus();
              return false;
            }
            if(form.codeSecLength == ''){
@@ -1809,14 +1832,19 @@
              this.$message.warning('(层级类型)'+tipsMsg);
              return false;
            }
            if(!regNumber.test(form.codeLevelValue)){
              this.$message.warning('层级的值)只能填写数字');
            if(form.codeLevelType != 'code_level_min'&& !regNumber.test(form.codeLevelValue)){
              this.$message.warning('(层级的值)只能填写数字');
              this.$refs.codeLevelValue.$el.querySelector('input').focus();
              return false;
            }
            if(form.valueCutType == ''){
              this.$message.warning('(字符截取类型)'+tipsMsg);
              this.$refs.valueCutType.$el.querySelector('select').focus();
              // this.$refs.valueCutType.$el.querySelector('select').focus();
              return false;
            }
            if(form.valueCutType != 'code_cut_none' && !regPos.test(form.valueCutLength)){
              this.$message.warning('(值截取长度)只能填写正整数');
              this.$refs.valueCutLength.$el.querySelector('input').focus();
              return false;
            }
          }else if(this.form.secType==='coderefersec'){
@@ -1976,7 +2004,7 @@
          this.sendGridCodeBasicSec({"pkCodeRule":this.selectionList[this.selectionList.length-1].oid},false);
        },
        // 上移下移基础码段
        upOrderNum(row){
        async upOrderNum(row){
          if(!this.tipsMessage(this.selectionList)){
            return;
          }
@@ -1988,7 +2016,7 @@
            this.$message.warning("未获取到必填参数!");
            return;
          }
          upOrderNum(row.oid).then(() => {
          await upOrderNum(row.oid).then(() => {
            this.loadBasic(this.selectionList[0]);
            this.$message({
              type: "success",