wangguoyu 2 months ago
parent
commit
341fcf6330
2 changed files with 104 additions and 37 deletions
  1. 13 0
      api/banzheng.js
  2. 91 37
      pages/admin/banzheng/list.vue

+ 13 - 0
api/banzheng.js

@@ -71,3 +71,16 @@ export function getKaozhengKaoshi(data = {}) {
   })
 }
 
+
+export function kaozhengDelete(data = {}) {
+  return request({
+    url: '/app/user/kaozheng/delete',
+    headers: {
+      isToken: true
+    },
+    method: 'post',
+    data,
+    timeout: 20000
+  })
+}
+

+ 91 - 37
pages/admin/banzheng/list.vue

@@ -18,11 +18,13 @@
 								<view class="head-name">{{item.realName}}</view>
 								<view class="head-status">
 									<text>{{item.statusBanzheng}}</text>
-									<text class="status-line" v-if="item.statusKaoshi != '-' && item.statusKaoshi != ''">|</text>
-									<text v-if="item.statusKaoshi != '-' && item.statusKaoshi != ''">{{item.statusKaoshi}}</text>
+									<text class="status-line"
+										v-if="item.statusKaoshi != '-' && item.statusKaoshi != ''">|</text>
+									<text
+										v-if="item.statusKaoshi != '-' && item.statusKaoshi != ''">{{item.statusKaoshi}}</text>
 									<!-- 删除 wgy看这里↓-->
-									<icon class="head-clear"></icon>
-								  </view>
+									<icon class="head-clear" @click.stop="deleteFun(item)"></icon>
+								</view>
 							</view>
 							<view class="card-body-row">
 								<view class="card-img-box">
@@ -32,12 +34,18 @@
 								<view class="body-content-row">
 									<view class="content-text-row">
 										<text>手机号:</text>{{item.userName}}
-										<button type="default" class="phone-green-btn bz-tel-btn" @click.stop="telCallBtn(item.userName)">打电话</button>
+										<button type="default" class="phone-green-btn bz-tel-btn"
+											@click.stop="telCallBtn(item.userName)">打电话</button>
 									</view>
 									<view class="content-text-row"><text>证件号:</text>{{item.idcard}}</view>
 									<view class="jg-zy-box">
-										<view class="jg-zy-row"><icon class="bz-icon"></icon><text>报证机构:{{item.jgName}}</text></view>
-										<view class="jg-zy-row"><icon class="zy-icon"></icon><text>职业名称:{{item.zyName}} {{item.zyLevel}}</text></view>
+										<view class="jg-zy-row">
+											<icon class="bz-icon"></icon><text>报证机构:{{item.jgName}}</text>
+										</view>
+										<view class="jg-zy-row">
+											<icon class="zy-icon"></icon><text>职业名称:{{item.zyName}}
+												{{item.zyLevel}}</text>
+										</view>
 									</view>
 								</view>
 							</view>
@@ -53,21 +61,41 @@
 		<!-- 筛选 -->
 		<filter-dialog ref="filterDialogRef" @confirm-btn="confirmBtn"></filter-dialog>
 		<!-- 搜索 -->
-		<search-dialog ref="searchDialogRef" @search-btn="dialogSearchBtn" @reset-search="dialogSearchReset"></search-dialog>
+		<search-dialog ref="searchDialogRef" @search-btn="dialogSearchBtn"
+			@reset-search="dialogSearchReset"></search-dialog>
+		<common-dialog ref="commonDialogRef" :title="deleteTitle" :content="deleteConcent"
+			@confirm-btn="deleteQuerenBtn"></common-dialog>
 	</view>
 </template>
 
 <script setup>
 	import customTabbarClientVue from "@/components/custom-tabbar/custom-tabbar-admin.vue";
 	import filterDialog from "./filter.vue";
+	import commonDialog from '@/components/dialog/commonDialog.vue';
 	import searchDialog from "./search.vue";
