特易招,招聘小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

290 lines
5.8 KiB

10 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
10 months ago
8 months ago
10 months ago
8 months ago
10 months ago
10 months ago
10 months ago
8 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
8 months ago
8 months ago
10 months ago
8 months ago
10 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
3 weeks ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
10 months ago
8 months ago
10 months ago
8 months ago
10 months ago
8 months ago
8 months ago
10 months ago
8 months ago
10 months ago
8 months ago
10 months ago
8 months ago
10 months ago
8 months ago
10 months ago
8 months ago
10 months ago
8 months ago
10 months ago
10 months ago
  1. <template>
  2. <view class="page">
  3. <navbar
  4. title="需提交的材料"
  5. leftClick
  6. @leftClick="$utils.navigateBack"
  7. />
  8. <view class="form">
  9. <view class="form-item"
  10. :key="item.id"
  11. v-for="(item, index) in formList">
  12. <view class="label"
  13. :class="{req : item.isFill == 1}">
  14. {{ item.title }}
  15. <br>
  16. <text>{{ item.descrip }}</text>
  17. </view>
  18. <view class="input"
  19. v-if="item.type == 0">
  20. <input type="text"
  21. :placeholder="'请输入' + item.title"
  22. v-model="form[item.keyName]"/>
  23. </view>
  24. <view class="input"
  25. v-else>
  26. <view class="upload-container">
  27. <uv-upload
  28. :fileList="fileMapList[item.keyName]"
  29. :name="item.keyName"
  30. :maxCount="1"
  31. width="120rpx"
  32. height="120rpx"
  33. multiple
  34. @afterRead="afterRead"
  35. @delete="deleteImage">
  36. <view class="upload">
  37. <image :src="item.image"
  38. mode="aspectFit"
  39. style="width: 120rpx;height: 120rpx;" />
  40. </view>
  41. </uv-upload>
  42. <view class="download-btn"
  43. v-if="item.template"
  44. @click="downloadTemplate(item.template, item.title)">
  45. <text>下载模板</text>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="icon"
  50. v-if="item.type == 1">
  51. <uv-icon
  52. name="arrow-right"
  53. size="30rpx"
  54. ></uv-icon>
  55. </view>
  56. </view>
  57. </view>
  58. <view class="uni-color-btn"
  59. v-if="formList.length > 0"
  60. @click="addMaterial()">
  61. 提交
  62. </view>
  63. <view class="uni-uncolor-btn"
  64. @click="$refs.customerServicePopup.open()">
  65. 联系客服
  66. </view>
  67. <view class="tips"
  68. style="text-align: center;padding: 20rpx 0;
  69. width: 750rpx;">
  70. 如有疑问请联系客服
  71. </view>
  72. <customerServicePopup ref="customerServicePopup"/>
  73. </view>
  74. </template>
  75. <script>
  76. import customerServicePopup from '@/components/config/customerServicePopup.vue'
  77. export default {
  78. components : {
  79. customerServicePopup
  80. },
  81. data() {
  82. return {
  83. form : {
  84. },
  85. fileMapList : {},
  86. formList : [],
  87. id : 0,
  88. verification : {},
  89. }
  90. },
  91. onLoad({id}) {
  92. this.id = id
  93. this.queryCertById()
  94. },
  95. methods: {
  96. deleteImage(e){
  97. this.fileMapList[e.name].splice(e.index, 1)
  98. },
  99. afterRead(e){
  100. let self = this
  101. e.file.forEach(file => {
  102. self.$Oss.ossUpload(file.url).then(url => {
  103. self.fileMapList[e.name].push({
  104. url
  105. })
  106. })
  107. })
  108. },
  109. addMaterial(){
  110. this.formList.forEach(n => {
  111. if(n.type == 1){
  112. let map = this.fileMapList[n.keyName]
  113. if(map){
  114. this.form[n.keyName] = map.map((item) => item.url).join(",")
  115. }
  116. }
  117. })
  118. if(this.$utils.verificationAll(this.form, this.verification)) {
  119. return
  120. }
  121. this.$api('addMaterial',this.form, res =>{
  122. if(res.code == 200){
  123. uni.showToast({
  124. title:'提交成功!等待审核',
  125. icon: 'none'
  126. })
  127. setTimeout(uni.navigateBack, 1000, -1)
  128. }
  129. })
  130. },
  131. downloadTemplate(template, title) {
  132. if (!template) {
  133. uni.showToast({
  134. title: '暂无模板文件',
  135. icon: 'none'
  136. })
  137. return
  138. }
  139. uni.downloadFile({
  140. url: template,
  141. success: (res) => {
  142. if (res.statusCode === 200) {
  143. uni.openDocument({
  144. showMenu: true,
  145. filePath: res.tempFilePath,
  146. success: () => {
  147. console.log('文件打开成功')
  148. },
  149. fail: (err) => {
  150. console.log('文件打开失败', err)
  151. }
  152. })
  153. }
  154. },
  155. fail: () => {
  156. uni.showToast({
  157. title: '下载失败',
  158. icon: 'none'
  159. })
  160. }
  161. })
  162. },
  163. queryCertById(){
  164. this.$api('queryCertById', {
  165. cerId : this.id,
  166. }, res => {
  167. if(res.code == 200){
  168. this.formList = res.result.employMaterialList
  169. res.result.employMaterialList.forEach(n => {
  170. if(n.isFill != 1){
  171. return
  172. }
  173. if(n.type == 0){
  174. this.verification[n.keyName] = '请输入' + n.title
  175. this.form[n.keyName] = ''
  176. }else{
  177. this.verification[n.keyName] = '请上传' + n.title
  178. // this.fileMapList[n.keyName] = []
  179. this.$set(this.fileMapList, n.keyName, [])
  180. }
  181. })
  182. }
  183. })
  184. },
  185. }
  186. }
  187. </script>
  188. <style scoped lang="scss">
  189. .page{
  190. min-height: 100vh;
  191. .required::before{
  192. content: '*';
  193. color: #f00;
  194. }
  195. .form-item{
  196. padding: 30rpx 0;
  197. display: flex;
  198. align-items: center;
  199. border-bottom: 1rpx solid #00000009;
  200. font-size: 28rpx;
  201. .label{
  202. font-weight: 600;
  203. margin-right: 50rpx;
  204. text{
  205. font-size: 24rpx;
  206. font-weight: 500;
  207. }
  208. &.req::before{
  209. content: '*';
  210. color: #f00;
  211. }
  212. }
  213. .input{
  214. margin-left: auto;
  215. flex-shrink: 0;
  216. image{
  217. }
  218. input{
  219. text-align: right;
  220. }
  221. }
  222. .icon{
  223. margin-left: 10rpx;
  224. }
  225. }
  226. .tips{
  227. font-size: 26rpx;
  228. color: #777;
  229. padding-bottom: 20rpx;
  230. }
  231. .form {
  232. padding: 0 30rpx;
  233. background-color: #fff;
  234. margin: 20rpx;
  235. border-radius: 20rpx;
  236. .upload-container {
  237. display: flex;
  238. flex-direction: column;
  239. align-items: center;
  240. gap: 10rpx;
  241. }
  242. .upload{
  243. display: flex;
  244. justify-content: center;
  245. align-items: center;
  246. // width: 690rpx;
  247. width: 120rpx;
  248. height: 120rpx;
  249. border-radius: 50%;
  250. overflow: hidden;
  251. background-color: #f3f3f3;
  252. border-radius: 10rpx;
  253. // .btn-add{
  254. // margin: auto;
  255. // padding: 10rpx 20rpx;
  256. // background-color: $uni-color;
  257. // color: #fff;
  258. // border-radius: 10rpx;
  259. // }
  260. }
  261. .download-btn {
  262. padding: 8rpx 16rpx;
  263. background-color: #007aff;
  264. color: #fff;
  265. border-radius: 6rpx;
  266. font-size: 24rpx;
  267. text {
  268. color: #fff;
  269. }
  270. }
  271. }
  272. }
  273. </style>