OemDetail.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  1. <template>
  2. <view class="box">
  3. <scroll-view scroll-x="true" class="scroll-Y">
  4. <view class="tab" v-for="(item,index) in tabList" @click="topClick(index)">
  5. <view class="tabLine" :class="{tabActive:tabIndex==index}">{{item}}
  6. <view class="line" :class="{lineBlue:tabIndex==index}"></view>
  7. </view>
  8. </view>
  9. </scroll-view>
  10. <!-- 配件信息 -->
  11. <view class="mainBox" v-if="tabIndex==0">
  12. <view class="pei">
  13. <view class="comtent">
  14. <view class="left">零件编号</view>
  15. <view class="right">{{mesData.partsnum}}</view>
  16. </view>
  17. <view class="comtent">
  18. <view class="left">名称</view>
  19. <view class="right">{{mesData.caption}}</view>
  20. </view>
  21. <view class="comtent">
  22. <view class="left">位置</view>
  23. <view class="right">{{weizhi}}</view>
  24. </view>
  25. <view class="comtent">
  26. <view class="left">用量</view>
  27. <view class="right">{{yongliang}}</view>
  28. </view>
  29. <view class="comtent">
  30. <view class="left">备注</view>
  31. <view class="right">{{mesData.remark}}</view>
  32. </view>
  33. <!-- <view class="comtent">
  34. <view class="left">英文名称</view>
  35. <view class="right">{{mesData.remark}}</view>
  36. </view> -->
  37. <!-- <view class="comtent">
  38. <view class="left">适用车型代码</view>
  39. <view class="right"></view>
  40. </view> -->
  41. <!-- <view class="comtent">
  42. <view class="left">是否颜色配件</view>
  43. <view class="right">否</view>
  44. </view> -->
  45. <view class="comtent">
  46. <view class="left">4S价格</view>
  47. <view class="right" style="color: #FF4F00; font-weight: bold;">¥{{mesData.price}}</view>
  48. </view>
  49. </view>
  50. </view>
  51. <!-- 维修工时 -->
  52. <!-- <view class="mainBox" v-if="tabIndex==1">
  53. <view class="workBox" v-for="(item,index) in workHourseList" :key="index">
  54. <view class="oneBox">
  55. <view class="comtent2">
  56. <view class="left">工时代号:</view>
  57. <view class="right">1201D0</view>
  58. </view>
  59. <view class="comtent2">
  60. <view class="left">工时:</view>
  61. <view class="right">12</view>
  62. </view>
  63. </view>
  64. <view class="oneBox">
  65. <view class="comtent2">
  66. <view class="left">相关参考号:</view>
  67. <view class="right">1201D0</view>
  68. </view>
  69. <view class="comtent2">
  70. <view class="left">工时包含:</view>
  71. <view class="right">12</view>
  72. </view>
  73. </view>
  74. <view class="comtent2" style="width: 100%;">
  75. <view class="left" style="width: 10%;" >说明:</view>
  76. <view class="right" style="width: 90%;" >净化控制电磁阀 - 更换净化控制电磁阀 - 更换净化控制电磁阀 - 更换</view>
  77. </view>
  78. </view>
  79. </view>
  80. -->
  81. <!-- 通用件 -->
  82. <!-- <view class="mainBox" v-if="tabIndex==1">
  83. <view class="tong">
  84. <view class="topTitle"><span style="color: #FF3B30;">*</span>通用件数据仅供参考,采购前请谨慎核对是否为相同配件</view>
  85. <view class="workBox2" v-for="(item,index) in tongyongList" :key="index">
  86. <view class="oneBox">
  87. <view class="comtent2">
  88. <view class="left2">品牌:</view>
  89. <view class="right2">{{item.brand}}</view>
  90. </view>
  91. <view class="comtent2">
  92. <view class="left2" style="width: 26%;">零件号:</view>
  93. <view class="right2">{{item.partsnum}}</view>
  94. </view>
  95. </view>
  96. <view class="oneBox">
  97. <view class="comtent2">
  98. <view class="left2">名称:</view>
  99. <view class="right2">{{item.description}}</view>
  100. </view>
  101. <view class="comtent2">
  102. <view class="left2">价格:</view>
  103. <view class="right2">{{item.price}}</view>
  104. </view>
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. -->
  110. <!-- EPC车型 -->
  111. <view class="mainBox" v-if="tabIndex==1">
  112. <view class="epc">
  113. <view class="topTitle">共<span style="color: #FF3B30;">{{epc_Count ? epc_Count:'0'}}</span>条</view>
  114. <view class="workBox2" v-for="(item,index) in epcList" :key="index">
  115. <view class="oneBox">
  116. <view class="comtent2">
  117. <view class="left2">名称:</view>
  118. <view class="right2">{{item.caption}}</view>
  119. </view>
  120. <view class="comtent2">
  121. <view class="left2">车型:</view>
  122. <view class="right2">{{item.vin_11}}</view>
  123. </view>
  124. </view>
  125. <view class="oneBox">
  126. <view class="comtent2">
  127. <view class="left2">年份:</view>
  128. <view class="right2">{{item.year}}</view>
  129. </view>
  130. <view class="comtent2">
  131. <view class="left2" style="width: 28%;">发动机:</view>
  132. <view class="right2">{{item.engine_prefix}}</view>
  133. </view>
  134. </view>
  135. <view class="oneBox">
  136. <view class="comtent2">
  137. <view class="left2" style="width: 28%;">变速箱:</view>
  138. <view class="right2">{{item.trans}}</view>
  139. </view>
  140. <view class="comtent2">
  141. <view class="left2">地区:</view>
  142. <view class="right2">{{item.area}}</view>
  143. </view>
  144. </view>
  145. <view class="oneBox">
  146. <view class="comtent2">
  147. <view class="left2">配置:</view>
  148. <view class="right2">{{item.equips}}</view>
  149. </view>
  150. <view class="comtent2">
  151. <view class="left2">级别:</view>
  152. <view class="right2">{{item.grade}}</view>
  153. </view>
  154. </view>
  155. <view class="oneBox">
  156. <view class="comtent2">
  157. <view class="left2" style="width: 35%;">模型代码:</view>
  158. <view class="right2">{{item.model_code}}</view>
  159. </view>
  160. </view>
  161. </view>
  162. </view>
  163. </view>
  164. <!-- 4S销售车型 -->
  165. <!-- <view class="mainBox" v-if="tabIndex==4" style="margin-top: 0rpx; padding: 0rpx">
  166. <view class="topTitle">共<span style="color: #FF3B30;">999</span>条</view>
  167. <view class="workBox3" v-for="(item,index) in xiaoshouList" :key="index">
  168. <view class="carMode">2009 手自一体变速器(MT)模拟7档 前置四驱 S5 </view>
  169. </view>
  170. </view>
  171. -->
  172. </view>
  173. </template>
  174. <script>
  175. export default {
  176. data() {
  177. return {
  178. epc_id: '',
  179. partsnum: '',
  180. tabIndex: 0,
  181. // tabList: ['配件信息', '维修工时', '通用件', 'EPC车型', '4S销售车型'],
  182. tabList: ['配件信息', 'EPC车型'],
  183. mesData: {},
  184. weizhi: '',
  185. yongliang: '',
  186. workHourseList: [],
  187. tongyongList: [],
  188. epcList: [],
  189. epc_Count: '',
  190. xiaoshouList: [],
  191. page: 1,
  192. total_page: 1
  193. }
  194. },
  195. onLoad(opt) {
  196. console.log('opt+',opt);
  197. this.epc_id = opt.epc_id;
  198. this.partsnum = opt.partsnum;
  199. this.weizhi = opt.weizhi;
  200. this.yongliang = opt.yongliang;
  201. this.getItemData();
  202. },
  203. methods: {
  204. // 配件信息
  205. getItemData() {
  206. uni.showLoading({
  207. title: '加载中'
  208. });
  209. this.$http('advancedEpc/generalEpc/info', {
  210. epc_id: this.epc_id,
  211. partsnum: this.partsnum,
  212. }, 'GET').then(res => {
  213. uni.hideLoading();
  214. this.mesData = res.data.result;
  215. });
  216. },
  217. // 通用件
  218. getTongData() {
  219. this.partsnum = '7E0498104K';
  220. this.epc_id = '1051';
  221. uni.showLoading({
  222. title: '加载中'
  223. });
  224. this.$http('advancedEpc/generalEpc/replace', {
  225. epc_id: this.epc_id,
  226. partsnum: this.partsnum,
  227. }, 'GET').then(res => {
  228. uni.hideLoading();
  229. this.tongyongList = res.data.result;
  230. });
  231. },
  232. // EPC车型
  233. getCarModelData() {
  234. uni.showLoading({
  235. title: '加载中'
  236. });
  237. this.$http('advancedEpc/findApplicableModels', {
  238. epc_id: this.epc_id,
  239. partnum: this.partsnum,
  240. page: this.page,
  241. }, 'GET').then(res => {
  242. uni.hideLoading();
  243. this.epc_Count = res.data.result.total_count;
  244. this.total_page = res.data.result.total_page;
  245. var list = res.data.result.list;
  246. if (list.length != 0) {
  247. this.epcList = this.epcList.concat(list)
  248. }
  249. });
  250. },
  251. topClick(index) {
  252. this.tabIndex = index
  253. this.page = 1;
  254. if (this.tabIndex == 0) {
  255. // 配件信息
  256. this.getItemData();
  257. }
  258. // else if (this.tabIndex == 1) {
  259. // // 维修工时
  260. // // this.getItemData();
  261. // }
  262. // else if (this.tabIndex == 1) {
  263. // // 通用件
  264. // this.getTongData();
  265. // }
  266. else if (this.tabIndex == 1) {
  267. // EPC车型
  268. this.getCarModelData();
  269. }
  270. // else if (this.tabIndex == 4) {
  271. // // 4S销售车型
  272. // // this.getItemData();
  273. // }
  274. },
  275. },
  276. // 下拉刷新 上拉加载更多
  277. onPullDownRefresh() {
  278. // this.page = 1
  279. // this.getItemData()
  280. setTimeout(function() {
  281. uni.stopPullDownRefresh();
  282. }, 1000);
  283. },
  284. onReachBottom() {
  285. // if (this.tabIndex == 0) {
  286. // // 配件信息
  287. // this.getItemData();
  288. // }
  289. // // else if (this.tabIndex == 1) {
  290. // // // 维修工时
  291. // // // this.getItemData();
  292. // // }
  293. // else if (this.tabIndex == 1) {
  294. // // 通用件
  295. // // this.getTongData();
  296. // }
  297. // else
  298. if (this.tabIndex == 2) {
  299. // EPC车型
  300. if (this.page <= this.total_page) {
  301. this.page++;
  302. this.getCarModelData()()
  303. }
  304. }
  305. // else if (this.tabIndex == 4) {
  306. // // 4S销售车型
  307. // // this.getItemData();
  308. // }
  309. }
  310. }
  311. </script>
  312. <style>
  313. .box {
  314. min-height: 100vh;
  315. background: #F4F5F7;
  316. padding-bottom: constant(safe-area-inset-bottom);
  317. padding-bottom: env(safe-area-inset-bottom);
  318. }
  319. .scroll-Y {
  320. white-space: nowrap;
  321. width: 100%;
  322. height: 90rpx;
  323. background-color: #FFFFFF;
  324. position: fixed;
  325. z-index: 111;
  326. }
  327. .tab {
  328. background: #FFFFFF;
  329. line-height: 87rpx;
  330. height: 87rpx;
  331. display: inline-block;
  332. padding-left: 20rpx;
  333. padding-right: 20rpx;
  334. }
  335. .tabLine {
  336. font-size: 32rpx;
  337. color: #999999;
  338. text-align: center;
  339. }
  340. .tabActive {
  341. color: #3F90F7;
  342. font-weight: bold;
  343. }
  344. .line {
  345. background: #FFFFFF;
  346. height: 4rpx;
  347. }
  348. .lineBlue {
  349. background: #3F90F7;
  350. width: 60rpx;
  351. margin-left: calc((100% - 60rpx)/2);
  352. }
  353. .mainBox {
  354. background: #F4F5F7;
  355. min-height: 90vh;
  356. width: 100%;
  357. padding-top: 90rpx;
  358. }
  359. .pei{
  360. background: #FFFFFF;
  361. padding: 20rpx 24rpx;
  362. margin-top: 20rpx;
  363. }
  364. .tong{
  365. background: #FFFFFF;
  366. }
  367. .epc{
  368. background: #FFFFFF;
  369. }
  370. .comtent {
  371. padding-bottom: 30rpx;
  372. display: flex;
  373. align-items: baseline;
  374. font-size: 26rpx;
  375. }
  376. .left {
  377. width: 20%;
  378. color: #999999;
  379. white-space: nowrap;
  380. }
  381. .right {
  382. width: 80%;
  383. color: #333333;
  384. }
  385. .workBox {
  386. background: #FFFFFF;
  387. border-bottom: 1rpx solid #EEEEEE;
  388. padding-bottom: 20rpx;
  389. margin-bottom: 20rpx;
  390. }
  391. .oneBox {
  392. display: flex;
  393. justify-content: space-between;
  394. align-items: baseline;
  395. font-size: 26rpx;
  396. padding-bottom: 20rpx;
  397. }
  398. .comtent2 {
  399. display: flex;
  400. align-items: baseline;
  401. font-size: 26rpx;
  402. width: 50%;
  403. }
  404. .topTitle {
  405. background-color: #F4F5F7;
  406. padding: 14rpx 24rpx;
  407. color: #666666;
  408. font-size: 24rpx;
  409. }
  410. .workBox2 {
  411. background: #FFFFFF;
  412. border-bottom: 1rpx solid #EEEEEE;
  413. padding: 20rpx 24rpx 0rpx;
  414. margin-bottom: 20rpx;
  415. }
  416. .left2 {
  417. width: 20%;
  418. color: #999999;
  419. white-space: nowrap;
  420. }
  421. .right2 {
  422. width: 80%;
  423. color: #333333;
  424. margin-right: 20rpx;
  425. }
  426. .workBox3 {
  427. background: #FFFFFF;
  428. border-bottom: 1rpx solid #EEEEEE;
  429. padding: 20rpx 24rpx;
  430. margin-bottom: 20rpx;
  431. }
  432. .carMode {
  433. color: #333333;
  434. font-size: 28rpx;
  435. }
  436. </style>