examinationSelect.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  1. <!--资质申请-->
  2. <template>
  3. <view id="transportPerson">
  4. <view class="search">
  5. <view class="search_t">
  6. <view class="search_n">
  7. <input v-model="params.searchValue" @blur="search()" type="text" placeholder="请输入气体名称或供应商的关键字">
  8. <img class="icon_img" src="@/images/basicsModules/icon_aqjc_ss.png"/>
  9. </view>
  10. </view>
  11. <!-- <view class="search_b">
  12. <text>气体名称</text>
  13. <text>气体级别</text>
  14. <text>气体规格</text>
  15. </view> -->
  16. </view>
  17. <scroll-view scroll-y @scrolltolower="scrollGet" class="scroll-box">
  18. <view class="list">
  19. <view class="list_li" v-for="(item,index) in listDetail">
  20. <view class="list_li_l">
  21. <view class="list_li_l_t">{{item.airName}}-{{item.configName}}</view>
  22. <view class="list_li_l_b">
  23. <img src="@/images/basicsModules/icon_14.png">
  24. <text>{{item.companyName}}</text>
  25. </view>
  26. </view>
  27. <view class="list_li_r">
  28. <view class="minus" @click="minus(item)"><img src="@/pages_student/images/icon_zgsq_jian.png"></view>
  29. <input v-model="item.bottleNumber" disabled type="text" >
  30. <view class="add" @click="add(item)"><img src="@/pages_student/images/icon_zgsq_j.png"></view>
  31. </view>
  32. </view>
  33. </view>
  34. </scroll-view>
  35. <view class="empty" v-if="pageType==4">
  36. <img class="for-back-img" src="@/pages_student/images/img_ysrygl_zwsj.png">
  37. <view>暂无数据</view>
  38. </view>
  39. <view v-if="amount>0" class="sub_btn">
  40. <view class="sub_btn_l">已选择{{amount}}个气瓶</view>
  41. <view class="sub_btn_r" @click="submitForm()">提交</view>
  42. </view>
  43. <view v-if="amount==0" class="sub_btn2">
  44. <view class="sub_btn_l">暂未选择气瓶</view>
  45. <view class="sub_btn_r">提交</view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. import { taskListGood } from '@/api/apiDemo/index.js'
  51. export default {
  52. name: "transportPerson",
  53. data() {
  54. return {
  55. pageType:0,
  56. //列表请求参数
  57. params:{
  58. searchValue:'',
  59. },
  60. listDetail:[],
  61. form:{
  62. },
  63. amount:0,
  64. status:null,//0添加1编辑
  65. id:null,
  66. }
  67. },
  68. onLoad(option) {
  69. this.status=option.status;
  70. this.id=option.id;
  71. if(option.form){
  72. this.form=JSON.parse(decodeURIComponent(option.form));
  73. }
  74. },
  75. onShow() {
  76. },
  77. methods: {
  78. search(){
  79. this.getList();
  80. },
  81. minus(d) {
  82. let _this=this;
  83. if(d.bottleNumber>0){
  84. _this.amount=0;
  85. d.bottleNumber--;
  86. this.listDetail.forEach(function(item){
  87. _this.amount+=item.bottleNumber;
  88. })
  89. }
  90. },
  91. add(d) {
  92. let _this=this;
  93. _this.amount=0;
  94. d.bottleNumber++;
  95. this.listDetail.forEach(function(item){
  96. _this.amount+=item.bottleNumber;
  97. })
  98. },
  99. //滚动加载事件
  100. scrollGet(){
  101. },
  102. //获取列表数据
  103. async getList(){
  104. let _this = this;
  105. const {data} = await taskListGood(this.params);
  106. if(data.code==200){
  107. let res=data.rows;
  108. if(res){
  109. let arr=[];
  110. res.forEach(function(item){
  111. item.bottleNumber=0;
  112. })
  113. _this.listDetail=res;
  114. if(_this.status==0){//新增
  115. //如果有值回显
  116. if(uni.getStorageSync('listDetail')){
  117. arr=JSON.parse(decodeURIComponent(uni.getStorageSync('listDetail')));
  118. _this.listDetail.forEach(function(item){
  119. arr.forEach(function(item2){
  120. if(item.id==item2.id){
  121. item.bottleNumber=item2.bottleNumber;
  122. _this.amount+=item.bottleNumber
  123. }
  124. })
  125. })
  126. }
  127. }else if(_this.status==1){//编辑
  128. //如果有值回显
  129. if(uni.getStorageSync('listDetail')){
  130. arr=JSON.parse(decodeURIComponent(uni.getStorageSync('listDetail')));
  131. _this.listDetail.forEach(function(item){
  132. arr.forEach(function(item2){
  133. if(item.id==item2.airBottleConfigId){
  134. item.bottleNumber=item2.bottleNumber;
  135. _this.amount+=item.bottleNumber
  136. }
  137. })
  138. })
  139. }
  140. }
  141. }
  142. }
  143. },
  144. //注册提交
  145. async submitForm(){
  146. let _this = this;
  147. if(_this.listDetail){
  148. let arr=[];
  149. _this.listDetail.forEach(function(item){
  150. if(item.bottleNumber>0){
  151. arr.push(item)
  152. }
  153. })
  154. uni.setStorageSync('listDetail',encodeURIComponent(JSON.stringify(arr)))
  155. }
  156. uni.redirectTo({
  157. url: '/pages_student/examination/examinationAdd?status='+this.status+'&id='+this.id+'&form='+encodeURIComponent(JSON.stringify(this.form)),
  158. });
  159. },
  160. },
  161. mounted(){
  162. this.getList()
  163. },
  164. }
  165. </script>
  166. <style lang="stylus" scoped>
  167. #transportPerson {
  168. height: 100%;
  169. width: 100%;
  170. flex :1;
  171. display flex;
  172. flex-direction column
  173. overflow hidden;
  174. /* 搜索 */
  175. .search{
  176. .search_t{
  177. background: #FFFFFF;
  178. padding: 20rpx;
  179. box-sizing: border-box;
  180. .search_n{
  181. width: 710rpx;
  182. height: 80rpx;
  183. border: 1px solid #E0E0E0;
  184. border-radius: 40rpx;
  185. display: flex;
  186. justify-content: space-between;
  187. align-items: center;
  188. padding:0 40rpx;
  189. box-sizing: border-box;
  190. >input{
  191. width: 640rpx;
  192. font-size: 24rpx;
  193. font-family: PingFang SC;
  194. font-weight: 500;
  195. color: #CCCCCC;
  196. line-height: 30rpx;
  197. }
  198. >img{
  199. width: 30rpx;
  200. height: 30rpx;
  201. }
  202. }
  203. }
  204. .search_b{
  205. display: flex;
  206. justify-content: center;
  207. align-items: center;
  208. margin: 20rpx 0;
  209. >text{
  210. display: inline-block;
  211. width: 200rpx;
  212. height: 60rpx;
  213. background: #FFFFFF;
  214. border-radius: 30rpx;
  215. font-size: 26rpx;
  216. font-family: PingFang SC;
  217. font-weight: 500;
  218. color: #333333;
  219. line-height: 60rpx;
  220. text-align: center;
  221. margin-right: 20rpx;
  222. }
  223. }
  224. }
  225. .scroll-box{
  226. // flex:1;
  227. overflow-y scroll;
  228. padding-top: 30rpx;
  229. padding-bottom: 180rpx;
  230. .list{
  231. background: #FFFFFF;
  232. border-radius: 20rpx;
  233. margin: 0 20rpx;
  234. padding: 0 20rpx;
  235. box-sizing: border-box;
  236. .list_li{
  237. height: 180rpx;
  238. display: flex;
  239. justify-content: space-between;
  240. padding: 0 20rpx;
  241. box-sizing: border-box;
  242. border-bottom:1px solid #f5f5f5;
  243. .list_li_l{
  244. flex: 1;
  245. .list_li_l_t{
  246. font-size: 28rpx;
  247. font-family: PingFang SC;
  248. font-weight: 500;
  249. color: #333333;
  250. line-height: 28rpx;
  251. margin-top: 44rpx;
  252. }
  253. .list_li_l_b{
  254. display: flex;
  255. justify-content: flex-start;
  256. margin: 42rpx 0 34rpx 0;
  257. >img{
  258. width: 28rpx;
  259. height: 30rpx;
  260. margin-right: 18rpx;
  261. }
  262. >text{
  263. font-size: 24rpx;
  264. font-family: PingFang SC;
  265. font-weight: 400;
  266. color: #666666;
  267. line-height: 24rpx;
  268. }
  269. }
  270. }
  271. .list_li_r{
  272. width: 222rpx;
  273. display: flex;
  274. justify-content: space-between;
  275. align-items: center;
  276. .minus{
  277. width: 96rpx;
  278. height: 96rpx;
  279. >img{
  280. width: 36rpx;
  281. height: 36rpx;
  282. margin-top: 30rpx;
  283. margin-left: 30rpx;
  284. }
  285. }
  286. .add{
  287. width: 96rpx;
  288. height: 96rpx;
  289. >img{
  290. width: 36rpx;
  291. height: 36rpx;
  292. margin-top: 30rpx;
  293. margin-left: 30rpx;
  294. }
  295. }
  296. >input{
  297. text-align: center;
  298. width: 90rpx;
  299. font-size: 28rpx;
  300. font-family: PingFang SC;
  301. font-weight: 500;
  302. color: #333333;
  303. line-height: 36rpx;
  304. }
  305. }
  306. }
  307. }
  308. }
  309. .empty{
  310. text-align: center;
  311. margin-top: 316rpx;
  312. >img{
  313. width: 336rpx;
  314. height: 222rpx;
  315. margin-left: 208rpx;
  316. }
  317. >view{
  318. font-size: 30rpx;
  319. font-family: PingFang SC;
  320. font-weight: 500;
  321. color: #E0E0E0;
  322. line-height: 30rpx;
  323. margin-top: 48rpx;
  324. }
  325. }
  326. /* 按钮 */
  327. .sub_btn{
  328. width: 750rpx;
  329. height: 120rpx;
  330. background: #FFFFFF;
  331. position: fixed;
  332. bottom: 0;
  333. display: flex;
  334. justify-content: space-between;
  335. align-items: center;
  336. padding: 0 20rpx 0 40rpx;
  337. box-sizing: border-box;
  338. z-index: 1000;
  339. .sub_btn_l{
  340. font-size: 28rpx;
  341. font-family: PingFang SC;
  342. font-weight: 500;
  343. color: #333333;
  344. line-height: 120rpx;
  345. flex: 1;
  346. }
  347. .sub_btn_r{
  348. width: 200rpx;
  349. height: 70rpx;
  350. background: #0183FA;
  351. border-radius: 35rpx;
  352. font-size: 28rpx;
  353. font-family: PingFang SC;
  354. font-weight: 500;
  355. color: #FFFFFF;
  356. line-height: 70rpx;
  357. text-align: center;
  358. }
  359. }
  360. .sub_btn2{
  361. width: 750rpx;
  362. height: 120rpx;
  363. background: #FFFFFF;
  364. position: fixed;
  365. bottom: 0;
  366. display: flex;
  367. justify-content: space-between;
  368. align-items: center;
  369. padding: 0 20rpx 0 40rpx;
  370. box-sizing: border-box;
  371. z-index: 1000;
  372. .sub_btn_l{
  373. font-size: 28rpx;
  374. font-family: PingFang SC;
  375. font-weight: 500;
  376. color: #CCCCCC;
  377. line-height: 120rpx;
  378. flex: 1;
  379. }
  380. .sub_btn_r{
  381. width: 200rpx;
  382. height: 70rpx;
  383. background: #E0E0E0;
  384. border-radius: 35rpx;
  385. font-size: 28rpx;
  386. font-family: PingFang SC;
  387. font-weight: 500;
  388. color: #999999;
  389. line-height: 70rpx;
  390. text-align: center;
  391. }
  392. }
  393. }
  394. </style>