liujq 2 years ago
parent
commit
136d9582ad

File diff suppressed because it is too large
+ 0 - 0
dist/index.html


+ 0 - 0
dist/static/css/chunk-57007450.b04e796b.css → dist/static/css/chunk-b3fa9264.b04e796b.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.b6cc6040.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.d0466208.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-57007450.c552df60.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-b3fa9264.5c57623a.js


+ 9 - 0
src/api/house.js

@@ -31,5 +31,14 @@ export default {
   admestateinfodetail: params => { //  楼盘一页纸 详情
     return getRequestNoSort('/adm/estate/info/detail', params, 'loading')
   },
+  admestategovernlist: params => { // 楼盘 案场人员 列表接口
+    return getRequest('/adm/estate/govern/list', params)
+  },
+  admestategovernadd: params => { // 楼盘 案场人员 添加
+    return getRequestNoSort('/adm/estate/govern/add', params, 'loading')
+  },
+  admestategoverndel: params => { // 楼盘 案场人员 删除
+    return getRequestNoSort('/adm/estate/govern/del', params, 'loading')
+  },
 }
 

+ 82 - 0
src/views/house/components/popup/GovernEdit.vue

@@ -0,0 +1,82 @@
+<template>
+  <div>
+    <el-dialog
+      v-loading="loading"
+      :show-close="false"
+      :close-on-click-modal="false"
+      :visible.sync="isShow"
+      :title="curObj.id ? '编辑案场人员' : '新增案场人员'"
+      :fullscreen="false"
+      width="400px"
+      custom-class="xl-dialog"
+      center
+    >
+      <base-form ref="ruleForm" :data="formData" :is-inline="false" label-width="80px">
+      </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() {
+    return {
+      loading: false,
+      formData: [],
+    }
+  },
+  watch: {
+    isShow: function(val) {
+      if (val) {
+        this.getDef()
+      }
+    },
+  },
+  methods: {
+    getDef (str) {
+      let params = { ...this.curObj }
+      this.formData = [
+        { label: '选择用户', key: 'user_id', type: 'selectRemote',
+          remoteParams: { skey: 'nickname', api: `user.admuserlist?auth_state=1`, opKey: 'nickname', opVal: '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.id = this.curObj.id
+            newForm.estate_id = this.parentData.searchForm.estate_id
+            let apiStr = 'admestategovernadd'
+            this.$api.house[apiStr](newForm).then(data => {
+              this.$msgs('新增成功')
+              this.$emit('close', newForm)
+            })
+          }
+        })
+      } else {
+        this.$emit('close')
+        this.setDefaultValue()
+      }
+    },
+  }
+}
+</script>
+<style lang="scss" scoped>
+</style>

+ 63 - 0
src/views/house/components/searchForm/Govern.vue

@@ -0,0 +1,63 @@
+<template>
+  <base-form slot="content" ref="ruleForm" :data="searchData">
+    <div slot="footer">
+      <el-button :loading="listLoading" icon="el-icon-search" class="xl-form-btn bgc1" @click="searchHandle">查询:{{name}}</el-button>
+      <el-button :loading="listLoading" icon="el-icon-plus" class="xl-form-btn bgc2" @click="addHandle">添加</el-button>
+    </div>
+  </base-form>
+</template>
+<script>
+export default {
+  props: {
+    listLoading: Boolean
+  },
+  inject: ['parentData'],
+  mixins,
+  data() {
+    return {
+      searchData: [],
+      isHidePut: false,
+    }
+  },
+  computed: {
+    name () {
+      return this.parentData.$route.query.name || ''
+    }
+  },
+  mounted () {
+    this.getDef()
+  },
+  methods: {
+    addHandle () {
+      this.parentData.isDtlShow = true
+      this.parentData.curObj = {}
+    },
+    getDef (str) {
+      let params = { ...this.$refs.ruleForm.baseForm }
+      const query = this.$route.query
+      let estateName = query.name || ''
+      params.estate_id = query.id ? Number(query.id) : ''
+      this.searchData = [
+        { label: '选择楼盘', key: 'estate_id', type: 'selectRemote', changeHandle: this.estateChange,
+          remoteParams: { skey: 'estate_name', api: `house.admestatelist`, opKey: 'estate_name', opVal: 'id' },
+          remoteOptions: [{ keyRO: estateName, valRO: params.estate_id }]
+        },
+        { label: '选择用户', key: 'user_id', type: 'selectRemote',
+          remoteParams: { skey: 'nickname', api: `user.admuserlist?auth_state=1`, opKey: 'nickname', opVal: 'id' },
+        },
+      ]
+      this.setDefaultValue(params, 'searchData')
+    },
+    estateChange (val, options, curItem) {
+      this.$router.push(`/house/govern?id=${val}&name=${curItem.estate_name}`)
+      // this.$router.go(0)
+      this.searchHandle()
+    },
+    searchHandle() {
+      const oldform = this.$refs.ruleForm.baseForm
+      const newForm = { ...oldform }
+      this.$emit('change', newForm)
+    }
+  }
+}
+</script>

+ 106 - 0
src/views/house/govern.vue

@@ -0,0 +1,106 @@
+<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"
+      @sizeChange="sizeChange"
+      :isAdd="true"
+      @add="openPopup"
+    />
+    <popup-edit
+      :isShow="isDtlShow"
+      :curObj="curObj"
+      @close="closePopup"
+    />
+  </div>
+</template>
+<script>
+import { arrToObj } from '@/utils'
+import SearchForm from './components/searchForm/Govern'
+import PopupEdit from './components/popup/GovernEdit'
+import baseTable from '_m/baseTable.js'
+export default {
+  name: 'govern',
+  components: {
+    SearchForm,
+    PopupEdit,
+  },
+  provide() {
+    return {
+      parentData: this
+    }
+  },
+  mixins: [baseTable],
+  data() {
+    return {
+      apiStr: 'house.admestategovernlist',
+      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: 'nickname'},
+        { label: '更新人', prop: 'update_by' },
+        { 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.admestategoverndel({
+          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>

+ 4 - 0
src/views/house/index.vue

@@ -85,6 +85,7 @@ export default {
             { label: '删除', func: this.delHandle, btnType: 'danger' },
             { label: '楼盘介绍', func: this.linkDesc, btnType: 'success' },
             { label: '一页纸', func: this.openHRPopup, btnType: 'success' },
+            { label: '案场人员', func: this.linkGovern, btnType: 'info' },
           ]
         }
       ]
@@ -94,6 +95,9 @@ export default {
     linkDesc (row) {
       this.$router.push(`/house/contentEdit?id=${row.id}`)
     },
+    linkGovern (row) {
+      this.$router.push(`/house/govern?id=${row.id}&name=${row.estate_name}`)
+    },
     // saveHandle (row) {
     //   this.$api.house.admestatesortedit({
     //     id: row.id,

Some files were not shown because too many files changed in this diff