list.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. <template>
  2. <div class="sld_myenquiry_wrapper">
  3. <MemberTitle :memberTitle="L['我的询盘']"></MemberTitle>
  4. <div class="container">
  5. <h3 class="mb-30">{{ L["我的询盘"] }}</h3>
  6. <div class="search_con flex_row_between_center search_info">
  7. <div class="search_incon1 flex_row_start_center">
  8. <el-input
  9. class="search_input"
  10. v-model="keyword"
  11. :placeholder="L['姓名/邮箱/公司/内容']"
  12. clearable
  13. @clear="clear"
  14. >
  15. </el-input>
  16. <div class="search pointer" @click="getEnquiryList">
  17. {{ L["搜索"] }}
  18. </div>
  19. </div>
  20. </div>
  21. <div class="point_list">
  22. <!-- <table class="point_table">
  23. <tbody>
  24. <tr class="voucher_tabeltitle">
  25. <th>{{ L["序号"] }}</th>
  26. <th>{{ L["姓名"] }}</th>
  27. <th>{{ L["邮箱"] }}</th>
  28. <th>{{ L["电话"] }}</th>
  29. <th>{{ L["公司"] }}</th>
  30. <th>{{ L["内容"] }}</th>
  31. <th>{{ L["发送时间"] }}</th>
  32. <th class="oprate">{{ L["操作"] }}</th>
  33. </tr>
  34. <tr v-for="(item, index) in enquiryList.list" :key="index">
  35. <td>{{ index + 1 }}</td>
  36. <td>{{ item.name }}</td>
  37. <td>{{ item.email }}</td>
  38. <td>{{ item.phoneCode }}-{{ item.phone }}</td>
  39. <td>{{ item.company }}</td>
  40. <td>{{ item.message }}</td>
  41. <td>{{ item.createTime }}</td>
  42. <td>
  43. </td>
  44. </tr>
  45. </tbody>
  46. </table> -->
  47. <el-table :data="enquiryList.list" style="width: 100%">
  48. <el-table-column :label="L['序号']" type="index" :index="indexMethod" width="80"/>
  49. <el-table-column prop="name" :label="L['姓名']"/>
  50. <el-table-column prop="email" :label="L['邮箱']" />
  51. <el-table-column prop="itemType" :label="L['类型']" >
  52. <template #default="scope">
  53. <template v-if="scope.row.itemType == 'GOODS'">
  54. <nuxt-link style="color:#00985e;text-decoration: underline;" :to="'/goods/detail/'+ calcProductName(scope.row.itemName) +'_'+ scope.row.itemId" target="_blank">{{scope.row.itemName}}
  55. </nuxt-link>
  56. </template>
  57. <template v-if="scope.row.itemType == 'SHOP'">
  58. <nuxt-link style="color:#00985e;text-decoration: underline;" :to="'/store/'+ calcProductName(scope.row.itemName) +'_'+ scope.row.storeId" target="_blank">{{scope.row.itemName}}
  59. </nuxt-link>
  60. </template>
  61. <template v-if="scope.row.itemType == 'MALL'">
  62. <nuxt-link style="color:#00985e;text-decoration: underline;" :to="`/home/contact`" target="_blank">{{scope.row.itemTypeStr}}
  63. </nuxt-link>
  64. </template>
  65. </template>
  66. </el-table-column>
  67. <el-table-column prop="quantity" :label="L['采购数量']" >
  68. <template #default="scope">
  69. <template v-if="scope.row.itemType == 'GOODS'">
  70. {{scope.row.quantity}}
  71. </template>
  72. <template v-if="scope.row.itemType != 'GOODS'">
  73. -
  74. </template>
  75. </template>
  76. </el-table-column>
  77. <el-table-column prop="createTime" :label="L['发送时间']" width="180">
  78. </el-table-column>
  79. <el-table-column fixed="right" :label="L['内容']" width="80" type="expand" >
  80. <template #default="scope">
  81. <el-form label-position="left" inline class="demo-table-expand">
  82. <el-form-item :label="L['姓名']+':'">
  83. <span>{{ scope.row.name}}</span>
  84. </el-form-item>
  85. <el-form-item :label="L['邮箱']+':'">
  86. <span>{{ scope.row.email}}</span>
  87. </el-form-item>
  88. <el-form-item :label="L['类型']+':'">
  89. <template v-if="scope.row.itemType == 'GOODS'">
  90. <nuxt-link style="color:#00985e;text-decoration: underline;" :to="'/goods/detail/'+ calcProductName(scope.row.itemName) +'_'+ scope.row.itemId" target="_blank">{{scope.row.itemName}}
  91. </nuxt-link>
  92. </template>
  93. <template v-if="scope.row.itemType == 'SHOP'">
  94. <nuxt-link style="color:#00985e;text-decoration: underline;" :to="'/store/'+ calcProductName(scope.row.itemName) +'_'+ scope.row.storeId" target="_blank">{{scope.row.itemName}}
  95. </nuxt-link>
  96. </template>
  97. <template v-if="scope.row.itemType == 'MALL'">
  98. <nuxt-link style="color:#00985e;text-decoration: underline;" :to="`/home/contact`" target="_blank">{{scope.row.itemTypeStr}}
  99. </nuxt-link>
  100. </template>
  101. </el-form-item>
  102. <el-form-item :label="L['采购数量']+':'">
  103. <template v-if="scope.row.itemType == 'GOODS'">
  104. {{scope.row.quantity}}
  105. </template>
  106. <template v-if="scope.row.itemType != 'GOODS'">
  107. -
  108. </template>
  109. </el-form-item>
  110. <el-form-item :label="L['电话']+':'">
  111. <span>{{ scope.row.phoneCode}}-{{scope.row.phone}}</span>
  112. </el-form-item>
  113. <el-form-item :label="L['公司名称']+':'">
  114. <span>{{ scope.row.company }}</span>
  115. </el-form-item>
  116. <el-form-item :label="L['内容']+':'">
  117. <span style="word-break: break-word;">{{ scope.row.message }}</span>
  118. </el-form-item>
  119. </el-form>
  120. </template>
  121. </el-table-column>
  122. </el-table>
  123. <SldCommonEmpty
  124. v-if="!enquiryList.list.length"
  125. totalHeight="587"
  126. totalWidth="1003"
  127. :tip="L['暂无询盘记录~']"
  128. />
  129. </div>
  130. <div class="flex_row_end_center sld_pagination mt-15">
  131. <el-pagination
  132. @current-change="handleCurrentChange"
  133. v-model:currentPage="pageData.page.current"
  134. :page-size="pageData.page.pageSize"
  135. layout="prev, pager, next, jumper"
  136. :total="pageData.page.total"
  137. :hide-on-single-page="true"
  138. >
  139. </el-pagination>
  140. </div>
  141. </div>
  142. <!-- 询盘弹窗详情 start -->
  143. <el-dialog
  144. :title="L['询盘详情']"
  145. v-model="enquiryDetail"
  146. customClass="select_reason_width"
  147. :before-close="(current_reason_id = '')"
  148. append-to-body="true"
  149. lock-sroll="false"
  150. >
  151. <div class="cancel_list_con">
  152. <div class="address_item flex_column_start_start">
  153. <span>{{ L["姓名"] }}:{{ enquiryInfoData.data.name }}</span>
  154. <span>{{ L["邮箱"] }}:{{ enquiryInfoData.data.email }}</span>
  155. <span
  156. >{{ L["电话"] }}:{{ enquiryInfoData.data.phoneCode }}-{{
  157. enquiryInfoData.data.phone
  158. }}</span
  159. >
  160. <span>{{ L["数量"] }}:{{ enquiryInfoData.data.quantity }}</span>
  161. <span>{{ L["公司"] }}:{{ enquiryInfoData.data.company }}</span>
  162. <span>{{ L["内容"] }}:{{ enquiryInfoData.data.message }}</span>
  163. <span
  164. >{{ L["发送时间"] }}:{{ enquiryInfoData.data.createTime }}</span
  165. >
  166. </div>
  167. </div>
  168. </el-dialog>
  169. </div>
  170. </template>
  171. <script setup>
  172. import { reactive, getCurrentInstance, ref, onMounted } from "vue";
  173. // import { lang_zn } from "@/assets/language/zh";
  174. import { getCurLanguage } from '@/composables/common.js';
  175. import { useFiltersStore } from "@/store/filter.js";
  176. import { ElForm,ElFormItem,ElPopover,ElTooltip,ElDialog,ElPagination,ElInput,ElTable,ElTableColumn,ElTag,ElButton } from "element-plus";
  177. const filtersStore = useFiltersStore();
  178. // const L = lang_zn;
  179. const L = getCurLanguage();
  180. definePageMeta({
  181. layout: "member",
  182. middleware: ["auth"],
  183. });
  184. const { proxy } = getCurrentInstance();
  185. const enquiryDetail = ref(false); //是否显示询盘弹窗
  186. const enquiryList = reactive({ list: [] });
  187. const enquiryInfoData = reactive({ data: {} });
  188. const pageData = reactive({ page: {} });
  189. const keyword = ref("");
  190. const params = reactive({
  191. current: 1,
  192. pageSize: 20,
  193. type: "",
  194. keyword: "",
  195. });
  196. const getEnquiryList = () => {
  197. if (
  198. keyword.value != "" &&
  199. keyword.value != null &&
  200. keyword.value != undefined
  201. ) {
  202. params.keyword = keyword.value;
  203. } else {
  204. params.keyword = "";
  205. }
  206. get("v3/member/front/enquiry/list", params).then((res) => {
  207. if (res.state == 200) {
  208. enquiryList.list = res.data.list;
  209. pageData.page = res.data.pagination;
  210. }
  211. });
  212. };
  213. //清空搜索订单
  214. const clear = () => {
  215. keyword.value = "";
  216. getEnquiryList();
  217. };
  218. //显示弹窗
  219. const showSelectReasonDialog = (enquiryItem) => {
  220. enquiryInfoData.data = enquiryItem;
  221. enquiryDetail.value = true;
  222. };
  223. const handleSwitch = (index) => {
  224. params.type = index;
  225. params.current = 1;
  226. getEnquiryList();
  227. };
  228. const handlePrevCilickChange = (e) => {
  229. params.current = e;
  230. getEnquiryList();
  231. };
  232. const handleNextCilickChange = (e) => {
  233. params.current = e;
  234. getEnquiryList();
  235. };
  236. const handleCurrentChange = (e) => {
  237. params.current = e;
  238. getEnquiryList();
  239. };
  240. onMounted(() => {
  241. getEnquiryList();
  242. });
  243. const getDealEnquiryContent = (text) => {
  244. return !text ? '' : (text.length > 50 ? text.substr(0, 50)+'......' : text);
  245. };
  246. const indexMethod = (index) => {
  247. let cur_page = params.current != undefined ? params.current : 1;
  248. return (cur_page - 1) * params.pageSize + index + 1;
  249. }
  250. </script>
  251. <style>
  252. .enquiry-content-tip{
  253. max-width: 25%!important;
  254. }
  255. .el-table__expand-icon--expanded{
  256. transform: rotate(180deg);
  257. }
  258. .el-table .cell{
  259. padding: 0 4px;
  260. }
  261. .sld_myenquiry_wrapper i.el-icon:before {
  262. content: '';
  263. width: 100%;
  264. height: 12px;
  265. background: url(/plus.svg);
  266. background-size: cover;
  267. background-repeat: no-repeat;
  268. }
  269. .sld_myenquiry_wrapper i.el-icon svg{
  270. display: none;
  271. }
  272. </style>
  273. <style lang="scss" scoped>
  274. .mt-15 {
  275. margin-top: 15px;
  276. }
  277. .mb-30 {
  278. margin-bottom: 30px;
  279. }
  280. .sld_pagination {
  281. margin-right: 40px;
  282. margin-bottom: 20px;
  283. }
  284. .sld_myenquiry_wrapper {
  285. width: 957px;
  286. margin-left: 10px;
  287. float: left;
  288. }
  289. .sld_myenquiry_wrapper {
  290. .container {
  291. padding: 20px;
  292. background-color: #fff;
  293. margin-bottom: 10px;
  294. }
  295. }
  296. .sld_myenquiry_wrapper {
  297. .point_table {
  298. border-left: none;
  299. border-right: none;
  300. width: 100%;
  301. margin-bottom: 30px;
  302. border: 1px solid #e0e0e0;
  303. border-collapse: collapse;
  304. border-spacing: 0;
  305. background-color: transparent;
  306. .detail{
  307. cursor: pointer;
  308. }
  309. }
  310. }
  311. .sld_myenquiry_wrapper {
  312. .point_table {
  313. .voucher_tabeltitle {
  314. height: 39px;
  315. background-color: #ececec;
  316. }
  317. }
  318. }
  319. .sld_myenquiry_wrapper {
  320. .point_table {
  321. .voucher_tabeltitle {
  322. th {
  323. text-align: center;
  324. font-weight: 400;
  325. border: 1px solid #e3e3e3;
  326. }
  327. }
  328. }
  329. }
  330. .sld_myenquiry_wrapper {
  331. .point_table {
  332. td {
  333. text-align: center;
  334. line-height: 50px;
  335. background: #fff;
  336. border: 1px solid #e3e3e3;
  337. font-weight: 400;
  338. }
  339. }
  340. }
  341. .address_item span:not(:first-child) {
  342. margin-top: 12px;
  343. }
  344. .search_incon1 {
  345. height: 34px;
  346. background: #ffffff;
  347. }
  348. .search_con {
  349. .search_input {
  350. border-right: none;
  351. width: 300px;
  352. }
  353. }
  354. .search_con {
  355. .el-input__inner {
  356. height: 29px;
  357. padding-left: 11px;
  358. border: none;
  359. box-sizing: border-box;
  360. outline: none;
  361. font-size: 12px;
  362. font-weight: 400;
  363. }
  364. }
  365. .search_con {
  366. height: 44px;
  367. padding-top: 18px;
  368. padding-bottom: 25px;
  369. box-sizing: border-box;
  370. }
  371. .search_con {
  372. .search {
  373. width: 105px;
  374. height: 32px;
  375. border: none;
  376. background-color: #f7f7f7;
  377. color: #000;
  378. line-height: 32px;
  379. text-align: center;
  380. font-size: 12px;
  381. }
  382. }
  383. .demo-table-expand {
  384. font-size: 0;
  385. }
  386. .demo-table-expand label {
  387. width: 90px;
  388. color: #99a9bf;
  389. }
  390. .demo-table-expand .el-form-item {
  391. margin-right: 0;
  392. margin-bottom: 0;
  393. width: 100%;
  394. }
  395. </style>