添加


 onSubmitAdd(values, that) {
        if (that.changeField.changed !== true) {
            that.$msgBox.error("无数据变更.");
        } else {
            let dataT = that.changeField;
            let rootMetaT = methodComp.options.rootMeta;
            let filterT = methodComp.options.filter;
            //需要处理的代码 start
            dataT["policyId"] = null;
            //dataT.isEnabled = {
            //    name: "启用",
            //    value: 1
            //};
            //dataT.auditStatus = {
            //    name: "待审核",
            //    value: 0
            //};
            //数据保存加密
            if (that.data.bdBbrIdcard) {
                dataT.bdBbrIdcard = that.$crypto.encryptByDES(that.data.bdBbrIdcard);
            }
            if (that.data.bdTbrIdcard) {
                dataT.bdTbrIdcard = that.$crypto.encryptByDES(that.data.bdTbrIdcard);
            }
            dataT.bdExpand = JSON.stringify(that.data.bdExpand || {});
            if (dataT.checklist) {
                dataT.checklist.forEach(element => {
                    element.description = JSON.stringify(element.description || {});

                });
            }

            //需要处理的代码 end
            that.$store.dispatch("dataLoading", true);
            let thisC = this;
            that.$bsAjax
                .doAdd(rootMetaT.mkey, rootMetaT.field + "_detail", filterT, dataT)
                .then((tempRes) => {
                    that.$store.dispatch("dataLoading", false);
                    if (tempRes && tempRes.data && tempRes.data.success === true) {
                        that.$msgBox.success(tempRes.data.message);
                        that.$refs["refCompSave"].resetChangeField();
                        //结果数据处理  清空数据
                        that.data = JSON.parse(JSON.stringify(methodComp.dataTemp));
                    }
                    //通知子组件数据变更
                    that.value.primaryChangeState = that.$verifyGuid.guid();
                    //清空数据避免错误
                    that.changeField = {};
                    that.changeField = JSON.parse(JSON.stringify(that.changeField));
                });
        }
    },
文档更新时间: 2022-09-04 18:41   作者:admin