BatchPublish.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833
  1. <template>
  2. <div class="batch-publish">
  3. <p>成功上传<b class="red-text">{{bomNumber.successImport || 0}}</b>个<br/>另有<span class="red-text">{{bomNumber.nullField || 0}}</span>个必填项缺失,请在当前页完善信息</p>
  4. <table v-if="bomList.content.length">
  5. <thead>
  6. <tr>
  7. <th width="60">
  8. <label class="com-check-box">
  9. <input type="checkbox" id="all" @change="onCheck()" v-model="isCheckAll">
  10. <label for="all"></label>
  11. </label>全选
  12. </th>
  13. <th width="160"><i class="red-text">*</i>型号</th>
  14. <th width="132"><i class="red-text">*</i>品牌</th>
  15. <th width="100">采购数量</th>
  16. <th width="128">单价预算</th>
  17. <th width="76">封装</th>
  18. <th width="102">生产日期</th>
  19. <th width="144"><i class="red-text">*</i>截止时间</th>
  20. <th width="92">操作</th>
  21. </tr>
  22. </thead>
  23. <tbody v-for="(item, index) in bomList.content">
  24. <tr v-if="!item.active">
  25. <td>
  26. <label class="com-check-box">
  27. <input type="checkbox" @change="onCheck(index)" v-model="item.checked" :id="index">
  28. <label :for="index"></label>
  29. </label>
  30. </td>
  31. <td>
  32. <div v-if="item.code">{{item.code}}</div>
  33. <span class="red-text" v-if="!item.code">请完善信息</span>
  34. </td>
  35. <td>
  36. <div v-if="item.brand">{{item.brand}}</div>
  37. <span class="red-text" v-if="!item.brand">请完善信息</span>
  38. </td>
  39. <td>
  40. <div>{{item.amount || '-'}}</div>
  41. </td>
  42. <td class="blue-text">
  43. <div>
  44. <span v-if="item.unitPrice">{{(item.currency === 'RMB' ? '¥' : '$') + item.unitPrice}}</span>
  45. <span v-if="!item.unitPrice">-</span>
  46. </div>
  47. </td>
  48. <td>
  49. <div>
  50. {{item.encapsulation || '-'}}
  51. </div>
  52. </td>
  53. <td>
  54. <div>
  55. {{item.produceDate}}
  56. </div>
  57. </td>
  58. <td>
  59. <span v-if="item.deadline">{{item.deadline | date}}</span>
  60. <span class="red-text" v-if="!item.deadline">请完善信息</span>
  61. <div class="red-text" v-if="!isValidTime(item.deadline)">默认≤90天</div>
  62. </td>
  63. <td class="operate">
  64. <a class="delete-btn" @click="modifyItem(index)">编辑</a>
  65. <a class="modify-btn" @click="deleteItem(index)">删除</a>
  66. </td>
  67. </tr>
  68. <tr class="modify-row" v-if="item.active">
  69. <td>
  70. <label class="com-check-box">
  71. <input type="checkbox" @change="onCheck(index)" v-model="item.checked" :id="index">
  72. <label :for="index"></label>
  73. </label>
  74. </td>
  75. <td>
  76. <input type="text" class="form-control" v-model="modifyObj.code" :class="{'error': !validObj.code}" maxlength="30" @blur="checkCode" @input="onCodeChange" >
  77. <ul v-show="showSimilarCodeList">
  78. <li v-for="sCode in similarCode" @click="setCode(sCode.code)">{{sCode.code}}</li>
  79. </ul>
  80. </td>
  81. <td>
  82. <input type="text" class="form-control" v-model="modifyObj.brand" :class="{'error': !validObj.brand}" maxlength="20" @blur="checkBrand" @input="onBrandChange">
  83. <ul class="brand-similar-list" v-show="showSimilarBrandList">
  84. <li v-for="sBrand in similarBrand" @click="setBrand(sBrand.nameEn)">{{sBrand.nameEn}}</li>
  85. </ul>
  86. </td>
  87. <td>
  88. <input type="text" class="form-control" v-model="modifyObj.amount" :class="{'error': !validObj.amount}" @blur="checkAmount" @input="onAmountInput">
  89. </td>
  90. <td>
  91. <select class="form-control" v-model="modifyObj.currency">
  92. <option value="RMB">¥</option>
  93. <option value="USD">$</option>
  94. </select>
  95. <input class="form-control" type="number" v-model="modifyObj.unitPrice" :class="{'error': !validObj.unitPrice}" @blur="checkUnitPrice" @input="onUnitPriceInput">
  96. </td>
  97. <td>
  98. <input type="text" class="form-control" v-model="modifyObj.encapsulation" maxlength="20" @input="onEncapsulationChange">
  99. </td>
  100. <td>
  101. <input type="text" class="form-control" v-model="modifyObj.produceDate" @input="onProduceDateChange">
  102. </td>
  103. <td>
  104. <el-date-picker
  105. v-model="modifyObj.deadline"
  106. type="date"
  107. :picker-options="pickerOptions"
  108. :editable="false"
  109. size="mini">
  110. </el-date-picker>
  111. <!--<input type="text" class="form-control" v-model="modifyObj.deadline">-->
  112. </td>
  113. <td class="operate">
  114. <a class="submit-btn" @click="submitModify(index)">确认</a>
  115. <a class="cancel-btn" @click="cancelModify(index)">取消</a>
  116. </td>
  117. </tr>
  118. </tbody>
  119. </table>
  120. <page :total="bomList.totalElements" :page-size="pageSize"
  121. :current="nowPage" @childEvent="listenPage"></page>
  122. <div class="submit-area" v-if="bomList.content.length">
  123. <a class="modify-btn" @click="deleteItem()">删除</a>
  124. <a class="modify-btn delete-btn" @click="submitBOM">确认发布</a>
  125. </div>
  126. <!--提示框-->
  127. <div class="apply-del-box" v-if="showRemindBox">
  128. <div class="title">
  129. <a @click="showRemindBox = false"><i class="fa fa-close fa-lg"></i></a>
  130. </div>
  131. <div class="content">
  132. <!--<p style="line-height: 20px;margin-top: 10px;padding:0 10px">非常抱歉,目前暂无此品牌!<br>若直接前往“品牌申请”,我们将为您先开通寄售功能,待申请通过后再提交开店申请。</p>-->
  133. <!--<p style="line-height: 20px;">前往<a @click="goBrandApply()" target="_blank" style="color: #5078CB">品牌申请&nbsp;<i class="fa fa-arrow-right"></i></a></p>-->
  134. <p><img src="/images/applyPurchase/check.png" alt="">发布成功</p>
  135. <p>其中<span>{{onSaleNum}}</span>个求购型号有现货在售,您可前往“<span>买家中心-我的求购</span>”查询并直接购买</p>
  136. <div>
  137. <a @click="showRemindBox = false">继续发布</a>
  138. <a href="/user#/seekPurchase">前往我的求购</a>
  139. </div>
  140. </div>
  141. </div>
  142. </div>
  143. </template>
  144. <script>
  145. let getRealLen = function (str) {
  146. let len = 0
  147. for (let i = 0; i < str.length; i++) {
  148. if (str.charCodeAt(i) > 127 || str.charCodeAt(i) === 94) {
  149. len += 2
  150. } else {
  151. len++
  152. }
  153. }
  154. return len
  155. }
  156. let cutOutString = function (str, length) {
  157. for (let i = 1; i <= str.length; i++) {
  158. if (getRealLen(str.substr(0, i)) > length) {
  159. str = str.substr(0, i - 1)
  160. break
  161. }
  162. }
  163. return str
  164. }
  165. import Page from '~components/common/page/pageComponent.vue'
  166. export default {
  167. data () {
  168. return {
  169. pageSize: 10,
  170. nowPage: 1,
  171. isCheckAll: false,
  172. showRemindBox: false,
  173. modifyObj: {
  174. code: '',
  175. brand: '',
  176. unitPrice: '',
  177. currency: 'RMB',
  178. encapsulation: '',
  179. produceDate: '',
  180. amount: '',
  181. deadline: ''
  182. },
  183. pickerOptions: {
  184. disabledDate (time) {
  185. // 大于等于今天 小于三个月后
  186. return time.getTime() < Date.now() - 1000 * 60 * 60 * 24 || time.getTime() > Date.now() + 1000 * 60 * 60 * 24 * 30 * 3
  187. }
  188. },
  189. similarCode: [],
  190. similarBrand: [],
  191. validObj: {
  192. code: true,
  193. brand: true,
  194. unitPrice: true,
  195. // encapsulation: true,
  196. // produceDate: true,
  197. amount: true,
  198. deadline: true
  199. },
  200. onSaleNum: 0,
  201. showSimilarCodeList: false,
  202. showSimilarBrandList: false
  203. }
  204. },
  205. components: {
  206. Page
  207. },
  208. computed: {
  209. bomList () {
  210. let _this = this
  211. let list = this.$store.state.applyPurchase.bomMaterial.bomList.data
  212. for (let i = 0; i < list.content.length; i++) {
  213. _this.$set(list.content[i], 'checked', false)
  214. _this.$set(list.content[i], 'active', false)
  215. // list.content[i].checked = false
  216. // list.content[i].active = false
  217. // if (!list.content[i].code || list.content[i].brand || !list.content[i].deadline || !this.isValidDate(list.content[i].deadline)) {
  218. // _this.validList = false
  219. // }
  220. }
  221. return list
  222. },
  223. bomNumber () {
  224. return this.$store.state.applyPurchase.bomMaterial.bomNumber.data
  225. }
  226. },
  227. mounted () {
  228. let _this = this
  229. document.body.onclick = function () {
  230. _this.showSimilarCodeList = false
  231. _this.showSimilarBrandList = false
  232. }
  233. },
  234. filters: {
  235. date: function (input) {
  236. if (input) {
  237. const d = new Date(input)
  238. const year = d.getFullYear()
  239. const monthTemp = d.getMonth() + 1
  240. const month = monthTemp < 10 ? '0' + monthTemp : '' + monthTemp
  241. const day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate()
  242. return year + '-' + month + '-' + day
  243. } else {
  244. return null
  245. }
  246. }
  247. },
  248. methods: {
  249. initModifyObj: function () {
  250. this.modifyObj = {
  251. code: '',
  252. brand: '',
  253. unitPrice: '',
  254. currency: 'RMB',
  255. encapsulation: '',
  256. produceDate: '',
  257. amount: '',
  258. deadline: ''
  259. }
  260. },
  261. listenPage: function (page) {
  262. this.nowPage = page
  263. this.reloadData()
  264. },
  265. reloadData: function () {
  266. this.$store.dispatch('applyPurchase/loadBOMMaterialList', {bomId: this.$route.params.id, page: this.nowPage, count: this.pageSize})
  267. },
  268. submitBOM: function () {
  269. let str = ''
  270. for (let i = 0; i < this.bomList.content.length; i++) {
  271. if (this.bomList.content[i].checked) {
  272. str += this.bomList.content[i].id + ','
  273. }
  274. }
  275. let param = {'bomId': Number(this.$route.params.id)}
  276. if (str.length) {
  277. str = str.substring(0, str.length - 1)
  278. param.spIds = str
  279. }
  280. this.$http.post('/seek/confirmBom', param)
  281. .then(response => {
  282. if (response.data.success) {
  283. this.showRemindBox = true
  284. this.onSaleNum = response.data.data
  285. this.listenPage(1)
  286. this.$store.dispatch('applyPurchase/loadBOMNumber', {bomId: this.$route.params.id})
  287. } else {
  288. this.$message.error('发布失败')
  289. }
  290. }, err => {
  291. console.log(err)
  292. this.$message.error('系统错误')
  293. })
  294. },
  295. onCheck: function (index) {
  296. if (typeof index === 'undefined') {
  297. let isCheckedAll = true
  298. for (let i = 0; i < this.bomList.content.length; i++) {
  299. if (!this.bomList.content[i].checked) {
  300. isCheckedAll = false
  301. break
  302. }
  303. }
  304. this.setAllCheck(!isCheckedAll)
  305. this.isCheckAll = !isCheckedAll
  306. }
  307. },
  308. setAllCheck: function (flag) {
  309. for (let i = 0; i < this.bomList.content.length; i++) {
  310. this.bomList.content[i].checked = flag
  311. }
  312. },
  313. modifyItem: function (index) {
  314. for (let i = 0; i < this.bomList.content.length; i++) {
  315. this.bomList.content[i].active = false
  316. }
  317. // this.$set(this.bomList.content[index], 'active', true)
  318. this.bomList.content[index].active = true
  319. let _this = this
  320. this.initModifyObj()
  321. for (let attr in this.bomList.content[index]) {
  322. _this.$set(_this.modifyObj, attr, _this.bomList.content[index][attr])
  323. // _this.modifyObj[attr] = _this.bomList.content[index][attr]
  324. }
  325. // this.modifyObj = this.bomList.content[index]
  326. this.modifyObj.deadline = this.getDate(this.bomList.content[index].deadline)
  327. },
  328. cancelModify: function (index) {
  329. this.bomList.content[index].active = false
  330. },
  331. getDate: function (input) {
  332. const d = new Date(input)
  333. const year = d.getFullYear()
  334. const monthTemp = d.getMonth() + 1
  335. const month = monthTemp < 10 ? '0' + monthTemp : '' + monthTemp
  336. const day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate()
  337. return year + '-' + month + '-' + day
  338. },
  339. submitModify: function (index) {
  340. let checkValid = this.checkAll()
  341. if (this.getSingleValidInfo(this.modifyObj) && checkValid) {
  342. this.$http.put('/seek/updateSeekPurchaseByBatch', this.modifyObj)
  343. .then(response => {
  344. if (response.data.success) {
  345. this.reloadData()
  346. this.$message.success('修改成功')
  347. // this.bomList.content[index].active = false
  348. } else {
  349. this.$message.error('修改失败')
  350. }
  351. }, err => {
  352. console.log(err)
  353. this.$message.error('系统错误')
  354. })
  355. } else {
  356. if (!checkValid) {
  357. if (!this.validObj.code) {
  358. this.$message.error('型号不能为空')
  359. } else if (!this.validObj.brand) {
  360. this.$message.error('品牌不能为空')
  361. } else if (!this.validObj.deadline) {
  362. this.$message.error('截止日期不能为空')
  363. } else if (!this.validObj.amount || !this.validObj.unitPrice) {
  364. this.$message.error('请输入正确的数值')
  365. }
  366. } else {
  367. this.$message.error('请完善信息')
  368. }
  369. }
  370. },
  371. deleteItem: function (index) {
  372. if (!index) {
  373. let str = ''
  374. for (let i = 0; i < this.bomList.content.length; i++) {
  375. if (this.bomList.content[i].checked) {
  376. str += this.bomList.content[i].id + ','
  377. }
  378. }
  379. let param = {}
  380. if (str.length) {
  381. str = str.substring(0, str.length - 1)
  382. param.spIds = str
  383. this.doDelete(param)
  384. } else {
  385. this.$message.error('请勾选')
  386. return
  387. }
  388. } else {
  389. this.doDelete({spIds: this.bomList.content[index].id})
  390. }
  391. },
  392. doDelete: function (param) {
  393. this.$http.put('/seek/deleteSeekPurchaseByBatch', param)
  394. .then(response => {
  395. if (response.data.success) {
  396. this.listenPage(1)
  397. this.$message.success('删除成功')
  398. } else {
  399. this.$message.error('删除失败')
  400. }
  401. }, err => {
  402. console.log(err)
  403. this.$message.error('系统错误')
  404. })
  405. },
  406. isValidTime: function (time) {
  407. let now = new Date().getTime()
  408. return !time || (time >= now && time <= now + 1000 * 60 * 60 * 24 * 90)
  409. },
  410. isValidDate: function (date) {
  411. let now = new Date().getTime()
  412. let time = new Date(date).getTime()
  413. return !time || (time >= now && time <= now + 1000 * 60 * 60 * 24 * 90)
  414. },
  415. getSimilarCode: function () {
  416. this.$http.get('/search/similarComponents', {params: {keyword: this.modifyObj.code}})
  417. .then(response => {
  418. this.similarCode = response.data
  419. if (response.data.length) {
  420. this.showSimilarCodeList = true
  421. }
  422. })
  423. },
  424. getSimilarBrand: function () {
  425. this.$http.get('/search/similarBrands', {params: {keyword: this.modifyObj.brand}})
  426. .then(response => {
  427. this.similarBrand = response.data
  428. if (response.data.length) {
  429. this.showSimilarBrandList = true
  430. }
  431. })
  432. },
  433. getSingleValidInfo: function (item) {
  434. return item.code && item.brand && item.deadline && item.deadline !== 'NaN-NaN-NaN' && this.isValidDate(item.deadline)
  435. },
  436. checkCode: function () {
  437. this.validObj.code = this.modifyObj.code && this.modifyObj.code !== ''
  438. return this.validObj.code
  439. },
  440. checkBrand: function () {
  441. this.validObj.brand = this.modifyObj.brand && this.modifyObj.brand !== ''
  442. return this.validObj.brand
  443. },
  444. checkUnitPrice: function () {
  445. this.validObj.unitPrice = (!this.modifyObj.unitPrice || this.modifyObj.unitPrice === '') ? true : this.modifyObj.unitPrice > 0 && this.modifyObj.unitPrice < 100000000
  446. return this.validObj.unitPrice
  447. },
  448. // checkEncapsulation: function () {
  449. // this.validObj.encapsulation = this.applyObj.encapsulation && this.applyObj.encapsulation !== ''
  450. // },
  451. // checkProduceDate: function () {
  452. // this.validObj.produceDate = this.applyObj.produceDate && this.applyObj.produceDate !== ''
  453. // },
  454. checkAmount: function () {
  455. this.validObj.amount = (!this.modifyObj.amount || this.modifyObj.amount === '') ? true : this.modifyObj.amount > 0 && this.modifyObj.amount < 100000000
  456. return this.validObj.amount
  457. },
  458. checkAll: function () {
  459. return this.checkCode() && this.checkBrand() && this.checkDeadline() && this.checkUnitPrice() && this.checkAmount()
  460. },
  461. checkDeadline: function () {
  462. this.validObj.deadline = Boolean(this.modifyObj.deadline)
  463. return this.validObj.deadline
  464. },
  465. onUnitPriceInput: function () {
  466. let price = this.modifyObj.unitPrice
  467. if (price >= 10000) {
  468. this.modifyObj.unitPrice = price.substring(0, 4)
  469. } else if (price.indexOf('.') > -1) {
  470. let arr = price.split('.')
  471. if (arr[0].length > 4) {
  472. this.modifyObj.unitPrice = Number(arr[0].substring(0, 4) + '.' + arr[1])
  473. } else if (arr[1].length > 6) {
  474. this.modifyObj.unitPrice = Number(arr[0] + '.' + arr[1].substring(0, 6))
  475. }
  476. }
  477. },
  478. onProduceDateChange: function () {
  479. if (this.modifyObj.produceDate && getRealLen(this.modifyObj.produceDate) > 12) {
  480. this.modifyObj.produceDate = cutOutString(this.modifyObj.produceDate, 12)
  481. }
  482. },
  483. onEncapsulationChange: function () {
  484. if (this.modifyObj.encapsulation && getRealLen(this.modifyObj.encapsulation) > 20) {
  485. this.modifyObj.encapsulation = cutOutString(this.modifyObj.encapsulation, 20)
  486. }
  487. },
  488. onCodeChange: function () {
  489. this.modifyObj.code = this.modifyObj.code.trim()
  490. if ((/[^\x00-\xff]/g).test(this.modifyObj.code)) {
  491. let chineseIndex = -1
  492. for (let i = 0; i < this.modifyObj.code.length; i++) {
  493. if ((/[^\x00-\xff]/g).test(this.modifyObj.code.charAt(i))) {
  494. chineseIndex = i
  495. break
  496. }
  497. }
  498. this.modifyObj.code = cutOutString(this.modifyObj.code, chineseIndex)
  499. } else if (this.modifyObj.code && getRealLen(this.modifyObj.code) > 100) {
  500. this.modifyObj.code = cutOutString(this.modifyObj.code, 100)
  501. } else {
  502. this.getSimilarCode()
  503. }
  504. },
  505. onBrandChange: function () {
  506. this.modifyObj.brand = this.modifyObj.brand.trim()
  507. if ((/[^\x00-\xff]/g).test(this.modifyObj.brand)) {
  508. let chineseIndex = -1
  509. for (let i = 0; i < this.modifyObj.brand.length; i++) {
  510. if ((/[^\x00-\xff]/g).test(this.modifyObj.brand.charAt(i))) {
  511. chineseIndex = i
  512. break
  513. }
  514. }
  515. this.modifyObj.brand = cutOutString(this.modifyObj.brand, chineseIndex)
  516. } else if (this.modifyObj.brand && getRealLen(this.modifyObj.brand) > 50) {
  517. this.modifyObj.brand = cutOutString(this.modifyObj.brand, 50)
  518. } else {
  519. this.getSimilarBrand()
  520. }
  521. },
  522. onAmountInput: function () {
  523. if (!(/^[0-9]*$/).test(this.modifyObj.amount)) {
  524. let chineseIndex = -1
  525. for (let i = 0; i < this.modifyObj.amount.length; i++) {
  526. if (!(/^[0-9]*$/).test(this.modifyObj.amount.charAt(i))) {
  527. chineseIndex = i
  528. break
  529. }
  530. }
  531. this.modifyObj.amount = cutOutString(this.modifyObj.amount, chineseIndex)
  532. } else if (this.modifyObj.amount.length > 8) {
  533. this.modifyObj.amount = cutOutString(this.modifyObj.amount, 8)
  534. }
  535. },
  536. setCode: function (code) {
  537. this.modifyObj.code = code
  538. this.showSimilarCodeList = false
  539. },
  540. setBrand: function (brand) {
  541. this.modifyObj.brand = brand
  542. this.showSimilarBrandList = false
  543. }
  544. }
  545. }
  546. </script>
  547. <style lang="scss">
  548. .batch-publish {
  549. margin: 0 auto;
  550. width: 998px;
  551. .red-text {
  552. color: #ff0000;
  553. }
  554. .blue-text {
  555. color: #3c7cf5;
  556. }
  557. > p {
  558. margin: 59px 0 42px;
  559. font-size: 16px;
  560. }
  561. table {
  562. width: 100%;
  563. table-layout: fixed;
  564. thead {
  565. tr {
  566. th {
  567. background: #b8b8b8;
  568. color: #fff;
  569. font-weight: normal;
  570. height: 50px;
  571. line-height: 50px;
  572. text-align: center;
  573. .com-check-box {
  574. margin-right: 2px;
  575. }
  576. i {
  577. margin-right: 3px;
  578. }
  579. }
  580. }
  581. }
  582. tbody {
  583. tr {
  584. height: 85px;
  585. line-height: 85px;
  586. text-align: center;
  587. border : {
  588. bottom: 1px solid #d9d9d9;
  589. left: 1px solid #d9d9d9;
  590. right: 1px solid #d9d9d9;
  591. }
  592. &:hover {
  593. background: #f3f3f3;
  594. }
  595. td {
  596. position: relative;
  597. font-size: 12px;
  598. > div {
  599. overflow: hidden;
  600. overflow-y: unset;
  601. text-overflow: ellipsis;
  602. white-space: nowrap;
  603. }
  604. > ul {
  605. line-height: normal;
  606. position: absolute;
  607. top: 52px;
  608. left: 24px;
  609. background: #fff;
  610. border: 1px solid #b5b5b5;
  611. z-index: 1;
  612. max-height: 120px;
  613. overflow-y: auto;
  614. overflow-x: hidden;
  615. border-radius: 3px;
  616. width: 114px;
  617. li {
  618. height: 24px;
  619. line-height: 24px;
  620. cursor: pointer;
  621. overflow: hidden;
  622. text-overflow: ellipsis;
  623. white-space: nowrap;
  624. padding: 0 5px;
  625. &:hover {
  626. background: #ddd;
  627. }
  628. }
  629. &.brand-similar-list {
  630. left: 20px;
  631. width: 94px;
  632. }
  633. }
  634. div.red-text {
  635. line-height: normal;
  636. position: absolute;
  637. left: 42px;
  638. top: 49px;
  639. }
  640. &.operate {
  641. a {
  642. display: block;
  643. width: 64px;
  644. height: 24px;
  645. line-height: 22px;
  646. text-align: center;
  647. border-radius: 3px;
  648. margin: 0 auto 4px;
  649. font-size: 14px;
  650. &.submit-btn {
  651. border: 1px solid #f64900;
  652. color: #fff;
  653. background: #f64900;
  654. }
  655. &.cancel-btn {
  656. border: 1px solid #bbb;
  657. color: #fff;
  658. background: #bbb;
  659. }
  660. }
  661. }
  662. }
  663. &.modify-row {
  664. td {
  665. position: relative;
  666. input, select {
  667. height: 20px;
  668. border-radius: 3px;
  669. background: #f4f4f4;
  670. border: 1px solid #b5b5b5;
  671. text-align: center;
  672. padding: 0 5px;
  673. &.error {
  674. border-color: #f4645f !important;
  675. }
  676. }
  677. &:nth-child(2) {
  678. input {
  679. width: 113px;
  680. }
  681. }
  682. &:nth-child(3) {
  683. input {
  684. width: 93px;
  685. }
  686. }
  687. &:nth-child(4) {
  688. input {
  689. width: 71px;
  690. }
  691. }
  692. &:nth-child(5) {
  693. input {
  694. width: 65px;
  695. padding: 0 5px 0 30px;
  696. }
  697. select {
  698. width: 25px;
  699. padding: 0 0 0 2px;
  700. background: url(/images/applyPurchase/select.png) no-repeat right;
  701. background-size: 12px 19px;
  702. background-position: 13px 0;
  703. position: absolute;
  704. top: 33px;
  705. border-bottom: none;
  706. border-top: none;
  707. border-left: 0;
  708. }
  709. }
  710. &:nth-child(6) {
  711. input {
  712. width: 54px;
  713. }
  714. }
  715. &:nth-child(7) {
  716. input {
  717. width: 72px;
  718. }
  719. }
  720. &:nth-child(8) {
  721. div {
  722. width: 101px;
  723. overflow: unset;
  724. input {
  725. width: 101px;
  726. }
  727. }
  728. }
  729. }
  730. }
  731. }
  732. }
  733. }
  734. .modify-btn {
  735. border: 1px solid #3c7cf5;
  736. color: #3c7cf5;
  737. background: #fff;
  738. }
  739. .delete-btn {
  740. border: 1px solid #3c7cf5;
  741. color: #fff;
  742. background: #3c7cf5;
  743. }
  744. .submit-area {
  745. margin: 51px auto 60px;
  746. text-align: center;
  747. clear: both;
  748. a {
  749. display: inline-block;
  750. width: 64px;
  751. height: 24px;
  752. line-height: 22px;
  753. text-align: center;
  754. border-radius: 3px;
  755. &.modify-btn {
  756. width: 90px;
  757. margin-left: 14px;
  758. }
  759. }
  760. }
  761. .apply-del-box{
  762. position: fixed;
  763. z-index: 1000;
  764. height: auto;
  765. opacity: 1;
  766. background-color: white;
  767. width: 310px;
  768. -webkit-box-shadow: 0 5px 15px rgba(0,0,0,.5);
  769. -moz-box-shadow: 0 5px 15px rgba(0,0,0,.5);
  770. -o-box-shadow: 0 5px 15px rgba(0,0,0,.5);
  771. box-shadow: 0 5px 15px rgba(0,0,0,.5);
  772. margin: -155px 0 0 -75px;
  773. top: 55%;
  774. left: 43%;
  775. .title{
  776. height: 24px;
  777. background-color: #007aff;
  778. text-align: right;
  779. padding-right: 15px;
  780. line-height: 24px;
  781. a{
  782. color: white;
  783. font-size: 12px;
  784. }
  785. }
  786. .content{
  787. width: 100%;
  788. text-align: center;
  789. margin: 0 auto;
  790. p{
  791. padding: 12px 31px;
  792. margin: 0;
  793. &:nth-child(2) {
  794. font-size: 12px;
  795. padding-top: 0;
  796. }
  797. i{
  798. color: #5078cb;
  799. font-size: 16px;
  800. margin-right: 10px;
  801. }
  802. span {
  803. color: #007aff;
  804. }
  805. &:last-child {
  806. font-size: 12px;
  807. }
  808. }
  809. div{
  810. width: 100%;
  811. text-align: center;
  812. margin: 0 auto 20px;
  813. a{
  814. padding: 0 19px;
  815. height: 26px;
  816. line-height: 26px;
  817. display: inline-block;
  818. text-align: center;
  819. font-size: 14px;
  820. color: #fff;
  821. &:first-child{
  822. background: #c8c6c6;
  823. margin-right: 10px;
  824. }
  825. &:last-child{
  826. background: #007aff;
  827. }
  828. }
  829. }
  830. }
  831. }
  832. }
  833. </style>