examinationSelect.vue 9.0 KB

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