riku
2023-12-19 6aa37bb1c8caefdfdb70042cee04527aee253e59
src/views/fytz/user/components/CompBaseInfo.vue
@@ -3,6 +3,7 @@
    :form-info="_formInfo"
    :rules="rules"
    :reset="active"
    :useReset="true"
    v-model:is-edit="_edit"
    @submit="submit"
    @cancel="cancel"
@@ -44,7 +45,6 @@
</template>
<script>
import userApi from '@/api/fytz/userApi.js'
export default {
  props: {
    //基本信息
@@ -64,10 +64,6 @@
    return {
      _formInfo: null,
      _edit: false,
      locations: false,
      locationsProps: {
        checkStrictly: true
      },
      rules: {
        biNickName: [
          {
@@ -103,9 +99,7 @@
  },
  watch: {
    formInfo(nValue) {
      console.log('value', nValue)
      this._formInfo = this.parseUserInfo(nValue)
      console.log('执行了')
    },
    _edit(nValue) {
      this.$emit('update:isEdit', nValue)
@@ -115,7 +109,6 @@
  methods: {
    // 用户基本信息格式化
    parseUserInfo(s) {
      const r = {}
      s._locations = {
        pCode: s.biProvinceCode,
        pName: s.biProvinceName,
@@ -130,25 +123,11 @@
    },
    // 创建新场景
    createBaseInfo(formObj, func) {
      return userApi
        .createUser(formObj)
        .then(() => {
          this.$emit('onSubmit', formObj)
        })
        .finally(() => {
          func()
        })
    },
    // 更新场景
    updateBaseInfo(formObj, func) {
      return userApi
        .updateUserInfo(formObj)
        .then(() => {
          this.$emit('onSubmit', formObj)
        })
        .finally(() => {
          func()
        })
    },
    submit(formObj, func) {
      // 行政区划信息填充