SayPriceInfo.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. <template>
  2. <div class="mobile-modal" @touchmove="preventTouchMove($event)">
  3. <div class="mobile-modal-box">
  4. <div class="mobile-modal-header">
  5. 查看报价
  6. <!--{{purchaseDetail.agreed == 1 || agreed == 1 ? '已采纳' : '已报价'}}-->
  7. <i class="icon-guanbi iconfont" @click="cancel"></i>
  8. </div>
  9. <!--<i class="icon-guanbi iconfont" @click="cancel"></i>-->
  10. <div class="say-price-info" ref="mobileModalBox">
  11. <div>
  12. <div v-if="isBuyer" class="is-buyer">
  13. <div class="base-info base">
  14. <div class="content-line">
  15. 品牌:<span>{{purchaseDetail.inbrand || '-'}}</span>
  16. </div>
  17. <div class="content-line">
  18. 类目(产品名称):<span>{{purchaseDetail.prodTitle || '-'}}</span>
  19. </div>
  20. <div class="content-line">
  21. 型号:<span>{{purchaseDetail.cmpCode || '-'}}</span>
  22. </div>
  23. <div class="content-line">
  24. 规格:<span>{{purchaseDetail.spec || '-'}}</span>
  25. </div>
  26. <div class="content-line">
  27. 采购数量(PCS):<span>{{purchaseDetail.needquantity || '-'}}</span>
  28. </div>
  29. <!-- <div class="content-line">
  30. 币种:<span>{{purchaseDetail.custCurrency || '不限'}}</span>
  31. </div>-->
  32. <!--<div class="content-line">
  33. 生产日期:<span>{{purchaseDetail.produceDate || '-'}}</span>
  34. </div>-->
  35. <div class="content-line">
  36. 截止日期:<span>{{purchaseDetail.endDate | date}}</span>
  37. </div>
  38. <div class="content-line">
  39. 联系电话:<span>{{purchaseDetail.userTel || '-'}}</span>
  40. </div>
  41. </div>
  42. <!-- <div class="base-info">
  43. <div class="content-line">
  44. 买家:<span>{{purchaseDetail.inquiry && purchaseDetail.inquiry.enterprise ? purchaseDetail.inquiry.enterprise.enName : purchaseDetail.userName}}</span>
  45. </div>
  46. <div class="content-line">
  47. 联系电话:<span>{{purchaseDetail.userTel || '-'}}</span>
  48. </div>
  49. </div>-->
  50. <div class="base-info say-info say" :class="{'long': item.showRefuseList}" v-for="(item, index) in qutationsTemp">
  51. <!-- <img v-if="agreed != 1 && (!item.agreed || item.agreed !== 1) && activeIndex == index" src="/images/mobile/@2x/applyPurchase/say-price-check.png" alt="">
  52. <img v-if="agreed != 1 && (!item.agreed || item.agreed !== 1) && activeIndex != index" src="/images/mobile/@2x/applyPurchase/say-price-default.png" alt="">
  53. <img v-if="item.agreed == 1" src="/images/mobile/@2x/applyPurchase/say-price-accept.png" alt="">-->
  54. <div class="content-title">
  55. <i>{{index + 1}}</i>
  56. <div class="inline-block text-ellipse vend-name">{{item.vendName}}</div>
  57. <img src="/images/mobile/center/accept.png" alt="" v-if="item.agreed == 1">
  58. <img src="/images/mobile/center/refuse.png" alt="" v-if="item.agreed == 0">
  59. </div>
  60. <div class="content-line">
  61. 报价人:<span v-if="item.user">{{item.user.userName}}</span>
  62. <span v-else>-</span>
  63. </div>
  64. <div class="content-line">
  65. 电话:<span v-if="item.user">{{item.user.userTel}}</span>
  66. <span v-else>-</span>
  67. </div>
  68. <div class="content-line date">
  69. 交期(天):<span>{{item.leadtime}}</span>
  70. </div>
  71. <div class="content-line date">
  72. 报价时间:<span>{{item.offerTime | date}}</span>
  73. </div>
  74. <!--<p>{{item.offerTime | date}}</p>-->
  75. <div class="price clearfix">
  76. <span>价格梯度:<br/>(PCS)</span>
  77. <table class="com-price-list com-price-listLong">
  78. <thead>
  79. <tr>
  80. <th>分段数量</th>
  81. <th>分段单价</th>
  82. </tr>
  83. </thead>
  84. <tbody>
  85. <tr v-for="replie in item.replies">
  86. <td class="date text-ellipse">{{replie.lapQty ? replie.lapQty + '+' : '-'}}</td>
  87. <td class="date text-ellipse">{{replie.price ? (item.currency == 'USD' ? '$' : '¥') + replie.price : '-'}}</td>
  88. </tr>
  89. </tbody>
  90. </table>
  91. </div>
  92. <!--<div class="price-level">
  93. <p>价格梯度:<span>(pcs)</span></p>
  94. <ul>
  95. <li v-for="replie in item.replies">
  96. <span>{{replie.lapQty ? replie.lapQty + '+' : '-'}}</span>
  97. <span>{{replie.price ? (item.currency == 'USD' ? '$' : '¥') + replie.price : '-'}}</span>
  98. </li>
  99. </ul>
  100. </div>-->
  101. <div class="operate-say" v-if="item.agreed != 1 && item.agreed != 0">
  102. <a class="operate-say-btn inline-block" @click="acceptQutation(item)">采纳报价</a>
  103. <a class="operate-say-btn inline-block refuse" @click="setShowRefuseList(item, !item.showRefuseList)">
  104. 拒绝报价
  105. <img src="/images/mobile/center/refuse-arrow-down.png" alt="">
  106. <ul v-if="item.showRefuseList">
  107. <li class="text-ellipse" @click.stop="selectRefuse(item, '采购需求变更')">采购需求变更</li>
  108. <li class="text-ellipse" @click.stop="selectRefuse(item, '价格过高')">价格过高</li>
  109. <li class="text-ellipse" @click.stop="selectRefuse(item, '需进一步了解原因')">需进一步了解原因</li>
  110. <li class="text-ellipse" @click.stop="selectRefuse(item, '已选定合适供应商')">已选定合适供应商</li>
  111. <li class="text-ellipse" @click.stop="selectRefuse(item, '交期过长')">交期过长</li>
  112. </ul>
  113. </a>
  114. </div>
  115. </div>
  116. <!-- <a class="say-price-btn" v-if="purchaseDetail.agreed != 1" @click="acceptQutation">采纳报价</a>
  117. <div style="height: 0.5rem;width: 100%"></div>-->
  118. </div>
  119. <div v-if="!isBuyer" class="is-vendor">
  120. <div class="base-info">
  121. <div class="content-title">
  122. <span class="inline-block text-ellipse">{{purchaseDetail.inquiry && purchaseDetail.inquiry.enterprise ? purchaseDetail.inquiry.enterprise.enName : purchaseDetail.userName}}</span>
  123. <img src="/images/mobile/center/accept.png" alt="" v-if="purchaseDetail.agreed == 1">
  124. <img src="/images/mobile/center/refuse.png" alt="" v-if="purchaseDetail.agreed == 0">
  125. </div>
  126. <div class="content-line">
  127. 品牌:<span>{{purchaseDetail.inbrand || '-'}}</span>
  128. </div>
  129. <div class="content-line">
  130. 类目(产品名称):<span>{{purchaseDetail.prodTitle || '-'}}</span>
  131. </div>
  132. <div class="content-line">
  133. 型号:<span>{{purchaseDetail.cmpCode || '-'}}</span>
  134. </div>
  135. <div class="content-line">
  136. 规格:<span>{{purchaseDetail.spec || '-'}}</span>
  137. </div>
  138. <div class="content-line">
  139. 采购数量(PCS):<span>{{purchaseDetail.needquantity || '-'}}</span>
  140. </div>
  141. <div class="content-line">
  142. 币种:<span>{{purchaseDetail.custCurrency || '不限'}}</span>
  143. </div>
  144. <!-- <div class="content-line">
  145. 生产日期:<span>{{purchaseDetail.produceDate || '-'}}</span>
  146. </div>-->
  147. <div class="content-line">
  148. 截止日期:<span>{{purchaseDetail.endDate | date}}</span>
  149. </div>
  150. <div class="content-line">
  151. 联系电话:<span>{{purchaseDetail.userTel || '-'}}</span>
  152. </div>
  153. </div>
  154. <!--<div class="base-info">
  155. <div class="content-line">
  156. 报价人:<span v-if="purchaseDetail.user">{{purchaseDetail.user.userName}}</span>
  157. <span v-else>-</span>
  158. </div>
  159. <div class="content-line">
  160. 联系电话:<span v-if="purchaseDetail.user">{{purchaseDetail.user.userTel || '-'}}</span>
  161. <span v-else>-</span>
  162. </div>
  163. </div>-->
  164. <div class="base-info say-info">
  165. <div class="content-line inline-block">
  166. 报价人:<span>{{purchaseDetail.user ? purchaseDetail.user.userName : '-'}}</span>
  167. </div>
  168. <div class="content-line inline-block">
  169. 电话:<span>{{purchaseDetail.user ? purchaseDetail.user.userTel : '-'}}</span>
  170. </div>
  171. <div class="content-line inline-block date">
  172. 交期(天):<span>{{purchaseDetail.leadtime}}</span>
  173. </div>
  174. <div class="content-line inline-block date">
  175. 报价时间:<span>{{purchaseDetail.offerTime | date}}</span>
  176. </div>
  177. <!--<p>{{purchaseDetail.offerTime | date}}</p>-->
  178. <div class="price clearfix">
  179. <span>价格梯度:<br/>(PCS)</span>
  180. <table class="com-price-list com-price-listLong">
  181. <thead>
  182. <tr>
  183. <th>分段数量</th>
  184. <th>分段单价</th>
  185. </tr>
  186. </thead>
  187. <tbody>
  188. <tr v-for="replie in purchaseDetail.replies">
  189. <td class="date text-ellipse">{{replie.lapQty ? replie.lapQty + '+' : '-'}}</td>
  190. <td class="date text-ellipse">{{replie.price ? (purchaseDetail.currency == 'USD' ? '$' : '¥') + replie.price : '-'}}</td>
  191. </tr>
  192. </tbody>
  193. </table>
  194. </div>
  195. <!--<div class="price-level vendor">
  196. <p>价格梯度:<span>(pcs)</span></p>
  197. <ul>
  198. <li v-for="replie in purchaseDetail.replies">
  199. <span>{{replie.lapQty ? replie.lapQty + '+' : '-'}}</span>
  200. <span>{{replie.price ? (purchaseDetail.currency == 'USD' ? '$' : '¥') + replie.price : '-'}}</span>
  201. </li>
  202. </ul>
  203. </div>-->
  204. </div>
  205. </div>
  206. </div>
  207. <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
  208. </div>
  209. </div>
  210. </div>
  211. </template>
  212. <script>
  213. import {RemindBox} from '~components/mobile/common'
  214. import {deepCopy} from '~utils/baseUtils'
  215. export default {
  216. data () {
  217. return {
  218. activeIndex: -1,
  219. remindText: '',
  220. timeoutCount: 0,
  221. qutationsTemp: []
  222. }
  223. },
  224. components: {
  225. RemindBox
  226. },
  227. props: ['agreed', 'userType'],
  228. filters: {
  229. date: function (date) {
  230. if (date) {
  231. const d = new Date(Number(date))
  232. const year = d.getFullYear()
  233. const monthTemp = d.getMonth() + 1
  234. const month = monthTemp < 10 ? '0' + monthTemp : '' + monthTemp
  235. const day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate() + ' '
  236. return year + '-' + month + '-' + day
  237. } else {
  238. return '-'
  239. }
  240. },
  241. userNameFilter (str) {
  242. return str ? str.substring(0, 1) + '**' : '-'
  243. }
  244. },
  245. computed: {
  246. purchaseDetail () {
  247. let obj = {}
  248. if (this.isBuyer) {
  249. obj = deepCopy(this.$store.state.applyPurchase.purchaseManList.buyerInquiryDetail.data)
  250. if (obj.qutations) {
  251. this.qutationsTemp = obj.qutations
  252. for (let i = 0; i < this.qutationsTemp.length; i++) {
  253. this.$set(this.qutationsTemp[i], 'showRefuseList', false)
  254. }
  255. }
  256. } else {
  257. obj = this.$store.state.applyPurchase.purchaseManList.vendorInquiryDetail.data
  258. }
  259. return obj
  260. },
  261. user () {
  262. return this.$store.state.option.user
  263. },
  264. isBuyer () {
  265. return this.$route.query.type === 'buyer' || this.userType === 'buyer'
  266. }
  267. },
  268. methods: {
  269. cancel: function () {
  270. this.$emit('cancelSayPriceInfoAction', false)
  271. },
  272. selectQutation: function (index) {
  273. this.activeIndex = this.activeIndex === index ? -1 : index
  274. },
  275. acceptQutation: function (item) {
  276. // if (this.activeIndex > -1) {
  277. // } else {
  278. // // this.$message.success('请选择报价信息')
  279. // this.onRemind('请选择报价信息')
  280. // }
  281. this.$http.post('/inquiry/buyer/decide?id=' + item.id + '&status=1')
  282. .then(response => {
  283. // this.$message.success('采纳成功')
  284. this.onRemind('采纳成功')
  285. // this.$emit('cancelSayPriceInfoAction', true)
  286. item.agreed = 1
  287. // this.$route.query.type === 'saler' ? this.$store.dispatch('applyPurchase/loadVendorInquiryDetail', {id: this.$route.params.id}) : this.$store.dispatch('applyPurchase/loadBuyerInquiryDetail', {id: this.$route.params.id})
  288. }, err => {
  289. console.log(err)
  290. // this.$message.success('系统错误')
  291. this.onRemind(err.response.data.message || '系统错误')
  292. })
  293. },
  294. onRemind: function (str) {
  295. this.remindText = str
  296. this.timeoutCount ++
  297. },
  298. selectRefuse: function (item, reason) {
  299. item.showRefuseList = false
  300. this.$http.post(`/inquiry/buyer/refuse?id=${item.id}&status=0&refusereason=${encodeURIComponent(reason)}`)
  301. .then(res => {
  302. item.agreed = 0
  303. this.onRemind('拒绝报价成功')
  304. }, err => {
  305. this.onRemind(err.response.data.message || '拒绝报价失败,系统错误')
  306. console.log(err)
  307. })
  308. },
  309. setShowRefuseList: function (item, flag) {
  310. // console.log(flag)
  311. item.showRefuseList = flag
  312. }
  313. },
  314. mounted() {
  315. this.$nextTick(() => {
  316. this._initscroll()
  317. // console.log(this.$refs.modalBody.scrollHeight)
  318. // this.$refs.modalBody.style.marginTop = (0 - (this.$refs.modalBody.scrollHeight / 2)) / 100 - 2.5 + 'rem'
  319. })
  320. }
  321. }
  322. </script>
  323. <style lang="scss" scoped>
  324. .mobile-modal {
  325. .mobile-modal-box {
  326. top: 1.66rem;
  327. left: 3%;
  328. right: 3%;
  329. bottom: 1.66rem;
  330. width: 7rem;
  331. margin: 0 auto;
  332. background: #fff;
  333. .icon-guanbi {
  334. position: absolute;
  335. right: -.25rem;
  336. font-size: .6rem;
  337. top: -.4rem;
  338. color: #fff;
  339. z-index: 1;
  340. }
  341. .say-price-info {
  342. /*background: #f3f3f3;*/
  343. padding: 0;
  344. width: 100%;
  345. overflow: hidden;
  346. max-height: 90%;
  347. position: relative;
  348. .base-info {
  349. margin: 0 auto;
  350. /*border-bottom: .18rem solid #f3f3f3;*/
  351. /* &:last-child {
  352. margin-bottom: 0;
  353. }*/
  354. &.say-info {
  355. /*height: 4.54rem;*/
  356. position: relative;
  357. /* margin-top: .18rem;*/
  358. > img {
  359. position: absolute;
  360. right: 0;
  361. top: 0;
  362. width: 1rem;
  363. height: 1rem;
  364. }
  365. .content-line {
  366. width: 4.55rem;
  367. span {
  368. color: #333;
  369. }
  370. &.date {
  371. span {
  372. color: #ef5042;
  373. }
  374. }
  375. }
  376. > p {
  377. font-size: .24rem;
  378. color: #999;
  379. }
  380. .price-level {
  381. font-size: .26rem;
  382. /*position: absolute;*/
  383. /*top: 1.3rem;*/
  384. /*right: .3rem;*/
  385. position: relative;
  386. bottom: .3rem;
  387. width: 4.4rem;
  388. text-align: center;
  389. margin-left: 2rem;
  390. p {
  391. margin-bottom: .1rem;
  392. span {
  393. color: #666;
  394. }
  395. }
  396. ul {
  397. li {
  398. height: .52rem;
  399. span {
  400. height: .52rem;
  401. line-height: .52rem;
  402. padding-left: .22rem;
  403. text-align: left;
  404. display: inline-block;
  405. border-top: .02rem solid #7e7e7e;
  406. border-left: .02rem solid #7e7e7e;
  407. overflow: hidden;
  408. text-overflow: ellipsis;
  409. white-space: nowrap;
  410. width: 50%;
  411. &:last-child {
  412. border-right: .02rem solid #7e7e7e;
  413. }
  414. }
  415. &:last-child {
  416. border-bottom: .02rem solid #7e7e7e;
  417. }
  418. }
  419. }
  420. &.vendor {
  421. margin: .15rem auto 0;
  422. }
  423. }
  424. }
  425. }
  426. .price {
  427. margin-top: .3rem;
  428. span {
  429. width: 1.4rem;
  430. color: #666;
  431. font-size: .28rem;
  432. display: inline-block;
  433. float: left;
  434. }
  435. table {
  436. float: left;
  437. margin: 0 0 .32rem 0;
  438. }
  439. }
  440. .is-buyer {
  441. .base {
  442. background: #3f84f6;
  443. color: #fff;
  444. margin: .1rem;
  445. border-radius: .1rem;
  446. .content-line {
  447. span {
  448. color: #fff;
  449. }
  450. }
  451. }
  452. .say {
  453. .content-title {
  454. border-bottom: 1px solid #d3d3d3;
  455. font-size: .28rem;
  456. font-weight: bold;
  457. height: .81rem;
  458. line-height: .81rem;
  459. .vend-name {
  460. width: 5rem;
  461. }
  462. img {
  463. width: .69rem;
  464. margin-left: .2rem;
  465. }
  466. i {
  467. display: inline-block;
  468. width: .4rem;
  469. height: .4rem;
  470. line-height: .4rem;
  471. color: #fff;
  472. font-weight: bold;
  473. font-style: normal;
  474. background: #3f84f6;
  475. border-radius: .05rem;
  476. text-align: center;
  477. margin-right: .12rem;
  478. }
  479. }
  480. .content-line {
  481. width: 50%;
  482. margin-top: .3rem;
  483. display: inline-block;
  484. vertical-align: middle;
  485. }
  486. .operate-say {
  487. text-align: center;
  488. margin-bottom: .73rem;
  489. .operate-say-btn {
  490. width: 3rem;
  491. height: .54rem;
  492. line-height: .54rem;
  493. text-align: center;
  494. font-size: .28rem;
  495. background: #fff;
  496. color: #3f84f6;
  497. border: 1px solid #3f84f6;
  498. border-radius: .08rem;
  499. &.refuse {
  500. color: #666;
  501. border-color: #e5e5e5;
  502. margin-left: .2rem;
  503. position: relative;
  504. img {
  505. width: .1rem;
  506. position: absolute;
  507. right: .21rem;
  508. top: .25rem;
  509. }
  510. ul {
  511. position: absolute;
  512. width: 3rem;
  513. li {
  514. height: .58rem;
  515. line-height: .58rem;
  516. padding-left: .16rem;
  517. font-size: .28rem;
  518. color: #666;
  519. background: #fff;
  520. text-align: left;
  521. border: 1px solid #e5e5e5;
  522. border-bottom-left-radius: .08rem;
  523. border-bottom-right-radius: .08rem;
  524. border-top: none;
  525. &:active, &:hover, &:focus {
  526. background: #dbf0fd;
  527. color: #333;
  528. }
  529. }
  530. }
  531. }
  532. }
  533. }
  534. &.long {
  535. .operate-say {
  536. margin-bottom: 3rem;
  537. }
  538. }
  539. }
  540. }
  541. .is-vendor {
  542. .base-info {
  543. .content-title {
  544. color: #3f84f6;
  545. font-size: .28rem;
  546. font-weight: bold;
  547. height: .82rem;
  548. line-height: .82rem;
  549. border-bottom: 1px solid #d3d3d3;
  550. margin-bottom: .1rem;
  551. span {
  552. width: 5.62rem;
  553. }
  554. img {
  555. width: .76rem;
  556. }
  557. }
  558. }
  559. .say-info {
  560. border-top: 1px solid #d3d3d3;
  561. .inline-block {
  562. width: 50%;
  563. margin-top: .1rem;
  564. }
  565. .price {
  566. margin-top: .1rem;
  567. }
  568. }
  569. }
  570. .say-price-btn {
  571. margin: .37rem auto 0;
  572. }
  573. }
  574. }
  575. }
  576. </style>