SayPriceInfo.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587
  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. import {deepCopy} from '~utils/baseUtils'
  217. export default {
  218. data () {
  219. return {
  220. activeIndex: -1,
  221. remindText: '',
  222. timeoutCount: 0,
  223. qutationsTemp: [],
  224. refusereason: ''
  225. }
  226. },
  227. components: {
  228. RemindBox
  229. },
  230. props: ['agreed', 'userType'],
  231. filters: {
  232. date: function (date) {
  233. if (date) {
  234. const d = new Date(Number(date))
  235. const year = d.getFullYear()
  236. const monthTemp = d.getMonth() + 1
  237. const month = monthTemp < 10 ? '0' + monthTemp : '' + monthTemp
  238. const day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate() + ' '
  239. return year + '-' + month + '-' + day
  240. } else {
  241. return '-'
  242. }
  243. },
  244. userNameFilter (str) {
  245. return str ? str.substring(0, 1) + '**' : '-'
  246. }
  247. },
  248. computed: {
  249. purchaseDetail () {
  250. let obj = {}
  251. if (this.isBuyer) {
  252. obj = deepCopy(this.$store.state.applyPurchase.purchaseManList.buyerInquiryDetail.data)
  253. if (obj.qutations) {
  254. this.qutationsTemp = obj.qutations
  255. for (let i = 0; i < this.qutationsTemp.length; i++) {
  256. this.$set(this.qutationsTemp[i], 'showRefuseList', false)
  257. }
  258. }
  259. } else {
  260. obj = this.$store.state.applyPurchase.purchaseManList.vendorInquiryDetail.data
  261. }
  262. return obj
  263. },
  264. user () {
  265. return this.$store.state.option.user
  266. },
  267. isBuyer () {
  268. return this.$route.query.type === 'buyer' || this.userType === 'buyer'
  269. }
  270. },
  271. methods: {
  272. cancel: function () {
  273. this.$emit('cancelSayPriceInfoAction', false)
  274. },
  275. selectQutation: function (index) {
  276. this.activeIndex = this.activeIndex === index ? -1 : index
  277. },
  278. acceptQutation: function (item) {
  279. // if (this.activeIndex > -1) {
  280. // } else {
  281. // // this.$message.success('请选择报价信息')
  282. // this.onRemind('请选择报价信息')
  283. // }
  284. this.$http.post('/inquiry/buyer/adopt?id=' + item.id + '&status=1')
  285. .then(response => {
  286. // this.$message.success('采纳成功')
  287. this.onRemind('采纳成功')
  288. // this.$emit('cancelSayPriceInfoAction', true)
  289. item.agreed = 1
  290. // 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})
  291. }, err => {
  292. console.log(err)
  293. // this.$message.success('系统错误')
  294. this.onRemind(err.response.data.message || '系统错误')
  295. })
  296. },
  297. onRemind: function (str) {
  298. this.remindText = str
  299. this.timeoutCount ++
  300. },
  301. selectRefuse: function (item, reason) {
  302. item.showRefuseList = false
  303. this.$http.post(`/inquiry/buyer/refuse?id=${item.id}&status=0&refusereason=${encodeURIComponent(reason)}`)
  304. .then(res => {
  305. item.agreed = 0
  306. this.onRemind('拒绝报价成功')
  307. item.refusereason = reason
  308. }, err => {
  309. this.onRemind(err.response.data.message || '拒绝报价失败,系统错误')
  310. console.log(err)
  311. })
  312. },
  313. setShowRefuseList: function (item, flag) {
  314. // console.log(flag)
  315. item.showRefuseList = flag
  316. }
  317. },
  318. mounted() {
  319. this.$nextTick(() => {
  320. // console.log('start')
  321. this._initscroll()
  322. })
  323. }
  324. }
  325. </script>
  326. <style lang="scss" scoped>
  327. .mobile-modal {
  328. .mobile-modal-box {
  329. top: 1.66rem;
  330. left: 3%;
  331. right: 3%;
  332. bottom: 1.66rem;
  333. width: 7rem;
  334. margin: 0 auto;
  335. background: #fff;
  336. .icon-guanbi {
  337. position: absolute;
  338. right: -.25rem;
  339. font-size: .6rem;
  340. top: -.4rem;
  341. color: #fff;
  342. z-index: 1;
  343. }
  344. .say-price-info {
  345. /*background: #f3f3f3;*/
  346. /*padding: .18rem 0 0 0;*/
  347. width: 100%;
  348. overflow: hidden;
  349. max-height: 90%;
  350. position: relative;
  351. margin-top: .1rem;
  352. .refused-txt {
  353. span{
  354. color: #ef5042;
  355. }
  356. }
  357. .base-info {
  358. margin: 0 auto;
  359. /*border-bottom: .18rem solid #f3f3f3;*/
  360. /* &:last-child {
  361. margin-bottom: 0;
  362. }*/
  363. &.say-info {
  364. /*height: 4.54rem;*/
  365. position: relative;
  366. /* margin-top: .18rem;*/
  367. > img {
  368. position: absolute;
  369. right: 0;
  370. top: 0;
  371. width: 1rem;
  372. height: 1rem;
  373. }
  374. .content-line {
  375. width: 4.55rem;
  376. span {
  377. color: #333;
  378. }
  379. &.date {
  380. span {
  381. color: #ef5042;
  382. }
  383. }
  384. }
  385. > p {
  386. font-size: .24rem;
  387. color: #999;
  388. }
  389. .price-level {
  390. font-size: .26rem;
  391. /*position: absolute;*/
  392. /*top: 1.3rem;*/
  393. /*right: .3rem;*/
  394. position: relative;
  395. bottom: .3rem;
  396. width: 4.4rem;
  397. text-align: center;
  398. margin-left: 2rem;
  399. p {
  400. margin-bottom: .1rem;
  401. span {
  402. color: #666;
  403. }
  404. }
  405. ul {
  406. li {
  407. height: .52rem;
  408. span {
  409. height: .52rem;
  410. line-height: .52rem;
  411. padding-left: .22rem;
  412. text-align: left;
  413. display: inline-block;
  414. border-top: .02rem solid #7e7e7e;
  415. border-left: .02rem solid #7e7e7e;
  416. overflow: hidden;
  417. text-overflow: ellipsis;
  418. white-space: nowrap;
  419. width: 50%;
  420. &:last-child {
  421. border-right: .02rem solid #7e7e7e;
  422. }
  423. }
  424. &:last-child {
  425. border-bottom: .02rem solid #7e7e7e;
  426. }
  427. }
  428. }
  429. &.vendor {
  430. margin: .15rem auto 0;
  431. }
  432. }
  433. }
  434. }
  435. .price {
  436. margin-top: .3rem;
  437. span {
  438. width: 1.4rem;
  439. color: #666;
  440. font-size: .28rem;
  441. display: inline-block;
  442. float: left;
  443. }
  444. table {
  445. float: left;
  446. margin: 0 0 .32rem 0;
  447. }
  448. }
  449. .is-buyer {
  450. height: 100%;
  451. .base {
  452. background: #3f84f6;
  453. color: #fff;
  454. margin: 0 .1rem .1rem .1rem;
  455. border-radius: .1rem;
  456. .content-line {
  457. span {
  458. color: #fff;
  459. }
  460. }
  461. }
  462. .say {
  463. .content-title {
  464. border-bottom: 1px solid #d3d3d3;
  465. font-size: .28rem;
  466. font-weight: bold;
  467. height: .81rem;
  468. line-height: .81rem;
  469. .vend-name {
  470. width: 5rem;
  471. }
  472. img {
  473. width: .69rem;
  474. margin-left: .2rem;
  475. }
  476. i {
  477. display: inline-block;
  478. width: .4rem;
  479. height: .4rem;
  480. line-height: .4rem;
  481. color: #fff;
  482. font-weight: bold;
  483. font-style: normal;
  484. background: #3f84f6;
  485. border-radius: .05rem;
  486. text-align: center;
  487. margin-right: .12rem;
  488. }
  489. }
  490. .content-line {
  491. width: 50%;
  492. margin-top: .3rem;
  493. display: inline-block;
  494. vertical-align: middle;
  495. }
  496. .operate-say {
  497. text-align: center;
  498. margin-bottom: .73rem;
  499. .operate-say-btn {
  500. width: 3rem;
  501. height: .54rem;
  502. line-height: .54rem;
  503. text-align: center;
  504. font-size: .28rem;
  505. background: #fff;
  506. color: #3f84f6;
  507. border: 1px solid #3f84f6;
  508. border-radius: .08rem;
  509. &.refuse {
  510. color: #666;
  511. border-color: #e5e5e5;
  512. margin-left: .2rem;
  513. position: relative;
  514. img {
  515. width: .1rem;
  516. position: absolute;
  517. right: .21rem;
  518. top: .25rem;
  519. }
  520. ul {
  521. position: absolute;
  522. width: 3rem;
  523. li {
  524. height: .58rem;
  525. line-height: .58rem;
  526. padding-left: .16rem;
  527. font-size: .28rem;
  528. color: #666;
  529. background: #fff;
  530. text-align: left;
  531. border: 1px solid #e5e5e5;
  532. border-bottom-left-radius: .08rem;
  533. border-bottom-right-radius: .08rem;
  534. border-top: none;
  535. &:active, &:hover, &:focus {
  536. background: #dbf0fd;
  537. color: #333;
  538. }
  539. }
  540. }
  541. }
  542. }
  543. }
  544. &.long {
  545. .operate-say {
  546. margin-bottom: 3rem;
  547. }
  548. }
  549. }
  550. }
  551. .is-vendor {
  552. height: 100%;
  553. .base-info {
  554. .content-title {
  555. color: #3f84f6;
  556. font-size: .28rem;
  557. font-weight: bold;
  558. height: .82rem;
  559. line-height: .82rem;
  560. border-bottom: 1px solid #d3d3d3;
  561. margin-bottom: .1rem;
  562. span {
  563. width: 5.62rem;
  564. }
  565. img {
  566. width: .76rem;
  567. }
  568. }
  569. }
  570. .say-info {
  571. border-top: 1px solid #d3d3d3;
  572. .inline-block {
  573. width: 50%;
  574. margin-top: .1rem;
  575. }
  576. .price {
  577. margin-top: .1rem;
  578. }
  579. }
  580. }
  581. .say-price-btn {
  582. margin: .37rem auto .7rem;
  583. }
  584. }
  585. }
  586. }
  587. </style>