ApplyInfo.vue 42 KB

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