3、订单列表管理接口对接

4、工程师审核接口对接
This commit is contained in:
2024-10-14 18:05:59 +08:00
parent eecb7aa9d4
commit 3d4b033c1c
7 changed files with 162 additions and 55 deletions
+6
View File
@@ -23,3 +23,9 @@ export function updateGoods(query) {
data: query,
});
}
export function delGoods(id) {
return service({
method: "delete",
url: `${API_BASE_URL}/`+id
});
}
+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: "勘察工程师审核",
},
},
{
+87 -23
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,7 +120,7 @@
show-overflow-tooltip
>
<template v-slot:default="scope">
<el-button type="success">通过</el-button>
<el-button type="success" @click="handleApprove(scope.row)">通过</el-button>
<el-button type="danger" @click="openModel(scope.$index)">驳回</el-button>
</template>
</el-table-column>
@@ -122,10 +139,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 +158,56 @@ 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);
// total.value = res.data.total
tableData.value = res.data.records;
});
};
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) => {
console.log("调试:", item)
approve(item.id).then((res) => {
ElMessage({
type: 'success'
})
})
}
// 驳回原因
const openModel = (index) => {
ElMessageBox.prompt('请输入驳回原因', '', {
@@ -158,13 +215,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) => {
+13 -9
View File
@@ -116,11 +116,7 @@ import {
InfoFilled,
View,
} from '@element-plus/icons-vue'
import {
getGoodsList,
addGoods,
updateGoods,
} from '../../api/modules/goods.js'
import { getGoodsList, addGoods, updateGoods, delGoods} from '../../api/modules/goods.js'
import { options } from './options.js'
import { onMounted, reactive, ref } from 'vue'
import { ElMessage } from 'element-plus'
@@ -225,10 +221,18 @@ const ItemView = (item) => {
dialogData.title = ''
}
const DeleteItem = (index) => {
console.log(index)
tableData.value.splice(index, 1)
}
const DeleteItem = async (index) => {
const row = tableData.value[index]; // 获取要删除的行
console.log("调试:row=",row)
const id = row.id; // 假设行数据中有一个名为 `id` 的属性
// 调用 delRecord 函数并等待其完成
await delGoods(id).then((res) => {
// 如果 delRecord 成功,则从 tableData 中移除该行
tableData.value.splice(index, 1);
});
};
const cancelEvent = () => {
console.log('cancel!')
}
+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'
},
];
];
+14 -9
View File
@@ -141,15 +141,19 @@ 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 {getApplyList, reject, approve} from "../../api/modules/postApply";
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)
@@ -164,13 +168,14 @@ const queryData = ref({
const initData = () => {
tableData.value = columnData.value;
// 加载示例数据
// tableData.value = exampleData.value;
// orderLists(queryData.value).then((res) => {
// console.log(res.data.data)
// // total.value = res.data.data.total
// tableData.value = res.data.data
// })
getApplyList(queryData.value).then((res) => {
console.log(res.data.data)
total.value = res.data.total
tableData.value = res.data
})
}
const itemEditHanld = (item) => {
item.itemEdit = !item.itemEdit