index.vue 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193
  1. <template>
  2. <div class="com-main com-margin-auto com-fixationwidth-1400">
  3. <el-breadcrumb separator-class="el-icon-arrow-right">
  4. <el-breadcrumb-item :to="{ path: '/' }">Home</el-breadcrumb-item>
  5. <el-breadcrumb-item>{{ tabName }}</el-breadcrumb-item>
  6. </el-breadcrumb>
  7. <div class="content">
  8. <el-menu
  9. background-color="#e8eaee"
  10. text-color="#4a596c"
  11. ref="menu"
  12. active-text-color="#fff"
  13. class="el-menu-vertical"
  14. :default-active="activeMenu"
  15. @select="handleClick">
  16. <el-menu-item index="profile">
  17. <i class="iconfont">&#xe630;</i>
  18. <span slot="title">My Profile</span>
  19. </el-menu-item>
  20. <!-- <el-menu-item index="enquiry">
  21. <i class="iconfont">&#xe610;</i>
  22. <span slot="title">My Enquiry</span>
  23. </el-menu-item> -->
  24. <!-- <el-menu-item index="address">
  25. <i class="iconfont">&#xe619;</i>
  26. <span slot="title">My Addresses</span>
  27. </el-menu-item> -->
  28. <el-submenu index="order">
  29. <template slot="title">
  30. <i class="iconfont">&#xe610;</i>
  31. <span slot="title">My Orders</span>
  32. </template>
  33. <el-menu-item index="all-orders">All Orders</el-menu-item>
  34. <el-menu-item index="open-orders">Open Orders</el-menu-item>
  35. <el-menu-item index="closed-orders">Closed Orders</el-menu-item>
  36. </el-submenu>
  37. <!-- <el-menu-item index="account">
  38. <i class="iconfont">&#xe638;</i>
  39. <span slot="title">Account And Password</span>
  40. </el-menu-item> -->
  41. </el-menu>
  42. <div class="content-right">
  43. <div v-show="activeMenu === 'profile'">
  44. <div class="content-form">
  45. <p class="content-title">{{ tabName }}</p>
  46. <el-form
  47. ref="form"
  48. :model="profileform"
  49. :rules="rules"
  50. label-width="220px">
  51. <el-row>
  52. <el-col :span="15">
  53. <el-form-item
  54. label="Email Address"
  55. prop="email">
  56. <el-input
  57. v-model="profileform.email"
  58. :disabled="true"></el-input>
  59. </el-form-item>
  60. </el-col>
  61. <el-col :span="9">
  62. <el-form-item
  63. class="upload-item"
  64. label="Your Logo">
  65. <image-upload
  66. :list.sync="profileform.logo"
  67. :disablePreview="true"
  68. :max="1"></image-upload>
  69. </el-form-item>
  70. </el-col>
  71. </el-row>
  72. <el-form-item
  73. label="Company Name"
  74. prop="company">
  75. <el-input v-model="profileform.company"></el-input>
  76. </el-form-item>
  77. <el-form-item
  78. label="First Name"
  79. prop="contacts">
  80. <el-input v-model="profileform.contacts"></el-input>
  81. </el-form-item>
  82. <el-form-item
  83. label="Last Name"
  84. prop="last_name">
  85. <el-input v-model="profileform.last_name"></el-input>
  86. </el-form-item>
  87. <el-form-item
  88. label="Contact Phone Number"
  89. prop="phone">
  90. <el-input v-model="profileform.phone"></el-input>
  91. </el-form-item>
  92. <!-- <el-form-item>
  93. <el-button
  94. class="saveBtn"
  95. @click="onSave('form')"
  96. >Save</el-button>
  97. </el-form-item> -->
  98. </el-form>
  99. </div>
  100. <div
  101. class="content-form"
  102. style="margin-top: 20px">
  103. <p class="content-title">Account And Password</p>
  104. <el-form
  105. ref="ruleForm"
  106. :model="accountPasswordForm"
  107. label-width="220px"
  108. class="accountPasswordForm">
  109. <el-form-item
  110. label="Enter the new password"
  111. prop="password">
  112. <el-input v-model="accountPasswordForm.password"></el-input>
  113. </el-form-item>
  114. <el-form-item
  115. label="Retype the password"
  116. prop="confirm_password">
  117. <el-input
  118. v-model="accountPasswordForm.confirm_password"></el-input>
  119. </el-form-item>
  120. <el-form-item>
  121. <el-button
  122. class="saveBtn"
  123. @click="onSave('form')">
  124. Save
  125. </el-button>
  126. </el-form-item>
  127. </el-form>
  128. </div>
  129. </div>
  130. <div
  131. v-show="activeMenu === 'enquiry'"
  132. class="content-form">
  133. <p class="content-title">{{ tabName }}</p>
  134. <div class="searchInput">
  135. <el-input
  136. placeholder="Search your job name"
  137. v-model="enquiryKeyword"
  138. clearable
  139. @keyup.enter.native="getEnquiryList"
  140. @clear="getEnquiryList"
  141. ><i
  142. slot="suffix"
  143. class="el-input__icon el-icon-search"
  144. @click="getEnquiryList"></i>
  145. </el-input>
  146. </div>
  147. <el-table
  148. class="table-order-list"
  149. :data="enquiryList"
  150. stripe
  151. style="width: 100%"
  152. @row-click="goEnquiryDetail"
  153. :header-cell-style="{ background: '#00213b', color: '#ffffff' }"
  154. v-loading="tableLoading">
  155. <el-table-column
  156. prop="Auto_Number"
  157. label="Enquiry No">
  158. </el-table-column>
  159. <el-table-column
  160. prop="Enquiry_Title"
  161. label="Job Name"
  162. width="300">
  163. </el-table-column>
  164. <el-table-column
  165. prop="Customize_Pipeline_Stage"
  166. label="Status"></el-table-column>
  167. <!-- <el-table-column
  168. prop="Rating"
  169. label="Ratiing"></el-table-column> -->
  170. <el-table-column
  171. prop="Enquiry_Created"
  172. label="Date">
  173. <template slot-scope="scope">
  174. <div>
  175. {{
  176. $utils.formatTime(
  177. scope.row.Sales_Order_Created,
  178. 'DD/MM/YYYY',
  179. true
  180. )
  181. }}
  182. </div>
  183. </template>
  184. </el-table-column>
  185. <el-table-column
  186. label="Action"
  187. width="90"
  188. align="center">
  189. <template>
  190. <el-button
  191. size="small"
  192. style="background-color: rgb(0, 33, 59); color: #fff"
  193. plain
  194. >View</el-button
  195. >
  196. </template>
  197. </el-table-column>
  198. <!-- <el-table-column label="Quote PDF">
  199. <template>
  200. <el-button>Download</el-button>
  201. </template>
  202. </el-table-column> -->
  203. </el-table>
  204. <pagination
  205. v-show="enquiryTotal > 0"
  206. :total="enquiryTotal"
  207. :page.sync="enquiryListQuery.page"
  208. :limit.sync="enquiryListQuery.limit"
  209. @pagination="getEnquiryList" />
  210. </div>
  211. <!-- <div
  212. v-show="activeMenu === 'address'"
  213. class="content-form">
  214. <p class="content-title">{{ tabName }}</p>
  215. <div class="address-content">
  216. <div
  217. class="my-addresses add-address"
  218. @click="addAddress(2)">
  219. <img
  220. src="@/assets/img/myAccount/add-address.png"
  221. alt="" />
  222. <p>Add address</p>
  223. </div>
  224. <div
  225. class="my-addresses address"
  226. v-for="item in addressList"
  227. :key="item.id">
  228. <div class="username">
  229. <p>{{ item.name }}</p>
  230. <span v-show="item.is_default">Default</span>
  231. </div>
  232. <div class="my-address-content">
  233. <p>{{ item.state }}</p>
  234. <p>{{ item.city }}</p>
  235. <p>{{ item.address }}</p>
  236. <p>{{ item.post_code }}</p>
  237. <p>{{ item.country }}</p>
  238. <p>Phone number: {{ item.phone }}</p>
  239. </div>
  240. <div class="edit-btns">
  241. <el-button
  242. size="mini"
  243. @click="editAddress(3, item.id)">
  244. Edit
  245. </el-button>
  246. <el-button
  247. size="mini"
  248. @click="delAddress(item.id)">
  249. Remove
  250. </el-button>
  251. <el-button
  252. size="mini"
  253. @click="setDefault(item.id)"
  254. v-show="!item.is_default">
  255. Set as Default
  256. </el-button>
  257. </div>
  258. </div>
  259. </div>
  260. <pagination
  261. v-show="addressTotal > 0"
  262. :total="addressTotal"
  263. :page.sync="addressListQuery.page"
  264. :limit.sync="addressListQuery.limit"
  265. @pagination="getAddressList" />
  266. </div> -->
  267. <!-- My Orders -->
  268. <div
  269. v-show="activeMenu.includes('orders')"
  270. class="content-form">
  271. <p class="content-title">{{ tabName }}</p>
  272. <div class="searchInput">
  273. <el-input
  274. placeholder="Search your job name"
  275. v-model="orderKeyword"
  276. clearable
  277. @keyup.enter.native="getOrdersList"
  278. @clear="getOrdersList"
  279. ><i
  280. slot="suffix"
  281. class="el-input__icon el-icon-search"
  282. @click="getOrdersList"></i>
  283. </el-input>
  284. <el-select
  285. v-if="selShow"
  286. v-model="selword"
  287. filterable
  288. clearable
  289. default-first-option
  290. placeholder="Select the status">
  291. <el-option
  292. v-for="option in orderSelList"
  293. :label="option"
  294. :value="option"
  295. :key="option"></el-option>
  296. </el-select>
  297. <el-select
  298. v-if="$store.state.userInfo?.memberCrmcomList?.length > 1"
  299. v-model="accounts_id"
  300. filterable
  301. clearable
  302. default-first-option
  303. placeholder="Select the CRM">
  304. <el-option
  305. v-for="option in $store.state.userInfo?.memberCrmcomList"
  306. :label="option.name"
  307. :value="option.id"
  308. :key="option.id"></el-option>
  309. </el-select>
  310. <el-button
  311. type="primary"
  312. @click="getOrdersList"
  313. style="
  314. background-color: rgb(0, 33, 59);
  315. border-color: rgb(0, 33, 59);
  316. "
  317. >Submit</el-button
  318. >
  319. </div>
  320. <el-table
  321. class="table-order-list"
  322. :data="tableData"
  323. v-loading="tableLoading"
  324. stripe
  325. :header-cell-style="{ background: '#00213b', color: '#ffffff' }"
  326. style="width: 100%">
  327. <el-table-column
  328. prop="Sales_Order_Title_Job_Name"
  329. label="Job Name">
  330. <template slot-scope="scope">
  331. <p class="table-list-p1">
  332. {{ scope.row.Sales_Order_Title_Job_Name }}
  333. </p>
  334. <!-- <p class="table-list-co2" v-if="scope.row.Emission_Total_Kg && scope.row.Emission_Total_Kg != '0'">
  335. <img src="@/assets/img/esg/co2_green.png" alt="CO2" class="co2-icon" />
  336. <span>{{ scope.row.Emission_Total_Kg }} kg CO₂e</span>
  337. </p>
  338. <p class="table-list-p2">Brand Name:{{ scope.row.Brand_Name }}</p>
  339. <p class="table-list-p2">ETA:{{ $utils.formatTime(scope.row.Expected_Delivery_Date,'DD/MM/YYYY') }}</p> -->
  340. </template>
  341. </el-table-column>
  342. <el-table-column
  343. width="100"
  344. prop="Reference"
  345. label="Order No">
  346. </el-table-column>
  347. <el-table-column
  348. width="120"
  349. prop="Sales_Order_Created"
  350. label="Order Date">
  351. <template slot-scope="scope">
  352. <div>
  353. {{
  354. $utils.formatTime(
  355. scope.row.Sales_Order_Created,
  356. 'DD/MM/YYYY'
  357. )
  358. }}
  359. </div>
  360. </template>
  361. </el-table-column>
  362. <el-table-column
  363. width="140"
  364. prop="Order_Stage_new"
  365. label="Order Status">
  366. </el-table-column>
  367. <el-table-column
  368. width="160"
  369. prop="Tracking_No_arr"
  370. label="Tracking No#">
  371. <template slot-scope="scope">
  372. <ul class="location">
  373. <li
  374. v-for="item in scope.row.Tracking_No_arr"
  375. :key="item.Tracking_No"
  376. @click="openTracking_URL(item.Tracking_URL)">
  377. <i class="el-icon-location"></i>{{ item.Tracking_No }}
  378. </li>
  379. </ul>
  380. </template>
  381. </el-table-column>
  382. <el-table-column
  383. width="110"
  384. prop="Grand_Total"
  385. label="Amount">
  386. <template slot-scope="scope">
  387. ${{ transformNumber(scope.row.Grand_Total) }}
  388. </template>
  389. </el-table-column>
  390. <el-table-column
  391. label="Action"
  392. width="100"
  393. align="center">
  394. <template slot-scope="scope">
  395. <!-- <el-button
  396. v-if="scope.row.Order_Stage_new === 'Sales Order Created'"
  397. @click="openApproved(scope.row)"
  398. size="small"
  399. style="
  400. background-color: rgb(0, 33, 59);
  401. color: #fff;
  402. width: 85px;
  403. "
  404. plain
  405. >Approved</el-button> -->
  406. <el-button
  407. @click="goOrderDetail(scope.row)"
  408. size="small"
  409. style="
  410. background-color: rgb(0, 33, 59);
  411. color: #fff;
  412. width: 85px;
  413. margin: 0;
  414. "
  415. plain
  416. >View</el-button
  417. >
  418. </template>
  419. </el-table-column>
  420. </el-table>
  421. <pagination
  422. v-show="orderTotal > 0"
  423. :total="orderTotal"
  424. :page.sync="orderListQuery.page"
  425. :limit.sync="orderListQuery.limit"
  426. @pagination="getOrdersList" />
  427. </div>
  428. </div>
  429. </div>
  430. <!-- <add-address-dialog
  431. :dialogVisible.sync="dialogVisible"
  432. :data="addressDetail"
  433. :componentVisible="componentVisible"
  434. @close="closeAddressDialog"
  435. @update="update" /> -->
  436. <dialog-XX-success
  437. :visible.sync="xxContentVisible"
  438. :content="xxContent"
  439. @notify-parent="handleNotification"></dialog-XX-success>
  440. <el-dialog
  441. :lock-scroll="false"
  442. :visible.sync="urlDialogShow"
  443. center
  444. width="850px"
  445. top="20vh">
  446. <iframe
  447. :src="Tracking_URL"
  448. style="width: 100%; height: 500px"
  449. frameborder="0"></iframe>
  450. </el-dialog>
  451. </div>
  452. </template>
  453. <script>
  454. import { mapMutations } from 'vuex'
  455. // import addAddressDialog from '../../../components/addAddressDialog.vue'
  456. import dialogXXSuccess from '@/components/DIalogXXSuccess.vue'
  457. import imageUpload from '@/components/ImageUpload'
  458. import { round } from '@/utils/price.js'
  459. export default {
  460. components: {
  461. // addAddressDialog,
  462. 'dialog-XX-success': dialogXXSuccess,
  463. imageUpload,
  464. },
  465. data() {
  466. return {
  467. xxContentVisible: false,
  468. xxContent: 'success',
  469. componentVisible: 1, // 2:add 3:edit 4:audit
  470. tabName: '',
  471. tableLoading: true,
  472. // 表单配置项
  473. profileform: {},
  474. rules: {
  475. email: [
  476. {
  477. required: true,
  478. message: 'Please enter the email',
  479. trigger: 'blur',
  480. },
  481. ],
  482. company: [
  483. {
  484. required: true,
  485. message: 'Please enter the company',
  486. trigger: 'blur',
  487. },
  488. ],
  489. contacts: [
  490. {
  491. required: true,
  492. message: 'Please enter first name',
  493. trigger: 'blur',
  494. },
  495. ],
  496. last_name: [
  497. {
  498. required: true,
  499. message: 'Please enter last name',
  500. trigger: 'blur',
  501. },
  502. ],
  503. phone: [
  504. {
  505. required: true,
  506. message: 'Please enter the phone',
  507. trigger: 'blur',
  508. },
  509. ],
  510. password: [
  511. {
  512. required: true,
  513. message: 'Please enter the password',
  514. trigger: 'blur',
  515. },
  516. ],
  517. confirm_password: [
  518. {
  519. required: true,
  520. message: 'Please enter the confirm_password',
  521. trigger: 'blur',
  522. },
  523. ],
  524. },
  525. accountPasswordForm: {
  526. password: '',
  527. confirm_password: '',
  528. },
  529. orderKeyword: '',
  530. selword: '',
  531. accounts_id: '',
  532. orderTotal: 0,
  533. orderListQuery: {
  534. page: 1,
  535. limit: 20,
  536. },
  537. tableData: [],
  538. dialogVisible: false,
  539. addressTotal: 0,
  540. addressListQuery: {
  541. page: 1,
  542. limit: 8,
  543. },
  544. addressList: [],
  545. addressDetail: {},
  546. enquiryKeyword: '',
  547. enquiryList: [],
  548. enquiryListQuery: {
  549. page: 1,
  550. limit: 20,
  551. },
  552. enquiryTotal: 0,
  553. orderSelList: [],
  554. Tracking_URL: '',
  555. urlDialogShow: false,
  556. }
  557. },
  558. computed: {
  559. activeMenu() {
  560. return this.$route.query.type ?? 'profile'
  561. },
  562. selShow() {
  563. return (
  564. this.activeMenu === 'all-orders' || this.activeMenu === 'open-orders'
  565. )
  566. },
  567. },
  568. watch: {
  569. $route: {
  570. handler(to) {
  571. if (process.client) {
  572. if (this.$utils.checkLogin()) {
  573. this.updateType()
  574. }
  575. }
  576. },
  577. },
  578. orderKeyword() {
  579. this.orderListQuery.page = 1
  580. },
  581. enquiryKeyword() {
  582. this.enquiryListQuery.page = 1
  583. },
  584. },
  585. mounted() {
  586. if (this.$utils.checkLogin()) {
  587. this.updateType()
  588. } else {
  589. this.$router.replace('/')
  590. }
  591. },
  592. methods: {
  593. transformNumber(value) {
  594. return round(Number(value)).toFixed(2)
  595. },
  596. handleClick(key, keyPath) {
  597. if (key) {
  598. this.$router.push({
  599. path: '/home/myDetail',
  600. query: { type: key },
  601. })
  602. }
  603. },
  604. updateType() {
  605. if (this.activeMenu === 'profile') {
  606. this.tabName = 'My Profile'
  607. this.getMemberDetail()
  608. } else if (this.activeMenu === 'enquiry') {
  609. this.tabName = 'My Enquiry'
  610. this.getEnquiryList()
  611. } else if (this.activeMenu === 'address') {
  612. // this.tabName = 'My Address'
  613. // this.getAddressList()
  614. } else {
  615. this.selword = ''
  616. if (this.activeMenu === 'all-orders') {
  617. this.orderSelList = [
  618. 'Order Confirmed',
  619. 'In Production',
  620. 'In Transit',
  621. 'Order Completed',
  622. ]
  623. }
  624. if (this.activeMenu === 'open-orders') {
  625. this.orderSelList = ['Order Confirmed', 'In Production', 'In Transit']
  626. }
  627. this.tabName = 'My Orders'
  628. this.getOrdersList()
  629. }
  630. },
  631. closeAddressDialog() {
  632. this.dialogVisible = false
  633. },
  634. // 获取用户信息
  635. getMemberDetail() {
  636. this.$axios
  637. .get('/uk-api/uk/member/detail')
  638. .then(res => {
  639. if (res.code === 1) {
  640. this.profileform = res.result
  641. this.profileform.logo = this.profileform.logo
  642. ? this.formatLogo(this.profileform.logo)
  643. : []
  644. }
  645. })
  646. .catch(() => {})
  647. },
  648. formatLogo(params) {
  649. return [{ url: params }]
  650. },
  651. onSave(form) {
  652. if (
  653. this.accountPasswordForm.confirm_password !==
  654. this.accountPasswordForm.password
  655. ) {
  656. this.$message.error('The second password is inconsistent!')
  657. return
  658. }
  659. this.$refs[form].validate(valid => {
  660. if (valid) {
  661. const requestBody = {
  662. email: this.profileform.email,
  663. company: this.profileform.company,
  664. contacts: this.profileform.contacts,
  665. last_name: this.profileform.last_name,
  666. phone: this.profileform.phone,
  667. logo: this.profileform.logo[0]?.url ?? '',
  668. }
  669. let needLogout = false
  670. if (this.accountPasswordForm.password.trim() !== '') {
  671. requestBody.password = this.accountPasswordForm.password
  672. requestBody.confirm_password =
  673. this.accountPasswordForm.confirm_password
  674. needLogout = true
  675. }
  676. this.$axios
  677. .post('/uk-api/uk/member/edit', requestBody)
  678. .then(res => {
  679. if (res.code === 1) {
  680. this.$notify({
  681. customClass: 'custom-notify-class',
  682. title: 'success',
  683. message: 'The profile information is modified successfully',
  684. type: 'success',
  685. })
  686. if (needLogout) {
  687. setTimeout(() => {
  688. this.$store.dispatch('logout').then(() => {
  689. this.$router.push('/')
  690. })
  691. }, 500)
  692. }
  693. }
  694. })
  695. .catch(() => {})
  696. } else {
  697. console.log('error submit!!')
  698. return false
  699. }
  700. })
  701. },
  702. // 获取订单列表
  703. getOrdersList() {
  704. const accounts_id = this.accounts_id
  705. ? this.accounts_id
  706. : this.$store.state.userInfo?.memberCrmcomList.map(i => i.id).join()
  707. const type =
  708. this.activeMenu === 'all-orders'
  709. ? ''
  710. : this.activeMenu === 'open-orders'
  711. ? 'Open Orders'
  712. : 'Closed Orders'
  713. this.tableLoading = true
  714. this.$axios
  715. .post('/uk-api/crmdata/order_lists', {
  716. keyword: this.orderKeyword,
  717. page: this.orderListQuery.page,
  718. limit: this.orderListQuery.limit,
  719. accounts_id,
  720. Order_Stage: this.selword,
  721. type,
  722. })
  723. .then(res => {
  724. if (res.code === 1) {
  725. this.tableData = res.result.data
  726. this.orderTotal = res.result.total
  727. this.tableLoading = false
  728. }
  729. if (process.client) {
  730. this.$nextTick(() => {
  731. window.scroll(0, 0)
  732. })
  733. }
  734. })
  735. .catch(() => {})
  736. },
  737. goOrderDetail(row) {
  738. const routeUrl = this.$router.resolve({
  739. path: '/home/myDetail/orderDetail',
  740. query: { id: row.sales_orders_id, crm: row.Account_Name_id },
  741. })
  742. window.open(routeUrl.href, '_blank')
  743. },
  744. openApproved(row) {
  745. this.$confirm(
  746. `
  747. <div style="text-align:center;">
  748. <h3 style="margin:0 0 10px;color:#333;">Ready to order?</h3>
  749. <p style="margin:0;font-size:16px;color:#333;">Your total is <b>${this.transformNumber(
  750. row.Grand_Total
  751. )}</b>. Confirm to place your order.</p>
  752. </div>
  753. `,
  754. '',
  755. {
  756. dangerouslyUseHTMLString: true,
  757. confirmButtonText: 'Confirm',
  758. cancelButtonText: 'Cancel',
  759. confirmButtonClass: 'el-button',
  760. cancelButtonClass: 'el-button--info',
  761. center: true,
  762. showClose: false,
  763. confirmButtonClass: 'com-btnblack',
  764. }
  765. ).then(() => {
  766. this.$router.push({
  767. path: '/so-confirm',
  768. query: { id: row.sales_orders_id, pc_psw: row.HASH },
  769. })
  770. })
  771. },
  772. getEnquiryList() {
  773. this.tableLoading = true
  774. this.$axios
  775. .post('/uk-api/crmdata/enquiries_lists', {
  776. keyword: this.enquiryKeyword,
  777. page: this.enquiryListQuery.page,
  778. limit: this.enquiryListQuery.limit,
  779. accounts_id: this.$store.state.userInfo?.crm_accounts_id || '',
  780. })
  781. .then(res => {
  782. if (res.code === 1) {
  783. this.enquiryList = res.result.data
  784. this.enquiryTotal = res.result.total
  785. this.tableLoading = false
  786. }
  787. if (process.client) {
  788. this.$nextTick(() => {
  789. window.scroll(0, 0)
  790. })
  791. }
  792. })
  793. },
  794. goEnquiryDetail(row) {
  795. const routeUrl = this.$router.resolve({
  796. path: '/home/myDetail/enquiryDetail',
  797. query: { id: row.enquiries_id },
  798. })
  799. window.open(routeUrl.href, '_blank')
  800. },
  801. // 获取地址列表
  802. // getAddressList() {
  803. // this.$axios
  804. // .get('/api/address/list', {
  805. // params: {
  806. // page: this.addressListQuery.page,
  807. // limit: this.addressListQuery.limit,
  808. // },
  809. // })
  810. // .then(res => {
  811. // if (res.code === 1) {
  812. // this.addressList = res.result.data
  813. // this.addressTotal = res.result.total
  814. // }
  815. // if (process.client) {
  816. // this.$nextTick(() => {
  817. // window.scroll(0, 0)
  818. // })
  819. // }
  820. // })
  821. // .catch(() => {})
  822. // },
  823. // addAddress(num) {
  824. // this.addressDetail = {}
  825. // this.componentVisible = num
  826. // this.dialogVisible = true
  827. // },
  828. // editAddress(num, id) {
  829. // this.$axios
  830. // .get('/api/address/detail/' + id)
  831. // .then(res => {
  832. // this.addressDetail = res.result
  833. // this.addressDetail.is_default = res.result.is_default === 1
  834. // this.componentVisible = num
  835. // this.dialogVisible = true
  836. // })
  837. // .catch(() => {})
  838. // },
  839. // delAddress(id) {
  840. // this.$axios.get('/api/address/delete/' + id).then(res => {
  841. // this.$notify({
  842. // title: 'success',
  843. // message: 'Deleted successfully',
  844. // type: 'success',
  845. // duration: 3000,
  846. // })
  847. // this.getAddressList()
  848. // })
  849. // },
  850. // setDefault(id) {
  851. // this.$axios.get('/api/address/set_default/' + id).then(res => {
  852. // this.$notify({
  853. // title: 'success',
  854. // message: 'Default address is set successfully',
  855. // type: 'success',
  856. // duration: 3000,
  857. // })
  858. // this.getAddressList()
  859. // })
  860. // },
  861. // update() {
  862. // this.getAddressList()
  863. // },
  864. resetPassword() {
  865. if (
  866. this.accountPasswordForm.confirm_password !==
  867. this.accountPasswordForm.password
  868. ) {
  869. this.$message.error('The second password is inconsistent!')
  870. } else {
  871. this.$axios({
  872. url: '/uk-api/uk/member/reset',
  873. method: 'POST',
  874. data: this.accountPasswordForm,
  875. })
  876. .then(res => {
  877. if (res.code === 1) {
  878. this.xxContentVisible = true
  879. this.xxContent = 'Password Reset Successful'
  880. }
  881. })
  882. .catch(() => {
  883. // this.$message.error(error.response.data.msg);
  884. })
  885. }
  886. },
  887. openTracking_URL(url) {
  888. this.Tracking_URL = url
  889. this.urlDialogShow = true
  890. },
  891. handleNotification() {
  892. this.$router.push('/')
  893. this.$store.dispatch('logout')
  894. this.openDialog()
  895. },
  896. ...mapMutations(['openDialog']),
  897. },
  898. }
  899. </script>
  900. <style lang="scss">
  901. .custom-notify-class {
  902. .el-notification__content {
  903. text-align: left;
  904. }
  905. }
  906. </style>
  907. <style lang="scss" scoped>
  908. .content {
  909. display: flex;
  910. .el-menu-vertical {
  911. width: 260px;
  912. min-height: 606px;
  913. background: #e8eaee;
  914. .iconfont {
  915. font-size: 22px;
  916. }
  917. :deep(.el-menu-item) {
  918. font-size: 16px;
  919. &:hover {
  920. background-color: #e8eaee !important;
  921. }
  922. &.is-active {
  923. background-color: #00213b !important;
  924. }
  925. }
  926. :deep(.el-submenu__title) {
  927. font-size: 16px;
  928. &:hover {
  929. background-color: #e8eaee !important;
  930. }
  931. }
  932. }
  933. :deep(.content-right) {
  934. flex: 1;
  935. margin-left: 15px;
  936. & > div {
  937. min-height: 606px;
  938. }
  939. .content-title {
  940. margin: 15px 0px 25px 15px;
  941. position: relative;
  942. width: 282px;
  943. height: 27px;
  944. font-size: 24px;
  945. font-weight: bold;
  946. color: #102f47;
  947. &::before {
  948. content: '';
  949. position: absolute;
  950. left: -14px;
  951. top: 50%;
  952. transform: translateY(-50%);
  953. width: 4px;
  954. height: 17px;
  955. background: #e90000;
  956. border-radius: 2px;
  957. margin-right: 10px;
  958. }
  959. }
  960. .content-form {
  961. border: 1px solid #c7c7c7;
  962. padding: 0 20px;
  963. .avatar-uploader .el-upload {
  964. border: 1px dashed #d9d9d9;
  965. border-radius: 6px;
  966. cursor: pointer;
  967. position: relative;
  968. overflow: hidden;
  969. }
  970. }
  971. .searchInput {
  972. margin-bottom: 10px;
  973. display: grid;
  974. grid-template-columns: 1fr 1fr 1fr 0.5fr 1fr;
  975. gap: 10px;
  976. .el-input {
  977. .el-input__inner {
  978. border-radius: 30px;
  979. }
  980. .el-input__suffix {
  981. .el-input__icon {
  982. font-size: 16px;
  983. font-weight: bold;
  984. }
  985. .el-icon-search {
  986. cursor: pointer;
  987. }
  988. }
  989. }
  990. }
  991. .table-order-list {
  992. width: 100%;
  993. border: 1px solid #c2c2c2;
  994. .table-list-p1 {
  995. font-weight: 600;
  996. color: #333;
  997. font-size: 16px;
  998. }
  999. .table-list-p2 {
  1000. font-size: 14px;
  1001. }
  1002. .table-list-co2 {
  1003. display: inline-flex;
  1004. align-items: center;
  1005. background: #f4fcf6;
  1006. border: 2px solid #7ed7a5;
  1007. border-radius: 4px;
  1008. padding: 1px 6px;
  1009. font-weight: bold;
  1010. color: #07a73a;
  1011. font-size: 12px;
  1012. .co2-icon {
  1013. width: 18px;
  1014. height: 18px;
  1015. margin-right: 4px;
  1016. }
  1017. }
  1018. }
  1019. .upload-item {
  1020. position: absolute;
  1021. right: 50px;
  1022. top: 0;
  1023. z-index: 2;
  1024. .el-form-item__content {
  1025. z-index: 1;
  1026. }
  1027. }
  1028. .el-form-item {
  1029. margin-bottom: 20px;
  1030. height: 40px;
  1031. .el-form-item__label {
  1032. font-size: 16px;
  1033. font-weight: 400;
  1034. color: #333333;
  1035. line-height: 35px;
  1036. }
  1037. .el-input__inner {
  1038. width: 460px;
  1039. background: #ffffff;
  1040. border: 1px solid #bebebe;
  1041. border-radius: 4px;
  1042. }
  1043. .saveBtn {
  1044. min-width: 140px;
  1045. height: 40px;
  1046. background: #00213b;
  1047. border-radius: 6px;
  1048. font-size: 18px;
  1049. font-weight: 400;
  1050. color: #ffffff;
  1051. margin-left: 180px;
  1052. }
  1053. }
  1054. .el-table {
  1055. margin-bottom: 10px;
  1056. border: 1px solid #c7c7c7;
  1057. .el-table__header {
  1058. height: 57px;
  1059. }
  1060. .el-table__row {
  1061. height: 57px;
  1062. }
  1063. }
  1064. .address-content {
  1065. display: flex;
  1066. flex-wrap: wrap;
  1067. .my-addresses {
  1068. display: inline-block;
  1069. width: 350px;
  1070. height: 300px;
  1071. box-sizing: border-box;
  1072. margin-bottom: 15px;
  1073. background: #f9fcfe;
  1074. border: 1px solid #c7c7c7;
  1075. border-radius: 10px;
  1076. margin-right: 13px;
  1077. &:nth-of-type(3),
  1078. &:nth-of-type(6),
  1079. &:nth-of-type(9) {
  1080. margin-right: 0;
  1081. }
  1082. }
  1083. .add-address {
  1084. display: flex;
  1085. flex-direction: column;
  1086. justify-content: space-evenly;
  1087. align-items: center;
  1088. img {
  1089. width: 77px;
  1090. height: 77px;
  1091. }
  1092. p {
  1093. width: 330px;
  1094. height: 21px;
  1095. font-size: 30px;
  1096. font-family: Proxima Nova;
  1097. font-weight: 400;
  1098. color: #00213b;
  1099. line-height: 30px;
  1100. text-align: center;
  1101. }
  1102. }
  1103. .address {
  1104. padding: 15px;
  1105. .username {
  1106. display: flex;
  1107. justify-content: space-between;
  1108. align-items: center;
  1109. height: 35px;
  1110. p {
  1111. height: 35px;
  1112. font-size: 24px;
  1113. font-family: Proxima Nova;
  1114. font-weight: bold;
  1115. color: #102f47;
  1116. line-height: 35px;
  1117. }
  1118. span {
  1119. height: 22px;
  1120. font-size: 14px;
  1121. font-family: Proxima Nova;
  1122. font-weight: 400;
  1123. color: #ef1f1f;
  1124. line-height: 22px;
  1125. }
  1126. }
  1127. .my-address-content {
  1128. margin: 10px 0px;
  1129. p {
  1130. font-size: 16px;
  1131. font-family: Proxima Nova;
  1132. font-weight: 400;
  1133. color: #666666;
  1134. line-height: 30px;
  1135. }
  1136. }
  1137. .edit-btns {
  1138. display: flex;
  1139. justify-content: flex-end;
  1140. .el-button {
  1141. font-size: 16px;
  1142. font-family: Proxima Nova;
  1143. font-weight: 400;
  1144. color: #00213b;
  1145. border: 1px solid #00213b;
  1146. border-radius: 4px;
  1147. }
  1148. .el-button--mini {
  1149. padding: 3px 10px;
  1150. }
  1151. }
  1152. }
  1153. }
  1154. .location {
  1155. color: #004a97;
  1156. li {
  1157. cursor: pointer;
  1158. }
  1159. }
  1160. .center {
  1161. text-align: center;
  1162. }
  1163. }
  1164. }
  1165. :deep(.el-pagination.is-background) {
  1166. .el-pager {
  1167. li.number {
  1168. background-color: #f8f8f8;
  1169. border-radius: 50%;
  1170. color: #a7a7a7;
  1171. }
  1172. li:not(.disabled).active {
  1173. background-color: #00213b;
  1174. color: #d4d7da;
  1175. }
  1176. }
  1177. .btn-prev,
  1178. .btn-next {
  1179. border-radius: 50%;
  1180. background-color: #fff;
  1181. .el-icon-arrow-left:before {
  1182. content: '';
  1183. }
  1184. .el-icon-arrow-right:before {
  1185. content: '';
  1186. }
  1187. }
  1188. }
  1189. </style>