zmc
2023-12-21 635e1b3c0d48c2db884794cb8bc26d6ff1591ffa
src/views/fytz/user/components/CompBaseInfo.vue
@@ -95,20 +95,20 @@
          }
        ]
      }
    }
    };
  },
  watch: {
    formInfo(nValue) {
      this._formInfo = this.parseUserInfo(nValue)
      this._formInfo = this.parseBaseInfo(nValue);
    },
    _edit(nValue) {
      this.$emit('update:isEdit', nValue)
      this.$emit('update:isEdit', nValue);
    }
  },
  mounted() {},
  methods: {
    // 用户基本信息格式化
    parseUserInfo(s) {
    parseBaseInfo(s) {
      s._locations = {
        pCode: s.biProvinceCode,
        pName: s.biProvinceName,
@@ -118,50 +118,46 @@
        dName: s.biDistrictName,
        tCode: s.biTownCode,
        tName: s.biTownName
      }
      return s
      };
      return s;
    },
    // 创建新场景
    createBaseInfo(formObj, func) {
    },
    createBaseInfo(formObj, func) {},
    // 更新场景
    updateBaseInfo(formObj, func) {
    },
    updateBaseInfo(formObj, func) {},
    submit(formObj, func) {
      // 行政区划信息填充
      const a = formObj.value._locations
      const a = formObj.value._locations;
      if ('pCode' in a) {
        formObj.value.biProvinceCode = a.pCode
        formObj.value.biProvinceCode = a.pCode;
      }
      if ('pName' in a) {
        formObj.value.biProvinceName = a.pName
        formObj.value.biProvinceName = a.pName;
      }
      if ('cCode' in a) {
        formObj.value.biCityCode = a.cCode
        formObj.value.biCityCode = a.cCode;
      }
      if ('cName' in a) {
        formObj.value.biCityName = a.cName
        formObj.value.biCityName = a.cName;
      }
      if ('dCode' in a) {
        formObj.value.biDistrictCode = a.dCode
        formObj.value.biDistrictCode = a.dCode;
      }
      if ('dName' in a) {
        formObj.value.biDistrictName = a.dName
        formObj.value.biDistrictName = a.dName;
      }
      if ('tCode' in a) {
        formObj.value.biTownCode = a.tCode
        formObj.value.biTownCode = a.tCode;
      }
      if ('tName' in a) {
        formObj.value.biTownName = a.tName
        formObj.value.biTownName = a.tName;
      }
      return this.create ? this.createBaseInfo(formObj, func) : this.updateBaseInfo(formObj, func)
      return this.create ? this.createBaseInfo(formObj, func) : this.updateBaseInfo(formObj, func);
    },
    cancel() {
      this.$emit('onCancel')
      this.$emit('onCancel');
    }
  }
}
};
</script>