sqmoneyadd.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <template>
  2. <view >
  3. <uni-forms ref="form" :model="datainfo">
  4. <view class="check">
  5. <view class="cbox">
  6. <view class="chmain">
  7. <uni-forms-item label="资讯类型" name="phonenumber">
  8. <!-- <picker range-key='dictLabel' :value="syqxidx" :range="sexs" @change='bindDateChange'>
  9. <view class="flexc">
  10. <view class="flex1 txr f13" :class="datainfo.iszc?'co27':'coa'">{{datainfo.iszc?'是':'请选择资讯类型'}}</view>
  11. <view class="rimg"><image :src="rimg"></image></view>
  12. </view>
  13. </picker> -->
  14. <uni-data-picker :map="map" placeholder="请选择" popup-title="请选择" :localdata="assetTree" v-model="classes"
  15. @change="onchange" @nodeclick="onnodeclick" @popupopened="onpopupopened" @popupclosed="onpopupclosed">
  16. </uni-data-picker>
  17. </uni-forms-item>
  18. </view>
  19. </view>
  20. <view class="cbox" style="flex: 1;">
  21. <view class="chmain">
  22. <uni-forms-item label-width='0' name="realName">
  23. <uni-easyinput type="textarea" autoHeight v-model="datainfo.realName" :inputBorder='false' placeholder="资产名称" />
  24. </uni-forms-item>
  25. <uni-forms-item label-width='0' name="realName">
  26. <uni-easyinput type="textarea" autoHeight v-model="datainfo.realName" :inputBorder='false' placeholder="购买时间" />
  27. </uni-forms-item>
  28. <uni-forms-item label-width='0' name="realName">
  29. <uni-easyinput type="textarea" autoHeight v-model="datainfo.realName" :inputBorder='false' placeholder="用途描述" />
  30. </uni-forms-item>
  31. <uni-forms-item label-width='0' name="realName">
  32. <uni-easyinput type="textarea" autoHeight v-model="datainfo.realName" :inputBorder='false' placeholder="资产状态" />
  33. </uni-forms-item>
  34. <uni-forms-item label-width='0' name="realName">
  35. <uni-easyinput type="textarea" autoHeight v-model="datainfo.realName" :inputBorder='false' placeholder="备注信息" />
  36. </uni-forms-item>
  37. <view class="imgs">
  38. <view class="img" @click="getPreview">
  39. <image :src="car" class="pimg"></image>
  40. <image :src="del" class="del" @click="getDelFn"></image>
  41. </view>
  42. <view class="addbox" @click="getaddImage">
  43. <image :src="photo"></image>
  44. <view>添加图片</view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="rfbtn" @click="getSubmit">确定</view>
  50. <loading></loading>
  51. </view>
  52. </uni-forms>
  53. </view>
  54. </template>
  55. <script>
  56. import config from '@/config'
  57. import editorBox from "@/manage/components/editor/editor.vue"
  58. import {checkPermi,checkRole} from "@/utils/permission"; // 权限判断函数
  59. import {uploadIdentify} from '@/utils/common.js'
  60. import {assetTypeAdd,assetTypeTree} from "@/api/work/manage.js"
  61. export default {
  62. components: {editorBox},
  63. data() {
  64. return {
  65. rimg: require('@/people/static/people/rimg.png'),
  66. photo:require("@/service/static/service/photo.png"),
  67. car:require('@/car/static/car/carico.png'),
  68. del:require('@/service/static/service/rdel.png'),
  69. baseUrl: config.baseUrl,
  70. datainfo: {
  71. "parentId":"",//父资产类型id
  72. "ancestors":"",//祖级列表
  73. "assetName":"",//资产类型名称
  74. "orderNum":"",//显示顺序
  75. "status":"",//资产类型状态(0正常 1停用)
  76. "delFlag":"",//删除标志(0代表存在 2代表删除)
  77. "parentName":"",//父资产名称
  78. "children":"",//子资产类型
  79. },
  80. assetTree:[],
  81. map:{text:'label',value:'id'},
  82. phofile:[],
  83. }
  84. },
  85. onLoad: function() {
  86. this.init()
  87. },
  88. methods: {
  89. checkPermi,
  90. checkRole,
  91. init(){
  92. assetTypeTree().then(res=>{
  93. if(res.code==200){
  94. this.assetTree=res.data;
  95. // if(res.data&&res.data.length){
  96. // this.tabval=res.data[0].id;
  97. // var children=JSON.parse(JSON.stringify(res.data[0].children))
  98. // this.tablist=children;
  99. // this.tabval=children[0].id;
  100. // this.getDataFn()
  101. // }
  102. }
  103. })
  104. },
  105. onchange(e){
  106. console.log(e)
  107. },
  108. getSubmit(){
  109. },
  110. bindDateChange(e){
  111. var val=e.detail.value;
  112. // this.datainfo.applicationBank=this.sdyhlist[val].value;
  113. // this.applicationBank=this.sdyhlist[val].label;
  114. },
  115. getPreview(idx,arr) {
  116. var newArr=[];
  117. arr.forEach(ite=>{
  118. var ds=this.baseUrl+ite
  119. newArr.push(ds)
  120. })
  121. uni.previewImage({
  122. urls: newArr,
  123. current:idx,
  124. success: function(data) {},
  125. fail: function(err) {}
  126. });
  127. },
  128. getDelFn(){
  129. var that=this;
  130. uni.showModal({
  131. title: '确认删除',
  132. content: "是否确认删除",
  133. cancelText: '取消',
  134. confirmText: '确认',
  135. success: function(res) {
  136. if (res.confirm) {
  137. // that.filelist.splice(idx,1)
  138. } else if (res.cancel) {
  139. }
  140. }
  141. });
  142. },
  143. getaddImage(e){
  144. let that = this;
  145. // var rs=['D:\\idcard.png']
  146. // if(rs&&rs.length>0){
  147. // var obj={
  148. // type:e,
  149. // // url:baseUrl+rs.join(',')
  150. // url:rs.join(',')
  151. // }
  152. // that.getOcrIdCard(obj)
  153. // }
  154. // return
  155. let file =[],count=9
  156. uni.chooseImage({
  157. success:function(res){
  158. let img= res.tempFilePaths;
  159. if(img.length + file.length > count){
  160. uni.showToast({
  161. title: '最多上传'+count+'张图片',
  162. icon: 'none',
  163. duration: 2000
  164. })
  165. }else{
  166. let imglen = res.tempFilePaths.length;
  167. var fuwufile = [];
  168. uploadmore('/common/upload',img,0,0,0,imglen,fuwufile,function(rs){
  169. that.phofile = that.phofile.concat(rs);
  170. })
  171. }
  172. }
  173. });
  174. },
  175. }
  176. }
  177. </script>
  178. <style>
  179. page{background: #F3F3F0;}
  180. </style>
  181. <style lang="scss" scoped>
  182. .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;}
  183. .check .cbox /deep/ .uni-forms-item:last-child{border: none;}
  184. .check /deep/ .uni-forms-item__label{font-weight: bold;font-size: 26rpx;color: #222327;flex: 0 0 auto;width: auto !important;}
  185. .check /deep/ .uni-easyinput{flex: 1;text-align: left;font-size: 26rpx;color: #222327;}
  186. .check /deep/ .uni-easyinput__content-textarea{min-height: 40rpx;font-size: 26rpx;}
  187. .check /deep/ .uni-easyinput__placeholder-class{font-size: 26rpx;color: #AAAAAA;}
  188. .check /deep/ .uni-easyinput__content-input{padding-left: 0 !important;}
  189. .check /deep/ .uni-input-input{font-size: 26rpx;}
  190. .check /deep/ .uni-textarea-textarea{font-size: 26rpx;}
  191. .check /deep/ .is-disabled{color: #222327;background-color: #ffffff !important;}
  192. .check /deep/ .uni-data-checklist .checklist-group .checklist-box{margin:10rpx 8rpx 10rpx 16rpx;}
  193. .check /deep/ .uni-data-checklist{flex: 0 0 auto;}
  194. .check{min-height: 100vh;padding: 20rpx 18rpx 110rpx;box-sizing: border-box;box-sizing: border-box;display: flex;flex-direction: column;}
  195. .cbox{background: #FFFFFF;border-radius: 20rpx;flex: 1;margin-bottom: 24rpx;display: flex;flex-direction: column;flex:0 0 auto;
  196. .chmain{
  197. padding: 0 32rpx;
  198. .rimg{width: 16rpx;height: 28rpx;flex: 0 0 auto;margin-left: 20rpx;
  199. image{width: 100%;height: 100%;}
  200. }
  201. .checkimg{width: 80rpx;height: 40rpx;margin-right: 8rpx;}
  202. .imgs{display: flex;align-items: center;flex-wrap: wrap;margin-top: 60rpx;
  203. .img{width: 142rpx;height:142rpx;border-radius: 20rpx;margin: 0 28rpx 20rpx 0;position: relative;
  204. &:nth-of-type(4n){margin-right: 0;}
  205. }
  206. .pimg{width: 100%;height: 100%;border-radius: 20rpx;}
  207. .del{width: 24rpx;height: 24rpx;position: absolute;right: 0;top: 0;}
  208. }
  209. .addbox{background: #F0F0F0;border-radius: 20rpx;display: flex;align-items: center;flex-direction: column;width: 142rpx;height:142rpx;justify-content: center;margin-bottom: 20rpx;
  210. image{width: 48rpx;height: 42rpx;margin-bottom: 12rpx;}
  211. view{font-weight: 500;font-size: 24rpx;color: #666666;}
  212. }
  213. }
  214. }
  215. </style>