SayPriceInfo.vue 11 KB

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