SayPriceInfo.vue 22 KB

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