SayPriceInfo.vue 11 KB

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