ApplyInfo.vue 40 KB

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