BatchPublish.vue 53 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402
  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.code">
  36. <span class="pi-title"><i class="red-text">*</i>型号:</span>
  37. <div class="pi-content over-ell" v-if="item.code && (!item.codeWord || item.codeWord.length == 0)" :title="item.code">{{item.code}}</div>
  38. <div class="pi-content red-text" v-if="!item.code">请完善信息</div>
  39. <div class="pi-content over-ell similar-select" v-if="item.codeWord && item.codeWord.length > 0" @click="setShowCodeWord(index, $event)">{{item.code}}</div>
  40. <ul v-show="item.showCodeWord">
  41. <li v-for="code in item.codeWord" @click="modifyItemByWord(index, code.code, 'code')" :title="code.code">{{code.code}}</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.brand">
  50. <span class="pi-title"><i class="red-text">*</i>品牌:</span>
  51. <div class="pi-content over-ell" v-if="item.brand && (!item.brandWord || item.brandWord.length == 0)" :title="item.brand">{{item.brand}}</div>
  52. <div class="pi-content red-text" v-if="!item.brand">请完善信息</div>
  53. <div class="pi-content similar-select over-ell" v-if="item.brandWord && item.brandWord.length > 0" @click="setShowBrandWord(index, $event)">{{item.brand}}</div>
  54. <ul v-show="item.showBrandWord">
  55. <li v-for="brand in item.brandWord" @click="modifyItemByWord(index, brand.nameEn, 'brand')" :title="brand.nameEn">{{brand.nameEn}}</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">商城现货({{spotGoodsData.length || 0}})</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.storeName"></td>
  112. <td width="83" class="red-text" v-text="spotGoods.b2cMinDelivery + '-' + spotGoods.b2cMaxDelivery">4-6</td>
  113. <td width="104" class="red-text" v-text="spotGoods.currencyName == 'RMB' ? '¥' + spotGoods.prices[0].rMBPrice: '$' + spotGoods.prices[0].uSDPrice"></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.code" :class="{'error': !validObj.code}" @blur="checkCode" @input="onCodeChange" >
  150. <ul v-show="showSimilarCodeList">
  151. <li v-for="sCode in similarCode" @click="setCode(sCode.code)">{{sCode.code}}</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.brand" :class="{'error': !validObj.brand}" @blur="checkBrand" @input="onBrandChange">
  165. <ul class="brand-similar-list" v-show="showSimilarBrandList">
  166. <li v-for="sBrand in similarBrand" @click="setBrand(sBrand.nameEn)">{{sBrand.nameEn}}</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. color: #999;
  1100. .red-text {
  1101. margin-right: 3px;
  1102. }
  1103. }
  1104. .pi-content {
  1105. display: inline-block;
  1106. text-align: left;
  1107. vertical-align: middle;
  1108. }
  1109. &.prod-item-large {
  1110. .pi-content {
  1111. width: 145px;
  1112. }
  1113. .pi-title {
  1114. width: 62px;
  1115. }
  1116. }
  1117. &.prod-item-small {
  1118. .pi-content {
  1119. width: 105px;
  1120. }
  1121. .pi-title {
  1122. width: 70px;
  1123. }
  1124. }
  1125. > ul {
  1126. line-height: normal;
  1127. position: absolute;
  1128. top: 31px;
  1129. left: 62px;
  1130. background: #fff;
  1131. border: 1px solid #b5b5b5;
  1132. z-index: 1;
  1133. max-height: 120px;
  1134. overflow-y: auto;
  1135. overflow-x: hidden;
  1136. border-radius: 2px;
  1137. width: 145px;
  1138. li {
  1139. height: 30px;
  1140. line-height: 30px;
  1141. cursor: pointer;
  1142. overflow: hidden;
  1143. text-overflow: ellipsis;
  1144. white-space: nowrap;
  1145. padding: 0 5px;
  1146. text-align: left;
  1147. &:hover {
  1148. background: #89aefa;
  1149. color: #fff;
  1150. }
  1151. }
  1152. }
  1153. }
  1154. }
  1155. .similar-select {
  1156. width: 145px;
  1157. margin: 0 auto;
  1158. border: 1px solid #b5b5b5;
  1159. height: 30px;
  1160. line-height: 30px;
  1161. overflow-y: hidden;
  1162. padding: 0 22px 0 5px;
  1163. background: url('/images/all/select-icon-full.png') no-repeat;
  1164. background-color: #fff;
  1165. background-position: 125px 10px;
  1166. cursor: default;
  1167. border-radius: 2px;
  1168. & + ul {
  1169. width: 145px;
  1170. top: 48px;
  1171. left: 12px;
  1172. &.brand-word-list {
  1173. left: 7px;
  1174. }
  1175. }
  1176. }
  1177. &.operate {
  1178. text-align: left;
  1179. font-size: 12px;
  1180. a {
  1181. color: #3c7cf5;
  1182. margin-left: 5px;
  1183. &.size-s {
  1184. padding: 4px 12px;
  1185. }
  1186. &.size-m {
  1187. padding: 4px 7px;
  1188. }
  1189. &:hover {
  1190. color: #fff;
  1191. background: #3c7cf5;
  1192. border-radius: 3px;
  1193. }
  1194. &.btn-ok {
  1195. background: #ff8522;
  1196. color: #fff;
  1197. border-radius: 3px;
  1198. }
  1199. }
  1200. }
  1201. .remind {
  1202. font-size: 12px;
  1203. }
  1204. }
  1205. &.spot-goods {
  1206. background: #fff;
  1207. > td {
  1208. .spot-goods-body {
  1209. .spot-goods-title {
  1210. height: 36px;
  1211. line-height: 36px;
  1212. background: #414140;
  1213. color: #fff;
  1214. }
  1215. table {
  1216. width: 1130px;
  1217. margin-left: 9px;
  1218. table-layout: fixed;
  1219. thead tr th {
  1220. text-align: center;
  1221. height: 34px;
  1222. line-height: 34px;
  1223. background: #fce8df;
  1224. font-weight: normal;
  1225. }
  1226. }
  1227. .spot-goods-list {
  1228. max-height: 250px;
  1229. overflow-y: auto;
  1230. overflow-x: hidden;
  1231. table {
  1232. margin-bottom: 10px;
  1233. tbody tr {
  1234. border: 1px solid #fce8df;
  1235. &:nth-child(even) {
  1236. background: #fdf8f5;
  1237. }
  1238. td {
  1239. height: 48px;
  1240. line-height: 48px;
  1241. &.input-number {
  1242. > div {
  1243. position: relative;
  1244. width: 100px;
  1245. margin: 0 auto;
  1246. span {
  1247. width: 17px;
  1248. height: 26px;
  1249. background: #4290f7;
  1250. line-height: 26px;
  1251. color: #fff;
  1252. display: inline-block;
  1253. font-size: 16px;
  1254. vertical-align: middle;
  1255. position: absolute;
  1256. top: 12px;
  1257. cursor: pointer;
  1258. &.not-allowed {
  1259. cursor: not-allowed;
  1260. background: #d7d5d5;
  1261. }
  1262. &:first-child {
  1263. left: -7px;
  1264. }
  1265. &:last-child {
  1266. right: -7px;
  1267. }
  1268. }
  1269. input {
  1270. width: 81px;
  1271. height: 26px;
  1272. text-align: center;
  1273. line-height: normal;
  1274. vertical-align: middle;
  1275. outline: none;
  1276. border: 1px solid #d1d0d0;
  1277. padding: 0 5px;
  1278. }
  1279. }
  1280. }
  1281. &.operate {
  1282. a {
  1283. color: #5078cb;
  1284. font-size: 12px;
  1285. }
  1286. span {
  1287. display: inline-block;
  1288. width: 64px;
  1289. height: 24px;
  1290. line-height: 24px;
  1291. text-align: center;
  1292. background: #4290f7;
  1293. color: #fff;
  1294. margin-left: 13px;
  1295. cursor: pointer;
  1296. font-size: 12px;
  1297. border-radius: 2px;
  1298. }
  1299. }
  1300. }
  1301. }
  1302. }
  1303. }
  1304. }
  1305. }
  1306. }
  1307. &.modify-row {
  1308. td {
  1309. input, select {
  1310. height: 30px;
  1311. border-radius: 2px;
  1312. border: 1px solid #dadada;
  1313. text-align: center;
  1314. padding: 0 5px;
  1315. display: inline-block;
  1316. &.error {
  1317. border-color: #f4645f !important;
  1318. }
  1319. }
  1320. input:focus {
  1321. -webkit-box-shadow: none;
  1322. -moz-box-shadow: none;
  1323. box-shadow: none;
  1324. border: 1px solid #3c7cf5;
  1325. }
  1326. .prod-item {
  1327. position: relative;
  1328. &.prod-item-large {
  1329. input {
  1330. width: 145px;
  1331. }
  1332. }
  1333. &.prod-item-small {
  1334. input {
  1335. width: 105px;
  1336. }
  1337. }
  1338. &.pi-select {
  1339. input {
  1340. width: 103px;
  1341. padding: 0 5px 0 30px;
  1342. }
  1343. select {
  1344. width: 25px;
  1345. padding: 0 0 0 2px;
  1346. background: url(/images/applyPurchase/select2.png) no-repeat right;
  1347. background-size: 12px 28px;
  1348. background-position: 12px 0;
  1349. position: absolute;
  1350. top: 1px;
  1351. border-bottom: none;
  1352. border-top: none;
  1353. border-left: 0;
  1354. }
  1355. }
  1356. }
  1357. &:nth-child(2) {
  1358. input {
  1359. width: 83px;
  1360. }
  1361. }
  1362. &:nth-child(3) {
  1363. input {
  1364. width: 106px;
  1365. }
  1366. }
  1367. &:nth-child(4) {
  1368. div {
  1369. width: 106px;
  1370. overflow: unset;
  1371. input {
  1372. width: 106px;
  1373. border-radius: 2px;
  1374. border: 1px solid #dadada;
  1375. }
  1376. }
  1377. }
  1378. }
  1379. }
  1380. }
  1381. }
  1382. }
  1383. .submit-area {
  1384. margin: 51px auto 0;
  1385. text-align: center;
  1386. clear: both;
  1387. a {
  1388. display: inline-block;
  1389. width: 126px;
  1390. height: 34px;
  1391. line-height: 34px;
  1392. text-align: center;
  1393. border-radius: 2px;
  1394. color: #fff;
  1395. background: #ff8522;
  1396. }
  1397. }
  1398. }
  1399. }
  1400. </style>