awaitStorage.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  1. <!-- 待入库 -->
  2. <template>
  3. <view id="register">
  4. <view class="title">{{item.airName}}-{{item.configName}}</view>
  5. <view class="register_li">
  6. <view class="register_li_min">
  7. <view></view>
  8. <view>司机姓名:</view>
  9. <input v-model="infoForm.user.userName" type="text" >
  10. </view>
  11. <view class="register_li_min">
  12. <view></view>
  13. <view>司机号牌:</view>
  14. <input v-model="infoForm.car.carCode" type="text" >
  15. </view>
  16. <view class="register_li_min" style="border-bottom:0;">
  17. <view></view>
  18. <view>联系方式:</view>
  19. <input v-model="infoForm.user.phone" type="text" >
  20. </view>
  21. </view>
  22. <view class="register_li">
  23. <view class="register_li_min" v-for="(item,index) in list">
  24. <view></view>
  25. <view>{{item.name}}</view>
  26. <view class="radio_group">
  27. <view class="radio" v-for="(item2,index2) in item.radioList" @click="radioClick(item,item2)">
  28. <img v-if="!item2.checked" src="@/images/basicsModules/icon_5.png">
  29. <img v-if="item2.checked" src="@/images/basicsModules/icon_6.png">
  30. <text>{{item2.name}}</text>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="register_li_min">
  35. <view>*</view>
  36. <view>气表压力:</view>
  37. <input v-model="form.gasPressure" maxlength="4" type="text" placeholder-style="color:#999;" placeholder="请输入气表压力">
  38. </view>
  39. <!-- 检验有效期 -->
  40. <view class="register_li_min2">
  41. <view><text style="color: #f00;margin-right: 10rpx;">*</text>检验有效期:</view>
  42. <picker mode="date" @change="startChange($event)">
  43. <input class="picker-text" v-model="form.validateStartTime" disabled type="text" placeholder-style="color:#999;" placeholder="开始时间">
  44. </picker>
  45. <view>-</view>
  46. <picker mode="date" @change="endChange($event)">
  47. <input class="picker-text2" v-model="form.validateEndTime" disabled type="text" placeholder-style="color:#999;" placeholder="结束时间">
  48. </picker>
  49. </view>
  50. <view class="register_li_min" >
  51. <view>*</view>
  52. <view>电子标签:</view>
  53. <input v-model="form.electronicTag" type="text" placeholder-style="color:#999;" placeholder="请输入电子标签ID">
  54. <img @click.stop="saoCode" class="code_img" src="@/images/basicsModules/icon_aqjc_sm.png">
  55. </view>
  56. <view class="register_li_min" style="border: none;">
  57. <view>*</view>
  58. <view>验收备注:</view>
  59. <input v-model="form.validateRemark" type="text" placeholder-style="color:#999;" placeholder="请输入验收备注">
  60. </view>
  61. </view>
  62. <view class="sub_btn">
  63. <view class="sub_btn_l" @click="rejection()">拒收</view>
  64. <view class="sub_btn_r" @click="submitForm()">确认信息并入库</view>
  65. </view>
  66. </view>
  67. </template>
  68. <script>
  69. import {gasApplyDetailDrkDetail,gasApplyStorageAdd} from '@/api/apiDemo/index.js'
  70. import { config } from '@/api/request/config.js'
  71. export default {
  72. data() {
  73. return {
  74. form:{
  75. gasPressure:'',
  76. validateStartTime:'',
  77. validateEndTime:'',
  78. electronicTag:'',
  79. validateRemark:'',
  80. },
  81. infoForm:{},
  82. item:{},
  83. id:{},
  84. list:[
  85. {
  86. id:'0',
  87. name:'瓶身颜色:',
  88. lab:'color',
  89. radioList:[
  90. {
  91. id:1,
  92. name:'灰',
  93. checked:true,
  94. },
  95. {
  96. id:2,
  97. name:'白',
  98. checked:false,
  99. },
  100. {
  101. id:3,
  102. name:'蓝',
  103. checked:false,
  104. },
  105. ]
  106. },
  107. {
  108. id:'0',
  109. name:'有无手轮:',
  110. lab:'isHandwheel',
  111. radioList:[
  112. {
  113. id:1,
  114. name:'有',
  115. checked:true,
  116. },
  117. {
  118. id:0,
  119. name:'无',
  120. checked:false,
  121. },
  122. ]
  123. },
  124. {
  125. id:'0',
  126. name:'是否固定:',
  127. lab:'isFixed',
  128. radioList:[
  129. {
  130. id:1,
  131. name:'是',
  132. checked:true,
  133. },
  134. {
  135. id:0,
  136. name:'否',
  137. checked:false,
  138. },
  139. ]
  140. },
  141. {
  142. id:'0',
  143. name:'电子标签:',
  144. lab:'isElectronicTag',
  145. radioList:[
  146. {
  147. id:1,
  148. name:'有',
  149. checked:true,
  150. },
  151. {
  152. id:0,
  153. name:'无',
  154. checked:false,
  155. },
  156. ]
  157. },
  158. {
  159. id:'0',
  160. name:'气瓶状态标牌:',
  161. lab:'isStatusSign',
  162. radioList:[
  163. {
  164. id:1,
  165. name:'有',
  166. checked:true,
  167. },
  168. {
  169. id:0,
  170. name:'无',
  171. checked:false,
  172. },
  173. ]
  174. },
  175. {
  176. id:'0',
  177. name:'标牌已拍照:',
  178. lab:'isPhoto',
  179. radioList:[
  180. {
  181. id:1,
  182. name:'有',
  183. checked:true,
  184. },
  185. {
  186. id:0,
  187. name:'无',
  188. checked:false,
  189. },
  190. ]
  191. },
  192. ]
  193. }
  194. },
  195. onLoad(option) {
  196. this.item=JSON.parse(decodeURIComponent(option.item));
  197. },
  198. onShow(){
  199. },
  200. mounted(){
  201. this.getInfo()
  202. },
  203. methods: {
  204. //开始时间选中事件
  205. startChange(e){
  206. this.form.validateStartTime=e.target.value
  207. },
  208. //结束时间选中事件
  209. endChange(e){
  210. this.form.validateEndTime=e.target.value
  211. },
  212. //单选按钮
  213. radioClick(p,d){
  214. d.checked=!d.checked
  215. if(d.checked){
  216. //如果有选中的,循环把其他选中的取消
  217. p.radioList.forEach(function(item){
  218. if(item.id==d.id){
  219. }else{
  220. item.checked=false;
  221. }
  222. })
  223. }else{
  224. }
  225. },
  226. //调用摄像头
  227. saoCode(){
  228. let _this = this;
  229. uni.scanCode({
  230. onlyFromCamera: true,
  231. success: function (res) {
  232. _this.form.electronicTag=res.result
  233. }
  234. });
  235. },
  236. //获取列表数据
  237. async getInfo(){
  238. let _this = this;
  239. const {data} = await gasApplyDetailDrkDetail({id:_this.item.id});
  240. if(data.code==200){
  241. if(data.code==200){
  242. let res = data.data;
  243. _this.infoForm=res
  244. }
  245. }
  246. },
  247. //拒收
  248. async rejection(){
  249. uni.redirectTo({
  250. url: '/pages_manage/gasBottle/gasApply/gasApplyReject?item='+encodeURIComponent(JSON.stringify(this.item))+'&item2='+encodeURIComponent(JSON.stringify(this.infoForm))
  251. });
  252. },
  253. //提交
  254. async submitForm(){
  255. let _this = this;
  256. if(!this.form.gasPressure){
  257. uni.showToast({
  258. title: '请输入气表压力',
  259. icon:"none",
  260. mask:true,
  261. duration: 2000
  262. });
  263. return
  264. }
  265. if(!this.form.validateStartTime || !this.form.validateEndTime){
  266. uni.showToast({
  267. title: '请选择检验有效期',
  268. icon:"none",
  269. mask:true,
  270. duration: 2000
  271. });
  272. return
  273. }
  274. if(!this.form.electronicTag){
  275. uni.showToast({
  276. title: '请输入电子标签',
  277. icon:"none",
  278. mask:true,
  279. duration: 2000
  280. });
  281. return
  282. }
  283. if(!this.form.validateRemark){
  284. uni.showToast({
  285. title: '请输入验收备注',
  286. icon:"none",
  287. mask:true,
  288. duration: 2000
  289. });
  290. return
  291. }
  292. _this.list.forEach(function(item){
  293. item.radioList.forEach(function(item2){
  294. if(item.lab=='color' && item2.checked){
  295. _this.form.color=item2.id;
  296. }else if(item.lab=='isHandwheel' && item2.checked){
  297. _this.form.isHandwheel=item2.id;
  298. }else if(item.lab=='isFixed' && item2.checked){
  299. _this.form.isFixed=item2.id;
  300. }else if(item.lab=='isElectronicTag' && item2.checked){
  301. _this.form.isElectronicTag=item2.id;
  302. }else if(item.lab=='isStatusSign' && item2.checked){
  303. _this.form.isStatusSign=item2.id;
  304. }else if(item.lab=='isPhoto' && item2.checked){
  305. _this.form.isPhoto=item2.id;
  306. }
  307. })
  308. })
  309. _this.form.driverName=_this.infoForm.user.userName
  310. _this.form.driverId=_this.infoForm.user.id
  311. _this.form.carCode=_this.infoForm.car.carCode
  312. _this.form.carCodeId =_this.infoForm.car.id
  313. _this.form.phone=_this.infoForm.user.phone
  314. _this.form.airStatus=0;
  315. _this.form.taskId=_this.item.taskId;
  316. _this.form.taskDetailId=_this.item.id;
  317. _this.form.airName=_this.item.airName;
  318. _this.form.parent=_this.item.parent;
  319. _this.form.specValue=_this.item.specValue;
  320. _this.form.configName=_this.item.configName;
  321. _this.form.companyName=_this.item.companyName;
  322. _this.form.airConstituents=_this.item.airConstituents;
  323. _this.form.airBottleConfigId=_this.item.airBottleConfigId;
  324. _this.form.airBottleId =_this.item.airBottleId;
  325. const {data} = await gasApplyStorageAdd(_this.form);
  326. if(data.code == 200){
  327. uni.showToast({
  328. title: '提交成功',
  329. icon:"none",
  330. mask:true,
  331. duration: 2000
  332. });
  333. setTimeout(function(){
  334. uni.redirectTo({
  335. url: '/pages_manage/gasBottle/gasApply/gasApply'
  336. });
  337. },2000);
  338. }
  339. },
  340. }
  341. }
  342. </script>
  343. <style lang="stylus" scoped>
  344. #register{
  345. height:auto;
  346. width:100%;
  347. display flex
  348. flex-direction column;
  349. padding-bottom: 220rpx;
  350. .title{
  351. width: 750rpx;
  352. height: 100rpx;
  353. background: #FFFFFF;
  354. font-size: 28rpx;
  355. font-family: PingFang SC;
  356. font-weight: 500;
  357. color: #333333;
  358. line-height: 100rpx;
  359. padding-left: 40rpx;
  360. }
  361. .register_li{
  362. background #fff;
  363. border-radius:20rpx;
  364. margin:20rpx 20rpx 0;
  365. padding:20rpx 0;
  366. box-sizing: border-box;
  367. .register_li_min{
  368. margin:0 26rpx;
  369. display flex;
  370. align-items center;
  371. border-bottom: 1px solid #F5F5F5;
  372. view{
  373. line-height:100rpx;
  374. font-size:28rpx;
  375. }
  376. view:nth-child(1){
  377. color:red;
  378. line-height:28rpx;
  379. margin-right: 12rpx;
  380. }
  381. view:nth-child(2){
  382. //width:140rpx;
  383. flex: 1;
  384. font-size: 28rpx;
  385. font-family: PingFang SC;
  386. font-weight: 500;
  387. color: #333333;
  388. }
  389. .picker-text{
  390. text-align: right;
  391. font-size: 28rpx;
  392. }
  393. >input{
  394. width 400rpx;
  395. text-align: right;
  396. font-size: 24rpx;
  397. font-family: PingFang SC;
  398. font-weight: 500;
  399. color: #333333;
  400. }
  401. .code_img{
  402. width: 30rpx;
  403. height: 28rpx;
  404. margin-left: 26rpx;
  405. }
  406. /* 单选按钮 */
  407. .radio_group{
  408. display: flex;
  409. .radio{
  410. display: flex;
  411. margin-left: 80rpx;
  412. margin-right: 0;
  413. >img{
  414. width: 30rpx;
  415. height: 30rpx;
  416. }
  417. >text{
  418. margin-left: 34rpx;
  419. font-size: 28rpx;
  420. font-family: PingFang SC;
  421. font-weight: 500;
  422. color: #333333;
  423. line-height: 28rpx;
  424. }
  425. }
  426. }
  427. }
  428. /* 时间 */
  429. .register_li_min2{
  430. margin:0 26rpx;
  431. border-bottom: 1px solid #f5f5f5;
  432. height: 100rpx;
  433. display: flex;
  434. justify-content: flex-start;
  435. align-items: center;
  436. >view:nth-child(1){
  437. font-size: 28rpx;
  438. font-family: PingFang SC;
  439. font-weight: 500;
  440. color: #333333;
  441. line-height: 100rpx;
  442. margin-right: 96rpx;
  443. }
  444. .picker-text{
  445. font-size: 24rpx;
  446. font-family: PingFang SC;
  447. font-weight: 500;
  448. color: #999999;
  449. line-height: 100rpx;
  450. width: 188rpx;
  451. }
  452. >view:nth-child(2){
  453. font-size: 24rpx;
  454. font-family: PingFang SC;
  455. font-weight: 500;
  456. color: #999999;
  457. line-height: 100rpx;
  458. }
  459. .picker-text2{
  460. font-size: 24rpx;
  461. font-family: PingFang SC;
  462. font-weight: 500;
  463. color: #999999;
  464. line-height: 100rpx;
  465. width: 188rpx;
  466. text-align: right;
  467. }
  468. }
  469. }
  470. /* 按钮 */
  471. .sub_btn{
  472. width: 650rpx;
  473. height: 100rpx;
  474. display: flex;
  475. position: fixed;
  476. bottom: 30rpx;
  477. left: 50rpx;
  478. z-index: 1000;
  479. .sub_btn_l{
  480. width: 325rpx;
  481. height: 100rpx;
  482. background: linear-gradient(-45deg, #FA9901, #F28E26);
  483. border-radius: 50rpx 0px 0px 50rpx;
  484. font-size: 30rpx;
  485. font-family: PingFang SC;
  486. font-weight: 500;
  487. color: #FFFFFF;
  488. line-height: 100rpx;
  489. text-align: center;
  490. }
  491. .sub_btn_r{
  492. width: 325rpx;
  493. height: 100rpx;
  494. background: linear-gradient(-35deg, #309CFF, #0183FA);
  495. border-radius: 0px 50rpx 50rpx 0px;
  496. font-size: 30rpx;
  497. font-family: PingFang SC;
  498. font-weight: 500;
  499. color: #FFFFFF;
  500. line-height: 100rpx;
  501. text-align: center;
  502. }
  503. }
  504. }
  505. /deep/.input-value-border{
  506. display :none !important;
  507. }
  508. </style>