Merge remote-tracking branch 'origin/main' into gyj

This commit is contained in:
monanxiao
2024-10-15 11:16:41 +08:00
8 changed files with 288 additions and 76 deletions
+28
View File
@@ -0,0 +1,28 @@
import service from "../request.js";
const API_BASE_URL = '/application';
// 工作岗位资格申请审批管理
export function getApplyList(query) {
return service({
method: "get",
url: `${API_BASE_URL}/list`,
data: query,
});
}
// 工作岗位资格申请拒绝
export function reject(applicationId) {
return service({
method: "put",
url: `${API_BASE_URL}/reject/`+applicationId
});
}
// 工作岗位资格申请通过
export function approve(applicationId) {
return service({
method: "put",
url: `${API_BASE_URL}/approve/`+applicationId
});
}
+2 -2
View File
@@ -158,7 +158,7 @@ const routerList = [
component: () => import("../views/users/reconnaissance.vue"),
meta: {
requiresAuth: true,
name: "勘察人员",
name: "勘察工程师",
},
},
{
@@ -187,7 +187,7 @@ const routerList = [
component: () => import("../views/engineer/reconnaissance.vue"),
meta: {
requiresAuth: true,
name: "勘察人员审核",
name: "勘察工程师审核",
},
},
{
+115 -24
View File
@@ -54,12 +54,15 @@
>
<el-table-column
label="序号"
prop="userId"
width="120"
width="80"
align="center"
show-overflow-tooltip
sortable
/>
>
<template #default="scope">
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="头像" width="200" align="center">
<template #default="scope">
@@ -69,27 +72,41 @@
<el-table-column
label="微信昵称"
prop="nickname"
width="300"
align="center"
show-overflow-tooltip
/>
<el-table-column
label="名字"
prop="name"
width="300"
align="center"
show-overflow-tooltip
/>
<el-table-column
label="手机号"
prop="mobile"
width="300"
align="center"
show-overflow-tooltip
/>
<el-table-column
label="注册时间"
prop="date"
label="申请岗位"
prop="roleId"
:formatter="postFormater"
align="center"
show-overflow-tooltip
/>
<el-table-column
label="申请时间"
prop="createTime"
:formatter="formatDate"
width="auto"
align="center"
show-overflow-tooltip
sortable
/>
<el-table-column
label="状态"
prop="status"
:formatter="statusFormater"
width="auto"
align="center"
show-overflow-tooltip
@@ -103,8 +120,9 @@
show-overflow-tooltip
>
<template v-slot:default="scope">
<el-button type="success">通过</el-button>
<el-button type="danger" @click="openModel(scope.$index)">驳回</el-button>
<el-button type="success" v-if="scope.row.status === 0" @click="handleApprove(scope.row)">通过</el-button>
<el-button type="danger" v-if="scope.row.status === 0" @click="handleReject(scope.row)">驳回</el-button>
<!-- <el-button type="danger" @click="openModel(scope.$index)">驳回</el-button>-->
</template>
</el-table-column>
</el-table>
@@ -122,10 +140,13 @@
<script setup>
import { ref, onMounted } from 'vue';
import { getUserList } from '../../api/modules/user';
import {getApplyList, reject, approve} from "../../api/modules/postApply";
// 示例数据
// import {options} from './options.js'
// const exampleData = ref(JSON.parse(JSON.stringify(options)))
import { ElMessage, ElMessageBox } from 'element-plus'
import {options} from './options.js'
const columnData = ref(JSON.parse(JSON.stringify(options)))
const tableData = ref([]);
const searchWechatNickname = ref('');
@@ -138,19 +159,82 @@ const queryData = ref({
});
const initData = () => {
tableData.value = columnData.value;
// getUserList(queryData.value).then((res) => {
// tableData.value = res.data.data;
// });
// 加载示例数据
// tableData.value = exampleData.value;
getApplyList(queryData.value).then((res) => {
console.log("调试:总数=", res.data.total, "data.record.length=", res.data.records.length);
const filteredData = res.data.records.filter(record => record.roleId === 3);
// total.value = res.data.total
tableData.value = filteredData;
});
};
const formatDate = (row, column, cellValue) => {
const date = new Date(cellValue);
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
}
const statusFormater = (row, column, cellValue) => {
// 0待审核(审核中) 1驳回 2通过
if (cellValue === 1) {
return '已驳回';
} else if (cellValue === 2) {
return '已通过';
} else {
return '待审核';
}
}
const postFormater = (row, column, cellValue) => {
if (cellValue === 2) {
return '勘察工程师';
} else if (cellValue === 3) {
return '维修工程师';
} else {
return '工程师';
}
}
const searchEvnt = () => {
console.log('点击搜索');
queryData.value.keyWord = searchWechatNickname.value || searchName.value || searchMobile.value;
initData();
};
const handleApprove = (item) => {
ElMessageBox.confirm('确定要通过该申请?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
approve(item.id).then(() => {
item.status = 2;
ElMessage({
type: 'success',
message: '申请已被通过!'
})
})
}).catch(() => {
});
}
const handleReject = (item) => {
ElMessageBox.confirm('确定要拒绝该申请?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
reject(item.id).then(() => {
item.status = 1;
ElMessage({
type: 'success',
message: '申请已被拒绝!'
})
})
}).catch(() => {
});
}
// 驳回原因
const openModel = (index) => {
ElMessageBox.prompt('请输入驳回原因', '', {
@@ -158,12 +242,19 @@ const openModel = (index) => {
cancelButtonText: '取消',
inputType: 'textarea',
})
.then(({value}) => {
ElMessage({
type: 'success',
message: `驳回成功`,
})
.then(({ value }) => {
// 用户确认后,调用 rejectApplication 函数
if (value) { // 确保用户输入了驳回原因
reject(applicationId, value);
} else {
ElMessage({
type: 'warning',
message: '请输入驳回原因',
});
}
})
.catch(() => {
// 用户取消操作,无需处理
});
};
+115 -24
View File
@@ -54,12 +54,15 @@
>
<el-table-column
label="序号"
prop="userId"
width="120"
width="80"
align="center"
show-overflow-tooltip
sortable
/>
>
<template #default="scope">
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="头像" width="200" align="center">
<template #default="scope">
@@ -69,32 +72,46 @@
<el-table-column
label="微信昵称"
prop="nickname"
width="300"
align="center"
show-overflow-tooltip
/>
<el-table-column
label="名字"
prop="name"
width="300"
align="center"
show-overflow-tooltip
/>
<el-table-column
label="手机号"
prop="mobile"
width="300"
align="center"
show-overflow-tooltip
/>
<el-table-column
label="注册时间"
prop="date"
label="申请岗位"
prop="roleId"
:formatter="postFormater"
align="center"
show-overflow-tooltip
/>
<el-table-column
label="申请时间"
prop="createTime"
:formatter="formatDate"
width="auto"
align="center"
show-overflow-tooltip
sortable
/>
<el-table-column
label="状态"
prop="status"
:formatter="statusFormater"
width="auto"
align="center"
show-overflow-tooltip
sortable
/>
<el-table-column
label="操作"
@@ -103,8 +120,9 @@
show-overflow-tooltip
>
<template v-slot:default="scope">
<el-button type="success">通过</el-button>
<el-button type="danger" @click="openModel(scope.$index)">驳回</el-button>
<el-button type="success" v-if="scope.row.status === 0" @click="handleApprove(scope.row)">通过</el-button>
<el-button type="danger" v-if="scope.row.status === 0" @click="handleReject(scope.row)">驳回</el-button>
<!-- <el-button type="danger" @click="openModel(scope.$index)">驳回</el-button>-->
</template>
</el-table-column>
</el-table>
@@ -122,10 +140,13 @@
<script setup>
import { ref, onMounted } from 'vue';
import { getUserList } from '../../api/modules/user';
import {getApplyList, reject, approve} from "../../api/modules/postApply";
// 示例数据
// import {options} from './options.js'
// const exampleData = ref(JSON.parse(JSON.stringify(options)))
import { ElMessage, ElMessageBox } from 'element-plus'
import {options} from './options.js'
const columnData = ref(JSON.parse(JSON.stringify(options)))
const tableData = ref([]);
const searchWechatNickname = ref('');
@@ -138,19 +159,82 @@ const queryData = ref({
});
const initData = () => {
tableData.value = columnData.value;
// getUserList(queryData.value).then((res) => {
// tableData.value = res.data.data;
// });
// 加载示例数据
// tableData.value = exampleData.value;
getApplyList(queryData.value).then((res) => {
console.log("调试:总数=", res.data.total, "data.record.length=", res.data.records.length);
const filteredData = res.data.records.filter(record => record.roleId === 2);
// total.value = res.data.total
tableData.value = filteredData;
});
};
const formatDate = (row, column, cellValue) => {
const date = new Date(cellValue);
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
}
const statusFormater = (row, column, cellValue) => {
// 0待审核(审核中) 1驳回 2通过
if (cellValue === 1) {
return '已驳回';
} else if (cellValue === 2) {
return '已通过';
} else {
return '待审核';
}
}
const postFormater = (row, column, cellValue) => {
if (cellValue === 2) {
return '勘察工程师';
} else if (cellValue === 3) {
return '维修工程师';
} else {
return '工程师';
}
}
const searchEvnt = () => {
console.log('点击搜索');
queryData.value.keyWord = searchWechatNickname.value || searchName.value || searchMobile.value;
initData();
};
const handleApprove = (item) => {
ElMessageBox.confirm('确定要通过该申请?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
approve(item.id).then((res) => {
item.status = 2;
ElMessage({
type: 'success',
message: '申请已被通过!'
})
})
}).catch(() => {
});
}
const handleReject = (item) => {
ElMessageBox.confirm('确定要拒绝该申请?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
reject(item.id).then((res) => {
item.status = 1;
ElMessage({
type: 'success',
message: '申请已被拒绝!'
})
})
}).catch(() => {
});
}
// 驳回原因
const openModel = (index) => {
ElMessageBox.prompt('请输入驳回原因', '', {
@@ -158,13 +242,20 @@ const openModel = (index) => {
cancelButtonText: '取消',
inputType: 'textarea',
})
.then(({value}) => {
ElMessage({
type: 'success',
message: `驳回成功`,
})
.then(({ value }) => {
// 用户确认后,调用 rejectApplication 函数
if (value) { // 确保用户输入了驳回原因
reject(applicationId, value);
} else {
ElMessage({
type: 'warning',
message: '请输入驳回原因',
});
}
})
.catch(() => {
// 用户取消操作,无需处理
});
};
const handleCurrentChange = (val) => {
+3 -4
View File
@@ -57,9 +57,7 @@
size="large"
type="primary"
:loading="loading"
>
登录
</el-button>
>登录</el-button>
</div>
<!-- <el-divider>其他方式登录 </el-divider>
<div class="flx-row">
@@ -167,7 +165,8 @@ const login = (formEl) => {
if (!formEl) return;
formEl.validate((valid) => {
if (valid) {
loading.value = true;
// 不知道提交失败后怎么关闭,暂时先不开启
// loading.value = true;
console.log(globalStore);
if (loginForm.checked) {
+12 -10
View File
@@ -309,15 +309,17 @@ import {
} from '@element-plus/icons-vue'
import {nextTick, onMounted, reactive, ref} from 'vue'
import {options} from './options.js'
import {getUserList} from "../../api/modules/user";
// 示例数据
// import {options} from './options.js'
import {getOrderList} from "../../api/modules/order";
const tableData = ref([])
const dataList = ref([])
const table = ref()
const tabclickIndex = ref()
const isExpand = ref(false)
const columnData = ref(JSON.parse(JSON.stringify(options)))
// 示例数据加载
// const exampleData = ref(JSON.parse(JSON.stringify(options)))
const disabled = ref(false)
const dialogVisible = ref(false)
const total = ref(0)
@@ -332,14 +334,14 @@ const queryData = ref({
})
const initData = () => {
// 示例数据加载
// tableData.value = exampleData.value;
tableData.value = columnData.value;
// orderLists(queryData.value).then((res) => {
// console.log(res.data.data)
// // total.value = res.data.data.total
// tableData.value = res.data.data
// })
getOrderList(queryData.value).then((res) => {
console.log(res.data)
total.value = res.data.total
tableData.value = res.data
})
}
const itemEditHanld = (item) => {
item.itemEdit = !item.itemEdit
+1
View File
@@ -57,6 +57,7 @@ const initData = () => {
const onSubmit = () => {
console.log('submit!')
updateConfig(form).then((res) => {
serviceTelephone.value = form.content;
console.log('编辑数据成功')
console.log(ElMessage)
ElMessage({
+12 -12
View File
@@ -3,7 +3,7 @@ export const options = [
userId: 1,
avatar: 'https://pic.qqans.com/up/2024-6/2024620113729773.jpg',
name: '高永建',
nickname: '软件开发老高',
nickname: '软件开发歪歪杰',
mobile: '19136448763',
date: '2024-10-11 10:11:01'
},
@@ -11,7 +11,7 @@ export const options = [
userId: 2,
avatar: 'https://pic.qqans.com/up/2024-6/2024620113729773.jpg',
name: '张三',
nickname: '软件开发老高',
nickname: '软件开发歪歪杰',
mobile: '19136448763',
date: '2024-10-10 10:11:01'
},
@@ -19,7 +19,7 @@ export const options = [
userId: 3,
avatar: 'https://pic.qqans.com/up/2024-6/2024620113729773.jpg',
name: '李四',
nickname: '软件开发老高',
nickname: '软件开发歪歪杰',
mobile: '19136448763',
date: '2024-10-13 10:11:01'
},
@@ -27,14 +27,14 @@ export const options = [
userId: 4,
avatar: 'https://pic.qqans.com/up/2024-6/2024620113729773.jpg',
name: '名称',
nickname: '软件开发老高',
nickname: '软件开发歪歪杰',
mobile: '19136448763',
date: '2024-10-02 10:11:01'
},{
userId: 5,
avatar: 'https://pic.qqans.com/up/2024-6/2024620113729773.jpg',
name: '名称',
nickname: '软件开发老高',
nickname: '软件开发歪歪杰',
mobile: '19136448763',
date: '2024-10-01 10:11:01'
},
@@ -42,35 +42,35 @@ export const options = [
userId: 6,
avatar: 'https://pic.qqans.com/up/2024-6/2024620113729773.jpg',
name: '名称',
nickname: '软件开发老高',
nickname: '软件开发歪歪杰',
mobile: '19136448763',
date: '2024-10-11 10:11:01'
},{
userId: 7,
avatar: 'https://pic.qqans.com/up/2024-6/2024620113729773.jpg',
name: '名称',
nickname: '软件开发老高',
nickname: '软件开发歪歪杰',
mobile: '19136448763',
date: '2024-10-11 10:11:01'
},{
userId: 8,
avatar: 'https://pic.qqans.com/up/2024-6/2024620113729773.jpg',
name: '名称',
nickname: '软件开发老高',
nickname: '软件开发歪歪杰',
mobile: '19136448763',
date: '2024-10-11 10:11:01'
},{
userId: 9,
avatar: 'https://pic.qqans.com/up/2024-6/2024620113729773.jpg',
name: '名称',
nickname: '软件开发老高',
nickname: '软件开发歪歪杰',
mobile: '19136448763',
date: '2024-10-11 10:11:01'
},{
userId: 10,
avatar: 'https://pic.qqans.com/up/2024-6/2024620113729773.jpg',
name: '名称',
nickname: '软件开发老高',
nickname: '软件开发歪歪杰',
mobile: '19136448763',
date: '2024-10-11 10:11:01'
},
@@ -78,9 +78,9 @@ export const options = [
userId: 11,
avatar: 'https://pic.qqans.com/up/2024-6/2024620113729773.jpg',
name: '名称',
nickname: '软件开发老高',
nickname: '软件开发歪歪杰',
mobile: '19136448763',
date: '2024-10-11 10:11:01'
},
];
];