list.vue 12 KB

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