Explorar o código

后管添加企业是否推荐功能

yuan hai 5 meses
pai
achega
388d0edb32
Modificáronse 2 ficheiros con 51 adicións e 3 borrados
  1. 45 0
      src/views/autonym/autonym.vue
  2. 6 3
      src/views/recruit/recruitList.vue

+ 45 - 0
src/views/autonym/autonym.vue

@@ -218,6 +218,15 @@
 			</el-table-column>
 			<el-table-column prop="createTime" label="创建时间" width="160">
 			</el-table-column>
+			<el-table-column prop="isRecommend" label="是否推荐" fixed="right">
+				<template slot-scope="scope">
+					<el-switch v-model="scope.row.isRecommend"
+						@change="changeTj(scope.row.companyId,scope.row.isRecommend)"
+						:active-value="openValue" :disabled="!isAuth('autonym:tongguo')"
+						:inactive-value="closeValue" active-color="#13ce66" inactive-color="#ff4949">
+					</el-switch>
+				</template>
+			</el-table-column>
 			<el-table-column fixed='right' prop="status" label="状态" width="160">
 				<template slot-scope="scope">
 					<span v-if="scope.row.status == 1">待审核</span>
@@ -730,6 +739,8 @@
 				dialogFormVisibleImg:false,
 				imgUrl:'',
 				hangyeData: [],
+				openValue:1,
+				closeValue:2,
 			}
 		},
 		methods: {
@@ -1551,6 +1562,40 @@
 					})
 				}).catch(() => {})
 			},
+			// 是否推荐
+			changeTj(companyId, isRecommend) {
+				this.$http({
+					url: this.$http.adornUrl('company/updateCompanyIsRecommend'),
+					method: 'post',
+					params: this.$http.adornParams({
+						'companyId': companyId,
+						'isRecommend':isRecommend
+					})
+				}).then(({
+					data
+				}) => {
+					if (data.code == 0) {
+						this.$message({
+							message: '操作成功',
+							type: 'success',
+							duration: 1500,
+							onClose: () => {
+								this.dataSelect()
+							}
+						})
+					} else {
+						this.$message({
+							message: data.msg,
+							type: 'warning',
+							duration: 1500,
+							onClose: () => {
+								this.dataSelect()
+							}
+						})
+					}
+
+				})
+			},
 			// 发票记录按钮
 			fapiaoClick(row){
 				this.userId = row.userId

+ 6 - 3
src/views/recruit/recruitList.vue

@@ -166,8 +166,8 @@
 						<template slot-scope="scope">
 							<el-switch v-model="scope.row.isRecommend"
 								@change="changeTj(scope.row.postPushId,scope.row.isRecommend)"
-								:active-value="openValue" :disabled="!isAuth('userList:delete')"
-								:inactive-value="closeValue" active-color="#13ce66" inactive-color="#ff4949">
+								:active-value="openValue2" :disabled="!isAuth('userList:delete')"
+								:inactive-value="closeValue2" active-color="#13ce66" inactive-color="#ff4949">
 							</el-switch>
 						</template>
 					</el-table-column>
@@ -540,6 +540,8 @@
 				postPushId: '',
 				openValue: 2,
 				closeValue: 5,
+				openValue2:1,
+				closeValue2:2,
 				type: '',
 				content: '',
 				userId: '',
@@ -1343,12 +1345,13 @@
 				
 			},
 			// 是否推荐
-			changeTj(postPushId, userId) {
+			changeTj(postPushId, isRecommend) {
 				this.$http({
 					url: this.$http.adornUrl('postPush/updatePostPushIsRecommend'),
 					method: 'post',
 					params: this.$http.adornParams({
 						'postPushId': postPushId,
+						'isRecommend':isRecommend
 					})
 				}).then(({
 					data