quanwei
3 days ago 04102f7237efefa744090ed7c25f7b5d0807b679
branch_vue/src/views/branch/branch/drawer/add.vue
@@ -25,9 +25,17 @@
              :key='index2'></el-option>
          </el-select>
        </el-form-item>
        <!-- <el-form-item label="分会简介" prop="branch.description">
          <el-input type="textarea" v-model="form.branch.description" class="max-w460"></el-input>
        </el-form-item> -->
        <el-form-item label="LOGO">
          <el-row>
            <el-button icon="el-icon-picture-outline" @click="openUpload('logo')">选择图片</el-button>
            <div v-if="form.branch.logo_id!=''" class="mt10">
              <img :src="logo_file_path" width="100" height="100" />
            </div>
          </el-row>
        </el-form-item>
        <el-form-item label="分会简介" prop="branch.description">
          <el-input type="textarea" v-model="form.branch.description" class="max-w460" :autosize="{ minRows: 3, maxRows: 8}"></el-input>
        </el-form-item>
        <div class="common-form">账号信息</div>
        <el-form-item label="绑定会长">
          <el-row>
@@ -58,6 +66,8 @@
    </el-drawer>
    <!--管理用户-->
    <GetUser :is_open="open_user" @close="closeDialogFunc($event, 'add')"></GetUser>
    <!--上传图片组件-->
    <Upload v-if="isupload" :isupload="isupload" :type="type" @returnImgs="returnImgsFunc">上传图片</Upload>
  </div>
</template>
@@ -65,10 +75,12 @@
  import BranchApi from '@/api/branch.js';
  import GetUser from '@/components/user/GetUser.vue';
  import DataApi from '@/api/data.js';
  import Upload from '@/components/file/Upload';
  export default {
    components: {
      /*选择用户*/
      GetUser,
      Upload
    },
    data() {
      return {
@@ -84,6 +96,7 @@
            city_id: '',
            region_id: '',
            description: '',
            logo_id: '',
          },
        },
        /*是否打开添加弹窗*/
@@ -94,6 +107,9 @@
        user_info: {},
        /*省市区*/
        areaList: [],
        logo_file_path: '',
        isupload: false,
        type:'logo',
      };
    },
    props: ['open'],
@@ -199,6 +215,23 @@
      //   this.open_branch = false;
      // },
      /*上传*/
      openUpload(e) {
        this.type = e;
        this.isupload = true;
      },
      /*获取图片*/
      returnImgsFunc(e) {
        if (e != null && e.length > 0) {
          if(this.type == 'logo'){
            this.logo_file_path = e[0].file_path;
            this.form.branch.logo_id = e[0].file_id;
          }
        }
        this.isupload = false;
      },
    }
  };