index.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <template>
  2. <div class="app-container organization-manage">
  3. <!-- 搜索 -->
  4. <el-form :model="state.queryParams" ref="queryRef" :inline="true">
  5. <el-form-item label="客户企业码" prop="customerqym">
  6. <el-input v-model="state.queryParams['customerqym.value']" placeholder="客户企业码" clearable
  7. @keyup.enter="handleQuery({ initPageIndex: true })" />
  8. </el-form-item>
  9. <!-- 按钮组件 -->
  10. <all-button :buttonType="['', '', 'query', 'refresh']" @addButton="accountEditRef.openDialog()"
  11. @queryButton="handleQuery({ initPageIndex: true })" @refreshButton="handleQuery({ initPageIndex: true })" />
  12. </el-form>
  13. <!-- 表格 -->
  14. <el-table v-loading="state.tableLoading" :data="state.tableData" row-key="id" style="flex: 1" stripe border
  15. table-layout="fixed" @cell-dblclick="tableCelldbl">
  16. <el-table-column align="center" prop="customerid" label="客户id" min-width="150" sortable></el-table-column>
  17. <el-table-column align="center" prop="customertel" label="客户手机" min-width="150"></el-table-column>
  18. <el-table-column align="center" prop="customerwxopenid" label="微信openid" min-width="150"></el-table-column>
  19. <el-table-column align="center" prop="customername" label="客户名称" min-width="150"></el-table-column>
  20. <el-table-column align="center" prop="customertype" label="客户类型" min-width="150">
  21. <template #default="scope">
  22. <span>{{ scope.row[scope.column.property] }} {{ scope.row.customertype1 ? `-${scope.row.customertype1}` : ''
  23. }}</span>
  24. </template>
  25. </el-table-column>
  26. <!-- <el-table-column align="center" prop="customersfky" label="客户是否可用" min-width="150"></el-table-column> -->
  27. <el-table-column align="center" prop="customersfrz" label="客户是否认证" min-width="150">
  28. <template #default="scope">
  29. <el-tag type="danger" v-if="scope.row[scope.column.property] == 1">已认证</el-tag>
  30. <el-tag v-if="scope.row[scope.column.property] == 0">未认证</el-tag>
  31. </template>
  32. </el-table-column>
  33. <el-table-column align="center" prop="customerissubscribe" label="客户是否关注" min-width="150">
  34. <template #default="scope">
  35. <el-tag v-if="scope.row[scope.column.property] == 1">已关注</el-tag>
  36. <el-tag v-if="scope.row[scope.column.property] == 0">没关注</el-tag>
  37. </template>
  38. </el-table-column>
  39. <!-- <el-table-column align="center" prop="customerzjlx" label="客户证件类型" min-width="150"></el-table-column> -->
  40. <!-- <el-table-column align="center" prop="customerzjhm" label="客户证件号码" min-width="210"></el-table-column> -->
  41. <!-- <el-table-column align="center" prop="customerzjyxq" label="客户证件有效期" min-width="150"></el-table-column> -->
  42. <!-- <el-table-column align="center" prop="customerheadimgurl" label="客户微信头像" min-width="150"></el-table-column> -->
  43. <el-table-column align="center" prop="customerqym" label="客户企业码" min-width="150"></el-table-column>
  44. <el-table-column align="center" prop="customercreatedate" label="客户创建时间" min-width="150"></el-table-column>
  45. <el-table-column align="center" prop="customerupdate" label="客户最后更新时间" min-width="150"></el-table-column>
  46. <el-table-column align="center" :width="fitWidth" label="操作" class-name="small-padding fixed-width" fixed="right">
  47. <template #default="scope">
  48. <div class="operation-box">
  49. <el-text class="operate-btn-item" type="primary" @click="handleDictInfo(scope.row)">客户资料</el-text>
  50. <el-text class="operate-btn-item" type="primary" @click="handleDictOrer(scope.row)">客户订单</el-text>
  51. <el-text class="operate-btn-item" type="primary" @click="handleDictUser(scope.row)">宽带客户</el-text>
  52. <!-- <el-text class="operate-btn-item" type="danger" @click="handleDictDel(scope.row)">删除客户</el-text> -->
  53. </div>
  54. </template>
  55. </el-table-column>
  56. </el-table>
  57. <div class="pagination-box">
  58. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
  59. :current-page="paginaionConfig.query.pageindex" :page-sizes="paginaionConfig.sizeOptions"
  60. :page-size="paginaionConfig.query.rows" layout="total, sizes, prev, pager, next, jumper"
  61. :total="paginaionConfig.total">
  62. </el-pagination>
  63. </div>
  64. <paymentEdit width="50%" ref="accountEditRef" @refresh="handleQuery" />
  65. </div>
  66. </template>
  67. <script setup name="Account">
  68. import prowlerStoreApi from '@store/modules/prowlerStoreApi'
  69. import useSystemManageStore from '@store/modules/systemManage'
  70. import paymentEdit from '../components/paymentEdit/index.vue'
  71. import _ from 'lodash'
  72. import usePagination from '@/hooks/usePagination'
  73. import useFitColumn from '@/hooks/useFitColumn'
  74. import tableCelldbl from '@/hooks/tableCelldbl'
  75. const router = useRouter()
  76. const { proxy } = getCurrentInstance()
  77. const systemManageStore = useSystemManageStore()
  78. const { paginaionConfig, handleSizeChange, handleCurrentChange } = usePagination(handleQuery)
  79. const { fitWidth } = useFitColumn()
  80. // 接口封装文件
  81. const productManageStore = prowlerStoreApi()
  82. const state = reactive({
  83. tableLoading: false,
  84. tableData: [],
  85. queryParams: {
  86. 'customerqym.value': ''
  87. }
  88. })
  89. // components组件
  90. const accountEditRef = ref(null)
  91. // 角色组信息
  92. const roleList = ref([])
  93. provide('roleList', readonly(roleList))
  94. // 重置搜索项
  95. const resetButton = () => {
  96. state.queryParams = {}
  97. handleQuery({ initPageIndex: true })
  98. }
  99. // 默认信息
  100. const getRoleList = async () => {
  101. const { Total, Data } = await systemManageStore.sysusergroupLoad({
  102. pageindex: 1,
  103. rows: 1000
  104. })
  105. roleList.value = Data
  106. }
  107. function handleQuery(config) {
  108. if (config?.initPageIndex) paginaionConfig.query.pageindex = 1
  109. getList(Object.assign(_.cloneDeep(paginaionConfig.query), state.queryParams))
  110. }
  111. /** 查询菜单列表 */
  112. const getList = async (query) => {
  113. state.tableLoading = true
  114. const { Total, Data } = await productManageStore.list(query)
  115. paginaionConfig.total = Total
  116. state.tableData = Data
  117. state.tableLoading = false
  118. }
  119. // 查看详情
  120. const handleDictInfo = async (query) => {
  121. router.push({ path: '/peoplesmanage/prowlerinfo', query: { customerid: query.customerid } })
  122. }
  123. const handleDictOrer = async (query) => {
  124. router.push({ path: '/orderesmanage/orderesmanage', query: { customerid: query.customerid } })
  125. }
  126. const handleDictUser = async (query) => {
  127. router.push({ path: '/kuandaiManage/kuandaiManage', query: { customerid: query.customerid } })
  128. }
  129. /** 删除 */
  130. const handleDictDel = async (query) => {
  131. try {
  132. let params = JSON.parse(JSON.stringify(query))
  133. params['customerid.value'] = params.customerid
  134. params['customerid'] = params.customerid
  135. await proxy.$modal.confirm('请问确认删除吗?')
  136. await productManageStore.del({ 'customerid.value': params.customerid })
  137. proxy.$modal.msgSuccess('删除成功!')
  138. handleQuery()
  139. } catch (error) {
  140. console.log(error, 'error')
  141. }
  142. }
  143. onMounted(() => {
  144. handleQuery({ initPageIndex: true })
  145. // 其他信息
  146. // getRoleList()
  147. })
  148. </script>