BatchPublish.vue 56 KB

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