ApplyInfo.vue 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209
  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. for (let i = 0; i < this.sayPriceObj.replies.length; i++) {
  451. if (!this.sayPriceObj.replies[i].lapQty || !this.sayPriceObj.replies[i].price) {
  452. return false
  453. }
  454. }
  455. return this.validSayPrice.leadtime && this.validSayPrice.repliesLapQty && this.validSayPrice.repliesPrice
  456. },
  457. // onUnitPriceBlur: function () {
  458. // if (this.sayPriceObj.unitPrice) {
  459. // if (this.sayPriceObj.unitPrice <= 0) {
  460. // this.$message.error('单价必须是大于0的数字')
  461. // this.validSayPrice.unitPrice = false
  462. // } else {
  463. // this.validSayPrice.unitPrice = true
  464. // }
  465. // } else {
  466. // this.$message.error('单价必须是大于0的数字')
  467. // this.validSayPrice.unitPrice = false
  468. // }
  469. // },
  470. // onUnitPriceChange: function () {
  471. // let price = this.sayPriceObj.unitPrice
  472. // if (price >= 10000) {
  473. // this.sayPriceObj.unitPrice = price.substring(0, 4)
  474. // } else if (price.indexOf('.') > -1) {
  475. // let arr = price.split('.')
  476. // if (arr[0].length > 4) {
  477. // this.sayPriceObj.unitPrice = Number(arr[0].substring(0, 4) + '.' + arr[1])
  478. // } else if (arr[1].length > 6) {
  479. // this.sayPriceObj.unitPrice = Number(arr[0] + '.' + arr[1].substring(0, 6))
  480. // }
  481. // }
  482. // },
  483. // onMinDayInput: function () {
  484. // this.sayPriceObj.minDay = Number(this.sayPriceObj.minDay)
  485. // if (this.sayPriceObj.minDay < 1 || this.sayPriceObj.minDay > 31 || this.sayPriceObj.minDay.toString().indexOf('.') !== -1) {
  486. // this.validSayPrice.minDay = false
  487. // this.$message.error('交期只能填写1-31之间的整数值')
  488. // } else if (this.sayPriceObj.maxDay && this.sayPriceObj.maxDay < this.sayPriceObj.minDay) {
  489. // this.validSayPrice.minDay = false
  490. // this.$message.error('最短交期应小于等于最长交期')
  491. // } else {
  492. // this.validSayPrice.minDay = true
  493. // }
  494. // },
  495. // onMinDayChange: function () {
  496. // if (this.sayPriceObj.minDay.length > 2) {
  497. // this.sayPriceObj.minDay = this.sayPriceObj.minDay.substring(0, 2)
  498. // }
  499. // },
  500. // onMaxDayInput: function () {
  501. // this.sayPriceObj.maxDay = Number(this.sayPriceObj.maxDay)
  502. // if (this.sayPriceObj.maxDay < 1 || this.sayPriceObj.maxDay > 31 || this.sayPriceObj.maxDay.toString().indexOf('.') !== -1) {
  503. // this.validSayPrice.maxDay = false
  504. // this.$message.error('交期只能填写1-31之间的整数值')
  505. // } else if (this.sayPriceObj.minDay && this.sayPriceObj.maxDay < this.sayPriceObj.minDay) {
  506. // this.validSayPrice.maxDay = false
  507. // this.$message.error('最短交期应小于等于最长交期')
  508. // } else {
  509. // this.validSayPrice.maxDay = true
  510. // }
  511. // },
  512. // onMaxDayChange: function () {
  513. // if (this.sayPriceObj.maxDay.length > 2) {
  514. // this.sayPriceObj.maxDay = this.sayPriceObj.maxDay.substring(0, 2)
  515. // }
  516. // },
  517. // onProduceDateChange: function () {
  518. // if (this.sayPriceObj.produceDate && getRealLen(this.sayPriceObj.produceDate) > 12) {
  519. // this.sayPriceObj.produceDate = cutOutString(this.sayPriceObj.produceDate, 12)
  520. // }
  521. // },
  522. // checkAllSayPrice: function () {
  523. // return this.validSayPrice.unitPrice && this.validSayPrice.minDay && this.validSayPrice.maxDay
  524. // },
  525. searchList: function () {
  526. this.nowPage = 1
  527. this.resetList()
  528. },
  529. sortListByParam: function (param) {
  530. if (this.sorting[param]) {
  531. if (this.sorting[param] === 'ASC') {
  532. this.$set(this.sorting, param, 'DESC')
  533. } else {
  534. this.$delete(this.sorting, param)
  535. }
  536. } else {
  537. this.sorting = {}
  538. this.$set(this.sorting, param, 'ASC')
  539. }
  540. this.nowPage = 1
  541. this.resetList()
  542. },
  543. setReplies: function (type, index) {
  544. if (type === 'add' && this.sayPriceObj.replies.length < 5) {
  545. if (this.sayPriceObj.replies[index].lapQty && this.sayPriceObj.replies[index].price) {
  546. this.sayPriceObj.replies.splice(index + 1, 0, {
  547. lapQty: '',
  548. price: ''
  549. })
  550. } else {
  551. this.$message.error('请填完整信息')
  552. }
  553. } else if (type === 'sub' && this.sayPriceObj.replies.length > 1) {
  554. this.sayPriceObj.replies.splice(index, 1)
  555. }
  556. },
  557. setLinkBoxIndex: function (index) {
  558. if (!this.user.logged) {
  559. this.$router.push('/auth/login?returnUrl=' + window.location.href)
  560. } else {
  561. this.linkBoxIndex = index
  562. }
  563. }
  564. }
  565. }
  566. </script>
  567. <style lang="scss" scoped>
  568. .apply-info {
  569. width: 1190px;
  570. margin: 0 auto;
  571. .apply-info-title {
  572. border-bottom: 1px solid #3975f4;
  573. >p {
  574. display: inline-block;
  575. width: 156px;
  576. height: 33px;
  577. line-height: 33px;
  578. color: #fff;
  579. background: #3975f4;
  580. font-size: 18px;
  581. text-align: center;
  582. border: {
  583. top-left-radius: 3px;
  584. top-right-radius: 3px;
  585. }
  586. margin: 0;
  587. }
  588. >span {
  589. color: #999;
  590. margin-left: 16px;
  591. }
  592. >div {
  593. float: right;
  594. height: 25px;
  595. line-height: 25px;
  596. >input {
  597. width: 241px;
  598. height: 25px;
  599. line-height: 25px;
  600. font-size: 13px;
  601. border: {
  602. top-right-radius: 0;
  603. bottom-right-radius: 0;
  604. }
  605. }
  606. >span {
  607. display: inline-block;
  608. width: 69px;
  609. color: #fff;
  610. background: #3975f4;
  611. text-align: center;
  612. margin: 0 6px 0 -1px;
  613. border: {
  614. top-right-radius: 3px;
  615. bottom-right-radius: 3px;
  616. }
  617. cursor: pointer;
  618. }
  619. >a {
  620. background: #ffa200;
  621. color: #fff;
  622. width: 79px;
  623. border-radius: 3px;
  624. text-align: center;
  625. display: inline-block;
  626. }
  627. }
  628. }
  629. .apply-info-list {
  630. >p {
  631. background: #ededed;
  632. height: 40px;
  633. line-height: 40px;
  634. margin: 9px 0 0 0;
  635. span {
  636. display: inline-block;
  637. text-align: center;
  638. a {
  639. i {
  640. color: #333;
  641. &.active {
  642. color: #5078cb;
  643. }
  644. }
  645. }
  646. &:nth-child(1) {
  647. width: 186px;
  648. }
  649. &:nth-child(2) {
  650. width: 106px;
  651. }
  652. &:nth-child(3) {
  653. width: 200px;
  654. }
  655. &:nth-child(4) {
  656. width: 174px;
  657. }
  658. &:nth-child(5) {
  659. width: 152px;
  660. }
  661. &:nth-child(6) {
  662. width: 158px;
  663. }
  664. &:nth-child(7) {
  665. width: 180px;
  666. margin-left: 30px;
  667. }
  668. }
  669. }
  670. >ul {
  671. margin-bottom: 29px;
  672. > li {
  673. position: relative;
  674. min-height: 67px;
  675. line-height: 67px;
  676. border: 1px solid #ededed;
  677. >div {
  678. overflow-x: hidden;
  679. text-overflow: ellipsis;
  680. white-space: nowrap;
  681. display: inline-block;
  682. text-align: center;
  683. color: #3c3c3c;
  684. vertical-align: middle;
  685. &:nth-child(1) {
  686. width: 186px;
  687. }
  688. &:nth-child(2) {
  689. width: 106px;
  690. }
  691. &:nth-child(3) {
  692. width: 200px;
  693. }
  694. &:nth-child(4) {
  695. width: 174px;
  696. }
  697. &:nth-child(5) {
  698. width: 152px;
  699. }
  700. &:nth-child(6) {
  701. width: 158px;
  702. }
  703. &:nth-child(7) {
  704. width: 180px;
  705. margin-left: 32px;
  706. float: right;
  707. }
  708. &.date-content {
  709. span {
  710. &:first-child {
  711. font-size: 12px;
  712. color: #666;
  713. }
  714. color: #f71026;
  715. }
  716. i {
  717. font-style: normal;
  718. }
  719. }
  720. &.number-content {
  721. span {
  722. color: #5392f9;
  723. &.active {
  724. color: #ff9a00;
  725. }
  726. }
  727. >img {
  728. margin-bottom: 5px;
  729. margin-right: 2px;
  730. }
  731. }
  732. &.btn-content {
  733. > a {
  734. display: inline-block;
  735. width: 71px;
  736. height: 28px;
  737. line-height: 28px;
  738. color: #fff;
  739. background: #3c7cf5;
  740. border-radius: 3px;
  741. cursor: pointer;
  742. &:first-child {
  743. background: #ffa200;
  744. float: left;
  745. margin-top: 19px;
  746. }
  747. }
  748. .is-say-price {
  749. display: inline-block;
  750. color: #39ae05;
  751. margin-left: 11px;
  752. img {
  753. margin-bottom: 2px;
  754. }
  755. .say-price-history {
  756. position: absolute;
  757. top: 53px;
  758. right: 11px;
  759. line-height: normal;
  760. width: 198px;
  761. height: 0;
  762. background: #fff;
  763. border: 1px solid #fab89a;
  764. z-index: 1;
  765. overflow: hidden;
  766. transition: height 1s;
  767. -moz-transition: height 1s; /* Firefox 4 */
  768. -webkit-transition: height 1s; /* Safari 和 Chrome */
  769. -o-transition: height 1s; /* Opera */
  770. opacity: 0;
  771. p {
  772. color: #020202;
  773. font-weight: bold;
  774. margin: 0;
  775. &.price-title {
  776. background: #fee6db;
  777. height: 28px;
  778. line-height: 28px;
  779. }
  780. &.price-level {
  781. margin: 6px 0;
  782. text-align: left;
  783. }
  784. }
  785. > div {
  786. padding: 9px 12px;
  787. > div {
  788. display: inline-block;
  789. text-align: left;
  790. &:nth-child(1) {
  791. float: left;
  792. }
  793. &:nth-child(2) {
  794. margin-left: 32px;
  795. }
  796. span {
  797. color: #020202;
  798. margin: 0;
  799. &.red-text {
  800. color: #f62d37;
  801. }
  802. }
  803. &.pre-line {
  804. display: block;
  805. padding: 13px 0;
  806. border-bottom: 1px dashed #fee6db;
  807. }
  808. }
  809. ul {
  810. li {
  811. color: #333;
  812. height: 22px;
  813. line-height: 22px;
  814. padding: 0 6px;
  815. &:nth-child(odd) {
  816. background: #f6f5f4;
  817. }
  818. span {
  819. color: #333;
  820. display: inline-block;
  821. text-align: left;
  822. width: 50%;
  823. margin: 0;
  824. }
  825. &:last-child {
  826. span {
  827. color: #4290f7;
  828. }
  829. }
  830. }
  831. }
  832. }
  833. }
  834. &:hover {
  835. .say-price-history {
  836. opacity: 1;
  837. /* animation: expand 1s infinite;
  838. -webkit-animation: expand 1s infinite; !*Safari and Chrome*!
  839. animation-iteration-count: 1;
  840. -webkit-animation-iteration-count: 1;*/
  841. height: 210px;
  842. }
  843. }
  844. /* @keyframes expand {
  845. from {bottom: 58px}
  846. to {bottom: auto}
  847. }
  848. @-webkit-keyframes expand {
  849. from {bottom: 58px}
  850. to {bottom: auto}
  851. }*/
  852. }
  853. }
  854. }
  855. .expand-content {
  856. display: none;
  857. justify-content: space-between;
  858. padding: 0 236px 0 36px;
  859. background: #fffbf0;
  860. height: 45px;
  861. line-height: 45px;
  862. color: #020202;
  863. div {
  864. display: inline-block;
  865. span {
  866. color: #f71026;
  867. }
  868. }
  869. }
  870. &:hover {
  871. box-shadow: 1.5px 3px 7px 0 rgb( 178, 178, 179 );
  872. .expand-content {
  873. display: flex;
  874. }
  875. }
  876. .say-price {
  877. background-color: #e7eef9;
  878. height: 64px;
  879. line-height: 64px;
  880. display: none;
  881. >div {
  882. display: inline-block;
  883. position: relative;
  884. height: 64px;
  885. line-height: 64px;
  886. input {
  887. border-radius: 3px;
  888. }
  889. &:nth-child(1) {
  890. width: 282px;
  891. background: url('/images/applyPurchase/say-price.png')no-repeat;
  892. text-align: center;
  893. margin-right: 44px;
  894. }
  895. &:nth-child(2) {
  896. margin-right: 39px;
  897. input {
  898. width: 118px;
  899. height: 26px;
  900. border: 1px solid #5392f9;
  901. }
  902. select {
  903. position: absolute;
  904. top: 19px;
  905. width: 32px;
  906. height: 26px;
  907. background: url('/images/applyPurchase/arrow-down.png')no-repeat right center;
  908. -webkit-box-shadow: none;
  909. -moz-box-shadow: none;
  910. box-shadow: none;
  911. border: {
  912. left: none;
  913. top: none;
  914. bottom: none;
  915. right: 1px solid #5392f9;
  916. bottom-left-radius: 4px;
  917. top-left-radius: 4px;
  918. }
  919. color: #5392f9;
  920. font: small-caption;
  921. padding-left: 8px;
  922. & + input {
  923. padding-left: 34px;
  924. }
  925. }
  926. div {
  927. position: absolute;
  928. top: 19px;
  929. left: 38px;
  930. width: 32px;
  931. height: 26px;
  932. line-height: 26px;
  933. text-align: center;
  934. border: {
  935. left: none;
  936. top: none;
  937. bottom: none;
  938. right: 1px solid #5392f9;
  939. bottom-left-radius: 4px;
  940. top-left-radius: 4px;
  941. }
  942. color: #5392f9;
  943. & + input {
  944. padding-left: 34px;
  945. }
  946. }
  947. }
  948. &:nth-child(3) {
  949. margin-right: 37px;
  950. input {
  951. width: 32px;
  952. height: 26px;
  953. padding: 0 0 0 6px;
  954. }
  955. }
  956. &:nth-child(4) {
  957. margin-right: 132px;
  958. input {
  959. width: 118px;
  960. height: 26px;
  961. }
  962. }
  963. &:nth-child(5) {
  964. span {
  965. width: 71px;
  966. height: 28px;
  967. line-height: 28px;
  968. text-align: center;
  969. display: inline-block;
  970. cursor: pointer;
  971. &:first-child {
  972. background: #dedddd;
  973. margin-right: 10px;
  974. }
  975. &:last-child {
  976. background: #fa4701;
  977. color: #fff;
  978. }
  979. }
  980. }
  981. i {
  982. color: #e41515;
  983. position: relative;
  984. top: 2px;
  985. right: 3px;
  986. }
  987. }
  988. }
  989. &.active {
  990. border-color: #f71026;
  991. box-shadow: none;
  992. .expand-content {
  993. display: flex;
  994. -webkit-box-shadow: none;
  995. -moz-box-shadow: none;
  996. box-shadow: none;
  997. }
  998. .say-price {
  999. display: block;
  1000. }
  1001. }
  1002. }
  1003. }
  1004. }
  1005. .page-wrap {
  1006. text-align: right;
  1007. float: none;
  1008. }
  1009. .say-price-box {
  1010. position: fixed;
  1011. width: 456px;
  1012. top: 30%;
  1013. left: 33%;
  1014. /*-webkit-box-shadow: 0 5px 15px rgba(0,0,0,.5);*/
  1015. /*-moz-box-shadow: 0 5px 15px rgba(0,0,0,.5);*/
  1016. /*box-shadow: 0 5px 15px rgba(0,0,0,.5);*/
  1017. z-index: 1;
  1018. .title {
  1019. position: relative;
  1020. height: 44px;
  1021. background: #4290f7;
  1022. line-height: 44px;
  1023. color: #fff;
  1024. border: {
  1025. top-right-radius: 5px;
  1026. top-left-radius: 5px;
  1027. }
  1028. > div {
  1029. display: inline-block;
  1030. padding-left: 57px;
  1031. width: 47%;
  1032. overflow: hidden;
  1033. text-overflow: ellipsis;
  1034. white-space: nowrap;
  1035. }
  1036. i {
  1037. position: absolute;
  1038. right: 10px;
  1039. top: 8px;
  1040. cursor: pointer;
  1041. }
  1042. }
  1043. .content {
  1044. padding: 9px 0;
  1045. background: #fff;
  1046. .content-line {
  1047. margin: 0 0 14px 0;
  1048. .form-item {
  1049. display: inline-block;
  1050. width: 49%;
  1051. > span {
  1052. i {
  1053. color: #fd2637;
  1054. margin-right: 4px;
  1055. }
  1056. }
  1057. input {
  1058. border: 1px solid #bfbfbf;
  1059. border-radius: 2px;
  1060. height: 28px;
  1061. }
  1062. &.form-left {
  1063. span {
  1064. display: inline-block;
  1065. width: 104px;
  1066. text-align: right;
  1067. }
  1068. input {
  1069. width: 64px;
  1070. }
  1071. }
  1072. &.form-upload {
  1073. text-align: center;
  1074. label {
  1075. margin-bottom: 0;
  1076. cursor: pointer;
  1077. input {
  1078. display: none;
  1079. }
  1080. span {
  1081. display: block;
  1082. width: 94px;
  1083. height: 23px;
  1084. line-height: 18px;
  1085. font-weight: normal;
  1086. color: #4290f7;
  1087. text-align: center;
  1088. border: 1px dashed #4290f7;
  1089. border-radius: 11px;
  1090. i {
  1091. font-weight: bold;
  1092. font-style: normal;
  1093. font-size: 18px;
  1094. margin-right: 5px;
  1095. }
  1096. }
  1097. }
  1098. div {
  1099. i {
  1100. cursor: pointer;
  1101. color: #eb222c;
  1102. font-size: 16px;
  1103. margin-right: 10px;
  1104. }
  1105. span {
  1106. display: inline-block;
  1107. max-width: 128px;
  1108. overflow: hidden;
  1109. text-overflow: ellipsis;
  1110. white-space: nowrap;
  1111. }
  1112. }
  1113. }
  1114. &.form-right {
  1115. padding-left: 13px;
  1116. position: relative;
  1117. input {
  1118. width: 101px;
  1119. }
  1120. select {
  1121. position: absolute;
  1122. top: 0;
  1123. width: 32px;
  1124. height: 28px;
  1125. background: url(/images/applyPurchase/arrow-down.png) no-repeat right center;
  1126. border: {
  1127. left: none;
  1128. top: none;
  1129. bottom: none;
  1130. right: 1px solid #bfbfbf;
  1131. bottom-left-radius: 4px;
  1132. top-left-radius: 4px;
  1133. }
  1134. color: #5392f9;
  1135. font: small-caption;
  1136. padding-left: 8px;
  1137. outline: none;
  1138. & + input {
  1139. padding-left: 36px;
  1140. }
  1141. }
  1142. > i {
  1143. margin-left: 4px;
  1144. }
  1145. }
  1146. }
  1147. }
  1148. }
  1149. .operate {
  1150. background: #fff;
  1151. height: 62px;
  1152. text-align: center;
  1153. padding-top: 15px;
  1154. border: {
  1155. top: 1px solid #e4e5e6;
  1156. bottom-left-radius: 5px;
  1157. bottom-right-radius: 5px;
  1158. }
  1159. span {
  1160. display: inline-block;
  1161. width: 64px;
  1162. height: 28px;
  1163. line-height: 28px;
  1164. text-align: center;
  1165. background: #4290f7;
  1166. color: #fff;
  1167. cursor: pointer;
  1168. &:last-child {
  1169. margin-left: 15px;
  1170. background: #acabab;
  1171. }
  1172. }
  1173. }
  1174. }
  1175. .link-saler-box {
  1176. width: 289px;
  1177. height: auto;
  1178. min-height: auto;
  1179. border-radius: 2px;
  1180. .title {
  1181. background-color: #4290f7;
  1182. height: 22px;
  1183. line-height: 22px;
  1184. margin-bottom: 20px;
  1185. }
  1186. .content {
  1187. p {
  1188. line-height: 20px;
  1189. padding-top: 0;
  1190. i {
  1191. color: #4290f7;
  1192. margin-right: 4px;
  1193. }
  1194. span {
  1195. color: #f62d37;
  1196. }
  1197. }
  1198. div {
  1199. a {
  1200. width: 78px;
  1201. background: #4290f7;
  1202. margin: 18px 0 13px 0;
  1203. border-radius: 2px;
  1204. }
  1205. }
  1206. }
  1207. }
  1208. }
  1209. </style>