list.vue 11 KB

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