wangting
2023-08-28 c98617764afe0ee4e64ebb7b3af6845aeaeeea12
Source/UBCS-WEB/src/components/code-dialog-page/maxSerialnumDialog.vue
@@ -1,5 +1,5 @@
<template>
    <el-dialog title="最大流水号" width="30%" append-to-body="true" :visible.sync="dialogVisible">
    <el-dialog title="最大流水号" width="30%" append-to-body="true" class="avue-dialog avue-dialog--top" top="-3%" :visible.sync="dialogVisible">
        <el-form :label-position="right" ref="ruleForm" label-width="80px" :model="formModel" :rules="rules">
            <el-form-item label="流水号" prop="maxSecNum">
                <el-input v-model="formModel.maxSecNum"></el-input>
@@ -72,13 +72,13 @@
                ],
            },
            selfColumnType: {
                codefixedsec: "combox",
                codeclassifysec: "refer",
                codevariablesec: "text",
                codeattrsec: "text",
                codelevelsec: "text",
                coderefersec: "refer",
                codedatesec: "date",
              codefixedsec: "combox",//固定码段
              codeclassifysec: "refer",//分类码段
              codevariablesec: "text",//可变码段
              coderefersec: "refer",//引用码段
              codeattrsec: "text",
              codelevelsec: "text",
              codedatesec: "date"
            },
            selfColumnConfig: {
                function: {
@@ -129,13 +129,11 @@
                    typeList.includes(item.secType)
                );
                if (this.secVOList.length > 0) {
                    // this.showCodeApply = true;
                    this.$nextTick(() => {
                        this.$refs.CodeApply.templateRender(this.secVOList);
                    });
                } else {
                    // this.showCodeApply = false;
                  this.$refs.CodeApply.loading = false;
                }
            }
        },
@@ -152,16 +150,15 @@
            this.formModel['codeRuleOid'] = ''
            this.formModel['maxSecNum'] = ''
            this.$refs.ruleForm.clearValidate('maxSecNum')
        },
        // 确认
        async comfirm() {
            console.log(this.codeApplyForm)
            const objcodekey = Object.keys(this.codeApplyForm)
            console.log(objcodekey)
            const filteredObj = objcodekey.reduce((acc, key) => {
                const pattern = /[\u4e00-\u9fa5]/; // 匹配中文字符的正则表达式
                if (!pattern.test(key)) {
                const patterns = /\$/;
                if (!pattern.test(key)&&!patterns.test(key)) {
                    acc[key] = this.codeApplyForm[key];
                }
                return acc;
@@ -175,18 +172,18 @@
            })
            this.formModel['secDTOList'] = arrCode
            this.formModel['codeRuleOid'] = this.ruleOid
            console.log(this.formModel)
            this.confirmLoadding = true
            const rule = await this.$refs.CodeApply.validate()
            this.$refs.ruleForm.validate(res => {
                if (rule && res) {
                    console.log(rule)
                    saveMaxSerialNum(this.formModel).then(res => {
                        if (res.data.success) {
                            this.$message.success('操作成功!');
                            this.confirmLoadding = false
                            this.cancel()
                        }
                    }).catch(error=>{
                      this.confirmLoadding = false
                    })
                } else {
                    this.confirmLoadding = false
@@ -196,7 +193,6 @@
        },
        // 参照组件数据变更
        referConfigDataUpdate(data) {
            // console.log(data)
            const { field } = data;
            this.secVOList = this.secVOList.map((item) => {
                if (item.parentClassifySecOid === field) {
@@ -225,11 +221,11 @@
            }
        },
        getReferConfig(item) {
            // console.log(item)
            let params = {};
            if (item.secType == "codeclassifysec") {
                params = {
                    isMuti: false,
                    valueField: 'id',
                    type: "grid",
                    tableConfig: {
                        limit: -1,
@@ -303,4 +299,4 @@
        },
    }
}
</script>
</script>