ludc
2023-10-27 a647b8fb3c96791c126dcf26c78676adc35c670f
修改编码规则管理基础码段编辑bug,修改ts日期转换报错bug
已修改4个文件
104 ■■■■■ 文件已修改
Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/util/func.js 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/code/code.vue 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/views/code/codeApply.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue
@@ -167,6 +167,7 @@
import {validatenull} from "@/util/validate";
import fileInHtml from "@/components/file/inHtml.vue";
import {getUserInfo} from "@/api/system/user";
import func from "@/util/func";
export default {
  components: {
@@ -328,7 +329,7 @@
        oids.push(ele.oid);
      });
      return oids;
    }
    },
  },
  created() {
    // const index = this.$route.query.id.indexOf('@name=') + '@name='.length;
@@ -881,8 +882,11 @@
    },
    //增加保存
    AddSumbit(val) {
      console.log(val)
      val.ts = val.ts.toISOString().replace("Z", "");
      //console.log(val)
      if(func.notEmpty(val.ts)) {
        val.ts = func.formattedDateTime(val.ts);
        //console.log(val.ts);
      }
      addSaveCode(val).then(res => {
        this.$nextTick(() => {
          this.addvisible = false;
Source/UBCS-WEB/src/util/func.js
@@ -74,6 +74,23 @@
  }
  /**
   * ts日期格式处理
   * @param {要处理的日期} thisDate
   * @returns
   */
  static formattedDateTime(thisDate) {
    const date = new Date(thisDate);
    const year = date.getFullYear();
    const month = (date.getMonth() + 1).toString().padStart(2, '0');
    const day = date.getDate().toString().padStart(2, '0');
    const hours = date.getHours().toString().padStart(2, '0');
    const minutes = date.getMinutes().toString().padStart(2, '0');
    const seconds = date.getSeconds().toString().padStart(2, '0');
    const milliseconds = date.getMilliseconds().toString().padStart(3, '0');
    return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}.${milliseconds}`;
  }
  /**
   * 根据逗号联合
   * @param arr
   * @returns {string}
Source/UBCS-WEB/src/views/code/code.vue
@@ -1186,9 +1186,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>
@@ -1601,7 +1599,7 @@
        basicMoveupBtn: this.vaildData(this.permission.code_rule.code_basic_moveup, false),
        basicDownBtn: this.vaildData(this.permission.code_rule.code_basic_down, false),
      }
    }
    },
  },
  watch: {},
  mounted() {
@@ -2696,16 +2694,16 @@
                type: "success",
                message: "操作成功!",
              });
              // 关闭对话框
              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 (
@@ -2725,14 +2723,14 @@
              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;
    },
@@ -3171,34 +3169,19 @@
      ) {
        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, //所属编码规则
      };
      if (this.form.secType === "codefixedsec") {
        //固定码段
        this.form = Object.assign({}, this.form, {
@@ -3351,6 +3334,15 @@
        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));
Source/UBCS-WEB/src/views/code/codeApply.vue
@@ -53,7 +53,7 @@
<script>
import {getAuthTree,getUsedTemplateByClassifyOid,getCodeRule,addSaveCode} from '@/api/code/codeApply.js'
import func from '@/util/func';
export default {
  name: "codeApply",
  components: { FormTemplate: () => import('@/components/FormTemplate/FormTemplate') },
@@ -217,7 +217,10 @@
      resForm.codeRuleOid = this.codeRuleOid;
      resForm.templateOid = this.templateOid;
      // this.$emit("submit", resForm);
      resForm.ts = resForm.ts.toISOString().replace("Z", "");
      if(func.notEmpty(resForm.ts)) {
        resForm.ts = func.formattedDateTime(resForm.ts);
        // resForm.ts = resForm.ts.toISOString().replace("Z", "");
      }
      addSaveCode(resForm).then(res => {
        this.$nextTick(() => {
          this.addvisible = false;