ApplyInfo.vue 41 KB

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