Compare commits

7 Commits
20 changed files with 833 additions and 537 deletions
+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 `http://repair.cpolar.top/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}`,
});
}
+3 -1
View File
@@ -9,7 +9,9 @@ const errorCode = {
default: "系统未知错误,请反馈给管理员",
};
const url = "https://repair.cpolar.top"; // "https://hazard.cpolar.top";
// const url = "https://repair.cpolar.top"; // 开发地址
const url = "https://api.cqcxj.cn"; // 正式地址
// const url = "https://cqjql.scdswj.cn:9443"; // 临时地址n
const service = axios.create({
baseURL: url,
+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>
+2 -2
View File
@@ -49,7 +49,7 @@ export const menuListItem = [
icon: "Menu",
},
{
title: "勘人员",
title: "勘人员",
url: "/reconnaissanceList",
icon: "Menu",
},
@@ -88,7 +88,7 @@ export const menuListItem = [
icon: "Menu",
},
{
title: "勘工程师",
title: "勘工程师",
url: "/reconnaissanceScheduling",
icon: "Menu",
},
+2 -2
View File
@@ -139,7 +139,7 @@ const routerList = [
component: () => import("../views/users/reconnaissance.vue"),
meta: {
requiresAuth: true,
name: "勘工程师",
name: "勘工程师",
},
},
{
@@ -206,7 +206,7 @@ const routerList = [
component: () => import("../views/scheduling/reconnaissance.vue"),
meta: {
requiresAuth: true,
name: "勘人员排班",
name: "勘人员排班",
},
},
{
+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>
+354 -72
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,8 +23,10 @@
<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-select>
</el-form-item>
@@ -37,9 +39,68 @@
/>
</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="searchName"
v-model="formSearch.username"
style="max-width: 300px"
placeholder="用户昵称"
class="input-with-select"
/>
</el-form-item>
<el-form-item label="勘测工程师姓名">
<el-input
v-model="formSearch.surveyorsName"
style="max-width: 300px"
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"
@@ -50,6 +111,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
@@ -112,6 +177,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,7 +214,12 @@
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>
@@ -226,7 +325,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 +409,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 +421,23 @@ 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: '',
date: '',
month: '',
year: '',
day: '',
page: 1,
size: 10,
current: 1,
})
const formSearch = ref({
goodsName:'',
status: ' ',
id: '',
amount: ''
});
const detailData = ref();
const isStatus = ref('');
@@ -335,7 +445,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 +469,242 @@ 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);
}
if(params.date !== '')
{
let {
year,
month,
day
} = {...formatDate(params.date)};
params.year = year;
params.month = month;
params.day = day;
}
return exportOrder(params);
}
// 搜索事件
const onSearchSubmit = ()=> {
let params = {...formSearch.value}
if(params.status !== ' ')
{
params.status = parseInt(params.status, 10);
}
if(params.year !== '')
{
let {
year
} = {...formatDate(params.year)};
params.year = year;
}
if(params.month !== '')
{
let {
month
} = {...formatDate(params.month)};
params.month = month;
}
if(params.day !== '')
{
let {
year,
month,
day
} = {...formatDate(params.day)};
params.year = year;
params.month = month;
params.day = 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
+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);
// 找出最大序号
+54 -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>
@@ -80,64 +80,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(() => {
+95 -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>
@@ -76,6 +76,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 +119,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 +135,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 +155,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(() => {
+97 -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>
@@ -87,6 +77,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 +109,6 @@
</el-card>
</template>
<script setup>
import * as XLSX from 'xlsx'
import {
Edit,
Delete,
@@ -111,32 +120,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 +148,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(() => {