Quote.vue 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490
  1. <template>
  2. <div>
  3. <div
  4. v-if="quoteLoadState == 0"
  5. v-loading="true"
  6. class="com-loading"></div>
  7. <div v-else-if="quoteLoadState == 1">
  8. <tab-nav
  9. :borderType="'allBorder'"
  10. :liWidth="100"
  11. :liHeight="40"
  12. :marginRight="5"
  13. :currTab.sync="curWeek"
  14. :tabList="priceList" />
  15. <div
  16. v-for="(items, indexs) in priceList"
  17. :key="items.name"
  18. v-show="curWeek == indexs">
  19. <div>
  20. <tab-nav
  21. :borderType="'incompleteBorder'"
  22. :currTab.sync="items.curPrint"
  23. :tabList="items.basePrice"
  24. :allPrintTab="allPrintTab"
  25. :marginTop="0"
  26. :marginRight="5"
  27. :marginBottom="items.basePrice?.length > 1 ? 7 : 0"
  28. @handle="sortBy(items)" />
  29. <!-- <el-popover
  30. placement="bottom-start"
  31. trigger="hover">
  32. <div
  33. class="exclamation-icon"
  34. slot="reference">!</div>
  35. <div class="popover">
  36. <p class="title">Print Price Comparison</p>
  37. <div
  38. v-for="(item,index) in items.basePrice"
  39. :key="item.name">
  40. <total-table
  41. :tableColumns="[...undecorated_columns, ...items.part_columns]"
  42. :tableData="item.data"
  43. :tableType="'Comparison'"
  44. :title="item.name"
  45. :curDecoration="items.decorationOrign[items.curPrint]" :indexDecoration="items.decorationOrign[index]"></total-table>
  46. </div>
  47. </div>
  48. </el-popover> -->
  49. </div>
  50. <div
  51. v-for="(item, index) in items.basePrice"
  52. :key="item.name"
  53. v-show="items.curPrint == index">
  54. <new-price-table
  55. :tableColumns="[...undecorated_columns, ...item.part_columns]"
  56. :tableData="item.data"
  57. :tableType="'Undecorated'"
  58. :curPrint="item.name"
  59. :curModel="items.decorationOrign[index]?.model"
  60. :data="items"
  61. :selectRow.sync="item.selectBaseRow"></new-price-table>
  62. </div>
  63. <!-- decoration_multiple is_more_print 打印开关,ID1001092需求 ;additional_print 颜色数量开关
  64. 以上需求作废,改版为多色多面的需求-->
  65. <new-price-table
  66. v-if="
  67. items.decoration?.length ||
  68. items.basePrice?.[items.curPrint]?.decoration_addition?.length
  69. "
  70. :tableData="items.decoration"
  71. :tableColumns="[...decoration_columns, ...comCurBaseColumns]"
  72. :tableType="'Decoration'"
  73. :marginBottom="0"
  74. :hasDecAdd="
  75. items.basePrice?.[items.curPrint]?.decoration_addition?.length
  76. "></new-price-table>
  77. <div
  78. v-for="(item, index) in items.basePrice"
  79. :key="item.name + index"
  80. v-show="items.curPrint == index && item.decoration_addition.length">
  81. <new-price-table
  82. :tableData="item.decoration_addition"
  83. :tableColumns="[...addon_columns, ...item.part_columns]"
  84. :isCheckBox="true"
  85. :tableType="'Addon'"
  86. :multipleSelection.sync="items.selectAdditionRow"></new-price-table>
  87. </div>
  88. </div>
  89. <!-- <section>
  90. <p class="title1">
  91. <span></span>
  92. <span>Currency GBP(£)</span>
  93. </p>
  94. <total-table
  95. :comLocationNum="comLocationNum"
  96. :tableData="comBuyData"
  97. :tableColumns="[
  98. ...buy_columns,
  99. ...comCurBaseTotalColumns
  100. ]"
  101. :curOrder="`${curWeek}-${comCurPrint}`"
  102. :min="comCurBaseColumns[0]?.label"
  103. :title="'Buy Price'" @send-idx="getChildIdx"></total-table>
  104. <p class="text-red">Price is ex- gst</p>
  105. <ul>
  106. <li class="entry">
  107. <div class="entry-l">Delivery Locations</div>
  108. <el-input
  109. placeholder="Enter Num"
  110. v-model="comCurBasePrice.locationNum"
  111. size="small" max="7" min="1"
  112. style="width: 130px;"
  113. type="number" @input="setMaxNum"></el-input>
  114. </li>
  115. <li
  116. class="entry"
  117. v-if="comLocationNum > 1">
  118. <div class="entry-text">Qty / Location</div>
  119. </li>
  120. <li class="entry" v-for="(i,k) in comCurBaseTotalColumns" :key="i.prop" v-show="comLocationNum > k">
  121. <div class="entry-l">Delivery Postcode</div>
  122. <el-input
  123. clearable
  124. placeholder="Enter Postcode"
  125. v-model="
  126. i.postcode"
  127. size="small"
  128. style="width: 130px; margin-right: 20px;"
  129. @input="getDebFreight(k)"></el-input>
  130. <el-input
  131. v-if="comLocationNum > 1"
  132. placeholder="Enter Qty"
  133. type="number"
  134. :min="comCurBaseColumns[0]?.label"
  135. @blur="getNumber($event, comCurBaseTotalColumns[k],comCurBaseColumns[0]?.label)"
  136. v-model="i.label"
  137. size="small"
  138. style="width: 130px; margin-right: 20px;"></el-input>
  139. <div class="entry-r">
  140. <span>Freight Method</span>
  141. <el-radio-group
  142. v-model="i.freight_type"
  143. @change="getFreight(k)">
  144. <el-radio :label="1">Road Express</el-radio>
  145. <el-radio :label="2">Air Freight</el-radio>
  146. </el-radio-group>
  147. </div>
  148. </li>
  149. </ul>
  150. <div class="entry">
  151. <div class="entry-l">Setup</div>
  152. <div class="entry-l">include in unit price</div>
  153. <pc-switch v-model="setup_switch"></pc-switch>
  154. </div>
  155. <div class="entry">
  156. <div class="entry-l">Freight</div>
  157. <div class="entry-l">include in unit price</div>
  158. <div>
  159. <pc-switch v-model="freight_switch"></pc-switch>
  160. </div>
  161. </div>
  162. </section> -->
  163. <el-button
  164. size="medium"
  165. class="button-black"
  166. @click="openMailDialog">
  167. Enquiry
  168. </el-button>
  169. <!-- <section>
  170. <unit-table
  171. :tableData="unitData"
  172. :tableColumns="[
  173. ...unit_columns,
  174. ...comCurBaseTotalColumns
  175. ]"></unit-table>
  176. 直接用comMergeColumns会出现summary数值问题,改用v-show="comLocationNum"控制
  177. <total-table
  178. v-show="comLocationNum == 1"
  179. :tableData="comSellData"
  180. :tableColumns="comNoSumCol"
  181. :comLocationNum="comLocationNum"
  182. :title="'Sell Price'"></total-table>
  183. <total-table
  184. v-show="comLocationNum != 1"
  185. :tableData="comSellData"
  186. :tableColumns="comHasSumCol"
  187. :comLocationNum="comLocationNum"
  188. :title="'Sell Price'"></total-table>
  189. <el-button
  190. class="button-black button-margin"
  191. size="medium"
  192. @click="openDownloadDialog(0)"
  193. >View Quote</el-button>
  194. <el-button
  195. class="button-black button-margin"
  196. size="medium"
  197. @click="openDownloadDialog(1)"
  198. >Send Order Enquiry</el-button>
  199. </section> -->
  200. </div>
  201. <div
  202. v-else
  203. class="quote-tips">
  204. Current item prices are missing, please contact<a
  205. href="mailto:Info@promocollection.uk">
  206. info@promocollection.uk</a
  207. >
  208. </div>
  209. <no-ssr>
  210. <div v-if="quoteLoadState == 1">
  211. <!-- Enquiry按钮 -->
  212. <form-dialog
  213. :emailForm="enquiryForm"
  214. :enquiryConfig="enquiryConfig"
  215. :visible.sync="enquiryFormVisible"
  216. @handleSend="sendPriceMail"
  217. :rules="rules"
  218. :labelWidth="
  219. enquiryConfig[3].selectlist?.length ? 140 : 82
  220. "></form-dialog>
  221. <mail-table
  222. ref="mailtable"
  223. :mailData="mailData"
  224. v-show="false">
  225. <price-to-img
  226. :pageData="pageData"
  227. :specificationsObj="specificationsObj"
  228. :tableData="comFilterSwitchSellData"
  229. :tableColumns="comMergeColumns"
  230. :comLocationNum="comLocationNum"
  231. :emailForm="commentObj"></price-to-img>
  232. </mail-table>
  233. <el-dialog
  234. ref="dialogRef"
  235. :lock-scroll="false"
  236. title="Customer Quote"
  237. :visible.sync="priceToImgVisible"
  238. custom-class="price-to-img-dialog">
  239. <price-to-img
  240. :isImgSrc="false"
  241. ref="priceToImgRef"
  242. :loading.sync="pdfLoading"
  243. :pageData="pageData"
  244. :specificationsObj="specificationsObj"
  245. :tableData="comFilterSwitchSellData"
  246. :tableColumns="comMergeColumns"
  247. :comLocationNum="comLocationNum"
  248. :emailForm="commentObj"></price-to-img>
  249. <p class="tips">Change default standard comment:</p>
  250. <el-input v-model="commentObj.Comments"></el-input>
  251. <div class="btn-wrap">
  252. <el-button
  253. class="button-black button-margin"
  254. size="medium"
  255. @click="handleDownloadPdf"
  256. :loading="pdfLoading"
  257. >Download</el-button
  258. >
  259. </div>
  260. </el-dialog>
  261. <!-- <form-dialog
  262. :emailForm="commentObj"
  263. :enquiryConfig="enquiryConfig1"
  264. :visible.sync="downloadDialogVisible"
  265. @handleSend="sendPdfMail"
  266. :rules="rules1"
  267. :labelWidth="120"
  268. :isSendPdf="true"></form-dialog> -->
  269. <price-to-img
  270. ref="pdf"
  271. v-show="false"
  272. :loading.sync="pdfLoading"
  273. :pageData="pageData"
  274. :specificationsObj="specificationsObj"
  275. :tableData="comFilterSwitchSellData"
  276. :tableColumns="comMergeColumns"
  277. :comLocationNum="comLocationNum"
  278. :emailForm="commentObj"></price-to-img>
  279. <!-- 报价图片弹框 -->
  280. <dialog-XX-success
  281. :visible.sync="xxContentVisible"
  282. :imgType="false"
  283. :content="'This quantity is below the MOQ for this product'"></dialog-XX-success>
  284. </div>
  285. </no-ssr>
  286. </div>
  287. </template>
  288. <script>
  289. import { mapState, mapMutations, mapActions } from 'vuex'
  290. import _ from 'lodash'
  291. import {
  292. times as npTimes,
  293. plus as npPlus,
  294. minus as npMinus,
  295. divide as npDivide,
  296. } from 'number-precision'
  297. import NewPriceTable from '@/components/table/NewPriceTable'
  298. import TotalTable from '@/components/table/TotalTable'
  299. import UnitTable from '@/components/table/UnitTable'
  300. import MailTable from '@/components/table/MailTable'
  301. import dialogXXSuccess from '@/components/DIalogXXSuccess.vue'
  302. export default {
  303. components: {
  304. NewPriceTable,
  305. TotalTable,
  306. UnitTable,
  307. MailTable,
  308. 'dialog-XX-success': dialogXXSuccess,
  309. },
  310. props: {
  311. pageData: {
  312. type: Object,
  313. default: () => {
  314. return {}
  315. },
  316. },
  317. id: {
  318. type: Number,
  319. default: null,
  320. },
  321. },
  322. data() {
  323. return {
  324. quoteLoadState: 0,
  325. curWeek: 0,
  326. allPrintTab: [],
  327. priceList: [],
  328. initZeroObj: {},
  329. initSetupObj: {},
  330. initUnitObj: {},
  331. initChangeUnitObj: {},
  332. initFrightObj: {},
  333. initTotalObj: {},
  334. xxContentVisible: false,
  335. setup_switch: false,
  336. freight_switch: false,
  337. weight: {},
  338. undecorated_columns: [
  339. {
  340. label: 'MODEL',
  341. prop: 'model',
  342. type: 'text',
  343. align: 'left',
  344. width: 150,
  345. extraWidth: 50, // 配合组件 (820-tableColumns[0].width-tableColumns[0].extraWidth)/(tableColumns.length-1)
  346. isFirstColumn: true, // 去掉$符号
  347. },
  348. {
  349. label: 'SETUP',
  350. prop: 'website_setup',
  351. },
  352. ],
  353. decoration_columns: [
  354. {
  355. label: 'PRINT OPTION',
  356. prop: 'dec_code',
  357. type: 'radioInput',
  358. align: 'left',
  359. width: 150,
  360. extraWidth: 50,
  361. },
  362. {
  363. label: 'SETUP',
  364. prop: 'website_setup',
  365. },
  366. ],
  367. addon_columns: [
  368. {
  369. label: 'Addon',
  370. prop: 'name',
  371. type: 'text',
  372. width: 150,
  373. extraWidth: 50,
  374. isFirstColumn: true, // 去掉$符号
  375. },
  376. {
  377. label: 'Setup',
  378. prop: 'website_setup',
  379. },
  380. ],
  381. buy_columns: [
  382. {
  383. label: 'QTY',
  384. prop: 'project',
  385. isFirstColumn: true, // 去掉$符号
  386. },
  387. ],
  388. unit_columns: [
  389. {
  390. label: 'QTY',
  391. prop: 'total',
  392. align: 'left',
  393. isText: true,
  394. },
  395. ],
  396. buyData: [
  397. { project: 'Setup' },
  398. { project: 'Unit' },
  399. { project: 'Freight' },
  400. { project: 'Total' },
  401. ],
  402. unitData: [
  403. { total: 'Unit Rate %' },
  404. { total: 'Setup %' },
  405. { total: 'Freight %' },
  406. ],
  407. sellData: [
  408. { project: 'Postcode', summary: '-' },
  409. { project: 'Setup', summary: 0.0 },
  410. { project: 'Unit', summary: 0.0 },
  411. { project: 'Freight', summary: 0.0 },
  412. { project: 'Total', summary: 0.0 },
  413. ],
  414. POA_Config: ['111', '111.00', '999', '999.00'],
  415. enquiryFormVisible: false,
  416. enquiryForm: {
  417. Name: '',
  418. Email: '',
  419. Phone: '',
  420. 'Customer manager': null,
  421. Comments: '',
  422. },
  423. enquiryConfig: [
  424. { prop: 'Name', type: 'input' },
  425. { prop: 'Email', type: 'input' },
  426. { prop: 'Phone', type: 'input' },
  427. {
  428. prop: 'Customer manager',
  429. type: 'select',
  430. selectlist: [],
  431. isShow: true,
  432. },
  433. { prop: 'Comments', type: 'textarea' },
  434. ],
  435. rules: {
  436. Name: [{ required: true, message: 'Please enter', trigger: 'blur' }],
  437. Email: [
  438. {
  439. required: true,
  440. message: 'Please enter the correct format',
  441. pattern:
  442. /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/,
  443. trigger: 'blur',
  444. },
  445. ],
  446. Phone: [
  447. {
  448. required: true,
  449. message: 'Please enter the correct format',
  450. // pattern: /^1[0-9]{10}$/,
  451. trigger: 'blur',
  452. },
  453. ],
  454. 'Customer manager': [
  455. { required: true, message: 'Please select', trigger: 'change' },
  456. ],
  457. },
  458. mailData: {
  459. Url: '',
  460. },
  461. priceToImgVisible: false,
  462. downloadDialogVisible: false,
  463. commentObj: {
  464. 'Email Address': '',
  465. Comments: '',
  466. },
  467. enquiryConfig1: [
  468. { prop: 'Email Address', type: 'input' },
  469. { prop: 'Comments', type: 'input' },
  470. ],
  471. rules1: {
  472. 'Email Address': [
  473. {
  474. required: true,
  475. message: 'Please enter the correct format',
  476. pattern:
  477. /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/,
  478. trigger: 'blur',
  479. },
  480. ],
  481. },
  482. specificationsObj: {
  483. time: null,
  484. model: null,
  485. decoration: null,
  486. addonArr: null,
  487. },
  488. pdfLoading: false,
  489. }
  490. },
  491. computed: {
  492. ...mapState('config', { configInfo: state => state.configInfo }),
  493. userInfo() {
  494. return this.$store.state.userInfo
  495. },
  496. comCurWeekPrice() {
  497. return this.priceList[this.curWeek] || {}
  498. },
  499. comCurPrint() {
  500. return this.comCurWeekPrice.curPrint
  501. },
  502. comCurBasePrice() {
  503. return this.comCurWeekPrice.basePrice[this.comCurPrint]
  504. },
  505. comLocationNum() {
  506. return +this.comCurWeekPrice.basePrice[this.comCurPrint].locationNum
  507. },
  508. comCurBaseColumns() {
  509. return this.comCurBasePrice.part_columns
  510. },
  511. comCurBaseTotalColumns() {
  512. const d =
  513. this.comCurWeekPrice.basePrice[this.comCurPrint].total_part_columns
  514. const n = this.comLocationNum
  515. if (n === 1) {
  516. return d
  517. } else {
  518. const concatAdd = [
  519. ...d,
  520. ...this.comCurWeekPrice.basePrice[this.comCurPrint].remainingAttr,
  521. ].slice(0, n)
  522. return concatAdd
  523. }
  524. },
  525. comTotalLabel() {
  526. // 计算所有元素label的和
  527. return this.comCurBaseTotalColumns.reduce(
  528. (sum, item) => sum + Number(item.label),
  529. 0
  530. )
  531. },
  532. comSummaryColumns() {
  533. return [{ label: this.comTotalLabel.toString(), prop: 'summary' }]
  534. },
  535. comAttributeList() {
  536. const obj = {}
  537. this.comCurBaseTotalColumns?.forEach(item => {
  538. obj[item.prop] = item.label
  539. })
  540. obj.summary = this.comTotalLabel
  541. return obj
  542. },
  543. // 当前已选基础价
  544. comBasePrice() {
  545. return this.comCurBasePrice.selectBaseRow
  546. },
  547. // 当前累加打印价
  548. comDecoPrice() {
  549. if (!this.comCurWeekPrice.decoration?.length) {
  550. return []
  551. }
  552. const arr = this.comCurWeekPrice.decoration
  553. .map((item, idx) => {
  554. const obj = {}
  555. if (+item.num > 0) {
  556. for (const i in this.initUnitObj) {
  557. if (idx === 0) {
  558. // 首个打印价要取附加价计算
  559. const keyArr = i.split('_')
  560. const supplier_val = item[`supplier_${keyArr[1]}`]
  561. if (this.POA_Config.includes(supplier_val)) {
  562. obj[`${i}`] = supplier_val
  563. } else {
  564. obj[`${i}`] = npTimes(+supplier_val, item.num)
  565. }
  566. } else {
  567. obj[`${i}`] = this.POA_Config.includes(item[i])
  568. ? item[i]
  569. : npTimes(+item[i], item.num)
  570. }
  571. }
  572. }
  573. return obj
  574. })
  575. .filter(obj => Object.keys(obj).length !== 0)
  576. return arr
  577. },
  578. comBuyData() {
  579. this.calculateBuyData()
  580. return this.buyData
  581. },
  582. comNoSumCol() {
  583. return [...this.buy_columns, ...this.comCurBaseTotalColumns]
  584. },
  585. comHasSumCol() {
  586. return [
  587. ...this.buy_columns,
  588. ...this.comCurBaseTotalColumns,
  589. ...this.comSummaryColumns,
  590. ]
  591. },
  592. comMergeColumns() {
  593. return this.comLocationNum == 1 ? this.comNoSumCol : this.comHasSumCol
  594. },
  595. comSellData() {
  596. if (Object.keys(this.comAttributeList).length !== 0) {
  597. this.calculateSellData()
  598. }
  599. return this.sellData
  600. },
  601. comFilterSwitchSellData() {
  602. return this.comSellData?.filter((item, i) => {
  603. if (i === 1 && this.setup_switch) {
  604. return false
  605. } else if (i === 3 && this.freight_switch) {
  606. return false
  607. } else {
  608. return item
  609. }
  610. })
  611. },
  612. },
  613. methods: {
  614. ...mapActions(['getUserInfo']),
  615. getQuote() {
  616. this.$axios
  617. .post('/uk-api/quote/pricequote', { id: this.id })
  618. .then(res => {
  619. if (localStorage.getItem('unit')) {
  620. this.unitData = JSON.parse(localStorage.getItem('unit'))
  621. }
  622. const { attributeList, priceList, default: defaultID } = res.result
  623. if (
  624. !Object.keys(attributeList).length ||
  625. !Object.keys(priceList).length
  626. ) {
  627. this.quoteLoadState = 2
  628. return
  629. }
  630. for (const a in attributeList) {
  631. // 过滤掉website_qty标签无数量
  632. if (attributeList[a]) {
  633. this.initZeroObj[a] = 0
  634. } else {
  635. delete attributeList[a]
  636. }
  637. for (const unit of this.unitData) {
  638. // 如果对象中缺少 attributeList 的 key,则设置为 40
  639. if (!(a in unit) || unit[a] === '') {
  640. this.$set(unit, a, 40)
  641. }
  642. }
  643. }
  644. // 格式化数据,对象改成数组
  645. for (const keys in priceList) {
  646. const vals = {}
  647. const { decoration, additionlist, ...remaining } = priceList[keys]
  648. vals.basePrice = []
  649. vals.selectAdditionRow = []
  650. vals.curPrint = 0
  651. vals.name = this.formatDurationString(keys)
  652. vals.nameOrigin = keys
  653. vals.decorationOrign = [...decoration]
  654. vals.decorationID = decoration.map(i => i.id)
  655. vals.decoration = [...decoration].flatMap(item => {
  656. const result = []
  657. if (item.max_color > 0) {
  658. result.push({
  659. ...item,
  660. max_num: item.max_color,
  661. id: `${item.id}-1`,
  662. decName: item.max_color_name,
  663. })
  664. }
  665. if (item.max_point > 0) {
  666. result.push({
  667. ...item,
  668. max_num: item.max_point,
  669. id: `${item.id}-2`,
  670. decName: item.max_point_name,
  671. })
  672. }
  673. return result
  674. })
  675. vals.additionlist = additionlist
  676. for (const k in remaining) {
  677. const o = {}
  678. o.attributeList = this.copyData(attributeList)
  679. if (remaining[k]?.length > 1) {
  680. // 检查数组中各元素的 website_qtyN 是否都等于 "-" or "POA",则删除key
  681. for (const a in attributeList) {
  682. const is111Poa = remaining[k].every(item =>
  683. this.POA_Config.includes(item[a])
  684. )
  685. if (is111Poa) {
  686. delete o.attributeList[a]
  687. }
  688. }
  689. } else if (remaining[k]?.length === 1) {
  690. // 判断 remaining[k][0] 中是否包含 vals.attributeList 的键,并且对应的值都等于 "-" or "POA",则不删除key
  691. const obj = remaining[k][0]
  692. const attributeKeys = Object.keys(o.attributeList)
  693. const areAllKeysInPOAConfig = attributeKeys.every(key => {
  694. return (
  695. Object.prototype.hasOwnProperty.call(obj, key) &&
  696. this.POA_Config.includes(obj[key])
  697. )
  698. })
  699. if (!areAllKeysInPOAConfig) {
  700. attributeKeys.forEach(key => {
  701. if (
  702. Object.prototype.hasOwnProperty.call(obj, key) &&
  703. this.POA_Config.includes(obj[key])
  704. ) {
  705. delete o.attributeList[key]
  706. }
  707. })
  708. }
  709. }
  710. o.name = k
  711. o.data = remaining[k]
  712. o.locationNum = 1
  713. o.part_columns = Object.keys(o.attributeList).map(e => {
  714. return { label: o.attributeList[e].toString(), prop: e }
  715. })
  716. const freightParam = {
  717. postcode: '',
  718. freight_type: 1,
  719. freight: {},
  720. }
  721. o.total_part_columns = this.copyData(o.part_columns).map(obj => ({
  722. ...obj,
  723. ...freightParam,
  724. }))
  725. o.remainingAttr = []
  726. const firstColumns = { ...o.part_columns[0], ...freightParam }
  727. for (let i = 1; i < 9; i++) {
  728. if (!Object.keys(o.attributeList).includes(`website_qty${i}`)) {
  729. const newColumn = { ...firstColumns }
  730. this.$set(newColumn, 'prop', `website_qty${i}`)
  731. o.remainingAttr.push(newColumn)
  732. }
  733. }
  734. vals.basePrice.push(o)
  735. if (!this.allPrintTab.includes(k)) {
  736. this.allPrintTab.push(k)
  737. }
  738. }
  739. this.priceList.push(vals)
  740. }
  741. this.priceList.forEach((options, index) => {
  742. // 原始数据name没空格,需要映射到
  743. if (options.nameOrigin === defaultID?.name) {
  744. this.curWeek = index
  745. options.decorationOrign.forEach((opt, idx) => {
  746. if (opt.id === defaultID?.decoration?.id) {
  747. this.$set(options, 'curPrint', idx)
  748. }
  749. })
  750. }
  751. // 所有周期的所有打印,进来页面时默认勾选第一条价格
  752. options.basePrice.forEach((opt, idx) => {
  753. this.$set(opt, 'selectBaseRow', opt.data[0] || {})
  754. opt.decoration_addition = [
  755. ...(options.decorationOrign?.[idx]?.decoration_addition || []),
  756. ...(options.additionlist || []),
  757. ]
  758. })
  759. options.decoration.forEach(opt => {
  760. this.$set(opt, 'num', 0)
  761. })
  762. })
  763. this.initSetupObj = Object.assign({}, this.initZeroObj)
  764. this.initUnitObj = Object.assign({}, this.initZeroObj, {
  765. website_setup: 0,
  766. })
  767. this.initFrightObj = Object.assign({}, this.initZeroObj)
  768. this.buyData = this.buyData.map(item => {
  769. return { ...item, ...this.initSetupObj }
  770. })
  771. this.sellData = this.sellData.map(item => {
  772. return { ...item, ...this.initSetupObj }
  773. })
  774. this.quoteLoadState = 1
  775. })
  776. .catch(e => {
  777. console.log('this.quoteLoadState1: ', e)
  778. this.quoteLoadState = 2
  779. })
  780. },
  781. formatDurationString(input) {
  782. // 匹配数字和字符串的正则表达式
  783. const regex = /(\d+)([a-zA-Z]+)/g
  784. const result = input.replace(regex, '$1 $2')
  785. return result
  786. },
  787. // getWeight() {
  788. // this.$axios
  789. // .post('/api/quote/weight', { id: this.id })
  790. // .then(res => {
  791. // this.weight = res.result
  792. // })
  793. // .catch(() => {})
  794. // },
  795. // getFreight(k) {
  796. // const postcode = this.comCurBaseTotalColumns[k].postcode
  797. // const type = this.comCurBaseTotalColumns[k].freight_type
  798. // const init = { basic:0,pickup:0,minimum:0 }
  799. // if (postcode.length < 3) {
  800. // this.comCurBaseTotalColumns[k].freight = init
  801. // return
  802. // }
  803. // this.$axios
  804. // .post('/api/quote/freight', {
  805. // postcode,
  806. // type
  807. // })
  808. // .then(res => {
  809. // this.comCurBaseTotalColumns[k].freight = Array.isArray(res.result)?init:res.result
  810. // })
  811. // },
  812. getDebFreight: _.debounce(function (k) {
  813. this.getFreight(k)
  814. }, 200),
  815. getNumber(e, row, min) {
  816. if (parseInt(e.target.value) < min) {
  817. this.xxContentVisible = true
  818. row.label = min
  819. } else {
  820. this.xxContentVisible = false
  821. }
  822. },
  823. sortBy(items) {
  824. // items.decoration.sort(this.customSort(items.decorationID))
  825. // const targetElement = items.decoration.splice(items.curPrint, 1)[0]
  826. // items.decoration.unshift(targetElement)
  827. },
  828. // 按原打印数组的id字段排序
  829. customSort(decorationID) {
  830. return (a, b) => {
  831. return decorationID.indexOf(a.id) - decorationID.indexOf(b.id)
  832. }
  833. },
  834. dividePrice(a) {
  835. return npDivide(+a, 100)
  836. },
  837. openMailDialog() {
  838. if (this.$utils.checkLogin()) {
  839. this.getUserInfo()
  840. const {
  841. contacts,
  842. email,
  843. phone,
  844. crm_users_id: crmUsersId,
  845. } = this.userInfo
  846. this.enquiryForm.Name = contacts
  847. this.enquiryForm.Email = email
  848. this.enquiryForm.Phone = phone
  849. if (crmUsersId?.length) {
  850. this.enquiryConfig[3].selectlist = crmUsersId
  851. if (crmUsersId?.length === 1) {
  852. this.enquiryForm['Customer manager'] = crmUsersId[0].name
  853. }
  854. } else {
  855. this.enquiryConfig[3].isShow = false
  856. this.$delete(this.enquiryForm, 'Customer manager')
  857. }
  858. this.enquiryFormVisible = true
  859. } else {
  860. this.openDialog()
  861. }
  862. },
  863. getMailData() {
  864. this.mailData.Url = window.location.href
  865. const { Name, Email, Phone, Comments } = this.enquiryForm
  866. this.mailData['Customer Name'] = Name
  867. this.mailData['Customer Email'] = Email
  868. this.mailData['Customer Phone'] = Phone
  869. this.mailData.Comments = Comments
  870. const { email, level, createTime } = this.userInfo
  871. this.mailData['Member Account'] = email
  872. this.mailData['Member Grade'] = level.name
  873. this.mailData['Member Registration time'] = createTime
  874. this.mailData['Quote time'] = this.$utils.formatTime(new Date())
  875. },
  876. // 发送价格邮件 Enquiry按钮
  877. async sendPriceMail() {
  878. await this.getMailData()
  879. await this.getCustomerQuoteData()
  880. const {
  881. Name,
  882. Email,
  883. Phone,
  884. Comments,
  885. 'Customer manager': customerManager,
  886. } = this.enquiryForm
  887. this.$axios
  888. .post('/uk-api/quote/sendenquiry', {
  889. content: this.$refs.mailtable.$el.innerHTML,
  890. name: Name,
  891. email: Email,
  892. phone: Phone,
  893. customer_manager: customerManager || '',
  894. url: this.mailData.Url,
  895. product_code: this.pageData.product_code,
  896. comments: Comments,
  897. member_id: this.userInfo.id,
  898. })
  899. .then(res => {
  900. this.setLoading(false)
  901. this.enquiryFormVisible = false
  902. this.$confirm('Enquiry Sent', {
  903. confirmButtonText: 'OK',
  904. showCancelButton: false,
  905. type: 'success',
  906. center: true,
  907. showClose: false,
  908. confirmButtonClass: 'com-btnblack',
  909. }).then(() => {})
  910. })
  911. .catch(() => {
  912. this.setLoading(false)
  913. })
  914. },
  915. getCustomerQuoteData() {
  916. const { name, selectAdditionRow } = this.comCurWeekPrice
  917. this.specificationsObj.time = name
  918. this.specificationsObj.model = this.comBasePrice.model
  919. this.specificationsObj.decoration = this.comCurBasePrice.name
  920. if (selectAdditionRow.length) {
  921. this.specificationsObj.addonArr = selectAdditionRow.map(
  922. item => item.name
  923. )
  924. } else {
  925. this.specificationsObj.addonArr = null
  926. }
  927. },
  928. // openDownloadDialog(type) {
  929. // this.getCustomerQuoteData()
  930. // type
  931. // ? (this.downloadDialogVisible = true)
  932. // : (this.priceToImgVisible = true)
  933. // },
  934. handleDownloadPdf() {
  935. this.pdfLoading = true
  936. this.$nextTick(() => {
  937. this.$refs.priceToImgRef.htmlToPdf(this.pageData.product_code)
  938. })
  939. },
  940. // 发送PDF邮件
  941. // sendPdfMail() {
  942. // this.$axios
  943. // .post('/api/quote/sendpdf', {
  944. // content: this.$refs.pdf.$el.innerHTML,
  945. // product_code: this.pageData.product_code,
  946. // email: this.commentObj['Email Address'],
  947. // })
  948. // .then(res => {
  949. // this.setLoading(false)
  950. // this.downloadDialogVisible = false
  951. // this.$confirm('Enquiry Sent', {
  952. // confirmButtonText: 'OK',
  953. // showCancelButton: false,
  954. // type: 'success',
  955. // center: true,
  956. // showClose: false,
  957. // confirmButtonClass: 'com-btnblack',
  958. // })
  959. // })
  960. // .catch(() => {
  961. // this.setLoading(false)
  962. // })
  963. // },
  964. copyData(data) {
  965. return JSON.parse(JSON.stringify(data))
  966. },
  967. calculateBuyData() {
  968. const selPriceArr = []
  969. if (JSON.stringify(this.comBasePrice) !== '{}') {
  970. selPriceArr.push(this.comBasePrice)
  971. }
  972. selPriceArr.push(
  973. ...this.comDecoPrice,
  974. ...this.comCurWeekPrice.selectAdditionRow
  975. )
  976. if (selPriceArr.length === 0) {
  977. this.buyData = this.buyData.map(item => ({
  978. ...item,
  979. ...this.initZeroObj,
  980. }))
  981. return
  982. }
  983. // 累加所选,初始数量对应的单价。赋值给this.initUnitObj
  984. for (const i in this.initUnitObj) {
  985. const columnSum = this.copyData(selPriceArr).reduce(function (
  986. prev,
  987. cur
  988. ) {
  989. if (cur[i] === '111' || cur[i] === '111.00') {
  990. return (cur[i] = '-')
  991. } else if (cur[i] === '999' || cur[i] === '999.00') {
  992. return (cur[i] = 'POA')
  993. } else {
  994. // 当基础价格是-POA,后续累加价格是正常数字价,依然返回-POA
  995. if (prev === '-' || prev === 'POA') {
  996. return prev
  997. }
  998. return npPlus(+cur[i], prev).toFixed(2)
  999. }
  1000. },
  1001. 0)
  1002. this.$set(this.initUnitObj, i, columnSum)
  1003. }
  1004. for (const a in this.comAttributeList) {
  1005. // 每次更改选择价格,必须遍历整个comAttributeList
  1006. const tempIdx = this.comCurBaseColumns.findIndex(
  1007. items => +this.comAttributeList[a] < +items.label
  1008. )
  1009. if (tempIdx > 0) {
  1010. const key = this.comCurBaseColumns[tempIdx - 1].prop
  1011. this.$set(this.initChangeUnitObj, a, this.initUnitObj[key])
  1012. } else {
  1013. const length = this.comCurBaseColumns.length
  1014. const key = this.comCurBaseColumns[length - 1].prop
  1015. this.$set(this.initChangeUnitObj, a, this.initUnitObj[key])
  1016. }
  1017. if (
  1018. this.initChangeUnitObj[a] === 'POA' ||
  1019. this.initChangeUnitObj[a] === '-'
  1020. ) {
  1021. this.$set(this.initSetupObj, a, this.initChangeUnitObj[a])
  1022. this.$set(this.initFrightObj, a, this.initChangeUnitObj[a])
  1023. } else {
  1024. this.$set(this.initSetupObj, a, this.initUnitObj.website_setup)
  1025. // 计算运费
  1026. // 单独批次数量的总重
  1027. // weight定义是{},后端没数据传回[]
  1028. const unitWLocal = this.weight.unit_w_local
  1029. ? +this.weight.unit_w_local
  1030. : 0
  1031. const totalWeight = Math.ceil(
  1032. npTimes(unitWLocal, this.comAttributeList[a])
  1033. )
  1034. // Road express 1 AAE:AAEFactor 2
  1035. const setupFuel = this.dividePrice(this.configInfo.fuel)
  1036. const setupBagFreight = this.dividePrice(this.configInfo.bag_freight)
  1037. const setupExpressFreight = this.dividePrice(
  1038. this.configInfo.express_freight
  1039. )
  1040. const AAEFactor = npPlus(1, setupBagFreight, setupFuel)
  1041. const expressFactor = npPlus(1, setupExpressFreight, setupFuel)
  1042. let frightCost = 0
  1043. let freightType
  1044. let postcode
  1045. let freight = {}
  1046. const matchIndex = this.comCurBaseTotalColumns.findIndex(
  1047. item => item.prop === a
  1048. )
  1049. // 1,所有按第一个运费统计;不为1,则只计算 comCurBaseTotalColumns的[地址数]长度
  1050. if (
  1051. +this.comLocationNum === 1 ||
  1052. this.comLocationNum >= matchIndex + 1
  1053. ) {
  1054. ;({
  1055. freight,
  1056. freight_type: freightType,
  1057. postcode,
  1058. } = this.comCurBaseTotalColumns[
  1059. +this.comLocationNum === 1 ? 0 : matchIndex
  1060. ] || {})
  1061. }
  1062. if (freightType === 1 && postcode >= 3) {
  1063. if (totalWeight > 20) {
  1064. const a1 = npMinus(totalWeight, 20)
  1065. const a2 = npTimes(a1, +freight.basic)
  1066. const a3 = npPlus(+freight.pickup, a2)
  1067. frightCost = npTimes(a3, expressFactor)
  1068. } else {
  1069. frightCost = npTimes(+freight.pickup, expressFactor)
  1070. }
  1071. } else if (freightType === 2 && postcode >= 3) {
  1072. const a1 = npDivide(totalWeight, 5)
  1073. const a2 = npTimes(+freight.minimum, Math.ceil(a1))
  1074. frightCost = npTimes(a2, AAEFactor)
  1075. } else {
  1076. frightCost = 0
  1077. }
  1078. this.$set(this.initFrightObj, a, Math.ceil(frightCost).toFixed(2))
  1079. }
  1080. if (
  1081. this.initChangeUnitObj[a] === '-' ||
  1082. this.initChangeUnitObj[a] === 'POA'
  1083. ) {
  1084. this.$set(this.initTotalObj, a, this.initChangeUnitObj[a])
  1085. } else {
  1086. const unitQTY = npTimes(
  1087. this.initChangeUnitObj[a],
  1088. this.comAttributeList[a]
  1089. )
  1090. this.$set(
  1091. this.initTotalObj,
  1092. a,
  1093. npPlus(
  1094. this.initUnitObj.website_setup,
  1095. unitQTY,
  1096. this.initFrightObj[a]
  1097. ).toFixed(2)
  1098. )
  1099. }
  1100. if (this.setup_switch) {
  1101. // 业务:Setup价格/对应数量后向上取整
  1102. if (
  1103. this.initChangeUnitObj[a] === '-' ||
  1104. this.initChangeUnitObj[a] === 'POA'
  1105. ) {
  1106. this.$set(this.initChangeUnitObj, a, this.initChangeUnitObj[a])
  1107. } else {
  1108. const num =
  1109. Math.ceil(
  1110. (this.initSetupObj[a] / this.comAttributeList[a]) * 100
  1111. ) / 100
  1112. this.$set(
  1113. this.initChangeUnitObj,
  1114. a,
  1115. npPlus(this.initChangeUnitObj[a], num).toFixed(2)
  1116. )
  1117. }
  1118. }
  1119. if (this.freight_switch) {
  1120. if (
  1121. this.initChangeUnitObj[a] === '-' ||
  1122. this.initChangeUnitObj[a] === 'POA'
  1123. ) {
  1124. this.$set(this.initChangeUnitObj, a, this.initChangeUnitObj[a])
  1125. } else {
  1126. const num =
  1127. Math.ceil(
  1128. (this.initFrightObj[a] / this.comAttributeList[a]) * 100
  1129. ) / 100
  1130. this.$set(
  1131. this.initChangeUnitObj,
  1132. a,
  1133. npPlus(this.initChangeUnitObj[a], num).toFixed(2)
  1134. )
  1135. }
  1136. }
  1137. }
  1138. if (this.setup_switch) {
  1139. this.$set(this.buyData, 0, {
  1140. ...this.buyData[0],
  1141. ...this.initZeroObj,
  1142. ...{ summary: 0.0 },
  1143. })
  1144. } else {
  1145. this.$set(this.buyData, 0, { ...this.buyData[0], ...this.initSetupObj })
  1146. }
  1147. this.$set(this.buyData, 1, {
  1148. ...this.buyData[1],
  1149. ...this.initChangeUnitObj,
  1150. })
  1151. if (this.freight_switch) {
  1152. this.$set(this.buyData, 2, { ...this.buyData[2], ...this.initZeroObj })
  1153. } else {
  1154. this.$set(this.buyData, 2, {
  1155. ...this.buyData[2],
  1156. ...this.initFrightObj,
  1157. })
  1158. }
  1159. this.$set(this.buyData, 3, { ...this.buyData[3], ...this.initTotalObj })
  1160. },
  1161. calculateSellData() {
  1162. // 放置comSellData计算和副作用的代码
  1163. const buySetup = this.comBuyData[0]
  1164. const buyUnit = this.comBuyData[1]
  1165. const buyFright = this.comBuyData[2]
  1166. let frightSummary = 0
  1167. for (const i in this.comAttributeList) {
  1168. if (buyUnit[i] === '-' || buyUnit[i] === 'POA') {
  1169. this.sellData[0][i] = '-'
  1170. this.sellData[1][i] = buyUnit[i]
  1171. this.sellData[2][i] = buyUnit[i]
  1172. this.sellData[3][i] = buyUnit[i]
  1173. this.sellData[4][i] = buyUnit[i]
  1174. } else {
  1175. const item =
  1176. this.comLocationNum === 1
  1177. ? this.comCurBaseTotalColumns[0]
  1178. : this.comCurBaseTotalColumns.find(element => element.prop === i)
  1179. this.sellData[0][i] =
  1180. item && item.postcode !== '' ? item.postcode : '-'
  1181. // 分别乘以Markup %表格
  1182. const key = this.comCurBaseTotalColumns[0]?.prop
  1183. if (this.unitData[1] && this.unitData[1][key]) {
  1184. const a = npPlus(this.unitData[1][key] / 100, 1)
  1185. this.sellData[1][i] = npTimes(buySetup[i], a).toFixed(2)
  1186. } else {
  1187. this.sellData[1][i] = buySetup[i]
  1188. }
  1189. if (this.unitData[0][i]) {
  1190. const a = npPlus(this.unitData[0][i] / 100, 1)
  1191. this.sellData[2][i] = npTimes(buyUnit[i], a).toFixed(2)
  1192. } else {
  1193. this.sellData[2][i] = buyUnit[i]
  1194. }
  1195. if (this.unitData[2] && this.unitData[2][key]) {
  1196. const a = npPlus(this.unitData[2][key] / 100, 1)
  1197. this.sellData[3][i] = npTimes(buyFright[i], a).toFixed(2)
  1198. // freight_switch会使qty的运费=0无法计算,故用了initFrightObj
  1199. const fa = npTimes(this.initFrightObj[i], a)
  1200. frightSummary = npPlus(frightSummary, fa).toFixed(2)
  1201. } else {
  1202. this.sellData[3][i] = buyFright[i]
  1203. frightSummary = npPlus(
  1204. frightSummary,
  1205. this.initFrightObj[i]
  1206. ).toFixed(2)
  1207. }
  1208. const unitQTY = npTimes(this.sellData[2][i], this.comAttributeList[i])
  1209. this.$set(
  1210. this.sellData[4],
  1211. i,
  1212. npPlus(this.sellData[1][i], unitQTY, this.sellData[3][i]).toFixed(2)
  1213. )
  1214. }
  1215. }
  1216. // 迭代加了Total列,需要统计qty的运费后才能合计运费
  1217. if (
  1218. this.sellData[2].summary !== '-' &&
  1219. this.sellData[2].summary !== 'POA'
  1220. ) {
  1221. if (this.freight_switch) {
  1222. const num =
  1223. Math.ceil((frightSummary / this.comAttributeList.summary) * 100) /
  1224. 100
  1225. this.sellData[2].summary = npPlus(
  1226. this.sellData[2].summary,
  1227. num
  1228. ).toFixed(2)
  1229. this.sellData[3].summary = 0.0
  1230. const a = npTimes(
  1231. this.sellData[2].summary,
  1232. this.comAttributeList.summary
  1233. )
  1234. this.sellData[4].summary = npPlus(
  1235. this.sellData[1].summary,
  1236. a
  1237. ).toFixed(2)
  1238. } else {
  1239. this.sellData[3].summary = frightSummary
  1240. this.sellData[4].summary = npPlus(
  1241. frightSummary,
  1242. this.sellData[4].summary
  1243. ).toFixed(2)
  1244. }
  1245. }
  1246. },
  1247. // 低于最小起订量 把该栏的数值重置到最小起订量
  1248. getChildIdx(idx) {
  1249. this.xxContentVisible = true
  1250. this.$set(
  1251. this.comCurBaseTotalColumns[idx - 1],
  1252. 'label',
  1253. this.comCurBaseColumns[0]?.label
  1254. )
  1255. },
  1256. setMaxNum(val) {
  1257. if (val > 7) {
  1258. this.comCurBasePrice.locationNum = 7
  1259. } else if (val < 1) {
  1260. this.comCurBasePrice.locationNum = 1
  1261. }
  1262. },
  1263. ...mapMutations({
  1264. openDialog: 'openDialog',
  1265. setLoading: 'product/setLoading',
  1266. }),
  1267. },
  1268. }
  1269. </script>
  1270. <style lang="scss" scoped>
  1271. $deep-blue: #004a97;
  1272. .exclamation-icon {
  1273. width: 18px;
  1274. height: 18px;
  1275. line-height: 18px;
  1276. display: inline-block;
  1277. text-align: center;
  1278. color: #000;
  1279. border-radius: 100%;
  1280. border: 1px solid #000;
  1281. font-size: 18px;
  1282. font-weight: 550;
  1283. }
  1284. .popover {
  1285. border: 1px solid #eee;
  1286. padding: 20px;
  1287. .title {
  1288. text-align: center;
  1289. font-weight: bold;
  1290. font-size: 20px;
  1291. }
  1292. }
  1293. .title1 {
  1294. margin: 30px 0 0;
  1295. padding: 20px 0 0;
  1296. font-size: 16px;
  1297. color: #15263d;
  1298. display: flex;
  1299. font-family: ProximaNova-Regular;
  1300. font-weight: 600;
  1301. justify-content: space-between;
  1302. border-top: 1px solid #eee;
  1303. span {
  1304. &:nth-child(2) {
  1305. font-size: 14px;
  1306. color: #50596b;
  1307. }
  1308. }
  1309. }
  1310. .text-red {
  1311. text-align: right;
  1312. color: #e90000;
  1313. padding: 10px 10px 0 0;
  1314. font-size: 16px;
  1315. font-weight: bold;
  1316. }
  1317. .entry {
  1318. color: #50596b;
  1319. margin: 15px 10px;
  1320. display: flex;
  1321. flex-direction: row;
  1322. align-items: center;
  1323. .entry-l {
  1324. width: 120px;
  1325. margin-right: 10px;
  1326. }
  1327. .entry-text {
  1328. margin-left: 280px;
  1329. width: 130px;
  1330. text-align: center;
  1331. font-weight: bold;
  1332. }
  1333. :deep(.el-input__inner) {
  1334. text-align: center;
  1335. padding: 0;
  1336. }
  1337. .entry-r {
  1338. flex: 1;
  1339. text-align: right;
  1340. span {
  1341. margin-right: 10px;
  1342. }
  1343. //修改radio选中为✔样式
  1344. :deep(.el-radio__inner) {
  1345. border-radius: 0;
  1346. width: 18px;
  1347. height: 18px;
  1348. }
  1349. :deep(.el-radio__input.is-checked .el-radio__inner) {
  1350. background: $deep-blue;
  1351. border: 1px solid $deep-blue;
  1352. }
  1353. :deep(.el-radio__input.is-checked + .el-radio__label) {
  1354. color: $deep-blue;
  1355. }
  1356. :deep(.el-radio__input.is-checked .el-radio__inner::after) {
  1357. content: '';
  1358. width: 10px;
  1359. height: 5px;
  1360. border: 1px solid white;
  1361. border-top: transparent;
  1362. border-right: transparent;
  1363. text-align: center;
  1364. display: block;
  1365. position: absolute;
  1366. top: 3px;
  1367. left: 2px;
  1368. transform: rotate(-45deg);
  1369. border-radius: 0px;
  1370. background: none;
  1371. }
  1372. }
  1373. }
  1374. .button-margin {
  1375. margin: 20px 0 0;
  1376. }
  1377. .quote-tips {
  1378. font-size: 16px;
  1379. a {
  1380. color: #6495ed;
  1381. text-decoration: underline;
  1382. margin-left: 5px;
  1383. }
  1384. }
  1385. button {
  1386. font-size: 12px;
  1387. width: 200px;
  1388. height: 30px;
  1389. border-radius: 5px;
  1390. margin-right: 20px;
  1391. cursor: pointer;
  1392. border: none;
  1393. box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.2);
  1394. }
  1395. .button-black {
  1396. background-color: $deep-blue;
  1397. color: #ffffff;
  1398. &:hover {
  1399. background-color: #013269;
  1400. }
  1401. }
  1402. .button-white {
  1403. background-color: #fff;
  1404. color: #50596b;
  1405. img,
  1406. span {
  1407. vertical-align: middle;
  1408. }
  1409. }
  1410. // 报价图片弹框样式
  1411. :deep(.price-to-img-dialog) {
  1412. min-width: 840px;
  1413. margin-top: 2vh !important;
  1414. .el-dialog__header {
  1415. background-color: #00213b;
  1416. padding: 10px 20px;
  1417. .el-dialog__title {
  1418. color: #fff;
  1419. }
  1420. .el-dialog__headerbtn {
  1421. top: 15px;
  1422. }
  1423. }
  1424. .el-dialog__body {
  1425. background-color: #f1f4f9;
  1426. padding: 13px 20px;
  1427. }
  1428. .tips {
  1429. font-size: 16px;
  1430. color: #00213b;
  1431. margin: 12px 0;
  1432. }
  1433. .btn-wrap {
  1434. text-align: left;
  1435. .button-black {
  1436. margin-top: 20px;
  1437. }
  1438. }
  1439. }
  1440. :deep(.el-switch) {
  1441. .el-switch__label {
  1442. position: absolute;
  1443. display: none;
  1444. color: #fff !important;
  1445. }
  1446. /*打开时文字位置设置*/
  1447. .el-switch__label--right {
  1448. z-index: 1;
  1449. right: -3px;
  1450. }
  1451. /*关闭时文字位置设置*/
  1452. .el-switch__label--left {
  1453. z-index: 1;
  1454. left: 20px;
  1455. }
  1456. /*显示文字*/
  1457. .el-switch__label.is-active {
  1458. display: block;
  1459. }
  1460. .el-switch .el-switch__core,
  1461. .el-switch .el-switch__label {
  1462. width: 50px !important;
  1463. }
  1464. .el-switch__label * {
  1465. font-size: 13px !important;
  1466. }
  1467. }
  1468. </style>