Quote.vue 44 KB

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