17 Commits
Author SHA1 Message Date
lzyyj 6b3112b547 添加备案号 2026-01-21 10:13:16 +08:00
lzyyj ad93451897 Merge remote-tracking branch 'origin/gyj' into gyj
# Conflicts:
#	src/api/request.js
2025-06-11 09:47:19 +08:00
lzyyj 55ca703755 更新正式环境地址; 添加题头图及背景图; 2025-06-11 09:40:30 +08:00
monanxiao 8ef70b7ee8 后台管理 订单模块 列表状态增加:已取消 ,订单列表筛选下拉选择增加: 已取消 2025-02-19 15:56:21 +08:00
monanxiao ea6208ba8a 修改左侧菜单默认为展开样式 2025-02-12 10:57:51 +08:00
monanxiao 011f54cf9c 服务项目名称增加限制6个字符串 2025-02-08 09:33:22 +08:00
monanxiao 6d0b76e41e 完成添加全局重复下单按钮开关,服务项目增加服务图标上传 2025-02-08 09:28:49 +08:00
monanxiao ba176fe8e4 订单筛选去除费用查询、年月日筛选去除“按”字 2024-11-04 11:05:13 +08:00
monanxiao b582f5c73b 去除多优化后字段 2024-10-25 17:58:29 +08:00
monanxiao b80265f3e8 优化字段显示,已重新打包。 2024-10-24 17:57:30 +08:00
monanxiao 9073b8310e 更换线上地址接口。 2024-10-24 16:44:42 +08:00
monanxiao 6a624d9a3a 重写时间查询,年月日分离,已完成对接。 2024-10-24 11:52:39 +08:00
monanxiao e8f5f0b85a 完成后台接口对接,待打包部署上线。 2024-10-23 17:50:56 +08:00
monanxiao 9d099007c6 修改查询字段,暂未完成接口对接。 2024-10-22 17:58:57 +08:00
monanxiao 7e255d6a66 修改工程师岗位文字,优化接口、页面参数。 2024-10-21 17:57:52 +08:00
monanxiao 185429a94c 根据客户反馈需求进行了界面修改已完成,暂未对接接口,等待后端修改完成后对接接口。 2024-10-18 17:27:44 +08:00
monanxiao 4383fa69de 预装环境部署上线,域名备案通过后需切换正式域名。 2024-10-17 23:22:45 +08:00
29 changed files with 5359 additions and 580 deletions
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

