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

289 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
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. this.form[n.keyName] = this.fileMapList[n.keyName]
  113. .map((item) => item.url).join(",")
  114. }
  115. })
  116. if(this.$utils.verificationAll(this.form, this.verification)) {
  117. return
  118. }
  119. this.$api('addMaterial',this.form, res =>{
  120. if(res.code == 200){
  121. uni.showToast({
  122. title:'提交成功!等待审核',
  123. icon: 'none'
  124. })
  125. setTimeout(uni.navigateBack, 1000, -1)
  126. }
  127. })
  128. },
  129. downloadTemplate(template, title) {
  130. if (!template) {
  131. uni.showToast({
  132. title: '暂无模板文件',
  133. icon: 'none'
  134. })
  135. return
  136. }
  137. uni.downloadFile({
  138. url: template,
  139. success: (res) => {
  140. if (res.statusCode === 200) {
  141. uni.openDocument({
  142. showMenu: true,
  143. filePath: res.tempFilePath,
  144. success: () => {
  145. console.log('文件打开成功')
  146. },
  147. fail: (err) => {
  148. console.log('文件打开失败', err)
  149. }
  150. })
  151. }
  152. },
  153. fail: () => {
  154. uni.showToast({
  155. title: '下载失败',
  156. icon: 'none'
  157. })
  158. }
  159. })
  160. },
  161. queryCertById(){
  162. this.$api('queryCertById', {
  163. cerId : this.id,
  164. }, res => {
  165. if(res.code == 200){
  166. this.formList = res.result.employMaterialList
  167. res.result.employMaterialList.forEach(n => {
  168. if(n.isFill != 1){
  169. return
  170. }
  171. if(n.type == 0){
  172. this.verification[n.keyName] = '请输入' + n.title
  173. this.form[n.keyName] = ''
  174. }else{
  175. this.verification[n.keyName] = '请上传' + n.title
  176. // this.fileMapList[n.keyName] = []
  177. this.$set(this.fileMapList, n.keyName, [])
  178. }
  179. })
  180. }
  181. })
  182. },
  183. }
  184. }
  185. </script>
  186. <style scoped lang="scss">
  187. .page{
  188. min-height: 100vh;
  189. .required::before{
  190. content: '*';
  191. color: #f00;
  192. }
  193. .form-item{
  194. padding: 30rpx 0;
  195. display: flex;
  196. align-items: center;
  197. border-bottom: 1rpx solid #00000009;
  198. font-size: 28rpx;
  199. .label{
  200. font-weight: 600;
  201. margin-right: 50rpx;
  202. text{
  203. font-size: 24rpx;
  204. font-weight: 500;
  205. }
  206. &.req::before{
  207. content: '*';
  208. color: #f00;
  209. }
  210. }
  211. .input{
  212. margin-left: auto;
  213. flex-shrink: 0;
  214. image{
  215. }
  216. input{
  217. text-align: right;
  218. }
  219. }
  220. .icon{
  221. margin-left: 10rpx;
  222. }
  223. }
  224. .tips{
  225. font-size: 26rpx;
  226. color: #777;
  227. padding-bottom: 20rpx;
  228. }
  229. .form {
  230. padding: 0 30rpx;
  231. background-color: #fff;
  232. margin: 20rpx;
  233. border-radius: 20rpx;
  234. .upload-container {
  235. display: flex;
  236. flex-direction: column;
  237. align-items: center;
  238. gap: 10rpx;
  239. }
  240. .upload{
  241. display: flex;
  242. justify-content: center;
  243. align-items: center;
  244. // width: 690rpx;
  245. width: 120rpx;
  246. height: 120rpx;
  247. border-radius: 50%;
  248. overflow: hidden;
  249. background-color: #f3f3f3;
  250. border-radius: 10rpx;
  251. // .btn-add{
  252. // margin: auto;
  253. // padding: 10rpx 20rpx;
  254. // background-color: $uni-color;
  255. // color: #fff;
  256. // border-radius: 10rpx;
  257. // }
  258. }
  259. .download-btn {
  260. padding: 8rpx 16rpx;
  261. background-color: #007aff;
  262. color: #fff;
  263. border-radius: 6rpx;
  264. font-size: 24rpx;
  265. text {
  266. color: #fff;
  267. }
  268. }
  269. }
  270. }
  271. </style>