123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357 |
- <!--出库确认-->
- <template>
- <view id="gasRecycle">
- <view class="title">{{specificationName.airName}}-{{specificationName.gasLevel}}</view>
- <view class="register_li" v-if="form3.isShow">
- <view class="register_li_min">
- <view>实际气压值:</view>
- <view>{{form3.afterEdit+'Mpa'}}</view>
- </view>
- <view class="register_li_min">
- <view>修改人:</view>
- <input v-model="form3.createBy" disabled type="text" >
- </view>
- <view class="register_li_min" style="border: none;">
- <view>修改时间:</view>
- <input v-model="form3.opTime" disabled type="text" >
- </view>
- </view>
- <view class="register_li">
- <view class="register_li_min">
- <view>实验地点:</view>
- <input v-model="form.location" disabled type="text" >
- </view>
- <view class="register_li_min" style="border: none;">
- <view>编号:</view>
- <input v-model="form.airNumber" disabled type="text" >
- </view>
- </view>
- <view class="register_li" v-if="form2.contacts">
- <view class="register_li_min">
- <view>使用人:</view>
- <input v-model="form2.contacts" disabled type="text" >
- </view>
- <!-- 使用时间 -->
- <view class="register_li_min2">
- <view>使用时间:</view>
- <picker mode="date" disabled @change="startChange($event)">
- <input class="picker-text" v-model="form2.useTimeApp" disabled type="text" placeholder="开始时间">
- </picker>
- <view>-</view>
- <picker mode="date" disabled @change="endChange($event)">
- <input class="picker-text2" v-model="form2.backTimeApp" disabled type="text" placeholder="结束时间">
- </picker>
- </view>
- <view class="register_li_min">
- <view>使用量:</view>
- <view>{{form2.amount+'Mpa'}}</view>
- </view>
- <view v-if="form2.beforeUse" class="register_li_min">
- <view>使用前气压:</view>
- <view>{{form2.beforeUse+'Mpa'}}</view>
- </view>
- <view v-if="form2.beforeUsePic" class="meter_img" :style="!form2.afterUse?'border:none;':''" @click="lookItem(form2.beforeUsePic)">
- <view>气表照片:</view>
- <img :src="baseUrl+form2.beforeUsePic" >
- </view>
- <view v-if="form2.afterUse" class="register_li_min">
- <view>使用后气压:</view>
- <view>{{form2.afterUse+'Mpa'}}</view>
- </view>
- <view v-if="form2.afterUsePic" class="meter_img" style="border:0;" @click="lookItem(form2.afterUsePic)">
- <view>气表照片:</view>
- <img :src="baseUrl+form2.afterUsePic" >
- </view>
- </view>
- <view class="sub_btn2" @click="barometer()">气压有误</view>
- <view class="sub_btn" @click="submitForm()">确认出库</view>
- </view>
- </template>
- <script>
- import { gasDetail,gasDetailRecord,gasBottleErrorList,gasStorageOut } from '@/api/apiDemo/index.js'
- import { config } from '@/api/request/config.js'
- export default {
- name: "gasRecycle",
- data() {
- return {
- baseUrl:config.base_url,
- pageType:0,
- //列表请求参数
- getData:{
- pageNum:1,
- pageSize:1,
- storageId:'',
- },
- form:{},
- form2:{},
- form3:{
- opTime:'',
- },
- dataList:[],
- imgList:[],
- item:{},
- specificationName:null,
- }
- },
- onLoad(option) {
- this.item=JSON.parse(decodeURIComponent(option.item));
- this.getData.storageId=this.item.id
- },
- onShow() {
- },
- mounted(){
- this.getInfo();
- this.getList();
- this.getList2();
- },
- methods: {
- lookItem(item){
- //查看图片
- wx.previewImage({
- urls: [config.base_url+item], //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
- current: '', // 当前显示图片的http链接,默认是第一个
- success: function(res) {},
- fail: function(res) {},
- complete: function(res) {},
- })
- },
- //判断两个日期的大小
- compareDate (d1, d2) {
- let reg = new RegExp('-', 'g')
- if(((new Date(d1.replace(reg, '/'))) > (new Date(d2.replace(reg, '/'))))){
- return true;
- }else{
- return false;
- }
- },
- //气压有误
- barometer(){
- uni.navigateTo({
- url:'/pages_manage/gasBottle/leaveConfirm/amendAir?item='+encodeURIComponent(JSON.stringify(this.form))+'&item2='+encodeURIComponent(JSON.stringify(this.form2))+'&specificationName='+encodeURIComponent(JSON.stringify(this.specificationName))
- });
- },
- async getInfo(){
- let _this=this;
- const {data} = await gasDetail({id:_this.item.id});
- if(data.code==200){
- let res = data.data;
- _this.form=res;
- _this.specificationName=JSON.parse(res.specificationName)
- }
- },
- //获取列表数据
- async getList(){
- let _this = this;
- const {data} = await gasDetailRecord(this.getData);
- if(data.code==200){
- let res=data.rows
- if(res){
- _this.form2=res[0]
- }
- }
- },
- //获取气压修改列表数据
- async getList2(){
- let _this = this;
- const {data} = await gasBottleErrorList(this.getData);
- if(data.code==200){
- let res=data.rows
- if(res){
- _this.form3=res[0]
- _this.form3.isShow=_this.compareDate(_this.form3.opTime,_this.form2.createTime)
- }
- }
- },
- //提交
- async submitForm(){
- let _this = this;
- let obj={
- storageId:_this.item.id,
- }
- const {data} = await gasStorageOut(obj);
- if(data.code == 200){
- uni.showToast({
- title: '出库成功!',
- icon:"none",
- mask:true,
- duration: 2000
- });
- setTimeout(function(){
- uni.redirectTo({
- url: '/pages_manage/gasBottle/gasManage/gasManage'
- });
- },2000);
- }
- },
- }
- }
- </script>
- <style lang="stylus" scoped>
- #gasRecycle {
- height: auto;
- width: 100%;
- flex :1;
- display flex;
- flex-direction column
- overflow hidden;
- padding-bottom: 300rpx;
- .title{
- width: 750rpx;
- height: 100rpx;
- background: #FFFFFF;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- line-height: 100rpx;
- padding-left: 40rpx;
- }
- .register_li{
- background #fff;
- border-radius:20rpx;
- margin:20rpx 20rpx 0;
- padding:20rpx 0;
- box-sizing: border-box;
- .register_li_min{
- margin:0 26rpx;
- display flex;
- align-items center;
- border-bottom: 1px solid #F5F5F5;
- .icon_img{
- width: 30rpx;
- height: 30rpx;
- margin-right: 12rpx;
- }
- view{
- //width:140rpx;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- line-height: 100rpx;
- }
- >view:nth-child(2){
- flex: 1;
- text-align: right;
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- }
- >input{
- flex:1;
- text-align: right;
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- }
- }
- /* 时间 */
- .register_li_min2{
- margin:0 26rpx;
- border-bottom: 1px solid #f5f5f5;
- height: 100rpx;
- display: flex;
- justify-content: flex-start;
- align-items: center;
- >view:nth-child(1){
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- line-height: 100rpx;
- margin-right: 46rpx;
- }
- .picker-text{
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- line-height: 100rpx;
- width: 240rpx;
- }
- >view:nth-child(2){
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- line-height: 100rpx;
- }
- .picker-text2{
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- line-height: 100rpx;
- width: 240rpx;
- text-align: right;
- }
- }
- .meter_img{
- margin:0 26rpx;
- display flex;
- justify-content: space-between;
- view{
- //width:140rpx;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- line-height: 100rpx;
- }
- >img{
- width: 150rpx;
- height: 150rpx;
- border-radius: 10rpx;
- margin:42rpx 0 20rpx 0;
- }
- }
- }
- /* 按钮 */
- .sub_btn{
- width: 650rpx;
- height: 100rpx;
- background: #0183FA;
- border-radius: 20rpx;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #FFFFFF;
- line-height: 100rpx;
- text-align: center;
- margin-left: 50rpx;
- position: fixed;
- bottom:30rpx;
- z-index: 1000;
- }
- .sub_btn2{
- width: 650rpx;
- height: 100rpx;
- border: 2rpx solid #0072DB;
- border-radius: 20rpx;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #0183FA;
- line-height: 100rpx;
- text-align: center;
- margin-left: 50rpx;
- position: fixed;
- bottom:158rpx;
- z-index: 1000;
- }
- }
- </style>
|