liujq 2 years ago
parent
commit
d6cce48abb

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


File diff suppressed because it is too large
+ 0 - 0
dist/static/css/chunk-8b735f92.6d4ba348.css


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


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-8b735f92.e67155f0.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-ee0b8224.315296e4.js


+ 12 - 66
src/views/cust/index.vue

@@ -14,53 +14,20 @@
       @currentChange="pageHandle"
       @sizeChange="sizeChange"
       :operationsDefaultLength="6"
-      :insertSlotArr="[7]"
+      :isAdd="true"
+      @add="openPopup"
     >
-      <div slot="OI7">
-        <el-table-column
-          width="140"
-          label="保护期止"
-          align="center"
-        >
-          <template slot-scope="scope">
-            <template v-if="scope.row.report_state === '1' && scope.row.report_step === '1'">
-              <div v-if="+new Date() > +new Date(scope.row.lock_at)">
-                <div style="color: #f00">{{scope.row.lock_at}}</div>
-                <el-tag type="danger" size="mini">已过期</el-tag>
-              </div>
-              <div v-else-if="(+new Date(scope.row.lock_at) - +new Date()) < 86400000">
-                <div style="color: #e6a23c">{{scope.row.lock_at}}</div>
-                <el-tag type="warning" size="mini">1天内过期</el-tag>
-              </div>
-              <div v-else>
-                <div>{{scope.row.lock_at}}</div>
-              </div>
-            </template>
-            <template v-else>
-              <div>{{scope.row.lock_at}}</div>
-            </template>
-          </template>
-        </el-table-column>
-      </div>
     </table-list>
-    <!-- :isAdd="true"
-      @add="openPopup" -->
     <popup-edit
       :isShow="isDtlShow"
       :curObj="curObj"
       @close="closePopup"
     />
-    <index-record
-      :isShow="isQShow"
-      :curObj="curObj"
-      @close="closeQPopup"
-    />
   </div>
 </template>
 <script>
 import { arrToObj } from '@/utils'
