SayPriceInfo.vue 12 KB

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