leaveConfirm.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. <!--出库确认-->
  2. <template>
  3. <view id="gasRecycle">
  4. <view class="title">{{specificationName.airName}}-{{specificationName.gasLevel}}</view>
  5. <view class="register_li" v-if="form3.isShow">
  6. <view class="register_li_min">
  7. <view>实际气压值:</view>
  8. <view>{{form3.afterEdit+'Mpa'}}</view>
  9. </view>
  10. <view class="register_li_min">
  11. <view>修改人:</view>
  12. <input v-model="form3.createBy" disabled type="text" >
  13. </view>
  14. <view class="register_li_min" style="border: none;">
  15. <view>修改时间:</view>
  16. <input v-model="form3.opTime" disabled type="text" >
  17. </view>
  18. </view>
  19. <view class="register_li">
  20. <view class="register_li_min">
  21. <view>实验地点:</view>
  22. <input v-model="form.location" disabled type="text" >
  23. </view>
  24. <view class="register_li_min" style="border: none;">
  25. <view>编号:</view>
  26. <input v-model="form.airNumber" disabled type="text" >
  27. </view>
  28. </view>
  29. <view class="register_li" v-if="form2.contacts">
  30. <view class="register_li_min">
  31. <view>使用人:</view>
  32. <input v-model="form2.contacts" disabled type="text" >
  33. </view>
  34. <!-- 使用时间 -->
  35. <view class="register_li_min2">
  36. <view>使用时间:</view>
  37. <picker mode="date" disabled @change="startChange($event)">
  38. <input class="picker-text" v-model="form2.useTimeApp" disabled type="text" placeholder="开始时间">
  39. </picker>
  40. <view>-</view>
  41. <picker mode="date" disabled @change="endChange($event)">
  42. <input class="picker-text2" v-model="form2.backTimeApp" disabled type="text" placeholder="结束时间">
  43. </picker>
  44. </view>
  45. <view class="register_li_min">
  46. <view>使用量:</view>
  47. <view>{{form2.amount+'Mpa'}}</view>
  48. </view>
  49. <view v-if="form2.beforeUse" class="register_li_min">
  50. <view>使用前气压:</view>
  51. <view>{{form2.beforeUse+'Mpa'}}</view>
  52. </view>
  53. <view v-if="form2.beforeUsePic" class="meter_img" :style="!form2.afterUse?'border:none;':''" @click="lookItem(form2.beforeUsePic)">
  54. <view>气表照片:</view>
  55. <img :src="baseUrl+form2.beforeUsePic" >
  56. </view>
  57. <view v-if="form2.afterUse" class="register_li_min">
  58. <view>使用后气压:</view>
  59. <view>{{form2.afterUse+'Mpa'}}</view>
  60. </view>
  61. <view v-if="form2.afterUsePic" class="meter_img" style="border:0;" @click="lookItem(form2.afterUsePic)">
  62. <view>气表照片:</view>
  63. <img :src="baseUrl+form2.afterUsePic" >
  64. </view>
  65. </view>
  66. <view class="sub_btn2" @click="barometer()">气压有误</view>
  67. <view class="sub_btn" @click="submitForm()">确认出库</view>
  68. </view>
  69. </template>
  70. <script>
  71. import { gasDetail,gasDetailRecord,gasBottleErrorList,gasStorageOut } from '@/api/apiDemo/index.js'
  72. import { config } from '@/api/request/config.js'
  73. export default {
  74. name: "gasRecycle",
  75. data() {
  76. return {
  77. baseUrl:config.base_url,
  78. pageType:0,
  79. //列表请求参数
  80. getData:{
  81. pageNum:1,
  82. pageSize:1,
  83. storageId:'',
  84. },
  85. form:{},
  86. form2:{},
  87. form3:{
  88. opTime:'',
  89. },
  90. dataList:[],
  91. imgList:[],
  92. item:{},
  93. specificationName:null,
  94. }
  95. },
  96. onLoad(option) {
  97. this.item=JSON.parse(decodeURIComponent(option.item));
  98. this.getData.storageId=this.item.id
  99. },
  100. onShow() {
  101. },
  102. mounted(){
  103. this.getInfo();
  104. this.getList();
  105. this.getList2();
  106. },
  107. methods: {
  108. lookItem(item){
  109. //查看图片
  110. wx.previewImage({
  111. urls: [config.base_url+item], //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
  112. current: '', // 当前显示图片的http链接,默认是第一个
  113. success: function(res) {},
  114. fail: function(res) {},
  115. complete: function(res) {},
  116. })
  117. },
  118. //判断两个日期的大小
  119. compareDate (d1, d2) {
  120. let reg = new RegExp('-', 'g')
  121. if(((new Date(d1.replace(reg, '/'))) > (new Date(d2.replace(reg, '/'))))){
  122. return true;
  123. }else{
  124. return false;
  125. }
  126. },
  127. //气压有误
  128. barometer(){
  129. uni.navigateTo({
  130. url:'/pages_manage/gasBottle/leaveConfirm/amendAir?item='+encodeURIComponent(JSON.stringify(this.form))+'&item2='+encodeURIComponent(JSON.stringify(this.form2))+'&specificationName='+encodeURIComponent(JSON.stringify(this.specificationName))
  131. });
  132. },
  133. async getInfo(){
  134. let _this=this;
  135. const {data} = await gasDetail({id:_this.item.id});
  136. if(data.code==200){
  137. let res = data.data;
  138. _this.form=res;
  139. _this.specificationName=JSON.parse(res.specificationName)
  140. }
  141. },
  142. //获取列表数据
  143. async getList(){
  144. let _this = this;
  145. const {data} = await gasDetailRecord(this.getData);
  146. if(data.code==200){
  147. let res=data.rows
  148. if(res){
  149. _this.form2=res[0]
  150. }
  151. }
  152. },
  153. //获取气压修改列表数据
  154. async getList2(){
  155. let _this = this;
  156. const {data} = await gasBottleErrorList(this.getData);
  157. if(data.code==200){
  158. let res=data.rows
  159. if(res){
  160. _this.form3=res[0]
  161. _this.form3.isShow=_this.compareDate(_this.form3.opTime,_this.form2.createTime)
  162. }
  163. }
  164. },
  165. //提交
  166. async submitForm(){
  167. let _this = this;
  168. let obj={
  169. storageId:_this.item.id,
  170. }
  171. const {data} = await gasStorageOut(obj);
  172. if(data.code == 200){
  173. uni.showToast({
  174. title: '出库成功!',
  175. icon:"none",
  176. mask:true,
  177. duration: 2000
  178. });
  179. setTimeout(function(){
  180. uni.redirectTo({
  181. url: '/pages_manage/gasBottle/gasManage/gasManage'
  182. });
  183. },2000);
  184. }
  185. },
  186. }
  187. }
  188. </script>
  189. <style lang="stylus" scoped>
  190. #gasRecycle {
  191. height: auto;
  192. width: 100%;
  193. flex :1;
  194. display flex;
  195. flex-direction column
  196. overflow hidden;
  197. padding-bottom: 300rpx;
  198. .title{
  199. width: 750rpx;
  200. height: 100rpx;
  201. background: #FFFFFF;
  202. font-size: 28rpx;
  203. font-family: PingFang SC;
  204. font-weight: 500;
  205. color: #333333;
  206. line-height: 100rpx;
  207. padding-left: 40rpx;
  208. }
  209. .register_li{
  210. background #fff;
  211. border-radius:20rpx;
  212. margin:20rpx 20rpx 0;
  213. padding:20rpx 0;
  214. box-sizing: border-box;
  215. .register_li_min{
  216. margin:0 26rpx;
  217. display flex;
  218. align-items center;
  219. border-bottom: 1px solid #F5F5F5;
  220. .icon_img{
  221. width: 30rpx;
  222. height: 30rpx;
  223. margin-right: 12rpx;
  224. }
  225. view{
  226. //width:140rpx;
  227. font-size: 28rpx;
  228. font-family: PingFang SC;
  229. font-weight: 500;
  230. color: #999999;
  231. line-height: 100rpx;
  232. }
  233. >view:nth-child(2){
  234. flex: 1;
  235. text-align: right;
  236. font-size: 24rpx;
  237. font-family: PingFang SC;
  238. font-weight: 500;
  239. color: #333333;
  240. }
  241. >input{
  242. flex:1;
  243. text-align: right;
  244. font-size: 24rpx;
  245. font-family: PingFang SC;
  246. font-weight: 500;
  247. color: #333333;
  248. }
  249. }
  250. /* 时间 */
  251. .register_li_min2{
  252. margin:0 26rpx;
  253. border-bottom: 1px solid #f5f5f5;
  254. height: 100rpx;
  255. display: flex;
  256. justify-content: flex-start;
  257. align-items: center;
  258. >view:nth-child(1){
  259. font-size: 28rpx;
  260. font-family: PingFang SC;
  261. font-weight: 500;
  262. color: #999999;
  263. line-height: 100rpx;
  264. margin-right: 46rpx;
  265. }
  266. .picker-text{
  267. font-size: 24rpx;
  268. font-family: PingFang SC;
  269. font-weight: 500;
  270. color: #333333;
  271. line-height: 100rpx;
  272. width: 240rpx;
  273. }
  274. >view:nth-child(2){
  275. font-size: 24rpx;
  276. font-family: PingFang SC;
  277. font-weight: 500;
  278. color: #333333;
  279. line-height: 100rpx;
  280. }
  281. .picker-text2{
  282. font-size: 24rpx;
  283. font-family: PingFang SC;
  284. font-weight: 500;
  285. color: #333333;
  286. line-height: 100rpx;
  287. width: 240rpx;
  288. text-align: right;
  289. }
  290. }
  291. .meter_img{
  292. margin:0 26rpx;
  293. display flex;
  294. justify-content: space-between;
  295. view{
  296. //width:140rpx;
  297. font-size: 28rpx;
  298. font-family: PingFang SC;
  299. font-weight: 500;
  300. color: #999999;
  301. line-height: 100rpx;
  302. }
  303. >img{
  304. width: 150rpx;
  305. height: 150rpx;
  306. border-radius: 10rpx;
  307. margin:42rpx 0 20rpx 0;
  308. }
  309. }
  310. }
  311. /* 按钮 */
  312. .sub_btn{
  313. width: 650rpx;
  314. height: 100rpx;
  315. background: #0183FA;
  316. border-radius: 20rpx;
  317. font-size: 28rpx;
  318. font-family: PingFang SC;
  319. font-weight: 500;
  320. color: #FFFFFF;
  321. line-height: 100rpx;
  322. text-align: center;
  323. margin-left: 50rpx;
  324. position: fixed;
  325. bottom:30rpx;
  326. z-index: 1000;
  327. }
  328. .sub_btn2{
  329. width: 650rpx;
  330. height: 100rpx;
  331. border: 2rpx solid #0072DB;
  332. border-radius: 20rpx;
  333. font-size: 28rpx;
  334. font-family: PingFang SC;
  335. font-weight: 500;
  336. color: #0183FA;
  337. line-height: 100rpx;
  338. text-align: center;
  339. margin-left: 50rpx;
  340. position: fixed;
  341. bottom:158rpx;
  342. z-index: 1000;
  343. }
  344. }
  345. </style>