material.vue 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233
  1. <template>
  2. <div>
  3. <div class="material-wrapper" >
  4. <div class="order-nav">
  5. <div :class="activeType === '' ? 'active': ''" @click="ChangeList('')"><span>公司产品库</span></div>
  6. <div :class="activeType === 'mine' ? 'active' : ''" @click="ChangeList('mine')"><span>我的产品库</span></div>
  7. </div>
  8. <div class="search-content">
  9. <input type="text" placeholder="请输入您要查找的品牌或型号" v-model="seekKeyword" @keyup.13="searchSeek">
  10. <span @click="searchSeek" >
  11. <i class="iconfont icon-sousuo"></i>
  12. </span>
  13. </div>
  14. <div class="scrollContent" id="provider-wrapper">
  15. <div class="providerList" v-for="(item, index) in GetEnterpriseListData">
  16. <div class="top">
  17. <div class="icon" :class="item.standard ? 'standed' : 'istanded'"></div>
  18. <div class="text" style="width: 4.3rem">
  19. {{item.pcmpcode}}
  20. </div>
  21. <div class="text" style="width: 1rem;color: #666;font-size: 0.28rem">
  22. {{item.goods && item.goods.storeid === '33069557578d44e69bd91ad12d28a8d4' ? '寄售' : '自营' || '寄售'}}
  23. <!--{{item.goods && item.goods.selfSale === 1 ? '自营' : '寄售' || '-'}}-->
  24. </div>
  25. <div class="text" style="width: 1rem;color: #666;font-size: 0.28rem">
  26. {{item.goods && (item.goods.status === 601 || item.goods.status === 602) ? '已上架' : '已下架' }}
  27. </div>
  28. <!-- <div class="pms">
  29. {{item.storeid === '33069557578d44e69bd91ad12d28a8d4' ? '寄售' : '自营'}}
  30. </div>-->
  31. <!--<img class="store-type" v-if="item.goods && item.goods.storeid === '33069557578d44e69bd91ad12d28a8d4'" src="/images/mobile/product/consignment.png" alt="">-->
  32. <!--<img class="store-type" src="/images/mobile/product/self.png" alt="" v-else >=-->
  33. <img class="store-type" src="/images/mobile/product/mine_icon.png" v-if="item.addProductPerson"/>
  34. </div>
  35. <div class="middle">
  36. <div class="list" style="height: 0.46rem;">
  37. <div class="fl">
  38. <div class="name">品牌:</div>
  39. <div class="text">{{item.pbranden || item.pbrand || '-'}}</div>
  40. </div>
  41. <!--<div class="fr">-->
  42. <!--<div class="button" @click="update(item)">编辑</div>-->
  43. <!--<div class="button" @click="offProduct(item, index)">下架</div>-->
  44. <!--</div>-->
  45. </div>
  46. <div class="list">
  47. <div class="name">物料名称:</div>
  48. <div class="text">{{item.kind || item.kinden || '-'}}</div>
  49. <!--<div class="fr">-->
  50. <!--<div class="textinfo" v-if="item.goods && item.goods.breakUp">可拆卖</div>-->
  51. <!--</div>-->
  52. </div>
  53. <div class="list">
  54. <div class="name">规格:</div>
  55. <div class="text">{{item.spec || '-'}}</div>
  56. </div>
  57. <div class="list">
  58. <div class="fl">
  59. <div class="name">包装方式:</div>
  60. <div class="text">{{item.packaging || '无包装信息'}}</div>
  61. </div>
  62. <div class="fr">
  63. <div class="name">库存(pcs):</div>
  64. <div class="text">{{item.erpReserve || '-'}}</div>
  65. </div>
  66. </div>
  67. <div class="list">
  68. <div class="fl">
  69. <div class="name">最小包装数:</div>
  70. <div class="text">{{item.minPackQty || '-'}}</div>
  71. </div>
  72. <div class="fr">
  73. <div class="name">成本单价:</div>
  74. <div class="text">{{item.price || '-'}}</div>
  75. </div>
  76. </div>
  77. <div class="list">
  78. <div class="fl">
  79. <div class="name">最小起订量:</div>
  80. <div class="text">{{item.goods && item.goods.minBuyQty || '-'}}</div>
  81. </div>
  82. <div class="fr">
  83. <div class="name">交期(天):</div>
  84. <div class="text" v-if="item.goods && item.goods.b2cMaxDelivery && (item.goods.b2cMaxDelivery != item.goods.b2cMinDelivery)" v-text="item.goods.b2cMinDelivery + '-'+ item.goods.b2cMaxDelivery"></div>
  85. <div class="text" v-if="item.goods && item.goods.b2cMaxDelivery && (item.goods.b2cMaxDelivery == item.goods.b2cMinDelivery)" v-text="item.goods.b2cMinDelivery"></div>
  86. </div>
  87. </div>
  88. <!--<div class="list">-->
  89. <!--<div class="name">生产日期:</div>-->
  90. <!--<div class="text" :title="item.produceDate">{{item.produceDate || '-'}}</div>-->
  91. <!--</div>-->
  92. <div class="list">
  93. <div class="name left">价格梯度:</div>
  94. <div class="table left">
  95. <ul>
  96. <li class="title">
  97. <div>分段数量/PCS</div>
  98. <div>分段单价</div>
  99. </li>
  100. <template v-if="item.goods">
  101. <li v-for="price in item.goods.prices">
  102. <div>{{price.start}}+</div>
  103. <!--{{item.goods.currencyName}}-->
  104. <div v-if="item.goods.currencyName === 'RMB'">¥{{price.rMBPrice}}</div>
  105. <div v-else>${{price.uSDPrice}}</div>
  106. </li>
  107. </template>
  108. <template v-else>
  109. <li>
  110. <div style="color: #666;width: 100%">暂无梯度数据</div>
  111. </li>
  112. </template>
  113. </ul>
  114. </div>
  115. </div>
  116. </div>
  117. <div class="clearfix">
  118. <div class="pull-right add" @click="addProtoperson(item)" :class="{noadd: item.addProductPerson}" v-if="activeType !== 'mine'">加入个人产品</div>
  119. <div class="pull-right look" @click="toAddpro(item, index)">编辑上架</div>
  120. <div class="pull-right look" @click="updateMateriel(item)">编辑物料</div>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. <!-- 编辑物料 -->
  126. <div class="update-materiel" v-show="showMateriel">
  127. <div class="mobile-nav">
  128. <div class="mobile-header mobile-center-header">
  129. <a @click="saveMateriel('a')"><i class="iconfont icon-fanhui"></i></a>
  130. <p>编辑物料</p>
  131. <p class="en-name">
  132. <img :src="`/images/mobile/center/${user.data.enterprise && user.data.enterprise.uu ? 'en' : 'self'}.png`" alt="">{{currentEnName}}
  133. </p>
  134. </div>
  135. </div>
  136. <div class="update-materiel-wrapper" @click="clearInfo()">
  137. <template v-if="MaterielItem.standard === 1">
  138. <img class="imgUrl" src="/images/mobile/@2x/productDetail/Strand.png" />
  139. </template>
  140. <template v-else>
  141. <img class="imgUrl" src="/images/mobile/@2x/productDetail/isStrand.png" />
  142. </template>
  143. <div ref="scroll" style="height: 100%;overflow-y:scroll">
  144. <div>
  145. <div style="background: #fff;border: 1px solid #dcdcdc;padding-bottom: 0.5rem;">
  146. <div class="update-materiel-wrapper-list clearfix" :class="{'overHidden': MaterielItem.standard === 1}">
  147. <div class="name pull-left"><a class="red">*</a>品牌:</div>
  148. <template v-if="MaterielItem.standard === 1">
  149. {{MaterielItem.pbranden}}
  150. </template>
  151. <template v-else>
  152. <div class="input pull-left clearfix" :class="{'overHidden': MaterielItem.standard === 1}">
  153. <input type="text" v-model="MaterielItem.pbranden" placeholder="请勿填中文符号" @blur.stop="checkBrand" @input.stop="onBrandChange"/>
  154. <ul class="similar brand-similar-list" v-show="showSimilarBrandList && MaterielItem.pbranden">
  155. <li v-for="sBrand in similarBrand" @click.stop="setBrand(sBrand.nameEn)">{{sBrand.nameEn}}</li>
  156. </ul>
  157. <i class="iconfont icon-guanbi1" @click.stop="MaterielItem.pbranden = ''"></i>
  158. </div>
  159. </template>
  160. </div>
  161. <div class="update-materiel-wrapper-list clearfix" :class="{'overHidden': MaterielItem.standard === 1}">
  162. <div class="name pull-left"><a class="red">*</a>物料名称:</div>
  163. <template v-if="MaterielItem.standard === 1">
  164. {{MaterielItem.kind}}
  165. </template>
  166. <template v-else>
  167. <div class="input pull-left clearfix" style="width: 4.44rem">
  168. <!--<input type="text" v-model="MaterielItem.kind" @blur="checkCode" @input="onCodeChange" placeholder="请勿填中文符号">-->
  169. <input type="text" placeholder="请输入物料名称" v-model="MaterielItem.kind"/>
  170. <i class="iconfont icon-guanbi1" @click.stop="MaterielItem.kind = ''"></i>
  171. </div>
  172. </template>
  173. </div>
  174. <div class="update-materiel-wrapper-list clearfix">
  175. <div class="name pull-left"><a class="red">*</a>型号:</div>
  176. <template v-if="MaterielItem.standard === 1">
  177. {{MaterielItem.pcmpcode}}
  178. </template>
  179. <template v-else>
  180. <div class="input pull-left clearfix">
  181. <input type="text" v-model="MaterielItem.pcmpcode" @blur.stop="checkCode" @input.stop="onCodeChange" placeholder="请勿填中文符号">
  182. <ul class="similar" v-show="showSimilarCodeList && MaterielItem.pcmpcode">
  183. <li v-for="sCode in similarCode" @click.stop="setCode(sCode.code)">{{sCode.code}}</li>
  184. </ul>
  185. <!--<input type="text" placeholder="请输入型号" v-model="MaterielItem.pcmpcode"/>-->
  186. <i class="iconfont icon-guanbi1" @click.stop="MaterielItem.pcmpcode = ''"></i>
  187. </div>
  188. </template>
  189. </div>
  190. <div class="update-materiel-wrapper-list clearfix">
  191. <div class="name pull-left"><a class="red" style="opacity: 0">*</a>规格:</div>
  192. <div class="input pull-left clearfix">
  193. <input type="text" placeholder="请输入规格" v-model="MaterielItem.spec" @blur="checkSpec" @input="onSpecInput" maxlength="50"/>
  194. <i class="iconfont icon-guanbi1" @click.stop="MaterielItem.spec = ''"></i>
  195. </div>
  196. </div>
  197. <div class="update-materiel-wrapper-list clearfix">
  198. <div class="name pull-left"><a class="red">*</a>最小包装数:</div>
  199. <div class="input pull-left clearfix" style="width: 4.15rem;">
  200. <input type="number" placeholder="请输入最小包装数" v-model="MaterielItem.minPackQty" maxlength="6" oninput="if(value.length>6)value=value.slice(0,6)"/>
  201. <i class="iconfont icon-guanbi1" @click.stop="MaterielItem.minPackQty = ''"></i>
  202. </div>
  203. </div>
  204. <div class="update-materiel-wrapper-list clearfix">
  205. <div class="name pull-left"><a class="red" style="opacity: 0">*</a>包装方式:</div>
  206. <div class="selectInput pull-left" @click.stop="showdropmenu('pack')">
  207. <span>{{MaterielItem.packaging || '无包装信息'}}</span>
  208. <img src="/images/mobile/product/drop_icon.png"/>
  209. <ul :class="{active : showDrop === 'pack' }">
  210. <li v-for="item in packObj" @click.stop="choosePack(item)">{{item}}</li>
  211. </ul>
  212. </div>
  213. </div>
  214. <div class="update-materiel-wrapper-list clearfix">
  215. <div class="name pull-left"><a class="red" style="opacity: 0">*</a>规格书:</div>
  216. </div>
  217. <div class="clearfix">
  218. <div class="update-materiel-wrapper-image">
  219. <a v-if="MaterielItem.IsSave" @click.stop="WinOpen(MaterielItem.Regulpic)">
  220. <img src="/images/mobile/openStore/pdf.png" style='width: 0.49rem; height: 0.49rem;display:block;margin: 0.2rem auto 0'/>
  221. </a>
  222. <img v-else src="/images/mobile/openStore/upload.png" style='width: 0.49rem; height: 0.49rem;display:block;margin: 0.2rem auto 0'/>
  223. <!--v-if="MaterielItem.standard !== 1"-->
  224. <input type="file" class="com-input" @change.stop="update" accept="*.pdf" v-if="!MaterielItem.IsSave"/>
  225. <span style="position: relative" v-if="MaterielItem.Regulpic === ''">上传规格书</span>
  226. </div>
  227. <span class="uploadImgInfo pull-left">
  228. <div class="name"><a class="red">*</a>仅支持PDF格式文件,大小不超过20M:</div>
  229. <div class="name"><a class="red">*</a>规格书上传后,将在两个工作日内完成审核</div>
  230. <div class="name"><a class="red">*</a>如审核不通过,将会以消息的形式通知您</div>
  231. <div class="name"><a class="red">*</a>已有原厂规格书的器件暂不开放上传</div>
  232. <div class="name"><a class="red">*</a>更新规格书需重新审核</div>
  233. </span>
  234. <div style="clear:both"></div>
  235. <div class="uploadImgBtn pull-left" v-if="MaterielItem.standard !== 1">上传规格书<input type="file" class="com-input" @change.stop="update" accept=".pdf" /></div>
  236. <div style="color: #ea0f42;font-size: 0.2rem;line-height: 0.47rem;margin-left: 0.2rem" class="pull-left" v-if="(MaterielItem.productAttachSubmit && MaterielItem.productAttachSubmit.uploadAttach) && MaterielItem.standard !== 1 && MaterielItem.Regulpic !== '' && MaterielItem.IsSave" >该规格书正在审核中</div>
  237. </div>
  238. <div class="update-materiel-wrapper-list clearfix">
  239. <div class="name pull-left"><a class="red" style="opacity: 0">*</a>物料图片:</div>
  240. </div>
  241. <div class="clearfix">
  242. <div class="update-materiel-wrapper-image">
  243. <img :src="MaterielItem.cmpImg || '/images/mobile/openStore/upload.png'" style='width: 0.49rem; height: 0.49rem;display:block;margin: 0.2rem auto 0'/>
  244. <input type="file" class="com-input" @change.stop="update2" accept="image/jpeg,image/jpg,image/png" />
  245. <span style="position: relative" v-if="MaterielItem.cmpImg === ''">上传图片</span>
  246. </div>
  247. <span class="uploadImgInfo pull-left" style="line-height: 1.09rem">
  248. <div class="name"><a class="red">*</a>仅支持JPG、PNG格式文件,大小不超过1M</div>
  249. </span>
  250. <div style="clear:both"></div>
  251. <div class="uploadImgBtn pull-left" style="margin-top: 0.15rem">上传图片<input type="file" class="com-input" @change.stop="update2" accept="image/jpeg,image/jpg,image/png" /></div>
  252. </div>
  253. </div>
  254. <div class="update-materiel-wrapper-controll clearfix">
  255. <div class="pull-left" @click.stop="saveMateriel()">保存</div>
  256. <div class="pull-right" @click.stop="saveMateriel('a')">取消</div>
  257. </div>
  258. <div style="height: 1rem;position:relative"></div>
  259. </div>
  260. </div>
  261. </div>
  262. </div>
  263. <!-- 物料上下架 -->
  264. <div>
  265. <upoff-material ref="upoffMaterial" :chooseItem="MaterielItem" @upoffMaterial="upoffMaterial" :firstPrice="firstPrice">
  266. </upoff-material>
  267. </div>
  268. <!-- /end 物料上下架 -->
  269. <remind-box :title="collectResult" :timeoutCount="timeoutCount"></remind-box>
  270. <pull-up :fixId="'provider-wrapper'" :searchMore="isSearchSearchingMore" :allPage="EnterprisePage" :page="seekPage" @pullUpAction="getMoreSearch"></pull-up>
  271. </div>
  272. </template>
  273. <script>
  274. // 移动端IOS不支持上传PDF文件
  275. import { RemindBox, PullUp } from '~components/mobile/common'
  276. import { upoffMaterial } from '~components/mobile/center'
  277. export default {
  278. layout: 'mobile',
  279. middleware: 'authenticated',
  280. name: 'mobileProduct',
  281. fetch ({store}) {
  282. return Promise.all([
  283. store.dispatch('loadStoreStatus', {op: 'check'})
  284. ])
  285. },
  286. data() {
  287. return {
  288. activeType: '',
  289. collectResult: '',
  290. timeoutCount: 0,
  291. isSearchSearchingMore: false, // 是否请求状态
  292. EnterprisePage: 0, // 总页数
  293. GetEnterpriseListData: [], // 当前数据源
  294. seekPage: 1, // 当前页数
  295. seekKeyword: '', // 搜索关键字
  296. MaterielItem: {}, // 当前选择编辑物料对象 或者 编辑上下架对象
  297. showMateriel: false, // 编辑物料弹窗
  298. showSimilarCodeList: false, // 型号选择框
  299. showSimilarBrandList: false, // 品牌选择框
  300. similarBrand: [],
  301. similarCode: [],
  302. packObj: ['其他', 'Bulk-散装', 'Reel-卷装', 'Tape/Reel-编带', 'Tray-盘装', 'Tube-管装', '盒装', '袋装', '罐装', '瓶装', '桶装', '箱装'],
  303. showDrop: '',
  304. firstPrice: ''
  305. }
  306. },
  307. created() {
  308. this.getResourceProvidor()
  309. // this.MaterielItem.packaging = this.packObj[0]
  310. },
  311. computed: {
  312. // 是否展示空数据
  313. StateNone() {
  314. return this.GetEnterpriseListData.length === 0 && this.EnterprisePage === 0
  315. }
  316. },
  317. methods: {
  318. // 打开pdf
  319. WinOpen(item) {
  320. window.open(item, '_blank')
  321. },
  322. // 获取当前企业产品库
  323. GetEnterpriseList: function() {
  324. let params = {
  325. _status: 'all',
  326. count: 20,
  327. isStandard: true,
  328. keyword: this.seekKeyword || '',
  329. page: this.seekPage,
  330. sorting: { id: 'DESC' },
  331. type: 'all'
  332. }
  333. return this.$http.get('/trade/products', { params })
  334. },
  335. // 获取当前个人产品库
  336. GetPersonList: function(cb) {
  337. let params = {
  338. _status: 'all',
  339. count: 20,
  340. isStandard: true,
  341. keyword: this.seekKeyword || '',
  342. page: this.seekPage,
  343. sorting: { id: 'DESC' },
  344. type: 'all'
  345. }
  346. return this.$http.get('/trade/products/person', { params })
  347. },
  348. ChangeList(_tp) {
  349. this.activeType = _tp
  350. this.seekPage = 1
  351. this.GetEnterpriseListData = []
  352. this.getResourceProvidor()
  353. },
  354. getResourceProvidor: function() {
  355. if (this.activeType === '') {
  356. this.GetEnterpriseList().then(res => {
  357. this.GetEnterpriseListData = this.GetEnterpriseListData.concat(res.data.content)
  358. this.EnterprisePage = res.data.totalPages
  359. this.isSearchSearchingMore = false
  360. })
  361. } else if (this.activeType === 'mine') {
  362. this.GetPersonList().then(res => {
  363. this.GetEnterpriseListData = this.GetEnterpriseListData.concat(res.data.content)
  364. this.EnterprisePage = res.data.totalPages
  365. this.isSearchSearchingMore = false
  366. })
  367. } else if (this.providerType === 'onLine') {
  368. this.GetOnlineList().then(res => {
  369. this.GetEnterpriseListData = this.GetEnterpriseListData.concat(res.data.content)
  370. this.EnterprisePage = res.data.totalPages
  371. this.isSearchSearchingMore = false
  372. })
  373. }
  374. },
  375. getMoreSearch: function () {
  376. this.seekPage++
  377. this.isSearchSearchingMore = true
  378. this.getResourceProvidor()
  379. },
  380. searchSeek: function() {
  381. this.seekPage = 0
  382. this.GetEnterpriseListData = []
  383. this.getMoreSearch()
  384. },
  385. addProtoperson: function(item) {
  386. if (item.addProductPerson) {
  387. this.collectResult = '已在个人产品库'
  388. this.timeoutCount++
  389. return false
  390. }
  391. this.$http.post('/trade/products/person', [item.id])
  392. .then(response => {
  393. this.collectResult = '绑定成功'
  394. this.timeoutCount++
  395. this.seekPage = 1
  396. this.GetEnterpriseListData.splice(0, this.GetEnterpriseListData.length)
  397. this.GetEnterpriseListData = null
  398. this.GetEnterpriseListData = []
  399. this.getResourceProvidor()
  400. // this.reloadData()
  401. }, () => {
  402. this.collectResult = '绑定失败'
  403. this.timeoutCount++
  404. })
  405. },
  406. // 编辑上架
  407. toAddpro(item, index) {
  408. if (item.erpReserve === '' || item.erpReserve === 0 || !item.erpReserve) {
  409. this.setRemindText(`当前物料库存为0,请先入库`)
  410. return false
  411. }
  412. if (item.minPackQty === '' || item.minPackQty === 0 || !item.minPackQty) {
  413. this.setRemindText(`请先编辑物料,最小包装数选项`)
  414. return false
  415. }
  416. // this.$item = this.baseUtils.deepCopy(item)
  417. this.$index = index
  418. // this.MaterielItem = item
  419. this.MaterielItem = item
  420. this.$item = this.baseUtils.deepCopy(this.MaterielItem)
  421. if (!this.MaterielItem.goods) {
  422. this.$set(this.MaterielItem, 'goods', {
  423. prices: [{end: '',
  424. rMBNTPrice: '',
  425. rMBPrice: '',
  426. start: '1'}],
  427. selfSale: 1,
  428. breakUp: true,
  429. autoPublish: true,
  430. productid: item.id,
  431. minDelivery: 1,
  432. maxDelivery: 10,
  433. minBuyQty: 1
  434. })
  435. }
  436. if (this.MaterielItem.goods.prices.length === 0) {
  437. this.MaterielItem.goods.prices = [{end: '', rMBNTPrice: '', rMBPrice: '', start: '1'}]
  438. }
  439. this.firstPrice = this.MaterielItem.goods.prices[0].start.toString()
  440. let rf = document.body.offsetHeight // 触发浏览器重绘
  441. // console.log(item)
  442. this.$refs.upoffMaterial.show()
  443. },
  444. update2 (e) {
  445. // 上传图片
  446. let file = e.target.files[0]
  447. if (file.size > 1024 * 1024) {
  448. this.setRemindText(`上传文件不得超过1M`)
  449. return false
  450. }
  451. if (file.type.indexOf('gif') > -1) {
  452. this.setRemindText(`不允许上传gif`)
  453. return false
  454. }
  455. let param = new FormData()
  456. param.append('file', file, file.name)
  457. param.append('chunk', '0')
  458. let config = {
  459. headers: {'Content-Type': 'multipart/form-data'}
  460. }
  461. this.$http.post('/api/images', param, config)
  462. .then(response => {
  463. this.$set(this.MaterielItem, 'cmpImg', response.data[0].path)
  464. // this.MaterielItem.cmpImg = response.data[0].path
  465. })
  466. },
  467. update (e) {
  468. // 上传PDF
  469. let file = e.target.files[0]
  470. if (file.size > 1024 * 1024 * 20) {
  471. this.setRemindText(`上传文件不得超过20M`)
  472. return false
  473. }
  474. if (file.type.indexOf('pdf') < 0) {
  475. this.setRemindText(`规格书只允许上传pdf文件`)
  476. return false
  477. }
  478. let param = new FormData()
  479. param.append('file', file, file.name)
  480. param.append('chunk', '0')
  481. let config = {
  482. headers: {'Content-Type': file.type}
  483. }
  484. this.$http.post('/file', param, config)
  485. .then(response => {
  486. this.MaterielItem.IsSave = true
  487. this.MaterielItem.Regulpic = response.data[0].path
  488. }, err => {
  489. console.log(err)
  490. })
  491. },
  492. // 编辑物料
  493. updateMateriel(item) {
  494. // Object.assign(this.MaterielItem, item, {Regulpic: '', IsSave: false, cmpImg: ''})
  495. this.MaterielItem = item
  496. this.$item = this.baseUtils.deepCopy(item)
  497. this.MaterielItem.minPackQty = (this.MaterielItem.minPackQty === '' || this.MaterielItem.minPackQty === 0) ? 1 : this.MaterielItem.minPackQty
  498. this.MaterielItem.packaging = (!this.MaterielItem.packaging && this.MaterielItem.packaging !== '') ? this.MaterielItem.packaging : this.packObj[0]
  499. this.$set(this.MaterielItem, 'IsSave', (item.productAttachSubmit && item.productAttachSubmit.uploadAttach || item.attach) ? true : false) // 规格书是否存在
  500. this.$set(this.MaterielItem, 'cmpImg', item.cmpImg || '')
  501. this.$set(this.MaterielItem, 'Regulpic', (item.productAttachSubmit && item.productAttachSubmit.uploadAttach) || item.attach || '')
  502. this.showMateriel = true
  503. // this._initScroll()
  504. },
  505. // 编辑物料保存按钮
  506. saveMateriel(str) {
  507. if (str) {
  508. let _key1 = Object.keys(this.$item)
  509. let _key2 = Object.keys(this.MaterielItem)
  510. for (let i = 0; i < _key1.length; i++) {
  511. this.MaterielItem[_key2[i]] = this.$item[_key1[i]]
  512. }
  513. this.showMateriel = false
  514. this.showDrop = ''
  515. return
  516. }
  517. if (this.MaterielItem.pbranden === '') {
  518. this.setRemindText('品牌不能为空')
  519. return
  520. } else if (this.MaterielItem.kind === '') {
  521. this.setRemindText('物料名称不能为空')
  522. return
  523. } else if (this.MaterielItem.minPackQty === '') {
  524. this.setRemindText('最小包装数不能为空')
  525. return
  526. } else if (this.MaterielItem.pcmpcode === '') {
  527. this.setRemindText('型号不能为空')
  528. return
  529. }
  530. this.MaterielItem.pcmpcode = this.MaterielItem.pcmpcode
  531. this.MaterielItem.pbranden = this.MaterielItem.pbranden
  532. let item = {
  533. id: this.MaterielItem.id,
  534. kind : this.MaterielItem.kind,
  535. pbranden: this.MaterielItem.pbranden,
  536. pcmpcode: this.MaterielItem.pcmpcode,
  537. spec: this.MaterielItem.spec,
  538. url: this.MaterielItem.Regulpic || '',
  539. cmpImg: this.MaterielItem.cmpImg, // 物料图片
  540. packaging: this.MaterielItem.packaging, // 包装
  541. minPackQty: this.MaterielItem.minPackQty // 最小包装数
  542. }
  543. let _url = item.url
  544. if (this.MaterielItem.standard === 1) {
  545. _url = ''
  546. }
  547. this.$http.post(`/trade/products/update/product?attachUrl=${_url}`, item).then(res => {
  548. if (res.data.success) {
  549. this.setRemindText('修改成功')
  550. this.showMateriel = false
  551. this.page = 1
  552. this.GetEnterpriseListData = null
  553. this.GetEnterpriseListData = []
  554. this.getResourceProvidor()
  555. } else {
  556. this.setRemindText(res.data.message)
  557. }
  558. })
  559. },
  560. // 显示包装选择
  561. showdropmenu(str) {
  562. this.showDrop = str
  563. },
  564. // 选择包装
  565. choosePack(item) {
  566. this.showDrop = ''
  567. this.MaterielItem.packaging = item
  568. },
  569. // 关闭包装选项
  570. closeAlert() {
  571. this.MaterielItem = this.$item
  572. this.showDrop = ''
  573. },
  574. clearInfo() {
  575. this.showSimilarCodeList = false
  576. this.showSimilarBrandList = false
  577. },
  578. checkBrand: function () {
  579. // this.MaterielItem.brand = this.MaterielItem.brand && this.MaterielItem.brand !== ''
  580. if (!this.MaterielItem.pbranden || this.MaterielItem.pbranden === '') {
  581. this.setRemindText('品牌不能为空')
  582. }
  583. return this.MaterielItem.pbranden
  584. },
  585. checkCode: function () {
  586. if (!this.MaterielItem.pcmpcode || this.MaterielItem.pcmpcode === '') {
  587. this.setRemindText('型号不能为空')
  588. }
  589. return this.MaterielItem.pcmpcode
  590. },
  591. onCodeChange: function () {
  592. this.MaterielItem.pcmpcode = this.MaterielItem.pcmpcode.trim()
  593. if ((/[^\x00-\xff]/g).test(this.MaterielItem.pcmpcode)) {
  594. let chineseIndex = -1
  595. for (let i = 0; i < this.MaterielItem.pcmpcode.length; i++) {
  596. if ((/[^\x00-\xff]/g).test(this.MaterielItem.pcmpcode.charAt(i))) {
  597. chineseIndex = i
  598. break
  599. }
  600. }
  601. this.MaterielItem.pcmpcode = this.baseUtils.cutOutString(this.MaterielItem.pcmpcode, chineseIndex)
  602. } else if (this.MaterielItem.pcmpcode && this.baseUtils.getRealLen(this.MaterielItem.pcmpcode) > 100) {
  603. this.MaterielItem.pcmpcode = this.baseUtils.cutOutString(this.MaterielItem.pcmpcode, 100)
  604. } else {
  605. this.getSimilarCode()
  606. }
  607. },
  608. onBrandChange: function () {
  609. this.MaterielItem.pbranden = this.MaterielItem.pbranden.trim()
  610. if ((/[^\x00-\xff]/g).test(this.MaterielItem.pbranden)) {
  611. let chineseIndex = -1
  612. for (let i = 0; i < this.MaterielItem.pbranden.length; i++) {
  613. if ((/[^\x00-\xff]/g).test(this.MaterielItem.pbranden.charAt(i)) && !(/[\u4e00-\u9fa5]/).test(this.MaterielItem.pbranden.charAt(i))) {
  614. chineseIndex = i
  615. break
  616. }
  617. }
  618. if (chineseIndex > -1) {
  619. this.MaterielItem.pbranden = this.MaterielItem.pbranden.substring(0, chineseIndex)
  620. }
  621. } else if (this.MaterielItem.pbranden && this.baseUtils.getRealLen(this.MaterielItem.pbranden) > 50) {
  622. this.MaterielItem.pbranden = this.baseUtils.cutOutString(this.MaterielItem.pbranden, 50)
  623. } else {
  624. this.getSimilarBrand()
  625. }
  626. },
  627. getSimilarBrand: function () {
  628. if (this.MaterielItem.pbranden) {
  629. this.$http.get('/search/similarBrands', {params: {keyword: this.MaterielItem.pbranden}})
  630. .then(response => {
  631. this.similarBrand = response.data
  632. this.showSimilarBrandList = response.data.length > 0
  633. })
  634. } else {
  635. this.showSimilarBrandList = false
  636. }
  637. },
  638. getSimilarCode: function () {
  639. if (this.MaterielItem.pcmpcode) {
  640. this.$http.get('/search/similarComponents', {params: {keyword: this.MaterielItem.pcmpcode}})
  641. .then(response => {
  642. this.similarCode = response.data
  643. this.showSimilarCodeList = response.data.length > 0
  644. })
  645. } else {
  646. this.showSimilarCodeList = false
  647. }
  648. },
  649. setCode: function (code) {
  650. this.MaterielItem.pcmpcode = code
  651. this.showSimilarCodeList = false
  652. },
  653. setBrand: function (brand) {
  654. this.MaterielItem.pbranden = brand
  655. this.showSimilarBrandList = false
  656. },
  657. setRemindText: function (str) {
  658. this.collectResult = str
  659. this.timeoutCount++
  660. },
  661. checkSpec: function () {
  662. // let nullStrFlag =
  663. // this.MaterielItem.spec = nullStrFlag
  664. if (!this.baseUtils.checkNullStr(this.MaterielItem.spec)) {
  665. this.setRemindText('规格输入不合法')
  666. }
  667. return this.MaterielItem.spec
  668. },
  669. onSpecInput: function () {
  670. if (this.MaterielItem.spec && this.baseUtils.getRealLen(this.MaterielItem.spec) > 100) {
  671. this.MaterielItem.spec = this.baseUtils.cutOutString(this.MaterielItem.spec, 100)
  672. }
  673. },
  674. upoffMaterial(type, item) {
  675. if (!type) {
  676. this.showMateriel = false
  677. this.page = 1
  678. this.GetEnterpriseListData = null
  679. this.GetEnterpriseListData = []
  680. this.getResourceProvidor()
  681. } else {
  682. // console.log(this.$item)
  683. // console.log(this.MaterielItem)
  684. // let _key1 = Object.keys(this.$item)
  685. // let _key2 = Object.keys(this.MaterielItem)
  686. // for (let i = 0; i < _key1.length; i++) {
  687. // this.MaterielItem[_key2[i]] = this.$item[_key1[i]]
  688. // }
  689. this.GetEnterpriseListData.splice(this.$index, 1, this.$item)
  690. // delete item.goods
  691. // this.MaterielItem = this.$item
  692. }
  693. this.MaterielItem = {}
  694. }
  695. // _initScroll() {
  696. // this.$nextTick(() => {
  697. // if (!this.scroll) {
  698. // this.scroll = new BScroll(this.$refs.scroll, {
  699. // click: true
  700. // })
  701. // } else {
  702. // this.scroll.refresh()
  703. // }
  704. // })
  705. // }
  706. },
  707. components: {
  708. RemindBox,
  709. PullUp,
  710. upoffMaterial
  711. }
  712. }
  713. </script>
  714. <style lang="scss">
  715. @mixin overFlowHidden {
  716. overflow: hidden;
  717. text-overflow: ellipsis;
  718. white-space: nowrap;
  719. }
  720. @mixin lineHeight($value) {
  721. height: $value;
  722. line-height: $value;
  723. }
  724. .material-wrapper {
  725. background: #f1f3f6;
  726. /*margin: 1.26rem 0 0.98rem 0;*/
  727. /*height: calc(100vh - 1.26rem - 0.98rem);*/
  728. position: absolute;
  729. width: 100%;
  730. top: 1.26rem;
  731. bottom: 0.98rem;
  732. overflow-y: auto;
  733. z-index: 100;
  734. .order-nav {
  735. background: #fff;
  736. div {
  737. height: 0.82rem;
  738. line-height: 0.82rem;
  739. display: inline-block;
  740. width: 50%;
  741. text-align: center;
  742. font-size: .28rem;
  743. color: #666;
  744. &.active span{
  745. color: #3f84f6;
  746. border-bottom: 0.04rem solid #3f84f6;
  747. padding-bottom: 0.2rem;
  748. }
  749. }
  750. }
  751. .search-content {
  752. text-align: center;
  753. padding: .25rem 0;
  754. input {
  755. border: 1px solid #376ff3;
  756. }
  757. span {
  758. }
  759. }
  760. .scrollContent {
  761. height: calc(100vh - 3.19rem - 0.98rem);
  762. overflow-y: auto;
  763. .providerList {
  764. margin-bottom: 0.24rem;
  765. .top {
  766. position: relative;
  767. padding: 0 0.24rem;
  768. border-bottom: 1px solid #d3d3d3;
  769. height: 0.9rem;
  770. line-height: 0.9rem;
  771. color: #0067e7;
  772. font-size: 0.3rem;
  773. background: #fff;
  774. &::after {
  775. clear: both;
  776. display: block;
  777. content: ' ';
  778. visibility: hidden;
  779. zoom: 1;
  780. }
  781. .text {
  782. width: 5.4rem;
  783. }
  784. .pms {
  785. color: #f57710;
  786. border: 1px solid #f57710;
  787. border-radius: 0.4rem;
  788. background: #fff;
  789. font-size: 0.24rem;
  790. height: 0.4rem;
  791. line-height: 0.4rem;
  792. width: 0.8rem;
  793. text-align: center;
  794. float: right;
  795. margin-top: 0.25rem;
  796. }
  797. .store-type {
  798. width: .77rem;
  799. height: .77rem;
  800. position: absolute;
  801. right: 0;
  802. top: 0;
  803. }
  804. .icon {
  805. width: 0.6rem;
  806. height: 0.36rem;
  807. line-height: 0.36rem;
  808. margin-top: 0.27rem;
  809. float: left;
  810. background-size: 100%;
  811. background-repeat: no-repeat;
  812. margin-right: 0.12rem;
  813. text-align: center;
  814. &.istanded {
  815. background-image: url('/images/mobile/@2x/istanded.png')
  816. }
  817. &.standed {
  818. background-image: url('/images/mobile/@2x/standed.png')
  819. }
  820. }
  821. .person-flag {
  822. width: .75rem;
  823. position: absolute;
  824. right: 0;
  825. }
  826. .text {
  827. float: left;
  828. width: 6.3rem;
  829. overflow: hidden;
  830. text-overflow: ellipsis;
  831. white-space: nowrap;
  832. }
  833. }
  834. .middle {
  835. padding: 0.24rem 0.24rem;
  836. background: #fff;
  837. .pms {
  838. color: #f57710;
  839. border: 1px solid #f57710;
  840. border-radius: 0.4rem;
  841. background: #fff;
  842. font-size: 0.24rem;
  843. height: 0.4rem;
  844. line-height: 0.4rem;
  845. width: 0.8rem;
  846. text-align: center;
  847. }
  848. .list {
  849. /*height: 0.46rem;*/
  850. .left {
  851. float: left;
  852. overflow: hidden;
  853. text-overflow: ellipsis;
  854. white-space: nowrap;
  855. }
  856. .textinfo {
  857. color: #0067e7;
  858. font-size: 0.3rem;
  859. }
  860. .button {
  861. font-size: 0.26rem;
  862. color: #fff;
  863. width: 0.92rem;
  864. text-align: center;
  865. border-radius: 5px;
  866. /*border:1px solid #1a58dd;*/
  867. background: #1a58dd;
  868. display: inline-block;
  869. margin-right: 0.2rem;
  870. line-height: 0.33rem;
  871. height: 0.37rem;
  872. }
  873. margin-bottom: 0.18rem;
  874. &::after{
  875. clear: both;
  876. display: block;
  877. content: ' ';
  878. visibility: hidden;
  879. zoom: 1;
  880. }
  881. .fl {
  882. width: 4.3rem;
  883. float: left;
  884. overflow: hidden;
  885. text-overflow: ellipsis;
  886. white-space: nowrap;
  887. }
  888. .fr {
  889. text-align: left;
  890. width: 2.6rem;
  891. overflow: hidden;
  892. text-overflow: ellipsis;
  893. white-space: nowrap;
  894. }
  895. &.list-long {
  896. .fl {
  897. width: 100% !important;
  898. }
  899. }
  900. .name {
  901. color: #666;
  902. font-size: 0.3rem;
  903. display: inline-block;
  904. }
  905. .text {
  906. display: inline-block;
  907. color: #333;
  908. font-size: 0.3rem
  909. }
  910. .table {
  911. width: 5.5rem;
  912. margin-bottom: 0;
  913. margin-top: 0;
  914. li {
  915. height: 0.43rem;
  916. line-height: 0.43rem;
  917. border-left: .01rem solid #c5c5c5;
  918. font-size: .28rem;
  919. &::after {
  920. clear: both;
  921. display: block;
  922. content: ' ';
  923. visibility: hidden;
  924. zoom: 1;
  925. }
  926. div {
  927. text-align: center;
  928. width: 50%;
  929. float: left;
  930. border-right: .01rem solid #c5c5c5;
  931. border-bottom: .01rem solid #c5c5c5;
  932. }
  933. &:nth-child(odd) {
  934. background: #ddd;
  935. color: #666;
  936. font-size: 0.28rem;
  937. }
  938. &:nth-child(even) {
  939. background: #fcfcfc;
  940. color: #666;
  941. font-size: 0.28rem;
  942. }
  943. &:nth-last-of-type(1){
  944. color: #f31919;
  945. }
  946. &.title {
  947. font-size: 0.28rem;
  948. color: #333;
  949. }
  950. }
  951. }
  952. }
  953. }
  954. div.clearfix {
  955. padding: 0.2rem 0.2rem;
  956. border-top: 1px solid #d3d3d3;
  957. background: #fff;
  958. div{
  959. width: 2.1rem;
  960. height: .6rem;
  961. text-align: center;
  962. line-height: .6rem;
  963. border-radius: 3px;
  964. margin-right: .2rem;
  965. &.look {
  966. color: #008bf7;
  967. border: 1px solid #008bf7;
  968. }
  969. &.add {
  970. background: #fff;
  971. color: #f57710;
  972. border: 1px solid #f57710;
  973. }
  974. &.noadd{
  975. background: #cccbcb;
  976. color: #fff;
  977. border:1px solid #cccbcb;
  978. }
  979. }
  980. }
  981. }
  982. }
  983. }
  984. .update-materiel {
  985. position: fixed;
  986. z-index: 102;
  987. background: #f1f3f6;
  988. /*background: red;*/
  989. top: 0;
  990. left: 0;
  991. bottom: 0;
  992. right: 0;
  993. .mobile-header{
  994. position: fixed;
  995. top: 0;
  996. z-index: 100;
  997. width:100%;
  998. height: 1.26rem;
  999. line-height: 1.26rem;
  1000. /*border-bottom:.01rem solid #ccc;*/
  1001. background: #3e82f5;
  1002. padding:0 .2rem 0 .1rem;
  1003. color:#fff;
  1004. }
  1005. .mobile-header p{
  1006. overflow: hidden;
  1007. text-overflow: ellipsis;
  1008. white-space: nowrap;
  1009. font-size:.36rem;
  1010. text-align: center;
  1011. width: 6rem;
  1012. padding-left: 1rem;
  1013. }
  1014. .mobile-center-header p.en-name {
  1015. font-size: .3rem;
  1016. }
  1017. .mobile-header a{
  1018. font-size:.28rem;
  1019. color:#fff;
  1020. position: absolute;
  1021. }
  1022. .mobile-header a i{
  1023. font-size: .48rem;
  1024. margin-right: -.1rem;
  1025. }
  1026. .update-materiel-wrapper {
  1027. border-radius: 0.07rem;
  1028. position: fixed;
  1029. overflow: hidden;
  1030. bottom: 0;
  1031. top: 1.46rem;
  1032. left: 0.2rem;
  1033. right: 0.2rem;
  1034. .imgUrl{
  1035. position: absolute;
  1036. width: 0.94rem;
  1037. height: 0.94rem;
  1038. right: 0;
  1039. top: 0;
  1040. z-index: 1;
  1041. }
  1042. .update-materiel-wrapper-image {
  1043. width: 1.09rem;
  1044. height: 1.09rem;
  1045. border: 1px solid #dcdcdc;
  1046. border-radius: 0.07rem;
  1047. position: relative;
  1048. margin: 0rem 0 0 0.5rem;
  1049. text-align: center;
  1050. position: relative;
  1051. float: left;
  1052. span {
  1053. color: #b2b2b2;
  1054. font-size: 0.2rem;
  1055. }
  1056. .com-input {
  1057. width: 100%;
  1058. height: 100%;
  1059. text-align: center;
  1060. position: absolute;
  1061. bottom: 0;
  1062. left: 0;
  1063. opacity: 0;
  1064. display: inline-block !important;
  1065. }
  1066. }
  1067. .uploadImgBtn {
  1068. color: #fff;
  1069. font-size: .28rem;
  1070. width: 1.51rem;
  1071. @include lineHeight(0.47rem);
  1072. border-radius: 0.07rem;
  1073. background: #f9b209;
  1074. text-align: center;
  1075. margin: 0rem 0 0 0.3rem;
  1076. position: relative;
  1077. .com-input {
  1078. width: 100%;
  1079. height: 100%;
  1080. text-align: center;
  1081. position: absolute;
  1082. bottom: 0;
  1083. left: 0;
  1084. opacity: 0;
  1085. display: inline-block !important;
  1086. }
  1087. }
  1088. .uploadImgInfo {
  1089. font-size: 0.24rem;
  1090. margin-left: 0.44rem;
  1091. color: #999;
  1092. .red {
  1093. color: red;
  1094. }
  1095. }
  1096. .update-materiel-wrapper-list {
  1097. margin-left:0.28rem;
  1098. margin-top: 0.3rem;
  1099. line-height: 0.7rem;
  1100. .red {color: #ea0f42}
  1101. .name {color: #666;font-size: 0.28rem}
  1102. .input {
  1103. position: relative;
  1104. width: 5rem;
  1105. line-height: 0.7rem;
  1106. height: 0.7rem;
  1107. border: 1px solid #dcdcdc;
  1108. input {
  1109. text-indent: 5px;
  1110. border: 0;
  1111. border-radius: 0.07rem;
  1112. line-height: 0.64rem;
  1113. height: 0.64rem;
  1114. width: 90%;
  1115. font-size:0.28rem;
  1116. float: left;
  1117. color: #333;
  1118. }
  1119. i {
  1120. font-size: 0.16rem;
  1121. vertical-align: top;
  1122. color: #666;
  1123. float: right;
  1124. margin-right: 0.05rem
  1125. }
  1126. .similar {
  1127. position: absolute;
  1128. width:100%;
  1129. max-height: 2.5rem;
  1130. overflow-y: auto;
  1131. z-index: 12;
  1132. border: 1px solid #7e7e7e;
  1133. border-radius: .05rem;
  1134. top: .5rem;
  1135. background: #fff;
  1136. li {
  1137. height: .5rem;
  1138. line-height: .5rem;
  1139. font-size: .26rem;
  1140. color: #999;
  1141. padding-left: .19rem;
  1142. &:focus, &:active, &:hover {
  1143. background: #999;
  1144. color: #fff;
  1145. }
  1146. }
  1147. }
  1148. }
  1149. }
  1150. .update-materiel-wrapper-list2 {
  1151. margin-left: 0.28rem;
  1152. margin-top: 0.3rem;
  1153. }
  1154. .update-materiel-wrapper-controll {
  1155. margin: 0.4rem 0.2rem 0;
  1156. div {
  1157. width: 48%;
  1158. background: #b5b5b5;
  1159. font-size: 0.3rem;
  1160. color: #fafbfc;
  1161. text-align: center;
  1162. @include lineHeight(0.62rem);
  1163. border-radius: 0.07rem;
  1164. &:first-child {
  1165. background: #3f84f6;
  1166. }
  1167. }
  1168. }
  1169. }
  1170. .selectInput {
  1171. display: inline-block;
  1172. position: relative;
  1173. vertical-align: top;
  1174. height: 0.7rem;
  1175. line-height: 0.7rem;
  1176. border: 1px solid #d2d2d2;
  1177. border-radius: 2px;
  1178. width: 4.44rem;
  1179. text-indent: 0.12rem;
  1180. img {
  1181. position: absolute;
  1182. width: 0.17rem;
  1183. height: 0.11rem;
  1184. right:0.1rem;
  1185. top: 0.28rem;
  1186. }
  1187. &.selectInput2 {
  1188. width: 1.56rem;
  1189. }
  1190. span {
  1191. height: 0.64rem;
  1192. line-height: 0.64rem;
  1193. display: block;
  1194. font-size: 0.28rem;
  1195. }
  1196. ul {
  1197. position: absolute;
  1198. left: 0;
  1199. top: .64rem;
  1200. z-index: 12;
  1201. width: 100%;
  1202. max-height: 3rem;
  1203. overflow-y: auto;
  1204. display: none;
  1205. li {
  1206. text-indent: 0px;
  1207. width: 100%;
  1208. background: #666;
  1209. color: rgba(255, 255, 255, 0.89);
  1210. text-align: center;
  1211. font-size: .3rem;
  1212. }
  1213. &.active {
  1214. display: block;
  1215. }
  1216. }
  1217. }
  1218. }
  1219. </style>