信息中心前端部分迁移
This commit is contained in:
51
gear-ui3/src/api/oa/express.js
Normal file
51
gear-ui3/src/api/oa/express.js
Normal file
@@ -0,0 +1,51 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询物流预览列表
|
||||
export function listExpress(query) {
|
||||
return request({
|
||||
url: '/oa/express/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询物流预览详细
|
||||
export function getExpress(expressId) {
|
||||
return request({
|
||||
url: '/oa/express/' + expressId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 查询物流预览详细
|
||||
export function refreshExpress(expressId) {
|
||||
return request({
|
||||
url: '/oa/express/refresh/' + expressId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增物流预览
|
||||
export function addExpress(data) {
|
||||
return request({
|
||||
url: '/oa/express',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改物流预览
|
||||
export function updateExpress(data) {
|
||||
return request({
|
||||
url: '/oa/express',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除物流预览
|
||||
export function delExpress(expressId) {
|
||||
return request({
|
||||
url: '/oa/express/' + expressId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
44
gear-ui3/src/api/oa/expressQuestion.js
Normal file
44
gear-ui3/src/api/oa/expressQuestion.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询快递问题列表
|
||||
export function listExpressQuestion(query) {
|
||||
return request({
|
||||
url: '/oa/expressQuestion/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询快递问题详细
|
||||
export function getExpressQuestion(questionId) {
|
||||
return request({
|
||||
url: '/oa/expressQuestion/' + questionId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增快递问题
|
||||
export function addExpressQuestion(data) {
|
||||
return request({
|
||||
url: '/oa/expressQuestion',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改快递问题
|
||||
export function updateExpressQuestion(data) {
|
||||
return request({
|
||||
url: '/oa/expressQuestion',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除快递问题
|
||||
export function delExpressQuestion(questionId) {
|
||||
return request({
|
||||
url: '/oa/expressQuestion/' + questionId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
61
gear-ui3/src/api/oa/feedback.js
Normal file
61
gear-ui3/src/api/oa/feedback.js
Normal file
@@ -0,0 +1,61 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询问题反馈列表
|
||||
export function listFeedback(query) {
|
||||
return request({
|
||||
url: '/oa/feedback/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 查询问题反馈列表
|
||||
export function indexListFeedback(query) {
|
||||
return request({
|
||||
url: '/oa/feedback/index-list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询问题反馈详细
|
||||
export function getFeedback(feedbackId) {
|
||||
return request({
|
||||
url: '/oa/feedback/' + feedbackId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增问题反馈
|
||||
export function addFeedback(data) {
|
||||
return request({
|
||||
url: '/oa/feedback',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改问题反馈
|
||||
export function updateFeedback(data) {
|
||||
return request({
|
||||
url: '/oa/feedback',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改问题反馈
|
||||
export function toRead(data) {
|
||||
return request({
|
||||
url: '/oa/feedback/toRead',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除问题反馈
|
||||
export function delFeedback(feedbackId) {
|
||||
return request({
|
||||
url: '/oa/feedback/remove/' + feedbackId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
93
gear-ui3/src/api/oa/reportDetail.js
Normal file
93
gear-ui3/src/api/oa/reportDetail.js
Normal file
@@ -0,0 +1,93 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询设计项目汇报详情列表
|
||||
export async function listReportDetail(query) {
|
||||
// return {
|
||||
// rows: [
|
||||
// {
|
||||
// reportDetailId: 1,
|
||||
// deviceCode: 1,
|
||||
// category: '设备类型2',
|
||||
// deviceDescription: '设备生产说明',
|
||||
// reportDetail: '汇报详情',
|
||||
// ossIds: '1,2',
|
||||
// images: 'https://api.mtyqx.cn/api/random.php,https://api.mtyqx.cn/xjjapi/random.php'
|
||||
// },
|
||||
// {
|
||||
// reportDetailId: 2,
|
||||
// deviceCode: 1,
|
||||
// category: '设备类型3',
|
||||
// deviceDescription: '设备生产说明',
|
||||
// reportDetail: '汇报详情',
|
||||
// images: 'https://api.mtyqx.cn/api/random.php,https://api.mtyqx.cn/xjjapi/random.php',
|
||||
// ossIds: 'https://api.mtyqx.cn/api/random.php,https://api.mtyqx.cn/xjjapi/random.php'
|
||||
// },
|
||||
// {
|
||||
// reportDetailId: 3,
|
||||
// deviceCode: 1,
|
||||
// category: '设备类型4',
|
||||
// deviceDescription: '设备生产说明',
|
||||
// reportDetail: '汇报详情',
|
||||
// images: 'https://api.mtyqx.cn/api/random.php,https://api.mtyqx.cn/xjjapi/random.php',
|
||||
// ossIds: 'https://api.mtyqx.cn/api/random.php,https://api.mtyqx.cn/xjjapi/random.php'
|
||||
// },
|
||||
// {
|
||||
// reportDetailId: 4,
|
||||
// deviceCode: 1,
|
||||
// category: '设备类型5',
|
||||
// deviceDescription: '设备生产说明',
|
||||
// reportDetail: '汇报详情',
|
||||
// images: 'https://api.mtyqx.cn/api/random.php,https://api.mtyqx.cn/xjjapi/random.php',
|
||||
// ossIds: 'https://api.mtyqx.cn/api/random.php,https://api.mtyqx.cn/xjjapi/random.php'
|
||||
// },
|
||||
// ],
|
||||
// total: 1
|
||||
// }
|
||||
return request({
|
||||
url: '/system/reportDetail/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询设计项目汇报详情详细
|
||||
export function getReportDetail(id) {
|
||||
return request({
|
||||
url: '/system/reportDetail/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增设计项目汇报详情
|
||||
export function addReportDetail(data) {
|
||||
return request({
|
||||
url: '/system/reportDetail',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改设计项目汇报详情
|
||||
export function updateReportDetail(data) {
|
||||
return request({
|
||||
url: '/system/reportDetail',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设计项目汇报详情
|
||||
export function delReportDetail(id) {
|
||||
return request({
|
||||
url: '/system/reportDetail/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function listReportDetailByProjectId(projectId) {
|
||||
return request({
|
||||
url: '/system/reportDetail/project/' + projectId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
81
gear-ui3/src/api/oa/reportSummary.js
Normal file
81
gear-ui3/src/api/oa/reportSummary.js
Normal file
@@ -0,0 +1,81 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询设计项目汇报概述列表
|
||||
export async function listReportSummary(query) {
|
||||
// return {
|
||||
// rows: [
|
||||
// {
|
||||
// reportSummaryId: 1,
|
||||
// reportTitle: '汇报标题',
|
||||
// reportDate: '汇报日期',
|
||||
// reporter: '汇报人',
|
||||
// projectName: '设计项目',
|
||||
// projectId: '1'
|
||||
// },
|
||||
// {
|
||||
// reportSummaryId: 2,
|
||||
// reportTitle: '汇报标题',
|
||||
// reportDate: '汇报日期',
|
||||
// reporter: '汇报人',
|
||||
// projectName: '设计项目',
|
||||
// projectId: '1'
|
||||
// },
|
||||
// {
|
||||
// reportSummaryId: 3,
|
||||
// reportTitle: '汇报标题',
|
||||
// reportDate: '汇报日期',
|
||||
// reporter: '汇报人',
|
||||
// projectName: '设计项目',
|
||||
// projectId: '1'
|
||||
// },
|
||||
// {
|
||||
// reportSummaryId: 4,
|
||||
// reportTitle: '汇报标题',
|
||||
// reportDate: '汇报日期',
|
||||
// reporter: '汇报人',
|
||||
// projectName: '设计项目',
|
||||
// projectId: '1'
|
||||
// },
|
||||
// ],
|
||||
// total: 1,
|
||||
// }
|
||||
return request({
|
||||
url: '/system/reportSummary/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询设计项目汇报概述详细
|
||||
export function getReportSummary(id) {
|
||||
return request({
|
||||
url: '/system/reportSummary/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增设计项目汇报概述
|
||||
export function addReportSummary(data) {
|
||||
return request({
|
||||
url: '/system/reportSummary',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改设计项目汇报概述
|
||||
export function updateReportSummary(data) {
|
||||
return request({
|
||||
url: '/system/reportSummary',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设计项目汇报概述
|
||||
export function delReportSummary(id) {
|
||||
return request({
|
||||
url: '/system/reportSummary/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
@clear="filterIcons"
|
||||
@input="filterIcons"
|
||||
>
|
||||
<template #suffix><i class="el-icon-search el-input__icon" /></template>
|
||||
<template #suffix><i class="Search el-input__icon" /></template>
|
||||
</el-input>
|
||||
<div class="icon-list">
|
||||
<div class="list-container">
|
||||
|
||||
6
gear-ui3/src/utils/enums.js
Normal file
6
gear-ui3/src/utils/enums.js
Normal file
@@ -0,0 +1,6 @@
|
||||
export const EExpressType = {
|
||||
SF: "SF",
|
||||
ZTO: "ZTO",
|
||||
BEST: "Best",
|
||||
STO: "STO",
|
||||
}
|
||||
@@ -335,7 +335,7 @@ function buildElCheckboxGroupChild(conf) {
|
||||
|
||||
function buildElUploadChild(conf) {
|
||||
const list = []
|
||||
if (conf['list-type'] === 'picture-card') list.push('<i class="el-icon-plus"></i>')
|
||||
if (conf['list-type'] === 'picture-card') list.push('<i class="Plus"></i>')
|
||||
else list.push(`<el-button size="small" type="primary" icon="el-icon-upload">${conf.buttonText}</el-button>`)
|
||||
if (conf.showTip) list.push(`<div slot="tip" class="el-upload__tip">只能上传不超过 ${conf.fileSize}${conf.sizeUnit} 的${conf.accept}文件</div>`)
|
||||
return list.join('\n')
|
||||
|
||||
430
gear-ui3/src/views/info/construction/detail.vue
Normal file
430
gear-ui3/src/views/info/construction/detail.vue
Normal file
@@ -0,0 +1,430 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px">
|
||||
<!-- <el-form-item label="关联汇报概述ID" prop="summaryId">
|
||||
<el-input
|
||||
v-model="queryParams.summaryId"
|
||||
placeholder="请输入关联汇报概述ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="设备唯一编号" prop="deviceCode">
|
||||
<el-input
|
||||
v-model="queryParams.deviceCode"
|
||||
placeholder="请输入设备唯一编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备类别" prop="category">
|
||||
<el-autocomplete
|
||||
v-model="queryParams.category"
|
||||
:fetch-suggestions="categoryQuerySearch"
|
||||
placeholder="请输入设备类别"
|
||||
@select="handleCategorySelect"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="设备生产说明" prop="deviceDescription">
|
||||
<el-input
|
||||
v-model="queryParams.deviceDescription"
|
||||
placeholder="请输入设备生产说明"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="汇报详情内容" prop="reportDetail">
|
||||
<el-input
|
||||
v-model="queryParams.reportDetail"
|
||||
placeholder="请输入汇报详情内容"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="reportDetailList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" align="center" type="index" v-if="true"/>
|
||||
<!-- <el-table-column label="关联汇报概述ID" align="center" prop="summaryId" /> -->
|
||||
<el-table-column label="设备编号" align="center" prop="deviceCode" />
|
||||
<el-table-column label="设备类别" align="center" prop="category" />
|
||||
<!-- <el-table-column label="设备生产说明" align="center" prop="deviceDescription" /> -->
|
||||
<el-table-column label="汇报详情内容" align="center" prop="reportDetail" />
|
||||
<el-table-column label="图片概况" align="center" prop="ossIds" width="100">
|
||||
<template slot-scope="scope">
|
||||
<image-preview :src="scope.row.ossIds" :width="50" :height="50"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-view"
|
||||
@click="handleImageDetail(scope.row)"
|
||||
>图片详情</el-button>
|
||||
|
||||
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="Edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>修改</el-button>
|
||||
|
||||
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改设计项目汇报详情对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="50%" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="设备编号" prop="deviceCode">
|
||||
<el-input v-model="form.deviceCode" placeholder="请输入设备唯一编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备类别" prop="category">
|
||||
<el-autocomplete
|
||||
v-model="form.category"
|
||||
:fetch-suggestions="categoryQuerySearch"
|
||||
placeholder="请输入设备类别"
|
||||
@select="handleCategorySelectForm"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="生产说明" prop="deviceDescription">
|
||||
<el-input v-model="form.deviceDescription" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="详情内容" prop="reportDetail">
|
||||
<el-input v-model="form.reportDetail" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="图像" prop="ossIds">
|
||||
<image-upload v-model="form.ossIds"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-drawer
|
||||
title="图片列表"
|
||||
:visible.sync="imageDrawer"
|
||||
direction="rtl"
|
||||
>
|
||||
<image-preview v-for="img in srcList" :src="img" :width="150" :height="150" />
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { addReportDetail, delReportDetail, getReportDetail, listReportDetail, updateReportDetail } from "@/api/oa/reportDetail";
|
||||
|
||||
export default {
|
||||
name: "ReportDetail",
|
||||
data() {
|
||||
return {
|
||||
// 按钮loading
|
||||
buttonLoading: false,
|
||||
imageDrawer:false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 设计项目汇报详情表格数据
|
||||
reportDetailList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
summaryId: undefined,
|
||||
deviceCode: undefined,
|
||||
category: undefined,
|
||||
deviceDescription: '施工',
|
||||
reportDetail: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
detailId: [
|
||||
{ required: true, message: "主键ID不能为空", trigger: "blur" }
|
||||
],
|
||||
summaryId: [
|
||||
{ required: true, message: "关联汇报概述ID不能为空", trigger: "blur" }
|
||||
],
|
||||
deviceCode: [
|
||||
{ required: true, message: "设备唯一编号不能为空", trigger: "blur" }
|
||||
],
|
||||
category: [
|
||||
{ required: true, message: "设备类别不能为空", trigger: "blur" }
|
||||
],
|
||||
// deviceDescription: [
|
||||
// { required: true, message: "设备生产说明不能为空", trigger: "blur" }
|
||||
// ],
|
||||
reportDetail: [
|
||||
{ required: true, message: "汇报详情内容不能为空", trigger: "blur" }
|
||||
],
|
||||
ossIds: [
|
||||
{ required: true, message: "关联图像 OSS ID 列表不能为空", trigger: "blur" }
|
||||
],
|
||||
},
|
||||
categoryList: [], // 设备类别本地缓存
|
||||
imageList:'',
|
||||
srcList:[],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.queryParams.summaryId = this.$route.params && this.$route.params.summaryId;
|
||||
this.form.summaryId = this.$route.params && this.$route.params.summaryId;
|
||||
this.getList();
|
||||
this.initCategoryList();
|
||||
},
|
||||
|
||||
methods: {
|
||||
/** 查询设计项目汇报详情列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listReportDetail(this.queryParams).then(response => {
|
||||
this.reportDetailList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
// 更新本地类别缓存
|
||||
this.updateCategoryList(response.rows);
|
||||
});
|
||||
},
|
||||
// 初始化设备类别缓存
|
||||
initCategoryList() {
|
||||
listReportDetail({pageSize: 9999}).then(response => {
|
||||
this.updateCategoryList(response.rows);
|
||||
});
|
||||
},
|
||||
|
||||
// 从rows中提取所有category并去重
|
||||
updateCategoryList(rows) {
|
||||
const set = new Set(this.categoryList);
|
||||
rows.forEach(item => {
|
||||
if (item.category) set.add(item.category);
|
||||
});
|
||||
this.categoryList = Array.from(set);
|
||||
},
|
||||
// 自动补全方法
|
||||
categoryQuerySearch(queryString, cb) {
|
||||
const results = queryString
|
||||
? this.categoryList
|
||||
.filter(cat => cat && cat.toLowerCase().includes(queryString.toLowerCase()))
|
||||
.map(cat => ({value: cat}))
|
||||
: this.categoryList.map(cat => ({value: cat}));
|
||||
cb(results);
|
||||
},
|
||||
// 搜索表单选择
|
||||
handleCategorySelect(item) {
|
||||
this.queryParams.category = item.value;
|
||||
},
|
||||
// 弹窗表单选择
|
||||
handleCategorySelectForm(item) {
|
||||
this.form.category = item.value;
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
detailId: undefined,
|
||||
summaryId: this.$route.params && this.$route.params.summaryId,
|
||||
deviceCode: undefined,
|
||||
category: undefined,
|
||||
deviceDescription: '施工',
|
||||
reportDetail: undefined,
|
||||
ossIds: undefined,
|
||||
images: '',
|
||||
createBy: undefined,
|
||||
createTime: undefined,
|
||||
updateBy: undefined,
|
||||
updateTime: undefined,
|
||||
delFlag: undefined,
|
||||
remark: undefined,
|
||||
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.detailId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加施工进度汇报详情";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.loading = true;
|
||||
this.reset();
|
||||
const id = row.detailId || this.ids
|
||||
getReportDetail(id).then(response => {
|
||||
this.loading = false;
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改施工进度汇报详情";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.detailId != null) {
|
||||
updateReportDetail(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
addReportDetail(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.detailId || this.ids;
|
||||
this.$modal.confirm('是否确认删除编号为"' + ids + '"的数据项?').then(() => {
|
||||
this.loading = true;
|
||||
return delReportDetail(ids);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/reportDetail/export', {
|
||||
...this.queryParams
|
||||
}, `reportDetail_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
/** 查看图片详情 */
|
||||
handleImageDetail(row) {
|
||||
this.imageList = row.ossIds;
|
||||
this.imageDrawer = true;
|
||||
this.getImageList()
|
||||
},
|
||||
getImageList() {
|
||||
let real_src_list = this.imageList.split(",");
|
||||
let srcList = [];
|
||||
real_src_list.forEach(item => {
|
||||
return srcList.push(item);
|
||||
});
|
||||
this.srcList = srcList;
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
330
gear-ui3/src/views/info/construction/index.vue
Normal file
330
gear-ui3/src/views/info/construction/index.vue
Normal file
@@ -0,0 +1,330 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
||||
<el-form-item label="汇报标题" prop="reportTitle">
|
||||
<el-input
|
||||
v-model="queryParams.reportTitle"
|
||||
placeholder="请输入汇报标题"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="汇报日期" prop="reportDate">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.reportDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择汇报日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="汇报人" prop="reporter">
|
||||
<el-input
|
||||
v-model="queryParams.reporter"
|
||||
placeholder="请输入汇报人"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="reportSummaryList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" align="center" type="index" v-if="true"/>
|
||||
<el-table-column label="汇报标题" align="center" prop="reportTitle">
|
||||
<template slot-scope="scope">
|
||||
<router-link class="link-type" :to="'/produce/construction/detail/' + scope.row.summaryId">{{ scope.row.reportTitle }}</router-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="最近汇报时间" align="center" prop="lastUpdateTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.lastUpdateTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="汇报日期" align="center" prop="reportDate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.reportDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="汇报人" align="center" prop="reporter" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="Edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改涉及项目汇报概述对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="40%" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="汇报标题" prop="reportTitle">
|
||||
<el-input v-model="form.reportTitle" placeholder="请输入汇报标题" />
|
||||
</el-form-item>
|
||||
<el-form-item label="汇报日期" prop="reportDate">
|
||||
<el-date-picker clearable
|
||||
v-model="form.reportDate"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择汇报日期"
|
||||
style="width: 100%;">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="汇报人" prop="reporter">
|
||||
<el-input v-model="form.reporter" placeholder="请输入汇报人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { addReportSummary, delReportSummary, getReportSummary, listReportSummary, updateReportSummary } from "@/api/oa/reportSummary";
|
||||
|
||||
export default {
|
||||
name: "ReportSummary",
|
||||
data() {
|
||||
return {
|
||||
projectList: [],
|
||||
// 按钮loading
|
||||
buttonLoading: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 涉及项目汇报概述表格数据
|
||||
reportSummaryList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
reportTitle: undefined,
|
||||
reportDate: undefined,
|
||||
reporter: undefined,
|
||||
projectId: undefined,
|
||||
type: 1
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
summaryId: [
|
||||
{ required: true, message: "主键ID不能为空", trigger: "blur" }
|
||||
],
|
||||
reportTitle: [
|
||||
{ required: true, message: "汇报标题不能为空", trigger: "blur" }
|
||||
],
|
||||
reportDate: [
|
||||
{ required: true, message: "汇报日期不能为空", trigger: "blur" }
|
||||
],
|
||||
reporter: [
|
||||
{ required: true, message: "汇报人不能为空", trigger: "blur" }
|
||||
],
|
||||
projectId: [
|
||||
{ required: true, message: "涉及项目不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询涉及项目汇报概述列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listReportSummary(this.queryParams).then(response => {
|
||||
this.reportSummaryList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
sum: undefined,
|
||||
reportTitle: undefined,
|
||||
reportDate: undefined,
|
||||
reporter: undefined,
|
||||
projectId: undefined,
|
||||
createBy: undefined,
|
||||
createTime: undefined,
|
||||
updateBy: undefined,
|
||||
updateTime: undefined,
|
||||
delFlag: undefined,
|
||||
remark: undefined,
|
||||
type: 1
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.summaryId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加涉及项目汇报概述";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.loading = true;
|
||||
this.reset();
|
||||
const summaryId = row.summaryId || this.ids
|
||||
getReportSummary(summaryId).then(response => {
|
||||
this.loading = false;
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改涉及项目汇报概述";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.summaryId != null) {
|
||||
updateReportSummary(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
addReportSummary(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.summaryId || this.ids;
|
||||
this.$modal.confirm('是否确认删除涉及项目汇报概述编号为"' + ids + '"的数据项?').then(() => {
|
||||
this.loading = true;
|
||||
return delReportSummary(ids);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/reportSummary/export', {
|
||||
...this.queryParams
|
||||
}, `reportSummary_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<span>
|
||||
<el-tag v-if="status === 2" type="success">已完成</el-tag>
|
||||
<el-tag v-else-if="status === 3" type="danger">异常</el-tag>
|
||||
<template v-else>
|
||||
<el-tag v-if="isTimeout" type="danger">超时</el-tag>
|
||||
<el-tag v-else type="info">剩余{{ remainDays }}天</el-tag>
|
||||
</template>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'ExpressRemainTime',
|
||||
props: {
|
||||
planDate: {
|
||||
type: [String, Date],
|
||||
required: false
|
||||
},
|
||||
status: {
|
||||
type: Number,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
remainDays() {
|
||||
if (!this.planDate) return '-';
|
||||
const now = new Date();
|
||||
const plan = new Date(this.planDate);
|
||||
const diff = plan.getTime() - now.getTime();
|
||||
return Math.ceil(diff / (1000 * 60 * 60 * 24));
|
||||
},
|
||||
isTimeout() {
|
||||
if (!this.planDate) return false;
|
||||
const now = new Date();
|
||||
const plan = new Date(this.planDate);
|
||||
return now.getTime() > plan.getTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,95 @@
|
||||
<template>
|
||||
<div>
|
||||
<span v-if="!isCustomExpress" style="color: #606266;">
|
||||
<span>{{ lastUpdateTime || '-' }}</span>
|
||||
<el-tooltip v-if="lastStatus" :content="lastStatus" placement="top">
|
||||
<span class="ellipsis" style="max-width: 200px; display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; font-size: 13px;">
|
||||
{{ lastStatus }}
|
||||
</span>
|
||||
</el-tooltip>
|
||||
<span v-else style="font-size: 13px;">未发货或无法获取</span>
|
||||
</span>
|
||||
<span v-else>
|
||||
<span @click="openDialog" style="cursor:pointer;color:#409EFF;text-decoration:underline;">
|
||||
{{ lastUpdateTime || '点击填写' }}
|
||||
</span>
|
||||
<span @click="openDialog" style="cursor:pointer;color:#409EFF;text-decoration:underline;">
|
||||
{{ lastStatus || '点击填写' }}
|
||||
</span>
|
||||
</span>
|
||||
<el-dialog title="手动填写物流状态" :visible.sync="dialogVisible" width="400px" append-to-body>
|
||||
<el-form :model="form" label-width="100px">
|
||||
<el-form-item label="物流状态">
|
||||
<el-input v-model="form.lastStatus" placeholder="请输入物流状态" />
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间">
|
||||
<el-date-picker v-model="form.lastUpdateTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择更新时间" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="handleSave">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { EExpressType } from '@/utils/enums';
|
||||
export default {
|
||||
name: 'ExpressStatusEditor',
|
||||
props: {
|
||||
lastStatus: String,
|
||||
lastUpdateTime: String,
|
||||
expressType: String
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
form: {
|
||||
lastStatus: '',
|
||||
lastUpdateTime: ''
|
||||
},
|
||||
EExpressType
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isCustomExpress() {
|
||||
console.log(this.EExpressType);
|
||||
if (!this.EExpressType || typeof this.EExpressType !== 'object') {
|
||||
return true;
|
||||
}
|
||||
const expressTypeList = Object.values(this.EExpressType);
|
||||
return !expressTypeList.includes(this.expressType);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openDialog() {
|
||||
this.form.lastStatus = this.lastStatus || '';
|
||||
this.form.lastUpdateTime = this.lastUpdateTime || '';
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
handleSave() {
|
||||
if (!this.form.lastStatus || !this.form.lastUpdateTime) {
|
||||
this.$message.error('请填写完整物流状态和更新时间');
|
||||
return;
|
||||
}
|
||||
this.$emit('update:lastStatus', this.form.lastStatus);
|
||||
this.$emit('update:lastUpdateTime', this.form.lastUpdateTime);
|
||||
this.$emit('save', {
|
||||
lastStatus: this.form.lastStatus,
|
||||
lastUpdateTime: this.form.lastUpdateTime
|
||||
});
|
||||
this.dialogVisible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.ellipsis {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
738
gear-ui3/src/views/info/express/index.vue
Normal file
738
gear-ui3/src/views/info/express/index.vue
Normal file
@@ -0,0 +1,738 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="96px">
|
||||
<el-form-item label="物流编号" prop="expressCode">
|
||||
<el-input
|
||||
v-model="queryParams.expressCode"
|
||||
placeholder="请输入物流编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="对方姓名" prop="supplyName">
|
||||
<el-input
|
||||
v-model="queryParams.supplyName"
|
||||
placeholder="请输入对方姓名"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="对方手机" prop="supplyPhone">
|
||||
<el-input
|
||||
v-model="queryParams.supplyPhone"
|
||||
placeholder="请输入对方联系方式"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人手机号" prop="ownerPhone">
|
||||
<el-input
|
||||
v-model="queryParams.ownerPhone"
|
||||
placeholder="请输入负责人手机号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划到货时间" prop="planDate">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.planDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择计划到货时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="物流公司" prop="expressType">
|
||||
<el-select v-model="queryParams.expressType" placeholder="请选择物流公司标识" clearable>
|
||||
<el-option
|
||||
v-for="dict in oa_express_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
|
||||
<el-button
|
||||
type="waning"
|
||||
plain
|
||||
size="mini"
|
||||
icon="Refresh"
|
||||
@click="handleRefresh"
|
||||
>批量更新状态
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>修改
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="expressList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column label="物流编号" align="center" prop="expressCode"/>
|
||||
<el-table-column label="数据状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status===0" type="warning">未确认</el-tag>
|
||||
<el-tag v-if="scope.row.status===1" type="primary">进行中</el-tag>
|
||||
<el-tag v-if="scope.row.status===2" type="success">已完成</el-tag>
|
||||
<el-tag v-if="scope.row.status===3" type="danger">异常</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物流状态" align="center" prop="status" width="200">
|
||||
<template slot-scope="scope">
|
||||
<ExpressStatusEditor
|
||||
:lastStatus.sync="scope.row.lastStatus"
|
||||
:lastUpdateTime.sync="scope.row.lastUpdateTime"
|
||||
:expressType="scope.row.expressType"
|
||||
@save="val => handleStatusSave(scope.row, val)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="剩余时间" align="center" width="120">
|
||||
<template slot-scope="scope">
|
||||
<ExpressRemainTime :planDate="scope.row.planDate" :status="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="对方姓名" align="center" prop="supplyName"/>
|
||||
<el-table-column label="负责人" align="center" prop="ownerName"/>
|
||||
<el-table-column label="负责人手机" align="center" prop="ownerPhone"/>
|
||||
<el-table-column label="计划到货时间" align="center" prop="planDate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{parseTime(scope.row.planDate,'{y}-{m}-{d}')}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新时间" align="center" prop="planDate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.updateTime}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物流公司标识" align="center" prop="expressType">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="oa_express_type" :value="scope.row.expressType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="Check"
|
||||
v-if="scope.row.status===0"
|
||||
@click="handleUpdateStatus(scope.row,1)"
|
||||
>确认
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="Check"
|
||||
v-if="scope.row.status===1"
|
||||
@click="handleUpdateStatus(scope.row,2)"
|
||||
>完成
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="Refresh"
|
||||
v-if="scope.row.status===1"
|
||||
@click="handleRefresh(scope.row)"
|
||||
>同步物流状态
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="Close"
|
||||
v-if="scope.row.status!==2 && scope.row.status!==3"
|
||||
@click="handleUpdateStatus(scope.row,3)"
|
||||
>异常
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="Edit"
|
||||
@click="handleDetail(scope.row)"
|
||||
>详情
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="Edit"
|
||||
v-if="scope.row.status!==2"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改物流预览对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="物流编号" prop="expressCode">
|
||||
<el-input v-model="form.expressCode" placeholder="请输入物流编号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="对方姓名" prop="supplyName">
|
||||
<el-input v-model="form.supplyName" placeholder="请输入发货方姓名"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="对方联系方式" prop="supplyPhone">
|
||||
<el-input v-model="form.supplyPhone" placeholder="请输入发货方联系方式"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="负责人" prop="ownerId">
|
||||
<user-select v-model="form.ownerId"></user-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人手机号" prop="ownerPhone">
|
||||
<el-input v-model="form.ownerPhone" placeholder="请输入负责人手机号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划到货时间" prop="planDate">
|
||||
<el-date-picker clearable
|
||||
v-model="form.planDate"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择计划到货时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="物流公司标识" prop="expressType">
|
||||
<el-select v-model="form.expressType" placeholder="请选择物流公司标识">
|
||||
<el-option
|
||||
v-for="dict in oa_express_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="发货记录" prop="detailId">
|
||||
<el-select v-model="form.detailId" placeholder="请选择发货记录">
|
||||
<el-option
|
||||
v-for="item in reportDetailList"
|
||||
:key="item.detailId"
|
||||
:label="item.reportDetail"
|
||||
:value="item.detailId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 物流详情弹窗 -->
|
||||
<el-dialog
|
||||
title="物流详情"
|
||||
:visible.sync="detailOpen"
|
||||
width="600px"
|
||||
append-to-body
|
||||
>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="物流编号">{{ expressDetail.expressCode || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="数据状态">
|
||||
<el-tag v-if="expressDetail.status===0" type="warning">未确认</el-tag>
|
||||
<el-tag v-else-if="expressDetail.status===1" type="primary">进行中</el-tag>
|
||||
<el-tag v-else-if="expressDetail.status===2" type="success">已完成</el-tag>
|
||||
<el-tag v-else-if="expressDetail.status===3" type="error">异常</el-tag>
|
||||
<span v-else>-</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="对方姓名">{{ expressDetail.supplyName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="对方手机号">{{ expressDetail.supplyPhone || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="负责人">{{ expressDetail.ownerName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="负责人手机">{{ expressDetail.ownerPhone || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="细节描述">{{ expressDetail.detailName || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="当前物流状态">{{ expressDetail.lastStatus || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="物流更新时间">{{ expressDetail.lastUpdateTime || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="计划到货时间">{{ expressDetail.planDate || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="更新时间">{{ expressDetail.updateTime || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="物流公司">
|
||||
<dict-tag :options="oa_express_type" :value="expressDetail.expressType"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="备注" :span="2">{{ expressDetail.remark || '-' }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="detailOpen = false">关 闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 异常登记弹窗表单 -->
|
||||
<el-dialog
|
||||
title="异常问题登记"
|
||||
:visible.sync="questionDialogVisible"
|
||||
width="500px"
|
||||
append-to-body
|
||||
>
|
||||
<el-form :model="questionForm" :rules="questionFormRules" ref="questionForm" label-width="100px">
|
||||
<el-form-item label="问题描述" prop="description">
|
||||
<el-input v-model="questionForm.description" type="textarea" placeholder="请输入问题描述"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="汇报时间" prop="reportTime">
|
||||
<el-date-picker v-model="questionForm.reportTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择汇报时间"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="questionForm.remark" type="textarea" placeholder="请输入备注"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="questionDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitQuestionForm">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 手动填写物流状态弹窗 -->
|
||||
<el-dialog title="手动填写物流状态" :visible.sync="customStatusDialogVisible" width="400px" append-to-body>
|
||||
<el-form :model="customStatusForm" label-width="100px">
|
||||
<el-form-item label="物流状态">
|
||||
<el-input v-model="customStatusForm.lastStatus" placeholder="请输入物流状态" />
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间">
|
||||
<el-date-picker v-model="customStatusForm.lastUpdateTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择更新时间" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="customStatusDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitCustomStatus">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { addExpress, delExpress, getExpress, listExpress, refreshExpress, updateExpress } from "@/api/oa/express";
|
||||
import { addExpressQuestion } from "@/api/oa/expressQuestion";
|
||||
import { listReportDetailByProjectId } from "@/api/oa/reportDetail";
|
||||
import UserSelect from "@/components/UserSelect/index.vue";
|
||||
import { EExpressType } from '@/utils/enums';
|
||||
import ExpressRemainTime from './components/ExpressRemainTime.vue';
|
||||
import ExpressStatusEditor from './components/ExpressStatusEditor.vue';
|
||||
|
||||
export default {
|
||||
name: "Express",
|
||||
components: {UserSelect, ExpressStatusEditor, ExpressRemainTime},
|
||||
dicts: ['oa_express_type'],
|
||||
data() {
|
||||
return {
|
||||
// 按钮loading
|
||||
buttonLoading: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
expressDetail:{},
|
||||
detailOpen:false,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 物流预览表格数据
|
||||
expressList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
expressCode: undefined,
|
||||
status: undefined,
|
||||
supplyName: undefined,
|
||||
supplyPhone: undefined,
|
||||
ownerId: undefined,
|
||||
ownerPhone: undefined,
|
||||
planDate: undefined,
|
||||
expressType: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
expressId: [
|
||||
{required: true, message: "主键id不能为空", trigger: "blur"}
|
||||
],
|
||||
expressCode: [
|
||||
{required: true, message: "物流编号不能为空", trigger: "blur"}
|
||||
],
|
||||
status: [
|
||||
{required: true, message: "数据状态0未确认1进行中2已完成不能为空", trigger: "change"}
|
||||
],
|
||||
supplyName: [
|
||||
{required: true, message: "供应商姓名不能为空", trigger: "blur"}
|
||||
],
|
||||
supplyPhone: [
|
||||
{required: true, message: "供应商联系方式不能为空", trigger: "blur"}
|
||||
],
|
||||
ownerId: [
|
||||
{required: true, message: "负责人id不能为空", trigger: "blur"}
|
||||
],
|
||||
ownerPhone: [
|
||||
{required: true, message: "负责人手机号不能为空", trigger: "blur"}
|
||||
],
|
||||
planDate: [
|
||||
{required: true, message: "计划到货时间不能为空", trigger: "blur"}
|
||||
],
|
||||
expressType: [
|
||||
{required: true, message: "物流公司标识不能为空", trigger: "change"}
|
||||
],
|
||||
remark: [
|
||||
{required: true, message: "备注不能为空", trigger: "blur"}
|
||||
]
|
||||
},
|
||||
allProject:[],
|
||||
reportDetailList:[],
|
||||
// 异常登记弹窗
|
||||
questionDialogVisible: false,
|
||||
// 异常登记表单
|
||||
questionForm: {
|
||||
expressId: null,
|
||||
description: '',
|
||||
reportTime: '',
|
||||
status: 0,
|
||||
remark: ''
|
||||
},
|
||||
// 异常登记表单校验
|
||||
questionFormRules: {
|
||||
description: [{ required: true, message: '问题描述不能为空', trigger: 'blur' }],
|
||||
reportTime: [{ required: true, message: '汇报时间不能为空', trigger: 'blur' }]
|
||||
},
|
||||
currentExceptionRow: null,
|
||||
customStatusDialogVisible: false,
|
||||
customStatusForm: {
|
||||
expressId: null,
|
||||
lastStatus: '',
|
||||
lastUpdateTime: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询物流预览列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listExpress(this.queryParams).then(response => {
|
||||
this.expressList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
||||
getReportSummary() {
|
||||
listReportDetailByProjectId(this.form.projectId).then(response => {
|
||||
this.reportDetailList = response.data;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
|
||||
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
expressId: undefined,
|
||||
expressCode: undefined,
|
||||
status: undefined,
|
||||
supplyName: undefined,
|
||||
supplyPhone: undefined,
|
||||
ownerId: undefined,
|
||||
ownerPhone: undefined,
|
||||
planDate: undefined,
|
||||
expressType: undefined,
|
||||
createBy: undefined,
|
||||
createTime: undefined,
|
||||
updateBy: undefined,
|
||||
updateTime: undefined,
|
||||
delFlag: undefined,
|
||||
remark: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.expressId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加物流预览";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.loading = true;
|
||||
this.reset();
|
||||
const expressId = row.expressId || this.ids
|
||||
getExpress(expressId).then(response => {
|
||||
this.loading = false;
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改物流预览";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.expressId != null) {
|
||||
updateExpress(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
addExpress(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
handleDetail(row){
|
||||
getExpress(row.expressId).then(response => {
|
||||
this.loading = false;
|
||||
this.expressDetail = response.data;
|
||||
this.detailOpen = true;
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// 更新状态
|
||||
handleUpdateStatus(row, status) {
|
||||
let str = ""
|
||||
if (status === 1) {
|
||||
str = "是否确认操作,此数据将变化为确认状态"
|
||||
} else if (status === 2) {
|
||||
str = "确认状态已完成?"
|
||||
} else {
|
||||
str = "此物流单是否确认发生异常?操作后数据无法恢复"
|
||||
}
|
||||
if (status === 3) {
|
||||
// 弹出异常登记表单
|
||||
this.questionForm = {
|
||||
expressId: row.expressId,
|
||||
description: '',
|
||||
reportTime: this.parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}'),
|
||||
status: 0,
|
||||
remark: ''
|
||||
};
|
||||
this.currentExceptionRow = row;
|
||||
this.questionDialogVisible = true;
|
||||
return;
|
||||
}
|
||||
this.$modal.confirm(str).then(() => {
|
||||
row.status = status
|
||||
this.loading = true;
|
||||
return updateExpress(row);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
submitQuestionForm() {
|
||||
this.$refs.questionForm.validate(valid => {
|
||||
if (!valid) return;
|
||||
// 新增 expressQuestion
|
||||
addExpressQuestion(this.questionForm).then(() => {
|
||||
// 新增成功后,更新物流单状态为异常
|
||||
const row = this.currentExceptionRow;
|
||||
row.status = 3;
|
||||
this.loading = true;
|
||||
updateExpress(row).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("异常登记成功,物流单已标记为异常");
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
this.questionDialogVisible = false;
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
// 同步物流状态
|
||||
handleRefresh(row){
|
||||
const expressIds = row.expressId || this.ids;
|
||||
if (expressIds.length < 1) {
|
||||
this.$modal.msgError("请选择要同步的物流单");
|
||||
return;
|
||||
}
|
||||
refreshExpress(expressIds).then(response => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("同步完成");
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const expressIds = row.expressId || this.ids;
|
||||
this.$modal.confirm('是否确认删除物流预览编号为"' + expressIds + '"的数据项?').then(() => {
|
||||
this.loading = true;
|
||||
return delExpress(expressIds);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('oa/express/export', {
|
||||
...this.queryParams
|
||||
}, `express_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
// 计算剩余天数
|
||||
getRemainDays(planDate) {
|
||||
if (!planDate) return '-';
|
||||
const now = new Date();
|
||||
const plan = new Date(planDate);
|
||||
const diff = plan.getTime() - now.getTime();
|
||||
return Math.ceil(diff / (1000 * 60 * 60 * 24));
|
||||
},
|
||||
// 判断是否超时
|
||||
isTimeout(planDate) {
|
||||
if (!planDate) return false;
|
||||
const now = new Date();
|
||||
const plan = new Date(planDate);
|
||||
return now.getTime() > plan.getTime();
|
||||
},
|
||||
isCustomExpress(expressType) {
|
||||
const expressTypeList = Object.values(EExpressType);
|
||||
return !expressTypeList.includes(expressType);
|
||||
},
|
||||
openCustomStatusDialog(row) {
|
||||
this.customStatusForm = {
|
||||
expressId: row.expressId,
|
||||
lastStatus: row.lastStatus || '',
|
||||
lastUpdateTime: row.lastUpdateTime || ''
|
||||
};
|
||||
this.customStatusDialogVisible = true;
|
||||
},
|
||||
submitCustomStatus() {
|
||||
if (!this.customStatusForm.lastStatus || !this.customStatusForm.lastUpdateTime) {
|
||||
this.$modal.msgError('请填写完整物流状态和更新时间');
|
||||
return;
|
||||
}
|
||||
// 更新expressList中对应项
|
||||
const row = this.expressList.find(item => item.expressId === this.customStatusForm.expressId);
|
||||
if (row) {
|
||||
row.lastStatus = this.customStatusForm.lastStatus;
|
||||
row.lastUpdateTime = this.customStatusForm.lastUpdateTime;
|
||||
// 可选:直接调用后端接口保存
|
||||
updateExpress(row).then(() => {
|
||||
this.$modal.msgSuccess('保存成功');
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
this.customStatusDialogVisible = false;
|
||||
},
|
||||
handleStatusSave(row, val) {
|
||||
row.lastStatus = val.lastStatus;
|
||||
row.lastUpdateTime = val.lastUpdateTime;
|
||||
updateExpress(row).then(() => {
|
||||
this.$modal.msgSuccess('保存成功');
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
353
gear-ui3/src/views/info/express/question.vue
Normal file
353
gear-ui3/src/views/info/express/question.vue
Normal file
@@ -0,0 +1,353 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="关联快递" prop="expressId">
|
||||
<el-input
|
||||
v-model="queryParams.expressId"
|
||||
placeholder="请输入关联快递"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="问题描述" prop="description">
|
||||
<el-input
|
||||
v-model="queryParams.description"
|
||||
placeholder="请输入问题描述"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="汇报时间" prop="reportTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.reportTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择汇报时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="汇报人" prop="reportBy">
|
||||
<el-input
|
||||
v-model="queryParams.reportBy"
|
||||
placeholder="请输入汇报人"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
@click="handleUpdateStatus"
|
||||
>修复</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="expressQuestionList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="问题编号" align="center" prop="questionId" v-if="true"/>
|
||||
<el-table-column label="快递单号" align="center" prop="expressCode" />
|
||||
<el-table-column label="问题描述" align="center" prop="description" />
|
||||
<el-table-column label="汇报时间" align="center" prop="reportTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.reportTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="汇报人" align="center" prop="reportBy" />
|
||||
<el-table-column label="是否解决" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status===0" type="danger">未解决</el-tag>
|
||||
<el-tag v-if="scope.row.status===1" type="success">完成</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="Edit"
|
||||
@click="handleUpdateStatus(scope.row,1)"
|
||||
>问题解决</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改快递问题对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="问题描述" prop="description">
|
||||
<el-input v-model="form.description" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="汇报时间" prop="reportTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.reportTime"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择汇报时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="汇报人" prop="reportBy">
|
||||
<el-input v-model="form.reportBy" placeholder="请输入汇报人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { updateExpress } from "@/api/oa/express";
|
||||
import { addExpressQuestion, delExpressQuestion, getExpressQuestion, listExpressQuestion, updateExpressQuestion } from "@/api/oa/expressQuestion";
|
||||
|
||||
export default {
|
||||
name: "ExpressQuestion",
|
||||
data() {
|
||||
return {
|
||||
// 按钮loading
|
||||
buttonLoading: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 快递问题表格数据
|
||||
expressQuestionList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
expressId: undefined,
|
||||
description: undefined,
|
||||
reportTime: undefined,
|
||||
reportBy: undefined,
|
||||
status: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
questionId: [
|
||||
{ required: true, message: "主键id不能为空", trigger: "blur" }
|
||||
],
|
||||
expressId: [
|
||||
{ required: true, message: "关联快递不能为空", trigger: "blur" }
|
||||
],
|
||||
description: [
|
||||
{ required: true, message: "问题描述不能为空", trigger: "blur" }
|
||||
],
|
||||
reportTime: [
|
||||
{ required: true, message: "汇报时间不能为空", trigger: "blur" }
|
||||
],
|
||||
reportBy: [
|
||||
{ required: true, message: "汇报人不能为空", trigger: "blur" }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "0未解决1已解决不能为空", trigger: "change" }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: "备注不能为空", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询快递问题列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listExpressQuestion(this.queryParams).then(response => {
|
||||
this.expressQuestionList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
questionId: undefined,
|
||||
expressId: undefined,
|
||||
description: undefined,
|
||||
reportTime: undefined,
|
||||
reportBy: undefined,
|
||||
status: undefined,
|
||||
createTime: undefined,
|
||||
createBy: undefined,
|
||||
updateTime: undefined,
|
||||
updateBy: undefined,
|
||||
delFlag: undefined,
|
||||
remark: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.questionId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加快递问题";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.loading = true;
|
||||
this.reset();
|
||||
const questionId = row.questionId || this.ids
|
||||
getExpressQuestion(questionId).then(response => {
|
||||
this.loading = false;
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改快递问题";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.questionId != null) {
|
||||
updateExpressQuestion(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
addExpressQuestion(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
handleUpdateStatus(row){
|
||||
row.status = 1
|
||||
updateExpressQuestion(row).then(()=>{
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
})
|
||||
let data = {
|
||||
expressId:row.expressId,
|
||||
status:1
|
||||
}
|
||||
updateExpress(data)
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const questionIds = row.questionId || this.ids;
|
||||
this.$modal.confirm('是否确认删除快递问题编号为"' + questionIds + '"的数据项?').then(() => {
|
||||
this.loading = true;
|
||||
return delExpressQuestion(questionIds);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('oa/expressQuestion/export', {
|
||||
...this.queryParams
|
||||
}, `expressQuestion_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
276
gear-ui3/src/views/info/feedback/index.vue
Normal file
276
gear-ui3/src/views/info/feedback/index.vue
Normal file
@@ -0,0 +1,276 @@
|
||||
<template>
|
||||
<div class="message-view-page">
|
||||
<el-row>
|
||||
<!-- 左侧:消息列表 -->
|
||||
<el-col :span="8" class="message-list" v-loading = "loading">
|
||||
<el-card class="list-container">
|
||||
<pagination
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<div
|
||||
v-for="(msg, index) in messageList"
|
||||
:key="msg.feedbackId"
|
||||
class="message-item"
|
||||
:class="{ 'unread': msg.state === 0 }"
|
||||
@click="handleSelectMessage(msg)"
|
||||
>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<div>
|
||||
<div class="message-title">
|
||||
<!-- 已读/未读标记,这里用一个简单的小圆点来表示,也可以根据需求改成文字或图标 -->
|
||||
<span class="state-dot"></span>
|
||||
<span>{{ msg.title }}</span>
|
||||
</div>
|
||||
<div class="message-brief">{{ msg.state === 0 ? '点击查看' : '已读' }}</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<el-button icon="Delete" @click="handleDel(msg)" circle></el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</el-card>
|
||||
</el-col>
|
||||
|
||||
<!-- 右侧:显示消息详情或空状态 -->
|
||||
<el-col :span="16" class="message-detail" v-loading="msgLoading">
|
||||
<!-- 在右上角放置一个圆形加号按钮,点击后打开对话框 -->
|
||||
<div class="add-feedback-btn">
|
||||
<el-button
|
||||
circle
|
||||
type="primary"
|
||||
icon="Plus"
|
||||
@click="dialogVisible = true"
|
||||
></el-button>
|
||||
</div>
|
||||
|
||||
<!-- 详情内容 -->
|
||||
<el-card v-if="selectedMessage" class="detail-container">
|
||||
<!-- 用 v-html 展示富文本内容 -->
|
||||
<div v-html="selectedMessage.content"></div>
|
||||
</el-card>
|
||||
<div v-else class="detail-empty">
|
||||
<el-empty description="请选择一条消息查看"></el-empty>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 对话框:新增 Feedback -->
|
||||
<el-dialog
|
||||
title="新增反馈"
|
||||
:visible.sync="dialogVisible"
|
||||
width="800px"
|
||||
@close="resetForm"
|
||||
>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
label-width="80px"
|
||||
:rules="rules"
|
||||
status-icon
|
||||
>
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input v-model="form.title"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="反馈内容">
|
||||
<editor v-model="form.content" :min-height="192"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="handleAddFeedback">提交</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {listFeedback, addFeedback, delFeedback, toRead} from "@/api/oa/feedback";
|
||||
|
||||
export default {
|
||||
name: "MessageViewPage",
|
||||
data() {
|
||||
return {
|
||||
messageList: [],
|
||||
// 当前选中的消息
|
||||
selectedMessage: null,
|
||||
|
||||
// 分页查询参数
|
||||
queryParams: {
|
||||
pageSize: 10,
|
||||
pageNum: 1,
|
||||
},
|
||||
total: 0,
|
||||
loading:false,
|
||||
masLoading:false,
|
||||
// 新增反馈对话框的显示控制
|
||||
dialogVisible: false,
|
||||
|
||||
// 表单数据
|
||||
form: {
|
||||
title: "",
|
||||
content: "",
|
||||
// 你可以根据实际需求添加更多字段
|
||||
},
|
||||
|
||||
// 表单校验规则(示例)
|
||||
rules: {
|
||||
title: [
|
||||
{required: true, message: "请输入标题", trigger: "blur"},
|
||||
{min: 2, max: 50, message: "标题长度在 2 到 50 个字符", trigger: "blur"},
|
||||
],
|
||||
content: [
|
||||
{required: true, message: "请输入反馈内容", trigger: "blur"},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
// 处理删除
|
||||
handleDel(row){
|
||||
delFeedback(row.feedbackId).then(res => {
|
||||
this.$message.success("删除成功!");
|
||||
this.getList();
|
||||
this.selectedMessage=null;
|
||||
})
|
||||
},
|
||||
// 获取反馈列表
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listFeedback(this.queryParams).then((res) => {
|
||||
// 这里根据你的后端返回结构进行赋值
|
||||
this.messageList = res.rows;
|
||||
this.total = res.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 选中某条消息
|
||||
handleSelectMessage(msg) {
|
||||
this.msgLoading = true;
|
||||
this.selectedMessage = msg;
|
||||
// 将消息状态改为已读
|
||||
if (msg.state === 0) {
|
||||
msg.state = 1
|
||||
toRead(msg).then((res) => {
|
||||
})
|
||||
}
|
||||
this.msgLoading = false;
|
||||
// 设置当前选中的消息
|
||||
|
||||
},
|
||||
|
||||
// 提交新增反馈
|
||||
handleAddFeedback() {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (!valid) return; // 如果表单校验不通过,直接return
|
||||
// 调用新增API
|
||||
addFeedback(this.form).then((res) => {
|
||||
// 假设请求成功后需要刷新列表
|
||||
this.$message.success("反馈新增成功!");
|
||||
this.dialogVisible = false;
|
||||
this.getList();
|
||||
}).catch(err => {
|
||||
// 错误处理
|
||||
this.$message.error(err.message || "新增失败");
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
// 对话框关闭时重置表单
|
||||
resetForm() {
|
||||
this.$refs.formRef && this.$refs.formRef.resetFields();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.message-view-page {
|
||||
padding: 20px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.list-container {
|
||||
height: 600px; /* 根据需要自行调整 */
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
/* 消息列表 */
|
||||
.message-item {
|
||||
cursor: pointer;
|
||||
padding: 10px;
|
||||
margin-bottom: 8px;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
}
|
||||
|
||||
.message-item:hover {
|
||||
background-color: #f5f7fa;
|
||||
}
|
||||
|
||||
/* 未读消息红点 */
|
||||
.message-item.unread .state-dot {
|
||||
background-color: #fa5555; /* 未读的红色小圆点 */
|
||||
}
|
||||
|
||||
.message-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* 小圆点标记 */
|
||||
.state-dot {
|
||||
display: inline-block;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background-color: #cccccc; /* 已读时的灰色小圆点 */
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.message-brief {
|
||||
color: #666;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
/* 右侧详情 */
|
||||
.message-detail {
|
||||
padding-left: 20px;
|
||||
position: relative; /* 为了定位“加号按钮” */
|
||||
}
|
||||
|
||||
/* 在右上角放置一个圆形加号按钮 */
|
||||
.add-feedback-btn {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.detail-container {
|
||||
height: 600px; /* 根据需要自行调整 */
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.detail-empty {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 600px; /* 根据需要自行调整 */
|
||||
border: 1px solid #ebeef5;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
/* 对话框底部按钮居中或居右,可自行调整 */
|
||||
.dialog-footer {
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
3
gear-ui3/src/views/info/home/index.vue
Normal file
3
gear-ui3/src/views/info/home/index.vue
Normal file
@@ -0,0 +1,3 @@
|
||||
<template>
|
||||
首页
|
||||
</template>
|
||||
216
gear-ui3/src/views/info/report/components/ExportDialog.vue
Normal file
216
gear-ui3/src/views/info/report/components/ExportDialog.vue
Normal file
@@ -0,0 +1,216 @@
|
||||
<template>
|
||||
<div class="export-container">
|
||||
<!-- 时间范围选择 -->
|
||||
<el-date-picker
|
||||
v-model="exportForm.dateRange"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="width: 280px; margin-right: 16px;"
|
||||
:picker-options="pickerOptions"
|
||||
/>
|
||||
|
||||
<!-- 用户选择 -->
|
||||
<el-select
|
||||
v-model="exportForm.userIds"
|
||||
multiple
|
||||
filterable
|
||||
placeholder="选择用户"
|
||||
style="width: 280px; margin-right: 16px;"
|
||||
:loading="userLoading"
|
||||
@visible-change="handleUserSelectVisible"
|
||||
>
|
||||
<el-option
|
||||
v-for="user in userList"
|
||||
:key="user.userId"
|
||||
:label="user.nickName"
|
||||
:value="user.userId"
|
||||
>
|
||||
<span>{{ user.nickName }}</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">{{ user.dept && user.dept.deptName }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
<!-- 导出按钮 -->
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-download"
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
:disabled="!canExport"
|
||||
>
|
||||
导出报工
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { exportProjectReport } from '@/api/oa/projectReport'
|
||||
import { listUser } from '@/api/system/user'
|
||||
|
||||
export default {
|
||||
name: 'ExportDialog',
|
||||
data() {
|
||||
return {
|
||||
exportLoading: false,
|
||||
userLoading: false,
|
||||
|
||||
// 表单数据
|
||||
exportForm: {
|
||||
dateRange: [],
|
||||
userIds: [],
|
||||
options: ['includeDetails', 'includeSummary']
|
||||
},
|
||||
|
||||
// 日期选择器配置
|
||||
pickerOptions: {
|
||||
shortcuts: [
|
||||
{
|
||||
text: '最近一周',
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '最近一个月',
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
},
|
||||
{
|
||||
text: '最近三个月',
|
||||
onClick(picker) {
|
||||
const end = new Date()
|
||||
const start = new Date()
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
|
||||
picker.$emit('pick', [start, end])
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
// 用户列表
|
||||
userList: []
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
canExport() {
|
||||
return this.exportForm.dateRange &&
|
||||
this.exportForm.dateRange.length === 2 &&
|
||||
this.exportForm.userIds.length > 0
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
this.initDateRange()
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 初始化默认时间范围(当前月)
|
||||
initDateRange() {
|
||||
const today = new Date()
|
||||
const startOfMonth = new Date(today.getFullYear(), today.getMonth(), 1)
|
||||
const endOfMonth = new Date(today.getFullYear(), today.getMonth() + 1, 0)
|
||||
|
||||
this.exportForm.dateRange = [
|
||||
this.formatDate(startOfMonth),
|
||||
this.formatDate(endOfMonth)
|
||||
]
|
||||
},
|
||||
|
||||
formatDate(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}`
|
||||
},
|
||||
|
||||
// 用户选择器显示/隐藏事件
|
||||
async handleUserSelectVisible(visible) {
|
||||
if (visible && this.userList.length === 0) {
|
||||
await this.getUserList()
|
||||
}
|
||||
},
|
||||
|
||||
// 获取用户列表
|
||||
async getUserList() {
|
||||
this.userLoading = true
|
||||
try {
|
||||
const params = {
|
||||
pageNum: 1,
|
||||
pageSize: 1000
|
||||
}
|
||||
const response = await listUser(params)
|
||||
this.userList = response.rows || []
|
||||
} catch (error) {
|
||||
console.error('获取用户列表失败:', error)
|
||||
this.$message.error('获取用户列表失败')
|
||||
} finally {
|
||||
this.userLoading = false
|
||||
}
|
||||
},
|
||||
|
||||
// 执行导出
|
||||
async handleExport() {
|
||||
if (!this.canExport) {
|
||||
this.$message.warning('请选择时间范围和用户')
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
this.exportLoading = true
|
||||
|
||||
// 构建导出参数
|
||||
const exportParams = {
|
||||
startDate: this.exportForm.dateRange[0],
|
||||
endDate: this.exportForm.dateRange[1],
|
||||
userIds: this.exportForm.userIds,
|
||||
options: this.exportForm.options.join(',')
|
||||
}
|
||||
|
||||
// 调用导出API
|
||||
const response = await exportProjectReport(exportParams)
|
||||
|
||||
// 处理文件下载
|
||||
const blob = new Blob([response], {
|
||||
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||
})
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a')
|
||||
link.href = url
|
||||
link.download = `projectReport_${this.exportForm.dateRange[0]}_${this.exportForm.dateRange[1]}.xlsx`
|
||||
document.body.appendChild(link)
|
||||
link.click()
|
||||
document.body.removeChild(link)
|
||||
window.URL.revokeObjectURL(url)
|
||||
|
||||
this.$message.success('导出成功!')
|
||||
|
||||
} catch (error) {
|
||||
console.error('导出失败:', error)
|
||||
this.$message.error('导出失败,请重试')
|
||||
} finally {
|
||||
this.exportLoading = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.export-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 16px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
</style>
|
||||
106
gear-ui3/src/views/info/report/components/PieChart.vue
Normal file
106
gear-ui3/src/views/info/report/components/PieChart.vue
Normal file
@@ -0,0 +1,106 @@
|
||||
<template>
|
||||
<div ref="chartRef" class="chart-container"></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as echarts from 'echarts';
|
||||
|
||||
export default {
|
||||
name: 'PieChart',
|
||||
props: {
|
||||
// 传入的 data 数组,每项是 { projectName: string, count: number, ... }
|
||||
data: {
|
||||
type: Array,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
data: {
|
||||
handler() {
|
||||
this.renderChart();
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.chart = echarts.init(this.$refs.chartRef);
|
||||
this.renderChart();
|
||||
window.addEventListener('resize', this.resizeChart);
|
||||
},
|
||||
beforeDestroy() {
|
||||
window.removeEventListener('resize', this.resizeChart);
|
||||
this.chart && this.chart.dispose();
|
||||
},
|
||||
methods: {
|
||||
renderChart() {
|
||||
// 如果没有任何数据,显示“暂无数据”提示
|
||||
if (!this.data || this.data.length === 0) {
|
||||
this.chart.clear();
|
||||
this.chart.showLoading({
|
||||
text: '暂无数据',
|
||||
color: '#999',
|
||||
textColor: '#999',
|
||||
maskColor: 'transparent'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 将后端的 { projectName, count } 转成 { name, value }
|
||||
const pieData = this.data.map(item => ({
|
||||
name: item.projectName,
|
||||
value: item.value
|
||||
}));
|
||||
|
||||
this.chart.hideLoading();
|
||||
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: '{b}: {c} ({d}%)'
|
||||
},
|
||||
// legend: {
|
||||
// orient: 'vertical',
|
||||
// left: '0%',
|
||||
// formatter: name => {
|
||||
// // 最多6个汉字,超出则省略
|
||||
// return name.length > 6 ? name.slice(0, 6) + '…' : name;
|
||||
// },
|
||||
// data: pieData.map(i => i.name)
|
||||
// },
|
||||
series: [
|
||||
{
|
||||
name: '项目分布',
|
||||
type: 'pie',
|
||||
radius: ['40%', '70%'],
|
||||
label: {
|
||||
formatter: '{b}\n{c}'
|
||||
},
|
||||
data: pieData
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
this.chart.setOption(option, true);
|
||||
},
|
||||
resizeChart() {
|
||||
this.chart && this.chart.resize();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-container {
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* 让“暂无数据”文案垂直居中 */
|
||||
.chart-container .echarts-loading-text {
|
||||
font-size: 14px !important;
|
||||
top: 50% !important;
|
||||
transform: translateY(-50%) !important;
|
||||
}
|
||||
</style>
|
||||
135
gear-ui3/src/views/info/report/components/RankList.vue
Normal file
135
gear-ui3/src/views/info/report/components/RankList.vue
Normal file
@@ -0,0 +1,135 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 空数据提示 -->
|
||||
<div v-if="!ranking || ranking.length === 0" class="empty-state">
|
||||
暂无数据
|
||||
</div>
|
||||
<!-- 排名列表 -->
|
||||
<div v-else class="rank-list two-column">
|
||||
<!-- 左列:1-5 -->
|
||||
<div class="column left-column">
|
||||
<div
|
||||
v-for="(item, idx) in ranking.slice(0, 5)"
|
||||
:key="idx"
|
||||
class="ranking-item"
|
||||
>
|
||||
<i
|
||||
:class="idx < 3 ? topIcons[idx] : 'el-icon-user'"
|
||||
:style="{ color: iconColors[idx] }"
|
||||
/>
|
||||
<span class="rank-number">{{ idx + 1 }}</span>
|
||||
<span class="nick">{{ item.nickName }}</span>
|
||||
<span class="dept" v-if="item.deptName">{{ item.deptName }}</span>
|
||||
<span class="count">{{ item.count }} 报工</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 右列:6-10 -->
|
||||
<div class="column right-column">
|
||||
<div
|
||||
v-for="(item, idx) in ranking.slice(5, 10)"
|
||||
:key="idx + 5"
|
||||
class="ranking-item"
|
||||
>
|
||||
<i
|
||||
:class="(idx + 5) < 3 ? topIcons[idx + 5] : 'el-icon-user'"
|
||||
:style="{ color: iconColors[idx + 5] }"
|
||||
/>
|
||||
<span class="rank-number">{{ idx + 6 }}</span>
|
||||
<span class="nick">{{ item.nickName }}</span>
|
||||
<span class="dept" v-if="item.deptName">/{{ item.deptName }}</span>
|
||||
<span class="count">{{ item.count }} 报工</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'RankList',
|
||||
props: {
|
||||
ranking: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
topIcons: [
|
||||
'el-icon-medal-1',
|
||||
'el-icon-medal',
|
||||
'el-icon-medal'
|
||||
],
|
||||
iconColors: [
|
||||
'#E6A23C', '#C0C4CC', '#F56C6C',
|
||||
'#909399', '#909399', '#909399',
|
||||
'#909399', '#909399', '#909399', '#909399'
|
||||
]
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.rank-list.two-column {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 250px; /* 撑满父级容器 */
|
||||
|
||||
}
|
||||
.column {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between; /* 从头到尾均匀分布 */
|
||||
}
|
||||
.left-column {
|
||||
padding-right: 8px;
|
||||
height: 100%;
|
||||
|
||||
}
|
||||
.right-column {
|
||||
padding-left: 8px;
|
||||
}
|
||||
.ranking-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 8px;
|
||||
}
|
||||
/* 每列除最后一项外绘制底部边框 */
|
||||
.left-column .ranking-item:not(:last-child),
|
||||
.right-column .ranking-item:not(:last-child) {
|
||||
border-bottom: 1px solid #ebebeb;
|
||||
}
|
||||
.ranking-item i {
|
||||
font-size: 20px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
.rank-number {
|
||||
width: 24px;
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
margin-right: 12px;
|
||||
}
|
||||
.nick {
|
||||
flex: 1;
|
||||
font-size: 14px;
|
||||
}
|
||||
.dept {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
margin-right: 12px;
|
||||
}
|
||||
.count {
|
||||
font-size: 16px;
|
||||
color: #409EFF;
|
||||
}
|
||||
.empty-state {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
color: #909399;
|
||||
font-size: 16px;
|
||||
}
|
||||
</style>
|
||||
93
gear-ui3/src/views/info/report/components/TrendChart.vue
Normal file
93
gear-ui3/src/views/info/report/components/TrendChart.vue
Normal file
@@ -0,0 +1,93 @@
|
||||
<template>
|
||||
<div ref="chartRef" class="chart-container"></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as echarts from 'echarts';
|
||||
|
||||
export default {
|
||||
name: 'TrendChart',
|
||||
props: {
|
||||
data: {
|
||||
type: Array,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
data: {
|
||||
handler() {
|
||||
this.renderChart();
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.chart = echarts.init(this.$refs.chartRef);
|
||||
this.renderChart();
|
||||
window.addEventListener('resize', this.resizeChart);
|
||||
},
|
||||
beforeDestroy() {
|
||||
window.removeEventListener('resize', this.resizeChart);
|
||||
this.chart && this.chart.dispose();
|
||||
},
|
||||
methods: {
|
||||
renderChart() {
|
||||
// 如果数据为空,清空图表并显示暂无数据 loading
|
||||
if (!this.data || this.data.length === 0) {
|
||||
this.chart.clear();
|
||||
this.chart.showLoading({
|
||||
text: '暂无数据',
|
||||
color: '#999',
|
||||
textColor: '#999',
|
||||
maskColor: 'transparent'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 有数据时,隐藏 loading 并渲染图表
|
||||
this.chart.hideLoading();
|
||||
|
||||
const option = {
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: this.data.map(i => i.date)
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
data: this.data.map(i => i.count),
|
||||
type: 'line',
|
||||
areaStyle: {}
|
||||
}
|
||||
],
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
}
|
||||
};
|
||||
// 第二个参数 true 避免与之前配置合并
|
||||
this.chart.setOption(option, true);
|
||||
},
|
||||
resizeChart() {
|
||||
this.chart && this.chart.resize();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.chart-container {
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* 居中“暂无数据”文字 */
|
||||
.chart-container .echarts-loading-text {
|
||||
font-size: 14px !important;
|
||||
top: 50% !important;
|
||||
transform: translateY(-50%) !important;
|
||||
}
|
||||
</style>
|
||||
400
gear-ui3/src/views/info/report/dashboard.vue
Normal file
400
gear-ui3/src/views/info/report/dashboard.vue
Normal file
@@ -0,0 +1,400 @@
|
||||
<template>
|
||||
<div class="report-dashboard">
|
||||
<!-- Header -->
|
||||
<el-row type="flex" align="middle" justify="space-between" class="header-row">
|
||||
<el-col>
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
/>
|
||||
<el-button type="primary" icon="Search" class="export-button" @click="handleSearch">
|
||||
搜 索
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- Summary Cards with Skeleton -->
|
||||
<el-skeleton :loading="loading" animated>
|
||||
<template #template>
|
||||
<el-row :gutter="20" class="summary-cards">
|
||||
<el-col :span="6" v-for="n in 4" :key="n">
|
||||
<el-skeleton-item variant="text" style="width: 60%; height: 20px" />
|
||||
<el-skeleton-item variant="rect" style="width: 100%; height: 80px; margin-top: 10px" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
<template #default>
|
||||
<el-row :gutter="20" class="summary-cards">
|
||||
<el-col :span="6" v-for="card in summaryCards" :key="card.title">
|
||||
<el-card>
|
||||
<template #header>
|
||||
<span>{{ card.title }}</span>
|
||||
</template>
|
||||
<div class="card-content" :class="{ exception: card.exception }">
|
||||
<div class="card-value">{{ card.value }}</div>
|
||||
<div v-if="!card.exception" class="card-change" :class="card.changeClass">
|
||||
{{ card.displayChange }}
|
||||
</div>
|
||||
<div v-else class="card-action">
|
||||
<span class="handle">需要处理</span>
|
||||
</div>
|
||||
<i :class="['card-icon', card.icon]" :style="{ color: card.iconColor }" />
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
</el-skeleton>
|
||||
|
||||
<!-- Charts & Ranking with Skeleton -->
|
||||
<el-skeleton :loading="loading" animated>
|
||||
<template #template>
|
||||
<el-row :gutter="20" class="charts-ranking">
|
||||
<el-col :span="8" v-for="n in 3" :key="n">
|
||||
<el-skeleton-item variant="rect" style="width: 100%; height: 300px" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
<template #default>
|
||||
<el-row type="flex" :gutter="20" class="charts-ranking">
|
||||
<el-col :span="8">
|
||||
<el-card
|
||||
class="charts-card"
|
||||
:body-style="{ height: '300px', padding: '16px' }"
|
||||
>
|
||||
<template #header>报工趋势</template>
|
||||
<TrendChart :data="trendData" style="height: 100%;" />
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-card
|
||||
class="charts-card"
|
||||
:body-style="{ height: '300px', padding: '16px' }"
|
||||
>
|
||||
<template #header>项目分布</template>
|
||||
<PieChart :data="pieData" style="height: 100%;" />
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-card
|
||||
class="charts-card"
|
||||
:body-style="{ height: '300px', padding: '16px' }"
|
||||
>
|
||||
<template #header>人员排行榜</template>
|
||||
<RankList :ranking="ranking" style="flex:1; overflow:auto;" />
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
</el-skeleton>
|
||||
|
||||
<!-- Table & Tabs -->
|
||||
<el-card class="table-card">
|
||||
<el-tabs v-model="activeTab">
|
||||
<el-tab-pane label="数据总结" name="summary" />
|
||||
<el-tab-pane label="项目进度" name="progress" />
|
||||
<el-tab-pane label="历史记录" name="history" />
|
||||
</el-tabs>
|
||||
|
||||
<!-- 数据总结 -->
|
||||
<div v-show="activeTab==='summary'">
|
||||
<!-- 时间检索 -->
|
||||
<el-row align="middle" class="summary-filter" :gutter="12" style="margin-bottom:16px">
|
||||
<el-col :span="4">
|
||||
<el-date-picker
|
||||
v-model="dateRangeSummary"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
unlink-panels
|
||||
@change="onSummaryDateChange"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-button type="primary" @click="fetchSummary">筛选</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 数据总结表格 -->
|
||||
<el-table
|
||||
:data="summaryList"
|
||||
stripe
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column prop="nickName" label="姓名" />
|
||||
<el-table-column prop="deptName" label="部门"/>
|
||||
<el-table-column prop="inWorkNum" label="国内出差次数"/>
|
||||
<el-table-column prop="outWorkNum" label="国外出差次数" />
|
||||
<el-table-column prop="reportCount" label="报工次数" />
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<div v-show="activeTab==='progress'">
|
||||
<el-table :data="projectList" stripe>
|
||||
<el-table-column label="项目代号">
|
||||
<template #default="{row}">
|
||||
<el-tag v-if="row.projectCode==null" type="danger">无</el-tag>
|
||||
<el-tag v-else>{{ row.projectCode }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="projectNum" label="项目编号" />
|
||||
<el-table-column prop="projectName" label="项目名称" />
|
||||
<el-table-column prop="reportCount" label="参与人天" />
|
||||
<el-table-column label="剩余时间" align="center" prop="remainTime">
|
||||
<template #default="scope">
|
||||
<div v-if="scope.row.remainTime>=0">
|
||||
<div v-if="scope.row.projectStatus===0">
|
||||
<span v-if="scope.row.remainTime>5">剩余{{ scope.row.remainTime }}天</span>
|
||||
<el-tag v-else-if="scope.row.remainTime<=5 &&scope.row.remainTime>3" type="warning">
|
||||
剩余{{ scope.row.remainTime }}天
|
||||
</el-tag>
|
||||
<el-tag v-else type="danger">剩余{{ scope.row.remainTime }}天</el-tag>
|
||||
</div>
|
||||
<div v-else>-</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<el-tag type="danger" v-if="scope.row.projectStatus===0">过期{{
|
||||
Math.abs(scope.row.remainTime)
|
||||
}}天
|
||||
</el-tag>
|
||||
<div v-else>-</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="projectStatus">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="sys_project_status" :value="scope.row.projectStatus"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<div v-show="activeTab==='history'">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<export-dialog />
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-button icon="Download" type="text" size="small" @click="loadMore">更多</el-button>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-table :data="filteredHistory" stripe style="margin-top:16px">
|
||||
<el-table-column prop="createTime" label="报工时间">
|
||||
<template #default="scope">
|
||||
<span>{{parseTime(scope.row.createTime,'{y}-{m}-{d}')}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="deptName" label="涉及部门"/>
|
||||
<el-table-column prop="nickName" label="报工人"/>
|
||||
<el-table-column prop="projectName" label="相关项目" />
|
||||
<el-table-column prop="status" label="操作状态">
|
||||
<template #default="{row}">
|
||||
<span>✔️成功</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-view"
|
||||
@click="openDetail(scope.row)"
|
||||
>详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
|
||||
<project-report-detail
|
||||
v-model="detailVisible"
|
||||
:record="currentRow" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getCardData,
|
||||
getPieData,
|
||||
getProjectData,
|
||||
getProjectReport,
|
||||
getRankData, getSummaryList,
|
||||
getTrendData,
|
||||
listClearProjectReport
|
||||
} from '@/api/oa/projectReport';
|
||||
import ExportDialog from './components/ExportDialog.vue';
|
||||
import PieChart from './components/PieChart.vue';
|
||||
import ProjectReportDetail from "./components/ProjectReportDetail.vue";
|
||||
import RankList from "./components/RankList.vue";
|
||||
import TrendChart from './components/TrendChart.vue';
|
||||
|
||||
export default {
|
||||
name: 'ReportDashboard',
|
||||
dicts:['sys_project_status'],
|
||||
components: {
|
||||
ProjectReportDetail,
|
||||
RankList,
|
||||
TrendChart,
|
||||
PieChart,
|
||||
ExportDialog
|
||||
},
|
||||
data() {
|
||||
const today = new Date();
|
||||
const yyyy = today.getFullYear();
|
||||
const mm = String(today.getMonth() + 1).padStart(2, '0');
|
||||
const dd = String(today.getDate()).padStart(2, '0');
|
||||
return {
|
||||
loading: true,
|
||||
dateRange: [`${yyyy}-${mm}-01`, `${yyyy}-${mm}-${dd}`],
|
||||
summaryCards: [],
|
||||
trendData: [],
|
||||
dateRangeSummary: [`${yyyy}-${mm}-01`, `${yyyy}-${mm}-${dd}`],
|
||||
pieData: [],
|
||||
ranking: [
|
||||
{ name:'张明华', role:'设备维护主管', score:98, status:'success' },
|
||||
{ name:'李建国', role:'生产线组长', score:95 },
|
||||
{ name:'王丽娜', role:'质检工程师', score:92 },
|
||||
{ name:'陈志远', role:'项目经理', score:88 },
|
||||
{ name:'刘思思', role:'工艺工程师', score:85 },
|
||||
{ name:'赵永康', role:'质检员', score:82 }
|
||||
],
|
||||
summaryList:[],
|
||||
|
||||
|
||||
projectList: [
|
||||
{ name:'智能制造系统升级', progress:95, efficiency:'95%', participants:24, status:'进行中' },
|
||||
{ name:'自动化生产线改造', progress:78, efficiency:'78%', participants:18, status:'延期' },
|
||||
{ name:'设备预防性维护', progress:98, efficiency:'98%', participants:12, status:'进行中' },
|
||||
{ name:'质量管理体系优化', progress:65, efficiency:'65%', participants:15, status:'异常' }
|
||||
],
|
||||
historyList: [ /* ...静态历史... */ ],
|
||||
historyFilter: { keyword:'', type:'' },
|
||||
historyTypes: ['报工提交','数据修改','审核操作'],
|
||||
activeTab: 'summary',
|
||||
currentRow:{},
|
||||
detailVisible: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
filteredHistory() {
|
||||
return this.historyList.filter(item =>
|
||||
(!this.historyFilter.keyword || item.content.includes(this.historyFilter.keyword)) &&
|
||||
(!this.historyFilter.type || item.type === this.historyFilter.type)
|
||||
);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 时间选择变化时,如果想自动刷新也可在这里调用 fetchSummary
|
||||
onSummaryDateChange() {
|
||||
this.fetchSummary();
|
||||
},
|
||||
// 拉取"数据总结"数据的接口方法
|
||||
fetchSummary() {
|
||||
getSummaryList(this.dateRangeSummary[0],this.dateRangeSummary[1]).then(res=>{
|
||||
this.summaryList = res.data
|
||||
})
|
||||
},
|
||||
|
||||
loadMore(){
|
||||
this.$router.push('/hint/projectReport')
|
||||
},
|
||||
/** 查询详情 */
|
||||
openDetail(row) {
|
||||
getProjectReport(row.reportId).then(response => {
|
||||
this.currentRow = response.data; // row 为表格中选中的记录
|
||||
this.detailVisible = true;
|
||||
})
|
||||
|
||||
},
|
||||
handleSearch(){
|
||||
this.getBaseData()
|
||||
},
|
||||
async getBaseData() {
|
||||
this.fetchSummary()
|
||||
const [ cardRes, trendRes, pieRes,rankRes,ProjRes,reportRes ] = await Promise.all([
|
||||
getCardData(),
|
||||
getTrendData(this.dateRange[0], this.dateRange[1]),
|
||||
getPieData(this.dateRange[0], this.dateRange[1]),
|
||||
getRankData(this.dateRange[0], this.dateRange[1]),
|
||||
getProjectData(this.dateRange[0], this.dateRange[1]),
|
||||
listClearProjectReport(this.dateRange[0], this.dateRange[1])
|
||||
]);
|
||||
// 处理卡片
|
||||
const { todayCount, todayCountChange: yc,
|
||||
inProgressProjects, projectChange: yp,
|
||||
completionRate, completionChange: ycr,
|
||||
exceptions
|
||||
} = cardRes.data;
|
||||
const pct = (t,y) => y===0 ? '—' : (((t-y)/y)*100).toFixed(1) + '%';
|
||||
this.summaryCards = [
|
||||
{ title:'今日报工人数', value:todayCount, displayChange:`${pct(todayCount,yc)} 较昨日`, changeClass: todayCount-yc>=0?'up':'down', icon:'el-icon-user', iconColor:'#67C23A' },
|
||||
{ title:'进行中项目', value:inProgressProjects, displayChange:`${pct(inProgressProjects,yp)} 较昨日`, changeClass: inProgressProjects-yp>=0?'up':'down', icon:'el-icon-document', iconColor:'#409EFF' },
|
||||
{ title:'本月报工', value:completionRate, displayChange:`${pct(completionRate,ycr)} 较上月`, changeClass: completionRate-ycr>=0?'up':'down', icon:'el-icon-data-analysis', iconColor:'#E6A23C' },
|
||||
{ title:'异常预警', value:exceptions, exception:true, icon:'el-icon-warning', iconColor:'#F56C6C' }
|
||||
];
|
||||
// 赋值图表数据
|
||||
this.trendData = trendRes.data;
|
||||
this.pieData = pieRes.data;
|
||||
this.ranking = rankRes.data;
|
||||
this.projectList = ProjRes.data;
|
||||
console.log(this.projectList)
|
||||
this.historyList = reportRes.data;
|
||||
this.loading = false;
|
||||
},
|
||||
statusTagType(s) {
|
||||
return s === '进行中' ? 'success'
|
||||
: s === '延期' ? 'warning'
|
||||
: s === '异常' ? 'danger'
|
||||
: '';
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getBaseData();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.report-dashboard { padding:20px; background:#f5f7fa; }
|
||||
.header-row { margin-bottom:20px; }
|
||||
.export-button { margin-left:10px; }
|
||||
.summary-cards { margin-bottom:20px; }
|
||||
.card-content { position:relative; padding:20px; }
|
||||
.card-value { font-size:28px; margin:10px 0; }
|
||||
.card-change { font-size:12px; }
|
||||
.card-change.up { color:#67C23A; }
|
||||
.card-change.down { color:#F56C6C; }
|
||||
.card-icon { position:absolute; top:20px; right:20px; font-size:28px; }
|
||||
.card-action { margin-top:10px; }
|
||||
.handle { color:#F56C6C; margin-right:10px; }
|
||||
.charts-ranking { margin-bottom:20px; }
|
||||
.charts-card { display:flex; flex-direction:column; }
|
||||
.table-card { margin-top:20px; }
|
||||
.history-filter { margin-bottom:12px; }
|
||||
.status-icon.success { color:#67C23A; margin-right:4px; }
|
||||
.status-icon.danger { color:#F56C6C; margin-right:4px; }
|
||||
.more { float:right; }
|
||||
/* 组件内的 .chart-container 在各自组件中定义 */
|
||||
.history-table-header {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 0 5px;
|
||||
}
|
||||
/* 如果想让按钮 hover 时高亮箭头,可以加: */
|
||||
.history-table-header .el-button:hover .el-icon-arrow-right {
|
||||
color: #409EFF;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user