SayPriceInfo.vue 21 KB

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