123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242 |
- <template>
- <view>
- <image src="https://cczdsz.cn/app/images/background.png" class="background"></image>
- <view class="project-content">
- <u-form :model="form" ref="form">
- <view class="top">
- <u-icon class="top-icon" name="map-fill"></u-icon>
- <u-form-item label=" " borderBottom ref="item1" placeholder=" " labelWidth="20" label-align="left">
- <u-input v-model="communityName" disabled placeholder=" " disabled trim="false"></u-input>
- </u-form-item>
- <u-icon class="top-icon" name="calendar"></u-icon>
- <u-form-item label=" " borderBottom ref="item1" placeholder=" " labelWidth="20">
- <u-input v-model="time" disabled style="font-size: 2rpx" length='30px' trim="true"
- placeholder=" "></u-input>
- </u-form-item>
- </view>
- <view class="small-title">调压箱部分</view>
- <u-row gutter="12">
- <u-col>
- <u-form-item label="管理所" borderBottom ref="item1" labelWidth="140">
- <u-input v-model="AdministrativeOfficeLabel" placeholder="请输入管理所名称"
- disabled borderBottom @click="showadministrativeOffice= true&&type!=1"></u-input>
- <!-- <u-select v-model="showadministrativeOffice" :list="AdministrativeOfficeList" label-name="name"
- value-name="value" @confirm="AdministrativeOffice()" disabled> </u-select>
- <u-icon slot="right" name="arrow-right"></u-icon> -->
- </u-form-item>
- </u-col>
- <u-col>
- <u-form-item label="编号" borderBottom ref="item1" labelWidth="140">
- <u-input :disabled="type==1" v-model="form.number" placeholder="请输入编号" ></u-input>
- </u-form-item>
- </u-col>
- <u-col>
- <u-form-item label="商服" borderBottom ref="item1" placeholder="请输入编号" labelWidth="140">
- <u-radio-group v-model="form.businessService" :disabled="type==1">
- <u-radio @change="businessService" v-for="(item, index) in typelist.business_service" :key="index"
- :name="item.dictValue">
- {{item.dictLabel}}
- </u-radio>
- </u-radio-group>
- </u-form-item>
- </u-col>
- <u-col>
- <u-form-item label="外观" borderBottom ref="item1" placeholder="请输入编号" labelWidth="140">
- <u-radio-group v-model="form.appearance" :disabled="type==1">
- <u-radio @change="appearance" v-for="(item, index) in typelist.appearance" :key="index"
- :name="item.dictValue">
- {{item.dictLabel}}
- </u-radio>
- </u-radio-group>
- </u-form-item>
- </u-col>
- <u-col>
- <u-form-item label="方砖" borderBottom ref="item1" placeholder="请输入编号" labelWidth="140">
- <u-radio-group v-model="form.squareBrick" :disabled="type==1">
- <u-radio @change="squareBrick" v-for="(item, index) in typelist.square_brick"
- :key="index" :name="item.dictValue">
- {{item.dictLabel}}
- </u-radio>
- </u-radio-group>
- </u-form-item>
- </u-col>
- <u-col>
- <u-form-item label="护栏" borderBottom ref="item1" placeholder="请输入编号" labelWidth="140">
- <u-radio-group v-model="form.guardrail" :disabled="type==1">
- <u-radio @change="guardrail" v-for="(item, index) in typelist.guardrail" :key="index"
- :name="item.dictValue">
- {{item.dictLabel}}
- </u-radio>
- </u-radio-group>
- </u-form-item>
- </u-col>
- <u-col>
- <u-form-item label="基础" borderBottom ref="item1" placeholder="请输入编号" labelWidth="140">
- <u-radio-group v-model="form.foundation" :disabled="type==1">
- <u-radio @change="foundation" v-for="(item, index) in typelist.foundation" :key="index"
- :name="item.dictValue">
- {{item.dictLabel}}
- </u-radio>
- </u-radio-group>
- </u-form-item>
- </u-col>
- <u-col>
- <u-form-item label="压力表" borderBottom ref="item1" placeholder="请输入编号" labelWidth="140">
- <u-radio-group v-model="form.pressureGage" :disabled="type==1">
- <u-radio @change="pressureGage" v-for="(item, index) in typelist.pressure_gage"
- :key="index" :name="item.dictValue">
- {{item.dictLabel}}
- </u-radio>
- </u-radio-group>
- </u-form-item>
- </u-col>
- <u-col>
- <u-form-item label="阀门" borderBottom ref="item1" placeholder="请输入编号" labelWidth="140">
- <u-radio-group v-model="form.valve" :disabled="type==1">
- <u-radio @change="valve" v-for="(item, index) in typelist.valve" :key="index"
- :name="item.dictValue">
- {{item.dictLabel}}
- </u-radio>
- </u-radio-group>
- </u-form-item>
- </u-col>
- <u-col>
- <u-form-item label="是否泄露" borderBottom ref="item1" placeholder="请输入编号" labelWidth="140">
- <u-radio-group v-model="form.isThereALeak" :disabled="type==1">
- <u-radio @change="isThereALeak" v-for="(item, index) in typelist.yes_and_no"
- :key="index" :name="item.dictValue">
- {{item.dictLabel}}
- </u-radio>
- </u-radio-group>
- </u-form-item>
- </u-col>
- <u-col>
- <u-form-item label="调压器" borderBottom ref="item1" placeholder="请输入编号" labelWidth="140">
- <u-radio-group v-model="form.voltageRegulator" :disabled="type==1">
- <u-radio @change="voltageRegulator" v-for="(item, index) in typelist.voltage_regulator"
- :key="index" :name="item.dictValue">
- {{item.dictLabel}}
- </u-radio>
- </u-radio-group>
- </u-form-item>
- </u-col>
- <u-col>
- <u-form-item label="过滤器" borderBottom ref="item1" placeholder="请输入编号" labelWidth="120">
- <u-radio-group v-model="form.filter" :disabled="type==1">
- <u-radio @change="filter" v-for="(item, index) in typelist.filter" :key="index"
- :name="item.dictValue">
- {{item.dictLabel}}
- </u-radio>
- </u-radio-group>
- </u-form-item>
- </u-col>
- </u-row>
- <u-row class="un-row" gutter="12" style="text-align:left;">
- <u-col span="10">
- <u-form-item label="入口压力" borderBottom ref="item1" placeholder="请输入编号" labelWidth="140">
- <u-input v-model="form.inletPressure" length='20px' placeholder="请输入入口压力"
- :disabled="type==1" type="digit" :clearable="false" @input="checkinletPressure"></u-input>
- </u-form-item>
- </u-col>
- <u-col span="2">
- <viwe class="danwei">Mpa</viwe>
- </u-col>
- </u-row>
- <u-row gutter="12">
- <u-col span="5">
- <u-form-item label="出口压力 主路" borderBottom ref="item1" placeholder=" " labelWidth="200">
- <u-input v-model="form.exportPressureMain" placeholder=" " :disabled="type==1" type="digit" :clearable="false" @input="checkexportPressureMain"></u-input>
- </u-form-item>
- </u-col>
- <u-col span="2">
- <viwe class="danwei">KPa</viwe>
- </u-col>
- <u-col span="3">
- <u-form-item label="副路" borderBottom ref="item1" placeholder=" " labelWidth="80">
- <u-input v-model="form.exportPressureAccessory" length='20px' trim="false" aceholder=""
- :disabled="type==1" type="digit" :clearable="false" @input="checkexportPressureAccessory"></u-input>
- </u-form-item>
- </u-col>
- <u-col span="1">
- <viwe class="danwei">KPa</viwe>
- </u-col>
- </u-row>
- <u-row gutter="12">
- <u-col span="5">
- <u-form-item label="关闭压力 主路" borderBottom ref="item1" placeholder=" " labelWidth="200">
- <u-input v-model="form.closingPressureMain" placeholder=" " trim="false"
- :disabled="type==1" type="digit" :clearable="false" @input="checkclosingPressureMain"></u-input>
- </u-form-item>
- </u-col>
- <u-col span="2">
- <viwe class="danwei">KPa</viwe>
- </u-col>
- <u-col span="3">
- <u-form-item label="副路" borderBottom ref="item1" placeholder=" " labelWidth="80">
- <u-input v-model="form.closingPressureAccessory" length='20px' trim="false" placeholder=" "
- :disabled="type==1" type="digit" :clearable="false" @input="checkclosingPressureAccessory"></u-input>
- </u-form-item>
- </u-col>
- <u-col span="1">
- <viwe class="danwei">KPa</viwe>
- </u-col>
- </u-row>
- <u-row>
- <u-col>
- <u-form-item label="是否开启伴热带" labelWidth="140" borderBottom ref="item1">
- <u-radio-group v-model="form.isNotXtv" :disabled="type==1">
- <u-radio @change="isNotXtv"
- v-for="(item, index) in typelist.on_off" :key="index"
- :name="item.dictValue">
- {{item.dictLabel}}
- </u-radio>
- </u-radio-group>
- </u-form-item>
- </u-col>
- <u-col>
- <u-form-item label="伴热带" labelWidth="140" borderBottom ref="item1">
- <u-radio-group v-model="form.xtv" :disabled="type==1">
- <u-radio @change="xtv"
- v-for="(item, index) in typelist.xtv" :key="index"
- :name="item.dictValue">
- {{item.dictLabel}}
- </u-radio>
- </u-radio-group>
- </u-form-item>
- </u-col>
- <u-col>
- <u-form-item label="有无温控器" borderBottom ref="item1" placeholder="" labelWidth="180">
- <u-radio-group v-model="form.thermostat" :disabled="type==1">
- <u-radio @change="thermostat"
- v-for="(item, index) in typelist.yes_or_no" :key="index"
- :name="item.dictValue">
- {{item.dictLabel}}
- </u-radio>
- </u-radio-group>
- </u-form-item>
- </u-col>
- <u-col>
- <u-form-item label="有无防爆开关" borderBottom ref="item1" placeholder="" labelWidth="180">
- <u-radio-group v-model="form.explosionProofSwitch" :disabled="type==1">
- <u-radio @change="explosionProofSwitch"
- v-for="(item, index) in typelist.yes_or_no" :key="index"
- :name="item.dictValue">
- {{item.dictLabel}}
- </u-radio>
- </u-radio-group>
- </u-form-item>
- </u-col>
- </u-row>
- <view class="small-title">切断器测证部分</view>
- <u-row>
- <u-col>
- <u-form-item label="切断器测试" borderBottom ref="item1" placeholder="" labelWidth="200">
- <u-radio-group v-model="form.cutterTested" :disabled="type==1">
- <u-radio @change="cutterTested"
- v-for="(item, index) in typelist.cutoff_test_certification" :key="index"
- :name="item.dictValue">
- {{item.dictLabel}}
- </u-radio>
- </u-radio-group>
- </u-form-item>
- </u-col>
- <u-col>
- <u-form-item label="切断器(放散阀)测试情况" borderBottom ref="item1" placeholder="" labelWidth="320" v-if="form.cutterTested==1">
- <u-radio-group v-model="form.disconnectorTestStatus" :disabled="type==1">
- <u-radio @change="disconnectorTestStatus"
- v-for="(item, index) in typelist.disconnector_test_status" :key="index"
- :name="item.dictValue">
- {{item.dictLabel}}
- </u-radio>
- </u-radio-group>
- </u-form-item>
- </u-col>
- </u-row>
- <u-row gutter="12">
- <u-col span="5">
- <u-form-item label="切断压力 主路" borderBottom ref="item1" placeholder=" " labelWidth="200" v-if="form.cutterTested==1">
- <u-input v-model="form.cutOffPressureMain" placeholder=" " :disabled="type==1" type="digit" :clearable="false" @input="checkcutOffPressureMain"></u-input>
- </u-form-item>
- </u-col>
- <u-col span="2" v-if="form.cutterTested==1">
- <viwe class="danwei" >KPa</viwe>
- </u-col>
- <u-col span="3">
- <u-form-item label="副路" borderBottom ref="item1" placeholder="" labelWidth="80" v-if="form.cutterTested==1">
- <u-input v-model="form.cutOffPressureAccessory" length='20px' placeholder="请输入副路"
- :disabled="type==1" type="digit" :clearable="false" @input="checkcutOffPressureAccessory"></u-input>
- </u-form-item>
- </u-col>
- <u-col span="1" v-if="form.cutterTested==1">
- <viwe class="danwei">KPa</viwe>
- </u-col>
- </u-row>
- <u-row gutter="12" style="text-align: center;">
- <u-col span="10">
- <u-form-item label="放散压力" borderBottom ref="item1" placeholder="请输入放散压力" labelWidth="140" v-if="form.cutterTested==1">
- <u-input v-model="form.releasePressure" length='20px' placeholder="请输入放散压力"
- :disabled="type==1" type="digit" :clearable="false" @input="checkreleasePressure"></u-input>
- </u-form-item>
- </u-col>
- <u-col span="2" v-if="form.cutterTested==1">
- <viwe class="danwei" >Kpa</viwe>
- </u-col>
- </u-row>
- <view class="small-title">主副路交替部分</view>
- <u-row>
- <u-col>
- <u-form-item label="是否交替" borderBottom ref="item1" placeholder="请输入编号" labelWidth="200">
- <u-radio-group v-model="form.manOfAccessoryAlternating" :disabled="type==1">
- <u-radio @change="manOfAccessoryAlternating" v-for="(item, index) in typelist.secondary_roads" :key="index"
- :name="item.dictValue">
- {{item.dictLabel}}
- </u-radio>
- </u-radio-group>
- </u-form-item>
- </u-col>
- </u-row>
- <u-row gutter="12" style="text-align: center;" v-if="form.manOfAccessoryAlternating==1">
- <u-col span="12">
- <u-form-item label="操作结果主副路已交替完毕,现" borderBottom ref="item1" placeholder="请输入编号"
- labelWidth="420">
- <u-input v-model="form.mainRoad" length='20px' placeholder="请输入"
- :disabled="type==1"></u-input>
- </u-form-item>
- </u-col>
- <u-col span="12">
- <viwe class="danwei">路为主路</viwe>
- </u-col>
- </u-row>
- <view class="small-title">特殊情况说明</view>
- <u-row>
- <u-col>
- <u-form-item label="调压设施特例" borderBottom ref="item1" placeholder="请输入编号" labelWidth="200">
- <u-radio-group v-model="form.specialCaseOfPressureRegulatingFacilities" :disabled="type==1">
- <u-radio @change="specialCaseOfPressureRegulatingFacilities"
- v-for="(item, index) in typelist.special_case_of_pressure_regulating_facilities"
- :key="index" :name="item.dictValue">
- {{item.dictLabel}}
- </u-radio>
- </u-radio-group>
- </u-form-item>
- </u-col>
- <u-col>
- <u-form-item label="超期巡检天数" borderBottom ref="item1" placeholder="请输入编号" labelWidth="200">
- <u-radio-group v-model="form.overdueInspectionDays" :disabled="type==1">
- <u-radio @change="overdueInspectionDays"
- v-for="(item, index) in typelist.overdue_inspection_days" :key="index"
- :name="item.dictValue">
- {{item.dictLabel}}
- </u-radio>
- </u-radio-group>
- </u-form-item>
- </u-col>
- <!-- <u-col>
- <u-form-item label="超期巡检原因" borderBottom ref="item1" placeholder="请输入编号" labelWidth="200">
- <u-radio-group v-model="form.reasonForOverdueInspection" :disabled="type==1">
- <u-radio @change="reasonForOverdueInspection"
- v-for="(item, index) in typelist.reason_for_overdue_inspection" :key="index"
- :name="item.dictValue">
- {{item.dictLabel}}
- </u-radio>
- </u-radio-group>
- </u-form-item>
- </u-col> -->
- <u-col>
- <u-form-item label="超期巡检原因" borderBottom ref="item1" labelWidth="200" v-if="form.overdueInspectionDays!=undefined&&form.overdueInspectionDays!=3">
- <u-input v-model="form.reasonForOverdueInspection" placeholder="请输入超期巡检原因"
- :disabled="type==1"></u-input>
- </u-form-item>
- </u-col>
- </u-row>
- <!-- <view class="small-title">阀井测试部分</view>
- <u-row>
- <u-col>
- <u-form-item label="未测试" borderBottom ref="item1" placeholder="请输入编号" labelWidth="120">
- <u-switch v-model="form.valveWellTesting" :disabled="type==1"></u-switch>
- </u-form-item>
- </u-col>
- <u-col>
- <u-form-item label="阀井情况" labelWidth="140" borderBottom ref="item1">
- <u-input v-model="valveWellConditioLabel" disabled
- @click=" showvalveWellCondition= true&& type!=1" borderBottom
- placeholder="请选择阀井情况"></u-input>
- <u-select v-model="showvalveWellCondition" :list="typelist.valve_well_condition"
- @confirm="valveWellCondition()" label-name="dictLabel" value-name="dictValue">
- </u-select>
- <u-icon slot="right" name="arrow-right"></u-icon>
- </u-form-item>
- </u-col>
- </u-row> -->
- <view class="small-title">备注信息</view>
- <u-row>
- <u-col>
- <u-form-item label=" " labelWidth="0" borderBottom ref="item1">
- <u-input v-model="form.remarks" type="textarea" borderBottom placeholder="请填写备注信息内容"
- :disabled="type==1"></u-input>
- </u-form-item>
- </u-col>
- <u-col>
- <u-form-item label=" " labelWidth="0" borderBottom ref="item1">
- <u-input v-model="form.WarningColumnInformation" disabled placeholder="请上传巡检照片"></u-input>
- <view class="" style="display: flex; flex-wrap: wrap; margin: 0 55rpx;">
- <image src="https://cczdsz.cn/app/images/chooseimg.png" mode=""
- style="width: 190rpx; height: 190rpx; margin: 0 12rpx; " @click="choose()"
- v-if="type!=1"></image>
- <view v-for="(item,index) in imgymxs" :key="index" style="position: relative;">
- <view v-if="item.type == 'image'">
- <image :src="item.url" mode=""
- style="width: 190rpx; height: 190rpx; margin: 0 20rpx;"
- @click="showPhoto(index)">
- </image>
- </view>
- <view v-else>
- <video :src="item"
- style="width: 190rpx; height: 190rpx; margin: 0 20rpx;"></video>
- </view>
- <view @click="remove(index)" v-if="type!=1"
- style="position: absolute; top: 0; right: 14rpx; border-radius: 50%; background-color: #FF0000;">
- <u-icon name="close" color="#FFFFFF" size="35" v-if="type!=1"></u-icon>
- </view>
- </view>
- </view>
- </u-form-item>
- </u-col>
- </u-row>
- </u-form>
- <u-button class="from-but" style="margin: 40rpx 0;" @click="save()" v-if="type!=1"
- type='primary'>确认上传</u-button>
- </view>
- </u-form>
- </view>
- </view>
- </template>
- <script>
- import service from '@/api/index.js'
- export default {
- data() {
- return {
- action: this.$HTTP.webUrl + `/obs`,
- headers: {
- MAuthorization: "wxBearer " + uni.getStorageSync('token')
- },
- url: [],
- showadministrativeOffice:false,
- uploading: false,
- imgArr: [],
- PhotoList: [],
- community: '',
- building: '',
- unit: '',
- imgymxs: [],
- progress: 0, //图片或视频上传百分比
- showxtv: false,
- showvalveWellCondition: false,
- form: {
- businessService:0,
- administrativeOffice:0,
- businessService:0,
- isNotXtv:null,
- appearance:0,
- squareBrick:0,
- foundation:0,
- pressureGage:0,
- valve:0,
- isThereALeak:0,
- voltageRegulator:0,
- xtv:0,
- thermostat:0,
- explosionProofSwitch:0,
- cutterTested:0,
- manOfAccessoryAlternating:0,
- filter:0,
- specialCaseOfPressureRegulatingFacilities:0,
- overdueInspectionDays:3,
- valveWellTesting:true,
- guardrail:0
- },
- xtvLabel: null,
- valveWellConditioLabel: null,
- // 表单校验
- rules: {
- areaId: [{
- required: true,
- message: "所属小区不能为空",
- trigger: "blur"
- }],
- buildingId: [{
- required: true,
- message: "所属楼宇不能为空",
- trigger: "blur"
- }],
- unitId: [{
- required: true,
- message: "单元id不能为空",
- trigger: "change"
- }],
- number: [{
- required: true,
- message: "编号不能为空",
- trigger: "blur"
- }],
- businessService: [{
- required: true,
- message: "商服不能为空",
- trigger: "blur"
- }],
- appearance: [{
- required: true,
- message: "外观不能为空",
- trigger: "change"
- }],
- squareBrick: [{
- required: true,
- message: "方砖不能为空",
- trigger: "change"
- }],
- guardrail: [{
- required: true,
- message: "护栏不能为空",
- trigger: "change"
- }],
- foundation: [{
- required: true,
- message: "基础不能为空",
- trigger: "change"
- }],
- pressureGage: [{
- required: true,
- message: "压力表不能为空",
- trigger: "change"
- }],
- mainRoad: [{
- required: true,
- message: "当前主路不能为空",
- trigger: "change"
- }],
- valve: [{
- required: true,
- message: "阀门不能为空",
- trigger: "change"
- }],
- isThereALeak: [{
- required: true,
- message: "是否泄露不能为空",
- trigger: "blur"
- }],
- voltageRegulator: [{
- required: true,
- message: "调压器不能为空",
- trigger: "change"
- }],
- inletPressure: [{
- required: true,
- message: "入口压力不能为空",
- trigger: "blur"
- }],
- exportPressureMain: [{
- required: true,
- message: "出口压力(主路)不能为空",
- trigger: "blur"
- }],
- exportPressureAccessory: [{
- required: true,
- message: "出口压力(副路)不能为空",
- trigger: "blur"
- }],
- closingPressureMain: [{
- required: true,
- message: "关闭压力(主路)不能为空",
- trigger: "blur"
- }],
- closingPressureAccessory: [{
- required: true,
- message: "关闭压力(副路)不能为空",
- trigger: "blur"
- }],
- xtv: [{
- required: true,
- message: "伴热带不能为空",
- trigger: "change"
- }],
- isNotXtv: [{
- required: true,
- message: "是否开启伴热带不能为空",
- trigger: "change"
- }],
- thermostat: [{
- required: true,
- message: "有无控温器不能为空",
- trigger: "blur"
- }],
- explosionProofSwitch: [{
- required: true,
- message: "有无防爆开关不能为空",
- trigger: "blur"
- }],
- cutterTested: [{
- required: true,
- message: "切断器测试不能为空",
- trigger: "blur"
- }],
- disconnectorTestStatus: [{
- required: true,
- message: "切断器(放散阀)测试情况不能为空",
- trigger: "change"
- }],
- cutOffPressureMain: [{
- required: true,
- message: "切断压力(主路)不能为空",
- trigger: "blur"
- }],
- cutOffPressureAccessory: [{
- required: true,
- message: "切断压力(副路)不能为空",
- trigger: "blur"
- }],
- releasePressure: [{
- required: true,
- message: "放散压力不能为空",
- trigger: "blur"
- }],
- manOfAccessoryAlternating: [{
- required: true,
- message: "主副路交替不能为空",
- trigger: "blur"
- }],
- filter: [{
- required: true,
- message: "过滤器不能为空",
- trigger: "change"
- }],
- specialCaseOfPressureRegulatingFacilities: [{
- required: true,
- message: "调压设施特例不能为空",
- trigger: "change"
- }],
- overdueInspectionDays: [{
- required: true,
- message: "超期巡检天数不能为空",
- trigger: "change"
- }],
- reasonForOverdueInspection: [{
- required: true,
- message: "超期巡检原因不能为空",
- trigger: "change"
- }],
- otherReasonsForOverdueInspection: [{
- required: true,
- message: "超期巡检其他原因不能为空",
- trigger: "blur"
- }],
- valveWellTesting: [{
- required: true,
- message: "阀井测试不能为空",
- trigger: "blur"
- }],
- valveWellCondition: [{
- required: true,
- message: "阀井情况不能为空",
- trigger: "change"
- }]
- },
- communityName: '',
- communityId:'',
- time: '',
- showrepairType: false,
- showrepairType: null,
- checked: true,
- typelist: {},
- dictlist: ['appearance', 'square_brick', 'guardrail', 'foundation', 'pressure_gage', 'valve',
- 'voltage_regulator', 'xtv', 'disconnector_test_status', 'filter','cutoff_test_certification','secondary_roads',
- 'special_case_of_pressure_regulating_facilities', 'overdue_inspection_days',
- 'reason_for_overdue_inspection', 'valve_well_condition', 'find_problem', 'on_off','administrative_office','yes_and_no','business_service','yes_or_no'
- ],
- type: 2,
- id: null,
- AdministrativeOfficeList:[],
- AdministrativeOfficeLabel:null,
- userId:null,createBy:null,
- administrativeOffice:null,
- code:null,
- name:null
- }
- },
- // onReady() {
- // uni.setNavigationBarTitle({
- // title: '调压箱表单'
- // });
- // },
- showPhoto(index) {
- uni.previewImage({
- current: index,
- urls: this.imgArr,
- })
- },
- showPhotos(index) {
- uni.previewImage({
- current: index,
- urls: this.photo,
- })
- },
- onLoad(e) {
- uni.setNavigationBarTitle({
- title: '调压箱表单'
- });
- uni.setNavigationBarColor({
- frontColor: '#ffffff',
- backgroundColor: '#2d95f4',
- })
- let time1 = new Date()
- console.log(time1.toLocaleString())
- var year = time1.getFullYear(); //得到年份
- var month = time1.getMonth() + 1; //得到月份
- var date = time1.getDate(); //得到日期
- var hours = time1.getHours(); //获取系统时
- var Min = time1.getMinutes(); //分
- this.type = e.type
- this.id = e.id
- this.time = year + "/" + month + "/" + date + "-" + hours + ":" + Min
- this.getdictsysinfo()
- this.getUserName()
- this.form.areaId = e.id
- this.communityId=e.id
- this.communityName = e.name
- this.form.number=e.number
- this.administrativeOffice=e.managementOffice
- this.form.administrativeOffice=e.managementOffice
- this.form.name=e.name
- this.name=e.name
- this.code=e.number
- //this.getAdministrativeOffice(this.userId)
- },
- methods: {
- checkinletPressure(e) {
- console.log(e)
- //正则表达试
- e = (e.match(/^\d*(\.?\d{0,2})/g)[0]) || null
- //重新赋值给input
- this.$nextTick(() => {
- this.form.inletPressure= e
- })
- },
- checkexportPressureMain(e) {
- console.log(e)
- //正则表达试
- e = (e.match(/^\d*(\.?\d{0,2})/g)[0]) || null
- //重新赋值给input
- this.$nextTick(() => {
- this.form.exportPressureMain= e
- })
- },
- checkclosingPressureAccessory(e) {
- console.log(e)
- //正则表达试
- e = (e.match(/^\d*(\.?\d{0,2})/g)[0]) || null
- //重新赋值给input
- this.$nextTick(() => {
- this.form.closingPressureAccessory= e
- })
- },
- checkexportPressureAccessory(e) {
- console.log(e)
- //正则表达试
- e = (e.match(/^\d*(\.?\d{0,2})/g)[0]) || null
- //重新赋值给input
- this.$nextTick(() => {
- this.form.exportPressureAccessory= e
- })
- },
- checkclosingPressureMain(e) {
- console.log(e)
- //正则表达试
- e = (e.match(/^\d*(\.?\d{0,2})/g)[0]) || null
- //重新赋值给input
- this.$nextTick(() => {
- this.form.closingPressureMain= e
- })
- },
- checkcutOffPressureMain(e) {
- console.log(e)
- //正则表达试
- e = (e.match(/^\d*(\.?\d{0,2})/g)[0]) || null
- //重新赋值给input
- this.$nextTick(() => {
- this.form.cutOffPressureMain= e
- })
- },
- checkcutOffPressureAccessory(e) {
- console.log(e)
- //正则表达试
- e = (e.match(/^\d*(\.?\d{0,2})/g)[0]) || null
- //重新赋值给input
- this.$nextTick(() => {
- this.form.cutOffPressureAccessory= e
- })
- },
- checkreleasePressure(e) {
- console.log(e)
- //正则表达试
- e = (e.match(/^\d*(\.?\d{0,2})/g)[0]) || null
- //重新赋值给input
- this.$nextTick(() => {
- this.form.releasePressure= e
- })
- },
- getUserName(){
- service.getUserName().then(res=>{
- this.userId=res.id
- this.createBy=res.name
- this.getAdministrativeOffice(res.id)
- console.log(this.communityName)
- })
- },
- getAdministrativeOffice(userId){
- service.getAdministrativeOffice({userId:userId}).then(res=>{
- this.AdministrativeOfficeList=res
- if(this.type!=1)
- {
- this.AdministrativeOfficeLabel=this.AdministrativeOfficeList.filter(item=>item.value==this.administrativeOffice)[0].name
- }
- })
- },
- getdictsysinfo() {
- let _this = this
- service.getDictInfoList({
- type: this.dictlist
- }).then(res => {
- _this.typelist = res
- if (this.type == 1) {
- service.getregulatorBox(this.id).then(res => {
- this.communityName = res.name
- this.time = res.createTime
- if (null != res.photoList) {
- res.photoList.forEach(item => {
- let url = {}
- url.url = item
- url.type = 'image'
- this.imgymxs.push(url)
- })
- }
- let list = []
- list = _this.typelist.xtv
- list.forEach((item) => {
- if (item.dictValue == res.xtv) {
- _this.xtvLabel = item.dictLabel
- }
- })
- let list2 = []
- list2 = _this.typelist.valve_well_condition
- list2.forEach((item) => {
- if (item.dictValue == res.valveWellCondition) {
- _this.valveWellConditioLabel = item.dictLabel
- }
- })
- let list3 = []
- list3 = _this.typelist.administrative_office
- list3.forEach((item) => {
- if (item.dictValue == res.administrativeOffice) {
- _this.AdministrativeOfficeLabel = item.dictLabel
- }
- })
- this.form = res
- })
- console.log(res)
- }
- })
- },
- //外观
- appearance(e) {
- this.$refs.form.appearance = e
- console.log(e)
- },
- explosionProofSwitch(e)
- {
- this.$refs.form.explosionProofSwitch = e
- console.log(e)
- },
- thermostat(e)
- {
- this.$refs.form.thermostat = e
- console.log(e)
- },
- businessService(e)
- {
- this.$refs.form.businessService = e
- console.log(e)
- },
- //方砖
- squareBrick(e) {
- this.$refs.form.squareBrick = e
- console.log(e)
- },
- //护栏
- guardrail(e) {
- this.$refs.form.guardrail = e
- console.log(e)
- },
- //基础
- foundation(e) {
- this.$refs.form.foundation = e
- console.log(e)
- },
- //压力表
- pressureGage(e) {
- this.$refs.form.pressureGage = e
- console.log(e)
- },
- //阀门
- valve(e) {
- this.$refs.form.valve = e
- console.log(e)
- },
- //调压器
- voltageRegulator(e) {
- this.$refs.form.voltageRegulator = e
- console.log(e)
- },
- isThereALeak(e)
- {
- this.$refs.form.isThereALeak = e
- console.log(e)
- },
- //切断器(放散阀)测试情况
- disconnectorTestStatus(e) {
- this.$refs.form.disconnectorTestStatus = e
- console.log(e)
- },
- cutterTested(e)
- {
- this.$refs.form.cutterTested = e
- console.log(e)
- },
- //过滤器
- filter(e) {
- this.$refs.form.filter = e
- console.log(e)
- },
- manOfAccessoryAlternating(e)
- {
- this.$refs.form.manOfAccessoryAlternating = e
- console.log(e)
- },
- specialCaseOfPressureRegulatingFacilities(e) {
- this.$refs.form.specialCaseOfPressureRegulatingFacilities = e
- console.log(e)
- },
- overdueInspectionDays(e) {
- this.$refs.form.overdueInspectionDays = e
- console.log(e)
- },
- reasonForOverdueInspection(e) {
- this.$refs.form.reasonForOverdueInspection = e
- console.log(e)
- },
- isNotXtv(e) {
- this.$refs.form.isNotXtv = e
- },
- xtv(e) {
- this.$refs.form.xtv = e
- },
- AdministrativeOffice(e)
- {
- this.form.administrativeOffice=e[0].value
- this.AdministrativeOfficeLabel = e[0].label
- console.log('11111',e)
- },
- valveWellCondition(e) {
- this.form.valveWellCondition = e[0].value
- this.valveWellConditioLabel = e[0].label
- console.log(this.$refs.form.valveWellCondition)
- },
- save() {
- let _this = this
- if(this.imgArr.length==0){
- this.$UTILS.showPrompt('请上传照片或视频!')
- return
- }
- if(this.form.isNotXtv==null){
- this.$UTILS.showPrompt('请选择是否开启伴热带!')
- return
- }
- this.form.photoList = this.imgArr
- this.form.unitId = this.unit
- this.form.areaId = this.id
- this.form.userId=this.userId
- this.form.createBy=this.userId
- this.form.name=this.name
- // this.form.administrativeOffice=this.administrativeOffice
- // this.form.code=this.code
- // this.form.name=this.name
- // this.form.number=this.code
- service.setregulatorBox(this.form).then(res => {
- console.log(res)
- _this.$UTILS.showPrompt('上报成功!')
- // setTimeout(() => {
- // console.log('跳')
- // uni.switchTab({
- // url: '/pages/index/index'
- // })
- // }, 2000)
- this.form={businessService:0,
- administrativeOffice:0,
- businessService:0,
- isNotXtv:null,
- appearance:0,
- squareBrick:0,
- foundation:0,
- pressureGage:0,
- valve:0,
- isThereALeak:0,
- voltageRegulator:0,
- xtv:0,
- thermostat:0,
- explosionProofSwitch:0,
- cutterTested:0,
- manOfAccessoryAlternating:0,
- filter:0,
- specialCaseOfPressureRegulatingFacilities:0,
- overdueInspectionDays:3,
- valveWellTesting:true,
- guardrail:0}
- this.AdministrativeOfficeLabel=this.AdministrativeOfficeList.filter(item=>item.value==this.administrativeOffice)[0].name
- this.valveWellConditioLabel=''
- this.xtvLabel=''
- this.valveWellConditioLabel=''
- //this.AdministrativeOfficeLabel=''
- this.form.administrativeOffice=this.administrativeOffice
- this.form.number=this.code
- this.imgArr=[]
- this.imgymxs=[]
- })
- },
- choose() {
- let _this = this;
- uni.showActionSheet({
- title: '上传',
- itemList: ['图片', '视频'],
- success: (res) => {
- // console.log(res)
- if (res.tapIndex == 0) {
- this.chooseimage()
- } else {
- this.choosevideo()
- }
- }
- })
- },
- chooseimage() {
- console.log('图片')
- let _this = this;
- uni.chooseImage({
- sourceType: ['camera'],
- success(resp) {
- console.log('res--uni.chooseMedia', resp);
- resp.tempFiles.forEach((item, index) => {
- const task = uni.uploadFile({
- url: _this.$HTTP.webUrl + `/obs`,
- filePath: item.path,
- name: 'file',
- formData: {},
- header: _this.headers,
- success: res => {
- // 判断是否json字符串,将其转为json格式
- let data = _this.$u.test.jsonString(res.data) ? JSON.parse(
- res.data) : res.data;
- if (![200, 201, 204].includes(res.statusCode)) {
- // this.uploadError(index, data);
- _this.$UTILS.showPrompt('选取失败!')
- } else {
- // 上传成功
- // this.lists[index].response = data;
- // this.lists[index].progress = 100;
- // this.lists[index].error = false;
- // this.$emit('on-success', data, index, this.lists, this
- // .index);
- if (_this.progress === 100) {
- // console.log('_this.progress', _this.progress)
- // console.log('data----', data)
- // console.log('res--', res)
- _this.imgymxs.push({
- url: data.data.url,
- type: 'image'
- })
- _this.imgArr.push(data.data.url)
- // console.log('imgArr', _this.imgArr)
- _this.$UTILS.showPrompt('选取成功!')
- }
- }
- },
- fail: e => {
- _this.$UTILS.showPrompt('选取失败!')
- this.uploadError(index, e);
- },
- complete: res => {
- _this.uploading = false;
- // _this.uploadFile(index + 1);
- // this.$emit('on-change', res, index, this.lists, this
- // .index);
- }
- });
- task.onProgressUpdate(res => {
- // if (res.progress > 0) {
- // this.lists[index].progress = res.progress;
- // this.$emit('on-progress', res, index, this.lists, this.index);
- // }
- _this.progress = res.progress;
- console.log('onProgressUpdate', res)
- uni.showLoading({
- title: '选取中'
- })
- });
- })
- },
- })
- },
- choosevideo() {
- let _this = this;
- console.log('视频')
- uni.chooseVideo({
- sourceType: ['camera'],
- maxDuration: 30,
- success(resp) {
- const task = uni.uploadFile({
- url: _this.$HTTP.webUrl + `/obs`,
- filePath: resp.tempFilePath,
- name: 'file',
- formData: {},
- header: _this.headers,
- success: res => {
- // 判断是否json字符串,将其转为json格式
- let data = _this.$u.test.jsonString(res.data) ? JSON.parse(res.data) :
- res.data;
- if (![200, 201, 204].includes(res.statusCode)) {
- this.uploadError(index, data);
- } else {
- // 上传成功
- // this.lists[index].response = data;
- // this.lists[index].progress = 100;
- // this.lists[index].error = false;
- // this.$emit('on-success', data, index, this.lists, this
- // .index);
- if (_this.progress === 100) {
- console.log('_this.progress', _this.progress)
- console.log('data----', data)
- console.log('res--', res)
- // _this.imgArr.push(data.data.url)
- _this.imgymxs.push({
- url: data.data.url,
- type: 'video'
- })
- _this.imgArr.push(data.data.url)
- console.log('imgArr', _this.imgArr)
- _this.$UTILS.showPrompt('选取成功!')
- }
- }
- },
- fail: e => {
- _this.$UTILS.showPrompt('选取失败!')
- this.uploadError(index, e);
- },
- complete: res => {
- uni.hideLoading();
- _this.uploading = false;
- // _this.uploadFile(index + 1);
- // this.$emit('on-change', res, index, this.lists, this
- // .index);
- }
- });
- task.onProgressUpdate(res => {
- // if (res.progress > 0) {
- // this.lists[index].progress = res.progress;
- // this.$emit('on-progress', res, index, this.lists, this.index);
- // }
- _this.progress = res.progress;
- console.log('onProgressUpdate', res)
- uni.showLoading({
- title: '选取中'
- })
- });
- },
- })
- },
- remove(index) {
- uni.showModal({
- title: '提示',
- content: '是否删除该图片或视频?',
- success: (res) => {
- if (res.confirm) {
- this.imgArr.splice(index, 1);
- this.imgymxs.splice(index, 1);
- console.log('this.imgArr', this.imgArr)
- }
- }
- })
- },
- }
- }
- </script>
- <style>
- .project-content {
- padding: 0rpx 20rpx;
- border-radius: 20rpx;
- width: 90%;
- margin: 0 auto;
- background: #fff;
- }
- .background {
- z-index: -1;
- position: fixed;
- width: 100%;
- height: 100%;
- background-size: 100% 100%;
- }
- .top-left {
- display: flex;
- align-items: center;
- }
- .small-title {
- font-size: 38rpx;
- color: #2d95f4;
- margin: 20rpx 0;
- }
- .form-item {
- display: flex;
- align-items: center;
- font-size: 32rpx;
- border: none;
- }
- .danwei {
- text-align: center;
- line-height: 110rpx;
- }
- .un-row {
- text-align: left;
- }
- .top {
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
- .top-icon {
- font-size: 40rpx;
- color: #2d95f4;
- }
- </style>
|