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

303 lines
6.0 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.saveFile({
  141. tempFilePath: res.tempFilePath,
  142. success: (saveRes) => {
  143. uni.showToast({
  144. title: '下载成功',
  145. icon: 'success'
  146. })
  147. // 保存成功后直接打开文件
  148. setTimeout(() => {
  149. uni.openDocument({
  150. filePath: saveRes.savedFilePath,
  151. success: () => {
  152. console.log('文件打开成功')
  153. },
  154. fail: (err) => {
  155. console.log('文件打开失败', err)
  156. uni.showToast({
  157. title: '文件已保存,请在文件管理器中查看',
  158. icon: 'none',
  159. duration: 3000
  160. })
  161. }
  162. })
  163. }, 1000)
  164. },
  165. fail: () => {
  166. uni.showToast({
  167. title: '保存失败',
  168. icon: 'none'
  169. })
  170. }
  171. })
  172. }
  173. },
  174. fail: () => {
  175. uni.showToast({
  176. title: '下载失败',
  177. icon: 'none'
  178. })
  179. }
  180. })
  181. },
  182. queryCertById(){
  183. this.$api('queryCertById', {
  184. cerId : this.id,
  185. }, res => {
  186. if(res.code == 200){
  187. this.formList = res.result.employMaterialList
  188. res.result.employMaterialList.forEach(n => {
  189. if(n.type == 0){
  190. this.verification[n.keyName] = '请输入' + n.title
  191. this.form[n.keyName] = ''
  192. }else{
  193. this.verification[n.keyName] = '请上传' + n.title
  194. // this.fileMapList[n.keyName] = []
  195. this.$set(this.fileMapList, n.keyName, [])
  196. }
  197. })
  198. }
  199. })
  200. },
  201. }
  202. }
  203. </script>
  204. <style scoped lang="scss">
  205. .page{
  206. min-height: 100vh;
  207. .required::before{
  208. content: '*';
  209. color: #f00;
  210. }
  211. .form-item{
  212. padding: 30rpx 0;
  213. display: flex;
  214. align-items: center;
  215. border-bottom: 1rpx solid #00000009;
  216. font-size: 28rpx;
  217. .label{
  218. font-weight: 600;
  219. margin-right: 50rpx;
  220. text{
  221. font-size: 24rpx;
  222. font-weight: 500;
  223. }
  224. }
  225. .input{
  226. margin-left: auto;
  227. flex-shrink: 0;
  228. image{
  229. }
  230. input{
  231. text-align: right;
  232. }
  233. }
  234. .icon{
  235. margin-left: 10rpx;
  236. }
  237. }
  238. .tips{
  239. font-size: 26rpx;
  240. color: #777;
  241. padding-bottom: 20rpx;
  242. }
  243. .form {
  244. padding: 0 30rpx;
  245. background-color: #fff;
  246. margin: 20rpx;
  247. border-radius: 20rpx;
  248. .upload-container {
  249. display: flex;
  250. flex-direction: column;
  251. align-items: center;
  252. gap: 10rpx;
  253. }
  254. .upload{
  255. display: flex;
  256. justify-content: center;
  257. align-items: center;
  258. // width: 690rpx;
  259. width: 120rpx;
  260. height: 120rpx;
  261. border-radius: 50%;
  262. overflow: hidden;
  263. background-color: #f3f3f3;
  264. border-radius: 10rpx;
  265. // .btn-add{
  266. // margin: auto;
  267. // padding: 10rpx 20rpx;
  268. // background-color: $uni-color;
  269. // color: #fff;
  270. // border-radius: 10rpx;
  271. // }
  272. }
  273. .download-btn {
  274. padding: 8rpx 16rpx;
  275. background-color: #007aff;
  276. color: #fff;
  277. border-radius: 6rpx;
  278. font-size: 24rpx;
  279. text {
  280. color: #fff;
  281. }
  282. }
  283. }
  284. }
  285. </style>