ApplyInfo.vue 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112
  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 ? purchaseMan.inquiry.enterprise.enName ? purchaseMan.inquiry.enterprise.enName : '-' : '-' || '-')">{{purchaseMan.userName || (purchaseMan.inquiry.enterprise ? purchaseMan.inquiry.enterprise.enName ? 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.needquantity || '-'}}</span><span v-if="purchaseMan.needquantity">个</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. if (this.checkValid()) {
  282. let purchaseMan = this.purchaseManList.content[this.currentSayPriceIndex]
  283. this.showLoading = true
  284. purchaseMan.leadtime = this.sayPriceObj.leadtime
  285. purchaseMan.replies = this.sayPriceObj.replies
  286. purchaseMan.vendUU = this.user.data.enterprise.uu
  287. purchaseMan.vendorUserUU = this.user.data.userUU
  288. purchaseMan.qutoApp = 'MALL'
  289. this.$http.post('/inquiry/sale/item/save', purchaseMan).then(response => {
  290. this.showLoading = false
  291. if (response.data.success === false) {
  292. this.$message.error(response.data.message)
  293. } else {
  294. this.$message.success('报价成功')
  295. this.resetSayPrice()
  296. this.resetList()
  297. }
  298. }, error => {
  299. console.log(error)
  300. this.$message.error('系统错误')
  301. this.showLoading = false
  302. })
  303. } else {
  304. this.$message.error('请输入正确的报价信息')
  305. }
  306. } else {
  307. this.$message.error('个人账户不可报价')
  308. }
  309. // if (this.checkAllSayPrice()) {
  310. // } else {
  311. // if (!this.validSayPrice.unitPrice) {
  312. // if (!this.sayPriceObj.unitPrice) {
  313. // this.$message.error('单价不能为空')
  314. // } else {
  315. // this.$message.error('单价必须是大于0的数字')
  316. // }
  317. // } else if (!this.validSayPrice.minDay || !this.validSayPrice.maxDay) {
  318. // if ((!this.sayPriceObj.minDay && this.sayPriceObj.minDay !== 0) || (!this.sayPriceObj.maxDay && this.sayPriceObj.maxDay !== 0)) {
  319. // this.$message.error('交期不能为空')
  320. // } else {
  321. // 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) {
  322. // this.$message.error('交期只能填写1-31之间的整数值')
  323. // } else {
  324. // this.$message.error('最短交期应小于等于最长交期')
  325. // }
  326. // }
  327. // }
  328. // }
  329. } else {
  330. this.$router.push('/auth/login?returnUrl=' + window.location.href)
  331. }
  332. },
  333. resetList: function () {
  334. this.currentSayPriceIndex = -1
  335. 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, enUU: this.user.data.enterprise ? this.user.data.enterprise.uu : null})
  336. },
  337. resetSayPrice: function () {
  338. this.sayPriceObj = {
  339. currency: 'RMB',
  340. leadtime: '',
  341. replies: [
  342. {
  343. lapQty: '',
  344. price: ''
  345. }
  346. ]
  347. }
  348. },
  349. onLeadtimeInput: function () {
  350. if (this.sayPriceObj.leadtime.length > 2) {
  351. this.sayPriceObj.leadtime = this.sayPriceObj.leadtime.substring(0, 2)
  352. }
  353. },
  354. onLeadtimeBlur: function () {
  355. if (!this.sayPriceObj.leadtime || this.sayPriceObj.leadtime < 1 || this.sayPriceObj.leadtime > 31 || this.sayPriceObj.leadtime.toString().indexOf('.') !== -1) {
  356. this.validSayPrice.leadtime = false
  357. this.$message.error('交期只能填写1-31之间的整数值')
  358. } else {
  359. this.validSayPrice.leadtime = true
  360. }
  361. },
  362. onReplyPriceInput: function (index) {
  363. let price = this.sayPriceObj.replies[index].price
  364. if (price >= 10000) {
  365. this.sayPriceObj.replies[index].price = price.substring(0, 4)
  366. } else if (price.indexOf('.') > -1) {
  367. let arr = price.split('.')
  368. if (arr[0].length > 4) {
  369. this.sayPriceObj.replies[index].price = Number(arr[0].substring(0, 4) + '.' + arr[1])
  370. } else if (arr[1].length > 6) {
  371. this.sayPriceObj.replies[index].price = Number(arr[0] + '.' + arr[1].substring(0, 6))
  372. }
  373. }
  374. },
  375. onReplyPriceBlur: function (index) {
  376. let price = this.sayPriceObj.replies[index].price
  377. let limitDownObj = this.getLimitDownPrice()
  378. if (!price || price <= 0) {
  379. this.sayPriceObj.replies[index].price = ''
  380. this.$message.error('输入值必须为正整数')
  381. this.validSayPrice.repliesPrice = false
  382. } else if (limitDownObj.index !== index && limitDownObj.price > price) {
  383. this.$message.error('输入值必须大于#该梯度的下限#')
  384. this.sayPriceObj.replies[index].price = ''
  385. this.validSayPrice.repliesPrice = false
  386. } else if ((index - 1 >= 0 && this.sayPriceObj.replies[index - 1].price >= price) || (index + 1 < this.sayPriceObj.replies.length && this.sayPriceObj.replies[index + 1].price <= price)) {
  387. this.$message.error('输入值会导致梯度重叠,请重新修改')
  388. this.sayPriceObj.replies[index].price = ''
  389. this.validSayPrice.repliesPrice = false
  390. } else {
  391. this.validSayPrice.repliesPrice = true
  392. }
  393. },
  394. onReplyLapQtyBlur: function (index) {
  395. let lapQty = this.sayPriceObj.replies[index].lapQty
  396. let limitDownObj = this.getLimitDownQty()
  397. if (!lapQty || lapQty < 1) {
  398. this.sayPriceObj.replies[index].lapQty = ''
  399. this.$message.error('输入值必须为正整数')
  400. this.validSayPrice.repliesLapQty = false
  401. } else if (limitDownObj.index !== index && limitDownObj.lapQty > lapQty) {
  402. this.$message.error('输入值必须大于#该梯度的下限#')
  403. this.sayPriceObj.replies[index].lapQty = ''
  404. this.validSayPrice.repliesLapQty = false
  405. } else if ((index - 1 >= 0 && this.sayPriceObj.replies[index - 1].lapQty >= lapQty) || (index + 1 < this.sayPriceObj.replies.length && this.sayPriceObj.replies[index + 1].lapQty <= lapQty)) {
  406. this.$message.error('输入值会导致梯度重叠,请重新修改')
  407. this.sayPriceObj.replies[index].lapQty = ''
  408. this.validSayPrice.repliesLapQty = false
  409. } else {
  410. this.validSayPrice.repliesLapQty = true
  411. }
  412. },
  413. getLimitDownQty: function () {
  414. for (let i = 0; i < this.sayPriceObj.replies.length; i++) {
  415. if (this.sayPriceObj.replies[i].lapQty) {
  416. return {
  417. lapQty: this.sayPriceObj.replies[i].lapQty,
  418. index: i
  419. }
  420. }
  421. }
  422. return {index: -1}
  423. },
  424. getLimitDownPrice: function () {
  425. for (let i = 0; i < this.sayPriceObj.replies.length; i++) {
  426. if (this.sayPriceObj.replies[i].price) {
  427. return {
  428. price: this.sayPriceObj.replies[i].price,
  429. index: i
  430. }
  431. }
  432. }
  433. return {index: -1}
  434. },
  435. checkValid: function () {
  436. return this.validSayPrice.leadtime && this.validSayPrice.repliesLapQty && this.validSayPrice.repliesPrice
  437. },
  438. // onUnitPriceBlur: function () {
  439. // if (this.sayPriceObj.unitPrice) {
  440. // if (this.sayPriceObj.unitPrice <= 0) {
  441. // this.$message.error('单价必须是大于0的数字')
  442. // this.validSayPrice.unitPrice = false
  443. // } else {
  444. // this.validSayPrice.unitPrice = true
  445. // }
  446. // } else {
  447. // this.$message.error('单价必须是大于0的数字')
  448. // this.validSayPrice.unitPrice = false
  449. // }
  450. // },
  451. // onUnitPriceChange: function () {
  452. // let price = this.sayPriceObj.unitPrice
  453. // if (price >= 10000) {
  454. // this.sayPriceObj.unitPrice = price.substring(0, 4)
  455. // } else if (price.indexOf('.') > -1) {
  456. // let arr = price.split('.')
  457. // if (arr[0].length > 4) {
  458. // this.sayPriceObj.unitPrice = Number(arr[0].substring(0, 4) + '.' + arr[1])
  459. // } else if (arr[1].length > 6) {
  460. // this.sayPriceObj.unitPrice = Number(arr[0] + '.' + arr[1].substring(0, 6))
  461. // }
  462. // }
  463. // },
  464. // onMinDayInput: function () {
  465. // this.sayPriceObj.minDay = Number(this.sayPriceObj.minDay)
  466. // if (this.sayPriceObj.minDay < 1 || this.sayPriceObj.minDay > 31 || this.sayPriceObj.minDay.toString().indexOf('.') !== -1) {
  467. // this.validSayPrice.minDay = false
  468. // this.$message.error('交期只能填写1-31之间的整数值')
  469. // } else if (this.sayPriceObj.maxDay && this.sayPriceObj.maxDay < this.sayPriceObj.minDay) {
  470. // this.validSayPrice.minDay = false
  471. // this.$message.error('最短交期应小于等于最长交期')
  472. // } else {
  473. // this.validSayPrice.minDay = true
  474. // }
  475. // },
  476. // onMinDayChange: function () {
  477. // if (this.sayPriceObj.minDay.length > 2) {
  478. // this.sayPriceObj.minDay = this.sayPriceObj.minDay.substring(0, 2)
  479. // }
  480. // },
  481. // onMaxDayInput: function () {
  482. // this.sayPriceObj.maxDay = Number(this.sayPriceObj.maxDay)
  483. // if (this.sayPriceObj.maxDay < 1 || this.sayPriceObj.maxDay > 31 || this.sayPriceObj.maxDay.toString().indexOf('.') !== -1) {
  484. // this.validSayPrice.maxDay = false
  485. // this.$message.error('交期只能填写1-31之间的整数值')
  486. // } else if (this.sayPriceObj.minDay && this.sayPriceObj.maxDay < this.sayPriceObj.minDay) {
  487. // this.validSayPrice.maxDay = false
  488. // this.$message.error('最短交期应小于等于最长交期')
  489. // } else {
  490. // this.validSayPrice.maxDay = true
  491. // }
  492. // },
  493. // onMaxDayChange: function () {
  494. // if (this.sayPriceObj.maxDay.length > 2) {
  495. // this.sayPriceObj.maxDay = this.sayPriceObj.maxDay.substring(0, 2)
  496. // }
  497. // },
  498. // onProduceDateChange: function () {
  499. // if (this.sayPriceObj.produceDate && getRealLen(this.sayPriceObj.produceDate) > 12) {
  500. // this.sayPriceObj.produceDate = cutOutString(this.sayPriceObj.produceDate, 12)
  501. // }
  502. // },
  503. // checkAllSayPrice: function () {
  504. // return this.validSayPrice.unitPrice && this.validSayPrice.minDay && this.validSayPrice.maxDay
  505. // },
  506. searchList: function () {
  507. this.nowPage = 1
  508. this.resetList()
  509. },
  510. sortListByParam: function (param) {
  511. if (this.sorting[param]) {
  512. if (this.sorting[param] === 'ASC') {
  513. this.$set(this.sorting, param, 'DESC')
  514. } else {
  515. this.$delete(this.sorting, param)
  516. }
  517. } else {
  518. this.sorting = {}
  519. this.$set(this.sorting, param, 'ASC')
  520. }
  521. this.nowPage = 1
  522. this.resetList()
  523. },
  524. setReplies: function (type, index) {
  525. if (type === 'add' && this.sayPriceObj.replies.length < 5) {
  526. this.sayPriceObj.replies.splice(index + 1, 0, {
  527. lapQty: '',
  528. price: ''
  529. })
  530. } else if (type === 'sub' && this.sayPriceObj.replies.length > 1) {
  531. this.sayPriceObj.replies.splice(index, 1)
  532. }
  533. }
  534. }
  535. }
  536. </script>
  537. <style lang="scss" scoped>
  538. .apply-info {
  539. width: 1190px;
  540. margin: 0 auto;
  541. .apply-info-title {
  542. border-bottom: 1px solid #3975f4;
  543. >p {
  544. display: inline-block;
  545. width: 156px;
  546. height: 33px;
  547. line-height: 33px;
  548. color: #fff;
  549. background: #3975f4;
  550. font-size: 18px;
  551. text-align: center;
  552. border: {
  553. top-left-radius: 3px;
  554. top-right-radius: 3px;
  555. }
  556. margin: 0;
  557. }
  558. >span {
  559. color: #999;
  560. margin-left: 16px;
  561. }
  562. >div {
  563. float: right;
  564. height: 25px;
  565. line-height: 25px;
  566. >input {
  567. width: 241px;
  568. height: 25px;
  569. line-height: 25px;
  570. font-size: 13px;
  571. border: {
  572. top-right-radius: 0;
  573. bottom-right-radius: 0;
  574. }
  575. }
  576. >span {
  577. display: inline-block;
  578. width: 69px;
  579. color: #fff;
  580. background: #3975f4;
  581. text-align: center;
  582. margin: 0 6px 0 -1px;
  583. border: {
  584. top-right-radius: 3px;
  585. bottom-right-radius: 3px;
  586. }
  587. cursor: pointer;
  588. }
  589. >a {
  590. background: #ffa200;
  591. color: #fff;
  592. width: 79px;
  593. border-radius: 3px;
  594. text-align: center;
  595. display: inline-block;
  596. }
  597. }
  598. }
  599. .apply-info-list {
  600. >p {
  601. background: #ededed;
  602. height: 40px;
  603. line-height: 40px;
  604. margin: 9px 0 0 0;
  605. span {
  606. display: inline-block;
  607. text-align: center;
  608. a {
  609. i {
  610. color: #333;
  611. &.active {
  612. color: #5078cb;
  613. }
  614. }
  615. }
  616. &:nth-child(1) {
  617. width: 186px;
  618. }
  619. &:nth-child(2) {
  620. width: 106px;
  621. }
  622. &:nth-child(3) {
  623. width: 200px;
  624. }
  625. &:nth-child(4) {
  626. width: 174px;
  627. }
  628. &:nth-child(5) {
  629. width: 152px;
  630. }
  631. &:nth-child(6) {
  632. width: 158px;
  633. }
  634. &:nth-child(7) {
  635. width: 214px;
  636. }
  637. }
  638. }
  639. >ul {
  640. margin-bottom: 29px;
  641. > li {
  642. position: relative;
  643. min-height: 67px;
  644. line-height: 67px;
  645. border: 1px solid #ededed;
  646. >div {
  647. overflow-x: hidden;
  648. text-overflow: ellipsis;
  649. white-space: nowrap;
  650. display: inline-block;
  651. text-align: center;
  652. color: #3c3c3c;
  653. vertical-align: middle;
  654. &:nth-child(1) {
  655. width: 186px;
  656. }
  657. &:nth-child(2) {
  658. width: 106px;
  659. }
  660. &:nth-child(3) {
  661. width: 200px;
  662. }
  663. &:nth-child(4) {
  664. width: 174px;
  665. }
  666. &:nth-child(5) {
  667. width: 152px;
  668. }
  669. &:nth-child(6) {
  670. width: 158px;
  671. }
  672. &:nth-child(7) {
  673. width: 212px;
  674. }
  675. &.date-content {
  676. span {
  677. &:first-child {
  678. font-size: 12px;
  679. color: #666;
  680. }
  681. color: #f71026;
  682. }
  683. i {
  684. font-style: normal;
  685. }
  686. }
  687. &.number-content {
  688. span {
  689. color: #5392f9;
  690. &.active {
  691. color: #ff9a00;
  692. }
  693. }
  694. >img {
  695. margin-bottom: 5px;
  696. margin-right: 2px;
  697. }
  698. }
  699. &.btn-content {
  700. > a {
  701. display: inline-block;
  702. width: 71px;
  703. height: 28px;
  704. line-height: 28px;
  705. color: #fff;
  706. background: #3c7cf5;
  707. border-radius: 3px;
  708. cursor: pointer;
  709. &:first-child {
  710. background: #ffa200;
  711. margin-right: 10px;
  712. }
  713. }
  714. .is-say-price {
  715. display: inline-block;
  716. color: #39ae05;
  717. margin-left: 11px;
  718. img {
  719. margin-bottom: 2px;
  720. }
  721. .say-price-history {
  722. position: absolute;
  723. top: 53px;
  724. right: 11px;
  725. line-height: normal;
  726. width: 198px;
  727. height: 0;
  728. background: #fff;
  729. border: 1px solid #fab89a;
  730. z-index: 1;
  731. overflow: hidden;
  732. transition: height 1s;
  733. -moz-transition: height 1s; /* Firefox 4 */
  734. -webkit-transition: height 1s; /* Safari 和 Chrome */
  735. -o-transition: height 1s; /* Opera */
  736. opacity: 0;
  737. p {
  738. color: #020202;
  739. font-weight: bold;
  740. margin: 0;
  741. &.price-title {
  742. background: #fee6db;
  743. height: 28px;
  744. line-height: 28px;
  745. }
  746. &.price-level {
  747. margin: 6px 0;
  748. text-align: left;
  749. }
  750. }
  751. > div {
  752. padding: 9px 12px;
  753. > div {
  754. display: inline-block;
  755. text-align: left;
  756. &:nth-child(1) {
  757. float: left;
  758. }
  759. &:nth-child(2) {
  760. margin-left: 32px;
  761. }
  762. span {
  763. color: #020202;
  764. margin: 0;
  765. &.red-text {
  766. color: #f62d37;
  767. }
  768. }
  769. &.pre-line {
  770. display: block;
  771. padding: 13px 0;
  772. border-bottom: 1px dashed #fee6db;
  773. }
  774. }
  775. ul {
  776. li {
  777. color: #333;
  778. height: 22px;
  779. line-height: 22px;
  780. padding: 0 6px;
  781. &:nth-child(odd) {
  782. background: #f6f5f4;
  783. }
  784. span {
  785. color: #333;
  786. display: inline-block;
  787. text-align: left;
  788. width: 50%;
  789. margin: 0;
  790. }
  791. &:last-child {
  792. span {
  793. color: #4290f7;
  794. }
  795. }
  796. }
  797. }
  798. }
  799. }
  800. &:hover {
  801. .say-price-history {
  802. opacity: 1;
  803. /* animation: expand 1s infinite;
  804. -webkit-animation: expand 1s infinite; !*Safari and Chrome*!
  805. animation-iteration-count: 1;
  806. -webkit-animation-iteration-count: 1;*/
  807. height: 210px;
  808. }
  809. }
  810. /* @keyframes expand {
  811. from {bottom: 58px}
  812. to {bottom: auto}
  813. }
  814. @-webkit-keyframes expand {
  815. from {bottom: 58px}
  816. to {bottom: auto}
  817. }*/
  818. }
  819. }
  820. }
  821. .expand-content {
  822. display: none;
  823. justify-content: space-between;
  824. padding: 0 236px 0 36px;
  825. background: #fffbf0;
  826. height: 45px;
  827. line-height: 45px;
  828. color: #020202;
  829. div {
  830. display: inline-block;
  831. span {
  832. color: #f71026;
  833. }
  834. }
  835. }
  836. &:hover {
  837. box-shadow: 1.5px 3px 7px 0 rgb( 178, 178, 179 );
  838. .expand-content {
  839. display: flex;
  840. }
  841. }
  842. .say-price {
  843. background-color: #e7eef9;
  844. height: 64px;
  845. line-height: 64px;
  846. display: none;
  847. >div {
  848. display: inline-block;
  849. position: relative;
  850. height: 64px;
  851. line-height: 64px;
  852. input {
  853. border-radius: 3px;
  854. }
  855. &:nth-child(1) {
  856. width: 282px;
  857. background: url('/images/applyPurchase/say-price.png')no-repeat;
  858. text-align: center;
  859. margin-right: 44px;
  860. }
  861. &:nth-child(2) {
  862. margin-right: 39px;
  863. input {
  864. width: 118px;
  865. height: 26px;
  866. border: 1px solid #5392f9;
  867. }
  868. select {
  869. position: absolute;
  870. top: 19px;
  871. width: 32px;
  872. height: 26px;
  873. background: url('/images/applyPurchase/arrow-down.png')no-repeat right center;
  874. -webkit-box-shadow: none;
  875. -moz-box-shadow: none;
  876. box-shadow: none;
  877. border: {
  878. left: none;
  879. top: none;
  880. bottom: none;
  881. right: 1px solid #5392f9;
  882. bottom-left-radius: 4px;
  883. top-left-radius: 4px;
  884. }
  885. color: #5392f9;
  886. font: small-caption;
  887. padding-left: 8px;
  888. & + input {
  889. padding-left: 34px;
  890. }
  891. }
  892. div {
  893. position: absolute;
  894. top: 19px;
  895. left: 38px;
  896. width: 32px;
  897. height: 26px;
  898. line-height: 26px;
  899. text-align: center;
  900. border: {
  901. left: none;
  902. top: none;
  903. bottom: none;
  904. right: 1px solid #5392f9;
  905. bottom-left-radius: 4px;
  906. top-left-radius: 4px;
  907. }
  908. color: #5392f9;
  909. & + input {
  910. padding-left: 34px;
  911. }
  912. }
  913. }
  914. &:nth-child(3) {
  915. margin-right: 37px;
  916. input {
  917. width: 32px;
  918. height: 26px;
  919. padding: 0 0 0 6px;
  920. }
  921. }
  922. &:nth-child(4) {
  923. margin-right: 132px;
  924. input {
  925. width: 118px;
  926. height: 26px;
  927. }
  928. }
  929. &:nth-child(5) {
  930. span {
  931. width: 71px;
  932. height: 28px;
  933. line-height: 28px;
  934. text-align: center;
  935. display: inline-block;
  936. cursor: pointer;
  937. &:first-child {
  938. background: #dedddd;
  939. margin-right: 10px;
  940. }
  941. &:last-child {
  942. background: #fa4701;
  943. color: #fff;
  944. }
  945. }
  946. }
  947. i {
  948. color: #e41515;
  949. position: relative;
  950. top: 2px;
  951. right: 3px;
  952. }
  953. }
  954. }
  955. &.active {
  956. border-color: #f71026;
  957. box-shadow: none;
  958. .expand-content {
  959. display: flex;
  960. -webkit-box-shadow: none;
  961. -moz-box-shadow: none;
  962. box-shadow: none;
  963. }
  964. .say-price {
  965. display: block;
  966. }
  967. }
  968. }
  969. }
  970. }
  971. .page-wrap {
  972. text-align: right;
  973. float: none;
  974. }
  975. .say-price-box {
  976. position: fixed;
  977. width: 527px;
  978. top: 30%;
  979. left: 33%;
  980. border-radius: 5px;
  981. -webkit-box-shadow: 0 5px 15px rgba(0,0,0,.5);
  982. -moz-box-shadow: 0 5px 15px rgba(0,0,0,.5);
  983. box-shadow: 0 5px 15px rgba(0,0,0,.5);
  984. z-index: 1;
  985. .title {
  986. position: relative;
  987. height: 44px;
  988. background: #4290f7;
  989. line-height: 44px;
  990. color: #fff;
  991. > div {
  992. display: inline-block;
  993. padding-left: 66px;
  994. width: 49%;
  995. overflow: hidden;
  996. text-overflow: ellipsis;
  997. white-space: nowrap;
  998. }
  999. i {
  1000. position: absolute;
  1001. right: 10px;
  1002. top: 8px;
  1003. cursor: pointer;
  1004. }
  1005. }
  1006. .content {
  1007. padding: 9px 0;
  1008. background: #fff;
  1009. .content-line {
  1010. margin: 0 0 14px 0;
  1011. .form-item {
  1012. display: inline-block;
  1013. width: 49%;
  1014. > span {
  1015. i {
  1016. color: #fd2637;
  1017. margin-right: 4px;
  1018. }
  1019. }
  1020. input {
  1021. border: 1px solid #bfbfbf;
  1022. border-radius: 2px;
  1023. height: 28px;
  1024. }
  1025. &.form-left {
  1026. span {
  1027. display: inline-block;
  1028. width: 104px;
  1029. text-align: right;
  1030. }
  1031. input {
  1032. width: 64px;
  1033. }
  1034. }
  1035. &.form-upload {
  1036. text-align: center;
  1037. label {
  1038. margin-bottom: 0;
  1039. cursor: pointer;
  1040. input {
  1041. display: none;
  1042. }
  1043. span {
  1044. display: block;
  1045. width: 94px;
  1046. height: 23px;
  1047. line-height: 18px;
  1048. font-weight: normal;
  1049. color: #4290f7;
  1050. text-align: center;
  1051. border: 1px dashed #4290f7;
  1052. border-radius: 11px;
  1053. i {
  1054. font-weight: bold;
  1055. font-style: normal;
  1056. font-size: 18px;
  1057. margin-right: 5px;
  1058. }
  1059. }
  1060. }
  1061. div {
  1062. i {
  1063. cursor: pointer;
  1064. color: #eb222c;
  1065. font-size: 16px;
  1066. margin-right: 10px;
  1067. }
  1068. span {
  1069. display: inline-block;
  1070. max-width: 128px;
  1071. overflow: hidden;
  1072. text-overflow: ellipsis;
  1073. white-space: nowrap;
  1074. }
  1075. }
  1076. }
  1077. &.form-right {
  1078. padding-left: 13px;
  1079. input {
  1080. width: 101px;
  1081. }
  1082. > i {
  1083. margin-left: 4px;
  1084. }
  1085. }
  1086. }
  1087. }
  1088. }
  1089. .operate {
  1090. border-top: 1px solid #e4e5e6;
  1091. background: #fff;
  1092. height: 62px;
  1093. text-align: center;
  1094. padding-top: 15px;
  1095. span {
  1096. display: inline-block;
  1097. width: 64px;
  1098. height: 28px;
  1099. line-height: 28px;
  1100. text-align: center;
  1101. background: #4290f7;
  1102. color: #fff;
  1103. cursor: pointer;
  1104. &:last-child {
  1105. margin-left: 15px;
  1106. background: #acabab;
  1107. }
  1108. }
  1109. }
  1110. }
  1111. }
  1112. </style>