sqmoneydetail.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <template>
  2. <view class="mdetail">
  3. <uni-data-picker :map="map" :readonly='readonly' :localdata="assetTree" v-model="datainfo.assetId" >
  4. </uni-data-picker>
  5. <!-- <view class="mdtit">车辆资产 / {{datainfo.assetName}}</view> -->
  6. <view class="mdbox">
  7. <image :src="yy_code" class="code"></image>
  8. <view class="down flexcc" @click="getDown">
  9. <image :src="downico"></image>保存二维码至手机
  10. </view>
  11. <image :src="line" class="line mb20"></image>
  12. <view class="mdlist flex mb14"><view class="tit">资产名称:</view>{{datainfo.equipmentName}}</view>
  13. <view class="mdlist flex mb14"><view class="tit">资产编号:</view>{{datainfo.equipmentNumber}}</view>
  14. <view class="mdlist flex mb14"><view class="tit">资产型号:</view>{{datainfo.equipmentModel}}</view>
  15. <view class="mdlist flex mb14"><view class="tit">存放位置或使用位置:</view>{{datainfo.equipmentLocation}}</view>
  16. <view class="mdlist flex mb14"><view class="tit">购买价格:</view>{{datainfo.equipmentPrice}}
  17. <!-- <view class="coby">复制</view> -->
  18. </view>
  19. <view class="mdlist flex mb14"><view class="tit">购买时间:</view>{{datainfo.purchaseDate}}</view>
  20. <view class="mdlist flex mb14"><view class="tit">资产状态:</view>{{kaType(datainfo.equipmentStatus,sbztList)}}</view>
  21. <view class="mdlist flex mb14"><view class="tit">用途描述:</view>{{datainfo.equipmentPurpose}}</view>
  22. <view class="mdlist flex mb14"><view class="tit">车牌号:</view>{{datainfo.plateNumber}}</view>
  23. <view class="mdlist flex mb14"><view class="tit">备注信息:</view>{{datainfo.remark}}</view>
  24. <view class="mdlist flex mb14"><view class="tit">设备封面:</view>
  25. <view class="imgs">
  26. <block v-if="fmphofile&&fmphofile.length">
  27. <view class="img" v-for="(ite,idx) in fmphofile" :key="idx" @click="getPreview(idx,fmphofile)">
  28. <image :src="baseUrl+ite" class="pimg"></image>
  29. </view>
  30. </block>
  31. </view>
  32. </view>
  33. <view class="mdlist flex mb14"><view class="tit">设备图片:</view>
  34. <view class="imgs">
  35. <block v-if="phofile&&phofile.length">
  36. <view class="img" v-for="(ite,idx) in phofile" :key="idx" @click="getPreview(idx,phofile)">
  37. <image :src="baseUrl+ite" class="pimg"></image>
  38. </view>
  39. </block>
  40. </view>
  41. </view>
  42. <view class="flex1"></view>
  43. <view class="rhbtn mb12 mt30" v-if="pfrom=='list'&&checkPermi(['wuYe:assets:edit'])" @click="getput">修改</view>
  44. <view class="time">最近更新时间:2025-03-03 17:35:56</view>
  45. </view>
  46. <loading></loading>
  47. </view>
  48. </template>
  49. <script>
  50. import config from '@/config'
  51. const baseUrl = config.baseUrl;
  52. import {selectDictValue} from "@/utils/common.js"
  53. import {getDictionaryFn} from "@/api/system/user.js"
  54. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  55. import {assetsDet,assetTypeTree} from "@/api/work/manage.js"
  56. import QR from "@/utils/wxqrcode.js" // 二维码生成器
  57. export default{
  58. components:{},
  59. data(){
  60. return{
  61. downico:require('@/manage/static/community/downico.png'),
  62. line:require('@/manage/static/community/line.png'),
  63. id:'',
  64. datainfo:{},
  65. pfrom:"",
  66. sbztList:[],
  67. baseUrl:config.baseUrl,
  68. readonly:true,
  69. fmphofile:[],
  70. phofile:[],
  71. assetTree:[],
  72. map:{text:'label',value:'id'},
  73. yy_code:'',
  74. }
  75. },
  76. onLoad: function(e) {
  77. this.id=e.id;
  78. if(e.from){
  79. this.pfrom=e.from
  80. }
  81. this.init()
  82. this.getDetailFn()
  83. },
  84. methods:{
  85. checkPermi, checkRole,
  86. kaType(data, list) {
  87. return selectDictValue(list, data);
  88. },
  89. init(){
  90. assetTypeTree().then(res=>{
  91. if(res.code==200){
  92. this.assetTree=res.data;
  93. }
  94. })
  95. //设备状态
  96. getDictionaryFn('shebei_status').then(res=>{
  97. if(res.code==200){
  98. if(res.data){
  99. this.sbztList = res.data.map(v => {
  100. return {
  101. dictLabel: v.dictLabel,
  102. dictValue: v.dictValue
  103. }
  104. })
  105. }
  106. }
  107. })
  108. },
  109. getDown(urls){
  110. // var url=this.baseUrl+urls
  111. var url=this.yy_code;
  112. // uni.downloadFile({
  113. // url: url,//文件的下载路径
  114. // success(res) {
  115. // if (res.statusCode === 200) {
  116. // uni.saveImageToPhotosAlbum({ //保存图片到系统相册。
  117. // filePath: res.tempFilePath, //图片文件路径
  118. // success: function() {
  119. // uni.showToast({
  120. // title: '图片保存成功',
  121. // icon: 'none',
  122. // });
  123. // },
  124. // fail: function(e) {
  125. // uni.showToast({
  126. // title: '图片保存失败',
  127. // icon: 'none',
  128. // });
  129. // }
  130. // });
  131. // }
  132. // },
  133. // fail(res) {
  134. // uni.hideLoading()
  135. // }
  136. // })
  137. },
  138. getPreview(idx,arr) {
  139. var newArr=[];
  140. arr.forEach(ite=>{
  141. var ds=this.baseUrl+ite
  142. newArr.push(ds)
  143. })
  144. uni.previewImage({
  145. urls: newArr,
  146. current:idx,
  147. success: function(data) {},
  148. fail: function(err) {}
  149. });
  150. },
  151. getDetailFn(){
  152. var that=this;
  153. assetsDet(this.id).then(res=>{
  154. if(res.code==200){
  155. this.datainfo=res.data;
  156. this.yy_code = QR.createQrCodeImg(this.id, {
  157. size: parseInt(240),//二维码大小
  158. typeNumber:10
  159. })
  160. if(res.data.equipmentCoverPhoto){
  161. this.fmphofile=res.data.equipmentCoverPhoto.split(',')
  162. }
  163. if(res.data.equipmentPhotos){
  164. this.phofile=res.data.equipmentPhotos.split(',')
  165. }
  166. }
  167. })
  168. },
  169. getput(){
  170. this.$tab.navigateTo("/manage/pages/community/sqmoneyadd?id="+this.id)
  171. },
  172. }
  173. }
  174. </script>
  175. <style>
  176. page{background: #F3F3F0;}
  177. </style>
  178. <style lang="scss" scoped>
  179. .mdetail /deep/ .input-value-border{border: none !important;font-weight: bold;font-size: 34rpx;color: #161616;padding: 16rpx 6rpx;}
  180. .mdetail{background: linear-gradient(180deg, #CCDDFF 0%, #F3F3F0 100%) no-repeat;min-height: 100vh;background-position: top;background-size: 100% 578rpx;padding: 32rpx 30rpx 26rpx;position: relative;display: flex;flex-direction: column;}
  181. // .mdtit{font-weight: bold;font-size: 34rpx;color: #161616;padding: 16rpx 6rpx;}
  182. .mdbox{width: 100%;background: #FFFFFF;border-radius: 20rpx;flex: 1;padding: 84rpx 24rpx 80rpx;box-sizing: border-box;display: flex;flex-direction: column;
  183. .code{width: 222rpx;height: 222rpx;margin: 0 auto 20rpx;display: block;}
  184. .down{font-weight: 500;font-size: 24rpx;color: #161616;margin-bottom: 54rpx;
  185. image{width: 18rpx;height: 20rpx;margin-right: 10rpx;}
  186. }
  187. .line{width: 100%;height: 14rpx;}
  188. .mdlist{font-weight: bold;font-size: 26rpx;color: #272727;
  189. .tit{font-weight: 500;color: #AAAAAA;flex: 0 0 auto;}
  190. .coby{font-weight: 500;margin-left: 18rpx;flex: 0 0 auto;font-size: 24rpx;color: #0256FD;}
  191. }
  192. .time{font-weight: 500;font-size: 24rpx;color: #AAAAAA;text-align: center;}
  193. .imgs{display: flex;align-items: center;flex-wrap: wrap;
  194. .img{width: 142rpx;height:142rpx;border-radius: 20rpx;margin: 0 28rpx 20rpx 0;position: relative;
  195. &:nth-of-type(4n){margin-right: 0;}
  196. }
  197. .pimg{width: 100%;height: 100%;border-radius: 20rpx;}
  198. }
  199. }
  200. </style>