特易招,招聘小程序
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.

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