123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529 |
- <!-- 待入库 -->
- <template>
- <view id="register">
- <view class="title">{{item.airName}}-{{item.configName}}</view>
- <view class="register_li">
- <view class="register_li_min">
- <view></view>
- <view>司机姓名:</view>
- <input v-model="infoForm.user.userName" type="text" >
- </view>
- <view class="register_li_min">
- <view></view>
- <view>司机号牌:</view>
- <input v-model="infoForm.car.carCode" type="text" >
- </view>
- <view class="register_li_min" style="border-bottom:0;">
- <view></view>
- <view>联系方式:</view>
- <input v-model="infoForm.user.phone" type="text" >
- </view>
- </view>
- <view class="register_li">
- <view class="register_li_min" v-for="(item,index) in list">
- <view></view>
- <view>{{item.name}}</view>
- <view class="radio_group">
- <view class="radio" v-for="(item2,index2) in item.radioList" @click="radioClick(item,item2)">
- <img v-if="!item2.checked" src="@/images/basicsModules/icon_5.png">
- <img v-if="item2.checked" src="@/images/basicsModules/icon_6.png">
- <text>{{item2.name}}</text>
- </view>
- </view>
- </view>
- <view class="register_li_min">
- <view>*</view>
- <view>气表压力:</view>
- <input v-model="form.gasPressure" maxlength="4" type="text" placeholder-style="color:#999;" placeholder="请输入气表压力">
- </view>
- <!-- 检验有效期 -->
- <view class="register_li_min2">
- <view><text style="color: #f00;margin-right: 10rpx;">*</text>检验有效期:</view>
- <picker mode="date" @change="startChange($event)">
- <input class="picker-text" v-model="form.validateStartTime" disabled type="text" placeholder-style="color:#999;" placeholder="开始时间">
- </picker>
- <view>-</view>
- <picker mode="date" @change="endChange($event)">
- <input class="picker-text2" v-model="form.validateEndTime" disabled type="text" placeholder-style="color:#999;" placeholder="结束时间">
- </picker>
- </view>
- <view class="register_li_min" >
- <view>*</view>
- <view>电子标签:</view>
- <input v-model="form.electronicTag" type="text" placeholder-style="color:#999;" placeholder="请输入电子标签ID">
- <img @click.stop="saoCode" class="code_img" src="@/images/basicsModules/icon_aqjc_sm.png">
- </view>
- <view class="register_li_min" style="border: none;">
- <view>*</view>
- <view>验收备注:</view>
- <input v-model="form.validateRemark" type="text" placeholder-style="color:#999;" placeholder="请输入验收备注">
- </view>
- </view>
- <view class="sub_btn">
- <view class="sub_btn_l" @click="rejection()">拒收</view>
- <view class="sub_btn_r" @click="submitForm()">确认信息并入库</view>
- </view>
- </view>
- </template>
- <script>
- import {gasApplyDetailDrkDetail,gasApplyStorageAdd} from '@/api/apiDemo/index.js'
- import { config } from '@/api/request/config.js'
- export default {
- data() {
- return {
- form:{
- gasPressure:'',
- validateStartTime:'',
- validateEndTime:'',
- electronicTag:'',
- validateRemark:'',
- },
- infoForm:{},
- item:{},
- id:{},
- list:[
- {
- id:'0',
- name:'瓶身颜色:',
- lab:'color',
- radioList:[
- {
- id:1,
- name:'灰',
- checked:true,
- },
- {
- id:2,
- name:'白',
- checked:false,
- },
- {
- id:3,
- name:'蓝',
- checked:false,
- },
- ]
- },
- {
- id:'0',
- name:'有无手轮:',
- lab:'isHandwheel',
- radioList:[
- {
- id:1,
- name:'有',
- checked:true,
- },
- {
- id:0,
- name:'无',
- checked:false,
- },
- ]
- },
- {
- id:'0',
- name:'是否固定:',
- lab:'isFixed',
- radioList:[
- {
- id:1,
- name:'是',
- checked:true,
- },
- {
- id:0,
- name:'否',
- checked:false,
- },
- ]
- },
- {
- id:'0',
- name:'电子标签:',
- lab:'isElectronicTag',
- radioList:[
- {
- id:1,
- name:'有',
- checked:true,
- },
- {
- id:0,
- name:'无',
- checked:false,
- },
- ]
- },
- {
- id:'0',
- name:'气瓶状态标牌:',
- lab:'isStatusSign',
- radioList:[
- {
- id:1,
- name:'有',
- checked:true,
- },
- {
- id:0,
- name:'无',
- checked:false,
- },
- ]
- },
- {
- id:'0',
- name:'标牌已拍照:',
- lab:'isPhoto',
- radioList:[
- {
- id:1,
- name:'有',
- checked:true,
- },
- {
- id:0,
- name:'无',
- checked:false,
- },
- ]
- },
- ]
- }
- },
- onLoad(option) {
- this.item=JSON.parse(decodeURIComponent(option.item));
- },
- onShow(){
- },
- mounted(){
- this.getInfo()
- },
- methods: {
- //开始时间选中事件
- startChange(e){
- this.form.validateStartTime=e.target.value
- },
- //结束时间选中事件
- endChange(e){
- this.form.validateEndTime=e.target.value
- },
- //单选按钮
- radioClick(p,d){
- d.checked=!d.checked
- if(d.checked){
- //如果有选中的,循环把其他选中的取消
- p.radioList.forEach(function(item){
- if(item.id==d.id){
- }else{
- item.checked=false;
- }
- })
- }else{
- }
- },
- //调用摄像头
- saoCode(){
- let _this = this;
- uni.scanCode({
- onlyFromCamera: true,
- success: function (res) {
- _this.form.electronicTag=res.result
- }
- });
- },
- //获取列表数据
- async getInfo(){
- let _this = this;
- const {data} = await gasApplyDetailDrkDetail({id:_this.item.id});
- if(data.code==200){
- if(data.code==200){
- let res = data.data;
- _this.infoForm=res
- }
- }
- },
- //拒收
- async rejection(){
- uni.redirectTo({
- url: '/pages_manage/gasBottle/gasApply/gasApplyReject?item='+encodeURIComponent(JSON.stringify(this.item))+'&item2='+encodeURIComponent(JSON.stringify(this.infoForm))
- });
- },
- //提交
- async submitForm(){
- let _this = this;
- if(!this.form.gasPressure){
- uni.showToast({
- title: '请输入气表压力',
- icon:"none",
- mask:true,
- duration: 2000
- });
- return
- }
- if(!this.form.validateStartTime || !this.form.validateEndTime){
- uni.showToast({
- title: '请选择检验有效期',
- icon:"none",
- mask:true,
- duration: 2000
- });
- return
- }
- if(!this.form.electronicTag){
- uni.showToast({
- title: '请输入电子标签',
- icon:"none",
- mask:true,
- duration: 2000
- });
- return
- }
- if(!this.form.validateRemark){
- uni.showToast({
- title: '请输入验收备注',
- icon:"none",
- mask:true,
- duration: 2000
- });
- return
- }
- _this.list.forEach(function(item){
- item.radioList.forEach(function(item2){
- if(item.lab=='color' && item2.checked){
- _this.form.color=item2.id;
- }else if(item.lab=='isHandwheel' && item2.checked){
- _this.form.isHandwheel=item2.id;
- }else if(item.lab=='isFixed' && item2.checked){
- _this.form.isFixed=item2.id;
- }else if(item.lab=='isElectronicTag' && item2.checked){
- _this.form.isElectronicTag=item2.id;
- }else if(item.lab=='isStatusSign' && item2.checked){
- _this.form.isStatusSign=item2.id;
- }else if(item.lab=='isPhoto' && item2.checked){
- _this.form.isPhoto=item2.id;
- }
- })
- })
- _this.form.driverName=_this.infoForm.user.userName
- _this.form.driverId=_this.infoForm.user.id
- _this.form.carCode=_this.infoForm.car.carCode
- _this.form.carCodeId =_this.infoForm.car.id
- _this.form.phone=_this.infoForm.user.phone
- _this.form.airStatus=0;
- _this.form.taskId=_this.item.taskId;
- _this.form.taskDetailId=_this.item.id;
- _this.form.airName=_this.item.airName;
- _this.form.parent=_this.item.parent;
- _this.form.specValue=_this.item.specValue;
- _this.form.configName=_this.item.configName;
- _this.form.companyName=_this.item.companyName;
- _this.form.airConstituents=_this.item.airConstituents;
- _this.form.airBottleConfigId=_this.item.airBottleConfigId;
- _this.form.airBottleId =_this.item.airBottleId;
- const {data} = await gasApplyStorageAdd(_this.form);
- if(data.code == 200){
- uni.showToast({
- title: '提交成功',
- icon:"none",
- mask:true,
- duration: 2000
- });
- setTimeout(function(){
- uni.redirectTo({
- url: '/pages_manage/gasBottle/gasApply/gasApply'
- });
- },2000);
- }
- },
- }
- }
- </script>
- <style lang="stylus" scoped>
- #register{
- height:auto;
- width:100%;
- display flex
- flex-direction column;
- padding-bottom: 220rpx;
- .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;
- view{
- line-height:100rpx;
- font-size:28rpx;
- }
- view:nth-child(1){
- color:red;
- line-height:28rpx;
- margin-right: 12rpx;
- }
- view:nth-child(2){
- //width:140rpx;
- flex: 1;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- }
- .picker-text{
- text-align: right;
- font-size: 28rpx;
- }
- >input{
- width 400rpx;
- text-align: right;
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- }
- .code_img{
- width: 30rpx;
- height: 28rpx;
- margin-left: 26rpx;
- }
- /* 单选按钮 */
- .radio_group{
- display: flex;
- .radio{
- display: flex;
- margin-left: 80rpx;
- margin-right: 0;
- >img{
- width: 30rpx;
- height: 30rpx;
- }
- >text{
- margin-left: 34rpx;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- line-height: 28rpx;
- }
- }
- }
- }
- /* 时间 */
- .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: #333333;
- line-height: 100rpx;
- margin-right: 96rpx;
- }
- .picker-text{
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- line-height: 100rpx;
- width: 188rpx;
- }
- >view:nth-child(2){
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- line-height: 100rpx;
- }
- .picker-text2{
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- line-height: 100rpx;
- width: 188rpx;
- text-align: right;
- }
- }
- }
- /* 按钮 */
- .sub_btn{
- width: 650rpx;
- height: 100rpx;
- display: flex;
- position: fixed;
- bottom: 30rpx;
- left: 50rpx;
- z-index: 1000;
- .sub_btn_l{
- width: 325rpx;
- height: 100rpx;
- background: linear-gradient(-45deg, #FA9901, #F28E26);
- border-radius: 50rpx 0px 0px 50rpx;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #FFFFFF;
- line-height: 100rpx;
- text-align: center;
- }
- .sub_btn_r{
- width: 325rpx;
- height: 100rpx;
- background: linear-gradient(-35deg, #309CFF, #0183FA);
- border-radius: 0px 50rpx 50rpx 0px;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #FFFFFF;
- line-height: 100rpx;
- text-align: center;
- }
- }
- }
- /deep/.input-value-border{
- display :none !important;
- }
- </style>
|