liujq 3 年之前
父节点
当前提交
5acaa4ddee
共有 4 个文件被更改,包括 300 次插入1 次删除
  1. 12 0
      src/api/house.js
  2. 178 0
      src/views/house/components/popup/SaleEdit.vue
  3. 110 0
      src/views/house/sale.vue
  4. 0 1
      src/views/user/appSale.vue

+ 12 - 0
src/api/house.js

@@ -49,6 +49,18 @@ export default {
   admestatenewsdel: params => { // 楼盘动态删除接口
     return getRequestNoSort('/adm/estate/news/del', params, 'loading')
   },
+  admestatesalelist: params => { // 置业顾问 -  列表接口
+    return getRequest('/adm/estate/sale/list', params)
+  },
+  admestatesaleadd: params => { // 置业顾问 -  添加接口
+    return getRequestNoSort('/adm/estate/sale/add', params, 'loading')
+  },
+  admestatesaleedit: params => { // 置业顾问 -  编辑接口
+    return getRequestNoSort('/adm/estate/sale/edit', params, 'loading')
+  },
+  admestatesaledel: params => { // 置业顾问 -  删除接口
+    return getRequestNoSort('/adm/estate/sale/del', params, 'loading')
+  },
   admoldhouselist: params => { // 二手房列表接口
     return getRequest('/adm/oldhouse/list', params)
   },

+ 178 - 0
src/views/house/components/popup/SaleEdit.vue

@@ -0,0 +1,178 @@
+<template>
+  <div>
+    <el-dialog
+      v-loading="loading"
+      :show-close="false"
+      :close-on-click-modal="false"
+      :visible.sync="isShow"
+      :title="curObj.id ? '编辑楼盘动态' : '新增楼盘动态'"
+      :fullscreen="false"
+      width="700px"
+      custom-class="xl-dialog"
+      center
+    >
+      <base-form ref="ruleForm" class="lib-edit" :data="formData" :is-inline="false" label-width="110px">
+        <div slot="otherItem">
+          <div class="scoped-img-area">
+            <div class="sia-op" v-for="(imgsrc,index) in imagesArr" :key="index">
+              <img class="img" :src="imgsrc + '_adm0'" alt="img">
+              <span class="close" @click="imgDel(index)"></span>
+            </div>
+            <el-upload
+              class="sia-img"
+              :action="`${domainUrl}/adm/upload/cloud`"
+              :data="{logic_type: 'estate', token}"
+              name="upload"
+              :show-file-list="false"
+              :on-success="roomAreaUploadSuccess"
+              :before-upload="roomAreaUploadBefore"
+              >
+              <i class="el-icon-plus icon"/>
+            </el-upload>
+          </div>
+        </div>
+      </base-form>
+      <div class="xl-form">
+        <div class="xl-form-footer">
+          <el-button class="xl-form-btn t2" @click="close">关 闭</el-button>
+          <el-button class="xl-form-btn t1" @click="close('confirm')">确定</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import { arrToObj } from '@/utils'
+export default {
+  components: { },
+  mixins,
+  props: {
+    isShow: Boolean,
+    curObj: Object
+  },
+  inject: ['parentData'],
+  data() {
+    const token = window.sessionStorage.getItem('fp_token')
+    let domainUrl = process.env.VUE_APP_BASE_API
+    return {
+      domainUrl,
+      token,
+      loading: false,
+      formData: [],
+      cObj: {},
+      imagesArr: [],
+    }
+  },
+  watch: {
+    isShow: function(val) {
+      if (val) {
+        this.getDef()
+      }
+    },
+  },
+  methods: {
+    getDef (str) {
+      let params = {}
+      params = { ...this.curObj }
+      this.formData = [
+        { label: '销售列表', key: 'sale_id', type: 'selectRemote',
+          remoteParams: { skey: 'sale_name', api: `user.admsaleuserlist`, opKey: 'sale_name', opVal: 'id' },
+          remoteOptions: [{ keyRO: item.sale_name, valRO: item.sale_id }]
+        },
+      ]
+      this.setDefaultValue(params)
+    },
+    close (str) {
+      if (str === 'confirm') {
+        this.$refs['ruleForm'].$refs['baseForm'].validate((valid) => {
+          if (valid) {
+            const oldform = this.$refs.ruleForm.baseForm
+            const newForm = { ...oldform }
+            if (this.curObj.id) newForm.sale_id = this.curObj.id
+            newForm.estate_id = this.parentData.searchForm.estate_id
+            let apiStr = 'admestatesaleadd'
+            if (this.curObj.id) apiStr = 'admestatesaleedit'
+            this.$api.house[apiStr](newForm).then(data => {
+              this.$msgs(newForm.estate_id ? '编辑成功' : '新增成功')
+              this.productData = []
+              this.$emit('close', newForm)
+            })
+          }
+        })
+      } else {
+        this.$emit('close')
+        this.productData = []
+        this.setDefaultValue()
+      }
+    },
+  }
+}
+</script>
+<style lang="scss" scoped>
+@import '../../../../styles/libEdit.scss';
+.lib-edit {
+  padding-top: 0;
+  ::v-deep .el-date-editor.el-input {
+    width: 100%;
+  }
+  ::v-deep .el-textarea__inner {
+    height: 300px;
+  }
+}
+
+.scoped-img-area {
+  padding-left: 40px;
+  .sia-op {
+    display: inline-block;
+    vertical-align: middle;
+    margin-right: 10px;
+    margin-bottom: 10px;
+    border: 1px solid #f2f2f2;
+    width: 80px;
+    height: 80px;
+    position: relative;
+    &:hover {
+      .img-big {
+        display: block;
+      }
+    }
+    .img {
+      width: 80px;
+      height: 80px;
+    }
+    .close {
+      position: absolute;
+      width: 20px;
+      height: 20px;
+      top: -10px;
+      right: -10px;
+      background: url(../../../../assets/icon_g_close.png) no-repeat;
+      background-size: 20px;
+      cursor: pointer;
+    }
+    .img-big {
+      position: absolute;
+      bottom: 0;
+      left: 0;
+      width: 400px;
+      height: auto;
+      display: none;
+      box-shadow: 10px 10px 10px #ccc;
+      z-index: 99;
+    }
+  }
+  .sia-img {
+    display: inline-block;
+    vertical-align: middle;
+    width: 80px;
+    height: 80px;
+    overflow: hidden;
+    border: 1px dashed #999;
+    margin-bottom: 10px;
+    .el-icon-plus {
+      color: #999;
+      padding: 30px;
+    }
+  }
+}
+</style>

+ 110 - 0
src/views/house/sale.vue

@@ -0,0 +1,110 @@
+<template>
+  <div class="app-container">
+    <!-- <search-form
+      :list-loading="listLoading"
+      @change="searchHandle"
+    /> -->
+    <table-list
+      :list-loading="listLoading"
+      :data="tableData2"
+      :columns="listConfig"
+      :current-page="currentPage"
+      :page-size="pageSize"
+      :total-records="totalRecords"
+      @currentChange="pageHandle"
+      :isAdd="true"
+      @add="openPopup"
+    />
+    <popup-edit
+      :isShow="isDtlShow"
+      :curObj="curObj"
+      @close="closePopup"
+    />
+  </div>
+</template>
+<script>
+import { arrToObj } from '@/utils'
+import SearchForm from './components/searchForm/News'
+import PopupEdit from './components/popup/SaleEdit'
+import baseTable from '_m/baseTable.js'
+export default {
+  name: 'HouseNews',
+  components: {
+    SearchForm,
+    PopupEdit,
+  },
+  provide() {
+    return {
+      parentData: this
+    }
+  },
+  mixins: [baseTable],
+  data() {
+    return {
+      apiStr: 'house.admestatesalelist',
+      searchForm: {},
+      isDtlShow: false,
+      // noCreated: true,
+      curObj: {},
+    }
+  },
+  computed: {
+    tableData2() {
+      const arr = [...this.tableData]
+      arr.map(item => {})
+      return arr
+    }
+  },
+  created() {
+    const query = this.$route.query
+    this.searchForm.estate_id = query.id || ''
+  },
+  mounted() {
+    this.listConfig = {
+      rows: [
+        { label: '分类', prop: 'sale_type', type: 'flag', flags: arrToObj(this.$dictData.sale_type	) },
+        { label: '置业经理', prop: 'sale_name' },
+        { label: '头像', prop: 'sale_avatar', type: 'img' },
+        { label: '联系电话', prop: 'sale_phone' },
+        { label: '销售标签', prop: 'custom_tag'},
+        { label: '微信昵称', prop: 'nickname'},
+        { label: '微信头像', prop: 'avatar', type: 'img' },
+        { label: '微信电话', prop: 'phone' },
+        { label: '更新时间', prop: 'update_at' },
+        { label: '操作', width: 120, type: 'handle2', operations:
+          [
+            { label: '编辑', func: this.openPopup, btnType: 'primary' },
+            { label: '删除', func: this.delHandle, btnType: 'danger' },
+          ]
+        }
+      ]
+    }
+  },
+  methods: {
+    delHandle(row) {
+      this.$msg(`您确定要删除该置业顾问吗?`, 'confirm', () => {
+        this.$api.house.admestatesaledel({
+          id: row.id,
+        }).then(data => {
+          this.$msgs(`已删除!`)
+          this.fetchData()
+        })
+      }, null, true)
+    },
+    openPopup(row) {
+      if (row && row.id) {
+        this.curObj = row
+      } else {
+        this.curObj = {}
+      }
+      this.isDtlShow = true
+    },
+    closePopup(obj) {
+      this.isDtlShow = false
+      if (obj) {
+        this.fetchData()
+      }
+    }
+  }
+}
+</script>

+ 0 - 1
src/views/user/appSale.vue

@@ -63,7 +63,6 @@ export default {
         { label: '联系电话', prop: 'sale_phone' },
         { label: '销售标签', prop: 'custom_tag'},
         { label: '微信昵称', prop: 'nickname'},
-        { label: '微信昵称', prop: 'nickname'},
         { label: '微信头像', prop: 'avatar', type: 'img' },
         { label: '微信电话', prop: 'phone' },
         { label: '更新时间', prop: 'update_at' },