jurisdiction.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <script setup>
  2. import mPage from "@/components/mPage.vue";
  3. import { dataMainInterface, customInterence } from "@/api/api.js";
  4. import { ref, reactive, computed, watch, onMounted, nextTick } from 'vue'
  5. import { useRouter } from "vue-router"
  6. import { Search,InfoFilled } from '@element-plus/icons-vue'
  7. const router = useRouter()
  8. const defaultSalesProps = {
  9. multiple: true,
  10. label: "RealName",
  11. children: "ChildrenList",
  12. value: "AdminId",
  13. } //销售级联配置
  14. const clientOptions = [
  15. {
  16. label: "正式",
  17. value: "1",
  18. },
  19. {
  20. label: "试用",
  21. value: "2",
  22. },
  23. {
  24. label: "永续",
  25. value: "3",
  26. },
  27. ]//状态
  28. let sellOptions = ref([]) //销售
  29. let sellName = ref("") //销售
  30. let clientState = ref("") //状态
  31. let pageSize = ref(10)
  32. let page_no = ref(1)
  33. let total = ref(0)
  34. let tableData = ref([])
  35. let keyword = ref("")
  36. let orderNumber = ref("1")
  37. let userTotal = ref("")
  38. let companyTotal = ref("")
  39. let exportExcel = computed(()=>{
  40. let arr = sellName.value.length ? sellName.value.map((item) => item[item.length-1]) : "";
  41. let sellUname = arr.length ? arr.join(",") : "";
  42. let str = `&Keyword=${keyword.value}&CompanyStatus=${clientState.value}&SellerId${sellUname}`;
  43. return (import.meta.env.VITE_APP_API_ROOT + "/yb/chartCensus/exportChartCompanyAuthCensusList?" + localStorage.getItem("auth") || "") + str;
  44. })
  45. watch(keyword,(newval)=>{
  46. sellName.value = "";
  47. clientState.value = "";
  48. page_no.value = 1;
  49. getTableList();
  50. })
  51. /* 获取销售 */
  52. function getSale() {
  53. customInterence.getSale().then((res) => {
  54. if (res.Ret === 200) {
  55. sellOptions.value = res.Data.List;
  56. }
  57. });
  58. }
  59. //分页
  60. function handleCurrentChange(page) {
  61. page_no.value = page;
  62. getTableList();
  63. }
  64. //获取表格数据
  65. async function getTableList() {
  66. let arr = sellName.value.length ? sellName.value.map((item) => item[item.length-1]) : "";
  67. const res = await dataMainInterface.getCompanyAuthCensusList({
  68. PageSize: pageSize.value,
  69. CurrentIndex: page_no.value,
  70. SellerId: arr.length ? arr.join(",") : "",
  71. CompanyStatus: clientState.value,
  72. Keyword: keyword.value,
  73. });
  74. if (res.Ret === 200) {
  75. tableData.value = res.Data.List;
  76. total.value = res.Data.Paging.Totals;
  77. userTotal.value = res.Data.UserTotal;
  78. companyTotal.value = res.Data.CompanyTotal;
  79. }
  80. }
  81. //表格的 change 事件
  82. function changeTableDate() {
  83. page_no.value = 1;
  84. getTableList();
  85. }
  86. function goDetail(item){
  87. router.push({
  88. path:'/customDetail',
  89. query: {
  90. id: item.CompanyId,
  91. }
  92. })
  93. }
  94. getTableList()
  95. getSale()
  96. </script>
  97. <template>
  98. <div class="container-jurisdiction">
  99. <el-card>
  100. <div class="top-box">
  101. <div>
  102. <a :href="exportExcel" download>
  103. <el-button type="primary">导出EXCEL</el-button>
  104. </a>
  105. <el-cascader
  106. v-model="sellName"
  107. placeholder="请选择销售"
  108. style="width: 230px; margin: 0 30px"
  109. :options="sellOptions"
  110. :props="defaultSalesProps"
  111. :show-all-levels="false"
  112. collapse-tags
  113. clearable
  114. filterable
  115. @change="changeTableDate"
  116. >
  117. </el-cascader>
  118. <el-select style="width: 230px" v-model="clientState" @change="changeTableDate" placeholder="请选择客户状态" clearable>
  119. <el-option v-for="item in clientOptions" :key="item.label" :label="item.label" :value="item.label"> </el-option>
  120. </el-select>
  121. </div>
  122. <div style="width: 400px">
  123. <el-input :prefix-icon="Search" v-model="keyword" placeholder="联系人姓名/客户名称" clearable></el-input>
  124. </div>
  125. </div>
  126. </el-card>
  127. <el-card style="margin-top: 30px">
  128. <div class="main-section">
  129. <el-card class="base-card" shadow="hover">
  130. <div slot="header" class="clearfix">
  131. <span>
  132. 开通权限用户数
  133. <el-tooltip class="item" effect="dark" content="根据筛选条件统计表格内联系人数量" placement="top">
  134. <InfoFilled style="width:14px;height:14px;"/>
  135. </el-tooltip>
  136. </span>
  137. </div>
  138. <div class="card-cont">{{ userTotal }}</div>
  139. </el-card>
  140. <el-card class="base-card" shadow="hover">
  141. <div slot="header" class="clearfix">
  142. <span>
  143. 开通权限客户数
  144. <el-tooltip class="item" effect="dark" content="根据筛选条件统计表格内客户数量" placement="top">
  145. <InfoFilled style="width:14px;height:14px;"/>
  146. </el-tooltip>
  147. </span>
  148. </div>
  149. <div class="card-cont">{{ companyTotal }}</div>
  150. </el-card>
  151. </div>
  152. <el-table :data="tableData" border style="width: 100%">
  153. <el-table-column prop="UserName" label="联系人姓名" align="center"></el-table-column>
  154. <el-table-column prop="CompanyName" label="客户名称" align="center">
  155. <template #default="scope">
  156. <span class="editsty" @click="goDetail(scope.row)">{{ scope.row.CompanyName }}</span>
  157. </template>
  158. </el-table-column>
  159. <el-table-column prop="SellerName" label="所属销售" align="center"></el-table-column>
  160. <el-table-column prop="CompanyStatus" label="客户状态" align="center"></el-table-column>
  161. <el-table-column prop="StartTime" label="图库服务期限" align="center">
  162. <template #default="scope"> {{ scope.row.StartTime }} ~ {{ scope.row.EndTime }} </template>
  163. </el-table-column>
  164. <el-table-column prop="RestDay" label="剩余天数" align="center"></el-table-column>
  165. </el-table>
  166. <el-col :span="24" class="toolbar">
  167. <mPage :total="total" :page_no="page_no" @handleCurrentChange="handleCurrentChange" />
  168. </el-col>
  169. </el-card>
  170. </div>
  171. </template>
  172. <style scoped lang="scss">
  173. .container-jurisdiction {
  174. .top-box {
  175. display: flex;
  176. justify-content: space-between;
  177. }
  178. .main-section {
  179. margin-bottom: 30px;
  180. display: flex;
  181. .base-card {
  182. width: 240px;
  183. background: #fff;
  184. color: #999;
  185. text-align: center;
  186. margin-right: 30px;
  187. cursor: pointer;
  188. .el-card__header {
  189. padding: 16px;
  190. }
  191. .card-cont {
  192. font-size: 28px;
  193. color: #333;
  194. }
  195. }
  196. }
  197. }
  198. </style>