Compare commits
17 Commits
15ed0d0416
...
7523444595
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7523444595 | ||
|
|
65c8f3c157 | ||
|
|
3afc321b16 | ||
|
|
e6699aa4bb | ||
|
|
b1aa6c6324 | ||
|
|
05477cc06f | ||
|
|
159c4f49e8 | ||
|
|
5b7dd337df | ||
|
|
1fa8ac0a14 | ||
|
|
98ab71da3e | ||
|
|
c304e53d29 | ||
|
|
4637325572 | ||
|
|
f86f41ccbe | ||
|
|
02d548f8df | ||
|
|
0cb93eb0d2 | ||
|
|
b7bbb6bf8b | ||
|
|
5edd1277d2 |
@ -9,7 +9,7 @@
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form-item>z
|
||||
|
||||
|
||||
|
||||
|
||||
@ -10,16 +10,34 @@ export function chartLineInspectionAmount(params) {
|
||||
}
|
||||
// 已收款金额
|
||||
export function getServerData1(params) {
|
||||
params.partnerId = '19'
|
||||
return request({
|
||||
url: '/partnerOwn/partner/newChartInfoAmount',
|
||||
url: '/partnerOwn/partner/chartInfoAmount',
|
||||
method: 'get',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
})}
|
||||
// }
|
||||
// // 已收款金额
|
||||
// export function getServerData1(params) {
|
||||
// return request({
|
||||
// url: '/partnerOwn/partner/newChartInfoAmount',
|
||||
// method: 'get',
|
||||
// params: params
|
||||
// })
|
||||
// }
|
||||
// // 数量统计
|
||||
// export function chartInfoNum(params) {
|
||||
// return request({
|
||||
// url: '/partnerOwn/partner/newChartInfoNum',
|
||||
// method: 'get',
|
||||
// params: params
|
||||
// })
|
||||
// }
|
||||
// 数量统计
|
||||
export function chartInfoNum(params) {
|
||||
params.partnerId = '19'
|
||||
return request({
|
||||
url: '/partnerOwn/partner/newChartInfoNum',
|
||||
url: '/partnerOwn/partner/chartInfoNum',
|
||||
method: 'get',
|
||||
params: params
|
||||
})
|
||||
@ -35,7 +53,7 @@ export function chartLineInspectionNum(params) {
|
||||
// 检测合格率
|
||||
export function chartInfoRatio(params) {
|
||||
return request({
|
||||
url: '/partnerOwn/partner/newChartInfoRatio',
|
||||
url: '/partnerOwn/partner/chartInfoRatio',
|
||||
method: 'get',
|
||||
params: params
|
||||
})
|
||||
@ -67,10 +85,20 @@ export function getfive3(params) {
|
||||
// 检测商品统计
|
||||
export function hotGoodsList() {
|
||||
return request({
|
||||
url: '/partnerOwn/partner/newHotGoodsList',
|
||||
url: '/partnerOwn/partner/hotGoodsList',
|
||||
method: 'get',
|
||||
params: {
|
||||
partnerId: '19'
|
||||
}
|
||||
})
|
||||
}
|
||||
// 检测商品统计
|
||||
// export function hotGoodsList() {
|
||||
// return request({
|
||||
// url: '/partnerOwn/partner/newHotGoodsList',
|
||||
// method: 'get'
|
||||
// })
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
@ -84,19 +84,19 @@
|
||||
<div class="fv_box">
|
||||
<div class="b-b">
|
||||
<div>公示价格</div>
|
||||
<div class="b_box">4090</div>
|
||||
<div class="b_box">{{ data1.gsAmount || 0 }}</div>
|
||||
</div>
|
||||
<div class="b-b">
|
||||
<div>应收</div>
|
||||
<div class="b_box">4090</div>
|
||||
<div class="b_box">{{ data1.ysAmount || 0 }}</div>
|
||||
</div>
|
||||
<div class="b-b">
|
||||
<div>已收</div>
|
||||
<div class="b_box">4090</div>
|
||||
<div class="b_box">{{ data1.yjsAmount || 0 }}</div>
|
||||
</div>
|
||||
<div class="b-b">
|
||||
<div>待收</div>
|
||||
<div class="b_box">4090</div>
|
||||
<div class="b_box">{{ data1.ysAmount - data1.yjsAmount || 0 }}</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -130,7 +130,7 @@
|
||||
</div>
|
||||
<div class="six_box">
|
||||
<div class="s_title">
|
||||
检测合格率
|
||||
检测合格率(按车型)
|
||||
</div>
|
||||
<div class="dis-t">
|
||||
|
||||
@ -142,33 +142,33 @@
|
||||
</div>
|
||||
<div class="echaets_box" style="padding-top: 15px" >
|
||||
<!-- gdt-->
|
||||
<div class="jd_box">
|
||||
<div class="jd_box" v-for="(item,index) in jchgl" :key="index">
|
||||
<div class="jd_bt">
|
||||
<div>重型货车</div>
|
||||
<div>{{Progress1}}%</div>
|
||||
<div>{{ item.name }}</div>
|
||||
<div>{{ item.value }}%</div>
|
||||
</div>
|
||||
<div class="jd_k">
|
||||
<div class="jd_v" :style=" 'width:' + Progress1+'%' " ></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="jd_box">
|
||||
<div class="jd_bt">
|
||||
<div>3.5以上 轻型货车</div>
|
||||
<div>{{Progress1}}%</div>
|
||||
</div>
|
||||
<div class="jd_k">
|
||||
<div class="jd_v" :style=" 'width:' + Progress1+'%' " ></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="jd_box">
|
||||
<div class="jd_bt">
|
||||
<div>3.5以下 轻型货车</div>
|
||||
<div>{{Progress1}}%</div>
|
||||
</div>
|
||||
<div class="jd_k">
|
||||
<div class="jd_v" :style=" 'width:' + Progress1+'%' " ></div>
|
||||
<div class="jd_v" :style=" 'width:' + item.value+'%' " ></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="jd_box">-->
|
||||
<!-- <div class="jd_bt">-->
|
||||
<!-- <div>3.5以上 轻型货车</div>-->
|
||||
<!-- <div>{{Progress1}}%</div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="jd_k">-->
|
||||
<!-- <div class="jd_v" :style=" 'width:' + Progress1+'%' " ></div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="jd_box">-->
|
||||
<!-- <div class="jd_bt">-->
|
||||
<!-- <div>3.5以下 轻型货车</div>-->
|
||||
<!-- <div>{{Progress1}}%</div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="jd_k">-->
|
||||
<!-- <div class="jd_v" :style=" 'width:' + Progress1+'%' " ></div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@ -179,11 +179,19 @@
|
||||
<div class="echaets_box" style="display: flex;align-items: center;justify-content: space-around">
|
||||
<div id="jcsptj" style="width: 170px; height: 170px;"></div>
|
||||
<div>
|
||||
<div class="hang_box">
|
||||
<!-- <div class="hang_box" v-for="(item,index) in goodsList">-->
|
||||
<!-- <div>-->
|
||||
<!-- <div class="jt_"></div>-->
|
||||
<!-- <div class="jt_size" style="color: #0174F6">{{ item.goodsName }}</div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div>{{ item.salesNum }}</div>-->
|
||||
<!-- </div>-->
|
||||
<div class="hang_box" >
|
||||
<div>
|
||||
<div class="jt_"></div>
|
||||
<div class="jt_size" style="color: #0174F6">双燃料机油</div>
|
||||
<div class="jt_" style="background: #40CC97"></div>
|
||||
<div class="jt_size" style="color: #40CC97">双燃料机油</div>
|
||||
</div>
|
||||
|
||||
<div>278</div>
|
||||
</div>
|
||||
<div class="hang_box" >
|
||||
@ -216,10 +224,10 @@ import * as echarts from 'echarts';
|
||||
import * as jcBigScreen from '@/views/inspection/screen/api/jcBigScreen';
|
||||
import {
|
||||
chartInfoNum,
|
||||
chartLineInspectionAmount,
|
||||
chartLineInspectionAmount, chartLineInspectionNum,
|
||||
getfive1,
|
||||
getfive2,
|
||||
getfive3, hotGoodsList
|
||||
getfive3, getServerData1, hotGoodsList
|
||||
} from "@/views/inspection/screen/api/jcBigScreen";
|
||||
|
||||
export default {
|
||||
@ -239,6 +247,7 @@ export default {
|
||||
data1: '',
|
||||
data3: '',
|
||||
chartData1: {},
|
||||
jchgl:[],
|
||||
params: {
|
||||
unit: this.unit,
|
||||
},
|
||||
@ -254,6 +263,8 @@ export default {
|
||||
{text: '年', unit: 'year'},
|
||||
|
||||
],
|
||||
jcList:[], //检测合格率
|
||||
goodsList:[],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@ -303,6 +314,11 @@ export default {
|
||||
|
||||
var chartDom = document.getElementById('yskje');
|
||||
var myChart = echarts.init(chartDom);
|
||||
const params = {
|
||||
unit: this.unit,
|
||||
};
|
||||
const res = await jcBigScreen.getServerData1(params)
|
||||
console.log('已收款金额', res)
|
||||
|
||||
let option = {
|
||||
tooltip: {
|
||||
@ -311,7 +327,7 @@ export default {
|
||||
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: ['小型汽车', '中型汽车', '大型汽车'],
|
||||
data: res.data.categories,
|
||||
//更改坐标轴颜色
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
@ -362,7 +378,7 @@ export default {
|
||||
},
|
||||
},
|
||||
series: [{
|
||||
data: [6,6,6],//this.PLAN_COUNT, this.ACTUAL_COUNT,this.GAP
|
||||
data: res.data.series[0].data,//this.PLAN_COUNT, this.ACTUAL_COUNT,this.GAP
|
||||
type: 'bar',
|
||||
barWidth:40,
|
||||
itemStyle: {
|
||||
@ -414,6 +430,20 @@ export default {
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async getProduct() {
|
||||
let res = await hotGoodsList()
|
||||
console.log('检测商品统计',res)
|
||||
this.goodsList = res.data
|
||||
//提取出res.data中的goodsName和salesNum 放进数组
|
||||
let goodsName = []
|
||||
let salesNum = []
|
||||
for (let i = 0; i < res.data.length; i++) {
|
||||
let name = {
|
||||
value: res.data[i].salesNum,
|
||||
name: res.data[i].goodsName
|
||||
}
|
||||
goodsName.push(name)
|
||||
salesNum.push(res.data[i].salesNum)
|
||||
}
|
||||
var chartDom = document.getElementById('jcsptj');
|
||||
|
||||
var myChart = echarts.init(chartDom);
|
||||
@ -455,11 +485,12 @@ export default {
|
||||
labelLine: {
|
||||
show: false
|
||||
},
|
||||
data: [
|
||||
{ value: 1048, name: '单燃料机油' },
|
||||
{ value: 735, name: '双燃料机油' },
|
||||
{ value: 580, name: '三燃料机油' }
|
||||
]
|
||||
// [
|
||||
// { value: 1000, name: '单燃料机油' },
|
||||
// { value: 735, name: '双燃料机油' },
|
||||
// { value: 580, name: '三燃料机油' }
|
||||
// ]
|
||||
data: goodsName
|
||||
}
|
||||
]
|
||||
};
|
||||
@ -471,6 +502,11 @@ export default {
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async chartInfoNum() {
|
||||
const params = {
|
||||
unit: this.unit1,
|
||||
}
|
||||
let res = await jcBigScreen.chartInfoNum(params)
|
||||
console.log('数量统计', res)
|
||||
var chartDom = document.getElementById('sltj');
|
||||
var myChart = echarts.init(chartDom);
|
||||
|
||||
@ -481,7 +517,7 @@ export default {
|
||||
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: ['小型汽车', '中型汽车', '大型汽车'],
|
||||
data: res.data.categories,
|
||||
//更改坐标轴颜色
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
@ -532,7 +568,7 @@ export default {
|
||||
},
|
||||
},
|
||||
series: [{
|
||||
data: [6,6,6],//this.PLAN_COUNT, this.ACTUAL_COUNT,this.GAP
|
||||
data: res.data.series[0].data,//this.PLAN_COUNT, this.ACTUAL_COUNT,this.GAP
|
||||
type: 'bar',
|
||||
barWidth:40,
|
||||
itemStyle: {
|
||||
@ -589,31 +625,17 @@ export default {
|
||||
}
|
||||
let res = await jcBigScreen.chartInfoRatio(params)
|
||||
console.log('检测合格率', res)
|
||||
res.data.series.forEach(item => {
|
||||
item.type = 'bar'
|
||||
})
|
||||
var chartDom = document.getElementById('jchgl');
|
||||
var myChart = echarts.init(chartDom);
|
||||
var option;
|
||||
option = {
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: res.data.categories
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
axisLabel: {
|
||||
formatter: '{value}',
|
||||
textStyle: {
|
||||
color: '#fff', //更改坐标轴文字颜色
|
||||
fontSize: 16, //更改坐标轴文字大小
|
||||
fontFamily: 'MicrosoftYaHei'
|
||||
}
|
||||
},
|
||||
},
|
||||
series: res.data.series
|
||||
};
|
||||
option && myChart.setOption(option);
|
||||
let arrA = res.data.categories
|
||||
let arrB = res.data.series
|
||||
let values = []
|
||||
for (let i = 0; i < arrA.length; i++) {
|
||||
let a = {
|
||||
value: arrB[0].data[i],
|
||||
name: arrA[i]
|
||||
}
|
||||
values.push(a)
|
||||
}
|
||||
this.jchgl = values
|
||||
},
|
||||
/**
|
||||
* 检测数量
|
||||
@ -623,7 +645,8 @@ export default {
|
||||
var chartDom = document.getElementById('jcsl');
|
||||
var myChart = echarts.init(chartDom);
|
||||
var option;
|
||||
|
||||
const res = await chartLineInspectionNum()
|
||||
console.log('检测数量', res)
|
||||
option = {
|
||||
color: ['#0663f0', '#FFD78B'],
|
||||
legend: {
|
||||
@ -633,7 +656,7 @@ export default {
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: ['01', '02', '03', '04', '05', '06', '07'],
|
||||
data: res.data.categories,
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#fff'
|
||||
@ -662,7 +685,7 @@ export default {
|
||||
},
|
||||
series: [
|
||||
{
|
||||
data: [820, 932, 901, 934, 1290, 1330, 1320],
|
||||
data: res.data.series[0].data,
|
||||
type: 'line',
|
||||
symbolSize: 0,
|
||||
smooth: true,
|
||||
@ -675,7 +698,7 @@ export default {
|
||||
}
|
||||
},
|
||||
{
|
||||
data: [220, 182, 191, 234, 290, 330, 310],
|
||||
data: res.data.series[1].data,
|
||||
type: 'line',
|
||||
symbolSize: 0,
|
||||
smooth: true,
|
||||
@ -690,6 +713,8 @@ export default {
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
|
||||
option && myChart.setOption(option);
|
||||
},
|
||||
|
||||
@ -697,6 +722,11 @@ export default {
|
||||
* 客户来源分析饼图
|
||||
*/
|
||||
async customerSource() {
|
||||
const params = {
|
||||
unit: this.unit,
|
||||
}
|
||||
const res = await jcBigScreen.chartLineInspectionAmount(params);
|
||||
console.log('成交金额', res.data)
|
||||
var chartDom = document.getElementById('khly');
|
||||
var myChart = echarts.init(chartDom);
|
||||
var option;
|
||||
@ -707,7 +737,7 @@ export default {
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: ['01', '02', '03', '04', '05', '06', '07'],
|
||||
data: res.data.categories,
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#fff'
|
||||
@ -733,13 +763,12 @@ export default {
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontSize: 16,
|
||||
|
||||
}
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
data: [120, 200, 150, 80, 70, 110, 130],
|
||||
data: res.data.series[0].data,
|
||||
type: 'line',
|
||||
|
||||
symbolSize: 10,
|
||||
|
||||
170
src/views/inspection/staff/api/staff.js
Normal file
170
src/views/inspection/staff/api/staff.js
Normal file
@ -0,0 +1,170 @@
|
||||
import request from '@/utils/request'
|
||||
import { praseStrEmpty } from "@/utils/ruoyi";
|
||||
|
||||
// 查询用户列表
|
||||
export function listUser(query) {
|
||||
return request({
|
||||
url: '/inspectionStaff/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获取用户精简信息列表
|
||||
export function listSimpleUsers() {
|
||||
return request({
|
||||
url: '/system/user/list-all-simple',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询用户详细
|
||||
export function getUser(userId) {
|
||||
return request({
|
||||
url: '/inspectionStaff/get?id=' + praseStrEmpty(userId),
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 驾照类型
|
||||
export function getDriverLicenseType(userId) {
|
||||
return request({
|
||||
url: '/common/down/getDriverLicenseType',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增用户
|
||||
export function addUser(data) {
|
||||
return request({
|
||||
url: '/inspectionStaff/save',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 新增用户
|
||||
export function addFolder(data) {
|
||||
return request({
|
||||
url: '/inspectionStaff/addFolder',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 新增用户
|
||||
export function permissionAssign(data) {
|
||||
return request({
|
||||
url: '/system/permission/assign-user-role',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改用户
|
||||
export function updateUser(data) {
|
||||
return request({
|
||||
url: '/inspectionStaff/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除用户
|
||||
export function delUser(userId) {
|
||||
return request({
|
||||
url: '/system/user/delete?id=' + userId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出用户
|
||||
export function exportUser(query) {
|
||||
return request({
|
||||
url: '/inspectionStaff/export',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 用户密码重置
|
||||
export function resetUserPwd(id, password) {
|
||||
const data = {
|
||||
id,
|
||||
password
|
||||
}
|
||||
return request({
|
||||
url: '/system/user/update-password',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 用户状态修改
|
||||
export function changeUserStatus(id, status) {
|
||||
const data = {
|
||||
id,
|
||||
status
|
||||
}
|
||||
return request({
|
||||
url: '/system/user/update-status',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 查询用户个人信息
|
||||
export function getUserProfile() {
|
||||
return request({
|
||||
url: '/system/user/profile/get',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 查询检测岗位
|
||||
export function getPost() {
|
||||
return request({
|
||||
url: '/system/role/pageByQuery',
|
||||
params:{
|
||||
servicePackageId:'jiance'
|
||||
},
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 修改用户个人信息
|
||||
export function updateUserProfile(data) {
|
||||
return request({
|
||||
url: '/system/user/profile/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 用户密码重置
|
||||
export function updateUserPwd(oldPassword, newPassword) {
|
||||
const data = {
|
||||
oldPassword,
|
||||
newPassword
|
||||
}
|
||||
return request({
|
||||
url: '/system/user/profile/update-password',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 用户头像上传
|
||||
export function uploadAvatar(data) {
|
||||
return request({
|
||||
url: '/system/user/profile/update-avatar',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 下载用户导入模板
|
||||
export function importTemplate() {
|
||||
return request({
|
||||
url: '/inspectionStaff/get-import-template',
|
||||
method: 'get',
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
850
src/views/inspection/staff/index.vue
Normal file
850
src/views/inspection/staff/index.vue
Normal file
@ -0,0 +1,850 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<doc-alert title="员工体系" url="https://doc.iocoder.cn/user-center/"/>
|
||||
<doc-alert title="三方登陆" url="https://doc.iocoder.cn/social-user/"/>
|
||||
<doc-alert title="Excel 导入导出" url="https://doc.iocoder.cn/excel-import-and-export/"/>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-row :gutter="20">
|
||||
<!--部门数据-->
|
||||
<!-- <el-col :span="4" :xs="24">-->
|
||||
<!-- <div class="head-container">-->
|
||||
<!-- <el-input v-model="deptName" placeholder="请输入部门名称" clearable size="small" prefix-icon="el-icon-search" style="margin-bottom: 20px"/>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="head-container">-->
|
||||
<!-- <el-tree :data="deptOptions" :props="defaultProps" :expand-on-click-node="false" :filter-node-method="filterNode"-->
|
||||
<!-- ref="tree" default-expand-all highlight-current @node-click="handleNodeClick"/>-->
|
||||
<!-- </div>-->
|
||||
<!-- </el-col>-->
|
||||
<!--员工数据-->
|
||||
<el-col>
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
|
||||
label-width="68px">
|
||||
<el-form-item label="员工账号" prop="username">
|
||||
<el-input v-model="queryParams.nickname" placeholder="请输入员工账号" clearable style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号码" prop="mobile">
|
||||
<el-input v-model="queryParams.mobile" placeholder="请输入手机号码" clearable style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="员工状态" clearable style="width: 240px">
|
||||
<el-option v-for="dict in statusDictDatas" :key="parseInt(dict.value)" :label="dict.label"
|
||||
:value="parseInt(dict.value)"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @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-plus" size="mini" @click="handleAdd">新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" icon="el-icon-upload2" size="mini" @click="handleImport">导入
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport"
|
||||
:loading="exportLoading">导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="userList">
|
||||
<el-table-column label="员工编号" align="center" key="id" prop="id" v-if="columns[0].visible"/>
|
||||
<el-table-column label="员工账号" align="center" key="username" prop="username" v-if="columns[1].visible"
|
||||
:show-overflow-tooltip="true"/>
|
||||
<el-table-column label="员工昵称" align="center" key="nickname" prop="nickname" v-if="columns[2].visible"
|
||||
:show-overflow-tooltip="true"/>
|
||||
<el-table-column label="部门" align="center" key="deptName" prop="dept.name" v-if="columns[3].visible"
|
||||
:show-overflow-tooltip="true"/>
|
||||
<el-table-column label="手机号码" align="center" key="mobile" prop="mobile" v-if="columns[4].visible"
|
||||
width="120"/>
|
||||
<el-table-column label="状态" key="status" v-if="columns[5].visible" align="center">
|
||||
<template v-slot="scope">
|
||||
<el-switch v-model="scope.row.status" :active-value="0" :inactive-value="1"
|
||||
@change="handleStatusChange(scope.row)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="创建时间" align="center" prop="createTime" v-if="columns[6].visible" width="160">-->
|
||||
<!-- <template v-slot="scope">-->
|
||||
<!-- <span>{{ parseTime(scope.row.createTime) }}</span>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 添加或修改参数配置对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="员工名称" prop="nickname">
|
||||
<el-input v-model="form.nickname" placeholder="请输入员工名称"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="岗位" prop="postId">
|
||||
<el-select multiple v-model="form.roleIds" placeholder="请选择岗位">
|
||||
<el-option v-for="item in postOptions" :key="item.id" :label="item.name" :value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="手机号码" prop="mobile">
|
||||
<el-input v-model="form.mobile" placeholder="请输入手机号码" maxlength="11"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- <el-row>-->
|
||||
<!-- <el-col :span="12">-->
|
||||
<!-- <el-form-item v-if="form.id === undefined" label="员工账号" prop="username">-->
|
||||
<!-- <el-input v-model="form.username" placeholder="请输入员工账号"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="12">-->
|
||||
<!-- <el-form-item v-if="form.id === undefined" label="员工密码" prop="password">-->
|
||||
<!-- <el-input v-model="form.password" placeholder="请输入员工密码" type="password" show-password/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- </el-row>-->
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="身份证号码" prop="idCard">
|
||||
<el-input v-model="form.idCard" placeholder="请输入身份证号码"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="居住地" prop="address">
|
||||
<el-input v-model="form.address" placeholder="请输入居住地"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学历" prop="educational">
|
||||
<!-- <el-input v-model="form.educational" placeholder="请输入学历"/>-->
|
||||
<el-select v-model="form.educational" placeholder="请选择学历">
|
||||
<el-option
|
||||
v-for="dict in educationOptions"
|
||||
:key="dict.label"
|
||||
:label="dict.label"
|
||||
:value="dict.label"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="毕业院校" prop="school">
|
||||
<el-input v-model="form.school" placeholder="请输入毕业院校"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="短号" prop="shortNumber">
|
||||
<el-input v-model="form.shortNumber" placeholder="请输入短号"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="入职时间" prop="joinDate">
|
||||
<el-date-picker v-model="form.joinDate" type="date" placeholder="请选择入职时间"
|
||||
value-format="yyyy-MM-dd"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="紧急联系人" prop="emergencyContactName">
|
||||
<el-input v-model="form.emergencyContactName" placeholder="请输入紧急联系人"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话" prop="emergencyContactPhone">
|
||||
<el-input v-model="form.emergencyContactPhone" placeholder="请输入联系电话"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="员工性别">
|
||||
<el-select v-model="form.sex" placeholder="请选择">
|
||||
<el-option v-for="dict in sexDictDatas" :key="parseInt(dict.value)" :label="dict.label"
|
||||
:value="parseInt(dict.value)"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="驾照类型" prop="driverLicenseType">
|
||||
<el-select
|
||||
multiple
|
||||
collapse-tags
|
||||
v-model="form.driverLicenseTypeArr" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="dict in driverLicenseTypeOptions" :key="dict.id" :label="dict.id"
|
||||
:value="dict.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="社保购买日期" prop="socialSecurityBuyDate">
|
||||
<el-date-picker v-model="form.socialSecurityBuyDate" type="date" value-format="yyyy-MM-dd"
|
||||
placeholder="请选择社保购买日期"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="1">
|
||||
<el-form-item label="转正时间" prop="shortNumber">
|
||||
<!-- <el-input v-model="form.probationPeriod" placeholder="请输入试用期"/>-->
|
||||
<el-date-picker v-model="form.probationPeriod" type="date" value-format="yyyy-MM-dd"
|
||||
placeholder="请选择试用期"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="查看附件" v-if="this.form.id">
|
||||
<div @click="addFolder">点击查看附件</div>
|
||||
</el-form-item>
|
||||
<!-- 导入附件-->
|
||||
<!-- <el-row style="display: flex; justify-content: center;">-->
|
||||
<!-- <el-upload-->
|
||||
<!-- class="upload-demo"-->
|
||||
<!-- :action="imageUpload.url"-->
|
||||
<!-- :on-preview="handlePreview"-->
|
||||
<!-- :on-remove="handleRemove"-->
|
||||
<!-- :before-remove="beforeRemove"-->
|
||||
<!-- multiple-->
|
||||
<!-- :limit="3"-->
|
||||
<!-- :on-exceed="handleExceed"-->
|
||||
<!-- :headers="imageUpload.headers"-->
|
||||
<!-- :on-success="handleFileSuccessAttachments"-->
|
||||
<!-- :file-list="fileList">-->
|
||||
<!-- <el-button size="small" type="primary">点击上传</el-button>-->
|
||||
<!-- <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>-->
|
||||
<!-- </el-upload>-->
|
||||
<!-- </el-row>-->
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 员工导入对话框 -->
|
||||
<el-dialog :title="upload.title" :visible.sync="upload.open" append-to-body>
|
||||
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
|
||||
:action="upload.url" :disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div class="el-upload__tip text-center" slot="tip">
|
||||
<div class="el-upload__tip" slot="tip">
|
||||
<el-checkbox v-model="upload.updateSupport"/>
|
||||
是否更新已经存在的员工数据
|
||||
</div>
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
|
||||
@click="importTemplate">下载模板
|
||||
</el-link>
|
||||
</div>
|
||||
</el-upload>
|
||||
<el-table
|
||||
v-if="isFail"
|
||||
:data="failList"
|
||||
stripe
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
prop="username"
|
||||
label="员工姓名"
|
||||
width="180">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="reason"
|
||||
label="失败原因">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="roleName"
|
||||
label="岗位">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="idCard"
|
||||
label="身份证号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="address"
|
||||
label="地址">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="educational"
|
||||
label="学历">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="school"
|
||||
label="毕业院校">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="mobile"
|
||||
label="电话号码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="shortNumber"
|
||||
label="短号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="joinDate"
|
||||
label="入职日期">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="probationPeriod"
|
||||
label="转正日期">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="socialSecurityBuyDate"
|
||||
label="社保购买日期">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="emergencyContactName"
|
||||
label="紧急联系人">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="emergencyContactPhone"
|
||||
label="紧急联系人电话">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="driverLicenseType"
|
||||
label="驾驶证类型">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="upload.open = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
addUser,
|
||||
changeUserStatus,
|
||||
delUser,
|
||||
exportUser,
|
||||
getUser,
|
||||
importTemplate,
|
||||
listUser,
|
||||
resetUserPwd,
|
||||
getDriverLicenseType,
|
||||
updateUser, getPost, permissionAssign, addFolder
|
||||
} from "@/views/inspection/staff/api/staff";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
|
||||
import {listSimpleDepts} from "@/api/system/dept";
|
||||
import {listSimplePosts} from "@/api/system/post";
|
||||
|
||||
import {CommonStatusEnum} from "@/utils/constants";
|
||||
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
|
||||
import {assignUserRole, listUserRoles} from "@/api/system/permission";
|
||||
import {listSimpleRoles} from "@/api/system/role";
|
||||
import {getBaseHeader} from "@/utils/request";
|
||||
|
||||
export default {
|
||||
name: "SystemUser",
|
||||
components: {Treeselect},
|
||||
data() {
|
||||
return {
|
||||
failList: [],
|
||||
isFail: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 导出遮罩层
|
||||
exportLoading: false,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 员工表格数据
|
||||
userList: null,
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 部门树选项
|
||||
deptOptions: undefined,
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 部门名称
|
||||
deptName: undefined,
|
||||
// 默认密码
|
||||
initPassword: undefined,
|
||||
// 性别状态字典
|
||||
sexOptions: [],
|
||||
// 岗位选项
|
||||
postOptions: [],
|
||||
// 角色选项
|
||||
roleOptions: [],
|
||||
isInsert: false,
|
||||
// 表单参数
|
||||
form: {
|
||||
driverLicenseTypeArr: []
|
||||
},
|
||||
defaultProps: {
|
||||
children: "children",
|
||||
label: "name"
|
||||
},
|
||||
// 文件列表
|
||||
fileList: [],
|
||||
// 驾驶证类型
|
||||
driverLicenseTypeOptions: [],
|
||||
// 员工导入参数
|
||||
upload: {
|
||||
// 是否显示弹出层(员工导入)
|
||||
open: false,
|
||||
// 弹出层标题(员工导入)
|
||||
title: "",
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 是否更新已经存在的员工数据
|
||||
updateSupport: 0,
|
||||
// 设置上传的请求头部
|
||||
headers: getBaseHeader(),
|
||||
// 上传的地址
|
||||
url: process.env.VUE_APP_BASE_API + '/admin-api/inspectionStaff/import'
|
||||
},
|
||||
//图片
|
||||
imageUpload: {
|
||||
// 是否显示弹出层(员工导入)
|
||||
open: false,
|
||||
// 弹出层标题(员工导入)
|
||||
title: "",
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 设置上传的请求头部
|
||||
headers: getBaseHeader(),
|
||||
// 上传的地址
|
||||
url: process.env.VUE_APP_BASE_API + '/admin-api/infra/file/uploadDetail'
|
||||
},
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
username: undefined,
|
||||
mobile: undefined,
|
||||
status: undefined,
|
||||
postId: undefined,
|
||||
createTime: []
|
||||
},
|
||||
// 列信息
|
||||
columns: [
|
||||
{key: 0, label: `员工编号`, visible: true},
|
||||
{key: 1, label: `员工名称`, visible: true},
|
||||
{key: 2, label: `员工昵称`, visible: true},
|
||||
{key: 3, label: `部门`, visible: true},
|
||||
{key: 4, label: `手机号码`, visible: true},
|
||||
{key: 5, label: `状态`, visible: true},
|
||||
{key: 6, label: `创建时间`, visible: true}
|
||||
],
|
||||
// 表单校验
|
||||
rules: {
|
||||
username: [
|
||||
{required: true, message: "员工名称不能为空", trigger: "blur"}
|
||||
],
|
||||
nickname: [
|
||||
{required: true, message: "员工昵称不能为空", trigger: "blur"}
|
||||
],
|
||||
password: [
|
||||
{required: true, message: "员工密码不能为空", trigger: "blur"}
|
||||
],
|
||||
email: [
|
||||
{
|
||||
type: "email",
|
||||
message: "'请输入正确的邮箱地址",
|
||||
trigger: ["blur", "change"]
|
||||
}
|
||||
],
|
||||
mobile: [
|
||||
{
|
||||
required: true,
|
||||
pattern: /^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/,
|
||||
message: "请输入正确的手机号码",
|
||||
trigger: "blur"
|
||||
}
|
||||
]
|
||||
},
|
||||
// 是否显示弹出层(角色权限)
|
||||
openRole: false,
|
||||
|
||||
// 枚举
|
||||
SysCommonStatusEnum: CommonStatusEnum,
|
||||
// 数据字典
|
||||
statusDictDatas: getDictDatas(DICT_TYPE.COMMON_STATUS),
|
||||
sexDictDatas: getDictDatas(DICT_TYPE.SYSTEM_USER_SEX),
|
||||
// 学历数组
|
||||
educationOptions: getDictDatas(DICT_TYPE.COMPANY_STAFF_EDU),
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
// 根据名称筛选部门树
|
||||
deptName(val) {
|
||||
this.$refs.tree.filter(val);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
// this.getTreeselect();
|
||||
this.getDriverLicenseType();
|
||||
// this.getConfigKey("sys.user.init-password").then(response => {
|
||||
// this.initPassword = response.msg;
|
||||
// });
|
||||
},
|
||||
methods: {
|
||||
// 更多操作
|
||||
handleCommand(command, index, row) {
|
||||
switch (command) {
|
||||
case 'handleUpdate':
|
||||
this.handleUpdate(row);//修改客户信息
|
||||
break;
|
||||
case 'handleDelete':
|
||||
this.handleDelete(row);//红号变更
|
||||
break;
|
||||
case 'handleResetPwd':
|
||||
this.handleResetPwd(row);
|
||||
break;
|
||||
case 'handleRole':
|
||||
this.handleRole(row);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
/** 查询员工列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listUser(this.queryParams).then(response => {
|
||||
this.userList = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
}
|
||||
);
|
||||
},
|
||||
addFolder() {
|
||||
if (!this.form.folderId) {
|
||||
addFolder(this.form.id).then(response => {
|
||||
this.form.folderId = response.data
|
||||
this.$router.push({path: '/jc/shop/partner/file/file', query: {"folderId": this.form.folderId}})
|
||||
})
|
||||
} else {
|
||||
this.$router.push({path: '/jc/shop/partner/file/file', query: {"folderId": this.form.folderId}})
|
||||
}
|
||||
},
|
||||
// 查询驾驶证类型
|
||||
getDriverLicenseType() {
|
||||
getDriverLicenseType().then(response => {
|
||||
this.driverLicenseTypeOptions = response.data;
|
||||
});
|
||||
},
|
||||
// 筛选节点
|
||||
filterNode(value, data) {
|
||||
if (!value) return true;
|
||||
return data.name.indexOf(value) !== -1;
|
||||
},
|
||||
// 节点单击事件
|
||||
handleNodeClick(data) {
|
||||
this.queryParams.postId = data.id;
|
||||
this.getList();
|
||||
},
|
||||
// 员工状态修改
|
||||
handleStatusChange(row) {
|
||||
let text = row.status === CommonStatusEnum.ENABLE ? "启用" : "停用";
|
||||
this.$modal.confirm('确认要"' + text + '""' + row.username + '"员工吗?').then(function () {
|
||||
return changeUserStatus(row.id, row.status);
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess(text + "成功");
|
||||
}).catch(function () {
|
||||
row.status = row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE
|
||||
: CommonStatusEnum.ENABLE;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 取消按钮(角色权限)
|
||||
cancelRole() {
|
||||
this.openRole = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: undefined,
|
||||
postId: undefined,
|
||||
username: undefined,
|
||||
nickname: undefined,
|
||||
password: undefined,
|
||||
mobile: undefined,
|
||||
email: undefined,
|
||||
sex: undefined,
|
||||
status: "0",
|
||||
remark: undefined,
|
||||
postIds: [],
|
||||
roleIds: []
|
||||
};
|
||||
this.fileList = [];
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.isInsert = true;
|
||||
// 获得下拉数据
|
||||
this.getPostsByDeptId();
|
||||
// 打开表单,并设置初始化
|
||||
this.open = true;
|
||||
this.title = "添加员工";
|
||||
this.form.password = this.initPassword;
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
this.getPostsByDeptId();
|
||||
const id = row.id;
|
||||
this.isInsert = false;
|
||||
getUser(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.fileList = this.form.fileList == null ? [] : this.form.fileList;
|
||||
this.open = true;
|
||||
this.title = "修改员工";
|
||||
});
|
||||
},
|
||||
/** 重置密码按钮操作 */
|
||||
handleResetPwd(row) {
|
||||
this.$prompt('请输入"' + row.username + '"的新密码', "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消"
|
||||
}).then(({value}) => {
|
||||
resetUserPwd(row.id, value).then(response => {
|
||||
this.$modal.msgSuccess("修改成功,新密码是:" + value);
|
||||
});
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
/** 获取检测岗位集合 */
|
||||
getPostsByDeptId() {
|
||||
getPost().then(response => {
|
||||
this.postOptions = response.data;
|
||||
// this.form.postId = this.postOptions[0].id
|
||||
});
|
||||
},
|
||||
/** 分配员工角色操作 */
|
||||
handleRole(row) {
|
||||
this.reset();
|
||||
const id = row.id
|
||||
// 处理了 form 的员工 username 和 nickname 的展示
|
||||
this.form.id = id;
|
||||
this.form.username = row.username;
|
||||
this.form.nickname = row.nickname;
|
||||
// 打开弹窗
|
||||
this.openRole = true;
|
||||
// 获得角色列表
|
||||
listSimpleRoles().then(response => {
|
||||
// 处理 roleOptions 参数
|
||||
this.roleOptions = [];
|
||||
this.roleOptions.push(...response.data);
|
||||
});
|
||||
// 获得角色拥有的菜单集合
|
||||
listUserRoles(id).then(response => {
|
||||
// 设置选中
|
||||
this.form.roleIds = response.data;
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function () {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.form.fileList = this.fileList
|
||||
if (this.form.id !== undefined) {
|
||||
this.form.userId = this.form.id;
|
||||
console.log(this.form)
|
||||
updateUser(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
let data = {
|
||||
userId: this.form.userId,
|
||||
roleIds: this.form.roleIds
|
||||
}
|
||||
permissionAssign(data)
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
this.form.username = this.form.mobile
|
||||
this.form.password = '123456'
|
||||
addUser(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
let data = {
|
||||
userId: response.data,
|
||||
roleIds: this.form.roleIds
|
||||
}
|
||||
permissionAssign(data)
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 提交按钮(角色权限) */
|
||||
submitRole: function () {
|
||||
if (this.form.id !== undefined) {
|
||||
assignUserRole({
|
||||
userId: this.form.id,
|
||||
roleIds: this.form.roleIds,
|
||||
}).then(response => {
|
||||
this.$modal.msgSuccess("分配角色成功");
|
||||
this.openRole = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除员工编号为"' + ids + '"的数据项?').then(function () {
|
||||
return delUser(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.$modal.confirm('是否确认导出所有员工数据项?').then(() => {
|
||||
// 处理查询参数
|
||||
let params = {...this.queryParams};
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.exportLoading = true;
|
||||
return exportUser(params);
|
||||
}).then(response => {
|
||||
this.$download.excel(response, '员工数据.xls');
|
||||
}).finally(() => {
|
||||
this.exportLoading = false;
|
||||
});
|
||||
},
|
||||
/** 导入按钮操作 */
|
||||
handleImport() {
|
||||
this.upload.title = "员工导入";
|
||||
this.upload.open = true;
|
||||
},
|
||||
/** 下载模板操作 */
|
||||
importTemplate() {
|
||||
importTemplate().then(response => {
|
||||
this.$download.excel(response, '员工导入模板.xls');
|
||||
});
|
||||
},
|
||||
// 文件上传中处理
|
||||
handleFileUploadProgress(event, file, fileList) {
|
||||
this.upload.isUploading = true;
|
||||
},
|
||||
// 文件上传成功处理
|
||||
handleFileSuccess(response, file, fileList) {
|
||||
if (response.code !== 0) {
|
||||
this.$modal.msgError(response.msg)
|
||||
return;
|
||||
}
|
||||
// this.upload.open = false;
|
||||
this.upload.isUploading = false;
|
||||
this.$refs.upload.clearFiles();
|
||||
if (response.data.failList.length > 0) {
|
||||
this.isFail = true
|
||||
console.log('执行了吗')
|
||||
this.$set(this, 'failList', response.data.failList); // 确保响应式
|
||||
console.log(this.failList)
|
||||
}
|
||||
this.getList();
|
||||
},
|
||||
// 提交上传文件
|
||||
submitFileForm() {
|
||||
this.$refs.upload.submit();
|
||||
this.failList = []
|
||||
this.isFail = false
|
||||
console.log('执行')
|
||||
},
|
||||
handleRemove(file) {
|
||||
console.log(file);
|
||||
//在fileList中删除附件
|
||||
this.fileList.splice(this.fileList.indexOf(file), 1);
|
||||
},
|
||||
handlePreview(file) {
|
||||
console.log(file);
|
||||
},
|
||||
handleExceed(files, fileList) {
|
||||
this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
|
||||
},
|
||||
beforeRemove(file, fileList) {
|
||||
return this.$confirm(`确定移除 ${file.name}?`);
|
||||
},
|
||||
// 文件上传成功处理
|
||||
handleFileSuccessAttachments(response, file, fileList) {
|
||||
if (response.code !== 0) {
|
||||
this.$modal.msgError(response.msg)
|
||||
return;
|
||||
}
|
||||
console.log(response)
|
||||
this.fileList.push(response.data)
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
100
src/views/inspection/staff/profile/index.vue
Normal file
100
src/views/inspection/staff/profile/index.vue
Normal file
@ -0,0 +1,100 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6" :xs="24">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>个人信息</span>
|
||||
</div>
|
||||
<div>
|
||||
<div class="text-center">
|
||||
<userAvatar :user="user" />
|
||||
</div>
|
||||
<ul class="list-group list-group-striped">
|
||||
<li class="list-group-item">
|
||||
<svg-icon icon-class="user" />用户名称
|
||||
<div class="pull-right">{{ user.username }}</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<svg-icon icon-class="phone" />手机号码
|
||||
<div class="pull-right">{{ user.mobile }}</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<svg-icon icon-class="email" />用户邮箱
|
||||
<div class="pull-right">{{ user.email }}</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<svg-icon icon-class="tree" />所属部门
|
||||
<div class="pull-right" v-if="user.dept">{{ user.dept.name }}</div>
|
||||
</li>
|
||||
<!-- <li class="list-group-item">-->
|
||||
<!-- <svg-icon icon-class="tree" />所属岗位-->
|
||||
<!-- <div class="pull-right" v-if="user.posts">{{ user.posts.map(post => post.name).join(',') }}</div>-->
|
||||
<!-- </li>-->
|
||||
<li class="list-group-item">
|
||||
<svg-icon icon-class="peoples" />所属角色
|
||||
<div class="pull-right" v-if="user.roles">{{ user.roles.map(role => role.name).join(',') }}</div>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<svg-icon icon-class="date" />创建日期
|
||||
<div class="pull-right">{{ parseTime(user.createTime) }}</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="18" :xs="24">
|
||||
<el-card>
|
||||
<div slot="header" class="clearfix">
|
||||
<span>基本资料</span>
|
||||
</div>
|
||||
<el-tabs v-model="activeTab">
|
||||
<el-tab-pane label="基本资料" name="userinfo">
|
||||
<userInfo :user="user" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="修改密码" name="resetPwd">
|
||||
<resetPwd :user="user" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="社交信息" name="userSocial">
|
||||
<userSocial :user="user" :getUser="getUser" :setActiveTab="setActiveTab" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import userAvatar from "./userAvatar";
|
||||
import userInfo from "./userInfo";
|
||||
import resetPwd from "./resetPwd";
|
||||
import userSocial from "./userSocial";
|
||||
import { getUserProfile } from "@/api/system/user";
|
||||
|
||||
export default {
|
||||
name: "Profile",
|
||||
components: { userAvatar, userInfo, resetPwd, userSocial },
|
||||
data() {
|
||||
return {
|
||||
user: {},
|
||||
roleGroup: {},
|
||||
postGroup: {},
|
||||
activeTab: "userinfo"
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getUser();
|
||||
},
|
||||
methods: {
|
||||
getUser() {
|
||||
getUserProfile().then(response => {
|
||||
this.user = response.data;
|
||||
});
|
||||
},
|
||||
setActiveTab(activeTab) {
|
||||
this.activeTab = activeTab
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
71
src/views/inspection/staff/profile/resetPwd.vue
Normal file
71
src/views/inspection/staff/profile/resetPwd.vue
Normal file
@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<el-form ref="form" :model="user" :rules="rules" label-width="80px">
|
||||
<el-form-item label="旧密码" prop="oldPassword">
|
||||
<el-input v-model="user.oldPassword" placeholder="请输入旧密码" type="password" show-password />
|
||||
</el-form-item>
|
||||
<el-form-item label="新密码" prop="newPassword">
|
||||
<el-input v-model="user.newPassword" placeholder="请输入新密码" type="password" show-password />
|
||||
</el-form-item>
|
||||
<el-form-item label="确认密码" prop="confirmPassword">
|
||||
<el-input v-model="user.confirmPassword" placeholder="请确认密码" type="password" show-password />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" size="mini" @click="submit">保存</el-button>
|
||||
<el-button type="danger" size="mini" @click="close">关闭</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { updateUserPwd } from "@/api/system/user";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
const equalToPassword = (rule, value, callback) => {
|
||||
if (this.user.newPassword !== value) {
|
||||
callback(new Error("两次输入的密码不一致"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
test: "1test",
|
||||
user: {
|
||||
oldPassword: undefined,
|
||||
newPassword: undefined,
|
||||
confirmPassword: undefined
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
oldPassword: [
|
||||
{ required: true, message: "旧密码不能为空", trigger: "blur" }
|
||||
],
|
||||
newPassword: [
|
||||
{ required: true, message: "新密码不能为空", trigger: "blur" },
|
||||
{ min: 6, max: 20, message: "长度在 6 到 20 个字符", trigger: "blur" }
|
||||
],
|
||||
confirmPassword: [
|
||||
{ required: true, message: "确认密码不能为空", trigger: "blur" },
|
||||
{ required: true, validator: equalToPassword, trigger: "blur" }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
updateUserPwd(this.user.oldPassword, this.user.newPassword).then(
|
||||
response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
close() {
|
||||
this.$tab.closePage();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
171
src/views/inspection/staff/profile/userAvatar.vue
Normal file
171
src/views/inspection/staff/profile/userAvatar.vue
Normal file
@ -0,0 +1,171 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="user-info-head" @click="editCropper()"><img v-bind:src="options.img" title="点击上传头像" class="img-circle img-lg" /></div>
|
||||
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body @opened="modalOpened" @close="closeDialog()">
|
||||
<el-row>
|
||||
<el-col :xs="24" :md="12" :style="{height: '350px'}">
|
||||
<vue-cropper
|
||||
ref="cropper"
|
||||
:img="options.img"
|
||||
:info="true"
|
||||
:autoCrop="options.autoCrop"
|
||||
:autoCropWidth="options.autoCropWidth"
|
||||
:autoCropHeight="options.autoCropHeight"
|
||||
:fixedBox="options.fixedBox"
|
||||
@realTime="realTime"
|
||||
v-if="visible"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :xs="24" :md="12" :style="{height: '350px'}">
|
||||
<div class="avatar-upload-preview">
|
||||
<img :src="previews.url" :style="previews.img" />
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<br />
|
||||
<el-row>
|
||||
<el-col :lg="2" :md="2">
|
||||
<el-upload action="#" :http-request="requestUpload" :show-file-list="false" :before-upload="beforeUpload">
|
||||
<el-button size="small">
|
||||
选择
|
||||
<i class="el-icon-upload el-icon--right"></i>
|
||||
</el-button>
|
||||
</el-upload>
|
||||
</el-col>
|
||||
<el-col :lg="{span: 1, offset: 2}" :md="2">
|
||||
<el-button icon="el-icon-plus" size="small" @click="changeScale(1)"></el-button>
|
||||
</el-col>
|
||||
<el-col :lg="{span: 1, offset: 1}" :md="2">
|
||||
<el-button icon="el-icon-minus" size="small" @click="changeScale(-1)"></el-button>
|
||||
</el-col>
|
||||
<el-col :lg="{span: 1, offset: 1}" :md="2">
|
||||
<el-button icon="el-icon-refresh-left" size="small" @click="rotateLeft()"></el-button>
|
||||
</el-col>
|
||||
<el-col :lg="{span: 1, offset: 1}" :md="2">
|
||||
<el-button icon="el-icon-refresh-right" size="small" @click="rotateRight()"></el-button>
|
||||
</el-col>
|
||||
<el-col :lg="{span: 2, offset: 6}" :md="2">
|
||||
<el-button type="primary" size="small" @click="uploadImg()">提 交</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import store from "@/store";
|
||||
import { VueCropper } from "vue-cropper";
|
||||
import { uploadAvatar } from "@/api/system/user";
|
||||
|
||||
export default {
|
||||
components: { VueCropper },
|
||||
props: {
|
||||
user: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 是否显示cropper
|
||||
visible: false,
|
||||
// 弹出层标题
|
||||
title: "修改头像",
|
||||
options: {
|
||||
img: store.getters.avatar, //裁剪图片的地址
|
||||
autoCrop: true, // 是否默认生成截图框
|
||||
autoCropWidth: 200, // 默认生成截图框宽度
|
||||
autoCropHeight: 200, // 默认生成截图框高度
|
||||
fixedBox: true // 固定截图框大小 不允许改变
|
||||
},
|
||||
previews: {}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 编辑头像
|
||||
editCropper() {
|
||||
this.open = true;
|
||||
},
|
||||
// 打开弹出层结束时的回调
|
||||
modalOpened() {
|
||||
this.visible = true;
|
||||
},
|
||||
// 覆盖默认的上传行为
|
||||
requestUpload() {
|
||||
},
|
||||
// 向左旋转
|
||||
rotateLeft() {
|
||||
this.$refs.cropper.rotateLeft();
|
||||
},
|
||||
// 向右旋转
|
||||
rotateRight() {
|
||||
this.$refs.cropper.rotateRight();
|
||||
},
|
||||
// 图片缩放
|
||||
changeScale(num) {
|
||||
num = num || 1;
|
||||
this.$refs.cropper.changeScale(num);
|
||||
},
|
||||
// 上传预处理
|
||||
beforeUpload(file) {
|
||||
if (file.type.indexOf("image/") === -1) {
|
||||
this.$modal.msgError("文件格式错误,请上传图片类型,如:JPG,PNG后缀的文件。");
|
||||
} else {
|
||||
const reader = new FileReader();
|
||||
reader.readAsDataURL(file);
|
||||
reader.onload = () => {
|
||||
this.options.img = reader.result;
|
||||
};
|
||||
}
|
||||
},
|
||||
// 上传图片
|
||||
uploadImg() {
|
||||
this.$refs.cropper.getCropBlob(data => {
|
||||
let formData = new FormData();
|
||||
formData.append("avatarFile", data);
|
||||
uploadAvatar(formData).then(resp => {
|
||||
this.open = false;
|
||||
// this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;
|
||||
store.commit('SET_AVATAR', resp.data);
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.visible = false;
|
||||
});
|
||||
});
|
||||
},
|
||||
// 实时预览
|
||||
realTime(data) {
|
||||
this.previews = data;
|
||||
},
|
||||
// 取消截图,关闭对话框
|
||||
closeDialog() {
|
||||
this.options.img = store.getters.avatar
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.user-info-head {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
height: 120px;
|
||||
}
|
||||
|
||||
.user-info-head:hover:after {
|
||||
content: '+';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
color: #eee;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
font-size: 24px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
cursor: pointer;
|
||||
line-height: 110px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
</style>
|
||||
75
src/views/inspection/staff/profile/userInfo.vue
Normal file
75
src/views/inspection/staff/profile/userInfo.vue
Normal file
@ -0,0 +1,75 @@
|
||||
<template>
|
||||
<el-form ref="form" :model="user" :rules="rules" label-width="80px">
|
||||
<el-form-item label="用户昵称" prop="nickName">
|
||||
<el-input v-model="user.nickname" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号码" prop="mobile">
|
||||
<el-input v-model="user.mobile" maxlength="11" />
|
||||
</el-form-item>
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input v-model="user.email" maxlength="50" />
|
||||
</el-form-item>
|
||||
<el-form-item label="性别">
|
||||
<el-radio-group v-model="user.sex">
|
||||
<el-radio :label="1">男</el-radio>
|
||||
<el-radio :label="2">女</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" size="mini" @click="submit">保存</el-button>
|
||||
<el-button type="danger" size="mini" @click="close">关闭</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { updateUserProfile } from "@/api/system/user";
|
||||
|
||||
export default {
|
||||
props: {
|
||||
user: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 表单校验
|
||||
rules: {
|
||||
nickname: [
|
||||
{ required: true, message: "用户昵称不能为空", trigger: "blur" }
|
||||
],
|
||||
email: [
|
||||
{ required: true, message: "邮箱地址不能为空", trigger: "blur" },
|
||||
{
|
||||
type: "email",
|
||||
message: "请输入正确的邮箱地址",
|
||||
trigger: ["blur", "change"]
|
||||
}
|
||||
],
|
||||
mobile: [
|
||||
{ required: true, message: "手机号码不能为空", trigger: "blur" },
|
||||
{
|
||||
pattern: /^1[3|456789][0-9]\d{8}$/,
|
||||
message: "请输入正确的手机号码",
|
||||
trigger: "blur"
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
updateUserProfile(this.user).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
close() {
|
||||
this.$tab.closePage();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
100
src/views/inspection/staff/profile/userSocial.vue
Normal file
100
src/views/inspection/staff/profile/userSocial.vue
Normal file
@ -0,0 +1,100 @@
|
||||
<template>
|
||||
<el-table :data="socialUsers" :show-header="false">
|
||||
<el-table-column label="社交平台" align="left" width="120">
|
||||
<template v-slot="scope">
|
||||
<img style="height:20px;vertical-align: middle;" :src="scope.row.img" /> {{ scope.row.title }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="left" >
|
||||
<template v-slot="scope">
|
||||
<div v-if="scope.row.openid">
|
||||
已绑定
|
||||
<el-button size="large" type="text" @click="unbind(scope.row)">(解绑)</el-button>
|
||||
</div>
|
||||
<div v-else>
|
||||
未绑定
|
||||
<el-button size="large" type="text" @click="bind(scope.row)">(绑定)</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {SystemUserSocialTypeEnum} from "@/utils/constants";
|
||||
import {socialAuthRedirect} from "@/api/login";
|
||||
import {socialBind, socialUnbind} from "@/api/system/socialUser";
|
||||
|
||||
export default {
|
||||
props: {
|
||||
user: {
|
||||
type: Object
|
||||
},
|
||||
getUser: { // 刷新用户
|
||||
type: Function
|
||||
},
|
||||
setActiveTab: { // 设置激活的
|
||||
type: Function
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
socialUsers (){
|
||||
const socialUsers = [];
|
||||
for (const i in SystemUserSocialTypeEnum) {
|
||||
const socialUser = {...SystemUserSocialTypeEnum[i]};
|
||||
socialUsers.push(socialUser);
|
||||
if (this.user.socialUsers) {
|
||||
for (const j in this.user.socialUsers) {
|
||||
if (socialUser.type === this.user.socialUsers[j].type) {
|
||||
socialUser.openid = this.user.socialUsers[j].openid;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return socialUsers;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 社交绑定
|
||||
const type = this.$route.query.type;
|
||||
const code = this.$route.query.code;
|
||||
const state = this.$route.query.state;
|
||||
if (!code) {
|
||||
return;
|
||||
}
|
||||
socialBind(type, code, state).then(resp => {
|
||||
this.$modal.msgSuccess("绑定成功");
|
||||
this.$router.replace('/user/profile');
|
||||
// 调用父组件, 刷新
|
||||
this.getUser();
|
||||
this.setActiveTab('userSocial');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
bind(socialUser) {
|
||||
// 计算 redirectUri
|
||||
const redirectUri = location.origin + '/user/profile?type=' + socialUser.type;
|
||||
// 进行跳转
|
||||
socialAuthRedirect(socialUser.type, encodeURIComponent(redirectUri)).then((res) => {
|
||||
// console.log(res.url);
|
||||
window.location.href = res.data;
|
||||
});
|
||||
},
|
||||
unbind(socialUser) {
|
||||
socialUnbind(socialUser.type, socialUser.openid).then(resp => {
|
||||
this.$modal.msgSuccess("解绑成功");
|
||||
socialUser.openid = undefined;
|
||||
});
|
||||
},
|
||||
close() {
|
||||
this.$tab.closePage();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
173
src/views/inspection/workReport/ReportForm.vue
Normal file
173
src/views/inspection/workReport/ReportForm.vue
Normal file
@ -0,0 +1,173 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="45%" v-dialogDrag append-to-body>
|
||||
<el-form ref="formRef" :model="formData" :rules="formRules" v-loading="formLoading" label-width="100px">
|
||||
<el-form-item label="汇报主题" prop="reportTopic">
|
||||
<el-input v-model="formData.reportTopic" placeholder="请输入汇报主题"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="汇报时间" prop="reportTime">
|
||||
<el-date-picker
|
||||
v-model="formData.reportTime"
|
||||
type="datetime"
|
||||
placeholder="选择日期时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="汇报给" prop="reportTos">
|
||||
<el-select v-model="formData.reportTos" multiple placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in reportTo"
|
||||
:key="item.id"
|
||||
:label="item.nickname"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="汇报内容" prop="reportContent">
|
||||
<el-input type="textarea" v-model="formData.reportContent" :autosize="{ minRows: 6, maxRows: 10 }"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="汇报附件" prop="reportFiles">
|
||||
<insp-file-upload
|
||||
:fileSize="30"
|
||||
:fileType="['doc', 'xls', 'ppt', 'txt', 'pdf','png','jpg','jpeg','gif','docx','xlsx','pptx','wps']"
|
||||
v-model="formData.filePath"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as ReportApi from '@/views/inspection/workReport/api/index';
|
||||
import Editor from '@/components/Editor';
|
||||
import {getReportTo} from "@/views/inspection/workReport/api/index";
|
||||
import {formatDate} from "@/utils";
|
||||
import inspFileUpload from "@/components/FileUpload/index.vue";
|
||||
|
||||
export default {
|
||||
name: "ReportForm",
|
||||
components: {
|
||||
inspFileUpload,
|
||||
Editor,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 弹出层标题
|
||||
dialogTitle: "",
|
||||
// 是否显示弹出层
|
||||
dialogVisible: false,
|
||||
// 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
formLoading: false,
|
||||
// 汇报对象
|
||||
reportTo: [],
|
||||
// 表单参数
|
||||
formData: {
|
||||
id: undefined,
|
||||
reportTopic: undefined,
|
||||
reportTime: undefined,
|
||||
reportContent: undefined,
|
||||
servicePackageId: undefined,
|
||||
reportTos: [],
|
||||
},
|
||||
// 表单校验
|
||||
formRules: {
|
||||
reportTopic: [{required: true, message: '汇报主题不能为空', trigger: 'blur'}],
|
||||
reportTime: [{required: true, message: '汇报时间不能为空', trigger: 'blur'}],
|
||||
reportContent: [{required: true, message: '汇报内容不能为空', trigger: 'blur'}],
|
||||
reportTos: [{required: true, message: '汇报给不能为空', trigger: 'blur'}],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
/** 打开弹窗 */
|
||||
async open(id) {
|
||||
this.dialogVisible = true;
|
||||
this.reset();
|
||||
this.getReportTo()
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
this.formLoading = true;
|
||||
try {
|
||||
const res = await ReportApi.getReport(id);
|
||||
this.formData = res.data;
|
||||
this.dialogTitle = "修改工作汇报";
|
||||
//将字符串转为数组
|
||||
if (this.formData.filePath !== undefined && this.formData.filePath !== null && this.formData.filePath !== "") {
|
||||
this.formData.filePath = this.formData.filePath.split(",");
|
||||
}
|
||||
} finally {
|
||||
this.formLoading = false;
|
||||
}
|
||||
} else {
|
||||
this.setDefaultData();
|
||||
this.dialogTitle = "新增工作汇报";
|
||||
}
|
||||
},
|
||||
/** 提交按钮 */
|
||||
async submitForm() {
|
||||
// 校验主表
|
||||
await this.$refs["formRef"].validate();
|
||||
this.formLoading = true;
|
||||
try {
|
||||
const data = this.formData;
|
||||
// 修改的提交
|
||||
if (data.id) {
|
||||
await ReportApi.updateReport(data);
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.dialogVisible = false;
|
||||
this.$emit('success');
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
data.reportTime = this.formData.reportTime.getTime();
|
||||
await ReportApi.createReport(data);
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.dialogVisible = false;
|
||||
this.$emit('success');
|
||||
} finally {
|
||||
this.formLoading = false;
|
||||
}
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.formData = {
|
||||
id: undefined,
|
||||
reportTopic: undefined,
|
||||
reportTime: undefined,
|
||||
reportContent: undefined,
|
||||
};
|
||||
this.resetForm("formRef");
|
||||
},
|
||||
/** 设置默认数据 */
|
||||
setDefaultData() {
|
||||
this.formData.reportTime = new Date();
|
||||
this.formData.servicePackageId = "jiance";
|
||||
},
|
||||
/** 获取汇报对象 */
|
||||
getReportTo() {
|
||||
const data = {
|
||||
dictType: "ins_report_role"
|
||||
}
|
||||
getReportTo(data).then(response => {
|
||||
this.reportTo = response.data;
|
||||
});
|
||||
},
|
||||
/** 格式化时间(yyyy-MM-dd HH:mm:ss) */
|
||||
formatDateTime(date) {
|
||||
if (!date) return null;
|
||||
const d = new Date(date);
|
||||
const year = d.getFullYear();
|
||||
const month = String(d.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(d.getDate()).padStart(2, '0');
|
||||
const hours = String(d.getHours()).padStart(2, '0');
|
||||
const minutes = String(d.getMinutes()).padStart(2, '0');
|
||||
const seconds = String(d.getSeconds()).padStart(2, '0');
|
||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
69
src/views/inspection/workReport/api/index.js
Normal file
69
src/views/inspection/workReport/api/index.js
Normal file
@ -0,0 +1,69 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建工作汇报
|
||||
export function getReportTo(query) {
|
||||
return request({
|
||||
url: '/work/report/queryReportTo',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 创建工作汇报
|
||||
export function createReport(data) {
|
||||
return request({
|
||||
url: '/work/report/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新工作汇报
|
||||
export function updateReport(data) {
|
||||
return request({
|
||||
url: '/work/report/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除工作汇报
|
||||
export function deleteReport(id) {
|
||||
return request({
|
||||
url: '/work/report/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得工作汇报
|
||||
export function getReport(id) {
|
||||
return request({
|
||||
url: '/work/report/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得工作汇报分页
|
||||
export function getReportPage(params) {
|
||||
return request({
|
||||
url: '/work/report/page',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
// 获得工作汇报分页
|
||||
export function workReportView(id) {
|
||||
return request({
|
||||
url: '/work/report/workReportView?id=' + id,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
// 导出工作汇报 Excel
|
||||
export function exportReportExcel(params) {
|
||||
return request({
|
||||
url: '/work/report/export-excel',
|
||||
method: 'get',
|
||||
params,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
180
src/views/inspection/workReport/index.vue
Normal file
180
src/views/inspection/workReport/index.vue
Normal file
@ -0,0 +1,180 @@
|
||||
<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="reportTopic">
|
||||
<el-input v-model="queryParams.reportTopic" placeholder="请输入汇报主题" clearable
|
||||
@keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="汇报时间" prop="reportTime">
|
||||
<el-date-picker v-model="queryParams.reportTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
type="daterange"
|
||||
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="汇报人" prop="userId">
|
||||
<el-input v-model="queryParams.userName" placeholder="请输入汇报人" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @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-plus" size="mini" @click="openForm(undefined)">新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
||||
:loading="exportLoading">导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="汇报主题" align="center" prop="reportTopic"/>
|
||||
<el-table-column label="汇报时间" align="center" prop="reportTime" width="180">
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.reportTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="汇报内容" align="center" prop="reportContent" show-overflow-tooltip/>
|
||||
<el-table-column label="汇报人" align="center" prop="userName"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="workReportView(scope.row.id)">打印
|
||||
</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.id)">修改
|
||||
</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-dialog :visible.sync="showView" width="50%" center>
|
||||
<div v-html="htmText" id="printMe"></div>
|
||||
<el-button type="primary" style="margin-left: 90%;margin-top:20px " v-print="'#printMe'" size="small">打印
|
||||
</el-button>
|
||||
</el-dialog>
|
||||
<!-- 分页组件 -->
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"/>
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<ReportForm ref="formRef" @success="getList"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as ReportApi from '@/views/inspection/workReport/api/index';
|
||||
import ReportForm from './ReportForm.vue';
|
||||
import print from 'vue-print-nb'
|
||||
import {workReportView} from "@/views/inspection/workReport/api/index";
|
||||
|
||||
export default {
|
||||
name: "Report",
|
||||
directives: {
|
||||
print
|
||||
},
|
||||
components: {
|
||||
ReportForm,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
showView:false,
|
||||
// 导出遮罩层
|
||||
exportLoading: false,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
htmText:'',
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 工作汇报列表
|
||||
list: [],
|
||||
// 是否展开,默认全部展开
|
||||
isExpandAll: true,
|
||||
// 重新渲染表格状态
|
||||
refreshTable: true,
|
||||
// 选中行
|
||||
currentRow: {},
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
reportTopic: null,
|
||||
reportTime: [],
|
||||
createTime: [],
|
||||
userId: null,
|
||||
userName: null,
|
||||
servicePackageId: "jiance",
|
||||
dictType:'ins_high_rise',
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询列表 */
|
||||
async getList() {
|
||||
try {
|
||||
this.loading = true;
|
||||
const res = await ReportApi.getReportPage(this.queryParams);
|
||||
this.list = res.data.records;
|
||||
this.total = res.data.total;
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 添加/修改操作 */
|
||||
openForm(id) {
|
||||
this.$refs["formRef"].open(id);
|
||||
},
|
||||
workReportView(id){
|
||||
this.showView = true
|
||||
ReportApi.workReportView(id).then(res => {
|
||||
this.htmText = res.data
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
async handleDelete(row) {
|
||||
const id = row.id;
|
||||
await this.$modal.confirm('是否确认删除工作汇报编号为"' + id + '"的数据项?')
|
||||
try {
|
||||
await ReportApi.deleteReport(id);
|
||||
await this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
} catch {
|
||||
}
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
async handleExport() {
|
||||
await this.$modal.confirm('是否确认导出所有工作汇报数据项?');
|
||||
try {
|
||||
this.exportLoading = true;
|
||||
const data = await ReportApi.exportReportExcel(this.queryParams);
|
||||
this.$download.excel(data, '工作汇报.xls');
|
||||
} catch {
|
||||
} finally {
|
||||
this.exportLoading = false;
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@ -34,6 +34,14 @@ export function updateEquInfo(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 修改equInfo
|
||||
export function importTemplate() {
|
||||
return request({
|
||||
url: '/system/equInfo/importTemplate',
|
||||
method: 'post',
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 删除equInfo
|
||||
export function delEquInfo(id) {
|
||||
@ -42,3 +50,11 @@ export function delEquInfo(id) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
// 删除equInfo
|
||||
export function addFolder(data) {
|
||||
return request({
|
||||
url: '/system/equInfo/addFolder',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
@ -8,6 +8,38 @@ export function listInspectionFile(query) {
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 查询inspectionFile列表(权限)
|
||||
export function listByPermission(query) {
|
||||
return request({
|
||||
url: '/inspectionFile/inspectionFile/listByPermission',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 根据文件id获取有权限的用户id
|
||||
export function getUserIdsByFileId(query) {
|
||||
return request({
|
||||
url: '/inspectionFile/inspectionFile/getUserIdsByFileId',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 给文件分配权限
|
||||
export function assignAuthority(data) {
|
||||
return request({
|
||||
url: '/inspectionFile/inspectionFile/assignAuthority',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function listStaff(query) {
|
||||
return request({
|
||||
url: '/inspectionStaff/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询inspectionFile详细
|
||||
export function getInspectionFile(id) {
|
||||
@ -16,6 +48,13 @@ export function getInspectionFile(id) {
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 查询inspectionFile修改记录
|
||||
export function getFileRecord(id) {
|
||||
return request({
|
||||
url: '/system/fileRecord/get/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增inspectionFile
|
||||
export function addInspectionFile(data) {
|
||||
|
||||
@ -27,7 +27,8 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="设备类型" prop="type">
|
||||
<el-select v-model="queryParams.type">
|
||||
<el-option v-for="item in this.getDictDatas(DICT_TYPE.INS_EQU_TYPE)" :key="item.value" :value="item.value" :label="item.label"/>
|
||||
<el-option v-for="item in this.getDictDatas(DICT_TYPE.INS_EQU_TYPE)" :key="item.value" :value="item.value"
|
||||
:label="item.label"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="检定时间">
|
||||
@ -56,71 +57,61 @@
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
|
||||
>新增</el-button>
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" icon="el-icon-upload2" size="mini" @click="handleImport"
|
||||
v-hasPermi="['system:user:import']">导入
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="success"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-edit"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="single"-->
|
||||
<!-- @click="handleUpdate"-->
|
||||
<!-- v-hasPermi="['system:equInfo:edit']"-->
|
||||
<!-- >修改</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="danger"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="multiple"-->
|
||||
<!-- @click="handleDelete"-->
|
||||
<!-- v-hasPermi="['system:equInfo:remove']"-->
|
||||
<!-- >删除</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="warning"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-download"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="handleExport"-->
|
||||
<!-- v-hasPermi="['system:equInfo:export']"-->
|
||||
<!-- >导出</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="equInfoList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<!-- 1-->
|
||||
<el-table-column label="设备名称" align="center" prop="equName" />
|
||||
<el-table-column label="设备型号" align="center" prop="equModel" />
|
||||
<el-table-column label="设备编号" align="center" prop="equNumber" />
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<!-- 1-->
|
||||
<el-table-column label="设备名称" align="center" prop="equName"/>
|
||||
<el-table-column label="设备型号" align="center" prop="equModel"/>
|
||||
<el-table-column label="设备编号" align="center" prop="equNumber"/>
|
||||
<el-table-column label="设备类别" align="center" prop="type">
|
||||
<template slot-scope="scope">
|
||||
<DictTag :type="DICT_TYPE.INS_EQU_TYPE" :value="scope.row.type" />
|
||||
<DictTag :type="DICT_TYPE.INS_EQU_TYPE" :value="scope.row.type"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备检定周期" align="center" prop="equZq" />
|
||||
<el-table-column label="校准日期" align="center" prop="equZq"/>
|
||||
<el-table-column label="有效期" align="center" prop="validTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.validTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="上次检定单位" align="center" prop="lastUnit" />
|
||||
<el-table-column label="下次检定时间" align="center" prop="nextCheckTime" width="180">
|
||||
<el-table-column label="校准单位" align="center" prop="lastUnit"/>
|
||||
<el-table-column label="证书编号" align="center" prop="certificateNumber"/>
|
||||
<el-table-column label="制造商" align="center" prop="manufacturer"/>
|
||||
<el-table-column label="电话" align="center" prop="mobile"/>
|
||||
<el-table-column label="邮编" align="center" prop="postcode"/>
|
||||
<el-table-column label="地址" align="center" prop="address"/>
|
||||
<el-table-column label="邮箱" align="center" prop="email"/>
|
||||
<el-table-column label="复校日期" align="center" prop="nextCheckTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.nextCheckTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="" align="center" prop="createTime" width="180">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <el-table-column label="" align="center" prop="createTime" width="180">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
@ -129,14 +120,16 @@
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
|
||||
>修改</el-button>
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
|
||||
>删除</el-button>
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -153,21 +146,22 @@
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="设备名称" prop="equName">
|
||||
<el-input v-model="form.equName" placeholder="请输入设备名称" />
|
||||
<el-input v-model="form.equName" placeholder="请输入设备名称"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备型号" prop="equModel">
|
||||
<el-input v-model="form.equModel" placeholder="请输入设备型号" />
|
||||
<el-input v-model="form.equModel" placeholder="请输入设备型号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备编号" prop="equNumber">
|
||||
<el-input v-model="form.equNumber" placeholder="请输入设备编号" />
|
||||
<el-input v-model="form.equNumber" placeholder="请输入设备编号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备类型" prop="type">
|
||||
<el-select v-model="form.type" placeholder="请选择类别">
|
||||
<el-option v-for="item in this.getDictDatas(DICT_TYPE.INS_EQU_TYPE)" :key="item.value" :value="item.value" :label="item.label" />
|
||||
<el-option v-for="item in this.getDictDatas(DICT_TYPE.INS_EQU_TYPE)" :key="item.value" :value="item.value"
|
||||
:label="item.label"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备检定周期" prop="equZq">
|
||||
<el-input v-model="form.equZq" placeholder="请输入设备检定周期" />
|
||||
<el-input v-model="form.equZq" placeholder="请输入设备检定周期"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="有效期" prop="validTime">
|
||||
<el-date-picker clearable
|
||||
@ -178,7 +172,7 @@
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="上次检定单位" prop="lastUnit">
|
||||
<el-input v-model="form.lastUnit" placeholder="请输入上次检定单位" />
|
||||
<el-input v-model="form.lastUnit" placeholder="请输入上次检定单位"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="下次检定时间" prop="nextCheckTime">
|
||||
<el-date-picker clearable
|
||||
@ -188,177 +182,335 @@
|
||||
placeholder="请选择下次检定时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="查看附件" v-if="this.form.id">
|
||||
<div @click="lookFile">点击查看附件</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 设备导入对话框 -->
|
||||
<el-dialog :title="upload.title" :visible.sync="upload.open" append-to-body>
|
||||
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
|
||||
:action="upload.url" :disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div class="el-upload__tip text-center" slot="tip">
|
||||
<div class="el-upload__tip" slot="tip">
|
||||
<el-checkbox v-model="upload.updateSupport"/>
|
||||
是否更新已经存在的设备数据
|
||||
</div>
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
|
||||
@click="importTemplate">下载模板
|
||||
</el-link>
|
||||
</div>
|
||||
</el-upload>
|
||||
<el-table
|
||||
v-if="isFail"
|
||||
:data="failList"
|
||||
stripe
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
prop="equName"
|
||||
label="设备名称"
|
||||
width="180">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="reason"
|
||||
label="失败原因">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="type"
|
||||
label="设备类型">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="equModel"
|
||||
label="型号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="equNumber"
|
||||
label="出厂编号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="validTime"
|
||||
label="校准日期">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="nextCheckTime"
|
||||
label="复校日期">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="certificateNumber"
|
||||
label="证书编号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="manufacturer"
|
||||
label="制造商">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="lastUnit"
|
||||
label="校准单位">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="mobile"
|
||||
label="电话">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="address"
|
||||
label="地址">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="postcode"
|
||||
label="邮编">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="email"
|
||||
label="邮箱">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="upload.open = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listEquInfo, getEquInfo, delEquInfo, addEquInfo, updateEquInfo } from "./api/device";
|
||||
import {DICT_TYPE} from "@/utils/dict";
|
||||
import {listEquInfo, getEquInfo, delEquInfo, addEquInfo, updateEquInfo, importTemplate, addFolder} from "./api/device";
|
||||
import {DICT_TYPE} from "@/utils/dict";
|
||||
import {getBaseHeader} from "@/utils/request";
|
||||
|
||||
export default {
|
||||
name: "EquInfo",
|
||||
computed: {
|
||||
DICT_TYPE() {
|
||||
return DICT_TYPE
|
||||
export default {
|
||||
name: "EquInfo",
|
||||
computed: {
|
||||
DICT_TYPE() {
|
||||
return DICT_TYPE
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isFail:false,
|
||||
failList: [],
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// equInfo表格数据
|
||||
equInfoList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 下次检定时间时间范围
|
||||
daterangeNextCheckTime: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
equName: null,
|
||||
equModel: null,
|
||||
equNumber: null,
|
||||
nextCheckTime: null,
|
||||
type: null
|
||||
},
|
||||
// 设备导入参数
|
||||
upload: {
|
||||
// 是否显示弹出层(设备导入)
|
||||
open: false,
|
||||
// 弹出层标题(设备导入)
|
||||
title: "",
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 是否更新已经存在的设备数据
|
||||
updateSupport: 0,
|
||||
// 设置上传的请求头部
|
||||
headers: getBaseHeader(),
|
||||
// 上传的地址
|
||||
url: process.env.VUE_APP_BASE_API + '/admin-api/system/equInfo/importEquipment'
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {},
|
||||
deviceId:null
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询equInfo列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.queryParams.params = {};
|
||||
if (null != this.daterangeNextCheckTime && '' != this.daterangeNextCheckTime) {
|
||||
this.queryParams.params["beginNextCheckTime"] = this.daterangeNextCheckTime[0];
|
||||
this.queryParams.params["endNextCheckTime"] = this.daterangeNextCheckTime[1];
|
||||
}
|
||||
listEquInfo(this.queryParams).then(response => {
|
||||
this.equInfoList = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
lookFile(){
|
||||
if (!this.form.folderId) {
|
||||
addFolder(this.form.id).then(response => {
|
||||
this.form.folderId = response.data
|
||||
this.$router.push({path: '/jc/shop/partner/file/file', query: {"folderId": this.form.folderId}})
|
||||
})
|
||||
}else {
|
||||
this.$router.push({path: '/jc/shop/partner/file/file', query: {"folderId": this.form.folderId}})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// equInfo表格数据
|
||||
equInfoList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 下次检定时间时间范围
|
||||
daterangeNextCheckTime: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
equName: null,
|
||||
equModel: null,
|
||||
equNumber: null,
|
||||
nextCheckTime: null,
|
||||
type: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
/** 导入按钮操作 */
|
||||
handleImport() {
|
||||
this.upload.title = "设备导入";
|
||||
this.upload.open = true;
|
||||
},
|
||||
created() {
|
||||
// 文件上传中处理
|
||||
handleFileUploadProgress(event, file, fileList) {
|
||||
this.upload.isUploading = true;
|
||||
},
|
||||
// 文件上传成功处理
|
||||
handleFileSuccess(response, file, fileList) {
|
||||
if (response.code !== 0) {
|
||||
this.$modal.msgError(response.msg)
|
||||
return;
|
||||
}
|
||||
// this.upload.open = false;
|
||||
this.upload.isUploading = false;
|
||||
this.$refs.upload.clearFiles();
|
||||
if (response.data.failList.length > 0) {
|
||||
this.isFail = true
|
||||
this.$set(this, 'failList', response.data.failList); // 确保响应式
|
||||
console.log(this.failList)
|
||||
}
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询equInfo列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.queryParams.params = {};
|
||||
if (null != this.daterangeNextCheckTime && '' != this.daterangeNextCheckTime) {
|
||||
this.queryParams.params["beginNextCheckTime"] = this.daterangeNextCheckTime[0];
|
||||
this.queryParams.params["endNextCheckTime"] = this.daterangeNextCheckTime[1];
|
||||
}
|
||||
listEquInfo(this.queryParams).then(response => {
|
||||
this.equInfoList = response.data.records;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
partnerId: null,
|
||||
equName: null,
|
||||
equModel: null,
|
||||
equNumber: null,
|
||||
equZq: null,
|
||||
validTime: null,
|
||||
lastUnit: null,
|
||||
nextCheckTime: null,
|
||||
createTime: null,
|
||||
createBy: null,
|
||||
updateTime: null,
|
||||
updateBy: null,
|
||||
type: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.daterangeNextCheckTime = [];
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
/** 下载模板操作 */
|
||||
importTemplate() {
|
||||
importTemplate().then(response => {
|
||||
this.$download.excel(response, '设备导入模板.xls');
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
partnerId: null,
|
||||
equName: null,
|
||||
equModel: null,
|
||||
equNumber: null,
|
||||
equZq: null,
|
||||
validTime: null,
|
||||
lastUnit: null,
|
||||
nextCheckTime: null,
|
||||
createTime: null,
|
||||
createBy: null,
|
||||
updateTime: null,
|
||||
updateBy: null,
|
||||
type: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.daterangeNextCheckTime = [];
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
this.deviceId= row.id
|
||||
getEquInfo(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "添加";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getEquInfo(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateEquInfo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addEquInfo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
this.title = "修改";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateEquInfo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addEquInfo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除equInfo编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delEquInfo(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/equInfo/export', {
|
||||
...this.queryParams
|
||||
}, `equInfo_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 提交上传文件
|
||||
submitFileForm() {
|
||||
this.$refs.upload.submit();
|
||||
this.failList = []
|
||||
this.isFail = false
|
||||
console.log('执行')
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除equInfo编号为"' + ids + '"的数据项?').then(function () {
|
||||
return delEquInfo(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/equInfo/export', {
|
||||
...this.queryParams
|
||||
}, `equInfo_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@ -1,30 +1,30 @@
|
||||
<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="fileName">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.fileName"-->
|
||||
<!-- placeholder="请输入文件名称"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="提醒时间">-->
|
||||
<!-- <el-date-picker-->
|
||||
<!-- v-model="daterangeWarnTime"-->
|
||||
<!-- style="width: 240px"-->
|
||||
<!-- value-format="yyyy-MM-dd"-->
|
||||
<!-- type="daterange"-->
|
||||
<!-- range-separator="-"-->
|
||||
<!-- start-placeholder="开始日期"-->
|
||||
<!-- end-placeholder="结束日期"-->
|
||||
<!-- ></el-date-picker>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item>-->
|
||||
<!-- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>-->
|
||||
<!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-form>-->
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="文件名称" prop="fileName">
|
||||
<el-input
|
||||
v-model="queryParams.fileName"
|
||||
placeholder="请输入文件名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="提醒时间">-->
|
||||
<!-- <el-date-picker-->
|
||||
<!-- v-model="daterangeWarnTime"-->
|
||||
<!-- style="width: 240px"-->
|
||||
<!-- value-format="yyyy-MM-dd"-->
|
||||
<!-- type="daterange"-->
|
||||
<!-- range-separator="-"-->
|
||||
<!-- start-placeholder="开始日期"-->
|
||||
<!-- end-placeholder="结束日期"-->
|
||||
<!-- ></el-date-picker>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
@ -35,7 +35,8 @@
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
|
||||
>新增</el-button>
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="1.5">
|
||||
@ -45,96 +46,90 @@
|
||||
size="mini"
|
||||
@click="backFile()"
|
||||
|
||||
>返回</el-button>
|
||||
>返回
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- <el-table v-loading="loading" :data="inspectionFileList" @selection-change="handleSelectionChange">-->
|
||||
<!-- <el-table-column type="selection" width="55" align="center" />-->
|
||||
<!-- <el-table-column label="" align="center" prop="id" />-->
|
||||
<!-- <el-table-column label="类型1文件夹2文件" align="center" prop="type" />-->
|
||||
<!-- <el-table-column label="文件名称" align="center" prop="fileName" />-->
|
||||
<!-- <el-table-column label="文件路径" align="center" prop="filePath" />-->
|
||||
<!-- <el-table-column label="提醒时间" align="center" prop="warnTime" width="180">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <span>{{ parseTime(scope.row.warnTime, '{y}-{m}-{d}') }}</span>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <el-table-column label="创建时间" align="center" prop="createTime" width="180">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <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-edit"-->
|
||||
<!-- @click="handleUpdate(scope.row)"-->
|
||||
<!-- v-hasPermi="['inspectionFile:inspectionFile:edit']"-->
|
||||
<!-- >修改</el-button>-->
|
||||
<!-- <el-button-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- @click="handleDelete(scope.row)"-->
|
||||
<!-- v-hasPermi="['inspectionFile:inspectionFile:remove']"-->
|
||||
<!-- >删除</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"-->
|
||||
<!-- />-->
|
||||
<div class="content-box">
|
||||
|
||||
<el-card class="box-card" v-for="(item,index) in inspectionFileList" :key="index" >
|
||||
<div v-if="item.type == 1" @click="fatherji(item.id)" >
|
||||
<img src="../../../assets/images/wenjianjia.png" style="width: 100px;height: 100px;">
|
||||
|
||||
<div>{{item.fileName}}</div>
|
||||
<el-card class="box-card" v-for="(item, index) in inspectionFileList" :key="index">
|
||||
<div v-if="item.type == 1" @click="fatherji(item.id)">
|
||||
<img src="../../../assets/images/wenjianjia.png" style="width: 100px;height: 100px;">
|
||||
<div>{{ item.fileName }}</div>
|
||||
</div>
|
||||
<div v-if="item.type == 2">
|
||||
<img src="../../../assets/images/wenjian.png" style="width: 100px;height: 100px;">
|
||||
<div>{{ item.fileName }}</div>
|
||||
</div>
|
||||
<div class="bjandshanchu">
|
||||
<div class="one" @click="handleE(item)">编辑</div>
|
||||
<div class="two" v-if="item.type == '2'" @click="downloadFile(item)">下载</div>
|
||||
<div class="two" @click="clickStaff(item.id)" v-hasPermi="['inspectionFile:inspectionFilePermis:edit']">
|
||||
分配权限
|
||||
</div>
|
||||
<div v-if="item.type == 2" >
|
||||
<img src="../../../assets/images/wenjian.png" style="width: 100px;height: 100px;">
|
||||
|
||||
<div>{{item.fileName}}</div>
|
||||
</div>
|
||||
<div class="bjandshanchu">
|
||||
<div class="one" @click="handleE(item)">编辑</div>
|
||||
<div class="two" v-if="item.type =='2'" @click="downloadFile(item)" >下载</div>
|
||||
<div class="three" @click="Deleteanniu(item.id)">删除</div>
|
||||
|
||||
</div>
|
||||
|
||||
</el-card>
|
||||
|
||||
<div class="two" @click="drawerShow(item.id)">历史版本</div>
|
||||
<div class="three" @click="Deleteanniu(item.id)">删除</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
|
||||
<el-dialog title="分配权限" :visible.sync="isShow" width="600px" append-to-body>
|
||||
<el-select v-model="selectStaffList" multiple filterable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in staffList"
|
||||
:key="item.id"
|
||||
:label="item.nickname"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="cancelStaff">取 消</el-button>
|
||||
<el-button type="primary" @click="saveStaff">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-drawer
|
||||
title="修改记录"
|
||||
:visible.sync="drawer"
|
||||
>
|
||||
|
||||
<div style="height: 200px; padding: 10px;">
|
||||
<el-steps direction="vertical" >
|
||||
<el-step v-for="(item, index) in drawerData" :key="index" :title="'记录 ' + (index + 1)" status="process">
|
||||
<template #description>
|
||||
<div class="step-content">
|
||||
<div class="step-file-name">文件名称:{{ item.fileName }}</div>
|
||||
<div class="step-time">修改时间:{{ formatDate(item.createTime) }}</div>
|
||||
<div class="step-time">提醒时间:{{ formatDate(item.warnTime) }}</div>
|
||||
<div class="step-download" @click="downloadFile(item)" v-if="item.type == '2'">📂 下载历史文件</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-step>
|
||||
</el-steps>
|
||||
</div>
|
||||
|
||||
</el-drawer>
|
||||
|
||||
|
||||
<!-- 添加或修改inspectionFile对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<!-- <el-form-item label="店铺主键" prop="partnerId">-->
|
||||
<!-- <el-input v-model="form.partnerId" placeholder="请输入店铺主键" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="父节点" prop="fatherId">-->
|
||||
<!-- <el-input v-model="form.fatherId" placeholder="请输入父节点" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="店铺主键" prop="partnerId">-->
|
||||
<!-- <el-input v-model="form.partnerId" placeholder="请输入店铺主键" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="父节点" prop="fatherId">-->
|
||||
<!-- <el-input v-model="form.fatherId" placeholder="请输入父节点" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="文件名称" prop="fileName">
|
||||
<el-input v-model="form.fileName" placeholder="请输入文件名称" />
|
||||
<el-input v-model="form.fileName" placeholder="请输入文件名称"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="type" v-if="this.title ==='新增'">
|
||||
<el-radio-group v-model="form.type">
|
||||
<el-radio :label="'1'">文件夹</el-radio>
|
||||
<el-radio :label="'2'">文件</el-radio>
|
||||
</el-radio-group>
|
||||
<el-radio-group v-model="form.type">
|
||||
<el-radio :label="'1'">文件夹</el-radio>
|
||||
<el-radio :label="'2'">文件</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="文件路径" v-if="form.type==='2'" prop="filePath">
|
||||
<insp-file-upload
|
||||
@ -161,241 +156,397 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listInspectionFile, getInspectionFile, delInspectionFile, addInspectionFile, updateInspectionFile } from "../api/file";
|
||||
import inspFileUpload from '@/components/FileUpload/index.vue'
|
||||
export default {
|
||||
name: "InspectionFile",
|
||||
components:{inspFileUpload},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
import {
|
||||
listInspectionFile,
|
||||
getInspectionFile,
|
||||
delInspectionFile,
|
||||
addInspectionFile,
|
||||
updateInspectionFile, listStaff, assignAuthority, getUserIdsByFileId, listByPermission, getFileRecord
|
||||
} from "../api/file";
|
||||
import inspFileUpload from '@/components/FileUpload/index.vue'
|
||||
|
||||
// 总条数
|
||||
total: 0,
|
||||
// inspectionFile表格数据
|
||||
inspectionFileList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 提醒时间时间范围
|
||||
daterangeWarnTime: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
type: null,
|
||||
fatherId:null,
|
||||
},
|
||||
fatherId:'',
|
||||
oldFatherId:'',
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
export default {
|
||||
name: "InspectionFile",
|
||||
components: {inspFileUpload},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// inspectionFile表格数据
|
||||
inspectionFileList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
drawer: false,
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 是否显示弹出层(分配权限)
|
||||
isShow: false,
|
||||
// 提醒时间时间范围
|
||||
daterangeWarnTime: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
type: null,
|
||||
fatherId: null,
|
||||
},
|
||||
fatherId: '',
|
||||
oldFatherId: '',
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {},
|
||||
// 员工列表
|
||||
staffList: [],
|
||||
selectStaffList: [],
|
||||
fileId: '',
|
||||
drawerData: {},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.listByPermission()
|
||||
},
|
||||
methods: {
|
||||
formatDate(timestamp) {
|
||||
if (!timestamp) return "";
|
||||
const date = new Date(timestamp);
|
||||
return `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, "0")}-${date.getDate().toString().padStart(2, "0")}`;
|
||||
},
|
||||
created() {
|
||||
backFile() {
|
||||
if (this.fatherId) {
|
||||
getInspectionFile(this.fatherId).then(response => {
|
||||
this.queryParams.fatherId = response.data.fatherId
|
||||
this.fatherId = response.data.fatherId
|
||||
this.queryParams.pageNum = 1
|
||||
const data = {
|
||||
fatherId: this.fatherId,
|
||||
fileName: this.fatherId === '' || this.fatherId == null || this.fatherId === undefined ? this.queryParams.fileName : ''
|
||||
}
|
||||
this.getFolderList(data)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
clickStaff(fileId) {
|
||||
this.fileId = fileId
|
||||
this.isShow = true
|
||||
this.getStaffList()
|
||||
},
|
||||
drawerShow(id) {
|
||||
getFileRecord(id).then(response => {
|
||||
this.drawer = true
|
||||
this.drawerData = response.data
|
||||
})
|
||||
},
|
||||
/** 查询inspectionFile列表 */
|
||||
// getList() {
|
||||
// this.loading = true;
|
||||
// this.queryParams.params = {};
|
||||
// // if (null != this.daterangeWarnTime && '' != this.daterangeWarnTime) {
|
||||
// // 123
|
||||
// // this.queryParams.params["beginWarnTime"] = this.daterangeWarnTime[0];
|
||||
// // this.queryParams.params["endWarnTime"] = this.daterangeWarnTime[1];
|
||||
// // }
|
||||
// listInspectionFile(this.queryParams).then(response => {
|
||||
// this.inspectionFileList = response.data;
|
||||
// this.queryParams.fatherId = response.data[0].fatherId;
|
||||
// // this.total = response.total;
|
||||
// this.loading = false;
|
||||
// });
|
||||
// },
|
||||
/** 查询inspectionFile列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.queryParams.params = {};
|
||||
// if (null != this.daterangeWarnTime && '' != this.daterangeWarnTime) {
|
||||
// 123
|
||||
// this.queryParams.params["beginWarnTime"] = this.daterangeWarnTime[0];
|
||||
// this.queryParams.params["endWarnTime"] = this.daterangeWarnTime[1];
|
||||
// }
|
||||
if (this.$route.query.folderId){
|
||||
this.queryParams.fatherId = this.$route.query.folderId
|
||||
this.fatherId = this.$route.query.folderId
|
||||
}
|
||||
listByPermission(this.queryParams).then(response => {
|
||||
this.inspectionFileList = response.data;
|
||||
this.queryParams.fatherId = response.data[0].fatherId;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
getFolderList(data) {
|
||||
this.loading = true;
|
||||
// listInspectionFile(data).then(response => {
|
||||
listByPermission(data).then(response => {
|
||||
this.inspectionFileList = response.data;
|
||||
if (response.data.length > 0) {
|
||||
this.queryParams.fatherId = response.data[0].fatherId;
|
||||
// this.total = response.total;
|
||||
this.loading = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
fatherji(id) {
|
||||
this.fatherId = id
|
||||
this.queryParams.fatherId = id
|
||||
this.inspectionFileList = []
|
||||
const data = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
fatherId: id
|
||||
}
|
||||
this.getFolderList(data)
|
||||
},
|
||||
getStaffList() {
|
||||
const data = {
|
||||
pageNum: 1,
|
||||
pageSize: 100000
|
||||
}
|
||||
listStaff(data).then(res => {
|
||||
this.staffList = res.data.records
|
||||
this.getUserIdsByFileId(this.fileId)
|
||||
})
|
||||
},
|
||||
/**根据文件id获取有权限的用户id*/
|
||||
getUserIdsByFileId(fileId) {
|
||||
const data = {
|
||||
fileId: fileId
|
||||
}
|
||||
getUserIdsByFileId(data).then(res => {
|
||||
this.selectStaffList = res.data
|
||||
console.log('当前文件权限', this.selectStaffList)
|
||||
})
|
||||
},
|
||||
downloadFile(item) {
|
||||
// 创建一个 <a> 元素
|
||||
// const link = document.createElement('a');
|
||||
let href = "https://www.nuoyunr.com/minio/" + item.filePath; // 文件路径
|
||||
// var lastIndexOf = item.filePath.lastIndexOf(".");
|
||||
// link.download = item.fileName+item.filePath.substr(lastIndexOf); // 下载的文件名
|
||||
window.open(href);
|
||||
// // 触发下载
|
||||
// link.click();
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
partnerId: null,
|
||||
type: null,
|
||||
fatherId: null,
|
||||
fileName: null,
|
||||
filePath: null,
|
||||
warnTime: null,
|
||||
createTime: null,
|
||||
createBy: null,
|
||||
updateTime: null,
|
||||
updateBy: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
backFile(){
|
||||
if (this.fatherId){
|
||||
getInspectionFile(this.fatherId).then(response => {
|
||||
this.queryParams.fatherId = response.data.fatherId
|
||||
this.fatherId = response.data.fatherId
|
||||
this.queryParams.pageNum =1
|
||||
this.getList()
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
/** 查询inspectionFile列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.queryParams.params = {};
|
||||
if (null != this.daterangeWarnTime && '' != this.daterangeWarnTime) {123
|
||||
this.queryParams.params["beginWarnTime"] = this.daterangeWarnTime[0];
|
||||
this.queryParams.params["endWarnTime"] = this.daterangeWarnTime[1];
|
||||
}
|
||||
listInspectionFile(this.queryParams).then(response => {
|
||||
this.inspectionFileList = response.data.records;
|
||||
this.queryParams.fatherId = response.data.records[0].fatherId;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
fatherji(id){
|
||||
this.oldFatherId = this.fatherId
|
||||
this.fatherId = id
|
||||
this.queryParams.fatherId = id
|
||||
this.inspectionFileList=[]
|
||||
this.queryParams.pageNum =1
|
||||
this.getList()
|
||||
},
|
||||
downloadFile(item) {
|
||||
// 创建一个 <a> 元素
|
||||
// const link = document.createElement('a');
|
||||
let href = "https://www.nuoyunr.com/minio"+item.filePath; // 文件路径
|
||||
// var lastIndexOf = item.filePath.lastIndexOf(".");
|
||||
// link.download = item.fileName+item.filePath.substr(lastIndexOf); // 下载的文件名
|
||||
window.open(href);
|
||||
// // 触发下载
|
||||
// link.click();
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
partnerId: null,
|
||||
type: null,
|
||||
fatherId: null,
|
||||
fileName: null,
|
||||
filePath: null,
|
||||
warnTime: null,
|
||||
createTime: null,
|
||||
createBy: null,
|
||||
updateTime: null,
|
||||
updateBy: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.daterangeWarnTime = [];
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.daterangeWarnTime = [];
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "新增";
|
||||
},
|
||||
handleE(item) {
|
||||
this.reset(item);
|
||||
this.form = item;
|
||||
this.open = true;
|
||||
this.title = "修改";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getInspectionFile(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "新增";
|
||||
},
|
||||
handleE(item) {
|
||||
this.reset(item);
|
||||
this.form = item;
|
||||
this.open = true;
|
||||
this.title = "修改";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getInspectionFile(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改inspectionFile";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateInspectionFile(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
this.form.fatherId = this.fatherId
|
||||
addInspectionFile(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
this.title = "修改inspectionFile";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (!this.form.filePath && this.form.type == "2") {
|
||||
this.$modal.msgError("请上传文件");
|
||||
return false;
|
||||
}
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateInspectionFile(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
this.form.fatherId = this.fatherId
|
||||
addInspectionFile(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
//新建删除
|
||||
Deleteanniu(id){
|
||||
this.$modal.confirm('是否确认删除inspectionFile编号为"' + id + '"的数据项?').then(function() {
|
||||
return delInspectionFile(id);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除inspectionFile编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delInspectionFile(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('inspectionFile/inspectionFile/export', {
|
||||
...this.queryParams
|
||||
}, `inspectionFile_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 分配文件权限给对应用户 */
|
||||
saveStaff() {
|
||||
console.log(this.selectStaffList, "66666666666666")
|
||||
const data = {
|
||||
userIds: this.selectStaffList,
|
||||
fileId: this.fileId
|
||||
}
|
||||
assignAuthority(data).then(res => {
|
||||
this.$modal.msgSuccess("分配权限成功")
|
||||
})
|
||||
this.selectStaffList = []
|
||||
this.isShow = false
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancelStaff() {
|
||||
this.selectStaffList = []
|
||||
this.isShow = false
|
||||
},
|
||||
//新建删除
|
||||
Deleteanniu(id) {
|
||||
this.$modal.confirm('是否确认删除inspectionFile编号为"' + id + '"的数据项?').then(function () {
|
||||
return delInspectionFile(id);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除inspectionFile编号为"' + ids + '"的数据项?').then(function () {
|
||||
return delInspectionFile(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('inspectionFile/inspectionFile/export', {
|
||||
...this.queryParams
|
||||
}, `inspectionFile_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.content-box{
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
}
|
||||
.box-card{
|
||||
width: 160px;
|
||||
.content-box {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
text-align: center;
|
||||
margin-bottom: 15px;
|
||||
margin-right: 15px;
|
||||
}
|
||||
.bjandshanchu{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.one{
|
||||
.box-card {
|
||||
width: 160px;
|
||||
|
||||
text-align: center;
|
||||
margin-bottom: 15px;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
.bjandshanchu {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.one {
|
||||
color: #67C23A;
|
||||
cursor: pointer;
|
||||
}
|
||||
.two{
|
||||
color: #409EFF;
|
||||
cursor: pointer;
|
||||
}
|
||||
.three{
|
||||
color: #F56C6C;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.two {
|
||||
color: #409EFF;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.three {
|
||||
color: #F56C6C;
|
||||
cursor: pointer;
|
||||
}
|
||||
/* 增加步骤间距 */
|
||||
.custom-step {
|
||||
margin-bottom: 35px;
|
||||
}
|
||||
|
||||
/* 统一样式容器 */
|
||||
.step-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px; /* 调整子元素间距 */
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
/* 时间样式 */
|
||||
.step-time {
|
||||
font-size: 14px;
|
||||
//color: #666;
|
||||
}
|
||||
|
||||
/* 文件名称高亮 */
|
||||
.step-file-name {
|
||||
font-weight: bold;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
/* 下载按钮样式 */
|
||||
.step-download {
|
||||
font-size: 14px;
|
||||
color: #409EFF;
|
||||
cursor: pointer;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.step-download:hover {
|
||||
color: #307ec7;
|
||||
}
|
||||
/deep/.el-drawer__header {
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="金额大于" prop="partnerName">
|
||||
<el-input-number v-model="queryParams.realPayMoney" :min="1" :max="999" label="描述文字"></el-input-number>
|
||||
<el-input-number v-model="queryParams.realPayMoney" :min="1" :max="999" label="描述文字"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
@ -65,63 +65,60 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- <el-row :gutter="10" class="mb8">-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="primary"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-plus"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="handleAdd"-->
|
||||
<!-- v-hasPermi="['system:info:add']"-->
|
||||
<!-- >新增</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="success"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-edit"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="single"-->
|
||||
<!-- @click="handleUpdate"-->
|
||||
<!-- v-hasPermi="['system:info:edit']"-->
|
||||
<!-- >修改</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="danger"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="multiple"-->
|
||||
<!-- @click="handleDelete"-->
|
||||
<!-- v-hasPermi="['system:info:remove']"-->
|
||||
<!-- >删除</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
<!-- </el-row>-->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
|
||||
v-hasPermi="['system:user:export']">导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:info:edit']"
|
||||
>修改
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:info:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="订单id" align="center" prop="id" width="80" />
|
||||
<el-table-column label="订单号" align="center" prop="orderNo" width="300" />
|
||||
<el-table-column label="商品名称" align="center" prop="goodsTitle" />
|
||||
<el-table-column label="用户姓名" align="center" prop="realName" />
|
||||
<el-table-column label="用户手机号" align="center" prop="phonenumber" />
|
||||
<!-- <el-table-column label="车牌号" align="center" prop="carNo" />-->
|
||||
<el-table-column label="商品原价 (元)" align="center" prop="goodsPrice" >
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column label="订单id" align="center" prop="id" width="80"/>
|
||||
<el-table-column label="订单号" align="center" prop="orderNo" width="300"/>
|
||||
<el-table-column label="商品名称" align="center" prop="goodsTitle"/>
|
||||
<el-table-column label="用户姓名" align="center" prop="realName"/>
|
||||
<el-table-column label="用户手机号" align="center" prop="phonenumber"/>
|
||||
<!-- <el-table-column label="车牌号" align="center" prop="carNo" />-->
|
||||
<el-table-column label="商品原价 (元)" align="center" prop="goodsPrice">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.goodsPrice /100 }}</span>
|
||||
<span>{{ scope.row.goodsPrice / 100 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="实付金额 (元)" align="center" prop="payMoney" >
|
||||
<el-table-column label="实付金额 (元)" align="center" prop="payMoney">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.payMoney /100 }}</span>
|
||||
<span>{{ scope.row.payMoney / 100 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="使用账户余额(元)" align="center" prop="balance" >
|
||||
<el-table-column label="使用账户余额(元)" align="center" prop="balance">
|
||||
<template slot-scope="scope">
|
||||
<span>{{(scope.row.balance/100) }}</span>
|
||||
<span>{{ (scope.row.balance / 100) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="支付时间" align="center" prop="payTime" width="180">
|
||||
@ -135,7 +132,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="评价" align="center">
|
||||
<el-table-column label="评价星级" align="center" prop="commentStar" >
|
||||
<el-table-column label="评价星级" align="center" prop="commentStar">
|
||||
<template slot-scope="scope">
|
||||
<el-rate
|
||||
v-model="scope.row.commentStar"
|
||||
@ -145,7 +142,7 @@
|
||||
</el-rate>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="评价内容" align="center" prop="commentDesc" show-overflow-tooltip />
|
||||
<el-table-column label="评价内容" align="center" prop="commentDesc" show-overflow-tooltip/>
|
||||
</el-table-column>
|
||||
|
||||
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
|
||||
@ -189,193 +186,195 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listInfo, getInfo, delInfo, addInfo, updateInfo } from "./api/ordermanagement";
|
||||
import moment from 'moment';
|
||||
import request from "@/utils/request";
|
||||
import DictTag from "@/components/DictTagOld/index.vue";
|
||||
export default {
|
||||
name: "Info",
|
||||
components:{DictTag},
|
||||
dicts: ['order_status', 'all_order_type'],
|
||||
data() {
|
||||
return {
|
||||
value1: '',
|
||||
value2: '',
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 订单表格数据
|
||||
infoList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
orderNo: null,
|
||||
goodsTitle: null,
|
||||
realName: null,
|
||||
orderStatus: null,
|
||||
orderType: null,
|
||||
partnerName: null,
|
||||
DateTimeFormat:null,
|
||||
JsonFormat:null,
|
||||
TableField:null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.dict = {type:{}}
|
||||
for (let i = 0; i < this.$options.dicts.length; i++) {
|
||||
request({
|
||||
url: '/rescue/dict/data/type/'+this.$options.dicts[i],
|
||||
method: 'get'
|
||||
}).then(res=>{
|
||||
this.$set(this.dict.type,this.$options.dicts[i],res.data)
|
||||
})
|
||||
import {listInfo, getInfo, delInfo, addInfo, updateInfo} from "./api/ordermanagement";
|
||||
import moment from 'moment';
|
||||
import request from "@/utils/request";
|
||||
import DictTag from "@/components/DictTagOld/index.vue";
|
||||
|
||||
export default {
|
||||
name: "Info",
|
||||
components: {DictTag},
|
||||
dicts: ['order_status', 'all_order_type'],
|
||||
data() {
|
||||
return {
|
||||
value1: '',
|
||||
value2: '',
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 订单表格数据
|
||||
infoList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
orderNo: null,
|
||||
goodsTitle: null,
|
||||
realName: null,
|
||||
orderStatus: null,
|
||||
orderType: null,
|
||||
partnerName: null,
|
||||
DateTimeFormat: null,
|
||||
JsonFormat: null,
|
||||
TableField: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.dict = {type: {}}
|
||||
for (let i = 0; i < this.$options.dicts.length; i++) {
|
||||
request({
|
||||
url: '/rescue/dict/data/type/' + this.$options.dicts[i],
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.$set(this.dict.type, this.$options.dicts[i], res.data)
|
||||
})
|
||||
}
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询订单列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
if (this.queryParams.startTime) {
|
||||
this.queryParams.startTime = moment(this.queryParams.startTime).format('YYYY-MM-DD HH:mm');
|
||||
}
|
||||
if (this.queryParams.endTime) {
|
||||
this.queryParams.endTime = moment(this.queryParams.endTime).format('YYYY-MM-DD HH:mm');
|
||||
}
|
||||
// this.queryParams.carAge = 1
|
||||
listInfo(this.queryParams).then(response => {
|
||||
this.infoList = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
orderNo: null,
|
||||
goodsId: null,
|
||||
goodsTitle: null,
|
||||
goodsType: null,
|
||||
userId: null,
|
||||
realName: null,
|
||||
phonenumber: null,
|
||||
goodsPrice: null,
|
||||
payMoney: null,
|
||||
orderTime: null,
|
||||
balance: null,
|
||||
payTime: null,
|
||||
orderStatus: null,
|
||||
commentDesc: null,
|
||||
commentStar: null,
|
||||
orderType: null,
|
||||
partnerId: null,
|
||||
partnerName: null,
|
||||
createTime: null,
|
||||
createBy: null,
|
||||
deptId: null,
|
||||
updateTime: null,
|
||||
updateBy: null,
|
||||
validationTime: null,
|
||||
validationRealName: null,
|
||||
validationUserId: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询订单列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
if (this.queryParams.startTime){
|
||||
this.queryParams.startTime = moment(this.queryParams.startTime).format('YYYY-MM-DD HH:mm');
|
||||
}
|
||||
if (this.queryParams.endTime){
|
||||
this.queryParams.endTime = moment(this.queryParams.endTime).format('YYYY-MM-DD HH:mm');
|
||||
}
|
||||
listInfo(this.queryParams).then(response => {
|
||||
this.infoList = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
orderNo: null,
|
||||
goodsId: null,
|
||||
goodsTitle: null,
|
||||
goodsType: null,
|
||||
userId: null,
|
||||
realName: null,
|
||||
phonenumber: null,
|
||||
goodsPrice: null,
|
||||
payMoney: null,
|
||||
orderTime: null,
|
||||
balance: null,
|
||||
payTime: null,
|
||||
orderStatus: null,
|
||||
commentDesc: null,
|
||||
commentStar: null,
|
||||
orderType: null,
|
||||
partnerId: null,
|
||||
partnerName: null,
|
||||
createTime: null,
|
||||
createBy: null,
|
||||
deptId: null,
|
||||
updateTime: null,
|
||||
updateBy: null,
|
||||
validationTime: null,
|
||||
validationRealName: null,
|
||||
validationUserId: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.queryParams.startTime = null
|
||||
this.queryParams.endTime = null
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.queryParams.startTime = null
|
||||
this.queryParams.endTime = null
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加订单";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getInfo(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "添加订单";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getInfo(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改订单";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateInfo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addInfo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
this.title = "修改订单";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateInfo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addInfo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除订单编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delInfo(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/info/export', {
|
||||
...this.queryParams
|
||||
}, `info_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除订单编号为"' + ids + '"的数据项?').then(function () {
|
||||
return delInfo(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/inspectionGoods/exportPartnerOrderListSystem', {
|
||||
...this.queryParams
|
||||
}, `订单_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user