SayPriceInfo.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. <template>
  2. <div class="mobile-modal">
  3. <div class="mobile-modal-box">
  4. <div class="mobile-modal-header">{{agreed == 1 ? '已采纳' : '已报价'}}<i class="icon-guanbi iconfont" @click="cancel"></i></div>
  5. <div class="say-price-info">
  6. <div v-if="isBuyer">
  7. <div class="base-info">
  8. <div class="content-line">
  9. 型号:<span>{{purchaseDetail.cmpCode || '-'}}</span>
  10. </div>
  11. <div class="content-line">
  12. 品牌:<span>{{purchaseDetail.inbrand || '-'}}</span>
  13. </div>
  14. <div class="content-line">
  15. 规格:<span>{{purchaseDetail.spec || '-'}}</span>
  16. </div>
  17. <div class="content-line">
  18. 采购数量:<span>{{purchaseDetail.needquantity || '-'}}</span>
  19. </div>
  20. <div class="content-line">
  21. 币种:<span>{{purchaseDetail.currency || '不限'}}</span>
  22. </div>
  23. <div class="content-line">
  24. 截止日期:<span>{{purchaseDetail.endDate | date}}</span>
  25. </div>
  26. </div>
  27. <div class="base-info">
  28. <div class="content-line">
  29. 买家:<span>{{purchaseDetail.inquiry.enterprise.enName || purchaseDetail.userName}}</span>
  30. </div>
  31. <div class="content-line">
  32. 联系电话:<span>{{purchaseDetail.userTel || '-'}}</span>
  33. </div>
  34. </div>
  35. <div class="base-info say-info" v-for="(item, index) in purchaseDetail.qutations" @click="selectQutation(index)">
  36. <img v-if="agreed != 1 && (!item.agreed || item.agreed !== 1) && activeIndex == index" src="/images/mobile/@2x/applyPurchase/say-price-check.png" alt="">
  37. <img v-if="agreed != 1 && (!item.agreed || item.agreed !== 1) && activeIndex != index" src="/images/mobile/@2x/applyPurchase/say-price-default.png" alt="">
  38. <img v-if="item.agreed == 1" src="/images/mobile/@2x/applyPurchase/say-price-accept.png" alt="">
  39. <div class="content-line">
  40. {{item.vendName}}
  41. </div>
  42. <div class="content-line">
  43. 报价人:<span v-if="item.user">{{item.user.userName | userNameFilter}}</span>
  44. <span v-else>-</span>
  45. </div>
  46. <div class="content-line">
  47. 电话:<span v-if="item.user">{{item.user.userTel}}</span>
  48. <span v-else>-</span>
  49. </div>
  50. <div class="content-line date">
  51. 交期(天):<span>{{item.leadtime}}</span>
  52. </div>
  53. <p>{{item.offerTime | date}}</p>
  54. <div class="price-level">
  55. <p>价格梯度:<span>(pcs)</span></p>
  56. <ul>
  57. <li v-for="replie in item.replies">
  58. <span>{{replie.lapQty ? replie.lapQty + '+' : '-'}}</span>
  59. <span>{{replie.price ? (purchaseDetail.currency == 'USD' ? '$' : '¥') + replie.price : '-'}}</span>
  60. </li>
  61. </ul>
  62. </div>
  63. </div>
  64. <a class="say-price-btn" v-if="purchaseDetail.agreed != 1" @click="acceptQutation">采纳报价</a>
  65. </div>
  66. <div v-if="!isBuyer">
  67. <div class="base-info">
  68. <div class="content-line">
  69. 型号:<span>{{purchaseDetail.cmpCode || '-'}}</span>
  70. </div>
  71. <div class="content-line">
  72. 品牌:<span>{{purchaseDetail.inbrand || '-'}}</span>
  73. </div>
  74. <div class="content-line">
  75. 规格:<span>{{purchaseDetail.spec || '-'}}</span>
  76. </div>
  77. <div class="content-line">
  78. 采购数量:<span>{{purchaseDetail.needquantity || '-'}}</span>
  79. </div>
  80. <div class="content-line">
  81. 币种:<span>{{purchaseDetail.currency || '不限'}}</span>
  82. </div>
  83. <div class="content-line">
  84. 截止日期:<span>{{purchaseDetail.endDate | date}}</span>
  85. </div>
  86. <div class="content-line">
  87. 买家:<span>{{purchaseDetail.inquiry.enterprise.enName || purchaseDetail.userName}}</span>
  88. </div>
  89. <div class="content-line">
  90. 联系电话:<span>{{purchaseDetail.userTel || '-'}}</span>
  91. </div>
  92. </div>
  93. <div class="base-info">
  94. <div class="content-line">
  95. 报价人:<span v-if="purchaseDetail.user">{{purchaseDetail.user.userName | userNameFilter}}</span>
  96. <span v-else>-</span>
  97. </div>
  98. <div class="content-line">
  99. 联系电话:<span v-if="purchaseDetail.user">{{purchaseDetail.user.userTel || '-'}}</span>
  100. <span v-else>-</span>
  101. </div>
  102. </div>
  103. <div class="base-info say-info">
  104. <div class="content-line date">
  105. 交期(天):<span>{{purchaseDetail.leadtime}}</span>
  106. </div>
  107. <p>{{purchaseDetail.offerTime | date}}</p>
  108. <div class="price-level vendor">
  109. <p>价格梯度:<span>(pcs)</span></p>
  110. <ul>
  111. <li v-for="replie in purchaseDetail.replies">
  112. <span>{{replie.lapQty ? replie.lapQty + '+' : '-'}}</span>
  113. <span>{{replie.price ? (purchaseDetail.currency == 'USD' ? '$' : '¥') + replie.price : '-'}}</span>
  114. </li>
  115. </ul>
  116. </div>
  117. </div>
  118. </div>
  119. <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
  120. </div>
  121. </div>
  122. </div>
  123. </template>
  124. <script>
  125. import {RemindBox} from '~components/mobile/common'
  126. export default {
  127. data () {
  128. return {
  129. activeIndex: -1,
  130. remindText: '',
  131. timeoutCount: 0
  132. }
  133. },
  134. components: {
  135. RemindBox
  136. },
  137. props: ['agreed'],
  138. filters: {
  139. date: function (date) {
  140. if (date) {
  141. const d = new Date(Number(date))
  142. const year = d.getFullYear()
  143. const monthTemp = d.getMonth() + 1
  144. const month = monthTemp < 10 ? '0' + monthTemp : '' + monthTemp
  145. const day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate() + ' '
  146. return year + '-' + month + '-' + day
  147. } else {
  148. return '-'
  149. }
  150. },
  151. userNameFilter (str) {
  152. return str ? str.substring(0, 1) + '**' : '-'
  153. }
  154. },
  155. computed: {
  156. purchaseDetail () {
  157. return this.isBuyer ? this.$store.state.applyPurchase.purchaseManList.buyerInquiryDetail.data : this.$store.state.applyPurchase.purchaseManList.vendorInquiryDetail.data
  158. },
  159. user () {
  160. return this.$store.state.option.user
  161. },
  162. isBuyer () {
  163. return this.$route.query.type === 'buyer'
  164. }
  165. },
  166. methods: {
  167. cancel: function () {
  168. this.$emit('cancelSayPriceInfoAction', false)
  169. },
  170. selectQutation: function (index) {
  171. this.activeIndex = this.activeIndex === index ? -1 : index
  172. },
  173. acceptQutation: function () {
  174. if (this.activeIndex > -1) {
  175. let obj = this.purchaseDetail.qutations[this.activeIndex]
  176. this.$http.post('/inquiry/buyer/decide?id=' + obj.id + '&status=1')
  177. .then(response => {
  178. // this.$message.success('采纳成功')
  179. // this.onRemind('采纳成功')
  180. this.$emit('cancelSayPriceInfoAction', true)
  181. // 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})
  182. }, err => {
  183. console.log(err)
  184. // this.$message.success('系统错误')
  185. this.onRemind('系统错误')
  186. })
  187. } else {
  188. // this.$message.success('请选择报价信息')
  189. this.onRemind('请选择报价信息')
  190. }
  191. },
  192. onRemind: function (str) {
  193. this.remindText = str
  194. this.timeoutCount ++
  195. }
  196. }
  197. }
  198. </script>
  199. <style lang="scss" scoped>
  200. .mobile-modal {
  201. .mobile-modal-box {
  202. top: 5%;
  203. left: 3%;
  204. right: 3%;
  205. bottom: 5%;
  206. width: auto;
  207. .say-price-info {
  208. background: #f3f3f3;
  209. padding: .18rem 0;
  210. width: 100%;
  211. overflow-y: auto;
  212. height: 90%;
  213. .base-info {
  214. &.say-info {
  215. /*height: 4.54rem;*/
  216. position: relative;
  217. > img {
  218. position: absolute;
  219. right: 0;
  220. top: 0;
  221. width: 1rem;
  222. height: 1rem;
  223. }
  224. .content-line {
  225. width: 4.55rem;
  226. span {
  227. color: #333;
  228. }
  229. &.date {
  230. span {
  231. color: #ef5042;
  232. }
  233. }
  234. }
  235. > p {
  236. font-size: .24rem;
  237. color: #999;
  238. }
  239. .price-level {
  240. font-size: .26rem;
  241. /*position: absolute;*/
  242. /*top: 1.3rem;*/
  243. /*right: .3rem;*/
  244. position: relative;
  245. bottom: .3rem;
  246. width: 4rem;
  247. text-align: center;
  248. margin-left: 2rem;
  249. p {
  250. margin-bottom: .1rem;
  251. span {
  252. color: #666;
  253. }
  254. }
  255. ul {
  256. li {
  257. height: .52rem;
  258. span {
  259. height: .52rem;
  260. line-height: .52rem;
  261. padding-left: .22rem;
  262. text-align: left;
  263. display: inline-block;
  264. border-top: .02rem solid #7e7e7e;
  265. border-left: .02rem solid #7e7e7e;
  266. overflow: hidden;
  267. text-overflow: ellipsis;
  268. white-space: nowrap;
  269. &:first-child {
  270. width: 45%;
  271. }
  272. &:last-child {
  273. width: 55%;
  274. border-right: .02rem solid #7e7e7e;
  275. }
  276. }
  277. &:last-child {
  278. border-bottom: .02rem solid #7e7e7e;
  279. }
  280. }
  281. }
  282. &.vendor {
  283. margin: .15rem auto 0;
  284. }
  285. }
  286. }
  287. }
  288. .say-price-btn {
  289. margin: .37rem auto .7rem;
  290. }
  291. }
  292. }
  293. }
  294. </style>