applyregister.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. <template>
  2. <view class="regbox flexdc">
  3. <uni-forms ref="form" :rules="rules" :modelValue="variables">
  4. <!-- <uni-forms-item label="学校" required name="schoolName">
  5. <uni-easyinput :inputBorder="false" v-model="variables.schoolName" placeholder="请输入学校名称"></uni-easyinput>
  6. <view class="rimg"> </view>
  7. </uni-forms-item> -->
  8. <view @click="getSchoolFn">
  9. <uni-forms-item label="学校" name="schoolName">
  10. <view class="f16 flex1 txr" :class="variables.schoolName?'co16':'coa'">{{variables.schoolName||'请选择学校'}}</view>
  11. <view class="rimg"><image :src="rimg" class="rimgs"></image> </view>
  12. </uni-forms-item>
  13. </view>
  14. <!-- <picker range-key='dictLabel' :value="xxindex" :range="schoolval" @change='bindDateChangea'>
  15. <uni-forms-item label="学校" name="schoolName">
  16. <view class="f16 flex1 txr" :class="variables.schoolName?'co16':'coa'">{{variables.schoolName||'请选择学校'}}</view>
  17. <view class="rimg"><image :src="rimg" class="rimgs"></image> </view>
  18. </uni-forms-item>
  19. </picker> -->
  20. <uni-forms-item name="userName" required label="负责人姓名">
  21. <uni-easyinput :inputBorder="false" v-model="variables.userName" placeholder="请输入负责人姓名"></uni-easyinput>
  22. <view class="rimg"> </view>
  23. </uni-forms-item>
  24. <uni-forms-item name="userPhone" required label="联系方式">
  25. <uni-easyinput :inputBorder="false" type="number" v-model="variables.userPhone" placeholder="请输入您的联系方式"></uni-easyinput>
  26. <view class="rimg"> </view>
  27. </uni-forms-item>
  28. <view class="noborder">
  29. <uni-forms-item name="registerSchoolFileList" style='margin-bottom: 0;'>
  30. <view class="flexc" style="width: 100%;">
  31. <view class="f16 fw co16 flex0 ">上传资质</view>
  32. <view class="infolist_a co47" ><lsj-upload
  33. ref="lsjUpload"
  34. childId="upload1"
  35. :width="width"
  36. :height="height"
  37. :option="option"
  38. :size="size"
  39. :count="count"
  40. :formats="formats"
  41. :debug="debug"
  42. :instantly="instantly"
  43. @progress=""
  44. @uploadEnd="onuploadEnd" >
  45. <view class="btn" :style="{width: width,height: height}">去上传</view>
  46. </lsj-upload></view>
  47. </view>
  48. </uni-forms-item>
  49. </view>
  50. <view>
  51. <view class="cldelistbf flexc" v-for="(ite,idx) in filelist" :key='idx'>
  52. <view class="flext f15 co16 flex1" @click="getDown(ite.url)">
  53. <view class="imgl"><image :src="wimg" ></image></view>
  54. <view class="tit">{{ite.name}}</view>
  55. </view>
  56. <!-- 删除 -->
  57. <view class="delimg flex0" @click.stop="getDelFj(idx)">
  58. <image :src="delimg" class="imgr"></image>
  59. </view>
  60. </view>
  61. </view>
  62. <view class="infolist_tit">注:须上传学校法人营业执照,或后期补传</view>
  63. <view class="infolist_b"><text>*</text>请上传大小不超过<text>100MB</text>格式为<text>pdf</text>的文件</view>
  64. </uni-forms>
  65. <view class="mt26">
  66. <view class="rbtn" @click="getSubmit">提交</view>
  67. <view class="apllytxt"><text>*</text>请确认您提交的信息真实有效</view>
  68. </view>
  69. </view>
  70. </template>
  71. <script>
  72. // import tabSearch from "@/components/toptab/search.vue"
  73. import config from '@/config'
  74. const baseUrl = config.baseUrl
  75. const Clientid = config.Clientid
  76. import { getToken } from '@/utils/auth'
  77. import {getschoolregFn,getschoolDetFn,getschoolPutFn} from "@/api/mine/register.js"
  78. import {getDeptList} from "@/api/mine/mine.js"
  79. export default {
  80. props:{
  81. schoolval:{
  82. type: Array,
  83. default () {
  84. return []
  85. }
  86. },
  87. schoolobj:{
  88. type: Object,
  89. default () {
  90. return {}
  91. }
  92. }
  93. },
  94. watch:{
  95. schoolobj(val){
  96. this.schooltit=val
  97. this.variables.schoolName=val.schoolName
  98. }
  99. },
  100. mounted() {
  101. },
  102. data(){
  103. return{
  104. //附件
  105. option: {
  106. // 上传服务器地址,需要替换为你的接口地址
  107. // url: baseUrl+'/common/upload', // 该地址非真实路径,需替换为你项目自己的接口地址
  108. url: baseUrl+'/common/upload', // 该地址非真实路径,需替换为你项目自己的接口地址
  109. // 上传附件的key
  110. name: 'file',
  111. // 根据你接口需求自定义请求头,默认不要写content-type,让浏览器自适配
  112. header: {
  113. // 示例参数可删除
  114. 'Authorization': 'Bearer ' + getToken(),
  115. 'Clientid': Clientid,
  116. },
  117. // 根据你接口需求自定义body参数
  118. formData: {
  119. }
  120. },
  121. // 选择文件后是否立即自动上传,true=选择后立即上传
  122. instantly: true,
  123. // 必传宽高且宽高应与slot宽高保持一致
  124. width: '',
  125. height: '44rpx',
  126. // 限制允许上传的格式,空串=不限制,默认为空
  127. formats: 'pdf',
  128. // 文件上传大小限制
  129. size: 100,
  130. // 文件数量限制 默认10
  131. count: 5,
  132. // 文件回显列表
  133. files: new Map(),
  134. // 微信小程序Map对象for循环不显示,所以转成普通数组,不要问为什么,我也不知道
  135. wxFiles: [],
  136. // 是否打印日志
  137. debug: false,
  138. filelist:[],
  139. rimg:require("@/static/images/rimg.png"),
  140. wimg:require('@/static/images/read.png'),
  141. delimg:require('@/static/images/del.png'),
  142. cyvalue:'',
  143. cyindex:0,
  144. cylist:[{label:'是',id:'Y'},{label:'否',id:'N'}],
  145. variables:{
  146. "schoolName": "",
  147. "userName": "",
  148. "userPhone": "",
  149. "registerSchoolFileList": [],
  150. },
  151. rules: {
  152. schoolName: {rules: [{required: true,errorMessage: '请输入学校名称'}]},
  153. userName: {rules: [{required: true,errorMessage: '请输入负责人姓名'}]},
  154. userPhone: {rules: [{required: true,errorMessage: '请输入联系方式'},{pattern:"^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\\d{8}$",errorMessage: '请输入正确的联系方式'}]},
  155. // registerSchoolFileList: {rules: [{required: true,errorMessage: '请上传附件' } ]},
  156. },
  157. wxInfo:{},
  158. xxindex:[],
  159. id:'',
  160. type:'add',//页面类型
  161. schooltit:{},
  162. // procDefId:'flow_1se5q74i:17:32545',//流程定义id
  163. // deploymentId:'32542',
  164. // type:'',//0学校注册 1 家长 2 老师
  165. }
  166. },
  167. methods:{
  168. getSchoolFn(){
  169. console.log(this.schooltit)
  170. this.$tab.navigateTo(`/mine/pages/mine/school?id=`+this.schooltit.schoolNameId+'&name='+this.schooltit.schoolName)
  171. },
  172. // 选择学校
  173. bindDateChangea(e) {
  174. var val = e.detail.value;
  175. var v = this.schoolval[val];
  176. this.variables.schoolName=v.dictLabel
  177. this.variables.schoolId=v.dictValue
  178. },
  179. getSubmit(){
  180. var that=this;
  181. this.$refs.form.validate().then(res => {
  182. var params=JSON.parse(JSON.stringify(that.variables));
  183. // params.openId=that.wxInfo.openId;
  184. this.$emit('getschoolregFn',params)
  185. })
  186. },
  187. onuploadEnd(item) {
  188. var newobj={}
  189. var responseText=JSON.parse(item.responseText)
  190. // newobj.name=item.name;
  191. newobj.name=responseText.originalFilename;
  192. newobj.url=responseText.fileName;
  193. this.filelist.push(newobj)
  194. this.variables.registerSchoolFileList=JSON.parse(JSON.stringify(this.filelist))
  195. },
  196. getDelFj(idx){
  197. this.filelist.splice(idx,1)
  198. this.variables.registerSchoolFileList=JSON.parse(JSON.stringify(this.filelist))
  199. },
  200. getDown(e){
  201. uni.showLoading({
  202. title: '加载中'
  203. });
  204. var url=baseUrl+e;
  205. uni.downloadFile({
  206. url: url,//文件的下载路径
  207. success(result) {
  208. uni.hideLoading()
  209. var filePath = result.tempFilePath;
  210. uni.openDocument({
  211. filePath: filePath,
  212. showMenu: true,
  213. success: function (res) {
  214. }
  215. });
  216. },
  217. fail(res) {uni.hideLoading()}
  218. })
  219. },
  220. },
  221. }
  222. </script>
  223. <style lang="scss" scoped>
  224. .infolist_a{height: 44rpx;flex: 1;text-align: right;font-size: 32rpx;}
  225. .cldelistbf {
  226. padding: 20rpx 24rpx;
  227. image{flex: 0 0 auto;}
  228. .imgl{width: 40rpx;height: 40rpx;display: flex;align-items: center;justify-content: center;margin-right: 24rpx;
  229. image{width: 40rpx;height: 34rpx;}
  230. }
  231. .imgr{width: 30rpx;height: 30rpx;margin-left: 24rpx;}
  232. .tit{line-height: 40rpx;font-size: 32rpx;color: #161616;flex: 1;word-break: break-all;}
  233. }
  234. .infolist_b{color: #aaaaaa;font-size: 26rpx;padding:0 24rpx;margin-top:10rpx;
  235. text{word-break: break-all;margin: 0 4rpx;color: #ff0000;}
  236. }
  237. .infolist_tit{font-size: 26rpx;padding:0 24rpx;color: #ff0000;margin-top: 36rpx;}
  238. .regbox{padding: 20rpx 36rpx 80rpx;box-sizing: border-box;min-height: auto;overflow: auto;}
  239. .regbox /deep/ .uni-forms{flex: 1;}
  240. .regbox /deep/ .uni-forms-item__label{flex: 0 0 auto;width: auto !important;font-size: 32rpx;font-weight: bold;
  241. color: #161616;}
  242. .regbox /deep/ .uni-forms .uni-forms-item{padding: 36rpx 24rpx 20rpx;border-bottom: 2rpx #C1C1C1 solid;margin-bottom: 0;
  243. }
  244. .regbox /deep/ .uni-forms .noborder .uni-forms-item{margin-bottom: 0;border-bottom: 0;}
  245. .regbox /deep/ .uni-forms-item__content{display: flex;align-items: center;flex-direction: row;}
  246. .regbox /deep/ .uni-easyinput{flex: 1;text-align: right;}
  247. .regbox /deep/ .uni-easyinput__placeholder-class{font-size: 30rpx;}
  248. .regbox /deep/ .uni-easyinput__content-input{font-size: 30rpx;}
  249. .regbox /deep/ .uni-forms-item__error{margin-top:20rpx;left: auto;right: 0;}
  250. </style>