patroladd.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <template>
  2. <view class="check">
  3. <uni-forms ref="form" :model="datainfo">
  4. <view class="cbox">
  5. <view class="patlist">
  6. <view class="pattop flexc">
  7. <image :src="home" class="imgs"></image>
  8. <view class="tit">幸福小区1栋2单元电梯间</view>
  9. <view class="flex1"></view>
  10. </view>
  11. <view class="patlistr">
  12. <view class="clist"><view class="tit">巡检类型</view>:设备维修</view>
  13. <view class="clist"><view class="tit">巡检时间</view>:2024-11-27 10:00</view>
  14. <view class="clist"><view class="tit">巡检路线</view>:幸福小区1号楼1-2单元</view>
  15. <view class="clist"><view class="tit">巡检人</view>:刘兵琦</view>
  16. </view>
  17. </view>
  18. </view>
  19. <view class="cbox" style="padding-bottom: 98rpx;">
  20. <view class="chmain">
  21. <uni-forms-item label="巡检结果" name="phonenumber">
  22. <picker range-key='text' :value="syqxidx" :range="sexs" @change='bindDateChange'>
  23. <view class="flexc">
  24. <view class="flex1 txr f13" :class="datainfo.iszc?'co27':'coa'">{{datainfo.iszc?'是':'请选择是否正常'}}</view>
  25. <view class="rimg"><image :src="rimg"></image></view>
  26. </view>
  27. </picker>
  28. </uni-forms-item>
  29. <uni-easyinput maxlength='-1' type="textarea" autoHeight v-model="datainfo.companyIntroduction" :inputBorder='false' placeholder="可详细描述巡检结果…" />
  30. <view class="voice mb20">
  31. <view class="flexc">
  32. <image :src="voice"></image>
  33. 语音输入
  34. </view>
  35. </view>
  36. <!-- 图片 -->
  37. <view class="imgs">
  38. <view class="img" @click="getPreview">
  39. <image :src="photo" class="pico"></image>
  40. <image :src="del" class="del" @click="getDelFn"></image>
  41. </view>
  42. <view class="img" @click="getPreview">
  43. <image :src="photo" class="pico"></image>
  44. <image :src="del" class="del" @click="getDelFn"></image>
  45. </view>
  46. <view class="img" @click="getPreview">
  47. <image :src="photo" class="pico"></image>
  48. <image :src="del" class="del" @click="getDelFn"></image>
  49. </view>
  50. <view class="img" @click="getPreview">
  51. <image :src="photo" class="pico"></image>
  52. <image :src="del" class="del" @click="getDelFn"></image>
  53. </view>
  54. <view class="addbox" @click="getaddImage">
  55. <image :src="photo" class="pico"></image>
  56. <view>添加图片</view>
  57. </view>
  58. </view>
  59. </view>
  60. <view class="pdlr12 mt63">
  61. <view class="rhbtn" @click="getNext">提交信息</view>
  62. </view>
  63. </view>
  64. </uni-forms>
  65. <loading></loading>
  66. </view>
  67. </template>
  68. <script>
  69. import config from '@/config'
  70. import {checkPermi,checkRole} from "@/utils/permission"; // 权限判断函数
  71. import {uploadmore} from '@/utils/common.js'
  72. export default {
  73. components: {},
  74. data() {
  75. return {
  76. voice: require('@/work/static/service/voice.png'),
  77. home:require("@/work/static/service/home.png"),
  78. photo:require("@/work/static/service/photo.png"),
  79. del:require('@/work/static/car/del.png'),
  80. rimg: require('@/work/static/people/rimg.png'),
  81. baseUrl: config.baseUrl,
  82. checkflag:true,
  83. datainfo: {
  84. sex:0,
  85. },
  86. syqxidx:'',
  87. sexs: [{
  88. text: '男',
  89. value: 0
  90. }, {
  91. text: '女',
  92. value: 1
  93. }],
  94. }
  95. },
  96. onLoad: function() {
  97. },
  98. methods: {
  99. checkPermi,
  100. checkRole,
  101. bindDateChange(e){
  102. var val=e.detail.value;
  103. // this.datainfo.applicationBank=this.sdyhlist[val].value;
  104. // this.applicationBank=this.sdyhlist[val].label;
  105. },
  106. getPreview(idx,arr) {
  107. var newArr=[];
  108. arr.forEach(ite=>{
  109. var ds=this.baseUrl+ite
  110. newArr.push(ds)
  111. })
  112. uni.previewImage({
  113. urls: newArr,
  114. current:idx,
  115. success: function(data) {},
  116. fail: function(err) {}
  117. });
  118. },
  119. getDelFn(){
  120. var that=this;
  121. uni.showModal({
  122. title: '确认删除',
  123. content: "是否确认删除",
  124. cancelText: '取消',
  125. confirmText: '确认',
  126. success: function(res) {
  127. if (res.confirm) {
  128. // that.filelist.splice(idx,1)
  129. } else if (res.cancel) {
  130. }
  131. }
  132. });
  133. },
  134. getaddImage(e){
  135. let that = this;
  136. // var rs=['D:\\idcard.png']
  137. // if(rs&&rs.length>0){
  138. // var obj={
  139. // type:e,
  140. // // url:baseUrl+rs.join(',')
  141. // url:rs.join(',')
  142. // }
  143. // that.getOcrIdCard(obj)
  144. // }
  145. // return
  146. let file =[],count=9
  147. uni.chooseImage({
  148. count: 1,
  149. success:function(res){
  150. let img= res.tempFilePaths;
  151. if(img.length + file.length > count){
  152. uni.showToast({
  153. title: '最多上传'+count+'张图片',
  154. icon: 'none',
  155. duration: 2000
  156. })
  157. }else{
  158. let imglen = res.tempFilePaths.length;
  159. var fuwufile = [];
  160. uploadmore('/common/upload',img,0,0,0,imglen,fuwufile,function(rs){
  161. var resurl=rs[0];
  162. // if(e=='front'){
  163. // that.datainfo.front=resurl.fileName;
  164. // }else{
  165. // that.datainfo.back=resurl.fileName;
  166. // }
  167. })
  168. }
  169. }
  170. });
  171. },
  172. }
  173. }
  174. </script>
  175. <style>
  176. page{background: #F3F3F0;}
  177. </style>
  178. <style lang="scss" scoped>
  179. .check /deep/ .uni-forms-item{min-height: 106rpx;box-sizing: border-box;display: flex;align-items: center;margin-bottom: 0;border-bottom: 2rpx solid #E6E6E6;padding:10rpx 0;}
  180. .check .cbox /deep/ .uni-forms-item:last-child{border: none;}
  181. .check /deep/ .uni-forms-item__label{font-weight: bold;font-size: 26rpx;color: #222327;flex: 0 0 auto;width: auto !important;}
  182. .check /deep/ .uni-easyinput{flex: 1;text-align: left;font-size: 26rpx;color: #222327;padding-left: 12rpx;min-height: 200rpx;}
  183. .check /deep/ .uni-easyinput__content-textarea{min-height: 40rpx;font-size: 26rpx;}
  184. .check /deep/ .uni-easyinput__placeholder-class{font-size: 26rpx;color: #AAAAAA;}
  185. .check /deep/ .uni-input-input{font-size: 26rpx;}
  186. .check /deep/ .uni-textarea-textarea{font-size: 26rpx;}
  187. .check /deep/ .is-disabled{color: #222327;background-color: #ffffff !important;}
  188. .check /deep/ .uni-data-checklist .checklist-group .checklist-box{margin:10rpx 8rpx 10rpx 16rpx;}
  189. .check /deep/ .uni-data-checklist{flex: 0 0 auto;}
  190. .check{min-height: 100vh;padding: 20rpx 18rpx 24rpx;box-sizing: border-box;}
  191. .cbox{background: #FFFFFF;border-radius: 20rpx;flex: 1;margin-bottom: 24rpx;
  192. .chmain{padding: 0 32rpx;
  193. .rimg{width: 16rpx;height: 28rpx;flex: 0 0 auto;margin-left: 20rpx;
  194. image{width: 100%;height: 100%;}
  195. }
  196. }
  197. .voice{font-weight: 500;display: flex;justify-content:flex-end;align-items: center;margin-top: 40rpx;
  198. font-size: 24rpx;
  199. color: #45CB99;
  200. image{width: 24rpx;height: 24rpx;margin-right: 8rpx;}
  201. }
  202. .imgs{display: flex;align-items: center;flex-wrap: wrap;
  203. .img{width: 142rpx;height:142rpx;border-radius: 20rpx;margin: 0 26rpx 20rpx 0;position: relative;
  204. &:nth-of-type(4n){margin-right: 0;}
  205. }
  206. .pico{width: 100%;height: 100%;border-radius: 20rpx;}
  207. .del{width: 24rpx;height: 24rpx;position: absolute;right: 0;top: 0;}
  208. .addbox{background: #F0F0F0;border-radius: 20rpx;display: flex;align-items: center;flex-direction: column;width: 142rpx;height:142rpx;justify-content: center;margin-bottom: 20rpx;
  209. image{width: 48rpx;height: 42rpx;margin-bottom: 12rpx;}
  210. view{font-weight: 500;font-size: 24rpx;color: #666666;}
  211. }
  212. }
  213. }
  214. .patlist{background: #FFFFFF;border-radius: 20rpx;margin-bottom: 24rpx;padding: 0 24rpx 30rpx;
  215. .pattop{padding:22rpx 30rpx;margin-bottom: 2rpx;
  216. .imgs{width: 28rpx;height: 28rpx;margin-right: 12rpx;}
  217. .tit{font-size: 30rpx;color: #272727;font-weight: bold;margin-right: 14rpx;}
  218. .txt{font-weight: 500;font-size:24rpx;
  219. &.ca{color: #3565ED;}
  220. &.cb{color: #FE5A0E;}
  221. &.cc{color: #28C529;}
  222. &.cd{color: #FF6969;}
  223. }
  224. }
  225. .patlistr{background: #EFF4FF;border-radius: 20rpx;padding: 20rpx 32rpx;
  226. .clist{font-weight: 500;font-size: 26rpx;color: #272727;display: flex;line-height: 50rpx;
  227. .tit{font-size: 26rpx;flex: 0 0 auto;min-width: 108rpx;text-align-last: justify;font-weight: bold;}
  228. }
  229. }
  230. }
  231. </style>