BatchPublish.vue 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272
  1. <template>
  2. <div class="batch-publish">
  3. <p><img src="/images/applyPurchase/batch-icon.png" alt="">共上传<b class="blue-text">{{bomNumber.successImport || 0}}</b>个产品,其中<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="140"><i class="red-text">*</i>型号</th>
  14. <th width="132"><i class="red-text">*</i>品牌</th>
  15. <th width="80">采购数量</th>
  16. <th width="108">单价预算</th>
  17. <th width="76">封装</th>
  18. <th width="102">生产日期</th>
  19. <th width="124"><i class="red-text">*</i>截止时间</th>
  20. <th width="192">操作</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.codeWord || item.codeWord.length == 0)" :title="item.code">{{item.code}}</div>
  33. <span class="red-text" v-if="!item.code">请完善信息</span>
  34. <div class="similar-select" v-if="item.codeWord && item.codeWord.length > 0" @click="setShowCodeWord(index, $event)">{{item.code}}</div>
  35. <ul v-show="item.showCodeWord">
  36. <li v-for="code in item.codeWord" @click="modifyItemByWord(index, code.code, 'code')" :title="code.code">{{code.code}}</li>
  37. </ul>
  38. </td>
  39. <td>
  40. <div v-if="item.brand && (!item.brandWord || item.brandWord.length == 0)" :title="item.brand">{{item.brand}}</div>
  41. <span class="red-text" v-if="!item.brand">请完善信息</span>
  42. <div class="similar-select" v-if="item.brandWord && item.brandWord.length > 0" @click="setShowBrandWord(index, $event)">{{item.brand}}</div>
  43. <ul v-show="item.showBrandWord" class="brand-word-list">
  44. <li v-for="brand in item.brandWord" @click="modifyItemByWord(index, brand.nameEn, 'brand')" :title="brand.nameEn">{{brand.nameEn}}</li>
  45. </ul>
  46. </td>
  47. <td>
  48. <div :title="item.amount">{{item.amount || '-'}}</div>
  49. </td>
  50. <td class="blue-text">
  51. <div>
  52. <span v-if="item.unitPrice">{{(item.currency === 'RMB' ? '¥' : '$') + item.unitPrice}}</span>
  53. <span v-if="!item.unitPrice">-</span>
  54. </div>
  55. </td>
  56. <td>
  57. <div :title="item.encapsulation">
  58. {{item.encapsulation || '-'}}
  59. </div>
  60. </td>
  61. <td>
  62. <div :title="item.produceDate">
  63. {{item.produceDate || '-'}}
  64. </div>
  65. </td>
  66. <td>
  67. <span v-if="item.deadline">{{item.deadline | date}}</span>
  68. <span class="red-text" v-if="!item.deadline">请完善信息</span>
  69. <div class="red-text" v-if="!isValidTime(item.deadline)">默认≤90天</div>
  70. </td>
  71. <td class="operate">
  72. <a @click="modifyItem(index)">编辑</a>
  73. <a @click="deleteItem(index)">删除</a>
  74. <a @click="setShowSpotGoods(true, item)" v-if="item.spotGoods && item.spotGoods.length && !item.showSpotGoods">商城现货&nbsp;<i class="fa fa-angle-double-down"></i></a>
  75. <a @click="setShowSpotGoods(false)" v-if="item.spotGoods && item.spotGoods.length && item.showSpotGoods">收起&nbsp;<i class="fa fa-angle-double-up"></i></a>
  76. </td>
  77. </tr>
  78. <tr class="spot-goods" v-if="item.showSpotGoods">
  79. <td colspan="8">
  80. <div class="spot-goods-body">
  81. <div class="spot-goods-title">商城现货(998)</div>
  82. <table>
  83. <thead>
  84. <tr>
  85. <th width="214">卖家</th>
  86. <th width="83">交期(天)</th>
  87. <th width="104">单价</th>
  88. <th width="137">生产日期</th>
  89. <th width="111">库存</th>
  90. <th width="142">购买数量</th>
  91. <th width="186">操作</th>
  92. </tr>
  93. </thead>
  94. </table>
  95. <div class="spot-goods-list">
  96. <table>
  97. <tbody>
  98. <tr v-for="(spotGoods, index) in spotGoodsData">
  99. <td width="214" v-text="spotGoods.enterpriseName"></td>
  100. <td width="83" class="red-text" v-text="spotGoods.minDelivery + '-' + spotGoods.maxDelivery">4-6</td>
  101. <td width="104" class="red-text">$123</td>
  102. <td width="137" v-text="spotGoods.produceDate"></td>
  103. <td width="111" v-text="spotGoods.reserve">21412</td>
  104. <td width="142" class="input-number">
  105. <div>
  106. <span @click="subNum(index)" :class="{'not-allowed': !fragments[index].canSub}">-</span>
  107. <input type="number" v-model="fragments[index].num" @blur="inputNum(index)">
  108. <span @click="addNum(index)" :class="{'not-allowed': !fragments[index].canAdd}">+</span>
  109. </div>
  110. </td>
  111. <td width="186" class="operate">
  112. <a href="javascript:void(0)" @click="linkSaler(spotGoods)">联系卖家<img src="/images/applyPurchase/link-buyer.png" alt=""></a>
  113. <span @click="buyNow(spotGoods, index)">立即购买</span>
  114. </td>
  115. </tr>
  116. </tbody>
  117. </table>
  118. </div>
  119. </div>
  120. </td>
  121. </tr>
  122. <tr class="modify-row" v-if="item.active">
  123. <!-- <td>
  124. <label class="com-check-box">
  125. <input type="checkbox" @change="onCheck(index)" v-model="item.checked" :id="index">
  126. <label :for="index"></label>
  127. </label>
  128. </td>-->
  129. <td>
  130. <input type="text" class="form-control" v-model="modifyObj.code" :class="{'error': !validObj.code}" @blur="checkCode" @input="onCodeChange" >
  131. <ul v-show="showSimilarCodeList">
  132. <li v-for="sCode in similarCode" @click="setCode(sCode.code)">{{sCode.code}}</li>
  133. </ul>
  134. </td>
  135. <td>
  136. <input type="text" class="form-control" v-model="modifyObj.brand" :class="{'error': !validObj.brand}" @blur="checkBrand" @input="onBrandChange">
  137. <ul class="brand-similar-list" v-show="showSimilarBrandList">
  138. <li v-for="sBrand in similarBrand" @click="setBrand(sBrand.nameEn)">{{sBrand.nameEn}}</li>
  139. </ul>
  140. </td>
  141. <td>
  142. <input type="text" class="form-control" v-model="modifyObj.amount" :class="{'error': !validObj.amount}" @blur="checkAmount" @input="onAmountInput">
  143. </td>
  144. <td>
  145. <select class="form-control" v-model="modifyObj.currency">
  146. <option value="RMB">¥</option>
  147. <option value="USD">$</option>
  148. </select>
  149. <input class="form-control" type="number" v-model="modifyObj.unitPrice" :class="{'error': !validObj.unitPrice}" @blur="checkUnitPrice" @input="onUnitPriceInput">
  150. </td>
  151. <td>
  152. <input type="text" class="form-control" v-model="modifyObj.encapsulation" @input="onEncapsulationChange">
  153. </td>
  154. <td>
  155. <input type="text" class="form-control" v-model="modifyObj.produceDate" @input="onProduceDateChange">
  156. </td>
  157. <td>
  158. <el-date-picker
  159. v-model="modifyObj.deadline"
  160. type="date"
  161. :picker-options="pickerOptions"
  162. :editable="false"
  163. :class="{'error': !validObj.deadline}"
  164. @change="getDate1()"
  165. size="mini">
  166. </el-date-picker>
  167. <!--<input type="text" class="form-control" v-model="modifyObj.deadline">-->
  168. </td>
  169. <td class="operate">
  170. <a class="btn-ok" @click="submitModify(index)">确认</a>
  171. <a class="btn-cancel" @click="cancelModify(index)">取消</a>
  172. </td>
  173. </tr>
  174. </tbody>
  175. </table>
  176. <page :total="bomList.totalElements" :page-size="pageSize"
  177. :current="nowPage" @childEvent="listenPage"></page>
  178. <div class="submit-area" v-if="bomList.content.length">
  179. <!-- <a class="modify-btn" @click="deleteItem()">删除</a>-->
  180. <a class="modify-btn" @click="submitBOM">确认发布</a>
  181. </div>
  182. </div>
  183. </template>
  184. <script>
  185. import { enidfilter, getRealLen, cutOutString, formatDate } from '~utils/baseUtils'
  186. import Page from '~components/common/page/pageComponent.vue'
  187. export default {
  188. data () {
  189. return {
  190. pageSize: 10,
  191. nowPage: 1,
  192. isCheckAll: false,
  193. // showRemindBox: false,
  194. modifyObj: {
  195. code: '',
  196. brand: '',
  197. unitPrice: '',
  198. currency: 'RMB',
  199. encapsulation: '',
  200. produceDate: '',
  201. amount: '',
  202. deadline: ''
  203. },
  204. pickerOptions: {
  205. disabledDate (time) {
  206. // 大于等于今天 小于三个月后
  207. return time.getTime() < Date.now() - 1000 * 60 * 60 * 24 || time.getTime() > Date.now() + 1000 * 60 * 60 * 24 * 30 * 3
  208. }
  209. },
  210. similarCode: [],
  211. similarBrand: [],
  212. validObj: {
  213. code: true,
  214. brand: true,
  215. unitPrice: true,
  216. // encapsulation: true,
  217. // produceDate: true,
  218. amount: true,
  219. deadline: true
  220. },
  221. // successResult: 0,
  222. showSimilarCodeList: false,
  223. showSimilarBrandList: false,
  224. spotGoodsData: [],
  225. fragments: []
  226. }
  227. },
  228. components: {
  229. Page
  230. },
  231. computed: {
  232. bomList () {
  233. let _this = this
  234. let list = this.$store.state.applyPurchase.bomMaterial.bomList.data
  235. for (let i = 0; i < list.content.length; i++) {
  236. _this.$set(list.content[i], 'checked', false)
  237. _this.$set(list.content[i], 'active', false)
  238. _this.$set(list.content[i], 'showCodeWord', false)
  239. _this.$set(list.content[i], 'showBrandWord', false)
  240. _this.$set(list.content[i], 'showSpotGoods', false)
  241. // list.content[i].checked = false
  242. // list.content[i].active = false
  243. // if (!list.content[i].code || list.content[i].brand || !list.content[i].deadline || !this.isValidDate(list.content[i].deadline)) {
  244. // _this.validList = false
  245. // }
  246. }
  247. return list
  248. },
  249. bomNumber () {
  250. return this.$store.state.applyPurchase.bomMaterial.bomNumber.data
  251. },
  252. tab () {
  253. return this.$store.state.chat.tab.tab.data
  254. },
  255. user () {
  256. return this.$store.state.option.user
  257. }
  258. },
  259. mounted () {
  260. let _this = this
  261. document.body.onclick = function () {
  262. _this.showSimilarCodeList = false
  263. _this.showSimilarBrandList = false
  264. for (let i = 0; i < _this.bomList.content.length; i++) {
  265. _this.bomList.content[i].showCodeWord = false
  266. _this.bomList.content[i].showBrandWord = false
  267. }
  268. }
  269. },
  270. filters: {
  271. date: function (input) {
  272. if (input) {
  273. const d = new Date(input)
  274. const year = d.getFullYear()
  275. const monthTemp = d.getMonth() + 1
  276. const month = monthTemp < 10 ? '0' + monthTemp : '' + monthTemp
  277. const day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate()
  278. return year + '-' + month + '-' + day
  279. } else {
  280. return null
  281. }
  282. },
  283. currencyStr: function (str) {
  284. return typeof str === 'string' && str !== 'RMB' && str !== 'USD' ? str.startsWith('RMB') ? '¥' + str.substring(3, str.length) : '$' + str.substring(3, str.length) : '-'
  285. }
  286. },
  287. methods: {
  288. getDate1: function () {
  289. this.modifyObj.deadline = formatDate(this.modifyObj.deadline, 'yyyy-MM-dd hh:mm:ss')
  290. },
  291. initModifyObj: function () {
  292. this.modifyObj = {
  293. code: '',
  294. brand: '',
  295. unitPrice: '',
  296. currency: 'RMB',
  297. encapsulation: '',
  298. produceDate: '',
  299. amount: '',
  300. deadline: ''
  301. }
  302. },
  303. initValidObj: function () {
  304. this.validObj = {
  305. code: true,
  306. brand: true,
  307. unitPrice: true,
  308. amount: true,
  309. deadline: true
  310. }
  311. },
  312. listenPage: function (page) {
  313. this.nowPage = page
  314. this.reloadData()
  315. },
  316. reloadData: function () {
  317. this.$store.dispatch('applyPurchase/loadBOMMaterialList', {bomId: this.$route.params.id, page: this.nowPage, count: this.pageSize})
  318. },
  319. submitBOM: function () {
  320. let str = ''
  321. // let _this = this
  322. for (let i = 0; i < this.bomList.content.length; i++) {
  323. if (this.bomList.content[i].checked) {
  324. if (!this.getSingleValidInfo(this.bomList.content[i])) {
  325. this.$message.error('请选择信息完善的产品发布求购')
  326. return
  327. }
  328. str += this.bomList.content[i].id + ','
  329. }
  330. }
  331. let param = {'bomId': Number(this.$route.params.id)}
  332. if (str.length) {
  333. str = str.substring(0, str.length - 1)
  334. param.spIds = str
  335. }
  336. this.$http.post('/seek/confirmBom?bomId=' + Number(this.$route.params.id))
  337. .then(response => {
  338. if (response.data.success) {
  339. // this.showRemindBox = true
  340. // this.successResult = response.data.data
  341. // this.listenPage(1)
  342. // this.$store.dispatch('applyPurchase/loadBOMNumber', {bomId: this.$route.params.id})
  343. if (response.data.data.successAmount) {
  344. this.$router.push('/applyPurchase/result?status=success&count=' + response.data.data.successAmount)
  345. } else {
  346. this.$message.error('发布失败,请完善信息')
  347. }
  348. } else {
  349. // this.$message.error(response.data.message)
  350. this.$router.push('/applyPurchase/result?status=error')
  351. }
  352. }, err => {
  353. console.log(err)
  354. this.$message.error('系统错误')
  355. })
  356. },
  357. onCheck: function (index) {
  358. if (typeof index === 'undefined') {
  359. let isCheckedAll = true
  360. for (let i = 0; i < this.bomList.content.length; i++) {
  361. if (!this.bomList.content[i].checked) {
  362. isCheckedAll = false
  363. break
  364. }
  365. }
  366. this.setAllCheck(!isCheckedAll)
  367. this.isCheckAll = !isCheckedAll
  368. }
  369. },
  370. setAllCheck: function (flag) {
  371. for (let i = 0; i < this.bomList.content.length; i++) {
  372. this.bomList.content[i].checked = flag
  373. }
  374. },
  375. cancelModifyItem: function () {
  376. for (let i = 0; i < this.bomList.content.length; i++) {
  377. if (this.bomList.content[i].active) {
  378. this.$message.error('抱歉,您尚有未保存的信息')
  379. return false
  380. }
  381. this.bomList.content[i].active = false
  382. }
  383. return true
  384. },
  385. modifyItem: function (index) {
  386. if (!this.cancelModifyItem()) {
  387. return
  388. }
  389. this.cancelShowSpotGoods()
  390. // this.$set(this.bomList.content[index], 'active', true)
  391. this.bomList.content[index].active = true
  392. let _this = this
  393. this.initModifyObj()
  394. this.initValidObj()
  395. for (let attr in this.bomList.content[index]) {
  396. // console.log(attr + ':' + _this.bomList.content[index][attr])
  397. _this.$set(_this.modifyObj, attr, _this.bomList.content[index][attr])
  398. // _this.modifyObj[attr] = _this.bomList.content[index][attr]
  399. }
  400. // this.modifyObj = this.bomList.content[index]
  401. this.modifyObj.deadline = this.bomList.content[index].deadline ? this.getDate(this.bomList.content[index].deadline) : ''
  402. },
  403. cancelModify: function (index) {
  404. this.bomList.content[index].active = false
  405. },
  406. getDate: function (input) {
  407. const d = new Date(input)
  408. const year = d.getFullYear()
  409. const monthTemp = d.getMonth() + 1
  410. const month = monthTemp < 10 ? '0' + monthTemp : '' + monthTemp
  411. const day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate()
  412. return year + '-' + month + '-' + day
  413. },
  414. // validDate: function (timestamp) {
  415. // let now = new Date().getTime()
  416. // return timestamp - now <= 1000 * 60 * 60 * 24 * 90 && timestamp - now > 0
  417. // },
  418. submitModify: function (index) {
  419. let checkValid = this.checkAll()
  420. if (this.getSingleValidInfo(this.modifyObj) && checkValid) {
  421. if (!this.modifyObj.unitPrice) {
  422. this.modifyObj.currency = null
  423. }
  424. this.$http.put('/seek/updateSeekPurchaseByBatch', this.modifyObj)
  425. .then(response => {
  426. if (response.data.success) {
  427. this.reloadData()
  428. this.$message.success('修改成功')
  429. // this.bomList.content[index].active = false
  430. } else {
  431. this.$message.error('修改失败')
  432. }
  433. }, err => {
  434. console.log(err)
  435. this.$message.error('系统错误')
  436. })
  437. } else {
  438. if (!checkValid) {
  439. if (!this.validObj.code) {
  440. this.$message.error('型号不能为空')
  441. } else if (!this.validObj.brand) {
  442. this.$message.error('品牌不能为空')
  443. } else if (!this.validObj.deadline) {
  444. if (!this.isValidDate(this.modifyObj.deadline)) {
  445. this.$message.error('截止日期需在90天以内')
  446. } else {
  447. this.$message.error('截止日期不能为空')
  448. }
  449. } else if (!this.validObj.amount || !this.validObj.unitPrice) {
  450. this.$message.error('请输入正确的数值')
  451. }
  452. } else {
  453. this.$message.error('请完善信息')
  454. }
  455. }
  456. },
  457. deleteItem: function (index) {
  458. if (!index && index !== 0) {
  459. let str = ''
  460. for (let i = 0; i < this.bomList.content.length; i++) {
  461. if (this.bomList.content[i].checked) {
  462. str += this.bomList.content[i].id + ','
  463. }
  464. }
  465. let param = {}
  466. if (str.length) {
  467. str = str.substring(0, str.length - 1)
  468. param.spIds = str
  469. this.doDelete(param)
  470. } else {
  471. this.$message.error('请勾选')
  472. return
  473. }
  474. } else {
  475. this.doDelete({spIds: this.bomList.content[index].id})
  476. }
  477. },
  478. doDelete: function (param) {
  479. this.$http.put('/seek/deleteSeekPurchaseByBatch', param)
  480. .then(response => {
  481. if (response.data.success) {
  482. this.listenPage(1)
  483. this.$message.success('删除成功')
  484. } else {
  485. this.$message.error('删除失败')
  486. }
  487. }, err => {
  488. console.log(err)
  489. this.$message.error('系统错误')
  490. })
  491. },
  492. isValidTime: function (time) {
  493. let now = new Date().getTime()
  494. return !time || (time >= now && time <= now + 1000 * 60 * 60 * 24 * 91)
  495. },
  496. isValidDate: function (date) {
  497. date = formatDate(date, 'yyyy-MM-dd hh:mm:ss')
  498. this.modifyObj.deadline = date
  499. let now = new Date().getTime()
  500. let time = new Date(date).getTime()
  501. return !time || (time >= now && time <= now + 1000 * 60 * 60 * 24 * 91)
  502. },
  503. getSimilarCode: function () {
  504. this.$http.get('/search/similarComponents', {params: {keyword: this.modifyObj.code}})
  505. .then(response => {
  506. this.similarCode = response.data
  507. if (response.data.length) {
  508. this.showSimilarCodeList = true
  509. } else {
  510. this.showSimilarCodeList = false
  511. }
  512. })
  513. },
  514. getSimilarBrand: function () {
  515. this.$http.get('/search/similarBrands', {params: {keyword: this.modifyObj.brand}})
  516. .then(response => {
  517. this.similarBrand = response.data
  518. if (response.data.length) {
  519. this.showSimilarBrandList = true
  520. } else {
  521. this.showSimilarBrandList = false
  522. }
  523. })
  524. },
  525. getSingleValidInfo: function (item) {
  526. return item.code && item.brand && item.deadline && this.isValidDate(item.deadline)
  527. },
  528. checkCode: function () {
  529. this.validObj.code = this.modifyObj.code && this.modifyObj.code !== ''
  530. return this.validObj.code
  531. },
  532. checkBrand: function () {
  533. this.validObj.brand = this.modifyObj.brand && this.modifyObj.brand !== ''
  534. return this.validObj.brand
  535. },
  536. checkUnitPrice: function () {
  537. this.validObj.unitPrice = (!this.modifyObj.unitPrice || this.modifyObj.unitPrice === '') ? true : this.modifyObj.unitPrice > 0 && this.modifyObj.unitPrice < 100000000
  538. return this.validObj.unitPrice
  539. },
  540. checkAmount: function () {
  541. this.validObj.amount = (!this.modifyObj.amount || this.modifyObj.amount === '') ? true : this.modifyObj.amount > 0 && this.modifyObj.amount < 1000000000
  542. return this.validObj.amount
  543. },
  544. checkAll: function () {
  545. return this.checkCode() && this.checkBrand() && this.checkDeadline() && this.checkUnitPrice() && this.checkAmount()
  546. },
  547. checkDeadline: function () {
  548. this.validObj.deadline = this.modifyObj.deadline && this.modifyObj.deadline !== '' && this.isValidDate(this.modifyObj.deadline)
  549. return this.validObj.deadline
  550. },
  551. onUnitPriceInput: function () {
  552. let price = this.modifyObj.unitPrice
  553. if (price >= 10000) {
  554. this.modifyObj.unitPrice = price.substring(0, 4)
  555. } else if (price.indexOf('.') > -1) {
  556. let arr = price.split('.')
  557. if (arr[0].length > 4) {
  558. this.modifyObj.unitPrice = Number(arr[0].substring(0, 4) + '.' + arr[1])
  559. } else if (arr[1].length > 6) {
  560. this.modifyObj.unitPrice = Number(arr[0] + '.' + arr[1].substring(0, 6))
  561. }
  562. }
  563. },
  564. onProduceDateChange: function () {
  565. if (this.modifyObj.produceDate && getRealLen(this.modifyObj.produceDate) > 12) {
  566. this.modifyObj.produceDate = cutOutString(this.modifyObj.produceDate, 12)
  567. }
  568. },
  569. onEncapsulationChange: function () {
  570. if (this.modifyObj.encapsulation && getRealLen(this.modifyObj.encapsulation) > 20) {
  571. this.modifyObj.encapsulation = cutOutString(this.modifyObj.encapsulation, 20)
  572. }
  573. },
  574. onCodeChange: function () {
  575. this.modifyObj.code = this.modifyObj.code.trim()
  576. if ((/[^\x00-\xff]/g).test(this.modifyObj.code)) {
  577. let chineseIndex = -1
  578. for (let i = 0; i < this.modifyObj.code.length; i++) {
  579. if ((/[^\x00-\xff]/g).test(this.modifyObj.code.charAt(i))) {
  580. chineseIndex = i
  581. break
  582. }
  583. }
  584. this.modifyObj.code = cutOutString(this.modifyObj.code, chineseIndex)
  585. } else if (this.modifyObj.code && getRealLen(this.modifyObj.code) > 100) {
  586. this.modifyObj.code = cutOutString(this.modifyObj.code, 100)
  587. } else {
  588. this.getSimilarCode()
  589. }
  590. },
  591. onBrandChange: function () {
  592. this.modifyObj.brand = this.modifyObj.brand.trim()
  593. if ((/[^\x00-\xff]/g).test(this.modifyObj.brand)) {
  594. let chineseIndex = -1
  595. for (let i = 0; i < this.modifyObj.brand.length; i++) {
  596. if ((/[^\x00-\xff]/g).test(this.modifyObj.brand.charAt(i)) && !(/[\u4e00-\u9fa5]/).test(this.modifyObj.brand.charAt(i))) {
  597. chineseIndex = i
  598. break
  599. }
  600. }
  601. if (chineseIndex > -1) {
  602. this.modifyObj.brand = this.modifyObj.brand.substring(0, chineseIndex)
  603. }
  604. } else if (this.modifyObj.brand && getRealLen(this.modifyObj.brand) > 50) {
  605. this.modifyObj.brand = cutOutString(this.modifyObj.brand, 50)
  606. }
  607. this.getSimilarBrand()
  608. },
  609. onAmountInput: function () {
  610. if (!(/^[0-9]*$/).test(this.modifyObj.amount)) {
  611. let chineseIndex = -1
  612. for (let i = 0; i < this.modifyObj.amount.length; i++) {
  613. if (!(/^[0-9]*$/).test(this.modifyObj.amount.charAt(i))) {
  614. chineseIndex = i
  615. break
  616. }
  617. }
  618. this.modifyObj.amount = cutOutString(this.modifyObj.amount, chineseIndex)
  619. } else if (this.modifyObj.amount.length > 9) {
  620. this.modifyObj.amount = cutOutString(this.modifyObj.amount, 9)
  621. }
  622. },
  623. setCode: function (code) {
  624. this.modifyObj.code = code
  625. this.showSimilarCodeList = false
  626. },
  627. setBrand: function (brand) {
  628. this.modifyObj.brand = brand
  629. this.showSimilarBrandList = false
  630. },
  631. setShowCodeWord: function (index, event) {
  632. event.stopPropagation()
  633. for (let i = 0; i < this.bomList.content.length; i++) {
  634. if (i !== index) {
  635. this.bomList.content[i].showCodeWord = false
  636. }
  637. this.bomList.content[i].showBrandWord = false
  638. }
  639. this.bomList.content[index].showCodeWord = !this.bomList.content[index].showCodeWord
  640. },
  641. setShowBrandWord: function (index, event) {
  642. event.stopPropagation()
  643. for (let i = 0; i < this.bomList.content.length; i++) {
  644. if (i !== index) {
  645. this.bomList.content[i].showBrandWord = false
  646. }
  647. this.bomList.content[i].showCodeWord = false
  648. }
  649. this.bomList.content[index].showBrandWord = !this.bomList.content[index].showBrandWord
  650. },
  651. modifyItemByWord: function (index, param, type) {
  652. if (type === 'code') {
  653. this.bomList.content[index].code = param
  654. this.requestModify(this.bomList.content[index])
  655. } else if (type === 'brand') {
  656. this.bomList.content[index].brand = param
  657. this.requestModify(this.bomList.content[index])
  658. } else {
  659. this.$message.error('修改失败')
  660. }
  661. },
  662. requestModify: function (item) {
  663. this.$http.put('/seek/updateSeekPurchaseByBatch', item)
  664. .then(response => {
  665. if (response.data.success) {
  666. this.$message.success('修改成功')
  667. } else {
  668. this.$message.error('修改失败')
  669. }
  670. this.reloadData()
  671. }, err => {
  672. console.log(err)
  673. this.$message.error('系统错误')
  674. this.reloadData()
  675. })
  676. },
  677. cancelShowSpotGoods: function () {
  678. for (let i = 0; i < this.bomList.content.length; i++) {
  679. this.bomList.content[i].showSpotGoods = false
  680. }
  681. },
  682. setShowSpotGoods: function (flag, item) {
  683. if (flag && item && item.spotGoods.length) {
  684. this.spotGoodsData = item.spotGoods
  685. this.initFragments()
  686. }
  687. if (!this.cancelModifyItem()) {
  688. return
  689. }
  690. this.cancelShowSpotGoods()
  691. item.showSpotGoods = flag
  692. },
  693. initFragment: function (commodity) {
  694. if (!commodity) {
  695. return {}
  696. }
  697. let fragment = {}
  698. let prices = commodity.prices[0]
  699. fragment.num = commodity.minBuyQty
  700. fragment.prices = prices
  701. if (commodity.currencyName !== 'USD') {
  702. fragment.currency = 'RMB'
  703. } else {
  704. fragment.currency = 'USD'
  705. }
  706. if (fragment.currency !== 'USD') {
  707. fragment.price = prices.rMBPrice
  708. } else {
  709. fragment.price = prices.uSDPrice
  710. }
  711. fragment.canAdd = true
  712. fragment.canSub = false
  713. return fragment
  714. },
  715. initFragments: function () {
  716. for (let i = 0; i < this.spotGoodsData.length; i++) {
  717. this.fragments.push(this.initFragment(this.spotGoodsData[i]))
  718. }
  719. },
  720. getFragment: function (commodity, fragment) {
  721. // 判断是否小于第一分段的起订量
  722. if (commodity.prices[0].start > fragment.num) {
  723. fragment.num = commodity.prices[0].start
  724. }
  725. // 获取分段的信息
  726. let prices = commodity.prices
  727. for (let i = 0; i < prices.length; i++) {
  728. if (fragment.num <= prices[i].end) {
  729. fragment.prices = prices[i]
  730. break
  731. }
  732. }
  733. },
  734. onInput: function (index) {
  735. let prices = this.spotGoodsData[index].prices
  736. if (prices && prices.length) {
  737. for (let i = 0; i < prices.length; i++) {
  738. if (this.fragments[index].num >= prices[i].start && this.fragments[index].num <= prices[i].end) {
  739. this.fragments[index].price = this.fragments[index].currency === 'RMB' ? prices[i].rMBPrice : prices[i].uSDPrice
  740. break
  741. }
  742. }
  743. }
  744. },
  745. changeNum: function (newNum, index) {
  746. let pack = this.spotGoodsData[index].perQty || this.spotGoodsData[index].minPackQty
  747. let buy = this.spotGoodsData[index].minBuyQty
  748. let reserve = this.spotGoodsData[index].reserve
  749. let breakUp = this.spotGoodsData[index].breakUp
  750. let nowFragment = this.fragments[index]
  751. if (!newNum) {
  752. nowFragment.num = buy
  753. } else {
  754. newNum = parseInt(newNum)
  755. if (breakUp) {
  756. if (newNum < buy) {
  757. this.$message.error('最小起订量为' + buy)
  758. nowFragment.num = buy
  759. nowFragment.canSub = false
  760. nowFragment.canAdd = true
  761. } else if (newNum > reserve) {
  762. this.$message.error('库存不足')
  763. nowFragment.num = reserve
  764. nowFragment.canAdd = false
  765. nowFragment.canSub = true
  766. } else {
  767. nowFragment.canSub = true
  768. nowFragment.canAdd = true
  769. nowFragment.num = newNum
  770. newNum === buy && (nowFragment.canSub = false)
  771. newNum === reserve && (nowFragment.canAdd = false)
  772. }
  773. } else {
  774. if (newNum < buy) {
  775. this.$message.error('最小起订量为' + buy)
  776. nowFragment.num = buy
  777. nowFragment.canSub = false
  778. if (newNum > reserve) {
  779. this.$message.error('库存不足')
  780. nowFragment.num = reserve - (reserve % pack)
  781. nowFragment.canAdd = false
  782. }
  783. } else if (newNum > reserve) {
  784. nowFragment.canSub = true
  785. nowFragment.canAdd = false
  786. this.$message.error('库存不足')
  787. nowFragment.num = reserve - (reserve % pack)
  788. } else {
  789. nowFragment.canSub = true
  790. nowFragment.canAdd = true
  791. let remainder = newNum % pack
  792. if (remainder !== 0) {
  793. this.$message.error('不支持拆包且包装量为' + pack)
  794. let res = (Math.floor(newNum / pack) + 1) * pack
  795. nowFragment.num = res > reserve ? Math.floor(newNum / pack) * pack : res
  796. } else {
  797. nowFragment.num = newNum
  798. }
  799. newNum === buy && (nowFragment.canSub = false)
  800. newNum === reserve && (nowFragment.canAdd = false)
  801. }
  802. }
  803. }
  804. },
  805. subNum: function (index) {
  806. let nowFragment = this.fragments[index]
  807. if (nowFragment.canSub) {
  808. let pack = this.spotGoodsData[index].perQty || this.spotGoodsData[index].minPackQty
  809. let newNum = 0
  810. if (this.spotGoodsData[index].breakUp) {
  811. newNum = nowFragment.num - 1
  812. } else {
  813. newNum = nowFragment.num - pack
  814. }
  815. this.changeNum(newNum, index)
  816. this.getFragment(this.spotGoodsData[index], nowFragment)
  817. this.onInput(index)
  818. } else {
  819. this.$message.error('该商品最少购买' + this.spotGoodsData[index].minBuyQty + '件')
  820. }
  821. },
  822. addNum: function (index) {
  823. let nowFragment = this.fragments[index]
  824. if (nowFragment.canAdd) {
  825. let pack = this.spotGoodsData[index].perQty || this.spotGoodsData[index].minPackQty
  826. let newNum = 0
  827. if (this.spotGoodsData[index].breakUp) {
  828. newNum = nowFragment.num + 1
  829. } else {
  830. newNum = nowFragment.num + pack
  831. }
  832. this.changeNum(newNum, index)
  833. this.getFragment(this.spotGoodsData[index], nowFragment)
  834. this.onInput(index)
  835. } else {
  836. this.$message.error('库存不足')
  837. }
  838. },
  839. inputNum: function (index) {
  840. if ((/^[\d]*$/).test(this.fragments[index].num)) {
  841. this.changeNum(this.fragments[index].num, index)
  842. this.getFragment(this.spotGoodsData[index], this.fragments[index])
  843. } else {
  844. this.message.error('请输入整数')
  845. this.fragments[index].num = this.spotGoodsData[index].minBuyQty
  846. }
  847. this.onInput(index)
  848. },
  849. buyNow: function (goods, index) {
  850. this.$http.post('trade/order/buyNow', [{
  851. uuid: goods.uuid,
  852. batchCode: goods.batchCode,
  853. number: this.fragments[index].num,
  854. storeid: goods.storeid ? goods.storeid : goods.storeId,
  855. storeUuid: goods.storeid ? goods.storeid : goods.storeId,
  856. currencyName: goods.currencyName,
  857. minPackQty: goods.minPackQty
  858. }])
  859. .then(response => {
  860. if (response.data.success) {
  861. if (response.data.message) {
  862. this.$message({
  863. message: response.data.message,
  864. type: 'success'
  865. })
  866. window.setTimeout(function () {
  867. window.open('/user#/order/pay/' + enidfilter(response.data.data.orderid))
  868. }, 1000)
  869. } else {
  870. window.open('/user#/order/pay/' + enidfilter(response.data.data.orderid))
  871. }
  872. } else {
  873. if (response.data.data && response.data.data.unvailable === 1) {
  874. this.$message.error('产品信息已失效,请刷新页面')
  875. } else {
  876. this.$message.error(response.data.message)
  877. }
  878. }
  879. }, err => {
  880. console.log(err)
  881. if (goods.minBuyQty > goods.reserve) {
  882. this.$message.error('商品' + goods.code + '的库存已经不满足起订量')
  883. }
  884. })
  885. },
  886. linkSaler: function (commodity) {
  887. // 获得窗口的垂直位置
  888. let iTop = (window.screen.availHeight - 30 - 780) / 2
  889. // 获得窗口的水平位置
  890. let iLeft = (window.screen.availWidth - 10 - 1030) / 2
  891. if (this.tab.close) {
  892. this.tab.close()
  893. }
  894. let newTab = window.open('', '即时对话框', 'height=750, width=1000, top=' + iTop + ', left=' + iLeft + ', toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no')
  895. newTab.close()
  896. newTab = window.open('', '即时对话框', 'height=750, width=1000, top=' + iTop + ', left=' + iLeft + ', toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no')
  897. this.$store.dispatch('chat/setChatTab', {tab: newTab})
  898. this.$http.get('/basic/enterprise/' + commodity.enUU + '/info')
  899. .then(response => {
  900. let obj = {}
  901. obj.userPhone = this.user.data.userTel
  902. obj.userType = 'ENTERPRISE'
  903. this.user.data.enterprises.forEach(function (item, index) {
  904. if (item.current) {
  905. obj.enUU = item.uu
  906. obj.enterprise = {enUU: item.uu, name: item.enName}
  907. }
  908. })
  909. obj.otherEnUU = response.data.uu
  910. obj.otherUserType = 'STORE'
  911. obj.otherEnterprise = {enUU: response.data.uu, name: response.data.enName}
  912. obj.type = 'CHAT'
  913. if (!(/^1\d{10}$/).test(response.data.enTel)) {
  914. this.$http.get('/basic/enterprise/' + response.data.uu + '/admin').then(response => {
  915. console.log(response)
  916. obj.toPhone = response.data.userTel
  917. console.log(obj)
  918. this.openWebChat(newTab, obj)
  919. }, err => {
  920. console.log(err)
  921. this.$message.error('暂无卖家管理员手机号!')
  922. })
  923. } else {
  924. obj.toPhone = response.data.enTel
  925. console.log(obj)
  926. this.openWebChat(newTab, obj)
  927. }
  928. }, err => {
  929. console.log(err)
  930. })
  931. },
  932. openWebChat: function (newTab, obj) {
  933. this.$http.post('https://im.ubtob.com/api/chat/infos?condition=chat_info', obj)
  934. .then(response => {
  935. if (response.data.success) {
  936. newTab.location.href = 'https://im.ubtob.com/chat/visit?gid=' + response.data.content
  937. } else {
  938. newTab.close()
  939. this.$message.error(response.data.message)
  940. }
  941. })
  942. }
  943. }
  944. }
  945. </script>
  946. <style lang="scss">
  947. .batch-publish {
  948. margin: 0 auto;
  949. width: 1190px;
  950. .red-text {
  951. color: #ff0000;
  952. }
  953. .blue-text {
  954. color: #3c7cf5;
  955. }
  956. > p {
  957. margin: 30px 0 56px;
  958. font-size: 16px;
  959. height: 60px;
  960. line-height: 60px;
  961. background: #f7f9fd;
  962. padding-left: 24px;
  963. > img {
  964. width: 23px;
  965. height: 31px;
  966. margin-right: 12px;
  967. }
  968. }
  969. > table {
  970. width: 1150px;
  971. margin: 0 auto;
  972. table-layout: fixed;
  973. > thead {
  974. tr {
  975. th {
  976. background: #89aefa;
  977. color: #fff;
  978. font-weight: normal;
  979. height: 40px;
  980. line-height: 40px;
  981. text-align: center;
  982. .com-check-box {
  983. margin-right: 2px;
  984. }
  985. i {
  986. margin-right: 3px;
  987. }
  988. }
  989. }
  990. }
  991. > tbody {
  992. > tr {
  993. height: 70px;
  994. line-height: 70px;
  995. text-align: center;
  996. border : {
  997. bottom: 1px solid #bcd2ff;
  998. left: 1px solid #bcd2ff;
  999. right: 1px solid #bcd2ff;
  1000. }
  1001. &:hover {
  1002. background: #f3f3f3;
  1003. }
  1004. > td {
  1005. position: relative;
  1006. > ul {
  1007. line-height: normal;
  1008. position: absolute;
  1009. top: 48px;
  1010. left: 12px;
  1011. background: #fff;
  1012. border: 1px solid #b5b5b5;
  1013. z-index: 1;
  1014. max-height: 120px;
  1015. overflow-y: auto;
  1016. overflow-x: hidden;
  1017. border-radius: 2px;
  1018. width: 145px;
  1019. li {
  1020. height: 30px;
  1021. line-height: 30px;
  1022. cursor: pointer;
  1023. overflow: hidden;
  1024. text-overflow: ellipsis;
  1025. white-space: nowrap;
  1026. padding: 0 5px;
  1027. &:hover {
  1028. background: #89aefa;
  1029. color: #fff;
  1030. }
  1031. }
  1032. &.brand-similar-list {
  1033. left: 7px;
  1034. }
  1035. }
  1036. > div {
  1037. overflow: hidden;
  1038. overflow-y: unset;
  1039. text-overflow: ellipsis;
  1040. white-space: nowrap;
  1041. &.similar-select {
  1042. width: 145px;
  1043. margin: 0 auto;
  1044. border: 1px solid #b5b5b5;
  1045. height: 30px;
  1046. line-height: 30px;
  1047. overflow-y: hidden;
  1048. padding: 0 22px 0 5px;
  1049. background: url('/images/all/select-icon-full.png') no-repeat;
  1050. background-position: 125px 10px;
  1051. cursor: default;
  1052. border-radius: 2px;
  1053. & + ul {
  1054. width: 145px;
  1055. top: 48px;
  1056. left: 12px;
  1057. &.brand-word-list {
  1058. left: 7px;
  1059. }
  1060. }
  1061. }
  1062. }
  1063. div.red-text {
  1064. line-height: normal;
  1065. position: absolute;
  1066. left: 42px;
  1067. top: 49px;
  1068. font-size: 12px;
  1069. }
  1070. &.operate {
  1071. text-align: left;
  1072. padding-left: 18px;
  1073. a {
  1074. padding: 5px 12px;
  1075. color: #3c7cf5;
  1076. margin-left: 5px;
  1077. &:hover {
  1078. color: #fff;
  1079. background: #3c7cf5;
  1080. border-radius: 3px;
  1081. }
  1082. &.btn-ok {
  1083. background: #ff8522;
  1084. color: #fff;
  1085. border-radius: 3px;
  1086. }
  1087. }
  1088. }
  1089. }
  1090. &.spot-goods {
  1091. background: #fff;
  1092. > td {
  1093. .spot-goods-body {
  1094. .spot-goods-title {
  1095. height: 36px;
  1096. line-height: 36px;
  1097. background: #414140;
  1098. color: #fff;
  1099. }
  1100. table {
  1101. width: 1130px;
  1102. margin-left: 9px;
  1103. table-layout: fixed;
  1104. thead tr th {
  1105. text-align: center;
  1106. height: 34px;
  1107. line-height: 34px;
  1108. background: #fce8df;
  1109. font-weight: normal;
  1110. }
  1111. }
  1112. .spot-goods-list {
  1113. max-height: 250px;
  1114. overflow-y: auto;
  1115. overflow-x: hidden;
  1116. table {
  1117. margin-bottom: 10px;
  1118. tbody tr {
  1119. border: 1px solid #fce8df;
  1120. td {
  1121. height: 48px;
  1122. line-height: 48px;
  1123. &.input-number {
  1124. > div {
  1125. position: relative;
  1126. width: 100px;
  1127. margin: 0 auto;
  1128. span {
  1129. width: 17px;
  1130. height: 27px;
  1131. background: #4290f7;
  1132. line-height: 27px;
  1133. color: #fff;
  1134. display: inline-block;
  1135. font-size: 16px;
  1136. vertical-align: middle;
  1137. position: absolute;
  1138. top: 12px;
  1139. cursor: pointer;
  1140. &.not-allowed {
  1141. cursor: not-allowed;
  1142. background: #e8e8e8;
  1143. }
  1144. &:last-child {
  1145. right: 10px;
  1146. }
  1147. }
  1148. input {
  1149. width: 80px;
  1150. height: 26px;
  1151. text-align: center;
  1152. line-height: normal;
  1153. vertical-align: middle;
  1154. outline: none;
  1155. }
  1156. }
  1157. }
  1158. &.operate {
  1159. a {
  1160. color: #5078cb;
  1161. font-size: 12px;
  1162. }
  1163. span {
  1164. display: inline-block;
  1165. width: 64px;
  1166. height: 24px;
  1167. line-height: 24px;
  1168. text-align: center;
  1169. background: #4290f7;
  1170. color: #fff;
  1171. margin-left: 13px;
  1172. cursor: pointer;
  1173. font-size: 12px;
  1174. border-radius: 2px;
  1175. }
  1176. }
  1177. }
  1178. }
  1179. }
  1180. }
  1181. }
  1182. }
  1183. }
  1184. &.modify-row {
  1185. td {
  1186. position: relative;
  1187. input, select {
  1188. height: 30px;
  1189. border-radius: 3px;
  1190. border: 1px solid #b5b5b5;
  1191. text-align: center;
  1192. padding: 0 5px;
  1193. &.error {
  1194. border-color: #f4645f !important;
  1195. }
  1196. }
  1197. &:nth-child(1) {
  1198. input {
  1199. width: 145px;
  1200. }
  1201. }
  1202. &:nth-child(2) {
  1203. input {
  1204. width: 145px;
  1205. }
  1206. }
  1207. &:nth-child(3) {
  1208. input {
  1209. width: 104px;
  1210. }
  1211. }
  1212. &:nth-child(4) {
  1213. input {
  1214. width: 103px;
  1215. padding: 0 5px 0 30px;
  1216. }
  1217. select {
  1218. width: 25px;
  1219. padding: 0 0 0 2px;
  1220. background: url(/images/applyPurchase/select.png) no-repeat right;
  1221. background-size: 12px 28px;
  1222. background-position: 12px 0;
  1223. position: absolute;
  1224. top: 20px;
  1225. border-bottom: none;
  1226. border-top: none;
  1227. border-left: 0;
  1228. }
  1229. }
  1230. &:nth-child(5) {
  1231. input {
  1232. width: 96px;
  1233. }
  1234. }
  1235. &:nth-child(6) {
  1236. input {
  1237. width: 85px;
  1238. }
  1239. }
  1240. &:nth-child(7) {
  1241. div {
  1242. width: 101px;
  1243. overflow: unset;
  1244. input {
  1245. width: 125px;
  1246. }
  1247. }
  1248. }
  1249. }
  1250. }
  1251. }
  1252. }
  1253. }
  1254. .submit-area {
  1255. margin: 51px auto 60px;
  1256. text-align: center;
  1257. clear: both;
  1258. a {
  1259. display: inline-block;
  1260. width: 90px;
  1261. height: 24px;
  1262. line-height: 22px;
  1263. text-align: center;
  1264. border-radius: 3px;
  1265. color: #fff;
  1266. background: #3c7cf5;
  1267. }
  1268. }
  1269. }
  1270. </style>