wangguoyu 2 ヶ月 前
コミット
05b97da901
2 ファイル変更42 行追加7 行削除
  1. 11 0
      api/jiazheng.js
  2. 31 7
      pages/admin/Jiazheng/jiazhengUserInfo.vue

+ 11 - 0
api/jiazheng.js

@@ -314,4 +314,15 @@ export function commonShare(data = {}) {
 		data,
 		timeout: 20000
 	})
+}
+export function jiazhengUserDelete(data = {}) {
+	return request({
+		url: '/app/user/jiazheng/delete',
+		headers: {
+			isToken: false
+		},
+		method: 'post',
+		data,
+		timeout: 20000
+	})
 }

+ 31 - 7
pages/admin/Jiazheng/jiazhengUserInfo.vue

@@ -4,7 +4,7 @@
 			<view @click="goUpPage" class="nav-bar-icon"></view>
 			<text class="nav-bar-title">家政人员信息</text>
 			<!-- 删除↓ wgy看这 -->
-			<i class="nav-bar-right-icon right-icon-delete-btn"></i>
+			<i class="nav-bar-right-icon right-icon-delete-btn" @click="deleteUser"></i>
 		</view>
 		<view class="jianli-wrap-box">
 			<view class="jianli-head-box">
@@ -70,6 +70,8 @@
 				</view>
 			</view>
 		</view>
+		<common-dialog ref="deleteDialogRef" :title="deleteTitle" :content="deleteConcent"
+			@confirm-btn="deleteQuerenBtn"></common-dialog>
 	</view>
 </template>
 <script>
@@ -77,17 +79,22 @@
 		ref
 	} from "vue";
 	import {
-		getJiazhengJianli
+		getJiazhengJianli,
+		jiazhengUserDelete
 	} from "@/api/jiazheng.js";
+	import commonDialog from '@/components/dialog/commonDialog.vue';
 	export default {
 		data() {
 			return {
 				pageInfo: {},
-				jianliInfo: {}
+				jianliInfo: {},
+				deleteConcent: '你确定要执行这个操作吗?',
+				deleteTitle: '删除',
+				deleteIndex: '',
 			}
 		},
 		components: {
-
+			commonDialog
 		},
 		onLoad(options) {
 			let data = JSON.parse(options.pageInfo)
@@ -98,6 +105,23 @@
 			this.getJianliInfo()
 		},
 		methods: {
+			deleteUser() {
+				this.$refs.deleteDialogRef.handleShow()
+			},
+			deleteQuerenBtn() {
+				jiazhengUserDelete({
+					ids: [this.pageInfo.id]
+				}).then(res => {
+					if (res.code == 0) {
+						uni.showToast({
+							title: "成功",
+							icon: 'none',
+							duration: 2000
+						})
+						this.goUpPage()
+					}
+				})
+			},
 			getJianliInfo() {
 				let req = {
 					id: this.pageInfo.id,
@@ -138,16 +162,16 @@
 				})
 			},
 			goUpPage() {
-				if(this.pageInfo.from =='banzheng'){
+				if (this.pageInfo.from == 'banzheng') {
 					uni.redirectTo({
 						url: "/pages/admin/banzheng/list"
 					})
-				}else{
+				} else {
 					uni.redirectTo({
 						url: "/pages/admin/Jiazheng/index"
 					})
 				}
-			
+
 			},
 
 		}