staffadd.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <template>
  2. <view class="check">
  3. <uni-forms ref="form" :model="datainfo">
  4. <view class="cbox">
  5. <view class="chtop flexc">
  6. <image :src="line"></image>
  7. <view>维修人员信息</view>
  8. </view>
  9. <view class="chmain">
  10. <uni-forms-item label="人员姓名" name="phonenumber">
  11. <view class="flexc">
  12. <uni-easyinput v-model="datainfo.phonenumber" :inputBorder='false' placeholder="请输入人员姓名" />
  13. <view class="rimg"><image :src="rimg"></image></view>
  14. </view>
  15. </uni-forms-item>
  16. <uni-forms-item label="人员性别" name="realName">
  17. <view class="flexc">
  18. <view class="flex1"></view>
  19. <uni-data-checkbox selectedColor="#0156FE" selectedTextColor="#272727" v-model="datainfo.sex" :localdata="sexs" />
  20. </view>
  21. </uni-forms-item>
  22. <uni-forms-item label="维修类别" name="phonenumber">
  23. <view class="flexc">
  24. <uni-easyinput v-model="datainfo.phonenumber" :inputBorder='false' placeholder="请选择或输入维修类别" />
  25. <picker range-key='text' :value="syqxidx" :range="sexs" @change='bindDateChange'>
  26. <view class="rimg"><image :src="rimg"></image></view>
  27. </picker>
  28. </view>
  29. </uni-forms-item>
  30. <uni-forms-item label="手机号码" name="phonenumber">
  31. <view class="flexc">
  32. <uni-easyinput v-model="datainfo.phonenumber" :inputBorder='false' placeholder="请输入手机号码" />
  33. <view class="rimg"></view>
  34. </view>
  35. </uni-forms-item>
  36. </view>
  37. </view>
  38. </uni-forms>
  39. <view class="pdlr12 mt55">
  40. <view class="rhbtn" @click="getNext">确定</view>
  41. </view>
  42. <loading></loading>
  43. </view>
  44. </template>
  45. <script>
  46. import config from '@/config'
  47. import {
  48. checkPermi,
  49. checkRole
  50. } from "@/utils/permission"; // 权限判断函数
  51. import {
  52. uploadIdentify
  53. } from '@/utils/common.js'
  54. export default {
  55. components: {},
  56. data() {
  57. return {
  58. line: require('@/work/static/car/line.png'),
  59. car: require('@/work/static/car/carico.png'),
  60. rimg: require('@/work/static/people/rimg.png'),
  61. aphoto: require('@/work/static/people/aphoto.png'),
  62. check: require('@/work/static/people/check.png'),
  63. ncheck: require('@/work/static/people/ncheck.png'),
  64. baseUrl: config.baseUrl,
  65. checkflag:true,
  66. datainfo: {
  67. sex:0,
  68. realName: '',
  69. idCard: '',
  70. address: '',
  71. expirationDate: '',
  72. phonenumber: '',
  73. front: '',
  74. back: '',
  75. },
  76. syqxidx:'',
  77. sexs: [{
  78. text: '男',
  79. value: 0
  80. }, {
  81. text: '女',
  82. value: 1
  83. }],
  84. }
  85. },
  86. onLoad: function() {
  87. },
  88. methods: {
  89. checkPermi,
  90. checkRole,
  91. bindDateChange(e){
  92. var val=e.detail.value;
  93. // this.datainfo.applicationBank=this.sdyhlist[val].value;
  94. // this.applicationBank=this.sdyhlist[val].label;
  95. },
  96. getaddImage(e) {
  97. let that = this;
  98. // var rs=['D:\\idcard.png']
  99. // if(rs&&rs.length>0){
  100. // var obj={
  101. // type:e,
  102. // // url:baseUrl+rs.join(',')
  103. // url:rs.join(',')
  104. // }
  105. // that.getOcrIdCard(obj)
  106. // }
  107. // return
  108. let file = [],
  109. count = 9
  110. uni.chooseImage({
  111. count: 1,
  112. success: function(res) {
  113. let img = res.tempFilePaths;
  114. if (img.length + file.length > count) {
  115. uni.showToast({
  116. title: '最多上传' + count + '张图片',
  117. icon: 'none',
  118. duration: 2000
  119. })
  120. } else {
  121. let imglen = res.tempFilePaths.length;
  122. var fuwufile = [];
  123. uploadIdentify('/common/upload', img, 0, 0, 0, imglen, fuwufile, function(rs) {
  124. var resurl = rs[0];
  125. if (e == 'front') {
  126. that.datainfo.front = resurl.fileName;
  127. } else {
  128. that.datainfo.back = resurl.fileName;
  129. }
  130. if (rs && rs.length > 0) {
  131. var obj = {
  132. type: e,
  133. url: resurl.urlOnline
  134. }
  135. that.getOcrIdCard(obj)
  136. }
  137. })
  138. }
  139. }
  140. });
  141. },
  142. getOcrIdCard(obj) {
  143. var params = {
  144. image: obj.url,
  145. idCardSide: obj.type
  146. }
  147. getOcrIdCard(params).then(res => {
  148. if (res.code == 200) {
  149. var datainfo = res.data;
  150. if (obj.type == 'front') {
  151. this.datainfo.realName = datainfo.realName;
  152. this.datainfo.idCard = datainfo.idCard;
  153. this.datainfo.address = datainfo.address;
  154. } else {
  155. this.datainfo.expirationDate = datainfo.expirationDate
  156. }
  157. }
  158. })
  159. }
  160. }
  161. }
  162. </script>
  163. <style>
  164. page{background: #F3F3F0;}
  165. </style>
  166. <style lang="scss" scoped>
  167. .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;}
  168. .check .cbox /deep/ .uni-forms-item:last-child{border: none;}
  169. .check /deep/ .uni-forms-item__label{font-weight: bold;font-size: 26rpx;color: #222327;flex: 0 0 auto;width: auto !important;}
  170. .check /deep/ .uni-easyinput{flex: 1;text-align: right;font-size: 26rpx;color: #222327;}
  171. .check /deep/ .uni-easyinput__content-textarea{min-height: 40rpx;font-size: 26rpx;}
  172. .check /deep/ .uni-easyinput__placeholder-class{font-size: 26rpx;color: #AAAAAA;}
  173. .check /deep/ .uni-input-input{font-size: 26rpx;}
  174. .check /deep/ .uni-textarea-textarea{font-size: 26rpx;}
  175. .check /deep/ .is-disabled{color: #222327;background-color: #ffffff !important;}
  176. .check /deep/ .uni-data-checklist .checklist-group .checklist-box{margin:10rpx 8rpx 10rpx 16rpx;}
  177. .check /deep/ .uni-data-checklist{flex: 0 0 auto;}
  178. .check{min-height: 100vh;padding: 20rpx 18rpx 24rpx;box-sizing: border-box;}
  179. .cbox{background: #FFFFFF;border-radius: 20rpx;flex: 1;margin-bottom: 24rpx;
  180. .chtop{padding-top: 32rpx;margin-bottom: 8rpx;
  181. image{width: 14rpx;height: 48rpx;margin-right: 20rpx;}
  182. view{font-weight: bold;font-size: 32rpx;color: #272727;}
  183. }
  184. .chmain{
  185. padding: 0 32rpx;
  186. .upbox{height: 224rpx;background: #EFF4FF;border-radius: 20rpx;display: flex;align-items: center;justify-content: center;flex-direction: column;margin-bottom: 8rpx;overflow: auto;
  187. .img{width: 100%;height: 100%;}
  188. .addimg{width: 70rpx;height: 70rpx;margin-bottom: 16rpx;}
  189. view{font-weight: bold;font-size: 26rpx;color: #4C6686;}
  190. }
  191. .rimg{width: 16rpx;height: 28rpx;flex: 0 0 auto;margin-left: 20rpx;
  192. image{width: 100%;height: 100%;}
  193. }
  194. .checkimg{width: 80rpx;height: 40rpx;margin-right: 8rpx;}
  195. .aphoto{padding: 0 24rpx;border-left: 2rpx solid #e6e6e6;margin-left: 26rpx;
  196. image{width: 40rpx;height: 38rpx;}
  197. }
  198. }
  199. }
  200. </style>