BatchPublish.vue 53 KB

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