ApplyInfo.vue 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088
  1. <template>
  2. <div class="apply-info">
  3. <div class="apply-info-title">
  4. <p>最新求购信息</p>
  5. <span>海量求购,一网打尽</span>
  6. <div>
  7. <input type="text" class="form-control" v-model="keyWord" @keyup.13="searchList" placeholder="型号/品牌" />
  8. <span @click="searchList">查询</span>
  9. </div>
  10. </div>
  11. <div class="apply-info-list">
  12. <p>
  13. <span>发布时间
  14. <a href="javascript:void(0)" @click="sortListByParam('releaseDate')">
  15. <i class=" fa fa-long-arrow-up" :class="{active: sorting.releaseDate == 'ASC'}"></i>
  16. <i class=" fa fa-long-arrow-down" :class="{active: sorting.releaseDate == 'DESC'}"></i>
  17. </a>
  18. </span>
  19. <span>买家</span>
  20. <span>型号</span>
  21. <span>品牌</span>
  22. <span>截止时间
  23. <a href="javascript:void(0)" @click="sortListByParam('deadline')">
  24. <i class=" fa fa-long-arrow-up" :class="{active: sorting.deadline == 'ASC'}"></i>
  25. <i class=" fa fa-long-arrow-down" :class="{active: sorting.deadline == 'DESC'}"></i>
  26. </a>
  27. </span>
  28. <span>已报价
  29. <a href="javascript:void(0)" @click="sortListByParam('offerAmount')">
  30. <i class=" fa fa-long-arrow-up" :class="{active: sorting.offerAmount == 'ASC'}"></i>
  31. <i class=" fa fa-long-arrow-down" :class="{active: sorting.offerAmount == 'DESC'}"></i>
  32. </a>
  33. </span>
  34. <span>操作</span>
  35. </p>
  36. <ul>
  37. <li v-for="(purchaseMan, index) in purchaseManList.content" :class="{'active': purchaseMan.active}">
  38. <div>{{purchaseMan.date| date}}</div>
  39. <div :title="purchaseMan.userName || purchaseMan.inquiry.enterprise.enName || '-'">{{purchaseMan.userName || purchaseMan.inquiry.enterprise.enName || '-'}}</div>
  40. <div :title="purchaseMan.cmpCode">{{purchaseMan.cmpCode || '-'}}</div>
  41. <div :title="purchaseMan.inbrand">{{purchaseMan.inbrand || '-'}}</div>
  42. <div class="date-content"><span>剩余&nbsp;</span><span v-if="getDay(purchaseMan.remainingTime) > 0" v-text="getDay(purchaseMan.remainingTime)"></span><i v-if="getDay(purchaseMan.remainingTime) > 0">&nbsp;天&nbsp;</i><span v-if="getDay(purchaseMan.remainingTime) <= 0" v-text="getHours(purchaseMan.remainingTime)"></span><i v-if="getDay(purchaseMan.remainingTime) <= 0" >&nbsp;小时</i></div>
  43. <div class="number-content"><img src="/images/applyPurchase/hot-fire.png" alt="" v-if="purchaseMan.offerAmount > 10"><span :style="purchaseMan.offerAmount > 10 ? 'color: #ff9a00': ''">{{purchaseMan.offerAmount || 0}}</span>&nbsp;条</div>
  44. <div class="btn-content">
  45. <a>联系买家</a>
  46. <a v-if="!purchaseMan.quoted || purchaseMan.quoted != 1" @click="sayPrice(purchaseMan, index)">我要报价</a>
  47. <div class="is-say-price" v-else>已报价 <img src="/images/applyPurchase/green-check.png" alt="">
  48. <div class="say-price-history">
  49. <p class="price-title">历史报价</p>
  50. <div>
  51. <div>
  52. <span>交期:</span><span class="red-text">6 天</span>
  53. </div>
  54. <div>
  55. <span>附件:</span><a href="">下载</a>
  56. </div>
  57. <div class="pre-line">
  58. <span>规格:</span>2016-05-21
  59. </div>
  60. <p class="price-level">价格梯度</p>
  61. <ul>
  62. <li>
  63. <span>1333+</span>
  64. <span>$123123</span>
  65. </li>
  66. <li>
  67. <span>1333+</span>
  68. <span>$123123</span>
  69. </li>
  70. <li>
  71. <span>1333+</span>
  72. <span>$123123</span>
  73. </li>
  74. </ul>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. <div class="expand-content">
  80. <div>
  81. 封装:{{purchaseMan.encapsulation || '-'}}
  82. </div>
  83. <div>
  84. 采购数量:<span>{{purchaseMan.amount || '-'}}</span><span v-if="purchaseMan.amount">个</span>
  85. </div>
  86. <div>
  87. 单价预算:<span>{{purchaseMan.unitPrice ? (purchaseMan.currency == 'RMB' ? '¥' : '$') + purchaseMan.unitPrice : '-'}}</span>
  88. </div>
  89. <div>
  90. 规格:{{purchaseMan.produceDate || '-'}}
  91. </div>
  92. </div>
  93. <!--<div class="say-price">
  94. <div>报价</div>
  95. <div>
  96. <i>*</i>单价
  97. <select v-if="!purchaseMan.currency" v-model="sayPriceObj.currency">
  98. <option value="RMB">¥</option>
  99. <option value="USD">$</option>
  100. </select>
  101. <div v-if="purchaseMan.currency" v-text="purchaseMan.currency == 'RMB' ? '¥' : '$'"></div>
  102. <input type="number" v-model="sayPriceObj.unitPrice" class="form-control" @blur="onUnitPriceBlur" @input="onUnitPriceChange">
  103. </div>
  104. <div>
  105. <i>*</i>交期&nbsp;
  106. <input type="number" v-model="sayPriceObj.minDay" @blur="onMinDayInput" @input="onMinDayChange" class="form-control">&nbsp;-&nbsp;<input type="number" v-model="sayPriceObj.maxDay" @blur="onMaxDayInput" @input="onMaxDayChange" class="form-control">&nbsp;天
  107. </div>
  108. <div>
  109. 生产日期&nbsp;<input v-model="sayPriceObj.produceDate" @input="onProduceDateChange" type="text" class="form-control">
  110. </div>
  111. <div>
  112. <span @click="cancelSayPrice(purchaseMan)">取消</span>
  113. <span @click="commitSayPrice(purchaseMan)">提交</span>
  114. </div>
  115. </div>-->
  116. </li>
  117. </ul>
  118. </div>
  119. <div class="modal-wrap" v-if="currentSayPriceIndex > -1">
  120. <div class="say-price-box" >
  121. <div class="title">
  122. <div>型号:<span :title="purchaseManList.content[currentSayPriceIndex].cmpCode">{{purchaseManList.content[currentSayPriceIndex].cmpCode}}</span></div>
  123. <div>品牌:<span :title="purchaseManList.content[currentSayPriceIndex].inbrand">{{purchaseManList.content[currentSayPriceIndex].inbrand}}</span></div>
  124. <i class="fa fa-close" @click="cancelSayPrice"></i>
  125. </div>
  126. <div class="content">
  127. <div class="content-line">
  128. <div class="form-item form-left">
  129. <span><i>*</i>交期:</span>
  130. <input type="number" class="form-control" placeholder="天数" @input="onLeadtimeInput" @blur="onLeadtimeBlur" v-model="sayPriceObj.leadtime">
  131. <!-- -
  132. <input type="text" class="form-control" placeholder="天数">-->
  133. </div>
  134. <div class="form-item form-upload">
  135. <label>
  136. <span><i>+</i>添加附件</span>
  137. <input type="file">
  138. </label>
  139. <!--<div>
  140. <span>我是Excel的名字111</span>
  141. <i class="fa fa-times-circle"></i>
  142. <a href="">更换</a>
  143. </div>-->
  144. </div>
  145. </div>
  146. <div class="content-line" v-for="(reply, index) in sayPriceObj.replies">
  147. <div class="form-item form-left">
  148. <span><i>*</i>价格梯度:</span>
  149. <input type="number" class="form-control" @blur="onReplyLapQtyBlur(index)" v-model="reply.lapQty" placeholder="数量">
  150. <!-- -
  151. <input type="text" class="form-control" placeholder="数量">-->
  152. </div>
  153. <div class="form-item form-right">
  154. <span><i>*</i>单价({{purchaseManList.content[currentSayPriceIndex].currency == 'USD' ? '$' : '¥'}}):</span>
  155. <input type="number" class="form-control" @input="onReplyPriceInput(index)" @blur="onReplyPriceBlur(index)" placeholder="单价" v-model="reply.price">
  156. <i class="fa fa-minus-circle" v-if="sayPriceObj.replies.length > 1" @click="setReplies('sub', index)"></i>
  157. <i class="fa fa-plus-circle" v-if="sayPriceObj.replies.length < 5" @click="setReplies('add', index)"></i>
  158. </div>
  159. </div>
  160. </div>
  161. <div class="operate">
  162. <span @click="commitSayPrice">确定</span>
  163. <span @click="cancelSayPrice">取消</span>
  164. </div>
  165. </div>
  166. </div>
  167. <page :total="totalCount" :page-size="pageSize"
  168. :current="nowPage" v-on:childEvent="listenPage"></page>
  169. <loading v-show="showLoading"></loading>
  170. </div>
  171. </template>
  172. <script>
  173. // let getRealLen = function (str) {
  174. // let len = 0
  175. // for (let i = 0; i < str.length; i++) {
  176. // if (str.charCodeAt(i) > 127 || str.charCodeAt(i) === 94) {
  177. // len += 2
  178. // } else {
  179. // len++
  180. // }
  181. // }
  182. // return len
  183. // }
  184. // let cutOutString = function (str, length) {
  185. // for (let i = 1; i <= str.length; i++) {
  186. // if (getRealLen(str.substr(0, i)) > length) {
  187. // str = str.substr(0, i - 1)
  188. // break
  189. // }
  190. // }
  191. // return str
  192. // }
  193. import Page from '~components/common/page/pageComponent.vue'
  194. import Loading from '~components/common/loading/PageLoading.vue'
  195. export default {
  196. data () {
  197. return {
  198. pageSize: 10,
  199. nowPage: 1,
  200. sayPriceObj: {
  201. currency: 'RMB',
  202. leadtime: '',
  203. replies: [
  204. {
  205. lapQty: '',
  206. price: ''
  207. }
  208. ]
  209. },
  210. validSayPrice: {
  211. leadtime: false,
  212. repliesPrice: false,
  213. repliesLapQty: false
  214. },
  215. keyWord: '',
  216. sorting: {},
  217. showLoading: false,
  218. currentSayPriceIndex: -1
  219. }
  220. },
  221. components: {
  222. Page,
  223. Loading
  224. },
  225. filters: {
  226. date: function (date) {
  227. const d = new Date(Number(date))
  228. const year = d.getFullYear()
  229. const monthTemp = d.getMonth() + 1
  230. const month = monthTemp < 10 ? '0' + monthTemp : '' + monthTemp
  231. const hour = d.getHours() < 10 ? '0' + d.getHours() : '' + d.getHours()
  232. const minutes = d.getMinutes() < 10 ? '0' + d.getMinutes() : '' + d.getMinutes() + ' '
  233. const day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate() + ' '
  234. return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes
  235. },
  236. phone: function (str) {
  237. return str.substring(0, 3) + '****' + str.substring(7, 11)
  238. }
  239. },
  240. computed: {
  241. purchaseManList () {
  242. return this.$store.state.applyPurchase.purchaseManList.purchaseManList.data
  243. },
  244. totalCount () {
  245. return this.purchaseManList.totalElements
  246. },
  247. user () {
  248. return this.$store.state.option.user
  249. }
  250. },
  251. methods: {
  252. getDay: function (timeStamp) {
  253. return Math.floor(timeStamp / (1000 * 60 * 60 * 24))
  254. },
  255. getHours: function (timeStamp) {
  256. return Math.floor((timeStamp / (1000 * 60 * 60)) % 24)
  257. },
  258. // getPurchaseManName: function (purchaseMan) {
  259. // return purchaseMan.enUu ? purchaseMan.userName : purchaseMan.userName.charAt(0) + '**'
  260. // },
  261. listenPage: function (page) {
  262. this.nowPage = page
  263. this.resetList()
  264. },
  265. sayPrice: function (purchaseMan, index) {
  266. let _this = this
  267. for (let i = 0; i < this.purchaseManList.content.length; i++) {
  268. _this.purchaseManList.content[i].active = false
  269. }
  270. this.resetSayPrice()
  271. purchaseMan.active = true
  272. this.currentSayPriceIndex = index
  273. },
  274. cancelSayPrice: function () {
  275. this.purchaseManList.content[this.currentSayPriceIndex].active = false
  276. this.currentSayPriceIndex = -1
  277. },
  278. commitSayPrice: function () {
  279. if (this.user.logged) {
  280. if (this.user.data.enterprise.uu) {
  281. let purchaseMan = this.purchaseManList.content[this.currentSayPriceIndex]
  282. this.showLoading = true
  283. purchaseMan.leadtime = this.sayPriceObj.leadtime
  284. purchaseMan.replies = this.sayPriceObj.replies
  285. purchaseMan.vendUU = this.user.data.enterprise.uu
  286. purchaseMan.vendorUserUU = this.user.data.userUU
  287. this.$http.post('/inquiry/sale/item/save', purchaseMan).then(response => {
  288. this.showLoading = false
  289. if (response.data.success === false) {
  290. this.$message.error(response.data.message)
  291. } else {
  292. this.$message.success('报价成功')
  293. this.resetSayPrice()
  294. this.resetList()
  295. }
  296. }, error => {
  297. console.log(error)
  298. this.$message.error('系统错误')
  299. this.showLoading = false
  300. })
  301. } else {
  302. this.$message.error('个人账户不可报价')
  303. }
  304. // if (this.checkAllSayPrice()) {
  305. // } else {
  306. // if (!this.validSayPrice.unitPrice) {
  307. // if (!this.sayPriceObj.unitPrice) {
  308. // this.$message.error('单价不能为空')
  309. // } else {
  310. // this.$message.error('单价必须是大于0的数字')
  311. // }
  312. // } else if (!this.validSayPrice.minDay || !this.validSayPrice.maxDay) {
  313. // if ((!this.sayPriceObj.minDay && this.sayPriceObj.minDay !== 0) || (!this.sayPriceObj.maxDay && this.sayPriceObj.maxDay !== 0)) {
  314. // this.$message.error('交期不能为空')
  315. // } else {
  316. // if (this.sayPriceObj.minDay > 31 || this.sayPriceObj.minDay < 1 || this.sayPriceObj.minDay.toString().indexOf('.') !== -1 || this.sayPriceObj.maxDay > 31 || this.sayPriceObj.maxDay < 1 || this.sayPriceObj.maxDay.toString().indexOf('.') !== -1) {
  317. // this.$message.error('交期只能填写1-31之间的整数值')
  318. // } else {
  319. // this.$message.error('最短交期应小于等于最长交期')
  320. // }
  321. // }
  322. // }
  323. // }
  324. } else {
  325. this.$router.push('/auth/login?returnUrl=' + window.location.href)
  326. }
  327. },
  328. resetList: function () {
  329. this.currentSayPriceIndex = -1
  330. this.$store.dispatch('applyPurchase/loadPurchaseManList', {pageNumber: this.nowPage, pageSize: this.pageSize, keyWord: this.keyWord, sorting: !this.sorting || JSON.stringify(this.sorting) === '{}' ? {releaseDate: 'DESC'} : this.sorting})
  331. },
  332. resetSayPrice: function () {
  333. this.sayPriceObj = {
  334. currency: 'RMB',
  335. leadtime: '',
  336. replies: [
  337. {
  338. lapQty: '',
  339. price: ''
  340. }
  341. ]
  342. }
  343. },
  344. onLeadtimeInput: function () {
  345. if (this.sayPriceObj.leadtime.length > 2) {
  346. this.sayPriceObj.leadtime = this.sayPriceObj.leadtime.substring(0, 2)
  347. }
  348. },
  349. onLeadtimeBlur: function () {
  350. if (!this.sayPriceObj.leadtime || this.sayPriceObj.leadtime < 1 || this.sayPriceObj.leadtime > 31 || this.sayPriceObj.leadtime.toString().indexOf('.') !== -1) {
  351. this.validSayPrice.leadtime = false
  352. this.$message.error('交期只能填写1-31之间的整数值')
  353. } else {
  354. this.validSayPrice.leadtime = true
  355. }
  356. },
  357. onReplyPriceInput: function (index) {
  358. let price = this.sayPriceObj.replies[index].price
  359. if (price >= 10000) {
  360. this.sayPriceObj.replies[index].price = price.substring(0, 4)
  361. } else if (price.indexOf('.') > -1) {
  362. let arr = price.split('.')
  363. if (arr[0].length > 4) {
  364. this.sayPriceObj.replies[index].price = Number(arr[0].substring(0, 4) + '.' + arr[1])
  365. } else if (arr[1].length > 6) {
  366. this.sayPriceObj.replies[index].price = Number(arr[0] + '.' + arr[1].substring(0, 6))
  367. }
  368. }
  369. },
  370. onReplyPriceBlur: function (index) {
  371. let price = this.sayPriceObj.replies[index].price
  372. if (price) {
  373. if (price <= 0) {
  374. this.$message.error('单价必须是大于0的数字')
  375. this.validSayPrice.repliesPrice = false
  376. } else {
  377. this.validSayPrice.repliesPrice = true
  378. }
  379. } else {
  380. this.$message.error('单价必须是大于0的数字')
  381. this.validSayPrice.repliesPrice = false
  382. }
  383. },
  384. onReplyLapQtyBlur: function (index) {
  385. let lapQty = this.sayPriceObj.replies[index].lapQty
  386. let limitDownObj = this.getLimitDown()
  387. if (!lapQty || lapQty < 1) {
  388. this.sayPriceObj.replies[index].lapQty = ''
  389. this.$message.error('输入值必须为正整数')
  390. this.validSayPrice.repliesLapQty = false
  391. } else if (limitDownObj.index !== index && limitDownObj.lapQty > lapQty) {
  392. this.$message.error('输入值必须大于#该梯度的下限#')
  393. this.sayPriceObj.replies[index].lapQty = ''
  394. this.validSayPrice.repliesLapQty = false
  395. } else if ((index - 1 >= 0 && this.sayPriceObj.replies[index - 1].lapQty >= lapQty) || (index + 1 <= 4 && this.sayPriceObj.replies[index + 1].lapQty <= lapQty)) {
  396. this.$message.error('输入值会导致梯度重叠,请重新修改')
  397. this.sayPriceObj.replies[index].lapQty = ''
  398. this.validSayPrice.repliesLapQty = false
  399. } else {
  400. this.validSayPrice.repliesLapQty = true
  401. }
  402. },
  403. getLimitDown: function () {
  404. for (let i = 0; i < this.sayPriceObj.replies.length; i++) {
  405. if (this.sayPriceObj.replies[i].lapQty) {
  406. return {
  407. lapQty: this.sayPriceObj.replies[i].lapQty,
  408. index: i
  409. }
  410. }
  411. }
  412. return {index: -1}
  413. },
  414. // onUnitPriceBlur: function () {
  415. // if (this.sayPriceObj.unitPrice) {
  416. // if (this.sayPriceObj.unitPrice <= 0) {
  417. // this.$message.error('单价必须是大于0的数字')
  418. // this.validSayPrice.unitPrice = false
  419. // } else {
  420. // this.validSayPrice.unitPrice = true
  421. // }
  422. // } else {
  423. // this.$message.error('单价必须是大于0的数字')
  424. // this.validSayPrice.unitPrice = false
  425. // }
  426. // },
  427. // onUnitPriceChange: function () {
  428. // let price = this.sayPriceObj.unitPrice
  429. // if (price >= 10000) {
  430. // this.sayPriceObj.unitPrice = price.substring(0, 4)
  431. // } else if (price.indexOf('.') > -1) {
  432. // let arr = price.split('.')
  433. // if (arr[0].length > 4) {
  434. // this.sayPriceObj.unitPrice = Number(arr[0].substring(0, 4) + '.' + arr[1])
  435. // } else if (arr[1].length > 6) {
  436. // this.sayPriceObj.unitPrice = Number(arr[0] + '.' + arr[1].substring(0, 6))
  437. // }
  438. // }
  439. // },
  440. // onMinDayInput: function () {
  441. // this.sayPriceObj.minDay = Number(this.sayPriceObj.minDay)
  442. // if (this.sayPriceObj.minDay < 1 || this.sayPriceObj.minDay > 31 || this.sayPriceObj.minDay.toString().indexOf('.') !== -1) {
  443. // this.validSayPrice.minDay = false
  444. // this.$message.error('交期只能填写1-31之间的整数值')
  445. // } else if (this.sayPriceObj.maxDay && this.sayPriceObj.maxDay < this.sayPriceObj.minDay) {
  446. // this.validSayPrice.minDay = false
  447. // this.$message.error('最短交期应小于等于最长交期')
  448. // } else {
  449. // this.validSayPrice.minDay = true
  450. // }
  451. // },
  452. // onMinDayChange: function () {
  453. // if (this.sayPriceObj.minDay.length > 2) {
  454. // this.sayPriceObj.minDay = this.sayPriceObj.minDay.substring(0, 2)
  455. // }
  456. // },
  457. // onMaxDayInput: function () {
  458. // this.sayPriceObj.maxDay = Number(this.sayPriceObj.maxDay)
  459. // if (this.sayPriceObj.maxDay < 1 || this.sayPriceObj.maxDay > 31 || this.sayPriceObj.maxDay.toString().indexOf('.') !== -1) {
  460. // this.validSayPrice.maxDay = false
  461. // this.$message.error('交期只能填写1-31之间的整数值')
  462. // } else if (this.sayPriceObj.minDay && this.sayPriceObj.maxDay < this.sayPriceObj.minDay) {
  463. // this.validSayPrice.maxDay = false
  464. // this.$message.error('最短交期应小于等于最长交期')
  465. // } else {
  466. // this.validSayPrice.maxDay = true
  467. // }
  468. // },
  469. // onMaxDayChange: function () {
  470. // if (this.sayPriceObj.maxDay.length > 2) {
  471. // this.sayPriceObj.maxDay = this.sayPriceObj.maxDay.substring(0, 2)
  472. // }
  473. // },
  474. // onProduceDateChange: function () {
  475. // if (this.sayPriceObj.produceDate && getRealLen(this.sayPriceObj.produceDate) > 12) {
  476. // this.sayPriceObj.produceDate = cutOutString(this.sayPriceObj.produceDate, 12)
  477. // }
  478. // },
  479. // checkAllSayPrice: function () {
  480. // return this.validSayPrice.unitPrice && this.validSayPrice.minDay && this.validSayPrice.maxDay
  481. // },
  482. searchList: function () {
  483. this.nowPage = 1
  484. this.resetList()
  485. },
  486. sortListByParam: function (param) {
  487. if (this.sorting[param]) {
  488. if (this.sorting[param] === 'ASC') {
  489. this.$set(this.sorting, param, 'DESC')
  490. } else {
  491. this.$delete(this.sorting, param)
  492. }
  493. } else {
  494. this.sorting = {}
  495. this.$set(this.sorting, param, 'ASC')
  496. }
  497. this.nowPage = 1
  498. this.resetList()
  499. },
  500. setReplies: function (type, index) {
  501. if (type === 'add' && this.sayPriceObj.replies.length < 5) {
  502. this.sayPriceObj.replies.splice(index + 1, 0, {
  503. lapQty: '',
  504. price: ''
  505. })
  506. } else if (type === 'sub' && this.sayPriceObj.replies.length > 1) {
  507. this.sayPriceObj.replies.splice(index, 1)
  508. }
  509. }
  510. }
  511. }
  512. </script>
  513. <style lang="scss" scoped>
  514. .apply-info {
  515. width: 1190px;
  516. margin: 0 auto;
  517. .apply-info-title {
  518. border-bottom: 1px solid #3975f4;
  519. >p {
  520. display: inline-block;
  521. width: 156px;
  522. height: 33px;
  523. line-height: 33px;
  524. color: #fff;
  525. background: #3975f4;
  526. font-size: 18px;
  527. text-align: center;
  528. border: {
  529. top-left-radius: 3px;
  530. top-right-radius: 3px;
  531. }
  532. margin: 0;
  533. }
  534. >span {
  535. color: #999;
  536. margin-left: 16px;
  537. }
  538. >div {
  539. float: right;
  540. height: 25px;
  541. line-height: 25px;
  542. >input {
  543. width: 241px;
  544. height: 25px;
  545. line-height: 25px;
  546. font-size: 13px;
  547. border: {
  548. top-right-radius: 0;
  549. bottom-right-radius: 0;
  550. }
  551. }
  552. >span {
  553. display: inline-block;
  554. width: 69px;
  555. color: #fff;
  556. background: #3975f4;
  557. text-align: center;
  558. margin: 0 6px 0 -1px;
  559. border: {
  560. top-right-radius: 3px;
  561. bottom-right-radius: 3px;
  562. }
  563. cursor: pointer;
  564. }
  565. >a {
  566. background: #ffa200;
  567. color: #fff;
  568. width: 79px;
  569. border-radius: 3px;
  570. text-align: center;
  571. display: inline-block;
  572. }
  573. }
  574. }
  575. .apply-info-list {
  576. >p {
  577. background: #ededed;
  578. height: 40px;
  579. line-height: 40px;
  580. margin: 9px 0 0 0;
  581. span {
  582. display: inline-block;
  583. text-align: center;
  584. a {
  585. i {
  586. color: #333;
  587. &.active {
  588. color: #5078cb;
  589. }
  590. }
  591. }
  592. &:nth-child(1) {
  593. width: 186px;
  594. }
  595. &:nth-child(2) {
  596. width: 106px;
  597. }
  598. &:nth-child(3) {
  599. width: 200px;
  600. }
  601. &:nth-child(4) {
  602. width: 174px;
  603. }
  604. &:nth-child(5) {
  605. width: 152px;
  606. }
  607. &:nth-child(6) {
  608. width: 158px;
  609. }
  610. &:nth-child(7) {
  611. width: 214px;
  612. }
  613. }
  614. }
  615. >ul {
  616. margin-bottom: 29px;
  617. > li {
  618. position: relative;
  619. min-height: 67px;
  620. line-height: 67px;
  621. border: 1px solid #ededed;
  622. >div {
  623. overflow-x: hidden;
  624. text-overflow: ellipsis;
  625. white-space: nowrap;
  626. display: inline-block;
  627. text-align: center;
  628. color: #3c3c3c;
  629. vertical-align: middle;
  630. &:nth-child(1) {
  631. width: 186px;
  632. }
  633. &:nth-child(2) {
  634. width: 106px;
  635. }
  636. &:nth-child(3) {
  637. width: 200px;
  638. }
  639. &:nth-child(4) {
  640. width: 174px;
  641. }
  642. &:nth-child(5) {
  643. width: 152px;
  644. }
  645. &:nth-child(6) {
  646. width: 158px;
  647. }
  648. &:nth-child(7) {
  649. width: 212px;
  650. }
  651. &.date-content {
  652. span {
  653. &:first-child {
  654. font-size: 12px;
  655. color: #666;
  656. }
  657. color: #f71026;
  658. }
  659. i {
  660. font-style: normal;
  661. }
  662. }
  663. &.number-content {
  664. span {
  665. color: #5392f9;
  666. &.active {
  667. color: #ff9a00;
  668. }
  669. }
  670. >img {
  671. margin-bottom: 5px;
  672. margin-right: 2px;
  673. }
  674. }
  675. &.btn-content {
  676. > a {
  677. display: inline-block;
  678. width: 71px;
  679. height: 28px;
  680. line-height: 28px;
  681. color: #fff;
  682. background: #3c7cf5;
  683. border-radius: 3px;
  684. cursor: pointer;
  685. &:first-child {
  686. background: #ffa200;
  687. margin-right: 10px;
  688. }
  689. }
  690. .is-say-price {
  691. display: inline-block;
  692. color: #39ae05;
  693. margin-left: 11px;
  694. img {
  695. margin-bottom: 2px;
  696. }
  697. .say-price-history {
  698. position: absolute;
  699. top: 53px;
  700. right: 11px;
  701. line-height: normal;
  702. width: 198px;
  703. height: 0;
  704. background: #fff;
  705. border: 1px solid #fab89a;
  706. z-index: 1;
  707. overflow: hidden;
  708. transition: height 1s;
  709. -moz-transition: height 1s; /* Firefox 4 */
  710. -webkit-transition: height 1s; /* Safari 和 Chrome */
  711. -o-transition: height 1s; /* Opera */
  712. opacity: 0;
  713. p {
  714. color: #020202;
  715. font-weight: bold;
  716. margin: 0;
  717. &.price-title {
  718. background: #fee6db;
  719. height: 28px;
  720. line-height: 28px;
  721. }
  722. &.price-level {
  723. margin: 6px 0;
  724. text-align: left;
  725. }
  726. }
  727. > div {
  728. padding: 9px 12px;
  729. > div {
  730. display: inline-block;
  731. text-align: left;
  732. &:nth-child(1) {
  733. float: left;
  734. }
  735. &:nth-child(2) {
  736. margin-left: 32px;
  737. }
  738. span {
  739. color: #020202;
  740. margin: 0;
  741. &.red-text {
  742. color: #f62d37;
  743. }
  744. }
  745. &.pre-line {
  746. display: block;
  747. padding: 13px 0;
  748. border-bottom: 1px dashed #fee6db;
  749. }
  750. }
  751. ul {
  752. li {
  753. color: #333;
  754. height: 22px;
  755. line-height: 22px;
  756. padding: 0 6px;
  757. &:nth-child(odd) {
  758. background: #f6f5f4;
  759. }
  760. span {
  761. color: #333;
  762. display: inline-block;
  763. text-align: left;
  764. width: 50%;
  765. margin: 0;
  766. }
  767. &:last-child {
  768. span {
  769. color: #4290f7;
  770. }
  771. }
  772. }
  773. }
  774. }
  775. }
  776. &:hover {
  777. .say-price-history {
  778. opacity: 1;
  779. /* animation: expand 1s infinite;
  780. -webkit-animation: expand 1s infinite; !*Safari and Chrome*!
  781. animation-iteration-count: 1;
  782. -webkit-animation-iteration-count: 1;*/
  783. height: 210px;
  784. }
  785. }
  786. /* @keyframes expand {
  787. from {bottom: 58px}
  788. to {bottom: auto}
  789. }
  790. @-webkit-keyframes expand {
  791. from {bottom: 58px}
  792. to {bottom: auto}
  793. }*/
  794. }
  795. }
  796. }
  797. .expand-content {
  798. display: none;
  799. justify-content: space-between;
  800. padding: 0 236px 0 36px;
  801. background: #fffbf0;
  802. height: 45px;
  803. line-height: 45px;
  804. color: #020202;
  805. div {
  806. display: inline-block;
  807. span {
  808. color: #f71026;
  809. }
  810. }
  811. }
  812. &:hover {
  813. box-shadow: 1.5px 3px 7px 0 rgb( 178, 178, 179 );
  814. .expand-content {
  815. display: flex;
  816. }
  817. }
  818. .say-price {
  819. background-color: #e7eef9;
  820. height: 64px;
  821. line-height: 64px;
  822. display: none;
  823. >div {
  824. display: inline-block;
  825. position: relative;
  826. height: 64px;
  827. line-height: 64px;
  828. input {
  829. border-radius: 3px;
  830. }
  831. &:nth-child(1) {
  832. width: 282px;
  833. background: url('/images/applyPurchase/say-price.png')no-repeat;
  834. text-align: center;
  835. margin-right: 44px;
  836. }
  837. &:nth-child(2) {
  838. margin-right: 39px;
  839. input {
  840. width: 118px;
  841. height: 26px;
  842. border: 1px solid #5392f9;
  843. }
  844. select {
  845. position: absolute;
  846. top: 19px;
  847. width: 32px;
  848. height: 26px;
  849. background: url('/images/applyPurchase/arrow-down.png')no-repeat right center;
  850. -webkit-box-shadow: none;
  851. -moz-box-shadow: none;
  852. box-shadow: none;
  853. border: {
  854. left: none;
  855. top: none;
  856. bottom: none;
  857. right: 1px solid #5392f9;
  858. bottom-left-radius: 4px;
  859. top-left-radius: 4px;
  860. }
  861. color: #5392f9;
  862. font: small-caption;
  863. padding-left: 8px;
  864. & + input {
  865. padding-left: 34px;
  866. }
  867. }
  868. div {
  869. position: absolute;
  870. top: 19px;
  871. left: 38px;
  872. width: 32px;
  873. height: 26px;
  874. line-height: 26px;
  875. text-align: center;
  876. border: {
  877. left: none;
  878. top: none;
  879. bottom: none;
  880. right: 1px solid #5392f9;
  881. bottom-left-radius: 4px;
  882. top-left-radius: 4px;
  883. }
  884. color: #5392f9;
  885. & + input {
  886. padding-left: 34px;
  887. }
  888. }
  889. }
  890. &:nth-child(3) {
  891. margin-right: 37px;
  892. input {
  893. width: 32px;
  894. height: 26px;
  895. padding: 0 0 0 6px;
  896. }
  897. }
  898. &:nth-child(4) {
  899. margin-right: 132px;
  900. input {
  901. width: 118px;
  902. height: 26px;
  903. }
  904. }
  905. &:nth-child(5) {
  906. span {
  907. width: 71px;
  908. height: 28px;
  909. line-height: 28px;
  910. text-align: center;
  911. display: inline-block;
  912. cursor: pointer;
  913. &:first-child {
  914. background: #dedddd;
  915. margin-right: 10px;
  916. }
  917. &:last-child {
  918. background: #fa4701;
  919. color: #fff;
  920. }
  921. }
  922. }
  923. i {
  924. color: #e41515;
  925. position: relative;
  926. top: 2px;
  927. right: 3px;
  928. }
  929. }
  930. }
  931. &.active {
  932. border-color: #f71026;
  933. box-shadow: none;
  934. .expand-content {
  935. display: flex;
  936. -webkit-box-shadow: none;
  937. -moz-box-shadow: none;
  938. box-shadow: none;
  939. }
  940. .say-price {
  941. display: block;
  942. }
  943. }
  944. }
  945. }
  946. }
  947. .page-wrap {
  948. text-align: right;
  949. float: none;
  950. }
  951. .say-price-box {
  952. position: fixed;
  953. width: 527px;
  954. top: 30%;
  955. left: 33%;
  956. border-radius: 5px;
  957. -webkit-box-shadow: 0 5px 15px rgba(0,0,0,.5);
  958. -moz-box-shadow: 0 5px 15px rgba(0,0,0,.5);
  959. box-shadow: 0 5px 15px rgba(0,0,0,.5);
  960. z-index: 1;
  961. .title {
  962. position: relative;
  963. height: 44px;
  964. background: #4290f7;
  965. line-height: 44px;
  966. color: #fff;
  967. > div {
  968. display: inline-block;
  969. padding-left: 66px;
  970. width: 49%;
  971. overflow: hidden;
  972. text-overflow: ellipsis;
  973. white-space: nowrap;
  974. }
  975. i {
  976. position: absolute;
  977. right: 10px;
  978. top: 8px;
  979. cursor: pointer;
  980. }
  981. }
  982. .content {
  983. padding: 9px 0;
  984. background: #fff;
  985. .content-line {
  986. margin: 0 0 14px 0;
  987. .form-item {
  988. display: inline-block;
  989. width: 49%;
  990. > span {
  991. i {
  992. color: #fd2637;
  993. margin-right: 4px;
  994. }
  995. }
  996. input {
  997. border: 1px solid #bfbfbf;
  998. border-radius: 2px;
  999. height: 28px;
  1000. }
  1001. &.form-left {
  1002. span {
  1003. display: inline-block;
  1004. width: 104px;
  1005. text-align: right;
  1006. }
  1007. input {
  1008. width: 64px;
  1009. }
  1010. }
  1011. &.form-upload {
  1012. text-align: center;
  1013. label {
  1014. margin-bottom: 0;
  1015. cursor: pointer;
  1016. input {
  1017. display: none;
  1018. }
  1019. span {
  1020. display: block;
  1021. width: 94px;
  1022. height: 23px;
  1023. line-height: 18px;
  1024. font-weight: normal;
  1025. color: #4290f7;
  1026. text-align: center;
  1027. border: 1px dashed #4290f7;
  1028. border-radius: 11px;
  1029. i {
  1030. font-weight: bold;
  1031. font-style: normal;
  1032. font-size: 18px;
  1033. margin-right: 5px;
  1034. }
  1035. }
  1036. }
  1037. div {
  1038. i {
  1039. cursor: pointer;
  1040. color: #eb222c;
  1041. font-size: 16px;
  1042. margin-right: 10px;
  1043. }
  1044. span {
  1045. display: inline-block;
  1046. max-width: 128px;
  1047. overflow: hidden;
  1048. text-overflow: ellipsis;
  1049. white-space: nowrap;
  1050. }
  1051. }
  1052. }
  1053. &.form-right {
  1054. padding-left: 13px;
  1055. input {
  1056. width: 101px;
  1057. }
  1058. > i {
  1059. margin-left: 4px;
  1060. }
  1061. }
  1062. }
  1063. }
  1064. }
  1065. .operate {
  1066. border-top: 1px solid #e4e5e6;
  1067. background: #fff;
  1068. height: 62px;
  1069. text-align: center;
  1070. padding-top: 15px;
  1071. span {
  1072. display: inline-block;
  1073. width: 64px;
  1074. height: 28px;
  1075. line-height: 28px;
  1076. text-align: center;
  1077. background: #4290f7;
  1078. color: #fff;
  1079. cursor: pointer;
  1080. &:last-child {
  1081. margin-left: 15px;
  1082. background: #acabab;
  1083. }
  1084. }
  1085. }
  1086. }
  1087. }
  1088. </style>