ApplyInfo.vue 39 KB

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