BatchPublish.vue 28 KB

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