@@ -44,7 +41,7 @@ import {ref} from "vue";
import axios from "axios";
import {ElMessage} from "element-plus";
import router from "@/router";
-const ups = ref({username:'',password:'',surepassword:''});
+const ups = ref({username:'',password:'',surepassword:'',phone:''});
const register=()=>{
if (ups.value.password==ups.value.surepassword){
axios.post('http://localhost:8080/wsf/user/register',ups.value)
@@ -52,7 +49,7 @@ const register=()=>{
console.log(resp);
if(resp.data.code==2000){
ElMessage.success(resp.data.msg);
- //登录成功要跳转到哪里
+ //注册成功要跳转到哪里
router.push('/login');
}else{
ElMessage.error(resp.data.msg);
@@ -62,6 +59,9 @@ const register=()=>{
ElMessage.error('两次密码不一致');
}
}
+const login=()=>{
+ router.push('/login');
+}
\ No newline at end of file
diff --git a/wsf-ui/src/views/log/OperationLogView.vue b/wsf-ui/src/views/log/OperationLogView.vue
index f79cdd8..ceeb3d8 100644
--- a/wsf-ui/src/views/log/OperationLogView.vue
+++ b/wsf-ui/src/views/log/OperationLogView.vue
@@ -1,11 +1,92 @@
-
-
+
+ 操作日志
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 重置
+ 查询
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/wsf-ui/src/views/order/OrderView.vue b/wsf-ui/src/views/order/OrderView.vue
index 55153e8..0782e49 100644
--- a/wsf-ui/src/views/order/OrderView.vue
+++ b/wsf-ui/src/views/order/OrderView.vue
@@ -1,12 +1,119 @@
+
+
+
+ 工单管理
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 重置
+ 查询
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 抢单
+
+
+
+
+
+
+
+
-
- Order
-
-
-
\ No newline at end of file
diff --git a/wsf-ui/src/views/order/ReqOrderView.vue b/wsf-ui/src/views/order/ReqOrderView.vue
new file mode 100644
index 0000000..a9efa6c
--- /dev/null
+++ b/wsf-ui/src/views/order/ReqOrderView.vue
@@ -0,0 +1,432 @@
+
+
+
+ 需求单管理
+ 新建需求单
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 取消
+ 保存
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 重置
+ 查询
+
+
+
+
+
+
+ 发起中
+ 服务中
+ 已结束
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 修改
+ 取消订单
+ 查看
+
+
+
+
+
+
+ 订单信息
+
+ {{orderDialogData.orderNo}}
+ {{orderDialogData.orderCategoryName}}
+ {{orderDialogData.requestOrderRawPrice}}
+ {{orderDialogData.gmtCreate}}
+ {{orderDialogData.gmtModified}}
+
+ 需求单信息
+
+ {{orderDialogData.requestOrderNo}}
+ {{orderDialogData.gmtCreate}}
+
+ 用户信息
+
+ {{orderDialogData.userName}}
+ {{orderDialogData.phone}}
+ {{orderDialogData.userAddress}}
+
+ 师傅信息
+
+ {{orderDialogData.workerName}}
+ {{orderDialogData.workerPhone}}
+
+
+ 确定
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/wsf-ui/src/views/order/WorkerOrderView.vue b/wsf-ui/src/views/order/WorkerOrderView.vue
new file mode 100644
index 0000000..9d15296
--- /dev/null
+++ b/wsf-ui/src/views/order/WorkerOrderView.vue
@@ -0,0 +1,217 @@
+
+
+
+ 订单管理
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 重置
+ 查询
+
+
+
+
+
+
+ 待签到
+ 待服务
+ 待确认
+ 待审核
+ 已完成
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 签到
+ 服务完成
+ 客户确认
+
+
+
+
+
+
+ 订单信息
+
+ {{orderDialogData.orderNo}}
+ {{orderDialogData.orderCategoryName}}
+ {{orderDialogData.requestOrderPrice}}
+ {{orderDialogData.gmtCreate}}
+ {{orderDialogData.gmtModified}}
+
+ 需求单信息
+
+ {{orderDialogData.requestOrderNo}}
+ {{orderDialogData.gmtCreate}}
+
+ 用户信息
+
+ {{orderDialogData.userName}}
+ {{orderDialogData.phone}}
+ {{orderDialogData.userAddress}}
+
+ 师傅信息
+
+ {{orderDialogData.workerName}}
+ {{orderDialogData.workerPhone}}
+
+
+ 确定
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/wsf-ui/src/views/user/UserView.vue b/wsf-ui/src/views/user/UserView.vue
index f91b133..1e0ea4e 100644
--- a/wsf-ui/src/views/user/UserView.vue
+++ b/wsf-ui/src/views/user/UserView.vue
@@ -15,12 +15,12 @@
+ :disabled="saveUserForm.userId!=null">
-
+
@@ -29,101 +29,41 @@
-
-
-
-
-
-
-
- 取消
- 保存
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
- 取消
- 提交
+ 取消
+ 保存
-
-
@@ -133,7 +73,7 @@
@keydown.enter="loadUser">
-
@@ -152,16 +92,22 @@
-
+
+
+
-
+
+
- 编辑
- 删除
- 师傅申请
+ 编辑
+ 注销
+ 成为师傅
@@ -173,49 +119,37 @@ import {onMounted, ref} from "vue";
import axios from "axios";
import qs from "qs";
import {ElMessage} from "element-plus";
-
//定义对象来保存用户查询的条件
-const searchUserForm = ref({username:'',enable:''});
+const searchUserForm = ref({username:'',status:''});
//定义对象保存查询到的用户表格数据
const userArr = ref([]);
-
-const proOptions= ref([
- {provincename:'AA',id:'000'},
-]);
-const cityOptions = ref([
- {cityname:'AA',id:'000'},
-]);
-const serverOptions = ref([
- {typename:'AA',id:'000'},
-]);
-const categoryOptions = ref([
- {categoryname:'AA',id:'000'},
-]);
-//定义数组用来维护直属领导数据
-const countyOptions = ref([
- {countyname:'AA',id:'000'},
-
-]);
+const formatSex = (row,column,sexVal,index)=>{
+ if (sexVal==1){
+ sexVal='女'
+ }else if (sexVal==0){
+ sexVal='男'
+ }else {
+ sexVal='未知'
+ }
+ return sexVal;
+}
+let token = localStorage.getItem('token');
//定义加载用户列表的方法
const loadUser = ()=>{
let data = qs.stringify(searchUserForm.value);//username=tom&status=0
- //如果有查询条件,就根据条件查,没有条件默认查全部数据
- axios.get(BASE_URL+'/wsf/user/query?'+data)
- .then((response)=>{//回调函数,处理响应数据
- if(response.data.code==2000){//后端返回的状态码是2000说明成功了
- userArr.value = response.data.data;//把请求回来的数据装到绑定表格的数组中
- console.log(userArr.value);
- }else{
- ElMessage.error(response.data.msg);
- }
- })
+ axios.get(BASE_URL+'/wsf/user/query?'+data,{headers: {"Authorization":token}})
+ .then((response)=>{//回调函数,处理响应数据
+ // console.log("查询用户列表")
+ if(response.data.code==2000){//后端返回的状态码是2000说明成功了
+ userArr.value = response.data.data;//把请求回来的数据装到绑定表格的数组中
+ }else{
+ ElMessage.error(response.data.msg);
+ }
+ })
}
-
-//页面一加载完毕(页面挂在成功),立即执行
onMounted(()=>{
loadUser();
})
-
//重置搜索
const resetSearch = ()=>{
//清空之前的搜索内容
@@ -226,7 +160,7 @@ const resetSearch = ()=>{
//删除用户
const deleteUser = (userId)=>{
if(confirm('您确认要删除该员工吗?')){
- axios.post(BASE_URL+'/wsf/user/delete/'+userId).then((response)=>{
+ axios.post(BASE_URL+'/wsf/user/delete/'+userId,null,{headers: {"Authorization":token}}).then((response)=>{
console.log("删除用户:"+userId);
if(response.data.code==2000){
ElMessage.success('删除成功!');
@@ -241,41 +175,29 @@ const deleteUser = (userId)=>{
//定义对象用来保存表单中的员工数据
const saveUserForm = ref({
- id:'',
+ userId:'',
username:'',
phone:'',
- avator:'',
+ avatar:'',
nickname:'',
-});
-//定义对象用来保存表单中的师傅数据
-const saveWorkerForm = ref({
- id:'',
- username:'',
- phone:'',
- realname:'',
- idcard:'',
- workarea:'',
- servertype:'',
- provinceid:'',
- cityid:'',
- countyid:'',
- typeid:'',
- categoryid:'',
+ sex:'',
+ status:'',
+ delFlag:'',
});
//定义变量控制弹窗是否出现
const dialogVisible = ref(false);
const dialogTitle = ref("编辑用户");
-const workerdialogVisible=ref(false);
-const workerdialogTitle=ref("师傅认证");
+
+
/* 点击用户表格的"编辑"按钮,出弹窗+修改弹窗标题 */
//定义编辑员工的方法
-const editUser = (id)=>{
+const editUser = (userId)=>{
//让弹窗出现
dialogVisible.value = true;
//修改弹窗的标题
- dialogTitle.value = '编辑员工';
+ dialogTitle.value = '编辑用户';
//根据id查询用户信息并回显在弹窗的表单中
- axios.get(BASE_URL+'/wsf/user/query?id='+id).then((response)=>{
+ axios.get(BASE_URL+'/wsf/user/query?userId='+userId,{headers: {"Authorization":token}}).then((response)=>{
if(response.data.code==2000){
//注意:后端返回的是List,所以查一条数据的话拿的是集合的第一个元素data[0]
saveUserForm.value = response.data.data[0];
@@ -291,27 +213,24 @@ const handleClose = ()=>{
//关闭弹窗且清空已输入的数据
dialogVisible.value = false;
saveUserForm.value = {};
+ fileList.value = [];//图片上传组件清空
}
}
-const workerhandleClose= ()=>{
- if(confirm("确定要关闭弹窗吗?")){
- //关闭弹窗且清空已输入的数据
- workerdialogVisible.value = false;
- saveWorkerForm.value = {};
- }
-}
-
const saveUser = ()=>{
//将表单数据封装成对象
+ if(fileList.value.length!=0){
+ saveUserForm.value.avatar=fileList.value[0].response.data;
+ }
let data = qs.stringify(saveUserForm.value);
//发送请求
- axios.post(BASE_URL+'/wsf/user/save',data)
+ axios.post(BASE_URL+'/wsf/user/save',data,{headers: {"Authorization":token}})
.then((response)=>{
if(response.data.code==2000){
ElMessage.success('保存成功!');
//保存成功后要:关弹窗+清除弹窗关联的表单数据
dialogVisible.value = false;
saveUserForm.value = {};
+ dialogImageUrl.value='';
//新增与编辑用户后都需要重新加载用户数据
loadUser();
}else{
@@ -320,76 +239,56 @@ const saveUser = ()=>{
})
}
-const becomeworker = (id)=>{
- //让弹窗出现
- workerdialogVisible.value = true;
+const becomeworker = (userId)=>{
//根据id查询用户信息并回显在弹窗的表单中
- axios.get(BASE_URL+'/wsf/user/query?id='+id).then((response)=>{
+ axios.get(BASE_URL+'/wsf/user/becomeWorker?userId='+userId,{headers: {"Authorization":token}}).then((response)=>{
if(response.data.code==2000){
- saveWorkerForm.value.username = response.data.data[0].username;
- saveWorkerForm.value.phone = response.data.data[0].phone;
+ ElMessage.success('恭喜你成为一名师傅!');
}else{
ElMessage.error(response.data.msg);
}
})
- loadprovince();
- loadserver()
-}
-const loadprovince = ()=>{
- axios.get(BASE_URL+'/wsf/area/queryprovince').then((response)=>{
- if(response.data.code==2000){
- proOptions.value = response.data.data;
- }else{
- ElMessage.error(response.data.msg);
- }
- })
}
-const loadcity = ()=>{
- cityOptions.value=[];
- saveWorkerForm.value.countyid='';
- let provinceid = saveWorkerForm.value.provinceid;
- axios.get(BASE_URL+'/wsf/area/querycity?provinceid='+provinceid).then((response)=>{
- if(response.data.code==2000){
- cityOptions.value = response.data.data;
- }else{
- ElMessage.error(response.data.msg);
- }
- })
-}
-const loadcounty = ()=>{
- countyOptions.value=[];
- let cityid = saveWorkerForm.value.cityid;
- axios.get(BASE_URL+'/wsf/area/querycounty?cityid='+cityid).then((response)=>{
- if(response.data.code==2000){
- countyOptions.value = response.data.data;
- }else{
- ElMessage.error(response.data.msg);
- }
- })
+
+//图片上传
+const fileList = ref([]);
+const dialogImageUrl = ref('');
+const dialogimgVisible = ref(false);
+//定义变量用来保存图片上传给哪个后端接口地址
+const actionUrl = ref(BASE_URL + '/wsf/file/upload');
+//图片上传后预览
+const handlePictureCardPreview = (uploadFile) => {
+ dialogImageUrl.value = uploadFile.url
+ // dialogimgVisible.value = true;
}
-const loadserver = ()=>{
- serverOptions.value=[];
- saveWorkerForm.value.serverid='';
- axios.get(BASE_URL+'/wsf/server/queryType').then((response)=>{
- if(response.data.code==2000){
- serverOptions.value = response.data.data;
- }else{
- ElMessage.error(response.data.msg);
- }
- })
+//移除图片
+const handleRemove = (uploadFile, uploadFiles) => {
+ console.log(uploadFile, uploadFiles);
+ //1.得到要删除的图片路径 uploadFile就是我们要删除的那个图片文件对象
+ let imgUrl = uploadFile.response.data;
+ //2.给后端发请求,删除图片
+ axios.post(BASE_URL+'/wsf/file/remove?imgUrl='+imgUrl,null,{headers: {"Authorization":token}})
+ .then((response)=>{
+ if (response.data.code==2000){
+ ElMessage.success('删除成功!');
+ }
+ })
}
-const loadcategory=()=>{
- categoryOptions.value=[];
- let serverid = saveWorkerForm.value.typeid;
- axios.get(BASE_URL+'/wsf/server/queryCategory?serverid='+serverid).then((response)=>{
- console.log("serverid:"+serverid);
- if(response.data.code==2000){
- categoryOptions.value = response.data.data;
- }else{
- ElMessage.error(response.data.msg);
- }
- })
+//定义方法修改用户状态
+const changeStatus = (userId,status)=>{
+ saveUserForm.value.userId=userId;
+ saveUserForm.value.status=status;
+ let data = qs.stringify(saveUserForm.value);
+ axios.post('http://localhost:8080/wsf/user/save',data,{headers: {"Authorization":token}})
+ .then((response)=>{
+ if(response.data.code==2000){
+ ElMessage.success('修改成功!');
+ saveUserForm.value={};
+ }else{
+ ElMessage.error(response.data.msg);
+ }
+ })
}
diff --git a/wsf-ui/src/views/worker/AdminAudit.vue b/wsf-ui/src/views/worker/AdminAudit.vue
new file mode 100644
index 0000000..1da5be2
--- /dev/null
+++ b/wsf-ui/src/views/worker/AdminAudit.vue
@@ -0,0 +1,245 @@
+
+
+
+
+ 审批列表
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 重置
+ 查询
+
+
+
+
+
+
+
+ 待审核
+ 已通过
+ 驳回
+
+
+
+
+
+
+
+
+
+
+
+ >审批
+ 查看
+
+
+
+
+
+
+
+
+ {{ auditDialogData.realName }}
+ {{ auditDialogData.idCard }}
+ {{ auditDialogData.phone }}
+ {{ auditDialogData.createTime }}
+
+
+
+
+ {{ auditDialogData.rejectReason }}
+
+
+
+ 取消
+ 驳回
+ 通过
+
+
+
+
+
+
+
+
+
+
+
+ 取消
+ 确定
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/wsf-ui/src/views/worker/WorkerAudit.vue b/wsf-ui/src/views/worker/WorkerAudit.vue
new file mode 100644
index 0000000..7fea533
--- /dev/null
+++ b/wsf-ui/src/views/worker/WorkerAudit.vue
@@ -0,0 +1,130 @@
+
+
+
+
+ 申请列表
+
+
+
+
+
+ 申请中
+ 已通过
+ 驳回
+
+
+
+
+
+
+
+
+ 王浩
+
+
+ 查看
+
+
+
+
+
+
+
+
+ {{ auditDialogData.realName }}
+ {{ auditDialogData.idCard }}
+ {{ auditDialogData.phone }}
+ {{ auditDialogData.createTime }}
+ {{ auditDialogData.auditTime }}
+ 王浩
+
+
+
+ {{ auditDialogData.rejectReason }}
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/wsf-ui/src/views/worker/WorkerView.vue b/wsf-ui/src/views/worker/WorkerView.vue
index 8af4a0a..047dc82 100644
--- a/wsf-ui/src/views/worker/WorkerView.vue
+++ b/wsf-ui/src/views/worker/WorkerView.vue
@@ -1,10 +1,421 @@
+
+
+
+ 师傅信息
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 重置
+ 查询
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 实名认证
+ 入驻
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 取消
+ 提交
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 取消
+ 提交
+
+
+
+
+//定义加载用户列表的方法
+const loadWorker = ()=>{
+ let data = qs.stringify(searchWorkerForm.value);//username=tom&status=0
+ axios.get(BASE_URL+'/wsf/worker/query?'+data,{headers: {"Authorization":token}})
+ .then((response)=>{//回调函数,处理响应数据
+ if(response.data.code==2000){//后端返回的状态码是2000说明成功了
+ console.log(response.data.data);
+ workerArr.value = response.data.data;//把请求回来的数据装到绑定表格的数组中
+ }else{
+ ElMessage.error(response.data.msg);
+ }
+ })
+}
+onMounted(()=>{
+ loadWorker();
+})
+//重置搜索
+const resetSearch = ()=>{
+ //清空之前的搜索内容
+ searchWorkerForm.value = {};
+ //重新加载所有的用户数据
+ loadWorker();
+}
+const verification=(workerId)=>{
+ saveWorkerForm.value.workerId=workerId;
+ verificationdialogVisible.value=true;
+}
+//定义对象用来保存表单中的师傅数据
+const saveWorkerForm = ref({
+ workerId:'',
+ realName:'',
+ idCard:'',
+});
+const saveMoveInForm=ref({
+ workerId:'',
+ passport:'',
+ provinceId:'',
+ cityId:'',
+ countyId:'',
+ categoryId:'',
+ countyIds: [], // 初始化为空数组
+ categoryIds: [],
+})
+//处理认证弹窗关闭的方法
+const verificationhandleClose = ()=>{
+ if(confirm("确定要关闭弹窗吗?")){
+ //关闭弹窗且清空已输入的数据
+ verificationdialogVisible.value = false;
+ saveWorkerForm.value = {};
+ }
+}
+const saveWorker = () => {
+ let data = qs.stringify(saveWorkerForm.value);
+ axios.post(BASE_URL+'/wsf/worker/save',data,{headers: {"Authorization":token}})
+ .then((response)=>{
+ if(response.data.code==2000){
+ ElMessage.success('实名认证成功!');
+ verificationdialogVisible.value = false;
+ saveWorkerForm.value = {};
+ loadWorker();
+ }else{
+ ElMessage.error(response.data.msg);
+ }
+ })
+}
+const moveIn=(workerId)=>{
+ saveMoveInForm.value.workerId=workerId;
+ moveIndialogVisible.value=true;
+ loadProvince();
+ loadType();
+}
+//定义入驻变量控制弹窗是否出现
+const moveIndialogVisible=ref(false);
+const moveIndialogTitle=ref("入驻");
+const moveInhandleClose= ()=>{
+ if(confirm("确定要关闭弹窗吗?")){
+ //关闭弹窗且清空已输入的数据
+ moveIndialogVisible.value = false;
+ proOptions.value = [];
+ countyOptions.value = [];
+ cityOptions.value = [];
+ typeOptions.value = [];
+ saveMoveInForm.value = {};
+ categoryOptions.value = [];
+ fileList.value = [];//图片上传组件清空
+ }
+}
+//认证状态转换为文字显示
+const CertStatusFormatter = (row,column,cellValue)=>{
+ if(cellValue==0){
+ cellValue='未认证';
+ }else if(cellValue==1){
+ cellValue='已认证';
+ }
+ return cellValue;
+}
+//入驻状态转换为文字显示
+const AuditStatusFormatter = (row,column,cellValue)=>{
+ if(cellValue==0){
+ cellValue='驳回';
+ }else if(cellValue==1){
+ cellValue='通过';
+ }else if(cellValue==2){
+ cellValue='待审核';
+ }else if(cellValue==3){
+ cellValue='未入驻';
+ }
+ return cellValue;
+}
-
- Worker
-
+//图片上传
+const fileList = ref([]);
+const dialogImageUrl = ref('');
+const dialogimgVisible = ref(false);
+//定义变量用来保存图片上传给哪个后端接口地址
+const actionUrl = ref(BASE_URL + '/wsf/file/upload');
+//图片上传后预览
+const handlePictureCardPreview = (uploadFile) => {
+ dialogImageUrl.value = uploadFile.url
+ // dialogimgVisible.value = false;
+}
+//移除图片
+const handleRemove = (uploadFile, uploadFiles) => {
+ //1.得到要删除的图片路径 uploadFile就是我们要删除的那个图片文件对象
+ let imgUrl = uploadFile.response.data;
+ //2.给后端发请求,删除图片
+ axios.post(BASE_URL+'/wsf/file/remove?imgUrl='+imgUrl,null,{headers: {"Authorization":token}})
+ .then((response)=>{
+ if (response.data.code==2000){
+ ElMessage.success('删除成功!');
+ }
+ })
+}
+