-	import {ref,reactive} from "vue";
-	import {onLoad,onShow} from "@dcloudio/uni-app";
-	import {getKaozhengList} from '@/api/banzheng.js'
-	import {formatSecondsToCnhms} from "@/utils/common.js"
+	import {
+		ref,
+		reactive
+	} from "vue";
+	import {
+		onLoad,
+		onShow
+	} from "@dcloudio/uni-app";
+	import {
+		getKaozhengList,
+		kaozhengDelete
+	} from '@/api/banzheng.js'
+	import {
+		formatSecondsToCnhms
+	} from "@/utils/common.js"
 
 	const filterDialogRef = ref(null);
 	const searchDialogRef = ref(null);
+	const commonDialogRef = ref(null);
+	const deleteId = ref('');
+	const deleteTitle = ref('删除');
+	const deleteConcent = ref('你确定要执行这个操作吗');
+
 	const data = reactive({
 		jgId: '', // 机构ID
 		realName: '', // 姓名
@@ -89,14 +117,40 @@
 		from: ''
 	})
 
+
+	function deleteFun(data) {
+		console.log('data', data);
+		deleteId.value = data.id
+		commonDialogRef.value.handleShow();
+
+	}
+
+	function deleteQuerenBtn() {
+		kaozhengDelete({
+			ids: [deleteId.value]
+		}).then(res => {
+			if (res.code == 0) {
+				uni.showToast({
+					title: '成功'
+				})
+				handleSearch()
+			} else {
+				uni.showToast({
+					title: '失败'
+				})
+			}
+
+		})
+	}
+
 	function goUpPage() {
 		uni.redirectTo({
 			url: '/pages/admin/ShouYe/shouye'
 		})
 	}
-	
+
 	// 筛选
-	function filterBtn(){
+	function filterBtn() {
 		filterDialogRef.value.initPage();
 		filterDialogRef.value.handleShow();
 	}
@@ -108,13 +162,13 @@
 
 	function goBzDetail(item) {
 		let pageInfo = {
-			status:'edit',
-			id:'',
-			userId:item.userId,
-			from:'banzheng'
+			status: 'edit',
+			id: '',
+			userId: item.userId,
+			from: 'banzheng'
 		}
 		uni.redirectTo({
-			url: `/pages/admin/Jiazheng/jiazhengUserInfo?pageInfo=`+JSON.stringify(pageInfo)
+			url: `/pages/admin/Jiazheng/jiazhengUserInfo?pageInfo=` + JSON.stringify(pageInfo)
 		})
 	}
 
@@ -192,8 +246,8 @@
 			data.loading = false;
 		})
 	}
-	
-	function confirmBtn(dialogData){
+
+	function confirmBtn(dialogData) {
 		data.jgId = dialogData.jigouId;
 		data.zyId = dialogData.zhiyeId;
 		data.zyLevel = dialogData.levelId;
@@ -202,37 +256,37 @@
 		data.page = 0;
 		refreshData();
 	}
-	
-	function searchBtn(){
+
+	function searchBtn() {
 		searchDialogRef.value.handleShow();
 	}
 
-	function dialogSearchBtn(name,searchData){
+	function dialogSearchBtn(name, searchData) {
 		switch (name) {
 			case '姓名':
 				dialogSearchReset();
-			    data.realName = searchData.value;
-			    break;
+				data.realName = searchData.value;
+				break;
 			case '手机号':
-			    data.userName = searchData.value;
-			    break;	
+				data.userName = searchData.value;
+				break;
 		}
 		data.page = 0;
 		refreshData();
-		
+
 	}
-	
-	function dialogSearchReset(){
-		data.userName='';
-		data.realName='';
+
+	function dialogSearchReset() {
+		data.userName = '';
+		data.realName = '';
 	}
-	
-	function telCallBtn(data){
+
+	function telCallBtn(data) {
 		uni.makePhoneCall({
 			phoneNumber: data //仅为示例
 		});
 	}
-	
+
 	onLoad((options) => {
 		data.from = options.from;
 	})
@@ -240,4 +294,4 @@
 	onShow(() => {
 		getMore()
 	})
-</script>
+</script>