-import SearchForm from './components/searchForm/Index'
-import IndexRecord from './components/popup/IndexRecord'
+import SearchForm from './components/searchForm/My'
 import PopupEdit from './components/popup/IndexEdit'
 import baseTable from '_m/baseTable.js'
 export default {
@@ -68,7 +35,6 @@ export default {
   components: {
     SearchForm,
     PopupEdit,
-    IndexRecord,
   },
   provide() {
     return {
@@ -78,7 +44,7 @@ export default {
   mixins: [baseTable],
   data() {
     return {
-      apiStr: 'cust.admreportlist',
+      apiStr: 'cust.admcustomerlist',
       searchForm: null,
       isDtlShow: false,
       curObj: {},
@@ -89,9 +55,7 @@ export default {
   computed: {
     tableData2() {
       const arr = [...this.tableData]
-      arr.map(item => {
-        item.newRecord = `${item.record_estate_name ? item.record_estate_name : '-'}${item.record_protect_at && item.record_protect_at !== '1970-01-01' ? '(' + item.record_protect_at + ')' : ''}-${item.record_remark ? item.record_remark : ''}`
-      })
+      arr.map(item => {})
       return arr
     }
   },
@@ -101,41 +65,23 @@ export default {
       rows: [
         { label: '姓名', prop: 'name' },
         { label: '电话', prop: 'phone' },
-        { label: '客户状态', prop: 'report_state', type: 'tag', tags: arrToObj(this.$dictData.report_state	), tagTypeObj: {'1': 'success', '2': 'warning', '3': 'danger'}},
-        { label: '报备进度', prop: 'report_step', type: 'tag', tags: arrToObj(this.$dictData.report_step	), tagTypeObj: {'1': 'info', '2': 'success', '3': 'success'} },
-        { label: '报备楼盘', prop: 'estate_name'},
-        { label: '报备时间', prop: 'create_at' },
         { label: '性别', prop: 'sex', type: 'tag', tags: arrToObj(this.$dictData.sex), tagTypeObj: {'male': 'primary', 'female': 'danger'} },
-        { label: '备注', prop: 'remark', fullShow: true },
-        { label: '报备人', prop: 'create_by' },
-        { label: '操作', width: 90, type: 'handle2', operations:
+        { label: '备注', prop: 'demand', fullShow: true, minWidth: 200, align: 'left' },
+        { label: '创建人', prop: 'create_by' },
+        { label: '创建时间', prop: 'create_at' },
+        { label: '操作', width: 120, type: 'handle2', operations:
           [
-            { label: '报备详情', func: this.openQPopup, btnType: 'primary' },
-            // { label: '修改状态', func: this.openPopup, btnType: 'warning' },
-            // { label: '删除', func: this.delHandle, btnType: 'danger' },
+            { label: '编辑', func: this.openPopup, btnType: 'primary' },
+            { label: '删除', func: this.delHandle, btnType: 'danger' },
           ]
         }
       ]
     }
   },
   methods: {
-    openQPopup (row) {
-      if (row && row.id) {
-        this.curObj = row
-      } else {
-        this.curObj = {}
-      }
-      this.isQShow = true
-    },
-    closeQPopup (obj) {
-      this.isQShow = false
-      if (obj) {
-        this.fetchData()
-      }
-    },
     delHandle(row) {
       this.$msg(`您确定要删除该客户吗?`, 'confirm', () => {
-        this.$api.user.admcustomerdel({
+        this.$api.cust.admcustomerdel({
           id: row.id
         }).then(data => {
           this.$msgs(`已删除!`)

+ 95 - 0
src/views/report/components/popup/IndexEdit.vue

@@ -0,0 +1,95 @@
+<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="footer" style="padding-top: 20px;">
+          <el-button class="xl-form-btn t2" @click="close">关 闭</el-button>
+          <el-button class="xl-form-btn t1" @click="close('confirm')">确定</el-button>
+        </div>
+      </base-form>
+    </el-dialog>
+  </div>
+</template>
+<script>
+export default {
+  components: { },
+  mixins,
+  props: {
+    isShow: Boolean,
+    curObj: Object
+  },
+  inject: ['parentData'],
+  data() {
+    return {
+      formData: [],
+      loading: true,
+      cObj: {},
+      curEstateList: [],
+    }
+  },
+  watch: {
+    isShow: function(val) {
+      if (val) {
+        this.getDef()
+      }
+    },
+  },
+  methods: {
+    getDef() {
+      let params = {...this.curObj}
+      this.formData = [
+        { label: '姓名', key: 'name', class: 'c-2', rules: 1 },
+        { label: '电话', key: 'phone', class: 'c-2', rules: 1 },
+        { label: '性别', key: 'sex', rules: 1, type: 'select', options: this.$dictData.sex },
+        { label: '备注', label2: '备注', key: 'demand', type: 'textarea' },
+      ]
+      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
+            }
+            let apiStr = 'admcustomeradd'
+            if (newForm.id) apiStr = 'admcustomeredit'
+            newForm.phone_type = 1
+            this.$api.cust[apiStr](newForm).then(data => {
+              this.$msgs(newForm.id ? '编辑成功' : '新增成功')
+              this.$emit('close', newForm)
+            })
+          }
+        })
+      } else {
+        this.$emit('close')
+        this.setDefaultValue()
+      }
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+@import '../../../../styles/libEdit.scss';
+.lib-edit {
+  padding-top: 0;
+  ::v-deep .el-form-item {
+    margin-bottom: 10px;
+  }
+  ::v-deep .el-date-editor.el-input {
+    width: 100%;
+  }
+}
+</style>

+ 216 - 0
src/views/report/components/popup/IndexRecord.vue

@@ -0,0 +1,216 @@
+<template>
+  <div>
+    <el-dialog
+      :show-close="false"
+      :close-on-click-modal="false"
+      :visible.sync="isShow"
+      :title="`${curObj.name}的报备详情`"
+      :fullscreen="false"
+      width="800px"
+      custom-class="xl-dialog"
+      center
+    >
+      <div class="scoped-info">
+        <div class="si-row">
+          <div class="si-col">昵称:{{dtlObj.name}}</div>
+          <div class="si-col">手机号:{{dtlObj.phone}}</div>
+          <div class="si-col">性别:{{sexObj[dtlObj.sex]}}</div>
+        </div>
+        <div class="si-row">
+          <div class="si-col">客户状态:{{reportStateStr}}</div>
+          <div class="si-col">报备进度:{{reportStepStr}}</div>
+        </div>
+        <div class="si-row">
+          <div class="si-col">报备日期:{{dtlObj.create_at}}</div>
+          <div class="si-col">保护期止:{{dtlObj.lock_at}}</div>
+          <div class="si-col">报备楼盘:{{dtlObj.estate_name}}</div>
+        </div>
+      </div>
+      <div class="scoped-table">
+        <table-list
+          :list-loading="listLoading"
+          :data="reportFlow"
+          :columns="listConfig"
+          :current-page="currentPage"
+          :page-size="-1"
+          >
+        </table-list>
+      </div>
+      <div class="xl-form" style="padding-top: 20px;">
+        <div class="xl-form-footer">
+            <div class="scoped-btn-more">
+              <el-button type="small" icon="el-icon-plus" class="xl-form-btn bgc2" @click="openPopup">更新报备进度</el-button>
+              <el-button type="small" icon="el-icon-warning" class="xl-form-btn bgc4" @click="openStatePopup">修改状态</el-button>
+            </div>
+          <el-button class="xl-form-btn t2" @click="close">关闭弹窗</el-button>
+        </div>
+      </div>
+    </el-dialog>
+    <record-edit
+      :isShow="isDtlShow"
+      :pObj="dtlObj"
+      :curObj="subObj"
+      @close="closePopup"
+    />
+    <state-edit
+      :isShow="isStateShow"
+      :pObj="dtlObj"
+      :curObj="subObj"
+      @close="closeStatePopup"
+    />
+  </div>
+</template>
+<script>
+import RecordEdit from './RecordEdit'
+import StateEdit from './StateEdit'
+import baseTable from '_m/baseTable.js'
+import { arrToObj } from '@/utils'
+export default {
+  components: {
+    RecordEdit,
+    StateEdit,
+  },
+  mixins: [...mixins, baseTable],
+  props: {
+    isShow: Boolean,
+    curObj: Object
+  },
+  inject: ['parentData'],
+  data() {
+    return {
+      apiStr: 'cust.admreportdetail',
+      noCreated: true,
+      searchForm: {},
+      aList: [],
+      subObj: {},
+      isDtlShow: false,
+      reportFlow: [],
+      dtlObj: {},
+      isStateShow: false,
+      sexObj: {},
+    }
+  },
+  mounted() {
+    this.sexObj = arrToObj(this.$dictData.sex)
+    this.listConfig = {
+      rows: [
+        { label: '客户状态', prop: 'report_state', type: 'tag', tags: arrToObj(this.$dictData.report_state	), tagTypeObj: {'1': 'success', '2': 'warning', '3': 'danger'}},
+        { label: '报备进度', prop: 'report_step', type: 'flag', flags: arrToObj(this.$dictData.report_step	) },
+        { label: '更新时间', prop: 'create_at' },
+        { label: '备注', prop: 'describe', fullShow: true, minWidth: 200, align: 'left' },
+        // { label: '操作', width: 120, type: 'handle2', operations:
+        //   [
+        //     { label: '编辑', func: this.openPopup, btnType: 'primary' },
+        //     { label: '删除', func: this.delHandle, btnType: 'danger' },
+        //   ]
+        // }
+      ]
+    }
+  },
+  computed: {
+    tableData2 () {
+      let arr = [...this.tableData]
+      arr.map(item => {})
+      return arr
+    },
+    reportStepStr () {
+      return arrToObj(this.$dictData.report_step)[this.dtlObj.report_step]
+    },
+    reportStateStr () {
+      return arrToObj(this.$dictData.report_state)[this.dtlObj.report_state]
+    }
+  },
+  watch: {
+    isShow: function(val) {
+      if (val) {
+        this.getData()
+      }
+    },
+  },
+  methods: {
+    getData () {
+      this.$api.cust.admreportdetail({id: this.curObj.id}).then(res => {
+        console.log(res)
+        this.dtlObj = res || {}
+        this.reportFlow = res.report_flow || []
+      })
+    },
+    delHandle(row) {
+      this.$msg(`您确定要删除该跟进记录吗?`, 'confirm', () => {
+        this.$api.user.admcustomerrecorddel({
+          id: row.id
+        }).then(data => {
+          this.$msgs(`已删除!`)
+          this.getData()
+        })
+      }, null, true)
+    },
+    close(str) {
+      this.$emit('close')
+    },
+    openPopup(row) {
+      if (row && row.id) {
+        this.subObj = row
+      } else {
+        this.subObj = {}
+      }
+      this.isDtlShow = true
+    },
+    closePopup(obj) {
+      this.isDtlShow = false
+      if (obj) {
+        this.getData()
+      }
+    },
+    openStatePopup(row) {
+      if (row && row.id) {
+        this.subObj = row
+      } else {
+        this.subObj = {}
+      }
+      this.isStateShow = true
+    },
+    closeStatePopup(obj) {
+      this.isStateShow = false
+      if (obj) {
+        this.getData()
+      }
+    },
+  }
+}
+</script>
+<style lang="scss" scoped>
+.scoped-info {
+  border-left: 1px solid #dcdcdc;
+  border-top: 1px solid #dcdcdc;
+  margin-bottom: 10px;
+  .si-row {
+    display: flex;
+    border-bottom: 1px solid #dcdcdc;
+  }
+  .si-col {
+    width: 33.33%;
+    box-sizing: border-box;
+    padding: 10px 20px;
+    border-right: 1px solid #dcdcdc;
+  }
+}
+
+.scoped-table {
+  max-height: 300px;
+  overflow-y: auto;
+  position: relative;
+  box-shadow: 0 0 2px #ccc;
+  // border-top: 1px solid #dcdcdc;
+  // border-bottom: 1px solid #dcdcdc;
+  ::v-deep .xl-pagination {
+    position: absolute;
+  }
+}
+
+
+.scoped-btn-more {
+  position: absolute;
+  left: 25px;
+}
+</style>

+ 189 - 0
src/views/report/components/popup/IndexRecordMy.vue

@@ -0,0 +1,189 @@
+<template>
+  <div>
+    <el-dialog
+      :show-close="false"
+      :close-on-click-modal="false"
+      :visible.sync="isShow"
+      :title="`${curObj.name}的报备详情`"
+      :fullscreen="false"
+      width="800px"
+      custom-class="xl-dialog"
+      center
+    >
+      <div class="scoped-info">
+        <div class="si-row">
+          <div class="si-col">昵称:{{dtlObj.name}}</div>
+          <div class="si-col">手机号:{{dtlObj.phone}}</div>
+          <div class="si-col">性别:{{sexObj[dtlObj.sex]}}</div>
+        </div>
+        <div class="si-row">
+          <div class="si-col">客户状态:{{reportStateStr}}</div>
+          <div class="si-col">报备进度:{{reportStepStr}}</div>
+        </div>
+        <div class="si-row">
+          <div class="si-col">报备日期:{{dtlObj.create_at}}</div>
+          <div class="si-col">保护期止:{{dtlObj.lock_at}}</div>
+          <div class="si-col">报备楼盘:{{dtlObj.estate_name}}</div>
+        </div>
+      </div>
+      <div class="scoped-table">
+        <table-list
+          :list-loading="listLoading"
+          :data="reportFlow"
+          :columns="listConfig"
+          :current-page="currentPage"
+          :page-size="-1"
+          >
+        </table-list>
+      </div>
+      <div class="xl-form" style="padding-top: 20px;">
+        <div class="xl-form-footer">
+          <el-button class="xl-form-btn t2" @click="close">关闭弹窗</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import baseTable from '_m/baseTable.js'
+import { arrToObj } from '@/utils'
+export default {
+  components: {},
+  mixins: [...mixins, baseTable],
+  props: {
+    isShow: Boolean,
+    curObj: Object
+  },
+  inject: ['parentData'],
+  data() {
+    return {
+      apiStr: 'cust.admreportdetail',
+      noCreated: true,
+      searchForm: {},
+      aList: [],
+      subObj: {},
+      isDtlShow: false,
+      reportFlow: [],
+      dtlObj: {},
+      isStateShow: false,
+      sexObj: {},
+    }
+  },
+  mounted() {
+    this.sexObj = arrToObj(this.$dictData.sex)
+    this.listConfig = {
+      rows: [
+        { label: '客户状态', prop: 'report_state', type: 'tag', tags: arrToObj(this.$dictData.report_state	), tagTypeObj: {'1': 'success', '2': 'warning', '3': 'danger'}},
+        { label: '报备进度', prop: 'report_step', type: 'flag', flags: arrToObj(this.$dictData.report_step	) },
+        { label: '更新时间', prop: 'create_at' },
+        { label: '备注', prop: 'describe', fullShow: true, minWidth: 200, align: 'left' },
+      ]
+    }
+  },
+  computed: {
+    tableData2 () {
+      let arr = [...this.tableData]
+      arr.map(item => {})
+      return arr
+    },
+    reportStepStr () {
+      return arrToObj(this.$dictData.report_step)[this.dtlObj.report_step]
+    },
+    reportStateStr () {
+      return arrToObj(this.$dictData.report_state)[this.dtlObj.report_state]
+    }
+  },
+  watch: {
+    isShow: function(val) {
+      if (val) {
+        this.getData()
+      }
+    },
+  },
+  methods: {
+    getData () {
+      this.$api.cust.admreportdetail({id: this.curObj.id}).then(res => {
+        console.log(res)
+        this.dtlObj = res || {}
+        this.reportFlow = res.report_flow || []
+      })
+    },
+    delHandle(row) {
+      this.$msg(`您确定要删除该跟进记录吗?`, 'confirm', () => {
+        this.$api.user.admcustomerrecorddel({
+          id: row.id
+        }).then(data => {
+          this.$msgs(`已删除!`)
+          this.getData()
+        })
+      }, null, true)
+    },
+    close(str) {
+      this.$emit('close')
+    },
+    openPopup(row) {
+      if (row && row.id) {
+        this.subObj = row
+      } else {
+        this.subObj = {}
+      }
+      this.isDtlShow = true
+    },
+    closePopup(obj) {
+      this.isDtlShow = false
+      if (obj) {
+        this.getData()
+      }
+    },
+    openStatePopup(row) {
+      if (row && row.id) {
+        this.subObj = row
+      } else {
+        this.subObj = {}
+      }
+      this.isStateShow = true
+    },
+    closeStatePopup(obj) {
+      this.isStateShow = false
+      if (obj) {
+        this.getData()
+      }
+    },
+  }
+}
+</script>
+<style lang="scss" scoped>
+.scoped-info {
+  border-left: 1px solid #dcdcdc;
+  border-top: 1px solid #dcdcdc;
+  margin-bottom: 10px;
+  .si-row {
+    display: flex;
+    border-bottom: 1px solid #dcdcdc;
+  }
+  .si-col {
+    width: 33.33%;
+    box-sizing: border-box;
+    padding: 10px 20px;
+    border-right: 1px solid #dcdcdc;
+  }
+}
+
+.scoped-table {
+  max-height: 300px;
+  overflow-y: auto;
+  position: relative;
+  box-shadow: 0 0 2px #ccc;
+  // border-top: 1px solid #dcdcdc;
+  // border-bottom: 1px solid #dcdcdc;
+  ::v-deep .xl-pagination {
+    position: absolute;
+  }
+}
+
+
+.scoped-btn-more {
+  position: absolute;
+  left: 25px;
+}
+</style>

+ 98 - 0
src/views/report/components/popup/RecordEdit.vue

@@ -0,0 +1,98 @@
+<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
+    >
+      <div class="scoped-tips">当前报备进度:<span class="t">{{reportStepStr}}</span></div>
+      <base-form ref="ruleForm" class="lib-edit" :data="formData" :is-inline="false" label-width="110px">
+        <div slot="footer" style="padding-top: 20px;">
+          <el-button class="xl-form-btn t2" @click="close">关 闭</el-button>
+          <el-button class="xl-form-btn t1" @click="close('confirm')">确定</el-button>
+        </div>
+      </base-form>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import { arrToObj } from '@/utils'
+export default {
+  components: { },
+  mixins,
+  props: {
+    isShow: Boolean,
+    curObj: Object,
+    pObj: Object,
+  },
+  inject: ['parentData'],
+  data() {
+    return {
+      formData: [],
+      loading: true,
+      cObj: {},
+      curEstateObj: {},
+    }
+  },
+  computed: {
+    reportStepStr () {
+      return arrToObj(this.$dictData.report_step)[this.pObj.report_step]
+    }
+  },
+  watch: {
+    isShow: function(val) {
+      if (val) {
+        this.getDef()
+      }
+    },
+  },
+  methods: {
+    getDef() {
+      let params = { ...this.curObj }
+      this.formData = [
+        { label: '新报备进度', key: 'report_step', rules: 1, type: 'select', options: this.$dictData.report_step },
+        { label: '备注', key: 'remark', type: 'textarea' },
+      ]
+      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 }
+            let apiStr = 'admreportstepadd'
+            if (this.pObj.id) {
+              newForm.id = this.pObj.id
+            }
+            this.$api.cust[apiStr](newForm).then(data => {
+              this.$msgs(newForm.id ? '编辑成功' : '新增成功')
+              this.$emit('close', newForm)
+            })
+          }
+        })
+      } else {
+        this.$emit('close')
+        this.setDefaultValue()
+      }
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+.scoped-tips {
+  padding-bottom: 6px;
+  text-align: center;
+  .t {
+    font-size: 18px;
+    font-weight: bold;
+    color: #0c78b1;
+  }
+}
+</style>

+ 98 - 0
src/views/report/components/popup/StateEdit.vue

@@ -0,0 +1,98 @@
+<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
+    >
+      <div class="scoped-tips">当前客户报备状态:<span class="t">{{reportStateStr}}</span></div>
+      <base-form ref="ruleForm" class="lib-edit" :data="formData" :is-inline="false" label-width="110px">
+        <div slot="footer" style="padding-top: 20px;">
+          <el-button class="xl-form-btn t2" @click="close">关 闭</el-button>
+          <el-button class="xl-form-btn t1" @click="close('confirm')">确定</el-button>
+        </div>
+      </base-form>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import { arrToObj } from '@/utils'
+export default {
+  components: { },
+  mixins,
+  props: {
+    isShow: Boolean,
+    curObj: Object,
+    pObj: Object,
+  },
+  inject: ['parentData'],
+  data() {
+    return {
+      formData: [],
+      loading: true,
+      cObj: {},
+      curEstateObj: {},
+    }
+  },
+  watch: {
+    isShow: function(val) {
+      if (val) {
+        this.getDef()
+      }
+    },
+  },
+  computed: {
+    reportStateStr () {
+      return arrToObj(this.$dictData.report_state)[this.pObj.report_state]
+    }
+  },
+  methods: {
+    getDef() {
+      let params = { ...this.curObj }
+      this.formData = [
+        { label: '新报备状态', key: 'report_state', rules: 1, type: 'select', options: this.$dictData.report_state },
+        { label: '备注', key: 'remark', type: 'textarea' },
+      ]
+      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 }
+            let apiStr = 'admreportstateadd'
+            if (this.pObj.id) {
+              newForm.id = this.pObj.id
+            }
+            this.$api.cust[apiStr](newForm).then(data => {
+              this.$msgs(newForm.id ? '编辑成功' : '新增成功')
+              this.$emit('close', newForm)
+            })
+          }
+        })
+      } else {
+        this.$emit('close')
+        this.setDefaultValue()
+      }
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+.scoped-tips {
+  padding-bottom: 6px;
+  text-align: center;
+  .t {
+    font-size: 18px;
+    font-weight: bold;
+    color: #0c78b1;
+  }
+}
+</style>

+ 46 - 0
src/views/report/components/searchForm/Index.vue

@@ -0,0 +1,46 @@
+<template>
+  <header-collapse>
+    <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">查询</el-button>
+        <!-- <el-button :loading="listLoading" icon="el-icon-plus" class="xl-form-btn bgc2" @click="addHandle">添加客户</el-button> -->
+      </div>
+    </base-form>
+  </header-collapse>
+</template>
+<script>
+export default {
+  name: 'custIndex',
+  mixins: [],
+  props: {
+    listLoading: Boolean
+  },
+  inject: ['parentData'],
+  data() {
+    return {
+      searchData: [
+        { label: '电话', key: 'phone' },
+        { label: '姓名', key: 'name' },
+        { label: '性别', key: 'sex', type: 'select', options: this.$dictData.sex},
+        { label: '客户状态', key: 'report_state', type: 'select', options: this.$dictData.report_state},
+        { label: '报备进度', key: 'report_step', type: 'select', options: this.$dictData.report_step},
+        { label: '意向楼盘', key: 'estate_id', type: 'selectRemote',
+          remoteParams: { skey: 'estate_name', api: `house.admestatelist`, opKey: 'estate_name', opVal: 'id' },
+        },
+        { label: '备注', key: 'remark' },
+      ]
+    }
+  },
+  methods: {
+    addHandle () {
+      this.parentData.isDtlShow = true
+      this.parentData.curObj = {}
+    },
+    searchHandle() {
+      const oldform = this.$refs.ruleForm.baseForm
+      const newForm = { ...oldform }
+      this.$emit('change', newForm)
+    }
+  }
+}
+</script>

+ 162 - 0
src/views/report/index.vue

@@ -0,0 +1,162 @@
+<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"
+      :operationsDefaultLength="6"
+      :insertSlotArr="[7]"
+    >
+      <div slot="OI7">
+        <el-table-column
+          width="140"
+          label="保护期止"
+          align="center"
+        >
+          <template slot-scope="scope">
+            <template v-if="scope.row.report_state === '1' && scope.row.report_step === '1'">
+              <div v-if="+new Date() > +new Date(scope.row.lock_at)">
+                <div style="color: #f00">{{scope.row.lock_at}}</div>
+                <el-tag type="danger" size="mini">已过期</el-tag>
+              </div>
+              <div v-else-if="(+new Date(scope.row.lock_at) - +new Date()) < 86400000">
+                <div style="color: #e6a23c">{{scope.row.lock_at}}</div>
+                <el-tag type="warning" size="mini">1天内过期</el-tag>
+              </div>
+              <div v-else>
+                <div>{{scope.row.lock_at}}</div>
+              </div>
+            </template>
+            <template v-else>
+              <div>{{scope.row.lock_at}}</div>
+            </template>
+          </template>
+        </el-table-column>
+      </div>
+    </table-list>
+    <!-- :isAdd="true"
+      @add="openPopup" -->
+    <popup-edit
+      :isShow="isDtlShow"
+      :curObj="curObj"
+      @close="closePopup"
+    />
+    <index-record
+      :isShow="isQShow"
+      :curObj="curObj"
+      @close="closeQPopup"
+    />
+  </div>
+</template>
+<script>
+import { arrToObj } from '@/utils'
+import SearchForm from './components/searchForm/Index'
+import IndexRecord from './components/popup/IndexRecord'
+import PopupEdit from './components/popup/IndexEdit'
+import baseTable from '_m/baseTable.js'
+export default {
+  name: 'index',
+  components: {
+    SearchForm,
+    PopupEdit,
+    IndexRecord,
+  },
+  provide() {
+    return {
+      parentData: this
+    }
+  },
+  mixins: [baseTable],
+  data() {
+    return {
+      apiStr: 'cust.admreportlist',
+      searchForm: null,
+      isDtlShow: false,
+      curObj: {},
+      isQShow: false,
+      isAShow: false,
+    }
+  },
+  computed: {
+    tableData2() {
+      const arr = [...this.tableData]
+      arr.map(item => {
+        item.newRecord = `${item.record_estate_name ? item.record_estate_name : '-'}${item.record_protect_at && item.record_protect_at !== '1970-01-01' ? '(' + item.record_protect_at + ')' : ''}-${item.record_remark ? item.record_remark : ''}`
+      })
+      return arr
+    }
+  },
+  created() {},
+  mounted() {
+    this.listConfig = {
+      rows: [
+        { label: '姓名', prop: 'name' },
+        { label: '电话', prop: 'phone' },
+        { label: '客户状态', prop: 'report_state', type: 'tag', tags: arrToObj(this.$dictData.report_state	), tagTypeObj: {'1': 'success', '2': 'warning', '3': 'danger'}},
+        { label: '报备进度', prop: 'report_step', type: 'tag', tags: arrToObj(this.$dictData.report_step	), tagTypeObj: {'1': 'info', '2': 'success', '3': 'success'} },
+        { label: '报备楼盘', prop: 'estate_name'},
+        { label: '报备时间', prop: 'create_at' },
+        { label: '性别', prop: 'sex', type: 'tag', tags: arrToObj(this.$dictData.sex), tagTypeObj: {'male': 'primary', 'female': 'danger'} },
+        { label: '备注', prop: 'remark', fullShow: true },
+        { label: '报备人', prop: 'create_by' },
+        { label: '操作', width: 90, type: 'handle2', operations:
+          [
+            { label: '报备详情', func: this.openQPopup, btnType: 'primary' },
+            // { label: '修改状态', func: this.openPopup, btnType: 'warning' },
+            // { label: '删除', func: this.delHandle, btnType: 'danger' },
+          ]
+        }
+      ]
+    }
+  },
+  methods: {
+    openQPopup (row) {
+      if (row && row.id) {
+        this.curObj = row
+      } else {
+        this.curObj = {}
+      }
+      this.isQShow = true
+    },
+    closeQPopup (obj) {
+      this.isQShow = false
+      if (obj) {
+        this.fetchData()
+      }
+    },
+    delHandle(row) {
+      this.$msg(`您确定要删除该客户吗?`, 'confirm', () => {
+        this.$api.user.admcustomerdel({
+          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>

+ 162 - 0
src/views/report/my.vue

@@ -0,0 +1,162 @@
+<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"
+      :operationsDefaultLength="6"
+      :insertSlotArr="[7]"
+    >
+      <div slot="OI7">
+        <el-table-column
+          width="140"
+          label="保护期止"
+          align="center"
+        >
+          <template slot-scope="scope">
+            <template v-if="scope.row.report_state === '1' && scope.row.report_step === '1'">
+              <div v-if="+new Date() > +new Date(scope.row.lock_at)">
+                <div style="color: #f00">{{scope.row.lock_at}}</div>
+                <el-tag type="danger" size="mini">已过期</el-tag>
+              </div>
+              <div v-else-if="(+new Date(scope.row.lock_at) - +new Date()) < 86400000">
+                <div style="color: #e6a23c">{{scope.row.lock_at}}</div>
+                <el-tag type="warning" size="mini">1天内过期</el-tag>
+              </div>
+              <div v-else>
+                <div>{{scope.row.lock_at}}</div>
+              </div>
+            </template>
+            <template v-else>
+              <div>{{scope.row.lock_at}}</div>
+            </template>
+          </template>
+        </el-table-column>
+      </div>
+    </table-list>
+    <!-- :isAdd="true"
+      @add="openPopup" -->
+    <popup-edit
+      :isShow="isDtlShow"
+      :curObj="curObj"
+      @close="closePopup"
+    />
+    <index-record
+      :isShow="isQShow"
+      :curObj="curObj"
+      @close="closeQPopup"
+    />
+  </div>
+</template>
+<script>
+import { arrToObj } from '@/utils'
+import SearchForm from './components/searchForm/Index'
+import IndexRecord from './components/popup/IndexRecordMy'
+import PopupEdit from './components/popup/IndexEdit'
+import baseTable from '_m/baseTable.js'
+export default {
+  name: 'index',
+  components: {
+    SearchForm,
+    PopupEdit,
+    IndexRecord,
+  },
+  provide() {
+    return {
+      parentData: this
+    }
+  },
+  mixins: [baseTable],
+  data() {
+    return {
+      apiStr: 'cust.admreportlist',
+      searchForm: null,
+      isDtlShow: false,
+      curObj: {},
+      isQShow: false,
+      isAShow: false,
+    }
+  },
+  computed: {
+    tableData2() {
+      const arr = [...this.tableData]
+      arr.map(item => {
+        item.newRecord = `${item.record_estate_name ? item.record_estate_name : '-'}${item.record_protect_at && item.record_protect_at !== '1970-01-01' ? '(' + item.record_protect_at + ')' : ''}-${item.record_remark ? item.record_remark : ''}`
+      })
+      return arr
+    }
+  },
+  created() {},
+  mounted() {
+    this.listConfig = {
+      rows: [
+        { label: '姓名', prop: 'name' },
+        { label: '电话', prop: 'phone' },
+        { label: '客户状态', prop: 'report_state', type: 'tag', tags: arrToObj(this.$dictData.report_state	), tagTypeObj: {'1': 'success', '2': 'warning', '3': 'danger'}},
+        { label: '报备进度', prop: 'report_step', type: 'tag', tags: arrToObj(this.$dictData.report_step	), tagTypeObj: {'1': 'info', '2': 'success', '3': 'success'} },
+        { label: '报备楼盘', prop: 'estate_name'},
+        { label: '报备时间', prop: 'create_at' },
+        { label: '性别', prop: 'sex', type: 'tag', tags: arrToObj(this.$dictData.sex), tagTypeObj: {'male': 'primary', 'female': 'danger'} },
+        { label: '备注', prop: 'remark', fullShow: true },
+        { label: '报备人', prop: 'create_by' },
+        { label: '操作', width: 90, type: 'handle2', operations:
+          [
+            { label: '报备详情', func: this.openQPopup, btnType: 'primary' },
+            // { label: '修改状态', func: this.openPopup, btnType: 'warning' },
+            // { label: '删除', func: this.delHandle, btnType: 'danger' },
+          ]
+        }
+      ]
+    }
+  },
+  methods: {
+    openQPopup (row) {
+      if (row && row.id) {
+        this.curObj = row
+      } else {
+        this.curObj = {}
+      }
+      this.isQShow = true
+    },
+    closeQPopup (obj) {
+      this.isQShow = false
+      if (obj) {
+        this.fetchData()
+      }
+    },
+    delHandle(row) {
+      this.$msg(`您确定要删除该客户吗?`, 'confirm', () => {
+        this.$api.user.admcustomerdel({
+          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>

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