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