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

293 lines
5.9 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
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.type == 0){
  171. // 文本输入类型
  172. if(n.isFill == 1){
  173. this.verification[n.keyName] = '请输入' + n.title
  174. }
  175. this.form[n.keyName] = ''
  176. }else{
  177. // 图片上传类型
  178. if(n.isFill == 1){
  179. this.verification[n.keyName] = '请上传' + n.title
  180. }
  181. // 无论必填还是非必填,都需要初始化fileMapList
  182. this.$set(this.fileMapList, n.keyName, [])
  183. }
  184. })
  185. }
  186. })
  187. },
  188. }
  189. }
  190. </script>
  191. <style scoped lang="scss">
  192. .page{
  193. min-height: 100vh;
  194. .required::before{
  195. content: '*';
  196. color: #f00;
  197. }
  198. .form-item{
  199. padding: 30rpx 0;
  200. display: flex;
  201. align-items: center;
  202. border-bottom: 1rpx solid #00000009;
  203. font-size: 28rpx;
  204. .label{
  205. font-weight: 600;
  206. margin-right: 50rpx;
  207. text{
  208. font-size: 24rpx;
  209. font-weight: 500;
  210. }
  211. &.req::before{
  212. content: '*';
  213. color: #f00;
  214. }
  215. }
  216. .input{
  217. margin-left: auto;
  218. flex-shrink: 0;
  219. image{
  220. }
  221. input{
  222. text-align: right;
  223. }
  224. }
  225. .icon{
  226. margin-left: 10rpx;
  227. }
  228. }
  229. .tips{
  230. font-size: 26rpx;
  231. color: #777;
  232. padding-bottom: 20rpx;
  233. }
  234. .form {
  235. padding: 0 30rpx;
  236. background-color: #fff;
  237. margin: 20rpx;
  238. border-radius: 20rpx;
  239. .upload-container {
  240. display: flex;
  241. flex-direction: column;
  242. align-items: center;
  243. gap: 10rpx;
  244. }
  245. .upload{
  246. display: flex;
  247. justify-content: center;
  248. align-items: center;
  249. // width: 690rpx;
  250. width: 120rpx;
  251. height: 120rpx;
  252. border-radius: 50%;
  253. overflow: hidden;
  254. background-color: #f3f3f3;
  255. border-radius: 10rpx;
  256. // .btn-add{
  257. // margin: auto;
  258. // padding: 10rpx 20rpx;
  259. // background-color: $uni-color;
  260. // color: #fff;
  261. // border-radius: 10rpx;
  262. // }
  263. }
  264. .download-btn {
  265. padding: 8rpx 16rpx;
  266. background-color: #007aff;
  267. color: #fff;
  268. border-radius: 6rpx;
  269. font-size: 24rpx;
  270. text {
  271. color: #fff;
  272. }
  273. }
  274. }
  275. }
  276. </style>