my.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <div class="app-container">
  3. <search-form
  4. :list-loading="listLoading"
  5. @change="searchHandle"
  6. />
  7. <table-list
  8. :list-loading="listLoading"
  9. :data="tableData2"
  10. :columns="listConfig"
  11. :current-page="currentPage"
  12. :page-size="pageSize"
  13. :total-records="totalRecords"
  14. @currentChange="pageHandle"
  15. @sizeChange="sizeChange"
  16. :operationsDefaultLength="6"
  17. :insertSlotArr="[7]"
  18. >
  19. <div slot="OI7">
  20. <el-table-column
  21. width="140"
  22. label="保护期止"
  23. align="center"
  24. >
  25. <template slot-scope="scope">
  26. <template v-if="scope.row.report_state === '1' && scope.row.report_step === '1'">
  27. <div v-if="+new Date() > +new Date(scope.row.lock_at)">
  28. <div style="color: #f00">{{scope.row.lock_at}}</div>
  29. <el-tag type="danger" size="mini">已过期</el-tag>
  30. </div>
  31. <div v-else-if="(+new Date(scope.row.lock_at) - +new Date()) < 86400000">
  32. <div style="color: #e6a23c">{{scope.row.lock_at}}</div>
  33. <el-tag type="warning" size="mini">1天内过期</el-tag>
  34. </div>
  35. <div v-else>
  36. <div>{{scope.row.lock_at}}</div>
  37. </div>
  38. </template>
  39. <template v-else>
  40. <div>{{scope.row.lock_at}}</div>
  41. </template>
  42. </template>
  43. </el-table-column>
  44. </div>
  45. </table-list>
  46. <!-- :isAdd="true"
  47. @add="openPopup" -->
  48. <popup-edit
  49. :isShow="isDtlShow"
  50. :curObj="curObj"
  51. @close="closePopup"
  52. />
  53. <index-record
  54. :isShow="isQShow"
  55. :curObj="curObj"
  56. @close="closeQPopup"
  57. />
  58. </div>
  59. </template>
  60. <script>
  61. import { arrToObj } from '@/utils'
  62. import SearchForm from './components/searchForm/Index'
  63. import IndexRecord from './components/popup/IndexRecordMy'
  64. import PopupEdit from './components/popup/IndexEdit'
  65. import baseTable from '_m/baseTable.js'
  66. export default {
  67. name: 'index',
  68. components: {
  69. SearchForm,
  70. PopupEdit,
  71. IndexRecord,
  72. },
  73. provide() {
  74. return {
  75. parentData: this
  76. }
  77. },
  78. mixins: [baseTable],
  79. data() {
  80. return {
  81. apiStr: 'cust.admreportlist',
  82. searchForm: null,
  83. isDtlShow: false,
  84. curObj: {},
  85. isQShow: false,
  86. isAShow: false,
  87. }
  88. },
  89. computed: {
  90. tableData2() {
  91. const arr = [...this.tableData]
  92. arr.map(item => {
  93. 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 : ''}`
  94. })
  95. return arr
  96. }
  97. },
  98. created() {},
  99. mounted() {
  100. this.listConfig = {
  101. rows: [
  102. { label: '姓名', prop: 'name' },
  103. { label: '电话', prop: 'phone' },
  104. { label: '客户状态', prop: 'report_state', type: 'tag', tags: arrToObj(this.$dictData.report_state ), tagTypeObj: {'1': 'success', '2': 'warning', '3': 'danger'}},
  105. { label: '报备进度', prop: 'report_step', type: 'tag', tags: arrToObj(this.$dictData.report_step ), tagTypeObj: {'1': 'info', '2': 'success', '3': 'success'} },
  106. { label: '报备楼盘', prop: 'estate_name'},
  107. { label: '报备时间', prop: 'create_at' },
  108. { label: '性别', prop: 'sex', type: 'tag', tags: arrToObj(this.$dictData.sex), tagTypeObj: {'male': 'primary', 'female': 'danger'} },
  109. { label: '备注', prop: 'remark', fullShow: true },
  110. { label: '报备人', prop: 'create_by' },
  111. { label: '操作', width: 90, type: 'handle2', operations:
  112. [
  113. { label: '报备详情', func: this.openQPopup, btnType: 'primary' },
  114. // { label: '修改状态', func: this.openPopup, btnType: 'warning' },
  115. // { label: '删除', func: this.delHandle, btnType: 'danger' },
  116. ]
  117. }
  118. ]
  119. }
  120. },
  121. methods: {
  122. openQPopup (row) {
  123. if (row && row.id) {
  124. this.curObj = row
  125. } else {
  126. this.curObj = {}
  127. }
  128. this.isQShow = true
  129. },
  130. closeQPopup (obj) {
  131. this.isQShow = false
  132. if (obj) {
  133. this.fetchData()
  134. }
  135. },
  136. delHandle(row) {
  137. this.$msg(`您确定要删除该客户吗?`, 'confirm', () => {
  138. this.$api.user.admcustomerdel({
  139. id: row.id
  140. }).then(data => {
  141. this.$msgs(`已删除!`)
  142. this.fetchData()
  143. })
  144. }, null, true)
  145. },
  146. openPopup(row) {
  147. if (row && row.id) {
  148. this.curObj = row
  149. } else {
  150. this.curObj = {}
  151. }
  152. this.isDtlShow = true
  153. },
  154. closePopup(obj) {
  155. this.isDtlShow = false
  156. if (obj) {
  157. this.fetchData()
  158. }
  159. }
  160. }
  161. }
  162. </script>