+8 -1
View File
@@ -7,6 +7,13 @@ export function getOrderList(query) {
return service({
method: "get",
url: `${API_BASE_URL}/all/list`,
data: query,
params: query,
});
}
// 导出订单
export function exportOrder(query) {
const urlParams = new URLSearchParams(query);
return `https://api.cqcxj.cn/order/list/export?${urlParams.toString()}`;
}
+1 -1
View File
@@ -7,7 +7,7 @@ export function getApplyList(query) {
return service({
method: "get",
url: `${API_BASE_URL}/list`,
data: query,
params: query,
});
}
+3 -3
View File
@@ -1,7 +1,7 @@
import service from "../request.js";
const API_BASE_URL = '/user';
// 查询勘人员列表
// 查询勘人员列表
export function listSurveyorsUser(query) {
return service({
method: "get",
@@ -10,11 +10,11 @@ export function listSurveyorsUser(query) {
});
}
// 查询勘人员列表
// 查询勘人员列表
export function listMaintenanceUser(query) {
return service({
method: "get",
url: `${API_BASE_URL}/maintenance`,
params: query
});
}
}
+12 -4
View File
@@ -3,15 +3,15 @@ import service from "../request.js";
const API_BASE_URL = '/user';
// 客户列表
export function getUserList(query) {
export function getUserList(roleld, query) {
return service({
method: "get",
url: `${API_BASE_URL}/${query.roleld}`,
data: query,
url: `${API_BASE_URL}/${roleld}`,
params: query,
});
}
// 获取勘人员列表
// 获取勘人员列表
export function getSurveyorsList(query) {
return service({
method: "get",
@@ -27,4 +27,12 @@ export function getMaintenanceList(query) {
url: `${API_BASE_URL}/maintenance`,
data: query,
});
}
// 删除人员
export function deleteUser(ItemId) {
return service({
method: "delete",
url: `/application/role/${ItemId}`,
});
}
+6 -9
View File
@@ -9,10 +9,7 @@ const errorCode = {
default: "系统未知错误,请反馈给管理员",
};
// const url = "https://repair.cpolar.top"; // 开发地址
const url = "https://api.cqcxj.cn"; // 正式地址
// const url = "https://cqjql.scdswj.cn:9443"; // 临时地址
// const url = "https://repair-api.scdswj.cn"; // 测试环境地址
const url = "https://api.cqcxj.cn";
const service = axios.create({
baseURL: url,
@@ -48,7 +45,7 @@ service.interceptors.request.use(
return config;
},
(error) => {
Promise.reject(error);
Promise.reject(error).then(() => {});
}
);
@@ -79,7 +76,7 @@ service.interceptors.response.use(
// Message({ message: msg, type: 'warning' })
ElMessage.error(message);
return Promise.reject("error");
} else if (code != 200) {
} else if (code !== 200) {
ElMessage.error(message);
return Promise.reject("error");
} else {
@@ -89,11 +86,11 @@ service.interceptors.response.use(
(error) => {
console.log(error.response.data); // 获取错误状态码
// 对响应错误做点什么
if (error.message.indexOf("timeout") != -1) {
if (error.message.indexOf("timeout") !== -1) {
ElMessage.error("网络超时");
} else if (error.message == "Network Error") {
} else if (error.message === "Network Error") {
ElMessage.error("网络连接错误");
} else if (error.response.data.code == "401") {
} else if (error.response.data.code === "401") {
sessionStorage.clear();
localStorage.clear();
router.push("/login");
+1 -1
View File
@@ -4,7 +4,7 @@
<div class="avatar">
<img src="../../../assets/images/avart.jpg" alt="avatar" />
</div>
<span class="username" :style="{ color: themeConfig.footColor }">超级管理员</span>
<span class="username" :style="{ color: themeConfig.footColor }">管理员</span>
</div>
<template #dropdown>
<el-dropdown-menu>
+7 -2
View File
@@ -26,6 +26,11 @@ export const menuListItem = [
url: "/activity",
icon: "Menu",
},
{
title: "重复下单开关",
url: "/switchOrder",
icon: "Menu",
},
]
},
{
@@ -49,7 +54,7 @@ export const menuListItem = [
icon: "Menu",
},
{
title: "勘人员",
title: "勘人员",
url: "/reconnaissanceList",
icon: "Menu",
},
@@ -88,7 +93,7 @@ export const menuListItem = [
icon: "Menu",
},
{
title: "勘工程师",
title: "勘工程师",
url: "/reconnaissanceScheduling",
icon: "Menu",
},
+11 -2
View File
@@ -64,6 +64,15 @@ const routerList = [
requiresAuth: true, //有一些页面是否登录才能进去
},
},
{
path: "/switchOrder",
name: "switchOrder",
component: () => import("../views/system/switchOrder.vue"),
meta: {
name: "重复下单开关",
requiresAuth: true, //有一些页面是否登录才能进去
},
},
{
path: "/edit",
name: "edit",
@@ -139,7 +148,7 @@ const routerList = [
component: () => import("../views/users/reconnaissance.vue"),
meta: {
requiresAuth: true,
name: "勘工程师",
name: "勘工程师",
},
},
{
@@ -206,7 +215,7 @@ const routerList = [
component: () => import("../views/scheduling/reconnaissance.vue"),
meta: {
requiresAuth: true,
name: "勘人员排班",
name: "勘人员排班",
},
},
{
+1 -1
View File
@@ -8,7 +8,7 @@ export default {
state: {
UserInfo: {},
token: sessionStorage.getItem("token") || "",
isCollapse: true,
isCollapse: false,
themeConfig: {
primary: "#4060c7",
tabColor: "#FFFFFF",
+95 -61
View File
@@ -1,22 +1,49 @@
<template>
<el-card class="mt10">
<!-- <el-card class="mt10">-->
<!-- <el-row>-->
<!-- <el-col :span="6">-->
<!-- <el-statistic title="合计" :value="268500" />-->
<!-- </el-col>-->
<!-- <el-col :span="6">-->
<!-- <el-statistic title="已通过" :value="268500" />-->
<!-- </el-col>-->
<!-- <el-col :span="6">-->
<!-- <el-statistic title="待审核" :value="268500" />-->
<!-- </el-col>-->
<!-- <el-col :span="6">-->
<!-- <el-statistic title="已驳回" :value="268500" />-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- </el-card>-->
<el-card class="mt10">
<el-form :inline="true" :model="formSearch" class="demo-form-inline">
<el-form-item label="微信昵称">
<el-form-item label="姓名">
<el-input
v-model="searchWechatNickname"
v-model="formSearch.name"
style="max-width: 300px"
placeholder="模糊查询微信昵称"
placeholder="模糊查询姓名"
class="input-with-select"
/>
</el-form-item>
<el-form-item label="手机号">
<el-input
v-model="searchWechatNickname"
style="max-width: 300px"
placeholder="模糊查询手机号"
class="input-with-select"
<!-- <el-form-item label="手机号">-->
<!-- <el-input-->
<!-- v-model="searchWechatNickname"-->
<!-- style="max-width: 300px"-->
<!-- placeholder="模糊查询手机号"-->
<!-- class="input-with-select"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="时间">
<el-date-picker
v-model="formSearch.date"
type="date"
placeholder="请选择时间"
@clear="clearDate"
/>
</el-form-item>
@@ -24,8 +51,11 @@
<el-button type="primary" @click="onSearchSubmit">搜索</el-button>
</el-form-item>
</el-form>
<el-table
ref="table"
:data="tableData"
@@ -75,7 +105,6 @@
<el-table-column
label="申请时间"
prop="createTime"
:formatter="formatDate"
width="auto"
align="center"
show-overflow-tooltip
@@ -97,8 +126,14 @@
min-width="120"
>
<template v-slot:default="scope" >
<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>
<template v-if="scope.row.status === 0">
<el-button type="success" @click="handleApprove(scope.row)">通过</el-button>
<el-button type="danger" @click="handleReject(scope.row)">驳回</el-button>
</template>
<template v-else>
<el-tag type="info">处理完成</el-tag>
</template>
</template>
</el-table-column>
@@ -117,44 +152,39 @@
<script setup>
import { ref, onMounted } from 'vue';
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'
const tableData = ref([]);
const searchWechatNickname = ref('');
const searchName = ref('');
const searchMobile = ref('');
const queryData = ref({
keyWord: '',
const total = ref(0)
const formSearch = ref({
roleId: 3,
name: '',
page: 1,
size: 10,
current: 1,
date: ''
});
const formSearch = ref({
goodsName:'',
status: ' ',
id: '',
amount: ''
});
const initData = () => {
// 加载示例数据
// 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;
getApplyList(formSearch.value).then((res) => {
tableData.value = res.data.records;
});
};
const formatDate = (row, column, cellValue) => {
const date = new Date(cellValue);
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
const formatDate = (date) => {
if (typeof date === 'string') {
// 检查是否已经是格式化的字符串
const regex = /^\d{4}-\d{2}-\d{2}$/;
if (regex.test(date)) {
return date; // 已经是格式化的字符串,直接返回
}
}
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
const statusFormater = (row, column, cellValue) => {
@@ -170,7 +200,7 @@ const statusFormater = (row, column, cellValue) => {
const postFormater = (row, column, cellValue) => {
if (cellValue === 2) {
return '勘工程师';
return '勘工程师';
} else if (cellValue === 3) {
return '维修工程师';
} else {
@@ -178,12 +208,27 @@ const postFormater = (row, column, cellValue) => {
}
}
const onSearchSubmit = () => {
console.log('点击搜索');
queryData.value.keyWord = searchWechatNickname.value || searchName.value || searchMobile.value;
initData();
// 搜索事件
const onSearchSubmit = ()=> {
let params = {...formSearch.value}
if(params.date !== '')
{
params.date = formatDate(params.date);
}
getApplyList(params).then((res) => {
tableData.value = res.data.records
total.value = res.data.total
})
};
// 清空日期
const clearDate = () => {
formSearch.value.date = ''
}
const handleApprove = (item) => {
ElMessageBox.confirm('确定要通过该申请?', '提示', {
confirmButtonText: '确定',
@@ -242,9 +287,9 @@ const openModel = (index) => {
};
const handleCurrentChange = (val) => {
queryData.value.size = 10;
queryData.value.page = val;
initData(queryData.value);
formSearch.value.size = 10;
formSearch.value.page = val;
initData(formSearch.value);
};
onMounted(() => {
@@ -253,19 +298,8 @@ onMounted(() => {
</script>
<style lang="scss" scoped>
.mt-4 {
float: right;
text-align: right;
margin-bottom: 20px;
}
.input-with-select {
max-width: 300px;
}
.expand-title {
padding: 10px;
color: #919399;
font-weight: 600;
.el-col {
text-align: center;
}
</style>
+86 -31
View File
@@ -1,22 +1,50 @@
<template>
<!-- <el-card class="mt10">-->
<!-- <el-row>-->
<!-- <el-col :span="6">-->
<!-- <el-statistic title="合计" :value="268500" />-->
<!-- </el-col>-->
<!-- <el-col :span="6">-->
<!-- <el-statistic title="已通过" :value="268500" />-->
<!-- </el-col>-->
<!-- <el-col :span="6">-->
<!-- <el-statistic title="待审核" :value="268500" />-->
<!-- </el-col>-->
<!-- <el-col :span="6">-->
<!-- <el-statistic title="已驳回" :value="268500" />-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- </el-card>-->
<el-card class="mt10">
<el-form :inline="true" :model="formSearch" class="demo-form-inline">
<el-form-item label="微信昵称">
<el-form-item label="姓名">
<el-input
v-model="searchWechatNickname"
v-model="formSearch.name"
style="max-width: 300px"
placeholder="模糊查询微信昵称"
placeholder="模糊查询姓名"
class="input-with-select"
/>
</el-form-item>
<el-form-item label="手机号">
<el-input
v-model="searchWechatNickname"
style="max-width: 300px"
placeholder="模糊查询手机号"
class="input-with-select"
<!-- <el-form-item label="手机号">-->
<!-- <el-input-->
<!-- v-model="searchWechatNickname"-->
<!-- style="max-width: 300px"-->
<!-- placeholder="模糊查询手机号"-->
<!-- class="input-with-select"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="时间">
<el-date-picker
v-model="formSearch.date"
type="date"
placeholder="请选择时间"
@clear="clearDate"
/>
</el-form-item>
@@ -75,7 +103,6 @@
<el-table-column
label="申请时间"
prop="createTime"
:formatter="formatDate"
width="auto"
align="center"
show-overflow-tooltip
@@ -97,8 +124,14 @@
min-width="120"
>
<template v-slot:default="scope" >
<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>
<template v-if="scope.row.status === 0">
<el-button type="success" @click="handleApprove(scope.row)">通过</el-button>
<el-button type="danger" @click="handleReject(scope.row)">驳回</el-button>
</template>
<template v-else>
<el-tag type="info">处理完成</el-tag>
</template>
</template>
</el-table-column>
@@ -133,28 +166,36 @@ const queryData = ref({
page: 1,
size: 10,
});
const total = ref(0)
const formSearch = ref({
goodsName:'',
status: ' ',
id: '',
amount: ''
roleId: 2,
name: '',
page: 1,
size: 10,
current: 1,
date: ''
});
const initData = () => {
// 加载示例数据
// 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;
getApplyList(formSearch.value).then((res) => {
tableData.value = res.data.records;
});
};
const formatDate = (row, column, cellValue) => {
const date = new Date(cellValue);
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
const formatDate = (date) => {
if (typeof date === 'string') {
// 检查是否已经是格式化的字符串
const regex = /^\d{4}-\d{2}-\d{2}$/;
if (regex.test(date)) {
return date; // 已经是格式化的字符串,直接返回
}
}
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
const statusFormater = (row, column, cellValue) => {
@@ -170,7 +211,7 @@ const statusFormater = (row, column, cellValue) => {
const postFormater = (row, column, cellValue) => {
if (cellValue === 2) {
return '勘工程师';
return '勘工程师';
} else if (cellValue === 3) {
return '维修工程师';
} else {
@@ -178,10 +219,24 @@ const postFormater = (row, column, cellValue) => {
}
}
// 清空日期
const clearDate = () => {
formSearch.value.date = ''
}
// 搜索事件
const onSearchSubmit = () => {
console.log('点击搜索');
queryData.value.keyWord = searchWechatNickname.value || searchName.value || searchMobile.value;
initData();
let params = {...formSearch.value}
if(params.date !== '')
{
params.date = formatDate(params.date);
}
getApplyList(params).then((res) => {
tableData.value = res.data.records
total.value = res.data.total
})
};
const handleApprove = (item) => {
-142
View File
@@ -1,142 +0,0 @@
<template>
<el-card>
<!-- <Row> 更多查看<a href="https://vueflow.dev/">Vue Flow官方文档</a> </Row> -->
<div class="mt-4">
<el-button type="primary" @click="resetTransform">重置</el-button>
<el-button type="success" @click="updatePos">修改属性</el-button>
<el-button type="success" @click="toggleclass">修改样式</el-button>
<el-button type="warning" @click="logToObject">查看属性</el-button>
</div>
<VueFlow v-model="elements" class="vue-flow-content">
<Background />
<MiniMap />
<Controls />
</VueFlow>
</el-card>
<el-dialog
v-model="dialogVisible"
title="流程图属性"
width="70%"
:before-close="handleClose"
>
<span>{{ dialogContent }}</span>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="dialogVisible = false"
>确认</el-button
>
</span>
</template>
</el-dialog>
</template>
<script setup>
import { ElMessage, ElMessageBox } from 'element-plus'
import '@braks/vue-flow/dist/style.css'
import '@braks/vue-flow/dist/theme-default.css'
import {
Background,
Controls,
MiniMap,
VueFlow,
isNode,
useVueFlow,
} from '@braks/vue-flow'
import { ref } from 'vue'
// import { Message } from 'view-ui-plus'
const dialogVisible = ref(false)
const dialogContent = ref('')
const elementsDefault = [
{
id: '1',
type: 'input',
label: '自律',
position: { x: 250, y: 5 },
class: 'node-light',
},
{
id: '2',
label: '控玩玩手机的时间',
position: { x: 100, y: 100 },
class: 'node-light',
},
{
id: '3',
label: '养成良好生活习惯',
position: { x: 400, y: 100 },
class: 'node-light',
},
{
id: '4',
label: '培养阅读习惯',
position: { x: 400, y: 200 },
class: 'node-light',
},
{ id: 'e1-2', source: '1', target: '2', animated: true },
{ id: 'e1-3', source: '1', target: '3' },
]
const elements = ref(elementsDefault)
const {
onPaneReady,
onNodeDragStop,
onConnect,
addEdges,
setTransform,
toObject,
} = useVueFlow({
defaultZoom: 1.5,
minZoom: 0.2,
maxZoom: 4,
})
onPaneReady(({ fitView }) => {
fitView()
})
onNodeDragStop((e) => console.log('drag stop', e))
onConnect((params) => addEdges([params]))
const updatePos = () => {
elements.value.forEach((el) => {
if (isNode(el)) {
el.position = {
x: Math.random() * 400,
y: Math.random() * 400,
}
}
})
}
const logToObject = () => {
dialogVisible.value = true
dialogContent.value = JSON.stringify(toObject())
// Message.info(JSON.stringify(toObject()))
}
const resetTransform = () => {
elements.value = elementsDefault
setTransform({ x: 0, y: 0, zoom: 1 })
}
const toggleclass = () =>
elements.value.forEach(
(el) => (el.class = el.class === 'node-light' ? 'node-dark' : 'node-light')
)
</script>
<style lang="scss" scoped>
.vue-flow-content {
height: 80vh;
.node-light {
background: none;
}
.node-dark {
background: #eeeeee;
}
}
.mt-4 {
float: right;
text-align: right;
margin-bottom: 20px;
}
</style>
+83 -9
View File
@@ -22,6 +22,7 @@
<el-form-item label="服务名称" prop="formData.goodsName">
<el-input
v-model="formData.goodsName"
maxlength="6"
placeholder="请输入服务名称"
></el-input>
</el-form-item>
@@ -40,6 +41,20 @@
/>
</el-form-item>
<el-form-item label="服务图标">
<el-upload
v-model:file-list="fileIcon"
list-type="picture-card"
:before-upload="beforeUpload"
:http-request="addUploadIconFile"
:limit="1"
:on-exceed="handleIconExceed"
:on-remove="handleIconRemove"
>
<el-icon><Plus /></el-icon>
</el-upload>
</el-form-item>
<el-form-item label="轮播图">
<el-upload
v-model:file-list="fileBannerList"
@@ -106,13 +121,20 @@
/>
</template>
<template v-slot:default="scope" v-if="item.props === 'icon'">
<el-image
style="width: 300px; height: 200px"
:src="scope.row.icon"
/>
</template>
<template v-slot:default="scope" v-if="item.props === 'carouselImage'">
<view v-for="itemImg in scope.row.carouselImage">
<el-image
:src="itemImg.url"
:preview-src-list="[itemImg.url]"
style="width:150px; height: 80px;margin-right: 5px;"
:style="{
boxShadow: `var(light)`,
@@ -127,7 +149,7 @@
<el-image
style="width: 300px; height: 200px"
:src="scope.row.details"
:preview-src-list="[scope.row.details]"
/>
</template>
@@ -201,18 +223,20 @@ const formData = ref({
price: '',
carouselImage: [],
details: '',
icon: '',
isList: false
})
const fileBannerList = ref([]); // 轮播图
const fileDetail = ref(); // 详情图
const fileDetail = ref([]); // 详情图
const fileIcon = ref([]); // 服务图标
// 页面初始化
const initData = () => {
getGoodsList(queryData.value).then((res) => {
let itemData = res.data.map(item => {
tableData.value = res.data.map(item => {
try {
// 尝试将字符串转换为 JSON 对象
item.carouselImage = JSON.parse(item.carouselImage);
@@ -222,8 +246,6 @@ const initData = () => {
}
return item;
});
tableData.value = itemData;
total.value = res.total
})
}
@@ -265,6 +287,13 @@ const handleDetailExceed= (files, uploadFiles) => {
)
}
// 服务图标上传限制
const handleIconExceed = (files, uploadFiles) => {
ElMessage.warning(
`服务图标最多可上传1张`
)
}
// 轮播图移除
const handleBannerRemove = (file) => {
@@ -279,6 +308,11 @@ const handleDetailRemove = (file, fileList) => {
formData.value.details = '';
}
// 服务图表移除
const handleIconRemove = (file, fileList) => {
formData.value.icon = '';
}
// 轮播上传请求
const addUploadCarouselImageFile = (params) => {
const formData = new FormData();
@@ -313,6 +347,23 @@ const addUploadDetailFile = (params) => {
});
}
// 服务图标上传
const addUploadIconFile = (params) => {
const formData = new FormData();
formData.append('files', params.file);
addFile(formData)
.then((response) => {
handleIconSuccess(response, params.file, params.fileList);
})
.catch((error) => {
if(error)
{
handleError(error, params.file, params.fileList);
}
});
}
// 处理轮播上传成功的回调
const handleCarouselImageSuccess = (response, file) => {
@@ -331,6 +382,12 @@ const handleDetailSuccess = (response) => {
loading.value = false;
}
// 处理服务图标上传成功的回调
const handleIconSuccess = (response) => {
formData.value.icon = response.data[0];
loading.value = false;
}
// 处理上传失败的回调
const handleError = (error, file, fileList) => {
loading.value = false;
@@ -377,15 +434,30 @@ const onSubmit = () => {
return;
}
formData.value.carouselImage = JSON.stringify(formData.value.carouselImage); // 转为字符串
let params = {...formData.value}
params.carouselImage = JSON.stringify(params.carouselImage); // 转为字符串
addGoods(formData.value)
addGoods(params)
.then((res) => {
drawer.value = false;
formData.value = {
goodsName: '',
price: '',
carouselImage: [],
details: '',
isList: false
}
fileBannerList.value = [];
fileDetail.value = [];
ElMessage({
message: '添加成功',
type: 'success',
})
drawer.value = false;
initData();
})
.catch((err) => {
@@ -422,6 +494,8 @@ const cancelDrawer = () => {
details: '',
isList: false
}
fileBannerList.value = [];
fileDetail.value = [];
}
// 分页切换
+6
View File
@@ -16,6 +16,12 @@ export const options = [
props: 'isList',
width: '150',
align: 'left'
},
{
label: '服务图标',
props: 'icon',
width: 'auto',
align: 'left'
},
{
label: '轮播图',
+5
View File
@@ -135,6 +135,11 @@
</div> -->
</div>
</div>
<!-- 备案号放在 login-box 外面居中显示 -->
<div class="beian-info" style="position: absolute; bottom: 20px; width: 100%; text-align: center; color: #999; font-size: 16px;">
渝ICP备2024040579号
</div>
</div>
</template>
+396 -78
View File
@@ -13,7 +13,7 @@
<el-form-item label="订单编号">
<el-input
v-model="formSearch.id"
v-model="formSearch.orderId"
style="max-width: 300px"
placeholder="订单编号"
class="input-with-select"
@@ -23,25 +23,87 @@
<el-form-item label="订单状态">
<el-select v-model="formSearch.status" placeholder="订单状态" style="width: 200px">
<el-option label="全部" value=" " />
<el-option label="待付款" value="0" />
<el-option label="已付款" value="1" />
<el-option label="待服务" value="0" />
<el-option label="服务中" value="1" />
<el-option label="待付款" value="2" />
<el-option label="已完成" value="3" />
<el-option label="已取消" value="4" />
</el-select>
</el-form-item>
<el-form-item label="维修费用">
<!-- <el-form-item label="维修费用">-->
<!-- <el-input-->
<!-- v-model="formSearch.amount"-->
<!-- style="max-width: 300px"-->
<!-- placeholder="维修费用"-->
<!-- class="input-with-select"-->
<!-- />-->
<!-- </el-form-item>-->
<br>
<el-form-item label="年">
<el-date-picker
v-model="formSearch.year"
type="year"
placeholder="请选择年份"
:disabled-date="disablePastAndSpecificYear"
style="margin-right: 20px"
@clear="clearYearDate"
@change="isYearClick"
/>
</el-form-item>
<el-form-item label="月">
<el-date-picker
v-model="formSearch.month"
type="month"
placeholder="请选择月份"
:disabled="!formSearch.year"
:disabled-date="disablePastAndSpecificMonth"
@clear="clearMonthDate"
@change="isMonthClick"
:default-value="new Date(formatDate(formSearch.year).year, 1, 1)"
:arrow-control="true"
/>
</el-form-item>
<el-form-item label="日">
<el-date-picker
v-model="formSearch.day"
:disabled="!formSearch.month"
:disabled-date="disablePastAndSpecificDay"
type="date"
placeholder="请选择日期"
@clear="clearDay"
@change="isDayClick"
:default-value="new Date(formatDate(formSearch.year).year, formatDate(formSearch.month).month-1, 1)"
:arrow-control="true"
/>
</el-form-item>
<br>
<el-form-item label="用户姓名">
<el-input
v-model="formSearch.amount"
v-model="formSearch.username"
style="max-width: 300px"
placeholder="维修费用"
placeholder="用户姓名"
class="input-with-select"
/>
</el-form-item>
<el-form-item label="用户昵称">
<el-form-item label="勘测工程师姓名">
<el-input
v-model="searchName"
v-model="formSearch.surveyorsName"
style="max-width: 300px"
placeholder="用户昵称"
placeholder="工程师姓名"
class="input-with-select"
/>
</el-form-item>
<el-form-item label="维修工程师姓名">
<el-input
v-model="formSearch.repairerName"
style="max-width: 300px"
placeholder="工程师姓名"
class="input-with-select"
/>
</el-form-item>
@@ -50,6 +112,10 @@
<el-button type="primary" @click="onSearchSubmit">搜索</el-button>
</el-form-item>
<el-form-item style="float: right">
<el-button type="warning" @click="excelDown">导出</el-button>
</el-form-item>
</el-form>
<el-table
@@ -81,6 +147,7 @@
<el-tag type="warning" v-if="scope.row.status === 1">服务中</el-tag>
<el-tag type="danger" v-if="scope.row.status === 2">待付款 </el-tag>
<el-tag type="success" v-if="scope.row.status === 3">已完成</el-tag>
<el-tag type="info" style="color: #d54f50" v-if="scope.row.status === 4">已取消</el-tag>
</template>
</el-table-column>
@@ -112,6 +179,35 @@
</template>
</el-table-column>
<el-table-column
label="勘测工程师"
width="120"
align="center"
show-overflow-tooltip
sortable
>
<template #default="scope">
{{ scope.row.surveyorsName }}
</template>
</el-table-column>
<el-table-column
label="维修工程师"
width="120"
align="center"
show-overflow-tooltip
sortable
>
<template #default="scope">
<template v-if="scope.row.repairerName">
{{ scope.row.repairerName }}
</template>
<template v-else>
<el-tag type="info">未分配</el-tag>
</template>
</template>
</el-table-column>
<el-table-column
label="报价费用"
width="120"
@@ -120,12 +216,17 @@
sortable
>
<template #default="scope">
{{ formatPrice(scope.row.amount) }}
<template v-if="scope.row.amount > 0">
{{ formatPrice(scope.row.amount) }}
</template>
<template v-else>
<el-tag type="info">暂未报价</el-tag>
</template>
</template>
</el-table-column>
<el-table-column
label="微信昵称"
label="用户姓名"
prop="username"
width="300"
align="center"
@@ -226,7 +327,13 @@
报价费用
</div>
</template>
{{ formatPrice(detailData.amount) }}
<template v-if="detailData.amount > 0">
{{ formatPrice(detailData.amount) }}
</template>
<template v-else>
<el-tag type="info">暂未报价</el-tag>
</template>
</el-descriptions-item>
<el-descriptions-item>
@@ -304,7 +411,8 @@
<script setup>
import {nextTick, onMounted, reactive, ref} from 'vue'
import {getOrderList} from "../../api/modules/order";
import {exportOrder, getOrderList} from "../../api/modules/order";
import {ElMessage} from "element-plus";
const tableData = ref([])
const table = ref()
@@ -315,19 +423,22 @@ const total = ref(0)
const searchName = ref('');
const drawer = ref(false)
const queryData = ref({
keyWord: '',
const formSearch = ref({
goodsName: '',
orderId: '',
status: ' ',
amount: '',
username: '',
surveyorsName: '',
repairerName: '',
month: '',
year: '',
day: '',
page: 1,
size: 10,
current: 1,
})
const formSearch = ref({
goodsName:'',
status: ' ',
id: '',
amount: ''
});
const detailData = ref();
const isStatus = ref('');
@@ -335,7 +446,7 @@ const isStatus = ref('');
// 初始化数据
const initData = () => {
getOrderList(queryData.value).then((res) => {
getOrderList(formSearch.value).then((res) => {
tableData.value = res.data.records
total.value = res.data.total
})
@@ -359,70 +470,277 @@ const detail = (row) => {
}
const handleCurrentChange = (val) => {
queryData.value.size = 10
queryData.value.page = val
initData(queryData.value)
formSearch.value.size = 10
formSearch.value.page = val
initData(formSearch.value)
}
// 搜索事件
const onSearchSubmit = ()=> {
console.log('点击搜索');
// 清空年份
const clearYearDate = () => {
formSearch.value.year = ''
}
// 清空月份
const clearMonthDate = () => {
formSearch.value.month = ''
}
// 清空日期
const clearDay = () => {
formSearch.value.day = ''
}
// 禁止选择之后的年份
const disablePastAndSpecificYear = (date) => {
// 获取当前日期
const currentDate = new Date();
currentDate.setDate(currentDate.getDate() - 1);
// 禁止选择今天的前一天及之前的日期(不包含今天)
if (date > currentDate) {
return true;
}
// 禁止选择特定的未来日期,例如节假日
const disabledDates = [new Date(2023, 9, 1), new Date(2023, 10, 1)];
return disabledDates.some((disabledDate) => {
return (
date.getFullYear() === disabledDate.getFullYear() &&
date.getMonth() === disabledDate.getMonth() &&
date.getDate() === disabledDate.getDate()
);
});
};
// 选中年份
const isYearClick = () => {
formSearch.value.month = '';
formSearch.value.day = '';
}
// 选中月份
const isMonthClick = () => {
formSearch.value.day = '';
}
// 选中天
const isDayClick = () => {
}
// 选中月份禁止调整年份
const disablePastAndSpecificMonth = (date) => {
if (!formSearch.value.year) {
return true; // 未选择年份时,禁用所有月份
}
const selectedYear = formatDate(formSearch.value.year).year;
const year = date.getFullYear();
// 只允许选择选中年份的月份
if (year !== selectedYear) {
return true;
}
return false;
};
// 选中年月禁止调整天
const disablePastAndSpecificDay = (date) => {
if (!formSearch.value.month) {
return true; // 未选择月份时,禁用所有日期
}
const selectedYear = formatDate(formSearch.value.year).year;
const selectedMonth = formatDate(formSearch.value.month).month;
const year = date.getFullYear();
const month = date.getMonth()+1;
if (year !== selectedYear || month != selectedMonth) {
return true;
}
return false;
}
const excelDown = async () => {
const url = downloadFile();
const currentDate = new Date().toISOString().split('T')[0]; // 获取当前日期,格式为 YYYY-MM-DD
const randomNum = generateRandomNumber();
try {
const response = await fetch(url, {
method: 'GET',
headers: {
'Authorization': "Bearer " + localStorage.getItem("token"), // 替换为实际的 token
'Content-Type': 'application/json'
}
});
const blob = await response.blob();
const downloadUrl = window.URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = downloadUrl;
a.download = `${formatDate(currentDate)}-${randomNum}.xlsx`; // 设置下载文件的名称
a.click();
window.URL.revokeObjectURL(downloadUrl);
} catch (error) {
console.error('Error downloading file:', error);
}
};
const generateRandomNumber = () => {
return Math.floor(Math.random() * 10000); // 生成一个 0 到 9999 之间的随机数
};
// 导出文件事件
const downloadFile = () => {
let params = {...formSearch.value}
if(params.status !== ' ')
{
params.status = parseInt(params.status, 10);
}else{
delete params.status;
}
if(params.year !== '')
{
let {
year
} = {...formatDate(params.year)};
params.year = year;
}else{
delete params.year;
}
if(params.month !== '')
{
let {
month
} = {...formatDate(params.month)};
params.month = month;
}else{
delete params.month;
}
if(params.day !== '')
{
let {
year,
month,
day
} = {...formatDate(params.day)};
params.year = year;
params.month = month;
params.day = day;
}else{
delete params.day;
}
return exportOrder(params);
}
// 搜索事件
const onSearchSubmit = ()=> {
let params = {...formSearch.value}
if(params.status !== ' ')
{
params.status = parseInt(params.status, 10);
}else{
delete params.status;
}
if(params.year !== '')
{
let {
year
} = {...formatDate(params.year)};
params.year = year;
}else{
delete params.year;
}
if(params.month !== '')
{
let {
month
} = {...formatDate(params.month)};
params.month = month;
}else{
delete params.month;
}
if(params.day !== '')
{
let {
year,
month,
day
} = {...formatDate(params.day)};
params.year = year;
params.month = month;
params.day = day;
}else{
delete params.day;
}
getOrderList(params).then((res) => {
tableData.value = res.data.records
total.value = res.data.total
})
};
// 日期格式
const formatDate = (date) => {
if(date === '')
{
return {
year: 1999,
month: 1,
day: 1,
};
}
if (typeof date === 'string') {
// 检查是否已经是格式化的字符串
const regex = /^\d{4}-\d{2}-\d{2}$/;
if (regex.test(date)) {
return date; // 已经是格式化的字符串,直接返回
}
}
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return {
year: year,
month: month,
day: day,
};
};
onMounted(() => {
initData()
})
</script>
<style lang="scss" scoped>
.mt-4 {
float: right;
text-align: right;
margin-bottom: 20px;
}
.demo-form-inline {
}
.dragClass {
background: rgba($color: #41c21a, $alpha: 0.5) !important;
}
// 停靠
.ghostClass {
background: rgba($color: #6cacf5, $alpha: 0.5) !important;
}
// 选择
.chosenClass:hover > td {
background: rgba($color: #f56c6c, $alpha: 0.5) !important;
}
.icon-view {
font-size: 20px;
color: #673ab7;
margin: 0 10px;
}
.icon-edit {
font-size: 20px;
color: #2f60c2;
margin: 0 10px;
}
.icon-dele {
font-size: 20px;
color: #ff5722;
}
.btn-color {
background: #fff;
color: #4c60cc;
}
.expand-title {
padding: 10px;
color: #919399;
font-weight: 600;
}
</style>
+2 -2
View File
@@ -165,7 +165,7 @@ const scheduleForm = ref({
const direction = ref('rtl')
const drawer = ref(false)
const editStatus = ref(false)
const userList = ref([]); // 勘人员列表
const userList = ref([]); // 勘人员列表
// 日期列表
const dateList = ref([]);
@@ -259,7 +259,7 @@ const handleDateChange = (value) => {
return;
}
// 查询勘人员列表
// 查询勘人员列表
let params = {
date: formatDate(scheduleForm.value.date),
timeQuantumId: scheduleForm.value.timeQuantumId
-97
View File
@@ -1,97 +0,0 @@
export const options = [
{
userId: 1,
avatar: 'https://pic.qqans.com/up/2024-6/2024620113729773.jpg',
name: '高永建',
nickname: '软件开发老高',
mobile: '19136448763',
date: '2024-10-11',
timeToTime: '14:00:00-15:00:00,15:00:00-16:00:00'
},
{
userId: 2,
avatar: 'https://pic.qqans.com/up/2024-6/2024620113729773.jpg',
name: '张三',
nickname: '软件开发老高',
mobile: '19136448763',
date: '2024-10-11',
timeToTime: '14:00:00-15:00:00,15:00:00-16:00:00'
},
{
userId: 3,
avatar: 'https://pic.qqans.com/up/2024-6/2024620113729773.jpg',
name: '李四',
nickname: '软件开发老高',
mobile: '19136448763',
date: '2024-10-11',
timeToTime: '14:00:00-15:00:00,15:00:00-16:00:00'
},
{
userId: 4,
avatar: 'https://pic.qqans.com/up/2024-6/2024620113729773.jpg',
name: '名称',
nickname: '软件开发老高',
mobile: '19136448763',
date: '2024-10-11',
timeToTime: '14:00:00-15:00:00,15:00:00-16:00:00'
},{
userId: 5,
avatar: 'https://pic.qqans.com/up/2024-6/2024620113729773.jpg',
name: '名称',
nickname: '软件开发老高',
mobile: '19136448763',
date: '2024-10-11',
timeToTime: '14:00:00-15:00:00,15:00:00-16:00:00'
},
{
userId: 6,
avatar: 'https://pic.qqans.com/up/2024-6/2024620113729773.jpg',
name: '李四',
nickname: '软件开发老高',
mobile: '19136448763',
date: '2024-10-11',
timeToTime: '14:00:00-15:00:00,15:00:00-16:00:00'
},{
userId: 7,
avatar: 'https://pic.qqans.com/up/2024-6/2024620113729773.jpg',
name: '张三',
nickname: '软件开发老高',
mobile: '19136448763',
date: '2024-10-11',
timeToTime: '14:00:00-15:00:00,15:00:00-16:00:00'
},{
userId: 8,
avatar: 'https://pic.qqans.com/up/2024-6/2024620113729773.jpg',
name: '名称',
nickname: '软件开发老高',
mobile: '19136448763',
date: '2024-10-07',
timeToTime: '14:00:00-15:00:00,15:00:00-16:00:00'
},{
userId: 9,
avatar: 'https://pic.qqans.com/up/2024-6/2024620113729773.jpg',
name: '名称',
nickname: '软件开发老高',
mobile: '19136448763',
date: '2024-10-08',
timeToTime: '14:00:00-15:00:00,15:00:00-16:00:00'
},{
userId: 10,
avatar: 'https://pic.qqans.com/up/2024-6/2024620113729773.jpg',
name: '名称',
nickname: '软件开发老高',
mobile: '19136448763',
date: '2024-10-09',
timeToTime: '14:00:00-15:00:00,15:00:00-16:00:00'
},
{
userId: 11,
avatar: 'https://pic.qqans.com/up/2024-6/2024620113729773.jpg',
name: '名称',
nickname: '软件开发老高',
mobile: '19136448763',
date: '2024-10-10',
timeToTime: '14:00:00-15:00:00,15:00:00-16:00:00'
},
];
+2 -2
View File
@@ -165,7 +165,7 @@ const scheduleForm = ref({
const direction = ref('rtl')
const drawer = ref(false)
const editStatus = ref(false)
const userList = ref([]); // 勘人员列表
const userList = ref([]); // 勘人员列表
// 日期列表
const dateList = ref([]);
@@ -259,7 +259,7 @@ const handleDateChange = (value) => {
return;
}
// 查询勘人员列表
// 查询勘人员列表
let params = {
date: formatDate(scheduleForm.value.date),
timeQuantumId: scheduleForm.value.timeQuantumId
-19
View File
@@ -40,14 +40,6 @@
/>
</el-form-item>
<el-form-item label="状态">
<el-switch
v-model="formData.flag"
inline-prompt
active-text="启用"
inactive-text="禁用"
/>
</el-form-item>
<div style="display: flex;justify-content: center;margin-top: 50px">
<el-button @click="handleCancel">取消</el-button>
@@ -82,17 +74,6 @@
</template>
</el-table-column>
<el-table-column label="状态" align="center">
<template #default="scope">
<el-switch
v-model="scope.row.flag"
inline-prompt
active-text="启用"
inactive-text="禁用"
@change="upStatus(scope.row)"
/>
</template>
</el-table-column>
<el-table-column label="操作" width="280px" align="center">
<template v-slot:default="scope">
+15 -17
View File
@@ -6,24 +6,22 @@
创建活动
</el-button>
<el-form :inline="true" :model="formSearch" class="mt10">
<el-form-item label="活动名称">
<el-input
v-model="searchName"
style="max-width: 300px"
placeholder="模糊查询活动名称"
class="input-with-select"
onchange="searchEvnt"
>
<!-- <el-form :inline="true" :model="formSearch" class="mt10">-->
<!-- <el-form-item label="活动名称">-->
<!-- <el-input-->
<!-- v-model="formSearch.name"-->
<!-- style="max-width: 300px"-->
<!-- placeholder="模糊查询活动名称"-->
<!-- class="input-with-select"-->
<!-- >-->
<!-- </el-input>-->
<!-- </el-form-item>-->
</el-input>
</el-form-item>
<!-- <el-form-item>-->
<!-- <el-button type="primary" @click="onSearchSubmit">搜索</el-button>-->
<!-- </el-form-item>-->
<el-form-item>
<el-button type="primary" @click="onSearchSubmit">搜索</el-button>
</el-form-item>
</el-form>
<!-- </el-form>-->
<el-drawer v-model="drawer" :direction="direction" :close-on-click-modal="false" :close-on-press-escape="false" :destroy-on-close="true" :show-close="false">
<template #header>
@@ -201,7 +199,7 @@ const initData = () => {
getConfigList(queryData.value).then((res) => {
if(res.data[1].content !== '[]' && res.data[1].content !== null)
if(res.data[1].content !== '[]' && res.data[1].content !== null && res.data[0].content !== "")
{
tableData.value = JSON.parse(res.data[1].content);
// 找出最ID
+1 -1
View File
@@ -129,7 +129,7 @@ const initData = () => {
getConfigList(queryData.value).then((res) => {
if(res.data[0].content !== '[]' && res.data[0].content !== null)
if(res.data[0].content !== '[]' && res.data[0].content !== null && res.data[0].content !== "")
{
tableData.value = JSON.parse(res.data[0].content);
// 找出最大序号
+77
View File
@@ -0,0 +1,77 @@
<template>
<el-card class="mt10" v-loading="loading">
<span>
重复下单开关
</span>
<el-divider />
<el-switch
size="large"
v-model="formData.content"
inline-prompt
active-text="开启"
inactive-text="关闭"
@click="upStatus(formData.content)"
/>
</el-card>
</template>
<script setup>
import {nextTick, onMounted, reactive, ref} from 'vue'
import {ElMessage} from "element-plus";
import {getConfigList, updateSystem} from "../../api/modules/system";
const loading = ref(true)
const formData = ref({
id:4,
content: true,
});
// 初始化数据
const initData = () => {
getConfigList().then((res) => {
loading.value = false;
if(res.data[3].content !== '[]' && res.data[3].content !== null && res.data[3].content !== "")
{
formData.value.content = JSON.parse(res.data[3].content);
}
})
}
// 更新状态
const upStatus = (param) => {
loading.value = true;
formData.value.content = param;
let params = {
id: 4,
content: JSON.stringify(param)
};
// 更新系统配置
updateSystem(params).then((res) => {
loading.value = false;
initData();
ElMessage({
message: '修改成功',
type: 'success',
})
});
}
onMounted(() => {
initData()
})
</script>
<style lang="scss" scoped>
</style>
+71 -40
View File
@@ -1,29 +1,29 @@
<template>
<el-card class="mt10">
<el-form :inline="true" :model="queryData" class="mt20">
<el-form :inline="true" :model="formSearch" class="mt20">
<el-form-item label="注册时间">
<el-date-picker
v-model="registerDate"
v-model="formSearch.date"
type="daterange"
range-separator=""
start-placeholder="注册开始日期"
end-placeholder="注册截至日期"
@clear="clearDate"
/>
</el-form-item>
<el-form-item label="微信昵称">
<el-input
v-model="searchName"
v-model="formSearch.name"
style="max-width: 300px"
placeholder="模糊查询微信昵称"
class="input-with-select"
onchange="searchEvnt"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleCurrentChange">查询</el-button>
<el-button type="primary" @click="onSearchSubmit">查询</el-button>
</el-form-item>
</el-form>
@@ -52,6 +52,23 @@
<el-avatar :size="50" :src="scope.row.avatar" />
</template>
</el-table-column>
<el-table-column
label="关注公众号"
width="300"
align="center"
show-overflow-tooltip
>
<template #default="scope">
<template v-if="scope.row.ampOpenid">
<el-tag type="success">已关注</el-tag>
</template>
<template v-else>
<el-tag type="info">未关注</el-tag>
</template>
</template>
</el-table-column>
<el-table-column
label="微信昵称"
prop="nickName"
@@ -80,64 +97,78 @@
</el-card>
</template>
<script setup>
import * as XLSX from 'xlsx'
import {
Edit,
Delete,
InfoFilled,
View,
ArrowDownBold,
Plus,
} from '@element-plus/icons-vue'
import {nextTick, onMounted, reactive, ref} from 'vue'
import {options} from './options.js'
import {getUserList} from "../../api/modules/user";
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 disabled = ref(false)
const dialogVisible = ref(false)
const total = ref(0)
const formInline = ref({})
const registerDate = ref('');
const searchName = ref('');
const queryData = ref({
keyWord: '',
const roleld = ref(1);
const formSearch = ref({
name: '',
page: 1,
size: 10,
current: 1,
date: ''
})
const initData = () => {
queryData.value.roleld = 1;
// 获取用户列表
getUserList(queryData.value).then((res) => {
getUserList(roleld.value, formSearch.value).then((res) => {
tableData.value = res.data.records;
total.value = res.data.total
});
}
const handleSizeChange = (val) => {
console.log(val)
}
const handleSelectionChange = (val) => {
}
const handleCurrentChange = (val) => {
queryData.value.size = 10
queryData.value.page = val
initData(queryData.value)
formSearch.value.size = 10
formSearch.value.page = val
initData(formSearch.value)
}
// 日期格式化
const formatDate = (date) => {
if (typeof date === 'string') {
// 检查是否已经是格式化的字符串
const regex = /^\d{4}-\d{2}-\d{2}$/;
if (regex.test(date)) {
return date; // 已经是格式化的字符串,直接返回
}
}
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
// 清空日期
const clearDate = () => {
formSearch.value.date = ''
}
// 搜索事件
const searchEvnt = ()=> {
console.log('点击搜索');
const onSearchSubmit = ()=> {
let params = {...formSearch.value}
if(params.date !== '')
{
params.startDate = formatDate(params.date[0]);
params.endDate = formatDate(params.date[1]);
}
delete params.date;
getUserList(roleld.value, params).then((res) => {
tableData.value = res.data.records
total.value = res.data.total
})
};
onMounted(() => {
+110 -19
View File
@@ -1,29 +1,29 @@
<template>
<el-card class="mt10">
<el-form :inline="true" :model="queryData" class="mt20">
<el-form :inline="true" :model="formSearch" class="mt20">
<el-form-item label="注册时间">
<el-date-picker
v-model="registerDate"
v-model="formSearch.date"
type="daterange"
range-separator=""
start-placeholder="注册开始日期"
end-placeholder="注册截至日期"
@clear="clearDate"
/>
</el-form-item>
<el-form-item label="微信昵称">
<el-form-item label="姓名">
<el-input
v-model="searchName"
v-model="formSearch.name"
style="max-width: 300px"
placeholder="模糊查询微信昵称"
placeholder="模糊查询姓名"
class="input-with-select"
onchange="searchEvnt"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleCurrentChange">查询</el-button>
<el-button type="primary" @click="onSearchSubmit">查询</el-button>
</el-form-item>
</el-form>
@@ -67,6 +67,21 @@
align="center"
show-overflow-tooltip
/>
<el-table-column
label="关注公众号"
width="300"
align="center"
show-overflow-tooltip
>
<template #default="scope">
<template v-if="scope.row.ampOpenid">
<el-tag type="success">已关注</el-tag>
</template>
<template v-else>
<el-tag type="info">未关注</el-tag>
</template>
</template>
</el-table-column>
<el-table-column
label="注册时间"
prop="createTime"
@@ -76,6 +91,25 @@
sortable
/>
<el-table-column
label="操作"
align="center"
>
<template #default="scope">
<el-popconfirm
confirm-button-text="确认"
cancel-button-text="取消"
:icon="InfoFilled"
icon-color="#626AEF"
title="确定要删除该维修人员吗?"
@confirm="deleteItem(scope.row)"
>
<template #reference>
<el-button type="danger">删除</el-button>
</template>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
<el-pagination
size="small"
@@ -100,7 +134,9 @@ import {
import {nextTick, onMounted, reactive, ref} from 'vue'
import {options} from './options.js'
import {getUserList} from "../../api/modules/user";
import {deleteUser, getUserList} from "../../api/modules/user";
import {delGoods} from "../../api/modules/goods";
import {ElMessage} from "element-plus";
const tableData = ref([])
const dataList = ref([])
@@ -114,19 +150,19 @@ const total = ref(0)
const formInline = ref({})
const registerDate = ref('');
const searchName = ref('');
const queryData = ref({
keyWord: '',
const roleld = ref(3);
const formSearch = ref({
name: '',
page: 1,
size: 10,
current: 1,
date: ''
})
const initData = () => {
queryData.value.roleld = 3;
// 获取维修工程师列表
getUserList(queryData.value).then((res) => {
getUserList(roleld.value, formSearch.value).then((res) => {
tableData.value = res.data.records;
total.value = res.data.total
});
@@ -134,14 +170,69 @@ const initData = () => {
}
const handleCurrentChange = (val) => {
queryData.value.size = 10
queryData.value.page = val
initData(queryData.value)
formSearch.value.size = 10
formSearch.value.page = val
initData(formSearch.value)
}
// 删除项
const deleteItem = (env) => {
let ItemId = env.id; // 项目ID
// 删除
deleteUser(ItemId).then((res) =>{
ElMessage({
message: '删除成功',
type: 'success',
});
initData(); // 重新加载数据
});
}
// 日期格式化
const formatDate = (date) => {
if (typeof date === 'string') {
// 检查是否已经是格式化的字符串
const regex = /^\d{4}-\d{2}-\d{2}$/;
if (regex.test(date)) {
return date; // 已经是格式化的字符串,直接返回
}
}
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
// 清空日期
const clearDate = () => {
formSearch.value.date = ''
}
// 搜索事件
const searchEvnt = ()=> {
console.log('点击搜索');
const onSearchSubmit = ()=> {
let params = {...formSearch.value}
if(params.date !== '')
{
params.startDate = formatDate(params.date[0]);
params.endDate = formatDate(params.date[1]);
}
delete params.date;
getUserList(roleld.value, params).then((res) => {
tableData.value = res.data.records
total.value = res.data.total
})
};
onMounted(() => {
+114 -38
View File
@@ -1,39 +1,29 @@
<template>
<el-card class="mt10">
<el-form :inline="true" :model="queryData" class="mt20">
<el-form :inline="true" :model="formSearch" class="mt20">
<el-form-item label="注册时间">
<el-date-picker
v-model="registerDate"
v-model="formSearch.date"
type="daterange"
range-separator=""
start-placeholder="注册开始日期"
end-placeholder="注册截至日期"
@clear="clearDate"
/>
</el-form-item>
<el-form-item label="微信昵称">
<el-form-item label="姓名">
<el-input
v-model="searchName"
v-model="formSearch.name"
style="max-width: 300px"
placeholder="模糊查询微信昵称"
placeholder="模糊查询姓名"
class="input-with-select"
onchange="searchEvnt"
/>
</el-form-item>
<el-form-item label="微信昵称">
<el-input
v-model="searchName"
style="max-width: 300px"
placeholder="模糊查询微信昵称"
class="input-with-select"
onchange="searchEvnt"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleCurrentChange">查询</el-button>
<el-button type="primary" @click="onSearchSubmit">查询</el-button>
</el-form-item>
</el-form>
@@ -78,6 +68,23 @@
align="center"
show-overflow-tooltip
/>
<el-table-column
label="关注公众号"
width="300"
align="center"
show-overflow-tooltip
>
<template #default="scope">
<template v-if="scope.row.ampOpenid">
<el-tag type="success">已关注</el-tag>
</template>
<template v-else>
<el-tag type="info">未关注</el-tag>
</template>
</template>
</el-table-column>
<el-table-column
label="注册时间"
prop="createTime"
@@ -87,6 +94,26 @@
sortable
/>
<el-table-column
label="操作"
align="center"
>
<template #default="scope">
<el-popconfirm
confirm-button-text="确认"
cancel-button-text="取消"
:icon="InfoFilled"
icon-color="#626AEF"
title="确定要删除该勘测人员吗?"
@confirm="deleteItem(scope.row)"
>
<template #reference>
<el-button type="danger">删除</el-button>
</template>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
<el-pagination
size="small"
@@ -99,7 +126,6 @@
</el-card>
</template>
<script setup>
import * as XLSX from 'xlsx'
import {
Edit,
Delete,
@@ -111,32 +137,27 @@ import {
import {nextTick, onMounted, reactive, ref} from 'vue'
import {options} from './options.js'
import {getUserList} from "../../api/modules/user";
import {deleteUser, getUserList} from "../../api/modules/user";
import {ElMessage} from "element-plus";
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 disabled = ref(false)
const dialogVisible = ref(false)
const total = ref(0)
const formInline = ref({})
const registerDate = ref('');
const searchName = ref('');
const queryData = ref({
keyWord: '',
const roleld = ref(2);
const formSearch = ref({
name: '',
page: 1,
size: 10,
current: 1,
date: ''
})
const initData = () => {
queryData.value.roleld = 2;
// 获取勘察工程师列表
getUserList(queryData.value).then((res) => {
// 获取勘测工程师列表
getUserList(roleld.value, formSearch.value).then((res) => {
tableData.value = res.data.records;
total.value = res.data.total
@@ -144,14 +165,69 @@ const initData = () => {
}
const handleCurrentChange = (val) => {
queryData.value.size = 10
queryData.value.page = val
initData(queryData.value)
formSearch.value.size = 10
formSearch.value.page = val
initData(formSearch.value)
}
// 删除项
const deleteItem = (env) => {
let ItemId = env.id; // 项目ID
// 删除
deleteUser(ItemId).then((res) =>{
ElMessage({
message: '删除成功',
type: 'success',
});
initData(); // 重新加载数据
});
}
// 日期格式化
const formatDate = (date) => {
if (typeof date === 'string') {
// 检查是否已经是格式化的字符串
const regex = /^\d{4}-\d{2}-\d{2}$/;
if (regex.test(date)) {
return date; // 已经是格式化的字符串,直接返回
}
}
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
// 清空日期
const clearDate = () => {
formSearch.value.date = ''
}
// 搜索事件
const searchEvnt = ()=> {
console.log('点击搜索');
const onSearchSubmit = ()=> {
let params = {...formSearch.value}
if(params.date !== '')
{
params.startDate = formatDate(params.date[0]);
params.endDate = formatDate(params.date[1]);
}
delete params.date;
getUserList(roleld.value,params).then((res) => {
tableData.value = res.data.records
total.value = res.data.total
})
};
onMounted(() => {
+4246
View File
File diff suppressed because it is too large Load Diff