| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756 |
- <template>
- <view class="container">
- <uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
- @clickLeft="toBack">
- <view style="width: 100%;display: flex;flex-direction: row;justify-content: center;align-items: center;">
- <text style="color: white;font-size: 1rem;">{{title}}</text>
- </view>
- </uni-nav-bar>
- <uni-forms ref="baseForm">
- <uSection title="维修总结情况" titleFontSize="0.8rem" type="line" style="width: 100%;">
- <uGroup margin-top="0">
- <uni-forms-item>
- <uni-easyinput type="textarea" v-model="baseInfo.processDesc" placeholder="请输入总结说明" />
- </uni-forms-item>
- </uGroup>
- <uGroup title="总体设施设备图片" margin-top="20">
- <view class="view-flex-rs" style="margin-top: 0px;">
- <view class="view-flex-cc" style="width: 120px;">
- <view class="img-container">
- <view class="note-image-box">
- <view v-if="baseInfo.photo1Take" class="note-image-item">
- <view class="close-icon" @click="onBasePhoto1DeleteClick()">
- <uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
- </view>
- <view class="image-box">
- <image :src="toOss(baseInfo.photo1Url)" mode="widthFix"></image>
- </view>
- </view>
- <view v-else class="note-image-item" @click="getBasePhoto1()">
- <view class="image-box">
- <uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="view-flex-cc" style="width: 120px;">
- <view class="img-container">
- <view class="note-image-box">
- <view v-if="baseInfo.photo2Take" class="note-image-item">
- <view class="close-icon" @click="onBasePhoto2DeleteClick()">
- <uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
- </view>
- <view class="image-box">
- <image :src="toOss(baseInfo.photo2Url)" mode="widthFix"></image>
- </view>
- </view>
- <view v-else class="note-image-item" @click="getBasePhoto2()">
- <view class="image-box">
- <uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </uGroup>
- </uSection>
- <uSection title="RTU设备" ftitleFontSize="0.8rem" type="line" style="width: 100%;">
- <uGroup margin-top="0">
- <uni-forms-item label="是否更换RTU" label-width="130px" required>
- <radio-group @change="onRtuReplaceRadioChange"
- style="display: flex;flex-direction: row;justify-content: flex-start;">
- <label style="margin-right: 20px;width:60px" class="view-flex-rs"
- v-for="(item, index) in rtuInfo.replaceItems.items" :key="item.id">
- <view>
- <radio :value="item.id" :checked="index === rtuInfo.replaceItems.current" />
- </view>
- <view style="font-size: 0.7rem;">{{item.dictValue}}</view>
- </label>
- </radio-group>
- </uni-forms-item>
- <uni-forms-item label="运行状态" label-width="130px" required>
- <radio-group @change="onRtuStatusRadioChange"
- style="display: flex;flex-direction: row;justify-content: flex-start;">
- <label style="margin-right: 20px;width:60px" class="view-flex-rs"
- v-for="(item, index) in rtuInfo.runStatus.items" :key="item.id">
- <view>
- <radio :value="item.id" :checked="index === rtuInfo.runStatus.current" />
- </view>
- <view style="font-size: 0.7rem;">{{item.dictValue}}</view>
- </label>
- </radio-group>
- </uni-forms-item>
- <uni-forms-item>
- <uni-easyinput label="备注说明" type="textarea" v-model="rtuInfo.remark" placeholder="请输入备注说明" />
- </uni-forms-item>
- </uGroup>
- <uGroup title="RTU图片" margin-top="20">
- <view class="view-flex-rs" style="margin-top: 0px;">
- <view class="view-flex-cc" style="width: 120px;">
- <view class="img-container">
- <view class="note-image-box">
- <view v-if="rtuInfo.photoTake" class="note-image-item">
- <view class="close-icon" @click="onRtuPhotoDeleteClick()">
- <uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
- </view>
- <view class="image-box">
- <image :src="toOss(rtuInfo.photoUrl)" mode="widthFix"></image>
- </view>
- </view>
- <view v-else class="note-image-item" @click="getRtuPhoto()">
- <view class="image-box">
- <uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </uGroup>
- </uSection>
- <uSection title="雨量传感器" ftitleFontSize="0.8rem" type="line" style="width: 100%;">
- <uGroup margin-top="0">
- <uni-forms-item label="是否更换雨量计" label-width="130px" required>
- <radio-group @change="onRainReplaceRadioChange"
- style="display: flex;flex-direction: row;justify-content: flex-start;">
- <label style="margin-right: 20px;width:60px" class="view-flex-rs"
- v-for="(item, index) in rainSensorInfo.replaceItems.items" :key="item.id">
- <view>
- <radio :value="item.id" :checked="index === rainSensorInfo.replaceItems.current" />
- </view>
- <view style="font-size: 0.7rem;">{{item.dictValue}}</view>
- </label>
- </radio-group>
- </uni-forms-item>
- <uni-forms-item label="运行状态" label-width="130px" required>
- <radio-group @change="onRainSensorStatusRadioChange"
- style="display: flex;flex-direction: row;justify-content: flex-start;">
- <label style="margin-right: 20px;width:60px" class="view-flex-rs"
- v-for="(item, index) in rainSensorInfo.runStatus.items" :key="item.id">
- <view>
- <radio :value="item.id" :checked="index === rainSensorInfo.runStatus.current" />
- </view>
- <view style="font-size: 0.7rem;">{{item.dictValue}}</view>
- </label>
- </radio-group>
- </uni-forms-item>
- <uni-forms-item>
- <uni-easyinput label="备注说明" type="textarea" v-model="rainSensorInfo.remark"
- placeholder="请输入备注说明" />
- </uni-forms-item>
- </uGroup>
- <uGroup title="雨量传感器图片" margin-top="20">
- <view class="view-flex-rs" style="margin-top: 0px;">
- <view class="view-flex-cc" style="width: 120px;">
- <view class="img-container">
- <view class="note-image-box">
- <view v-if="rainSensorInfo.photoTake" class="note-image-item">
- <view class="close-icon" @click="onRainPhotoDeleteClick()">
- <uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
- </view>
- <view class="image-box">
- <image :src="toOss(rainSensorInfo.photoUrl)" mode="widthFix"></image>
- </view>
- </view>
- <view v-else class="note-image-item" @click="getRainSensorPhoto()">
- <view class="image-box">
- <uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </uGroup>
- </uSection>
- <uSection title="水位传感器" ftitleFontSize="0.8rem" type="line" style="width: 100%;">
- <uGroup margin-top="0">
- <uni-forms-item label="是否更换水位计" label-width="130px" required>
- <radio-group @change="onWaterReplaceRadioChange"
- style="display: flex;flex-direction: row;justify-content: flex-start;">
- <label style="margin-right: 20px;width:60px" class="view-flex-rs"
- v-for="(item, index) in waterSensorInfo.replaceItems.items" :key="item.id">
- <view>
- <radio :value="item.id" :checked="index === waterSensorInfo.replaceItems.current" />
- </view>
- <view style="font-size: 0.7rem;">{{item.dictValue}}</view>
- </label>
- </radio-group>
- </uni-forms-item>
- <uni-forms-item label="运行状态" label-width="130px" required>
- <radio-group @change="onWaterSensorStatusRadioChange"
- style="display: flex;flex-direction: row;justify-content: flex-start;">
- <label style="margin-right: 20px;width:60px" class="view-flex-rs"
- v-for="(item, index) in waterSensorInfo.runStatus.items" :key="item.id">
- <view>
- <radio :value="item.id" :checked="index === waterSensorInfo.runStatus.current" />
- </view>
- <view style="font-size: 0.7rem;">{{item.dictValue}}</view>
- </label>
- </radio-group>
- </uni-forms-item>
- <uni-forms-item>
- <uni-easyinput label="备注说明" type="textarea" v-model="waterSensorInfo.remark"
- placeholder="请输入备注说明" />
- </uni-forms-item>
- </uGroup>
- <uGroup title="水位传感器图片" margin-top="20">
- <view class="view-flex-rs" style="margin-top: 0px;">
- <view class="view-flex-cc" style="width: 120px;">
- <view class="img-container">
- <view class="note-image-box">
- <view v-if="waterSensorInfo.photoTake" class="note-image-item">
- <view class="close-icon" @click="onWaterPhotoDeleteClick()">
- <uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
- </view>
- <view class="image-box">
- <image :src="toOss(waterSensorInfo.photoUrl)" mode="widthFix"></image>
- </view>
- </view>
- <view v-else class="note-image-item" @click="getWaterSensorPhoto()">
- <view class="image-box">
- <uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </uGroup>
- </uSection>
- <uSection title="墒情传感器" ftitleFontSize="0.8rem" type="line" style="width: 100%;">
- <uGroup margin-top="0">
- <uni-forms-item label="是否更换墒情传感器" label-width="130px" required>
- <radio-group @change="onGroundReplaceRadioChange"
- style="display: flex;flex-direction: row;justify-content: flex-start;">
- <label style="margin-right: 20px;width:60px" class="view-flex-rs"
- v-for="(item, index) in groundSensorInfo.replaceItems.items" :key="item.id">
- <view>
- <radio :value="item.id"
- :checked="index === groundSensorInfo.replaceItems.current" />
- </view>
- <view style="font-size: 0.7rem;">{{item.dictValue}}</view>
- </label>
- </radio-group>
- </uni-forms-item>
- <uni-forms-item label="运行状态" label-width="130px" required>
- <radio-group @change="onGroundSensorStatusRadioChange"
- style="display: flex;flex-direction: row;justify-content: flex-start;">
- <label style="margin-right: 20px;width:60px" class="view-flex-rs"
- v-for="(item, index) in groundSensorInfo.runStatus.items" :key="item.id">
- <view>
- <radio :value="item.id" :checked="index === groundSensorInfo.runStatus.current" />
- </view>
- <view style="font-size: 0.7rem;">{{item.dictValue}}</view>
- </label>
- </radio-group>
- </uni-forms-item>
- <uni-forms-item>
- <uni-easyinput label="备注说明" type="textarea" v-model="groundSensorInfo.remark"
- placeholder="请输入备注说明" />
- </uni-forms-item>
- </uGroup>
- <uGroup title="墒情传感器图片" margin-top="20">
- <view class="view-flex-rs" style="margin-top: 0px;">
- <view class="view-flex-cc" style="width: 120px;">
- <view class="img-container">
- <view class="note-image-box">
- <view v-if="groundSensorInfo.photoTake" class="note-image-item">
- <view class="close-icon" @click="onGroundPhotoDeleteClick()">
- <uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
- </view>
- <view class="image-box">
- <image :src="toOss(groundSensorInfo.photoUrl)" mode="widthFix"></image>
- </view>
- </view>
- <view v-else class="note-image-item" @click="getGroundSensorPhoto()">
- <view class="image-box">
- <uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </uGroup>
- </uSection>
- <uSection title="供电系统" ftitleFontSize="0.8rem" type="line" style="width: 100%;">
- <uGroup margin-top="0">
- <uni-forms-item label="是否更换蓄电池" label-width="130px" required>
- <radio-group @change="onBatteryReplaceRadioChange"
- style="display: flex;flex-direction: row;justify-content: flex-start;">
- <label style="margin-right: 20px;width:60px" class="view-flex-rs"
- v-for="(item, index) in powerInfo.batteryReplaceItems.items" :key="item.id">
- <view>
- <radio :value="item.id"
- :checked="index === powerInfo.batteryReplaceItems.current" />
- </view>
- <view style="font-size: 0.7rem;">{{item.dictValue}}</view>
- </label>
- </radio-group>
- </uni-forms-item>
- <uni-forms-item label="是否更换太阳能板" label-width="130px" required>
- <radio-group @change="onSunPowerReplaceRadioChange"
- style="display: flex;flex-direction: row;justify-content: flex-start;">
- <label style="margin-right: 20px;width:60px" class="view-flex-rs"
- v-for="(item, index) in powerInfo.sunPowerReplaceItems.items" :key="item.id">
- <view>
- <radio :value="item.id"
- :checked="index === powerInfo.sunPowerReplaceItems.current" />
- </view>
- <view style="font-size: 0.7rem;">{{item.dictValue}}</view>
- </label>
- </radio-group>
- </uni-forms-item>
- <uni-forms-item label="运行状态" label-width="130px" required>
- <radio-group @change="onPowerStatusRadioChange"
- style="display: flex;flex-direction: row;justify-content: flex-start;">
- <label style="margin-right: 20px;width:60px" class="view-flex-rs"
- v-for="(item, index) in powerInfo.runStatus.items" :key="item.id">
- <view>
- <radio :value="item.id" :checked="index === powerInfo.runStatus.current" />
- </view>
- <view style="font-size: 0.7rem;">{{item.dictValue}}</view>
- </label>
- </radio-group>
- </uni-forms-item>
- <uni-forms-item>
- <uni-easyinput label="备注说明" type="textarea" v-model="powerInfo.remark" placeholder="请输入备注说明" />
- </uni-forms-item>
- </uGroup>
- <uGroup title="供电系统图片" margin-top="20">
- <view class="view-flex-rs" style="margin-top: 0px;">
- <view class="view-flex-cc" style="width: 120px;">
- <view class="img-container">
- <view class="note-image-box">
- <view v-if="powerInfo.batteryPhotoTake" class="note-image-item">
- <view class="close-icon" @click="onBatteryPhotoDeleteClick()">
- <uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
- </view>
- <view class="image-box">
- <image :src="toOss(powerInfo.batteryPhotoUrl)" mode="widthFix"></image>
- </view>
- </view>
- <view v-else class="note-image-item" @click="getBatteryPhoto()">
- <view class="image-box">
- <uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="view-flex-cc" style="width: 120px;">
- <view class="img-container">
- <view class="note-image-box">
- <view v-if="powerInfo.sunPhotoTake" class="note-image-item">
- <view class="close-icon" @click="onSunPowerPhotoDeleteClick()">
- <uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
- </view>
- <view class="image-box">
- <image :src="toOss(powerInfo.sunPhotoUrl)" mode="widthFix"></image>
- </view>
- </view>
- <view v-else class="note-image-item" @click="getSunPowerPhoto()">
- <view class="image-box">
- <uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </uGroup>
- </uSection>
- <uSection title="4G移动网络" ftitleFontSize="0.8rem" type="line" style="width: 100%;">
- <uGroup margin-top="0">
- <uni-forms-item label="是否欠费" label-width="130px" required>
- <radio-group @change="onNetworkOverdueRadioChange"
- style="display: flex;flex-direction: row;justify-content: flex-start;">
- <label style="margin-right: 20px;width:60px" class="view-flex-rs"
- v-for="(item, index) in networkInfo.overdueItems.items" :key="item.id">
- <view>
- <radio :value="item.id" :checked="index === networkInfo.overdueItems.current" />
- </view>
- <view style="font-size: 0.7rem;">{{item.dictValue}}</view>
- </label>
- </radio-group>
- </uni-forms-item>
- <uni-forms-item label="运行状态" label-width="130px" required>
- <radio-group @change="onNetworkStatusRadioChange"
- style="display: flex;flex-direction: row;justify-content: flex-start;">
- <label style="margin-right: 20px;width:60px" class="view-flex-rs"
- v-for="(item, index) in networkInfo.runStatus.items" :key="item.id">
- <view>
- <radio :value="item.id" :checked="index === networkInfo.runStatus.current" />
- </view>
- <view style="font-size: 0.7rem;">{{item.dictValue}}</view>
- </label>
- </radio-group>
- </uni-forms-item>
- <uni-forms-item>
- <uni-easyinput label="备注说明" type="textarea" v-model="networkInfo.remark"
- placeholder="请输入备注说明" />
- </uni-forms-item>
- </uGroup>
- </uSection>
- <uSection title="北斗通讯" ftitleFontSize="0.8rem" type="line" style="width: 100%;">
- <uGroup margin-top="0">
- <uni-forms-item label="运行状态" label-width="130px" required>
- <radio-group @change="onSatelliteStatusRadioChange"
- style="display: flex;flex-direction: row;justify-content: flex-start;">
- <label style="margin-right: 20px;width:60px" class="view-flex-rs"
- v-for="(item, index) in satelliteInfo.runStatus.items" :key="item.id">
- <view>
- <radio :value="item.id" :checked="index === satelliteInfo.runStatus.current" />
- </view>
- <view style="font-size: 0.7rem;">{{item.dictValue}}</view>
- </label>
- </radio-group>
- </uni-forms-item>
- <uni-forms-item>
- <uni-easyinput label="备注说明" type="textarea" v-model="satelliteInfo.remark"
- placeholder="请输入备注说明" />
- </uni-forms-item>
- </uGroup>
- </uSection>
- </uni-forms>
- <view class="footer">
- <view class="control">
- <view style="display: flex;flex-direction: row;justify-content: flex-start;">
- <view
- style="display:flex;flex-direction: row;justify-content: center;width: 90px;height:28px;margin-right: 10px;border-radius:7px;background-color:lightblue"
- @click="toSave()">
- <view style="display:flex;flex-direction: column;justify-content: center;">
- <uIcons class="input-uni-icon" type="folder-add" size="18" color="#999" />
- </view>
- <view style="display:flex;flex-direction: column;justify-content: center;padding-left:5px;">
- <text style="color:black;font-size:0.7rem">暂存</text>
- </view>
- </view>
- <view
- style="display:flex;flex-direction: row;justify-content: center;width: 90px;height:28px;margin-right: 10px;border-radius:7px;background-color:lightpink"
- @click="toSubmit()">
- <view style="display:flex;flex-direction: column;justify-content: center;">
- <uIcons class="input-uni-icon" type="upload" size="18" color="#999" />
- </view>
- <view style="display:flex;flex-direction: column;justify-content: center;padding-left:5px;">
- <text style="color:black;font-size:0.7rem">立即提交</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- // import pageNav from '@/components/page-nav/page-nav.vue';
- import http from '@/http/api.js';
- import {
- pathToBase64,
- base64ToPath
- } from '@/js_sdk/mmmm-image-tools/index.js';
- import {
- oss,
- devUrl,
- prodUrl
- } from '@/common/setting';
- import uIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
- import uGroup from '@/uni_modules/uni-group/uni-group.vue'
- import uSection from '@/uni_modules/uni-section/uni-section.vue'
- import uFormsItem from '@/uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue'
- import uFab from '@/uni_modules/uni-fab/components/uni-fab/uni-fab.vue'
- export default {
- components: {
- uIcons,
- uGroup,
- uSection,
- uFormsItem,
- uFab
- },
- onLoad(options) {
- this.orderId = options.orderId;
- this.baseURL = process.env.NODE_ENV === 'development' ? devUrl : prodUrl;
- //初始化字典
- //this.getReportDict();
- //查询计划信息
- //this.getPlanInfo();
- },
- data() {
- return {
- pattern: {
- color: '#7A7E83',
- backgroundColor: '#fff',
- selectedColor: '#007AFF',
- buttonColor: '#007AFF',
- iconColor: '#fff'
- },
- content: [{
- iconPath: '/static/images/user/c6.png',
- selectedIconPath: '/static/images/user/c6.png',
- text: '提交',
- active: false
- },
- {
- iconPath: '/static/images/user/c5.png',
- selectedIconPath: '/static/images/user/c5.png',
- text: '保存',
- active: false
- }
- ],
- baseURL: '',
- orderId: 0,
- rtuCode: '',
- planInfo: {},
- waterLevelSensorType: {
- items: [],
- current: 0,
- },
- groundSensorType: {
- items: [],
- current: 0,
- },
- satelliteModel: {
- items: [],
- current: 0,
- },
- datagramIp: {
- items: [{
- 'id': '0',
- 'checked': false,
- 'dictValue': '发往县'
- }, {
- 'id': '1',
- 'checked': false,
- 'dictValue': '发往市'
- }, {
- 'id': '2',
- 'checked': false,
- 'dictValue': '发往省'
- }],
- current: 0,
- },
- baseInfo: {
- processDesc: '',
- photo1Url: '',
- photo1Take: false,
- photo2Url: '',
- photo2Take: false
- },
- rtuInfo: {
- remark: '',
- rtuReplace: 0,
- photoUrl: '',
- photoTake: false,
- replaceItems: {
- items: [{
- 'id': '0',
- 'dictValue': '无'
- }, {
- 'id': '1',
- 'dictValue': '更换'
- }],
- current: 0,
- },
- runStatus: {
- items: [{
- 'id': '0',
- 'dictValue': '正常'
- }, {
- 'id': '1',
- 'dictValue': '故障'
- }],
- current: 0,
- },
- },
- rainSensorInfo: {
- rainSensorReplace: 0,
- replaceItems: {
- items: [{
- 'id': '0',
- 'dictValue': '无'
- }, {
- 'id': '1',
- 'dictValue': '更换'
- }],
- current: 0,
- },
- remark: '',
- photoUrl: '',
- photoTake: false,
- active: {
- items: [{
- 'id': '0',
- 'dictValue': '有'
- }, {
- 'id': '1',
- 'dictValue': '无'
- }],
- current: 0,
- },
- runStatus: {
- items: [{
- 'id': '0',
- 'dictValue': '正常'
- }, {
- 'id': '1',
- 'dictValue': '故障'
- }],
- current: 0,
- },
- },
- waterSensorInfo: {
- waterSensorReplace: 0,
- replaceItems: {
- items: [{
- 'id': '0',
- 'dictValue': '无'
- }, {
- 'id': '1',
- 'dictValue': '更换'
- }],
- current: 0,
- },
- remark: '',
- photoUrl: '',
- photoTake: false,
- active: {
- items: [{
- 'id': '0',
- 'dictValue': '有'
- }, {
- 'id': '1',
- 'dictValue': '无'
- }],
- current: 0,
- },
- runStatus: {
- items: [{
- 'id': '0',
- 'dictValue': '正常'
- }, {
- 'id': '1',
- 'dictValue': '故障'
- }],
- current: 0,
- },
- },
- groundSensorInfo: {
- groundSensorReplace: 0,
- replaceItems: {
- items: [{
- 'id': '0',
- 'dictValue': '无'
- }, {
- 'id': '1',
- 'dictValue': '更换'
- }],
- current: 0,
- },
- remark: '',
- photoUrl: '',
- photoTake: false,
- active: {
- items: [{
- 'id': '0',
- 'dictValue': '有'
- }, {
- 'id': '1',
- 'dictValue': '无'
- }],
- current: 0,
- },
- runStatus: {
- items: [{
- 'id': '0',
- 'dictValue': '正常'
- }, {
- 'id': '1',
- 'dictValue': '故障'
- }],
- current: 0,
- },
- },
- powerInfo: {
- batteryReplace: 0,
- batteryReplaceItems: {
- items: [{
- 'id': '0',
- 'dictValue': '无'
- }, {
- 'id': '1',
- 'dictValue': '更换'
- }],
- current: 0,
- },
- sunPowerReplace: 0,
- sunPowerReplaceItems: {
- items: [{
- 'id': '0',
- 'dictValue': '无'
- }, {
- 'id': '1',
- 'dictValue': '更换'
- }],
- current: 0,
- },
- batteryPhotoUrl: '',
- batteryPhotoTake: false,
- sunPhotoUrl: '',
- sunPhotoTake: false,
- remark: '',
- active: {
- items: [{
- 'id': '0',
- 'dictValue': '有'
- }, {
- 'id': '1',
- 'dictValue': '无'
- }],
- current: 0,
- },
- runStatus: {
- items: [{
- 'id': '0',
- 'dictValue': '正常'
- }, {
- 'id': '1',
- 'dictValue': '故障'
- }],
- current: 0,
- },
- },
- networkInfo: {
- overdueItems: {
- items: [{
- 'id': '0',
- 'dictValue': '正常'
- }, {
- 'id': '1',
- 'dictValue': '欠费'
- }],
- current: 0,
- },
- networkOverdue: 0,
- remark: '',
- active: {
- items: [{
- 'id': '0',
- 'dictValue': '有'
- }, {
- 'id': '1',
- 'dictValue': '无'
- }],
- current: 0,
- },
- runStatus: {
- items: [{
- 'id': '0',
- 'dictValue': '正常'
- }, {
- 'id': '1',
- 'dictValue': '故障'
- }],
- current: 0,
- },
- },
- satelliteInfo: {
- remark: '',
- active: {
- items: [{
- 'id': '0',
- 'dictValue': '有'
- }, {
- 'id': '1',
- 'dictValue': '无'
- }],
- current: 0,
- },
- runStatus: {
- items: [{
- 'id': '0',
- 'dictValue': '正常'
- }, {
- 'id': '1',
- 'dictValue': '故障'
- }],
- current: 0,
- },
- },
- localImageList: [],
- uploadImageList: [],
- title: '工单填报',
- desc: '',
- }
- },
- computed: {
- getIcon() {
- return path => {
- return 'https://cdn.uviewui.com/uview/example/' + path + '.png';
- }
- },
- },
- onShow() {
- },
- created() {
- },
- methods: {
- toOss(path) {
- return oss + path;
- },
- toBack() {
- uni.navigateBack({
- delta: 1
- })
- },
- toSubmit() {
- var formdata = {};
- formdata['orderId'] = this.orderId;
- formdata['processDesc'] = this.baseInfo.processDesc;
- if (this.baseInfo.photo1Take) {
- formdata['basePhoto1Take'] = 1;
- formdata['basePhoto1Url'] = this.baseInfo.photo1Url;
- } else {
- formdata['basePhoto1Take'] = 0;
- }
- if (this.baseInfo.photo2Take) {
- formdata['basePhoto2Take'] = 1;
- formdata['basePhoto2Url'] = this.baseInfo.photo2Url;
- } else {
- formdata['basePhoto2Take'] = 0;
- }
- formdata['rtuStatus'] = this.rtuInfo.runStatus.current;
- formdata['rtuReplace'] = this.rtuInfo.replaceItems.current;
- formdata['rtuDesc'] = this.rtuInfo.remark;
- if (this.rtuInfo.photoTake) {
- formdata['rtuPhotoTake'] = 1;
- formdata['rtuPhotoUrl'] = this.rtuInfo.photoUrl;
- } else {
- formdata['rtuPhotoTake'] = 0;
- }
- formdata['rainSensorReplace'] = this.rainSensorInfo.replaceItems.current;
- formdata['rainSensorDesc'] = this.rainSensorInfo.remark;
- formdata['rainSensorStatus'] = this.rainSensorInfo.runStatus.current;
- if (this.rainSensorInfo.photoTake) {
- formdata['rainSensorPhotoTake'] = 1;
- formdata['rainSensorPhotoUrl'] = this.rainSensorInfo.photoUrl;
- } else {
- formdata['rainSensorPhotoTake'] = 0;
- }
- formdata['waterSensorReplace'] = this.waterSensorInfo.replaceItems.current;
- formdata['waterSensorDesc'] = this.waterSensorInfo.remark;
- formdata['waterLevelSensorStatus'] = this.waterSensorInfo.runStatus.current;
- if (this.waterSensorInfo.photoTake) {
- formdata['waterSensorPhotoTake'] = 1;
- formdata['waterSensorPhotoUrl'] = this.waterSensorInfo.photoUrl;
- } else {
- formdata['waterSensorPhotoTake'] = 0;
- }
- formdata['groundWaterSensorStatus'] = this.groundSensorInfo.runStatus.current;
- formdata['groundSensorReplace'] = this.groundSensorInfo.replaceItems.current;
- formdata['groundSensorDesc'] = this.groundSensorInfo.remark;
- if (this.groundSensorInfo.photoTake) {
- formdata['groundSensorPhotoTake'] = 1;
- formdata['groundSensorPhotoUrl'] = this.groundSensorInfo.photoUrl;
- } else {
- formdata['groundSensorPhotoTake'] = 0;
- }
- formdata['batteryReplace'] = this.powerInfo.batteryReplaceItems.current;
- formdata['sunPowerReplace'] = this.powerInfo.sunPowerReplaceItems.current;
- formdata['powerStatus'] = this.powerInfo.runStatus.current;
- formdata['powerDesc'] = this.powerInfo.remark;
- if (this.powerInfo.batteryPhotoTake) {
- formdata['batteryPhotoTake'] = 1;
- formdata['batteryPhotoUrl'] = this.powerInfo.batteryPhotoUrl;
- } else {
- formdata['batteryPhotoTake'] = 0;
- }
- if (this.powerInfo.sunPhotoTake) {
- formdata['sunPhotoTake'] = 1;
- formdata['sunPhotoUrl'] = this.powerInfo.sunPhotoUrl;
- } else {
- formdata['sunPhotoTake'] = 0;
- }
- formdata['networkOverdue'] = this.networkInfo.overdueItems.current;
- formdata['networkStatus'] = this.networkInfo.runStatus.current;
- formdata['networkDesc'] = this.networkInfo.remark;
- formdata['satelliteStatus'] = this.satelliteInfo.runStatus.current;
- formdata['satelliteDesc'] = this.satelliteInfo.remark;
- var that = this;
- http.request({
- url: '/galaxy-test/rtu/check/order/process/save',
- method: 'POST',
- data: formdata
- }).then(res => {
- if (res.success) {
- uni.showModal({
- content: '工单填报信息已成功提交',
- showCancel: false,
- success(res) {
- if (res.confirm) {
- that.toBack();
- }
- }
- });
- } else {
- uni.showModal({
- content: '' + res.msg,
- showCancel: false
- });
- }
- }).catch(err => {
- console.log(err)
- })
- },
- toSave() {
- },
- rtuReplaceDateClick(e) {
- console.log('maskClick事件:', e);
- },
- rainSensorReplaceDateClick(e) {
- console.log('maskClick事件:', e);
- },
- waterSensorReplaceDateClick(e) {
- console.log('maskClick事件:', e);
- },
- groundSensorReplaceDateClick(e) {
- console.log('maskClick事件:', e);
- },
- batteryReplaceDateClick(e) {
- console.log('maskClick事件:', e);
- },
- sunPowerReplaceDateClick(e) {
- console.log('maskClick事件:', e);
- },
- simPayEndDateClick(e) {
- console.log('maskClick事件:', e);
- },
- dateFormat(dt) {
- var text = "" + dt.getFullYear();
- text += "-";
- text += ((dt.getMonth() + 1) < 10) ? ("0" + (dt.getMonth() + 1)) : (dt
- .getMonth() +
- 1);
- text += "-";
- text += dt.getDate() < 10 ? "0" + dt.getDate() : dt.getDate();
- text += " ";
- text += dt.getHours() < 10 ? "0" + dt.getHours() : dt.getHours();
- text += ":";
- text += dt.getMinutes() < 10 ? "0" + dt.getMinutes() : dt.getMinutes();
- text += ":";
- text += dt.getSeconds() < 10 ? "0" + dt.getSeconds() : dt.getSeconds();
- return text;
- },
- getReportDict() {
- var that = this;
- var waterLevelSensorTypeDictList = [];
- //查询水位计
- http.request({
- url: '/galaxy-system/dict-biz/dictionary?code=water_level_sensor_type',
- method: 'GET'
- }).then(res => {
- console.log(res.data)
- if (res.data != null) {
- const dictLength = res.data['length'];
- for (var i = 0; i < dictLength; i++) {
- let dict = res.data['' + i];
- waterLevelSensorTypeDictList.push(dict);
- }
- that.waterLevelSensorType.items = waterLevelSensorTypeDictList;
- }
- }).catch(err => {
- console.log(err)
- })
- var groundSensorTypeDictList = [];
- //查询墒情传感器类型
- http.request({
- url: '/galaxy-system/dict-biz/dictionary?code=ground_water_sensor_type',
- method: 'GET'
- }).then(res => {
- console.log(res.data)
- if (res.data != null) {
- const dictLength = res.data['length'];
- for (var i = 0; i < dictLength; i++) {
- let dict = res.data['' + i];
- groundSensorTypeDictList.push(dict);
- }
- that.groundSensorType.items = groundSensorTypeDictList;
- }
- }).catch(err => {
- console.log(err)
- })
- //查询北斗模式
- var satelliteModelDictList = [];
- http.request({
- url: '/galaxy-system/dict-biz/dictionary?code=satellite_model',
- method: 'GET'
- }).then(res => {
- console.log(res.data)
- if (res.data != null) {
- const dictLength = res.data['length'];
- for (var i = 0; i < dictLength; i++) {
- let dict = res.data['' + i];
- satelliteModelDictList.push(dict);
- }
- that.satelliteModel.items = satelliteModelDictList;
- }
- }).catch(err => {
- console.log(err)
- })
- },
- getPlanInfo() {
- var that = this;
- var postData = {};
- postData['id'] = this.planId;
- http.request({
- url: '/galaxy-test/equipment/inspection/plan/detail',
- method: 'GET',
- data: postData
- }).then(res => {
- console.log(res)
- if (res.data != null) {
- that.planInfo = res.data;
- }
- }).catch(err => {
- console.log(err)
- })
- },
- onBasePhoto1DeleteClick() {
- this.baseInfo.photo1Take = false;
- },
- onBasePhoto2DeleteClick() {
- this.baseInfo.photo2Take = false;
- },
- onRtuPhotoDeleteClick() {
- this.rtuInfo.photoTake = false;
- },
- onRainPhotoDeleteClick() {
- this.rainSensorInfo.photoTake = false;
- },
- onWaterPhotoDeleteClick() {
- this.waterSensorInfo.photoTake = false;
- },
- onGroundPhotoDeleteClick() {
- this.groundSensorInfo.photoTake = false;
- },
- onBatteryPhotoDeleteClick() {
- this.powerInfo.batteryPhotoTake = false;
- },
- onSunPowerPhotoDeleteClick() {
- this.powerInfo.sunPhotoTake = false;
- },
- onRtuReplaceRadioChange: function(evt) {
- for (let i = 0; i < this.rtuInfo.replaceItems.items.length; i++) {
- if (this.rtuInfo.replaceItems.items[i].id === evt.detail.value) {
- this.rtuInfo.replaceItems.current = i;
- break;
- }
- }
- },
- onRainReplaceRadioChange: function(evt) {
- for (let i = 0; i < this.rainSensorInfo.replaceItems.items.length; i++) {
- if (this.rainSensorInfo.replaceItems.items[i].id === evt.detail.value) {
- this.rainSensorInfo.replaceItems.current = i;
- break;
- }
- }
- },
- onWaterReplaceRadioChange: function(evt) {
- for (let i = 0; i < this.waterSensorInfo.replaceItems.items.length; i++) {
- if (this.waterSensorInfo.replaceItems.items[i].id === evt.detail.value) {
- this.waterSensorInfo.replaceItems.current = i;
- break;
- }
- }
- },
- onGroundReplaceRadioChange: function(evt) {
- for (let i = 0; i < this.groundSensorInfo.replaceItems.items.length; i++) {
- if (this.groundSensorInfo.replaceItems.items[i].id === evt.detail.value) {
- this.groundSensorInfo.replaceItems.current = i;
- break;
- }
- }
- },
- onBatteryReplaceRadioChange: function(evt) {
- for (let i = 0; i < this.powerInfo.batteryReplaceItems.items.length; i++) {
- if (this.powerInfo.batteryReplaceItems.items[i].id === evt.detail.value) {
- this.powerInfo.batteryReplaceItems.current = i;
- break;
- }
- }
- },
- onSunPowerReplaceRadioChange: function(evt) {
- for (let i = 0; i < this.powerInfo.sunPowerReplaceItems.items.length; i++) {
- if (this.powerInfo.sunPowerReplaceItems.items[i].id === evt.detail.value) {
- this.powerInfo.sunPowerReplaceItems.current = i;
- break;
- }
- }
- },
- onNetworkOverdueRadioChange: function(evt) {
- for (let i = 0; i < this.networkInfo.overdueItems.items.length; i++) {
- if (this.networkInfo.overdueItems.items[i].id === evt.detail.value) {
- this.networkInfo.overdueItems.current = i;
- break;
- }
- }
- },
- onRtuStatusRadioChange: function(evt) {
- for (let i = 0; i < this.rtuInfo.runStatus.items.length; i++) {
- if (this.rtuInfo.runStatus.items[i].id === evt.detail.value) {
- this.rtuInfo.runStatus.current = i;
- break;
- }
- }
- },
- onRainSensorStatusRadioChange: function(evt) {
- for (let i = 0; i < this.rainSensorInfo.runStatus.items.length; i++) {
- if (this.rainSensorInfo.runStatus.items[i].id === evt.detail.value) {
- this.rainSensorInfo.runStatus.current = i;
- break;
- }
- }
- },
- onWaterSensorStatusRadioChange: function(evt) {
- for (let i = 0; i < this.waterSensorInfo.runStatus.items.length; i++) {
- if (this.waterSensorInfo.runStatus.items[i].id === evt.detail.value) {
- this.waterSensorInfo.runStatus.current = i;
- break;
- }
- }
- },
- onGroundSensorStatusRadioChange: function(evt) {
- for (let i = 0; i < this.groundSensorInfo.runStatus.items.length; i++) {
- if (this.groundSensorInfo.runStatus.items[i].id === evt.detail.value) {
- this.groundSensorInfo.runStatus.current = i;
- break;
- }
- }
- },
- onPowerStatusRadioChange: function(evt) {
- for (let i = 0; i < this.powerInfo.runStatus.items.length; i++) {
- if (this.powerInfo.runStatus.items[i].id === evt.detail.value) {
- this.powerInfo.runStatus.current = i;
- break;
- }
- }
- },
- onNetworkStatusRadioChange: function(evt) {
- for (let i = 0; i < this.networkInfo.runStatus.items.length; i++) {
- if (this.networkInfo.runStatus.items[i].id === evt.detail.value) {
- this.networkInfo.runStatus.current = i;
- break;
- }
- }
- },
- onSatelliteStatusRadioChange: function(evt) {
- for (let i = 0; i < this.satelliteInfo.runStatus.items.length; i++) {
- if (this.satelliteInfo.runStatus.items[i].id === evt.detail.value) {
- this.satelliteInfo.runStatus.current = i;
- break;
- }
- }
- },
- uploadPhotoCallback(path, photoIndex) {
- if (photoIndex === 'basePhoto1') {
- this.baseInfo.photo1Url = path;
- this.baseInfo.photo1Take = true;
- } else if (photoIndex === 'basePhoto2') {
- this.baseInfo.photo2Url = path;
- this.baseInfo.photo2Take = true;
- } else if (photoIndex === 'rtu') {
- this.rtuInfo.photoUrl = path;
- this.rtuInfo.photoTake = true;
- } else if (photoIndex === 'rain') {
- this.rainSensorInfo.photoUrl = path;
- this.rainSensorInfo.photoTake = true;
- } else if (photoIndex === 'water') {
- this.waterSensorInfo.photoUrl = path;
- this.waterSensorInfo.photoTake = true;
- } else if (photoIndex === 'ground') {
- this.groundSensorInfo.photoUrl = path;
- this.groundSensorInfo.photoTake = true;
- } else if (photoIndex === 'battery') {
- this.powerInfo.batteryPhotoUrl = path;
- this.powerInfo.batteryPhotoTake = true;
- } else if (photoIndex === 'sun') {
- this.powerInfo.sunPhotoUrl = path;
- this.powerInfo.sunPhotoTake = true;
- }
- },
- uploadPhoto(imagePath, photoIndex) {
- var that = this;
- console.log("accessToken:" + uni.getStorageSync('accessToken'));
- console.log("path " + imagePath);
- uni.showLoading({
- title: '上传中'
- });
- uni.uploadFile({
- url: this.baseURL +
- '/galaxy-resource/oss/endpoint/put-file-attach?Blade-Auth=' +
- uni.getStorageSync('accessToken'),
- fileType: 'image',
- filePath: imagePath,
- name: 'file',
- success: (uploadFileRes) => {
- uni.hideLoading()
- if (uploadFileRes.statusCode == 200) {
- let data = JSON.parse(uploadFileRes.data);
- if (data.success) {
- let path = data.data['name'];
- console.log("paht " + path);
- that.uploadPhotoCallback(path, photoIndex);
- }
- }
- },
- fail: (err) => {
- uni.hideLoading()
- console.log(err);
- reject('err')
- },
- complete() {
- uni.hideLoading()
- }
- });
- },
- getBasePhoto1() {
- var that = this;
- uni.chooseImage({
- sourceType: ['album', 'camera'],
- success: (res) => {
- const len = res.tempFilePaths.length;
- if (len === 1) {
- res.tempFilePaths.forEach(path => {
- that.uploadPhoto(path, 'basePhoto1');
- })
- } else {
- uni.showModal({
- content: '只能选择一张图片,请确认!',
- showCancel: false
- });
- }
- }
- })
- },
- getBasePhoto2() {
- var that = this;
- uni.chooseImage({
- sourceType: ['album', 'camera'],
- success: (res) => {
- const len = res.tempFilePaths.length;
- if (len === 1) {
- res.tempFilePaths.forEach(path => {
- that.uploadPhoto(path, 'basePhoto2');
- })
- } else {
- uni.showModal({
- content: '只能选择一张图片,请确认!',
- showCancel: false
- });
- }
- }
- })
- },
- getRtuPhoto() {
- var that = this;
- uni.chooseImage({
- sourceType: ['album', 'camera'],
- success: (res) => {
- const len = res.tempFilePaths.length;
- if (len === 1) {
- res.tempFilePaths.forEach(path => {
- that.uploadPhoto(path, 'rtu');
- })
- } else {
- uni.showModal({
- content: '只能选择一张图片,请确认!',
- showCancel: false
- });
- }
- }
- })
- },
- getRainSensorPhoto() {
- var that = this;
- uni.chooseImage({
- sourceType: ['album', 'camera'],
- success: (res) => {
- const len = res.tempFilePaths.length;
- if (len === 1) {
- res.tempFilePaths.forEach(path => {
- that.uploadPhoto(path, 'rain');
- })
- } else {
- uni.showModal({
- content: '只能选择一张图片,请确认!',
- showCancel: false
- });
- }
- }
- })
- },
- getWaterSensorPhoto() {
- var that = this;
- uni.chooseImage({
- sourceType: ['album', 'camera'],
- success: (res) => {
- const len = res.tempFilePaths.length;
- if (len === 1) {
- res.tempFilePaths.forEach(path => {
- that.uploadPhoto(path, 'water');
- })
- } else {
- uni.showModal({
- content: '只能选择一张图片,请确认!',
- showCancel: false
- });
- }
- }
- })
- },
- getGroundSensorPhoto() {
- var that = this;
- uni.chooseImage({
- sourceType: ['album', 'camera'],
- success: (res) => {
- const len = res.tempFilePaths.length;
- if (len === 1) {
- res.tempFilePaths.forEach(path => {
- that.uploadPhoto(path, 'ground');
- })
- } else {
- uni.showModal({
- content: '只能选择一张图片,请确认!',
- showCancel: false
- });
- }
- }
- })
- },
- getBatteryPhoto() {
- var that = this;
- uni.chooseImage({
- sourceType: ['album', 'camera'],
- success: (res) => {
- const len = res.tempFilePaths.length;
- if (len === 1) {
- res.tempFilePaths.forEach(path => {
- that.uploadPhoto(path, 'battery');
- })
- } else {
- uni.showModal({
- content: '只能选择一张图片,请确认!',
- showCancel: false
- });
- }
- }
- })
- },
- getSunPowerPhoto() {
- var that = this;
- uni.chooseImage({
- sourceType: ['album', 'camera'],
- success: (res) => {
- const len = res.tempFilePaths.length;
- if (len === 1) {
- res.tempFilePaths.forEach(path => {
- that.uploadPhoto(path, 'sun');
- })
- } else {
- uni.showModal({
- content: '只能选择一张图片,请确认!',
- showCancel: false
- });
- }
- }
- })
- },
- onSaveClick(e) {
- if ((this.projectInfo.projectId != null && this.projectInfo.projectId.length > 0) &&
- (this.checkAreaDict.id != null && this.checkAreaDict.id.length > 0) &&
- (this.checkItemTypeDict.id != null && this.checkItemTypeDict.id.length > 0) &&
- (this.checkItemLabelDict.id != null && this.checkItemLabelDict.id.length > 0) &&
- (this.checkStandardDict.id != null && this.checkStandardDict.id.length > 0)) {
- try {
- var data = {};
- data['failureHiddenDangerDesc'] = this.failureHiddenDangerDesc;
- data['failureCheckPointDesc'] = this.failureCheckPointDesc;
- data['failureCorrectiveSuggest'] = this.failureCorrectiveSuggest;
- data['failureCheckNo'] = this.checkNo;
- data['failureProjectId'] = this.projectInfo.projectId;
- data['failureCheckArea'] = this.checkAreaDict.id;
- data['failureCheckHiddenDangerType'] = this.checkItemTypeDict.id;
- data['failureCheckHiddenDanger'] = this.checkItemLabelDict.id;
- data['failureCheckHiddenDangerItemPoint'] = this.checkStandardDict.id;
- data['failureCheckHiddenDangerStandard'] = this.checkItemStandardBasisDict.id;
- data['failureHiddenDangerLevel'] = this.hiddenDangerRadio.items[this.hiddenDangerRadio.current]
- .id;
- data['failureCorrectivePlanTime'] = this.planTimeRadio.items[this.planTimeRadio.current]
- .id;
- data['createTime'] = this.dateFormat(new Date());
- data['createUserName'] = this.userInfo1.nick_name;
- this.saveLocalFiles();
- console.log("save " + data);
- var list = uni.getStorageSync('check_report_storage_index');
- if (list != null && list.length > 0) {
- list.push(this.checkNo);
- uni.setStorageSync('check_report_storage_index', list);
- uni.setStorageSync('check_report_storage_' + this.checkNo, data);
- } else {
- list = [];
- list.push(this.checkNo);
- uni.setStorageSync('check_report_storage_index', list);
- uni.setStorageSync('check_report_storage_' + this.checkNo, data);
- }
- var that = this;
- uni.showModal({
- title: '流程确认',
- content: '请选择复制或继续检查',
- cancelText: '复制检查单',
- confirmText: '继续检查',
- success: function(res) {
- if (res.confirm) {
- that.onContinunClick();
- } else if (res.cancel) {
- that.onCopyClick();
- }
- }
- });
- //uni.navigateBack();
- } catch (e) {
- console.log(e)
- uni.showModal({
- content: '保存失败!',
- showCancel: false
- });
- }
- } else {
- uni.showModal({
- content: '请检查必填项',
- showCancel: false
- });
- }
- },
- formReset: function(e) {
- console.log('清空数据')
- },
- }
- }
- </script>
- <style>
- /* page {
- background-color: rgb(240, 242, 244);
- } */
- </style>
- <style lang="scss" scoped>
- .cell-hover-class {
- background-color: rgb(235, 237, 238);
- }
- .view-flex-rs {
- display: flex;
- flex-direction: row;
- justify-content: flex-start;
- align-items: center;
- }
- .view-flex-rc {
- display: flex;
- flex-direction: row;
- justify-content: center;
- align-items: center;
- }
- .view-flex-re {
- display: flex;
- flex-direction: row;
- justify-content: flex-end;
- align-items: center;
- }
- .view-flex-cs {
- display: flex;
- flex-direction: column;
- justify-content: flex-start;
- }
- .view-flex-cc {
- display: flex;
- flex-direction: column;
- justify-content: center;
- }
- .view-flex-ce {
- display: flex;
- flex-direction: column;
- justify-content: flex-end;
- }
- .line-body {
- padding-left: 10px;
- padding-right: 10px;
- }
- .required-star {
- color: #FF0000;
- font-size: 15px;
- width: 20px;
- text-align: center;
- padding-left: 0px;
- padding-right: 2px;
- }
- .item-title {
- color: #909399;
- font-size: 15px;
- }
- .mline-text {
- padding-left: 2px;
- width: 100%;
- /* background-color:#909399; */
- height: 70px;
- border: 1px solid #FF5A5F;
- border-radius: 5px;
- }
- .footer {
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- z-index: 1;
- height: 100rpx;
- padding: 20rpx;
- box-sizing: border-box;
- display: flex;
- align-items: center;
- justify-content: flex-end;
- background-color: #ffffff;
- .ipt {
- width: 380rpx;
- height: 77rpx;
- background: #f7f7f7;
- border-radius: 38px;
- padding: 0 37rpx;
- box-sizing: border-box;
- margin-right: 20rpx;
- }
- .control {
- flex: 1;
- display: flex;
- align-items: center;
- justify-content: flex-end;
- .block {
- display: flex;
- align-items: center;
- justify-content: center;
- flex: 1;
- }
- .icon {
- height: auto;
- }
- .c {
- width: 41rpx;
- margin-right: 10rpx;
- }
- .s {
- width: 36rpx;
- }
- .t {
- width: 31rpx;
- }
- }
- }
- .container {
- padding: 0 0 100rpx;
- }
- .u-cell-icon {
- width: 36rpx;
- height: 36rpx;
- margin-right: 8rpx;
- }
- .slot-box {
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- flex-direction: row;
- align-items: center;
- }
- .slot-image {
- /* #ifndef APP-NVUE */
- display: block;
- /* #endif */
- margin-right: 10px;
- width: 30px;
- height: 30px;
- }
- .slot-text {
- flex: 1;
- font-size: 14px;
- color: #4cd964;
- margin-right: 10px;
- }
- .img-container {
- margin-bottom: 0px;
- width: 100px;
- height: 100px;
- .note-image-box {
- margin-top: 0px;
- display: flex;
- flex-wrap: wrap;
- padding: 10px;
- .note-image-item {
- position: relative;
- width: 100%;
- height: 0;
- padding-top: 100%;
- box-sizing: border-box;
- // background-color: #18B566;
- .close-icon {
- display: flex;
- justify-content: center;
- align-items: center;
- position: absolute;
- right: 0px;
- top: 0px;
- width: 22px;
- height: 22px;
- border-radius: 50%;
- background-color: #d5d5d5;
- z-index: 2;
- }
- .image-box {
- display: flex;
- justify-content: center;
- align-items: center;
- position: absolute;
- top: 5px;
- right: 5px;
- border: 5px;
- left: 5px;
- border: 1px #eee solid;
- border-radius: 5px;
- overflow: hidden;
- width: 98%;
- height: 98%;
- }
- }
- }
- }
- .input-body {
- background-color: #fff;
- padding: 10px;
- }
- </style>
|