BatchPublish.vue 52 KB

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