trialApplication.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <script setup>
  2. import { ref,computed } from 'vue'
  3. import { ElMessageBox,ElMessage } from 'element-plus'
  4. import { Search } from '@element-plus/icons-vue'
  5. import { customInterence } from "@/api/api.js";
  6. import mPage from '@/components/mPage.vue'
  7. const isShowloadding = ref(false)
  8. const tableData = ref([]) //表格数据
  9. const page_no = ref(1)
  10. const pageSize = ref(10)
  11. const total = ref(0)
  12. const lang = ref("中文官网")
  13. const search_txt = ref("") // 搜索关键字
  14. /* 获取表格数据 */
  15. function getTableData() {
  16. isShowloadding.value = true;
  17. customInterence
  18. .trialList({
  19. PageSize: 10,
  20. CurrentIndex: page_no.value,
  21. SourceType: lang.value,
  22. KeyWord: search_txt.value,
  23. })
  24. .then((res) => {
  25. if (res.Ret === 200) {
  26. total.value = res.Data.Paging.Totals;
  27. tableData.value = res.Data.List;
  28. } else {
  29. tableData.value = [];
  30. }
  31. isShowloadding.value = false;
  32. })
  33. }
  34. getTableData()
  35. /* 页码改变 */
  36. function handleCurrentChange(page) {
  37. page_no.value = page;
  38. getTableData();
  39. }
  40. /* 点击"未处理" */
  41. function statusHandle(item) {
  42. ElMessageBox.confirm("请确认已处理客户申请?", "提示", {
  43. type: "warning",
  44. })
  45. .then(() => {
  46. customInterence
  47. .trialStatus({
  48. Id: item.Id,
  49. })
  50. .then((res) => {
  51. if (res.Ret === 200) {
  52. ElMessage.success("操作成功!");
  53. getTableData();
  54. }
  55. });
  56. })
  57. .catch(() => {});
  58. }
  59. /* 中英文按钮 */
  60. function cEnClick(txt) {
  61. search_txt.value = "";
  62. lang.value = txt;
  63. page_no.value = 1;
  64. getTableData();
  65. }
  66. const cnColumn = [
  67. { label: '企业名称',key: 'CompanyName' },
  68. { label: '姓名',key: 'RealName' },
  69. { label: '手机号/邮箱',key: 'Phone' },
  70. { label: '所属行业',key: 'Industry' },
  71. { label: '申请时间',key: 'CreateTimeStr' },
  72. { label: '申请品种',key: 'ProductInfo' },
  73. ]
  74. const enColumn = [
  75. { label: '企业名称',key: 'CompanyName' },
  76. { label: '姓名',key: 'RealName' },
  77. { label: '邮箱',key: 'Email' },
  78. { label: '信息',key: 'Message' },
  79. { label: '发送时间',key: 'CreateTimeStr' },
  80. ]
  81. const columns = computed(() => {
  82. return lang.value==='中文官网' ? cnColumn : enColumn
  83. })
  84. </script>
  85. <template>
  86. <div class="trialApplication_container">
  87. <div class="trialApplication_top">
  88. <div class="left">
  89. <el-button type="primary" ref="btnCn" :plain="lang!=='中文官网'" @click="cEnClick('中文官网')">中文网站</el-button>
  90. <el-button type="primary" ref="btnEn" :plain="lang!=='英文官网'" @click="cEnClick('英文官网')"
  91. >英文网站</el-button
  92. >
  93. </div>
  94. <div class="right">
  95. <el-input
  96. placeholder="公司名称/手机号码"
  97. v-model="search_txt"
  98. clearable
  99. style="max-width: 500px"
  100. ref="searchInput"
  101. >
  102. <template #prefix>
  103. <el-icon><Search /></el-icon>
  104. </template>
  105. </el-input>
  106. <el-button @click="getTableData" type="primary">客户检索</el-button>
  107. </div>
  108. </div>
  109. <div class="trialApplication_cont">
  110. <!-- 中文官网 -->
  111. <el-table
  112. ref="table"
  113. :data="tableData"
  114. v-loading="isShowloadding"
  115. element-loading-text="数据加载中..."
  116. border
  117. >
  118. <el-table-column
  119. :label="item.label"
  120. align="center"
  121. v-for="item in columns"
  122. :key="item.key"
  123. >
  124. <template #default="scope">
  125. <span v-if="key==='Phone'">{{scope.row[item.key] || scope.row.Email}}</span>
  126. <span v-else>{{ scope.row[item.key] }}</span>
  127. </template>
  128. </el-table-column>
  129. <el-table-column label="操作" align="center">
  130. <template #default="scope">
  131. <div style="color: #4099ef; font-size: 24px">
  132. <span
  133. v-if="scope.row.Status == '待处理'"
  134. class="processed editsty"
  135. @click.stop="statusHandle(scope.row)"
  136. >标记处理
  137. </span>
  138. </div>
  139. </template>
  140. </el-table-column>
  141. <template #empty>
  142. <div style="line-height: 44px; margin: 60px 0; color: #999">
  143. <img
  144. src="~@/assets/img/cus_m/nodata.png"
  145. alt=""
  146. style="display: block; width: 160px; height: 128px; margin: auto"
  147. />
  148. <span>暂无信息</span>
  149. </div>
  150. </template>
  151. </el-table>
  152. <el-col :span="24" class="toolbar">
  153. <mPage
  154. :total="total"
  155. :page_no="page_no"
  156. :pageSize="pageSize"
  157. @handleCurrentChange="handleCurrentChange"
  158. />
  159. </el-col>
  160. </div>
  161. </div>
  162. </template>
  163. <style lang="scss" scoped>
  164. .trialApplication_container {
  165. .el-form-item__label {
  166. font-size: 16px;
  167. padding-right: 20px !important;
  168. }
  169. .trialApplication_top {
  170. display: flex;
  171. justify-content: space-between;
  172. flex-wrap: wrap;
  173. align-items: center;
  174. border: 1px solid #ececec;
  175. padding: 20px 30px;
  176. background: #fff;
  177. border-radius: 4px;
  178. box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
  179. .left {
  180. width: 215px;
  181. }
  182. .right {
  183. width: 617px;
  184. }
  185. a {
  186. float: left;
  187. }
  188. a:last-of-type {
  189. float: right;
  190. margin-left: 19px;
  191. }
  192. }
  193. .trialApplication_cont {
  194. padding: 20px 30px 80px;
  195. margin-top: 20px;
  196. background-color: #fff;
  197. box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
  198. position: relative;
  199. border: 1px solid #ececec;
  200. border-radius: 4px;
  201. }
  202. /* 待处理hover效果 */
  203. .el-table__row td:last-of-type .cell div span {
  204. cursor: pointer;
  205. }
  206. }
  207. </style>