Quote.vue 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485
  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. <el-button
  163. size="medium"
  164. class="button-black"
  165. @click="openMailDialog">
  166. Enquiry
  167. </el-button>
  168. </section> -->
  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 { contacts, email, phone, crm_users_id:crmUsersId } = this.userInfo
  841. // this.enquiryForm.Name = contacts
  842. // this.enquiryForm.Email = email
  843. // this.enquiryForm.Phone = phone
  844. // if (crmUsersId?.length) {
  845. // this.enquiryConfig[3].selectlist = crmUsersId
  846. // if (crmUsersId?.length === 1) {
  847. // this.enquiryForm['Customer manager'] = crmUsersId[0].name
  848. // }
  849. // } else {
  850. // this.enquiryConfig[3].isShow = false
  851. // this.$delete(this.enquiryForm, 'Customer manager')
  852. // }
  853. // this.enquiryFormVisible = true
  854. // } else {
  855. // this.openDialog()
  856. // }
  857. // },
  858. getMailData() {
  859. this.mailData.Url = window.location.href
  860. const { Name, Email, Phone, Comments } = this.enquiryForm
  861. this.mailData['Customer Name'] = Name
  862. this.mailData['Customer Email'] = Email
  863. this.mailData['Customer Phone'] = Phone
  864. this.mailData.Comments = Comments
  865. const { email, level, createTime } = this.userInfo
  866. this.mailData['Member Account'] = email
  867. this.mailData['Member Grade'] = level.name
  868. this.mailData['Member Registration time'] = createTime
  869. this.mailData['Quote time'] = this.$utils.formatTime(new Date())
  870. },
  871. // 发送价格邮件 Enquiry按钮
  872. // async sendPriceMail() {
  873. // await this.getMailData()
  874. // await this.getCustomerQuoteData()
  875. // const {
  876. // Name,
  877. // Email,
  878. // Phone,
  879. // Comments,
  880. // 'Customer manager': customerManager,
  881. // } = this.enquiryForm
  882. // this.$axios
  883. // .post('/uk-api/quote/sendenquiry', {
  884. // content: this.$refs.mailtable.$el.innerHTML,
  885. // name: Name,
  886. // email: Email,
  887. // phone: Phone,
  888. // customer_manager: customerManager || '',
  889. // url: this.mailData.Url,
  890. // product_code: this.pageData.product_code,
  891. // comments: Comments,
  892. // member_id: this.userInfo.id,
  893. // })
  894. // .then(res => {
  895. // this.setLoading(false)
  896. // this.enquiryFormVisible = false
  897. // this.$confirm('Enquiry Sent', {
  898. // confirmButtonText: 'OK',
  899. // showCancelButton: false,
  900. // type: 'success',
  901. // center: true,
  902. // showClose: false,
  903. // confirmButtonClass: 'com-btnblack',
  904. // }).then(() => {})
  905. // })
  906. // .catch(() => {
  907. // this.setLoading(false)
  908. // })
  909. // },
  910. // getCustomerQuoteData() {
  911. // const { name, selectAdditionRow } = this.comCurWeekPrice
  912. // this.specificationsObj.time = name
  913. // this.specificationsObj.model = this.comBasePrice.model
  914. // this.specificationsObj.decoration = this.comCurBasePrice.name
  915. // if (selectAdditionRow.length) {
  916. // this.specificationsObj.addonArr = selectAdditionRow.map(
  917. // item => item.name
  918. // )
  919. // } else {
  920. // this.specificationsObj.addonArr = null
  921. // }
  922. // },
  923. // openDownloadDialog(type) {
  924. // this.getCustomerQuoteData()
  925. // type
  926. // ? (this.downloadDialogVisible = true)
  927. // : (this.priceToImgVisible = true)
  928. // },
  929. handleDownloadPdf() {
  930. this.pdfLoading = true
  931. this.$nextTick(() => {
  932. this.$refs.priceToImgRef.htmlToPdf(this.pageData.product_code)
  933. })
  934. },
  935. // 发送PDF邮件
  936. // sendPdfMail() {
  937. // this.$axios
  938. // .post('/api/quote/sendpdf', {
  939. // content: this.$refs.pdf.$el.innerHTML,
  940. // product_code: this.pageData.product_code,
  941. // email: this.commentObj['Email Address'],
  942. // })
  943. // .then(res => {
  944. // this.setLoading(false)
  945. // this.downloadDialogVisible = false
  946. // this.$confirm('Enquiry Sent', {
  947. // confirmButtonText: 'OK',
  948. // showCancelButton: false,
  949. // type: 'success',
  950. // center: true,
  951. // showClose: false,
  952. // confirmButtonClass: 'com-btnblack',
  953. // })
  954. // })
  955. // .catch(() => {
  956. // this.setLoading(false)
  957. // })
  958. // },
  959. copyData(data) {
  960. return JSON.parse(JSON.stringify(data))
  961. },
  962. calculateBuyData() {
  963. const selPriceArr = []
  964. if (JSON.stringify(this.comBasePrice) !== '{}') {
  965. selPriceArr.push(this.comBasePrice)
  966. }
  967. selPriceArr.push(
  968. ...this.comDecoPrice,
  969. ...this.comCurWeekPrice.selectAdditionRow
  970. )
  971. if (selPriceArr.length === 0) {
  972. this.buyData = this.buyData.map(item => ({
  973. ...item,
  974. ...this.initZeroObj,
  975. }))
  976. return
  977. }
  978. // 累加所选,初始数量对应的单价。赋值给this.initUnitObj
  979. for (const i in this.initUnitObj) {
  980. const columnSum = this.copyData(selPriceArr).reduce(function (
  981. prev,
  982. cur
  983. ) {
  984. if (cur[i] === '111' || cur[i] === '111.00') {
  985. return (cur[i] = '-')
  986. } else if (cur[i] === '999' || cur[i] === '999.00') {
  987. return (cur[i] = 'POA')
  988. } else {
  989. // 当基础价格是-POA,后续累加价格是正常数字价,依然返回-POA
  990. if (prev === '-' || prev === 'POA') {
  991. return prev
  992. }
  993. return npPlus(+cur[i], prev).toFixed(2)
  994. }
  995. },
  996. 0)
  997. this.$set(this.initUnitObj, i, columnSum)
  998. }
  999. for (const a in this.comAttributeList) {
  1000. // 每次更改选择价格,必须遍历整个comAttributeList
  1001. const tempIdx = this.comCurBaseColumns.findIndex(
  1002. items => +this.comAttributeList[a] < +items.label
  1003. )
  1004. if (tempIdx > 0) {
  1005. const key = this.comCurBaseColumns[tempIdx - 1].prop
  1006. this.$set(this.initChangeUnitObj, a, this.initUnitObj[key])
  1007. } else {
  1008. const length = this.comCurBaseColumns.length
  1009. const key = this.comCurBaseColumns[length - 1].prop
  1010. this.$set(this.initChangeUnitObj, a, this.initUnitObj[key])
  1011. }
  1012. if (
  1013. this.initChangeUnitObj[a] === 'POA' ||
  1014. this.initChangeUnitObj[a] === '-'
  1015. ) {
  1016. this.$set(this.initSetupObj, a, this.initChangeUnitObj[a])
  1017. this.$set(this.initFrightObj, a, this.initChangeUnitObj[a])
  1018. } else {
  1019. this.$set(this.initSetupObj, a, this.initUnitObj.website_setup)
  1020. // 计算运费
  1021. // 单独批次数量的总重
  1022. // weight定义是{},后端没数据传回[]
  1023. const unitWLocal = this.weight.unit_w_local
  1024. ? +this.weight.unit_w_local
  1025. : 0
  1026. const totalWeight = Math.ceil(
  1027. npTimes(unitWLocal, this.comAttributeList[a])
  1028. )
  1029. // Road express 1 AAE:AAEFactor 2
  1030. const setupFuel = this.dividePrice(this.configInfo.fuel)
  1031. const setupBagFreight = this.dividePrice(this.configInfo.bag_freight)
  1032. const setupExpressFreight = this.dividePrice(
  1033. this.configInfo.express_freight
  1034. )
  1035. const AAEFactor = npPlus(1, setupBagFreight, setupFuel)
  1036. const expressFactor = npPlus(1, setupExpressFreight, setupFuel)
  1037. let frightCost = 0
  1038. let freightType
  1039. let postcode
  1040. let freight = {}
  1041. const matchIndex = this.comCurBaseTotalColumns.findIndex(
  1042. item => item.prop === a
  1043. )
  1044. // 1,所有按第一个运费统计;不为1,则只计算 comCurBaseTotalColumns的[地址数]长度
  1045. if (
  1046. +this.comLocationNum === 1 ||
  1047. this.comLocationNum >= matchIndex + 1
  1048. ) {
  1049. ;({
  1050. freight,
  1051. freight_type: freightType,
  1052. postcode,
  1053. } = this.comCurBaseTotalColumns[
  1054. +this.comLocationNum === 1 ? 0 : matchIndex
  1055. ] || {})
  1056. }
  1057. if (freightType === 1 && postcode >= 3) {
  1058. if (totalWeight > 20) {
  1059. const a1 = npMinus(totalWeight, 20)
  1060. const a2 = npTimes(a1, +freight.basic)
  1061. const a3 = npPlus(+freight.pickup, a2)
  1062. frightCost = npTimes(a3, expressFactor)
  1063. } else {
  1064. frightCost = npTimes(+freight.pickup, expressFactor)
  1065. }
  1066. } else if (freightType === 2 && postcode >= 3) {
  1067. const a1 = npDivide(totalWeight, 5)
  1068. const a2 = npTimes(+freight.minimum, Math.ceil(a1))
  1069. frightCost = npTimes(a2, AAEFactor)
  1070. } else {
  1071. frightCost = 0
  1072. }
  1073. this.$set(this.initFrightObj, a, Math.ceil(frightCost).toFixed(2))
  1074. }
  1075. if (
  1076. this.initChangeUnitObj[a] === '-' ||
  1077. this.initChangeUnitObj[a] === 'POA'
  1078. ) {
  1079. this.$set(this.initTotalObj, a, this.initChangeUnitObj[a])
  1080. } else {
  1081. const unitQTY = npTimes(
  1082. this.initChangeUnitObj[a],
  1083. this.comAttributeList[a]
  1084. )
  1085. this.$set(
  1086. this.initTotalObj,
  1087. a,
  1088. npPlus(
  1089. this.initUnitObj.website_setup,
  1090. unitQTY,
  1091. this.initFrightObj[a]
  1092. ).toFixed(2)
  1093. )
  1094. }
  1095. if (this.setup_switch) {
  1096. // 业务:Setup价格/对应数量后向上取整
  1097. if (
  1098. this.initChangeUnitObj[a] === '-' ||
  1099. this.initChangeUnitObj[a] === 'POA'
  1100. ) {
  1101. this.$set(this.initChangeUnitObj, a, this.initChangeUnitObj[a])
  1102. } else {
  1103. const num =
  1104. Math.ceil(
  1105. (this.initSetupObj[a] / this.comAttributeList[a]) * 100
  1106. ) / 100
  1107. this.$set(
  1108. this.initChangeUnitObj,
  1109. a,
  1110. npPlus(this.initChangeUnitObj[a], num).toFixed(2)
  1111. )
  1112. }
  1113. }
  1114. if (this.freight_switch) {
  1115. if (
  1116. this.initChangeUnitObj[a] === '-' ||
  1117. this.initChangeUnitObj[a] === 'POA'
  1118. ) {
  1119. this.$set(this.initChangeUnitObj, a, this.initChangeUnitObj[a])
  1120. } else {
  1121. const num =
  1122. Math.ceil(
  1123. (this.initFrightObj[a] / this.comAttributeList[a]) * 100
  1124. ) / 100
  1125. this.$set(
  1126. this.initChangeUnitObj,
  1127. a,
  1128. npPlus(this.initChangeUnitObj[a], num).toFixed(2)
  1129. )
  1130. }
  1131. }
  1132. }
  1133. if (this.setup_switch) {
  1134. this.$set(this.buyData, 0, {
  1135. ...this.buyData[0],
  1136. ...this.initZeroObj,
  1137. ...{ summary: 0.0 },
  1138. })
  1139. } else {
  1140. this.$set(this.buyData, 0, { ...this.buyData[0], ...this.initSetupObj })
  1141. }
  1142. this.$set(this.buyData, 1, {
  1143. ...this.buyData[1],
  1144. ...this.initChangeUnitObj,
  1145. })
  1146. if (this.freight_switch) {
  1147. this.$set(this.buyData, 2, { ...this.buyData[2], ...this.initZeroObj })
  1148. } else {
  1149. this.$set(this.buyData, 2, {
  1150. ...this.buyData[2],
  1151. ...this.initFrightObj,
  1152. })
  1153. }
  1154. this.$set(this.buyData, 3, { ...this.buyData[3], ...this.initTotalObj })
  1155. },
  1156. calculateSellData() {
  1157. // 放置comSellData计算和副作用的代码
  1158. const buySetup = this.comBuyData[0]
  1159. const buyUnit = this.comBuyData[1]
  1160. const buyFright = this.comBuyData[2]
  1161. let frightSummary = 0
  1162. for (const i in this.comAttributeList) {
  1163. if (buyUnit[i] === '-' || buyUnit[i] === 'POA') {
  1164. this.sellData[0][i] = '-'
  1165. this.sellData[1][i] = buyUnit[i]
  1166. this.sellData[2][i] = buyUnit[i]
  1167. this.sellData[3][i] = buyUnit[i]
  1168. this.sellData[4][i] = buyUnit[i]
  1169. } else {
  1170. const item =
  1171. this.comLocationNum === 1
  1172. ? this.comCurBaseTotalColumns[0]
  1173. : this.comCurBaseTotalColumns.find(element => element.prop === i)
  1174. this.sellData[0][i] =
  1175. item && item.postcode !== '' ? item.postcode : '-'
  1176. // 分别乘以Markup %表格
  1177. const key = this.comCurBaseTotalColumns[0]?.prop
  1178. if (this.unitData[1] && this.unitData[1][key]) {
  1179. const a = npPlus(this.unitData[1][key] / 100, 1)
  1180. this.sellData[1][i] = npTimes(buySetup[i], a).toFixed(2)
  1181. } else {
  1182. this.sellData[1][i] = buySetup[i]
  1183. }
  1184. if (this.unitData[0][i]) {
  1185. const a = npPlus(this.unitData[0][i] / 100, 1)
  1186. this.sellData[2][i] = npTimes(buyUnit[i], a).toFixed(2)
  1187. } else {
  1188. this.sellData[2][i] = buyUnit[i]
  1189. }
  1190. if (this.unitData[2] && this.unitData[2][key]) {
  1191. const a = npPlus(this.unitData[2][key] / 100, 1)
  1192. this.sellData[3][i] = npTimes(buyFright[i], a).toFixed(2)
  1193. // freight_switch会使qty的运费=0无法计算,故用了initFrightObj
  1194. const fa = npTimes(this.initFrightObj[i], a)
  1195. frightSummary = npPlus(frightSummary, fa).toFixed(2)
  1196. } else {
  1197. this.sellData[3][i] = buyFright[i]
  1198. frightSummary = npPlus(
  1199. frightSummary,
  1200. this.initFrightObj[i]
  1201. ).toFixed(2)
  1202. }
  1203. const unitQTY = npTimes(this.sellData[2][i], this.comAttributeList[i])
  1204. this.$set(
  1205. this.sellData[4],
  1206. i,
  1207. npPlus(this.sellData[1][i], unitQTY, this.sellData[3][i]).toFixed(2)
  1208. )
  1209. }
  1210. }
  1211. // 迭代加了Total列,需要统计qty的运费后才能合计运费
  1212. if (
  1213. this.sellData[2].summary !== '-' &&
  1214. this.sellData[2].summary !== 'POA'
  1215. ) {
  1216. if (this.freight_switch) {
  1217. const num =
  1218. Math.ceil((frightSummary / this.comAttributeList.summary) * 100) /
  1219. 100
  1220. this.sellData[2].summary = npPlus(
  1221. this.sellData[2].summary,
  1222. num
  1223. ).toFixed(2)
  1224. this.sellData[3].summary = 0.0
  1225. const a = npTimes(
  1226. this.sellData[2].summary,
  1227. this.comAttributeList.summary
  1228. )
  1229. this.sellData[4].summary = npPlus(
  1230. this.sellData[1].summary,
  1231. a
  1232. ).toFixed(2)
  1233. } else {
  1234. this.sellData[3].summary = frightSummary
  1235. this.sellData[4].summary = npPlus(
  1236. frightSummary,
  1237. this.sellData[4].summary
  1238. ).toFixed(2)
  1239. }
  1240. }
  1241. },
  1242. // 低于最小起订量 把该栏的数值重置到最小起订量
  1243. getChildIdx(idx) {
  1244. this.xxContentVisible = true
  1245. this.$set(
  1246. this.comCurBaseTotalColumns[idx - 1],
  1247. 'label',
  1248. this.comCurBaseColumns[0]?.label
  1249. )
  1250. },
  1251. setMaxNum(val) {
  1252. if (val > 7) {
  1253. this.comCurBasePrice.locationNum = 7
  1254. } else if (val < 1) {
  1255. this.comCurBasePrice.locationNum = 1
  1256. }
  1257. },
  1258. ...mapMutations({
  1259. openDialog: 'openDialog',
  1260. setLoading: 'product/setLoading',
  1261. }),
  1262. },
  1263. }
  1264. </script>
  1265. <style lang="scss" scoped>
  1266. $deep-blue: #004a97;
  1267. .exclamation-icon {
  1268. width: 18px;
  1269. height: 18px;
  1270. line-height: 18px;
  1271. display: inline-block;
  1272. text-align: center;
  1273. color: #000;
  1274. border-radius: 100%;
  1275. border: 1px solid #000;
  1276. font-size: 18px;
  1277. font-weight: 550;
  1278. }
  1279. .popover {
  1280. border: 1px solid #eee;
  1281. padding: 20px;
  1282. .title {
  1283. text-align: center;
  1284. font-weight: bold;
  1285. font-size: 20px;
  1286. }
  1287. }
  1288. .title1 {
  1289. margin: 30px 0 0;
  1290. padding: 20px 0 0;
  1291. font-size: 16px;
  1292. color: #15263d;
  1293. display: flex;
  1294. font-family: ProximaNova-Regular;
  1295. font-weight: 600;
  1296. justify-content: space-between;
  1297. border-top: 1px solid #eee;
  1298. span {
  1299. &:nth-child(2) {
  1300. font-size: 14px;
  1301. color: #50596b;
  1302. }
  1303. }
  1304. }
  1305. .text-red {
  1306. text-align: right;
  1307. color: #e90000;
  1308. padding: 10px 10px 0 0;
  1309. font-size: 16px;
  1310. font-weight: bold;
  1311. }
  1312. .entry {
  1313. color: #50596b;
  1314. margin: 15px 10px;
  1315. display: flex;
  1316. flex-direction: row;
  1317. align-items: center;
  1318. .entry-l {
  1319. width: 120px;
  1320. margin-right: 10px;
  1321. }
  1322. .entry-text {
  1323. margin-left: 280px;
  1324. width: 130px;
  1325. text-align: center;
  1326. font-weight: bold;
  1327. }
  1328. :deep(.el-input__inner) {
  1329. text-align: center;
  1330. padding: 0;
  1331. }
  1332. .entry-r {
  1333. flex: 1;
  1334. text-align: right;
  1335. span {
  1336. margin-right: 10px;
  1337. }
  1338. //修改radio选中为✔样式
  1339. :deep(.el-radio__inner) {
  1340. border-radius: 0;
  1341. width: 18px;
  1342. height: 18px;
  1343. }
  1344. :deep(.el-radio__input.is-checked .el-radio__inner) {
  1345. background: $deep-blue;
  1346. border: 1px solid $deep-blue;
  1347. }
  1348. :deep(.el-radio__input.is-checked + .el-radio__label) {
  1349. color: $deep-blue;
  1350. }
  1351. :deep(.el-radio__input.is-checked .el-radio__inner::after) {
  1352. content: '';
  1353. width: 10px;
  1354. height: 5px;
  1355. border: 1px solid white;
  1356. border-top: transparent;
  1357. border-right: transparent;
  1358. text-align: center;
  1359. display: block;
  1360. position: absolute;
  1361. top: 3px;
  1362. left: 2px;
  1363. transform: rotate(-45deg);
  1364. border-radius: 0px;
  1365. background: none;
  1366. }
  1367. }
  1368. }
  1369. .button-margin {
  1370. margin: 20px 0 0;
  1371. }
  1372. .quote-tips {
  1373. font-size: 16px;
  1374. a {
  1375. color: #6495ed;
  1376. text-decoration: underline;
  1377. margin-left: 5px;
  1378. }
  1379. }
  1380. button {
  1381. font-size: 12px;
  1382. width: 200px;
  1383. height: 30px;
  1384. border-radius: 5px;
  1385. margin-right: 20px;
  1386. cursor: pointer;
  1387. border: none;
  1388. box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.2);
  1389. }
  1390. .button-black {
  1391. background-color: $deep-blue;
  1392. color: #ffffff;
  1393. &:hover {
  1394. background-color: #013269;
  1395. }
  1396. }
  1397. .button-white {
  1398. background-color: #fff;
  1399. color: #50596b;
  1400. img,
  1401. span {
  1402. vertical-align: middle;
  1403. }
  1404. }
  1405. // 报价图片弹框样式
  1406. :deep(.price-to-img-dialog) {
  1407. min-width: 840px;
  1408. margin-top: 2vh !important;
  1409. .el-dialog__header {
  1410. background-color: #00213b;
  1411. padding: 10px 20px;
  1412. .el-dialog__title {
  1413. color: #fff;
  1414. }
  1415. .el-dialog__headerbtn {
  1416. top: 15px;
  1417. }
  1418. }
  1419. .el-dialog__body {
  1420. background-color: #f1f4f9;
  1421. padding: 13px 20px;
  1422. }
  1423. .tips {
  1424. font-size: 16px;
  1425. color: #00213b;
  1426. margin: 12px 0;
  1427. }
  1428. .btn-wrap {
  1429. text-align: left;
  1430. .button-black {
  1431. margin-top: 20px;
  1432. }
  1433. }
  1434. }
  1435. :deep(.el-switch) {
  1436. .el-switch__label {
  1437. position: absolute;
  1438. display: none;
  1439. color: #fff !important;
  1440. }
  1441. /*打开时文字位置设置*/
  1442. .el-switch__label--right {
  1443. z-index: 1;
  1444. right: -3px;
  1445. }
  1446. /*关闭时文字位置设置*/
  1447. .el-switch__label--left {
  1448. z-index: 1;
  1449. left: 20px;
  1450. }
  1451. /*显示文字*/
  1452. .el-switch__label.is-active {
  1453. display: block;
  1454. }
  1455. .el-switch .el-switch__core,
  1456. .el-switch .el-switch__label {
  1457. width: 50px !important;
  1458. }
  1459. .el-switch__label * {
  1460. font-size: 13px !important;
  1461. }
  1462. }
  1463. </style>