Compare commits
4 Commits
projects/l
...
projects/l
| Author | SHA1 | Date | |
|---|---|---|---|
| c9c8f82910 | |||
| d859ba62c8 | |||
| 31bafae4aa | |||
| 67b6b88863 |
@@ -57,7 +57,66 @@ export function listByDeptId(id) {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 作废计划
|
||||||
|
export function disablePlan(id) {
|
||||||
|
return request({
|
||||||
|
url: '/base/group-scheduling-plan/disablePlan?id='+id,
|
||||||
|
method: 'delete',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 同步节假日
|
||||||
|
export function updateScheduleLater(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/group-holiday/updateScheduleLater',
|
||||||
|
method: 'post',
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 复制计划
|
||||||
|
export function copyPlan(id) {
|
||||||
|
return request({
|
||||||
|
url: '/base/group-scheduling-plan/copyPlan?id='+id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 列表草稿编辑
|
||||||
|
export function draftEditing(id) {
|
||||||
|
return request({
|
||||||
|
url: '/base/group-scheduling-plan/draftEditing?id='+id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 排班计划-详情
|
||||||
|
export function getPlan(id) {
|
||||||
|
return request({
|
||||||
|
url: '/base/group-scheduling-plan/get?id='+id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 弹窗-取消
|
||||||
|
export function cancelStepThree(id) {
|
||||||
|
return request({
|
||||||
|
url: '/base/group-scheduling-plan/cancelStepThree?id='+id,
|
||||||
|
method: 'delete',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 第三步确认并执行 检查计划时间是否冲突,如果有,返回冲突的计划列表
|
||||||
|
export function checkPlan(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/group-scheduling-plan/checkPlan',
|
||||||
|
method: 'post',
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 第三步确认并执行 执行
|
||||||
|
export function createStepFour(id) {
|
||||||
|
return request({
|
||||||
|
url: '/base/group-scheduling-plan/createStepFour',
|
||||||
|
method: 'post',
|
||||||
|
data:id
|
||||||
|
})
|
||||||
|
}
|
||||||
// 班组班次下一步至获取预览
|
// 班组班次下一步至获取预览
|
||||||
export function createStepTwo(data) {
|
export function createStepTwo(data) {
|
||||||
return request({
|
return request({
|
||||||
@@ -73,3 +132,12 @@ export function returnStepTwo(id) {
|
|||||||
method: 'delete',
|
method: 'delete',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 第三步获取预览
|
||||||
|
export function getPerView(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/group-scheduling-plan/getPerView',
|
||||||
|
method: 'post',
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
18
src/api/group/calendar.js
Normal file
18
src/api/group/calendar.js
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 获取部门及下级部门排班list
|
||||||
|
export function getDeptSchedulingList(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/group-team-scheduling/getDeptSchedulingList',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 某个班组的排班list
|
||||||
|
export function getClassSchedulingList(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/group-team-scheduling/getClassSchedulingList',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -2,19 +2,28 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2025-10-18 21:24:37
|
* @Date: 2025-10-18 21:24:37
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2025-10-18 23:07:37
|
* @LastEditTime: 2025-10-22 14:34:29
|
||||||
* @Description:
|
* @Description:
|
||||||
*/
|
*/
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
// 获得节假日基础信息分页
|
// 获得节假日基础信息分页
|
||||||
export function deptHolidayList(query) {
|
export function deptHolidayPage(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/group-holiday/page',
|
url: '/base/group-holiday/page',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 获得部门节假日信息
|
||||||
|
export function deptHolidayList(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/group-holiday/deptHolidayList',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 创建节假日基础信息
|
// 创建节假日基础信息
|
||||||
export function createHoliday(data) {
|
export function createHoliday(data) {
|
||||||
@@ -24,6 +33,14 @@ export function createHoliday(data) {
|
|||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 节假日操作后直接更新排班日历
|
||||||
|
export function updateSchedule(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/group-holiday/updateSchedule',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 更新节假日基础信息
|
// 更新节假日基础信息
|
||||||
export function updateHoliday(data) {
|
export function updateHoliday(data) {
|
||||||
@@ -33,14 +50,30 @@ export function updateHoliday(data) {
|
|||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 删除节假日基础信息前校验是否影响排班
|
||||||
|
export function checkDeleteHoliday(id) {
|
||||||
|
return request({
|
||||||
|
url: '/base/group-holiday/checkDelete?id=' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
export function deleteHolidayn(id) {
|
export function deleteHoliday(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/base/group-holiday/delete?id=' + id,
|
url: '/base/group-holiday/delete?id=' + id,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获得节假日基础信息
|
||||||
|
export function getHoliday(id) {
|
||||||
|
return request({
|
||||||
|
url: '/base/group-holiday/get?id=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 获得节假日变动日志分页
|
// 获得节假日变动日志分页
|
||||||
export function deptHolidayLogList(query) {
|
export function deptHolidayLogList(query) {
|
||||||
return request({
|
return request({
|
||||||
@@ -49,3 +82,11 @@ export function deptHolidayLogList(query) {
|
|||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获得用户本人及以下的部门扁平化结构
|
||||||
|
export function getEnableData() {
|
||||||
|
return request({
|
||||||
|
url: '/base/group-team-scheduling/getEnableData',
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
BIN
src/assets/img/cold-data-board-msg1.png
Normal file
BIN
src/assets/img/cold-data-board-msg1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
BIN
src/assets/img/cold-data-board-msg2.png
Normal file
BIN
src/assets/img/cold-data-board-msg2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
BIN
src/assets/img/home-bg.png
Normal file
BIN
src/assets/img/home-bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 MiB |
BIN
src/assets/img/home-progress-bg.png
Normal file
BIN
src/assets/img/home-progress-bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 936 B |
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div style="background: #f2f4f9; height: 40px; width: 100%">
|
<!-- <div style="background: #f2f4f9; height: 40px; width: 100%">
|
||||||
<ButtonNav :menus="['按日期', '按规格']" @change="currentMenu">
|
<ButtonNav :menus="['按日期', '按规格']" @change="currentMenu">
|
||||||
<template v-slot:tab1>
|
<template v-slot:tab1>
|
||||||
<div>按日期</div>
|
<div>按日期</div>
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
<div>按规格</div>
|
<div>按规格</div>
|
||||||
</template>
|
</template>
|
||||||
</ButtonNav>
|
</ButtonNav>
|
||||||
</div>
|
</div> -->
|
||||||
<div class="app-container energyOverlimitLog">
|
<div class="app-container energyOverlimitLog">
|
||||||
<div v-show="activeName === 'his'">
|
<div v-show="activeName === 'his'">
|
||||||
<!-- 搜索工作栏 -->
|
<!-- 搜索工作栏 -->
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
:page.sync="listQuery.pageNo"
|
:page.sync="listQuery.pageNo"
|
||||||
:limit.sync="listQuery.pageSize"
|
:limit.sync="listQuery.pageSize"
|
||||||
:total="listQuery.total"
|
:total="listQuery.total"
|
||||||
@pagination="getDataList" />
|
@pagination="getNavDataList" />
|
||||||
<base-dialog
|
<base-dialog
|
||||||
:dialogTitle="addOrEditTitle"
|
:dialogTitle="addOrEditTitle"
|
||||||
:dialogVisible="addOrUpdateVisible"
|
:dialogVisible="addOrUpdateVisible"
|
||||||
@@ -86,32 +86,36 @@ import ButtonNav from '@/components/ButtonNav';
|
|||||||
|
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
{
|
{
|
||||||
prop: 'recTime',
|
prop: 'time',
|
||||||
label: '日期',
|
label: '日期',
|
||||||
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'originArea',
|
prop: 'originArea',
|
||||||
label: '原片下片面积',
|
label: '原片下片面积',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'deepArea',
|
prop: 'deepArea',
|
||||||
label: '深加工下片面积',
|
label: '深加工下片面积',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'originPrice',
|
prop: 'originPrice',
|
||||||
label: '原片成本/元',
|
label: '原片成本/元',
|
||||||
align: 'right',
|
align: 'right',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'deepPrice',
|
prop: 'deepPrice',
|
||||||
label: '深加工成本/元',
|
label: '深加工成本/元',
|
||||||
align: 'right',
|
align: 'right',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'price',
|
prop: 'price',
|
||||||
label: '总成本/元',
|
label: '总成本/元',
|
||||||
align: 'right',
|
align: 'right',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const tableProps2 = [
|
const tableProps2 = [
|
||||||
@@ -244,19 +248,12 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
buttonClick(val) {
|
buttonClick(val) {
|
||||||
if (val.statisticType === 2) {
|
|
||||||
this.tableProps[0].filter = (val) =>
|
|
||||||
parseTime(val, '{y}年第{w}周');
|
|
||||||
}else{
|
|
||||||
this.tableProps[0].filter = (val) =>
|
|
||||||
parseTime(val, '{y}年{m}月{d}日');
|
|
||||||
}
|
|
||||||
this.formConfig2[0].startPlaceholder = '开始时间';
|
this.formConfig2[0].startPlaceholder = '开始时间';
|
||||||
this.formConfig2[0].endPlaceholder = '结束时间';
|
this.formConfig2[0].endPlaceholder = '结束时间';
|
||||||
switch (val.btnName) {
|
switch (val.btnName) {
|
||||||
case 'search':
|
case 'search':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.bindObjectId = val.name || null;
|
this.listQuery.bindObjectId = val.name || null;
|
||||||
this.listQuery.statisticType = val.statisticType || 1;
|
this.listQuery.statisticType = val.statisticType || 1;
|
||||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||||
@@ -274,7 +271,7 @@ export default {
|
|||||||
break;
|
break;
|
||||||
case 'export':
|
case 'export':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.bindObjectId = val.name || null;
|
this.listQuery.bindObjectId = val.name || null;
|
||||||
this.listQuery.statisticType = val.statisticType || 1;
|
this.listQuery.statisticType = val.statisticType || 1;
|
||||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||||
@@ -334,12 +331,19 @@ export default {
|
|||||||
this.otherMethods(val);
|
this.otherMethods(val);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
getNavDataList(){
|
||||||
|
if (this.activeName === 'his') {
|
||||||
|
this.getDataList();
|
||||||
|
} else {
|
||||||
|
this.getDataList2();
|
||||||
|
}
|
||||||
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
let exportURL, title;
|
let exportURL, title;
|
||||||
if (this.activeName === 'his') {
|
if (this.activeName === 'his') {
|
||||||
exportURL = exportCostSumExcel;
|
exportURL = exportCostSumExcel;
|
||||||
title = '总成本统计-按日期';
|
title = '总成本统计';
|
||||||
} else {
|
} else {
|
||||||
exportURL = exportRawStatisticsRealtimeExcel;
|
exportURL = exportRawStatisticsRealtimeExcel;
|
||||||
title = '总成本统计-按规格';
|
title = '总成本统计-按规格';
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ export default {
|
|||||||
switch (val.btnName) {
|
switch (val.btnName) {
|
||||||
case 'search':
|
case 'search':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.name = val.name||null;
|
this.listQuery.name = val.name||null;
|
||||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||||
this.listQuery.endTime = val.searchTime
|
this.listQuery.endTime = val.searchTime
|
||||||
@@ -90,7 +90,7 @@ export default {
|
|||||||
break;
|
break;
|
||||||
case 'export':
|
case 'export':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.name = val.name;
|
this.listQuery.name = val.name;
|
||||||
this.listQuery.recTime = val.searchTime;
|
this.listQuery.recTime = val.searchTime;
|
||||||
this.handleExport();
|
this.handleExport();
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
:page.sync="listQuery.pageNo"
|
:page.sync="listQuery.pageNo"
|
||||||
:limit.sync="listQuery.pageSize"
|
:limit.sync="listQuery.pageSize"
|
||||||
:total="listQuery.total"
|
:total="listQuery.total"
|
||||||
@pagination="getDataList" />
|
@pagination="getNavDataList" />
|
||||||
<base-dialog
|
<base-dialog
|
||||||
:dialogTitle="addOrEditTitle"
|
:dialogTitle="addOrEditTitle"
|
||||||
:dialogVisible="addOrUpdateVisible"
|
:dialogVisible="addOrUpdateVisible"
|
||||||
@@ -86,24 +86,27 @@ import ButtonNav from '@/components/ButtonNav';
|
|||||||
|
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
{
|
{
|
||||||
prop: 'recTime',
|
prop: 'time',
|
||||||
label: '日期',
|
label: '日期',
|
||||||
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
|
},
|
||||||
|
{
|
||||||
|
prop: 'remark',
|
||||||
|
label: '备注',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'energyTypeName',
|
prop: 'energyTypeName',
|
||||||
label: '能源类型',
|
label: '能源类型',
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
prop: 'bindObjectName',
|
// prop: 'bindObjectName',
|
||||||
label: '监控对象',
|
// label: '监控对象',
|
||||||
filter: (val) => (val != null ? val : '--'),
|
// filter: (val) => (val != null ? val : '--'),
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
prop: 'meterName',
|
// prop: 'meterName',
|
||||||
label: '抄表名',
|
// label: '抄表名',
|
||||||
filter: (val) => (val != null ? val : '--'),
|
// filter: (val) => (val != null ? val : '--'),
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
prop: 'quantity',
|
prop: 'quantity',
|
||||||
label: '累计使用量',
|
label: '累计使用量',
|
||||||
@@ -115,20 +118,24 @@ const tableProps = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
const tableProps2 = [
|
const tableProps2 = [
|
||||||
|
{
|
||||||
|
prop: 'remark',
|
||||||
|
label: '备注',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
prop: 'energyTypeName',
|
prop: 'energyTypeName',
|
||||||
label: '能源类型',
|
label: '能源类型',
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
prop: 'bindObjectName',
|
// prop: 'bindObjectName',
|
||||||
label: '监控对象',
|
// label: '监控对象',
|
||||||
filter: (val) => (val != null ? val : '--'),
|
// filter: (val) => (val != null ? val : '--'),
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
prop: 'meter',
|
// prop: 'meter',
|
||||||
label: '抄表名',
|
// label: '抄表名',
|
||||||
filter: (val) => (val != null ? val : '--'),
|
// filter: (val) => (val != null ? val : '--'),
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
prop: 'quantity',
|
prop: 'quantity',
|
||||||
label: '累计使用量',
|
label: '累计使用量',
|
||||||
@@ -207,13 +214,16 @@ export default {
|
|||||||
{
|
{
|
||||||
type: 'datePicker',
|
type: 'datePicker',
|
||||||
label: '时间范围',
|
label: '时间范围',
|
||||||
dateType: 'daterange',
|
dateType: 'datetimerange',
|
||||||
format: 'yyyy-MM-dd',
|
format: 'yyyy-MM-dd HH:mm:ss',
|
||||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||||
rangeSeparator: '-',
|
rangeSeparator: '-',
|
||||||
startPlaceholder: '开始时间',
|
startPlaceholder: '开始时间',
|
||||||
endPlaceholder: '结束时间',
|
endPlaceholder: '结束时间',
|
||||||
|
defaultTime: ['08:30:00', '08:30:00'],
|
||||||
param: 'searchTime',
|
param: 'searchTime',
|
||||||
|
width: 350,
|
||||||
|
clearable: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'button',
|
type: 'button',
|
||||||
@@ -262,26 +272,18 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
buttonClick(val) {
|
buttonClick(val) {
|
||||||
if (val.statisticType === 2) {
|
|
||||||
this.tableProps[0].filter = (val) =>
|
|
||||||
parseTime(val, '{y}年第{w}周');
|
|
||||||
}else{
|
|
||||||
this.tableProps[0].filter = (val) =>
|
|
||||||
parseTime(val, '{y}年{m}月{d}日');
|
|
||||||
}
|
|
||||||
this.formConfig2[1].startPlaceholder = '开始时间';
|
|
||||||
this.formConfig2[1].endPlaceholder = '结束时间';
|
|
||||||
switch (val.btnName) {
|
switch (val.btnName) {
|
||||||
case 'search':
|
case 'search':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.energyTypeId = val.name || null;
|
this.listQuery.energyTypeId = val.name || null;
|
||||||
this.listQuery.statisticType = val.statisticType || 1;
|
this.listQuery.statisticType = val.statisticType || 1;
|
||||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||||
|
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;
|
||||||
|
if (this.activeName === 'his') {
|
||||||
this.listQuery.endTime = val.searchTime
|
this.listQuery.endTime = val.searchTime
|
||||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||||
: null;
|
: null;
|
||||||
if (this.activeName === 'his') {
|
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
} else {
|
} else {
|
||||||
this.getDataList2();
|
this.getDataList2();
|
||||||
@@ -292,13 +294,18 @@ export default {
|
|||||||
break;
|
break;
|
||||||
case 'export':
|
case 'export':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.energyTypeId = val.name || null;
|
this.listQuery.energyTypeId = val.name || null;
|
||||||
this.listQuery.statisticType = val.statisticType || 1;
|
this.listQuery.statisticType = val.statisticType || 1;
|
||||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||||
|
this.listQuery.endTime = val.searchTime
|
||||||
|
? val.searchTime[1]
|
||||||
|
: null;
|
||||||
|
if (this.activeName === 'his') {
|
||||||
this.listQuery.endTime = val.searchTime
|
this.listQuery.endTime = val.searchTime
|
||||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||||
: null;
|
: null;
|
||||||
|
}
|
||||||
this.handleExport();
|
this.handleExport();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -320,15 +327,26 @@ export default {
|
|||||||
const end = new Date();
|
const end = new Date();
|
||||||
const start = new Date();
|
const start = new Date();
|
||||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||||
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 00:00:00';
|
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 08:30:00';
|
||||||
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 23:59:59';
|
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 08:30:00';
|
||||||
this.formConfig2[1].startPlaceholder = parseTime(start).substr(0, 10);
|
this.$nextTick(() => {
|
||||||
this.formConfig2[1].endPlaceholder = parseTime(end).substr(0, 10);
|
this.$refs.searchBarForm2.formInline.searchTime = [
|
||||||
|
this.listQuery.startTime,
|
||||||
|
this.listQuery.endTime,
|
||||||
|
];
|
||||||
|
});
|
||||||
this.listQuery.name = null;
|
this.listQuery.name = null;
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.getDataList2();
|
this.getDataList2();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
getNavDataList(){
|
||||||
|
if (this.activeName === 'his') {
|
||||||
|
this.getDataList();
|
||||||
|
} else {
|
||||||
|
this.getDataList2();
|
||||||
|
}
|
||||||
|
},
|
||||||
// 获取数据2列表
|
// 获取数据2列表
|
||||||
getDataList2() {
|
getDataList2() {
|
||||||
if (this.listQuery.startTime) {
|
if (this.listQuery.startTime) {
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
:page.sync="listQuery.pageNo"
|
:page.sync="listQuery.pageNo"
|
||||||
:limit.sync="listQuery.pageSize"
|
:limit.sync="listQuery.pageSize"
|
||||||
:total="listQuery.total"
|
:total="listQuery.total"
|
||||||
@pagination="getDataList" />
|
@pagination="getNavDataList" />
|
||||||
<base-dialog
|
<base-dialog
|
||||||
:dialogTitle="addOrEditTitle"
|
:dialogTitle="addOrEditTitle"
|
||||||
:dialogVisible="addOrUpdateVisible"
|
:dialogVisible="addOrUpdateVisible"
|
||||||
@@ -87,9 +87,12 @@ import ButtonNav from '@/components/ButtonNav';
|
|||||||
|
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
{
|
{
|
||||||
prop: 'recTime',
|
prop: 'time',
|
||||||
label: '日期',
|
label: '日期',
|
||||||
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
|
},
|
||||||
|
{
|
||||||
|
prop: 'remark',
|
||||||
|
label: '备注',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'otherCostName',
|
prop: 'otherCostName',
|
||||||
@@ -99,9 +102,14 @@ const tableProps = [
|
|||||||
prop: 'price',
|
prop: 'price',
|
||||||
label: '总价(元)',
|
label: '总价(元)',
|
||||||
align: 'right',
|
align: 'right',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const tableProps2 = [
|
const tableProps2 = [
|
||||||
|
// {
|
||||||
|
// prop: 'remark',
|
||||||
|
// label: '备注',
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
prop: 'otherCostName',
|
prop: 'otherCostName',
|
||||||
label: '成本名称',
|
label: '成本名称',
|
||||||
@@ -110,6 +118,7 @@ const tableProps2 = [
|
|||||||
prop: 'price',
|
prop: 'price',
|
||||||
label: '总价(元)',
|
label: '总价(元)',
|
||||||
align: 'right',
|
align: 'right',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
export default {
|
export default {
|
||||||
@@ -182,13 +191,16 @@ export default {
|
|||||||
{
|
{
|
||||||
type: 'datePicker',
|
type: 'datePicker',
|
||||||
label: '时间范围',
|
label: '时间范围',
|
||||||
dateType: 'daterange',
|
dateType: 'datetimerange',
|
||||||
format: 'yyyy-MM-dd',
|
format: 'yyyy-MM-dd HH:mm:ss',
|
||||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||||
rangeSeparator: '-',
|
rangeSeparator: '-',
|
||||||
startPlaceholder: '开始时间',
|
startPlaceholder: '开始时间',
|
||||||
endPlaceholder: '结束时间',
|
endPlaceholder: '结束时间',
|
||||||
|
defaultTime: ['08:30:00', '08:30:00'],
|
||||||
param: 'searchTime',
|
param: 'searchTime',
|
||||||
|
width: 350,
|
||||||
|
clearable: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'button',
|
type: 'button',
|
||||||
@@ -237,26 +249,20 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
buttonClick(val) {
|
buttonClick(val) {
|
||||||
if (val.statisticType === 2) {
|
|
||||||
this.tableProps[0].filter = (val) =>
|
|
||||||
parseTime(val, '{y}年第{w}周');
|
|
||||||
}else{
|
|
||||||
this.tableProps[0].filter = (val) =>
|
|
||||||
parseTime(val, '{y}年{m}月{d}日');
|
|
||||||
}
|
|
||||||
this.formConfig2[1].startPlaceholder = '开始时间';
|
|
||||||
this.formConfig2[1].endPlaceholder = '结束时间';
|
|
||||||
switch (val.btnName) {
|
switch (val.btnName) {
|
||||||
case 'search':
|
case 'search':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.name = val.name || null;
|
this.listQuery.name = val.name || null;
|
||||||
this.listQuery.statisticType = val.statisticType || 1;
|
this.listQuery.statisticType = val.statisticType || 1;
|
||||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||||
this.listQuery.endTime = val.searchTime
|
this.listQuery.endTime = val.searchTime
|
||||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
? val.searchTime[1]
|
||||||
: null;
|
: null;
|
||||||
if (this.activeName === 'his') {
|
if (this.activeName === 'his') {
|
||||||
|
this.listQuery.endTime = val.searchTime
|
||||||
|
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||||
|
: null;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
} else {
|
} else {
|
||||||
this.getDataList2();
|
this.getDataList2();
|
||||||
@@ -267,13 +273,18 @@ export default {
|
|||||||
break;
|
break;
|
||||||
case 'export':
|
case 'export':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.name = val.name || null;
|
this.listQuery.name = val.name || null;
|
||||||
this.listQuery.statisticType = val.statisticType || 1;
|
this.listQuery.statisticType = val.statisticType || 1;
|
||||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||||
|
this.listQuery.endTime = val.searchTime
|
||||||
|
? val.searchTime[1]
|
||||||
|
: null;
|
||||||
|
if (this.activeName === 'his') {
|
||||||
this.listQuery.endTime = val.searchTime
|
this.listQuery.endTime = val.searchTime
|
||||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||||
: null;
|
: null;
|
||||||
|
}
|
||||||
this.handleExport();
|
this.handleExport();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -295,15 +306,26 @@ export default {
|
|||||||
const end = new Date();
|
const end = new Date();
|
||||||
const start = new Date();
|
const start = new Date();
|
||||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||||
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 00:00:00';
|
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 08:30:00';
|
||||||
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 23:59:59';
|
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 08:30:00';
|
||||||
this.formConfig2[1].startPlaceholder = parseTime(start).substr(0, 10);
|
this.$nextTick(() => {
|
||||||
this.formConfig2[1].endPlaceholder = parseTime(end).substr(0, 10);
|
this.$refs.searchBarForm2.formInline.searchTime = [
|
||||||
|
this.listQuery.startTime,
|
||||||
|
this.listQuery.endTime,
|
||||||
|
];
|
||||||
|
});
|
||||||
this.listQuery.name = null;
|
this.listQuery.name = null;
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.getDataList2();
|
this.getDataList2();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
getNavDataList(){
|
||||||
|
if (this.activeName === 'his') {
|
||||||
|
this.getDataList();
|
||||||
|
} else {
|
||||||
|
this.getDataList2();
|
||||||
|
}
|
||||||
|
},
|
||||||
// 获取数据2列表
|
// 获取数据2列表
|
||||||
getDataList2() {
|
getDataList2() {
|
||||||
getRawOthercostSunPage(this.listQuery).then((response) => {
|
getRawOthercostSunPage(this.listQuery).then((response) => {
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ const tableProps = [
|
|||||||
prop: 'price',
|
prop: 'price',
|
||||||
label: '成本金额',
|
label: '成本金额',
|
||||||
align: 'right',
|
align: 'right',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'remark',
|
prop: 'remark',
|
||||||
@@ -161,7 +162,7 @@ export default {
|
|||||||
switch (val.btnName) {
|
switch (val.btnName) {
|
||||||
case 'search':
|
case 'search':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.name = val.name||null;
|
this.listQuery.name = val.name||null;
|
||||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||||
this.listQuery.endTime = val.searchTime
|
this.listQuery.endTime = val.searchTime
|
||||||
@@ -174,7 +175,7 @@ export default {
|
|||||||
break;
|
break;
|
||||||
case 'export':
|
case 'export':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.name = val.name||null;
|
this.listQuery.name = val.name||null;
|
||||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||||
this.listQuery.endTime = val.searchTime
|
this.listQuery.endTime = val.searchTime
|
||||||
|
|||||||
@@ -10,9 +10,9 @@
|
|||||||
<span>
|
<span>
|
||||||
{{
|
{{
|
||||||
injectData.type == 1
|
injectData.type == 1
|
||||||
? `每天等价,${injectData.price}元`
|
? `每天等价,${Number(injectData.price)}元`
|
||||||
: injectData.type == 2
|
: injectData.type == 2
|
||||||
? `总价${injectData.price}元,年折旧率${injectData.ratio}%,折旧年限${injectData.timeLimit}年`
|
? `总价${Number(injectData.price)}元,年折旧率${injectData.ratio}%,折旧年限${injectData.timeLimit}年`
|
||||||
: '-'
|
: '-'
|
||||||
}}
|
}}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
:page.sync="listQuery.pageNo"
|
:page.sync="listQuery.pageNo"
|
||||||
:limit.sync="listQuery.pageSize"
|
:limit.sync="listQuery.pageSize"
|
||||||
:total="listQuery.total"
|
:total="listQuery.total"
|
||||||
@pagination="getDataList" />
|
@pagination="getNavDataList" />
|
||||||
<base-dialog
|
<base-dialog
|
||||||
:dialogTitle="addOrEditTitle"
|
:dialogTitle="addOrEditTitle"
|
||||||
:dialogVisible="addOrUpdateVisible"
|
:dialogVisible="addOrUpdateVisible"
|
||||||
@@ -85,9 +85,12 @@ import ButtonNav from '@/components/ButtonNav';
|
|||||||
|
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
{
|
{
|
||||||
prop: 'recTime',
|
prop: 'time',
|
||||||
label: '日期',
|
label: '日期',
|
||||||
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
|
},
|
||||||
|
{
|
||||||
|
prop: 'remark',
|
||||||
|
label: '备注',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'productionLineName',
|
prop: 'productionLineName',
|
||||||
@@ -100,22 +103,27 @@ const tableProps = [
|
|||||||
{
|
{
|
||||||
prop: 'innum',
|
prop: 'innum',
|
||||||
label: '上片数量',
|
label: '上片数量',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'outnum',
|
prop: 'outnum',
|
||||||
label: '下片数量',
|
label: '下片数量',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'ratio',
|
prop: 'ratio',
|
||||||
label: '良品率',
|
label: '良品率',
|
||||||
filter: (val) => (val ? val * 100 + '%' : '-'),
|
filter: (val) => (val ? Number(val * 100).toFixed(2) + '%' : '-'),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const tableProps2 = [
|
const tableProps2 = [
|
||||||
{
|
{
|
||||||
prop: 'recTime',
|
prop: 'time',
|
||||||
label: '日期',
|
label: '日期',
|
||||||
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
|
},
|
||||||
|
{
|
||||||
|
prop: 'remark',
|
||||||
|
label: '备注',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'productionLineName',
|
prop: 'productionLineName',
|
||||||
@@ -128,15 +136,17 @@ const tableProps2 = [
|
|||||||
{
|
{
|
||||||
prop: 'innum',
|
prop: 'innum',
|
||||||
label: '进片数量',
|
label: '进片数量',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'outnum',
|
prop: 'outnum',
|
||||||
label: '出片数量',
|
label: '出片数量',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'ratio',
|
prop: 'ratio',
|
||||||
label: '良品率',
|
label: '良品率',
|
||||||
filter: (val) => (val ? val * 100 + '%' : '-'),
|
filter: (val) => (val ? Number(val * 100).toFixed(2) + '%' : '-'),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
export default {
|
export default {
|
||||||
@@ -170,13 +180,15 @@ export default {
|
|||||||
{
|
{
|
||||||
type: 'datePicker',
|
type: 'datePicker',
|
||||||
label: '时间范围',
|
label: '时间范围',
|
||||||
dateType: 'daterange',
|
dateType: 'datetimerange',
|
||||||
format: 'yyyy-MM-dd',
|
format: 'yyyy-MM-dd HH:mm:ss',
|
||||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||||
rangeSeparator: '-',
|
rangeSeparator: '-',
|
||||||
startPlaceholder: '开始时间',
|
startPlaceholder: '开始时间',
|
||||||
endPlaceholder: '结束时间',
|
endPlaceholder: '结束时间',
|
||||||
|
defaultTime: ['08:30:00', '08:30:00'],
|
||||||
param: 'searchTime',
|
param: 'searchTime',
|
||||||
|
width: 350,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'button',
|
type: 'button',
|
||||||
@@ -225,22 +237,15 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
buttonClick(val) {
|
buttonClick(val) {
|
||||||
if (val.statisticType === 2) {
|
|
||||||
this.tableProps[0].filter = (val) =>
|
|
||||||
parseTime(val, '{y}年第{w}周');
|
|
||||||
}else{
|
|
||||||
this.tableProps[0].filter = (val) =>
|
|
||||||
parseTime(val, '{y}年{m}月{d}日');
|
|
||||||
}
|
|
||||||
switch (val.btnName) {
|
switch (val.btnName) {
|
||||||
case 'search':
|
case 'search':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.productionLineId = val.name || null;
|
this.listQuery.productionLineId = val.name || null;
|
||||||
this.listQuery.statisticType = val.statisticType || 1;
|
this.listQuery.statisticType = val.statisticType || 1;
|
||||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||||
this.listQuery.endTime = val.searchTime
|
this.listQuery.endTime = val.searchTime
|
||||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
? val.searchTime[1]
|
||||||
: null;
|
: null;
|
||||||
if (this.activeName === 'his') {
|
if (this.activeName === 'his') {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
@@ -253,12 +258,12 @@ export default {
|
|||||||
break;
|
break;
|
||||||
case 'export':
|
case 'export':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.productionLineId = val.name || null;
|
this.listQuery.productionLineId = val.name || null;
|
||||||
this.listQuery.statisticType = val.statisticType || 1;
|
this.listQuery.statisticType = val.statisticType || 1;
|
||||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||||
this.listQuery.endTime = val.searchTime
|
this.listQuery.endTime = val.searchTime
|
||||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
? val.searchTime[1]
|
||||||
: null;
|
: null;
|
||||||
this.handleExport();
|
this.handleExport();
|
||||||
break;
|
break;
|
||||||
@@ -309,10 +314,20 @@ export default {
|
|||||||
this.otherMethods(val);
|
this.otherMethods(val);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
getNavDataList(){
|
||||||
|
if (this.activeName === 'his') {
|
||||||
|
this.getDataList();
|
||||||
|
} else {
|
||||||
|
this.getDataList2();
|
||||||
|
}
|
||||||
|
},
|
||||||
successSubmit() {
|
successSubmit() {
|
||||||
this.handleCancel();
|
this.handleCancel();
|
||||||
const val = this.activeName === 'his' ? '产线良品率' : 'now';
|
if (this.activeName === 'his') {
|
||||||
this.currentMenu(val);
|
this.getDataList();
|
||||||
|
} else {
|
||||||
|
this.getDataList2();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
:page.sync="listQuery.pageNo"
|
:page.sync="listQuery.pageNo"
|
||||||
:limit.sync="listQuery.pageSize"
|
:limit.sync="listQuery.pageSize"
|
||||||
:total="listQuery.total"
|
:total="listQuery.total"
|
||||||
@pagination="getDataList" />
|
@pagination="getNavDataList" />
|
||||||
<base-dialog
|
<base-dialog
|
||||||
:dialogTitle="addOrEditTitle"
|
:dialogTitle="addOrEditTitle"
|
||||||
:dialogVisible="addOrUpdateVisible"
|
:dialogVisible="addOrUpdateVisible"
|
||||||
@@ -87,9 +87,12 @@ import ButtonNav from '@/components/ButtonNav';
|
|||||||
|
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
{
|
{
|
||||||
prop: 'recTime',
|
prop: 'time',
|
||||||
label: '时间',
|
label: '时间',
|
||||||
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
|
},
|
||||||
|
{
|
||||||
|
prop: 'remark',
|
||||||
|
label: '备注',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'bindObjectName',
|
prop: 'bindObjectName',
|
||||||
@@ -102,33 +105,42 @@ const tableProps = [
|
|||||||
{
|
{
|
||||||
prop: 'inCount',
|
prop: 'inCount',
|
||||||
label: '上片数量',
|
label: '上片数量',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'outCount',
|
prop: 'outCount',
|
||||||
label: '下片数量',
|
label: '下片数量',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'ratio',
|
prop: 'ratio',
|
||||||
label: '良品率',
|
label: '良品率',
|
||||||
filter: (val) => (val ? val * 100 + '%' : '-'),
|
filter: (val) => (val ? Number(val * 100).toFixed(2) + '%' : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'costSum',
|
prop: 'costSum',
|
||||||
label: '深加工成本/元',
|
label: '深加工成本/元',
|
||||||
align: 'right',
|
align: 'right',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'costPiece',
|
prop: 'costPiece',
|
||||||
label: '单片成本/元',
|
label: '单片成本/元',
|
||||||
align: 'right',
|
align: 'right',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'costArea',
|
prop: 'costArea',
|
||||||
label: '每平米成本/元',
|
label: '每平米成本/元',
|
||||||
align: 'right',
|
align: 'right',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const tableProps2 = [
|
const tableProps2 = [
|
||||||
|
{
|
||||||
|
prop: 'remark',
|
||||||
|
label: '备注',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
prop: 'bindObjectName',
|
prop: 'bindObjectName',
|
||||||
label: '产线',
|
label: '产线',
|
||||||
@@ -140,30 +152,35 @@ const tableProps2 = [
|
|||||||
{
|
{
|
||||||
prop: 'inCount',
|
prop: 'inCount',
|
||||||
label: '上片数量',
|
label: '上片数量',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'outCount',
|
prop: 'outCount',
|
||||||
label: '下片数量',
|
label: '下片数量',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'ratio',
|
prop: 'ratio',
|
||||||
label: '良品率',
|
label: '良品率',
|
||||||
filter: (val) => (val ? val * 100 + '%' : '-'),
|
filter: (val) => (val ? Number(val * 100).toFixed(2) + '%' : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'costSum',
|
prop: 'costSum',
|
||||||
label: '深加工成本/元',
|
label: '深加工成本/元',
|
||||||
align: 'right',
|
align: 'right',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'costPiece',
|
prop: 'costPiece',
|
||||||
label: '单片成本/元',
|
label: '单片成本/元',
|
||||||
align: 'right',
|
align: 'right',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'costArea',
|
prop: 'costArea',
|
||||||
label: '每平米成本/元',
|
label: '每平米成本/元',
|
||||||
align: 'right',
|
align: 'right',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
export default {
|
export default {
|
||||||
@@ -225,13 +242,16 @@ export default {
|
|||||||
{
|
{
|
||||||
type: 'datePicker',
|
type: 'datePicker',
|
||||||
label: '时间范围',
|
label: '时间范围',
|
||||||
dateType: 'daterange',
|
dateType: 'datetimerange',
|
||||||
format: 'yyyy-MM-dd',
|
format: 'yyyy-MM-dd HH:mm:ss',
|
||||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||||
rangeSeparator: '-',
|
rangeSeparator: '-',
|
||||||
startPlaceholder: '开始时间',
|
startPlaceholder: '开始时间',
|
||||||
endPlaceholder: '结束时间',
|
endPlaceholder: '结束时间',
|
||||||
|
defaultTime: ['08:30:00', '08:30:00'],
|
||||||
param: 'searchTime',
|
param: 'searchTime',
|
||||||
|
width: 350,
|
||||||
|
clearable: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'select',
|
type: 'select',
|
||||||
@@ -288,26 +308,20 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
buttonClick(val) {
|
buttonClick(val) {
|
||||||
if (val.statisticType === 2) {
|
|
||||||
this.tableProps[0].filter = (val) =>
|
|
||||||
parseTime(val, '{y}年第{w}周');
|
|
||||||
}else{
|
|
||||||
this.tableProps[0].filter = (val) =>
|
|
||||||
parseTime(val, '{y}年{m}月{d}日');
|
|
||||||
}
|
|
||||||
this.formConfig2[0].startPlaceholder = '开始时间';
|
|
||||||
this.formConfig2[0].endPlaceholder = '结束时间';
|
|
||||||
switch (val.btnName) {
|
switch (val.btnName) {
|
||||||
case 'search':
|
case 'search':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.bindObjectId = val.name || null;
|
this.listQuery.bindObjectId = val.name || null;
|
||||||
this.listQuery.statisticType = val.statisticType || 1;
|
this.listQuery.statisticType = val.statisticType || 1;
|
||||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||||
this.listQuery.endTime = val.searchTime
|
this.listQuery.endTime = val.searchTime
|
||||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
? val.searchTime[1]
|
||||||
: null;
|
: null;
|
||||||
if (this.activeName === 'his') {
|
if (this.activeName === 'his') {
|
||||||
|
this.listQuery.endTime = val.searchTime
|
||||||
|
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||||
|
: null;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
} else {
|
} else {
|
||||||
this.getDataList2();
|
this.getDataList2();
|
||||||
@@ -318,13 +332,18 @@ export default {
|
|||||||
break;
|
break;
|
||||||
case 'export':
|
case 'export':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.bindObjectId = val.name || null;
|
this.listQuery.bindObjectId = val.name || null;
|
||||||
this.listQuery.statisticType = val.statisticType || 1;
|
this.listQuery.statisticType = val.statisticType || 1;
|
||||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||||
|
this.listQuery.endTime = val.searchTime
|
||||||
|
? val.searchTime[1]
|
||||||
|
: null;
|
||||||
|
if (this.activeName === 'his') {
|
||||||
this.listQuery.endTime = val.searchTime
|
this.listQuery.endTime = val.searchTime
|
||||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||||
: null;
|
: null;
|
||||||
|
}
|
||||||
this.handleExport();
|
this.handleExport();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -346,15 +365,26 @@ export default {
|
|||||||
const end = new Date();
|
const end = new Date();
|
||||||
const start = new Date();
|
const start = new Date();
|
||||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||||
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 00:00:00';
|
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 08:30:00';
|
||||||
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 23:59:59';
|
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 08:30:00';
|
||||||
this.formConfig2[0].startPlaceholder = parseTime(start).substr(0, 10);
|
this.$nextTick(() => {
|
||||||
this.formConfig2[0].endPlaceholder = parseTime(end).substr(0, 10);
|
this.$refs.searchBarForm2.formInline.searchTime = [
|
||||||
|
this.listQuery.startTime,
|
||||||
|
this.listQuery.endTime,
|
||||||
|
];
|
||||||
|
});
|
||||||
this.listQuery.name = null;
|
this.listQuery.name = null;
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.getDataList2();
|
this.getDataList2();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
getNavDataList(){
|
||||||
|
if (this.activeName === 'his') {
|
||||||
|
this.getDataList();
|
||||||
|
} else {
|
||||||
|
this.getDataList2();
|
||||||
|
}
|
||||||
|
},
|
||||||
// 获取数据2列表
|
// 获取数据2列表
|
||||||
getDataList2() {
|
getDataList2() {
|
||||||
if (this.listQuery.startTime) {
|
if (this.listQuery.startTime) {
|
||||||
|
|||||||
423
src/views/cost/index.vue
Normal file
423
src/views/cost/index.vue
Normal file
@@ -0,0 +1,423 @@
|
|||||||
|
<template>
|
||||||
|
<div class="home-page">
|
||||||
|
<div class="date-tabs">
|
||||||
|
<!-- @tab-click="handleClick" -->
|
||||||
|
<el-tabs v-model="activeName" @tab-click="timedayChange" :stretch="true">
|
||||||
|
<el-tab-pane
|
||||||
|
:label="'\u2002\u2002日\u2002\u2002'"
|
||||||
|
name="日"></el-tab-pane>
|
||||||
|
<el-tab-pane
|
||||||
|
:label="'\u2002\u2002周\u2002\u2002'"
|
||||||
|
name="周"></el-tab-pane>
|
||||||
|
<el-tab-pane
|
||||||
|
:label="'\u2002\u2002月\u2002\u2002'"
|
||||||
|
name="月"></el-tab-pane>
|
||||||
|
<el-tab-pane
|
||||||
|
:label="'\u2002\u2002年\u2002\u2002'"
|
||||||
|
name="年"></el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
<div class="detail">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="timeday"
|
||||||
|
align="right"
|
||||||
|
type="date"
|
||||||
|
format="yyyy-MM-dd"
|
||||||
|
valueFormat="yyyy-MM-dd"
|
||||||
|
:clearable="false"
|
||||||
|
@change="timedayChange"
|
||||||
|
placeholder="选择日期"
|
||||||
|
:picker-options="pickerOptions"></el-date-picker>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-row class="main-top" :gutter="16">
|
||||||
|
<el-col :span="24" style="position: relative">
|
||||||
|
<div class="title">
|
||||||
|
<svg-icon icon-class="home-produce" />
|
||||||
|
<span class="title-inner">生产总成本</span>
|
||||||
|
</div>
|
||||||
|
<el-row class="box">
|
||||||
|
<el-col :span="4" class="num-box shadow">
|
||||||
|
<div class="num-style">{{ homeData.priceS }}万元</div>
|
||||||
|
<div class="unit-style">总计成本</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4" class="num-box shadow">
|
||||||
|
<div class="num-style">{{ homeData.matPriceS }}万元</div>
|
||||||
|
<div class="unit-style">原料成本</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4" class="num-box shadow">
|
||||||
|
<div class="num-style">{{ homeData.energyPriceS }}万元</div>
|
||||||
|
<div class="unit-style">能源成本</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4" class="num-box shadow">
|
||||||
|
<div class="num-style">{{ homeData.otherPriceS }}万元</div>
|
||||||
|
<div class="unit-style">其他成本</div>
|
||||||
|
</el-col>
|
||||||
|
<!-- <el-col :span="4" class="num-box shadow">
|
||||||
|
<div class="num-style">{{ homeData.ratioS }}</div>
|
||||||
|
<div class="unit-style">综合良品率/%</div>
|
||||||
|
</el-col> -->
|
||||||
|
<el-col :span="4" class="num-box shadow">
|
||||||
|
<div class="num-style">{{ homeData.areaPriceS }}元</div>
|
||||||
|
<div class="unit-style">综合每平米成本</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24" style="position: relative">
|
||||||
|
<div class="title">
|
||||||
|
<svg-icon icon-class="home-produce" />
|
||||||
|
<span class="title-inner">原片成本</span>
|
||||||
|
</div>
|
||||||
|
<el-row class="box">
|
||||||
|
<el-col :span="4" class="num-box shadow">
|
||||||
|
<div class="num-style">{{ homeData.priceO }}万元</div>
|
||||||
|
<div class="unit-style">原片总成本</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4" class="num-box shadow">
|
||||||
|
<div class="num-style">{{ homeData.matPriceO }}万元</div>
|
||||||
|
<div class="unit-style">原料成本</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4" class="num-box shadow">
|
||||||
|
<div class="num-style">{{ homeData.energyPriceO }}万元</div>
|
||||||
|
<div class="unit-style">能源成本</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4" class="num-box shadow">
|
||||||
|
<div class="num-style">{{ homeData.otherPriceO }}万元</div>
|
||||||
|
<div class="unit-style">其他成本</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4" class="num-box shadow">
|
||||||
|
<div class="num-style">{{ homeData.ratioO }}</div>
|
||||||
|
<div class="unit-style">原片良品率/%</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4" class="num-box shadow">
|
||||||
|
<div class="num-style">{{ homeData.areaPriceO }}元</div>
|
||||||
|
<div class="unit-style">原片每平米成本</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24" style="position: relative">
|
||||||
|
<div class="title">
|
||||||
|
<svg-icon icon-class="home-produce" />
|
||||||
|
<span class="title-inner">深加工成本</span>
|
||||||
|
</div>
|
||||||
|
<el-row class="box">
|
||||||
|
<el-col :span="4" class="num-box shadow">
|
||||||
|
<div class="num-style">{{ homeData.priceD }}万元</div>
|
||||||
|
<div class="unit-style">深加工总成本</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4" class="num-box shadow">
|
||||||
|
<div class="num-style">{{ homeData.energyPriceD }}万元</div>
|
||||||
|
<div class="unit-style">能源成本</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4" class="num-box shadow">
|
||||||
|
<div class="num-style">{{ homeData.otherPriceD }}万元</div>
|
||||||
|
<div class="unit-style">其他成本</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4" class="num-box shadow">
|
||||||
|
<div class="num-style">{{ homeData.ratioD }}</div>
|
||||||
|
<div class="unit-style">深加工良品率/%</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4" class="num-box shadow">
|
||||||
|
<div class="num-style">{{ homeData.areaPriceD }}元</div>
|
||||||
|
<div class="unit-style">深加工每平米成本</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row class="main-bottom" :gutter="16" v-if="false">
|
||||||
|
<el-col :span="9">
|
||||||
|
<div class="chart-wrapper">
|
||||||
|
<line-chart :chart-data="lineChartData" />
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="7">
|
||||||
|
<div class="chart-wrapper">
|
||||||
|
<pie-chart />
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<div class="chart-wrapper">
|
||||||
|
<bar-chart />
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<div
|
||||||
|
class="main-footer"
|
||||||
|
style="
|
||||||
|
color: #c7c7c7;
|
||||||
|
user-select: none;
|
||||||
|
font-size: 14px;
|
||||||
|
letter-spacing: 1px;
|
||||||
|
height: 30px;
|
||||||
|
display: grid;
|
||||||
|
place-content: center;
|
||||||
|
">
|
||||||
|
© 中建材智能自动化研究院有限公司
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import moment from 'moment';
|
||||||
|
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||||
|
import LineChart from '../dashboard/LineChart';
|
||||||
|
import PieChart from '../dashboard/PieChart';
|
||||||
|
import BarChart from '../dashboard/BarChart';
|
||||||
|
import PanelGroup from '../dashboard/PanelGroup';
|
||||||
|
import { getData } from '@/api/cost/allCost';
|
||||||
|
import { getUserProfile } from '@/api/system/user';
|
||||||
|
|
||||||
|
const lineChartData = {
|
||||||
|
newVisitis: {
|
||||||
|
expectedData: [100, 120, 161, 134, 105, 160, 165],
|
||||||
|
actualData: [120, 82, 91, 154, 162, 140, 145],
|
||||||
|
},
|
||||||
|
messages: {
|
||||||
|
expectedData: [200, 192, 120, 144, 160, 130, 140],
|
||||||
|
actualData: [180, 160, 151, 106, 145, 150, 130],
|
||||||
|
},
|
||||||
|
purchases: {
|
||||||
|
expectedData: [80, 100, 121, 104, 105, 90, 100],
|
||||||
|
actualData: [120, 90, 100, 138, 142, 130, 130],
|
||||||
|
},
|
||||||
|
shoppings: {
|
||||||
|
expectedData: [130, 140, 141, 142, 145, 150, 160],
|
||||||
|
actualData: [120, 82, 91, 154, 162, 140, 130],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'Home',
|
||||||
|
mixins: [tableHeightMixin],
|
||||||
|
components: {
|
||||||
|
LineChart,
|
||||||
|
PieChart,
|
||||||
|
PanelGroup,
|
||||||
|
BarChart,
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
gradientBackground() {
|
||||||
|
return {
|
||||||
|
'background-image':
|
||||||
|
'linear-gradient(90deg, #f0f0f0 25%, rgba(255, 255, 255, 0) 25%, rgba(255, 255, 255, 0) 50%, #f0f0f0 50%, #f0f0f0 75%, rgba(255, 255, 255, 0) 75%, rgba(255, 255, 255, 0))',
|
||||||
|
'background-size': '100px 100px', // 调整条纹的大小
|
||||||
|
};
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
activeName: '日',
|
||||||
|
user: '',
|
||||||
|
lineChartData: lineChartData.newVisitis,
|
||||||
|
homeData: {},
|
||||||
|
timeday: moment(new Date()).subtract(1, 'days').format('YYYY-MM-DD'),
|
||||||
|
startTime:
|
||||||
|
moment(new Date()).subtract(0, 'days').format('YYYY-MM-DD') +
|
||||||
|
' 00:00:00',
|
||||||
|
endTime:
|
||||||
|
moment(new Date()).subtract(-1, 'days').format('YYYY-MM-DD') +
|
||||||
|
' 00:00:00',
|
||||||
|
|
||||||
|
pickerOptions: {
|
||||||
|
disabledDate(time) {
|
||||||
|
return time.getTime() + 3600 * 1000 * 24 > Date.now();
|
||||||
|
},
|
||||||
|
shortcuts: [
|
||||||
|
{
|
||||||
|
text: '今天',
|
||||||
|
onClick(picker) {
|
||||||
|
picker.$emit('pick', new Date());
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: '昨天',
|
||||||
|
onClick(picker) {
|
||||||
|
const date = new Date();
|
||||||
|
date.setTime(date.getTime() - 3600 * 1000 * 24);
|
||||||
|
picker.$emit('pick', date);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: '一周前',
|
||||||
|
onClick(picker) {
|
||||||
|
const date = new Date();
|
||||||
|
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
|
||||||
|
picker.$emit('pick', date);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getData() {
|
||||||
|
let listQuery = {
|
||||||
|
//分页
|
||||||
|
pageSize: 10,
|
||||||
|
pageNo: 1,
|
||||||
|
statisticType: ['', '日', '周', '月', '年'].indexOf(this.activeName),
|
||||||
|
startTime: this.timeday + ' 00:00:00',
|
||||||
|
};
|
||||||
|
getData(listQuery).then((response) => {
|
||||||
|
this.homeData = response.data;
|
||||||
|
for (let i in this.homeData) {
|
||||||
|
this.homeData[i] = Number(this.homeData[i]).toFixed(2);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
timedayChange() {
|
||||||
|
let listQuery = {
|
||||||
|
//分页
|
||||||
|
pageSize: 10,
|
||||||
|
pageNo: 1,
|
||||||
|
statisticType: ['', '日', '周', '月', '年'].indexOf(this.activeName),
|
||||||
|
startTime: this.timeday + ' 00:00:00',
|
||||||
|
};
|
||||||
|
getData(listQuery).then((response) => {
|
||||||
|
this.homeData = response.data;
|
||||||
|
for (let i in this.homeData) {
|
||||||
|
this.homeData[i] = Number(this.homeData[i]).toFixed(2);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
goDetail() {
|
||||||
|
this.$router.push({ path: 'indexDetail' });
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.home-page::before {
|
||||||
|
background-image: url('~@/assets/img/home-bg.png');
|
||||||
|
background-size: cover;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center;
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
|
.date-tabs {
|
||||||
|
padding-left: 40px;
|
||||||
|
padding-top: 20px;
|
||||||
|
position: relative;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
:deep(.date-tabs) {
|
||||||
|
.el-tabs__header {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
display: inline-block;
|
||||||
|
transform: translateY(-12px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tabs__content {
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-tabs__item {
|
||||||
|
font-size: 18px;
|
||||||
|
color: #fff;
|
||||||
|
padding-left: 0 !important;
|
||||||
|
padding-right: 0 !important;
|
||||||
|
line-height: 36px !important;
|
||||||
|
height: 36px;
|
||||||
|
}
|
||||||
|
.el-tabs__item.is-active {
|
||||||
|
color: #0b58ff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.detail {
|
||||||
|
display: inline-block;
|
||||||
|
position: absolute;
|
||||||
|
left: 260px;
|
||||||
|
top: 10px;
|
||||||
|
}
|
||||||
|
:deep(.detail) {
|
||||||
|
.el-input__inner {
|
||||||
|
background-color: transparent;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// .current-date {
|
||||||
|
// color: #fff;
|
||||||
|
// font-size: 18px;
|
||||||
|
// position: absolute;
|
||||||
|
// left: 260px;
|
||||||
|
// top: 14px;
|
||||||
|
// }
|
||||||
|
.current-time {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 18px;
|
||||||
|
position: absolute;
|
||||||
|
right: 38px;
|
||||||
|
top: 14px;
|
||||||
|
}
|
||||||
|
.main-top {
|
||||||
|
width: 100%;
|
||||||
|
padding: 0 20px 0 40px;
|
||||||
|
.title {
|
||||||
|
position: absolute;
|
||||||
|
left: 34px;
|
||||||
|
top: 20px;
|
||||||
|
width: 180px;
|
||||||
|
font-size: 32px;
|
||||||
|
z-index: 10;
|
||||||
|
.title-inner {
|
||||||
|
position: absolute;
|
||||||
|
left: 42px;
|
||||||
|
top: 5px;
|
||||||
|
font-size: calc(100vw * 20 / 1920);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.box {
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 24px;
|
||||||
|
height: 192px;
|
||||||
|
padding: 40px 24px 32px 24px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
box-shadow: 0 8px 8px 0 gray;
|
||||||
|
.num-box {
|
||||||
|
height: 120px;
|
||||||
|
padding-top: 26px;
|
||||||
|
text-align: center;
|
||||||
|
.num-style {
|
||||||
|
color: #000;
|
||||||
|
font-size: calc(100vw * 40 / 1920);
|
||||||
|
}
|
||||||
|
.unit-style {
|
||||||
|
color: rgba(0, 0, 0, 0.7);
|
||||||
|
font-size: calc(100vw * 18 / 1920);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.shadow {
|
||||||
|
background: linear-gradient(90deg, #ffffff 80%, #f2f4f9 100%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.main-bottom {
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 20px;
|
||||||
|
.chart-wrapper {
|
||||||
|
margin-left: 10px;
|
||||||
|
height: 425px;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 5px;
|
||||||
|
box-shadow: 0 3px 3px 0 gray;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style lang="scss">
|
||||||
|
.home-page {
|
||||||
|
.el-progress-bar__inner {
|
||||||
|
background-image: url('~@/assets/img/home-progress-bg.png');
|
||||||
|
background-size: cover;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
199
src/views/cost/indexDetail.vue
Normal file
199
src/views/cost/indexDetail.vue
Normal file
@@ -0,0 +1,199 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<search-bar
|
||||||
|
:formConfigs="formConfig"
|
||||||
|
ref="searchBarForm"
|
||||||
|
@headBtnClick="buttonClick" />
|
||||||
|
<base-table
|
||||||
|
:table-props="tableProps1"
|
||||||
|
:page="1"
|
||||||
|
:limit="100"
|
||||||
|
:table-data="tableData1"></base-table>
|
||||||
|
<base-table
|
||||||
|
:table-props="tableProps2"
|
||||||
|
:page="1"
|
||||||
|
:limit="100"
|
||||||
|
:table-data="tableData2"></base-table>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getDetailData } from '@/api/cost/allCost';
|
||||||
|
import moment from 'moment';
|
||||||
|
|
||||||
|
const tableProps1 = [
|
||||||
|
{
|
||||||
|
prop: 'name',
|
||||||
|
label: '成本项目-原片',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'f1',
|
||||||
|
label: '本期领用',
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
prop: 'quantity',
|
||||||
|
label: '数量',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'price',
|
||||||
|
label: '单价',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'sumPrice',
|
||||||
|
label: '金额',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'sprice',
|
||||||
|
label: '单位成本',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const tableProps2 = [
|
||||||
|
{
|
||||||
|
prop: 'name',
|
||||||
|
label: '成本项目-加工',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'quantity',
|
||||||
|
label: '耗用数量',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'price',
|
||||||
|
label: '平均耗用单价',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'sumPrice',
|
||||||
|
label: '总成本',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'sprice',
|
||||||
|
label: '综合单位成本',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
tableProps1,
|
||||||
|
tableData1: [],
|
||||||
|
tableProps2,
|
||||||
|
tableData2: [],
|
||||||
|
listQuery: {
|
||||||
|
pageSize: 10,
|
||||||
|
pageNo: 1,
|
||||||
|
statisticType: 1,
|
||||||
|
},
|
||||||
|
activeName: '日',
|
||||||
|
startTime:
|
||||||
|
moment(new Date()).subtract(1, 'days').format('YYYY-MM-DD') +
|
||||||
|
' 00:00:00',
|
||||||
|
endTime:
|
||||||
|
moment(new Date()).subtract(-1, 'days').format('YYYY-MM-DD') +
|
||||||
|
' 00:00:00',
|
||||||
|
formConfig: [
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: '维度',
|
||||||
|
selectOptions: [
|
||||||
|
{ id: 1, name: '日' },
|
||||||
|
{ id: 2, name: '周' },
|
||||||
|
{ id: 3, name: '月' },
|
||||||
|
{ id: 4, name: '年' },
|
||||||
|
],
|
||||||
|
param: 'statisticType',
|
||||||
|
defaultSelect: 1, // 默认值,
|
||||||
|
clearable: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// 日期选择
|
||||||
|
type: 'datePicker',
|
||||||
|
// label: '日期',
|
||||||
|
dateType: 'date',
|
||||||
|
placeholder: '选择日期',
|
||||||
|
format: 'yyyy-MM-dd',
|
||||||
|
valueFormat: 'yyyy-MM-dd',
|
||||||
|
param: 'timeday',
|
||||||
|
clearable: false,
|
||||||
|
pickerOptions: {
|
||||||
|
disabledDate(time) {
|
||||||
|
return (time.getTime()+ 3600 * 1000 * 24) > Date.now();
|
||||||
|
},
|
||||||
|
shortcuts: [
|
||||||
|
{
|
||||||
|
text: '今天',
|
||||||
|
onClick(picker) {
|
||||||
|
picker.$emit('pick', new Date());
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: '昨天',
|
||||||
|
onClick(picker) {
|
||||||
|
const date = new Date();
|
||||||
|
date.setTime(date.getTime() - 3600 * 1000 * 24);
|
||||||
|
picker.$emit('pick', date);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: '一周前',
|
||||||
|
onClick(picker) {
|
||||||
|
const date = new Date();
|
||||||
|
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
|
||||||
|
picker.$emit('pick', date);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '搜索',
|
||||||
|
name: 'search',
|
||||||
|
color: 'primary',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'separate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '返回首页',
|
||||||
|
name: 'back',
|
||||||
|
color: 'warning',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
mounted() {
|
||||||
|
this.listQuery.startTime = this.startTime;
|
||||||
|
this.$refs.searchBarForm.formInline.timeday = this.startTime.substr(0, 10)
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 获取数据列表
|
||||||
|
getDataList() {
|
||||||
|
getDetailData(this.listQuery).then((response) => {
|
||||||
|
this.tableData1 = response.data.odata;
|
||||||
|
this.tableData2 = response.data.ddata;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
buttonClick(val) {
|
||||||
|
switch (val.btnName) {
|
||||||
|
case 'search':
|
||||||
|
console.log(val.timeday)
|
||||||
|
this.listQuery.statisticType = val.statisticType || 1;
|
||||||
|
this.listQuery.startTime = val.timeday
|
||||||
|
? val.timeday + ' 00:00:00'
|
||||||
|
: null;
|
||||||
|
this.getDataList();
|
||||||
|
break;
|
||||||
|
case 'back':
|
||||||
|
this.$router.go(-1)
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.log(val);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -77,7 +77,7 @@ export default {
|
|||||||
switch (val.btnName) {
|
switch (val.btnName) {
|
||||||
case 'search':
|
case 'search':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.name = val.name||null;
|
this.listQuery.name = val.name||null;
|
||||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||||
this.listQuery.endTime = val.searchTime
|
this.listQuery.endTime = val.searchTime
|
||||||
@@ -90,7 +90,7 @@ export default {
|
|||||||
break;
|
break;
|
||||||
case 'export':
|
case 'export':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.name = val.name;
|
this.listQuery.name = val.name;
|
||||||
this.listQuery.recTime = val.searchTime;
|
this.listQuery.recTime = val.searchTime;
|
||||||
this.handleExport();
|
this.handleExport();
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
:page.sync="listQuery.pageNo"
|
:page.sync="listQuery.pageNo"
|
||||||
:limit.sync="listQuery.pageSize"
|
:limit.sync="listQuery.pageSize"
|
||||||
:total="listQuery.total"
|
:total="listQuery.total"
|
||||||
@pagination="getDataList" />
|
@pagination="getNavDataList" />
|
||||||
<base-dialog
|
<base-dialog
|
||||||
:dialogTitle="addOrEditTitle"
|
:dialogTitle="addOrEditTitle"
|
||||||
:dialogVisible="addOrUpdateVisible"
|
:dialogVisible="addOrUpdateVisible"
|
||||||
@@ -86,24 +86,27 @@ import ButtonNav from '@/components/ButtonNav';
|
|||||||
|
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
{
|
{
|
||||||
prop: 'recTime',
|
prop: 'time',
|
||||||
label: '日期',
|
label: '日期',
|
||||||
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
|
},
|
||||||
|
{
|
||||||
|
prop: 'remark',
|
||||||
|
label: '备注',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'energyTypeName',
|
prop: 'energyTypeName',
|
||||||
label: '能源类型',
|
label: '能源类型',
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
prop: 'bindObjectName',
|
// prop: 'bindObjectName',
|
||||||
label: '监控对象',
|
// label: '监控对象',
|
||||||
filter: (val) => (val != null ? val : '--'),
|
// filter: (val) => (val != null ? val : '--'),
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
prop: 'meterName',
|
// prop: 'meterName',
|
||||||
label: '抄表名',
|
// label: '抄表名',
|
||||||
filter: (val) => (val != null ? val : '--'),
|
// filter: (val) => (val != null ? val : '--'),
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
prop: 'quantity',
|
prop: 'quantity',
|
||||||
label: '累计使用量',
|
label: '累计使用量',
|
||||||
@@ -115,20 +118,24 @@ const tableProps = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
const tableProps2 = [
|
const tableProps2 = [
|
||||||
|
{
|
||||||
|
prop: 'remark',
|
||||||
|
label: '备注',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
prop: 'energyTypeName',
|
prop: 'energyTypeName',
|
||||||
label: '能源类型',
|
label: '能源类型',
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
prop: 'bindObjectName',
|
// prop: 'bindObjectName',
|
||||||
label: '监控对象',
|
// label: '监控对象',
|
||||||
filter: (val) => (val != null ? val : '--'),
|
// filter: (val) => (val != null ? val : '--'),
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
prop: 'meter',
|
// prop: 'meter',
|
||||||
label: '抄表名',
|
// label: '抄表名',
|
||||||
filter: (val) => (val != null ? val : '--'),
|
// filter: (val) => (val != null ? val : '--'),
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
prop: 'quantity',
|
prop: 'quantity',
|
||||||
label: '累计使用量',
|
label: '累计使用量',
|
||||||
@@ -207,13 +214,16 @@ export default {
|
|||||||
{
|
{
|
||||||
type: 'datePicker',
|
type: 'datePicker',
|
||||||
label: '时间范围',
|
label: '时间范围',
|
||||||
dateType: 'daterange',
|
dateType: 'datetimerange',
|
||||||
format: 'yyyy-MM-dd',
|
format: 'yyyy-MM-dd HH:mm:ss',
|
||||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||||
rangeSeparator: '-',
|
rangeSeparator: '-',
|
||||||
startPlaceholder: '开始时间',
|
startPlaceholder: '开始时间',
|
||||||
endPlaceholder: '结束时间',
|
endPlaceholder: '结束时间',
|
||||||
|
defaultTime: ['08:30:00', '08:30:00'],
|
||||||
param: 'searchTime',
|
param: 'searchTime',
|
||||||
|
width: 350,
|
||||||
|
clearable: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'button',
|
type: 'button',
|
||||||
@@ -237,10 +247,11 @@ export default {
|
|||||||
activeName: 'his',
|
activeName: 'his',
|
||||||
tableProps,
|
tableProps,
|
||||||
tableProps2,
|
tableProps2,
|
||||||
tableBtn: [{
|
tableBtn: [
|
||||||
|
{
|
||||||
type: 'edit',
|
type: 'edit',
|
||||||
btnName: '编辑',
|
btnName: '编辑',
|
||||||
}
|
},
|
||||||
].filter((v) => v),
|
].filter((v) => v),
|
||||||
tableData: [],
|
tableData: [],
|
||||||
tableData2: [],
|
tableData2: [],
|
||||||
@@ -262,26 +273,18 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
buttonClick(val) {
|
buttonClick(val) {
|
||||||
if (val.statisticType === 2) {
|
|
||||||
this.tableProps[0].filter = (val) =>
|
|
||||||
parseTime(val, '{y}年第{w}周');
|
|
||||||
}else{
|
|
||||||
this.tableProps[0].filter = (val) =>
|
|
||||||
parseTime(val, '{y}年{m}月{d}日');
|
|
||||||
}
|
|
||||||
this.formConfig2[1].startPlaceholder = '开始时间';
|
|
||||||
this.formConfig2[1].endPlaceholder = '结束时间';
|
|
||||||
switch (val.btnName) {
|
switch (val.btnName) {
|
||||||
case 'search':
|
case 'search':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.energyTypeId = val.name || null;
|
this.listQuery.energyTypeId = val.name || null;
|
||||||
this.listQuery.statisticType = val.statisticType || 1;
|
this.listQuery.statisticType = val.statisticType || 1;
|
||||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||||
|
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;
|
||||||
|
if (this.activeName === 'his') {
|
||||||
this.listQuery.endTime = val.searchTime
|
this.listQuery.endTime = val.searchTime
|
||||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||||
: null;
|
: null;
|
||||||
if (this.activeName === 'his') {
|
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
} else {
|
} else {
|
||||||
this.getDataList2();
|
this.getDataList2();
|
||||||
@@ -292,13 +295,16 @@ export default {
|
|||||||
break;
|
break;
|
||||||
case 'export':
|
case 'export':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.energyTypeId = val.name || null;
|
this.listQuery.energyTypeId = val.name || null;
|
||||||
this.listQuery.statisticType = val.statisticType || 1;
|
this.listQuery.statisticType = val.statisticType || 1;
|
||||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||||
|
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;
|
||||||
|
if (this.activeName === 'his') {
|
||||||
this.listQuery.endTime = val.searchTime
|
this.listQuery.endTime = val.searchTime
|
||||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||||
: null;
|
: null;
|
||||||
|
}
|
||||||
this.handleExport();
|
this.handleExport();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -320,15 +326,26 @@ export default {
|
|||||||
const end = new Date();
|
const end = new Date();
|
||||||
const start = new Date();
|
const start = new Date();
|
||||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||||
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 00:00:00';
|
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 08:30:00';
|
||||||
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 23:59:59';
|
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 08:30:00';
|
||||||
this.formConfig2[1].startPlaceholder = parseTime(start).substr(0, 10);
|
this.$nextTick(() => {
|
||||||
this.formConfig2[1].endPlaceholder = parseTime(end).substr(0, 10);
|
this.$refs.searchBarForm2.formInline.searchTime = [
|
||||||
|
this.listQuery.startTime,
|
||||||
|
this.listQuery.endTime,
|
||||||
|
];
|
||||||
|
});
|
||||||
this.listQuery.name = null;
|
this.listQuery.name = null;
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.getDataList2();
|
this.getDataList2();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
getNavDataList() {
|
||||||
|
if (this.activeName === 'his') {
|
||||||
|
this.getDataList();
|
||||||
|
} else {
|
||||||
|
this.getDataList2();
|
||||||
|
}
|
||||||
|
},
|
||||||
// 获取数据2列表
|
// 获取数据2列表
|
||||||
getDataList2() {
|
getDataList2() {
|
||||||
if (this.listQuery.startTime) {
|
if (this.listQuery.startTime) {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2021-11-18 14:16:25
|
* @Date: 2021-11-18 14:16:25
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2024-09-05 15:34:28
|
* @LastEditTime: 2024-12-27 09:18:43
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
placeholder="请输入原料名称" />
|
placeholder="请输入原料名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<!-- <el-col :span="12">
|
||||||
<el-form-item label="单价" prop="matPrice">
|
<el-form-item label="单价" prop="matPrice">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="dataForm.matPrice"
|
v-model="dataForm.matPrice"
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
placeholder="请输入单价" />
|
placeholder="请输入单价" />
|
||||||
(元/吨)
|
(元/吨)
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col> -->
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="累计用量" prop="quantity">
|
<el-form-item label="累计用量" prop="quantity">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
:page.sync="listQuery.pageNo"
|
:page.sync="listQuery.pageNo"
|
||||||
:limit.sync="listQuery.pageSize"
|
:limit.sync="listQuery.pageSize"
|
||||||
:total="listQuery.total"
|
:total="listQuery.total"
|
||||||
@pagination="getDataList" />
|
@pagination="getNavDataList" />
|
||||||
<base-dialog
|
<base-dialog
|
||||||
:dialogTitle="addOrEditTitle"
|
:dialogTitle="addOrEditTitle"
|
||||||
:dialogVisible="addOrUpdateVisible"
|
:dialogVisible="addOrUpdateVisible"
|
||||||
@@ -87,9 +87,12 @@ import ButtonNav from '@/components/ButtonNav';
|
|||||||
|
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
{
|
{
|
||||||
prop: 'recTime',
|
prop: 'time',
|
||||||
label: '日期',
|
label: '日期',
|
||||||
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
|
},
|
||||||
|
{
|
||||||
|
prop: 'remark',
|
||||||
|
label: '备注',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'materialName',
|
prop: 'materialName',
|
||||||
@@ -97,13 +100,13 @@ const tableProps = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'quantity',
|
prop: 'quantity',
|
||||||
label: '累计使用量(吨)',
|
label: '累计使用量(千克)',
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'matPrice',
|
|
||||||
label: '单价(元/吨)',
|
|
||||||
align: 'right',
|
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// prop: 'matPrice',
|
||||||
|
// label: '单价(元/千克)',
|
||||||
|
// align: 'right',
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
prop: 'price',
|
prop: 'price',
|
||||||
label: '总价(元)',
|
label: '总价(元)',
|
||||||
@@ -111,6 +114,10 @@ const tableProps = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
const tableProps2 = [
|
const tableProps2 = [
|
||||||
|
// {
|
||||||
|
// prop: 'remark',
|
||||||
|
// label: '备注',
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
prop: 'materialName',
|
prop: 'materialName',
|
||||||
label: '原料名称',
|
label: '原料名称',
|
||||||
@@ -123,13 +130,13 @@ const tableProps2 = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'quantity',
|
prop: 'quantity',
|
||||||
label: '累计使用量(吨)',
|
label: '累计使用量(千克)',
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'materialPrice',
|
|
||||||
label: '单价(元/吨)',
|
|
||||||
align: 'right',
|
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// prop: 'materialPrice',
|
||||||
|
// label: '单价(元/千克)',
|
||||||
|
// align: 'right',
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
prop: 'price',
|
prop: 'price',
|
||||||
label: '总价(元)',
|
label: '总价(元)',
|
||||||
@@ -204,13 +211,16 @@ export default {
|
|||||||
{
|
{
|
||||||
type: 'datePicker',
|
type: 'datePicker',
|
||||||
label: '时间范围',
|
label: '时间范围',
|
||||||
dateType: 'daterange',
|
dateType: 'datetimerange',
|
||||||
format: 'yyyy-MM-dd',
|
format: 'yyyy-MM-dd HH:mm:ss',
|
||||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||||
rangeSeparator: '-',
|
rangeSeparator: '-',
|
||||||
startPlaceholder: '开始时间',
|
startPlaceholder: '开始时间',
|
||||||
endPlaceholder: '结束时间',
|
endPlaceholder: '结束时间',
|
||||||
|
defaultTime: ['08:30:00', '08:30:00'],
|
||||||
param: 'searchTime',
|
param: 'searchTime',
|
||||||
|
width: 350,
|
||||||
|
clearable: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'button',
|
type: 'button',
|
||||||
@@ -234,10 +244,11 @@ export default {
|
|||||||
activeName: 'his',
|
activeName: 'his',
|
||||||
tableProps,
|
tableProps,
|
||||||
tableProps2,
|
tableProps2,
|
||||||
tableBtn: [{
|
tableBtn: [
|
||||||
|
{
|
||||||
type: 'edit',
|
type: 'edit',
|
||||||
btnName: '编辑',
|
btnName: '编辑',
|
||||||
}
|
},
|
||||||
].filter((v) => v),
|
].filter((v) => v),
|
||||||
tableData: [],
|
tableData: [],
|
||||||
tableData2: [],
|
tableData2: [],
|
||||||
@@ -259,26 +270,20 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
buttonClick(val) {
|
buttonClick(val) {
|
||||||
if (val.statisticType === 2) {
|
|
||||||
this.tableProps[0].filter = (val) =>
|
|
||||||
parseTime(val, '{y}年第{w}周');
|
|
||||||
}else{
|
|
||||||
this.tableProps[0].filter = (val) =>
|
|
||||||
parseTime(val, '{y}年{m}月{d}日');
|
|
||||||
}
|
|
||||||
this.formConfig2[1].startPlaceholder = '开始时间';
|
|
||||||
this.formConfig2[1].endPlaceholder = '结束时间';
|
|
||||||
switch (val.btnName) {
|
switch (val.btnName) {
|
||||||
case 'search':
|
case 'search':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.materialId = val.name || null;
|
this.listQuery.materialId = val.name || null;
|
||||||
this.listQuery.statisticType = val.statisticType || 1;
|
this.listQuery.statisticType = val.statisticType || 1;
|
||||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||||
this.listQuery.endTime = val.searchTime
|
this.listQuery.endTime = val.searchTime
|
||||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
? val.searchTime[1]
|
||||||
: null;
|
: null;
|
||||||
if (this.activeName === 'his') {
|
if (this.activeName === 'his') {
|
||||||
|
this.listQuery.endTime = val.searchTime
|
||||||
|
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||||
|
: null;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
} else {
|
} else {
|
||||||
this.getDataList2();
|
this.getDataList2();
|
||||||
@@ -289,13 +294,18 @@ export default {
|
|||||||
break;
|
break;
|
||||||
case 'export':
|
case 'export':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.materialId = val.name || null;
|
this.listQuery.materialId = val.name || null;
|
||||||
this.listQuery.statisticType = val.statisticType || 1;
|
this.listQuery.statisticType = val.statisticType || 1;
|
||||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||||
|
this.listQuery.endTime = val.searchTime
|
||||||
|
? val.searchTime[1]
|
||||||
|
: null;
|
||||||
|
if (this.activeName === 'his') {
|
||||||
this.listQuery.endTime = val.searchTime
|
this.listQuery.endTime = val.searchTime
|
||||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||||
: null;
|
: null;
|
||||||
|
}
|
||||||
this.handleExport();
|
this.handleExport();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -317,15 +327,26 @@ export default {
|
|||||||
const end = new Date();
|
const end = new Date();
|
||||||
const start = new Date();
|
const start = new Date();
|
||||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||||
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 00:00:00';
|
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 08:30:00';
|
||||||
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 23:59:59';
|
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 08:30:00';
|
||||||
this.formConfig2[1].startPlaceholder = parseTime(start).substr(0, 10);
|
this.$nextTick(() => {
|
||||||
this.formConfig2[1].endPlaceholder = parseTime(end).substr(0, 10);
|
this.$refs.searchBarForm2.formInline.searchTime = [
|
||||||
|
this.listQuery.startTime,
|
||||||
|
this.listQuery.endTime,
|
||||||
|
];
|
||||||
|
});
|
||||||
this.listQuery.name = null;
|
this.listQuery.name = null;
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.getDataList2();
|
this.getDataList2();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
getNavDataList() {
|
||||||
|
if (this.activeName === 'his') {
|
||||||
|
this.getDataList();
|
||||||
|
} else {
|
||||||
|
this.getDataList2();
|
||||||
|
}
|
||||||
|
},
|
||||||
// 获取数据2列表
|
// 获取数据2列表
|
||||||
getDataList2() {
|
getDataList2() {
|
||||||
if (this.listQuery.startTime) {
|
if (this.listQuery.startTime) {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2021-11-18 14:16:25
|
* @Date: 2021-11-18 14:16:25
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2024-09-05 15:33:16
|
* @LastEditTime: 2025-06-13 10:59:54
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@@ -15,7 +15,9 @@
|
|||||||
label-width="80px">
|
label-width="80px">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="产线" prop="bindObjectName">
|
<el-form-item
|
||||||
|
:label="activeName === 'his' ? '产线' : '工段'"
|
||||||
|
prop="bindObjectName">
|
||||||
<el-input
|
<el-input
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
v-model="dataForm.bindObjectName"
|
v-model="dataForm.bindObjectName"
|
||||||
@@ -33,7 +35,7 @@
|
|||||||
placeholder="选择所属日期"></el-date-picker>
|
placeholder="选择所属日期"></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12" v-if="activeName === 'his'">
|
||||||
<el-form-item label="厚度" prop="thick">
|
<el-form-item label="厚度" prop="thick">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
:min="0"
|
:min="0"
|
||||||
@@ -43,7 +45,7 @@
|
|||||||
placeholder="请输入厚度" />
|
placeholder="请输入厚度" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12" v-if="activeName === 'his'">
|
||||||
<el-form-item label="在线速度" prop="speed">
|
<el-form-item label="在线速度" prop="speed">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
:min="0"
|
:min="0"
|
||||||
@@ -53,7 +55,7 @@
|
|||||||
placeholder="请输入在线速度" />
|
placeholder="请输入在线速度" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12" v-if="activeName === 'his'">
|
||||||
<el-form-item label="掰边宽度" prop="width">
|
<el-form-item label="掰边宽度" prop="width">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
:min="0"
|
:min="0"
|
||||||
@@ -64,25 +66,27 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="拉引量" prop="inArea">
|
<el-form-item
|
||||||
|
:label="activeName === 'his' ? '拉引量' : '进片数'"
|
||||||
|
prop="inArea">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
:min="0"
|
:min="0"
|
||||||
style="width: 85%"
|
style="width: 85%"
|
||||||
v-model="dataForm.inArea"
|
v-model="dataForm.inArea"
|
||||||
clearable
|
clearable />
|
||||||
placeholder="请输入拉引量" />
|
{{ activeName === 'his' ? '(m²)' : '片' }}
|
||||||
(m²)
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="下片面积" prop="outArea">
|
<el-form-item
|
||||||
|
:label="activeName === 'his' ? '下片面积' : '出片数'"
|
||||||
|
prop="outArea">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
:min="0"
|
:min="0"
|
||||||
style="width: 85%"
|
style="width: 85%"
|
||||||
v-model="dataForm.outArea"
|
v-model="dataForm.outArea"
|
||||||
clearable
|
clearable />
|
||||||
placeholder="请输入下片面积" />
|
{{ activeName === 'his' ? '(m²)' : '片' }}
|
||||||
(m²)
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@@ -129,10 +133,12 @@ export default {
|
|||||||
recTime: undefined,
|
recTime: undefined,
|
||||||
},
|
},
|
||||||
dataRule: {},
|
dataRule: {},
|
||||||
|
activeName: 'his',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init(val, statisticType) {
|
init(val, statisticType, activeName) {
|
||||||
|
this.activeName = activeName;
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs['dataForm'].resetFields();
|
this.$refs['dataForm'].resetFields();
|
||||||
@@ -148,17 +154,22 @@ export default {
|
|||||||
if (!valid) {
|
if (!valid) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const udata = {
|
let udata = {
|
||||||
id: this.dataForm.id,
|
id: this.dataForm.id,
|
||||||
statisticType: this.dataForm.statisticType,
|
statisticType: this.dataForm.statisticType,
|
||||||
modifyThick: this.dataForm.thick,
|
|
||||||
modifySpeed: this.dataForm.speed,
|
|
||||||
modifyWidth: this.dataForm.width,
|
|
||||||
modifyInArea: this.dataForm.inArea,
|
modifyInArea: this.dataForm.inArea,
|
||||||
modifyOutArea: this.dataForm.outArea,
|
modifyOutArea: this.dataForm.outArea,
|
||||||
modifyRatio:
|
modifyRatio:
|
||||||
this.dataForm.ratio >= 0 ? this.dataForm.ratio / 100 : '',
|
this.dataForm.ratio >= 0 ? this.dataForm.ratio / 100 : '',
|
||||||
};
|
};
|
||||||
|
if (this.activeName === 'his') {
|
||||||
|
udata = {
|
||||||
|
...udata,
|
||||||
|
modifyThick: this.dataForm.thick,
|
||||||
|
modifySpeed: this.dataForm.speed,
|
||||||
|
modifyWidth: this.dataForm.width,
|
||||||
|
};
|
||||||
|
}
|
||||||
// 修改的提交
|
// 修改的提交
|
||||||
this.urlOptions.updateURL(udata).then((response) => {
|
this.urlOptions.updateURL(udata).then((response) => {
|
||||||
this.$modal.msgSuccess('修改成功');
|
this.$modal.msgSuccess('修改成功');
|
||||||
|
|||||||
@@ -1,11 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div>
|
||||||
|
<div style="background: #f2f4f9; height: 40px; width: 100%">
|
||||||
|
<ButtonNav :menus="['产线良品率', '工段良品率']" @change="currentMenu">
|
||||||
|
<template v-slot:tab1>
|
||||||
|
<div>产线良品率</div>
|
||||||
|
</template>
|
||||||
|
<template v-slot:tab2>
|
||||||
|
<div>工段良品率</div>
|
||||||
|
</template>
|
||||||
|
</ButtonNav>
|
||||||
|
</div>
|
||||||
<div class="app-container energyOverlimitLog">
|
<div class="app-container energyOverlimitLog">
|
||||||
<!-- 搜索工作栏 -->
|
|
||||||
<search-bar
|
<search-bar
|
||||||
:formConfigs="formConfig"
|
:formConfigs="formConfig"
|
||||||
ref="searchBarForm"
|
ref="searchBarForm"
|
||||||
@headBtnClick="buttonClick" />
|
@headBtnClick="buttonClick" />
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
|
<div v-if="activeName === 'his'">
|
||||||
<base-table
|
<base-table
|
||||||
:page="listQuery.pageNo"
|
:page="listQuery.pageNo"
|
||||||
:limit="listQuery.pageSize"
|
:limit="listQuery.pageSize"
|
||||||
@@ -20,11 +31,28 @@
|
|||||||
:method-list="tableBtn"
|
:method-list="tableBtn"
|
||||||
@clickBtn="handleClick" />
|
@clickBtn="handleClick" />
|
||||||
</base-table>
|
</base-table>
|
||||||
|
</div>
|
||||||
|
<div v-if="activeName === 'now'">
|
||||||
|
<base-table
|
||||||
|
:page="listQuery.pageNo"
|
||||||
|
:limit="listQuery.pageSize"
|
||||||
|
:table-props="tableProps2"
|
||||||
|
:table-data="tableData2"
|
||||||
|
:max-height="tableH">
|
||||||
|
<method-btn
|
||||||
|
v-if="tableBtn.length"
|
||||||
|
slot="handleBtn"
|
||||||
|
:width="80"
|
||||||
|
label="操作"
|
||||||
|
:method-list="tableBtn"
|
||||||
|
@clickBtn="handleClick" />
|
||||||
|
</base-table>
|
||||||
|
</div>
|
||||||
<pagination
|
<pagination
|
||||||
:page.sync="listQuery.pageNo"
|
:page.sync="listQuery.pageNo"
|
||||||
:limit.sync="listQuery.pageSize"
|
:limit.sync="listQuery.pageSize"
|
||||||
:total="listQuery.total"
|
:total="listQuery.total"
|
||||||
@pagination="getDataList" />
|
@pagination="getNavDataList" />
|
||||||
<base-dialog
|
<base-dialog
|
||||||
:dialogTitle="addOrEditTitle"
|
:dialogTitle="addOrEditTitle"
|
||||||
:dialogVisible="addOrUpdateVisible"
|
:dialogVisible="addOrUpdateVisible"
|
||||||
@@ -38,22 +66,34 @@
|
|||||||
@refreshDataList="successSubmit"></add-or-update>
|
@refreshDataList="successSubmit"></add-or-update>
|
||||||
</base-dialog>
|
</base-dialog>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import AddOrUpdate from './add-or-updata';
|
import AddOrUpdate from './add-or-updata';
|
||||||
import basicPage from '@/mixins/basic-page';
|
import basicPage from '@/mixins/basic-page';
|
||||||
import { getLinePage } from '@/api/base/productionLine';
|
import { getLinePage } from '@/api/base/productionLine';
|
||||||
import { getcostOriginRatioHisPage,exportcostOriginRatioHisExcel } from '@/api/cost/costOriginRatioHis';
|
import {
|
||||||
|
getcostOriginRatioHisPage,
|
||||||
|
getcostOriginWSRatioHisPage,
|
||||||
|
exportcostOriginWSRatioHisExcel,
|
||||||
|
exportcostOriginRatioHisExcel,
|
||||||
|
} from '@/api/cost/costOriginRatioHis';
|
||||||
import { parseTime } from '@/filter/code-filter';
|
import { parseTime } from '@/filter/code-filter';
|
||||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||||
|
import ButtonNav from '@/components/ButtonNav';
|
||||||
|
|
||||||
|
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
{
|
{
|
||||||
prop: 'recTime',
|
prop: 'time',
|
||||||
label: '日期',
|
label: '日期',
|
||||||
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
|
|
||||||
width:130,
|
width:130,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
prop: 'remark',
|
||||||
|
label: '备注',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
prop: 'bindObjectName',
|
prop: 'bindObjectName',
|
||||||
label: '产线',
|
label: '产线',
|
||||||
@@ -62,27 +102,67 @@ const tableProps = [
|
|||||||
{
|
{
|
||||||
prop: 'thick',
|
prop: 'thick',
|
||||||
label: '厚度',
|
label: '厚度',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(1) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'speed',
|
prop: 'speed',
|
||||||
label: '在线速度',
|
label: '在线速度',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'width',
|
prop: 'width',
|
||||||
label: '掰边宽度',
|
label: '掰边宽度',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'inArea',
|
prop: 'inArea',
|
||||||
label: '拉引量/m²',
|
label: '拉引量/m²',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'outArea',
|
prop: 'outArea',
|
||||||
label: '下片面积/m²',
|
label: '下片面积/m²',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'ratio',
|
prop: 'ratio',
|
||||||
label: '良品率',
|
label: '良品率',
|
||||||
filter: (val) => (val ? val * 100 + '%' : '-'),
|
filter: (val) => (val ? Number(val * 100).toFixed(2) + '%' : '-'),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const tableProps2 = [
|
||||||
|
{
|
||||||
|
prop: 'time',
|
||||||
|
label: '日期',
|
||||||
|
width:130,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'remark',
|
||||||
|
label: '备注',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'bindObjectName',
|
||||||
|
label: '工段',
|
||||||
|
width:145,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'spec',
|
||||||
|
label: '规格',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'inArea',
|
||||||
|
label: '进片数',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'outArea',
|
||||||
|
label: '出片数',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'ratio',
|
||||||
|
label: '良品率',
|
||||||
|
filter: (val) => (val ? Number(val * 100).toFixed(2) + '%' : '-'),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
export default {
|
export default {
|
||||||
@@ -116,13 +196,15 @@ export default {
|
|||||||
{
|
{
|
||||||
type: 'datePicker',
|
type: 'datePicker',
|
||||||
label: '时间范围',
|
label: '时间范围',
|
||||||
dateType: 'daterange',
|
dateType: 'datetimerange',
|
||||||
format: 'yyyy-MM-dd',
|
format: 'yyyy-MM-dd HH:mm:ss',
|
||||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||||
rangeSeparator: '-',
|
rangeSeparator: '-',
|
||||||
startPlaceholder: '开始时间',
|
startPlaceholder: '开始时间',
|
||||||
endPlaceholder: '结束时间',
|
endPlaceholder: '结束时间',
|
||||||
|
defaultTime: ['08:30:00', '08:30:00'],
|
||||||
param: 'searchTime',
|
param: 'searchTime',
|
||||||
|
width: 350,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'button',
|
type: 'button',
|
||||||
@@ -143,23 +225,27 @@ export default {
|
|||||||
listQuery: {
|
listQuery: {
|
||||||
statisticType: 1,
|
statisticType: 1,
|
||||||
},
|
},
|
||||||
|
activeName: 'his',
|
||||||
tableProps,
|
tableProps,
|
||||||
|
tableProps2,
|
||||||
tableBtn: [{
|
tableBtn: [{
|
||||||
type: 'edit',
|
type: 'edit',
|
||||||
btnName: '编辑',
|
btnName: '编辑',
|
||||||
}
|
}
|
||||||
].filter((v) => v),
|
].filter((v) => v),
|
||||||
tableData: [],
|
tableData: [],
|
||||||
|
tableData2: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
AddOrUpdate,
|
AddOrUpdate,
|
||||||
|
ButtonNav,
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
const params ={
|
const params ={
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
pdType: 1
|
pdType: 0
|
||||||
}
|
}
|
||||||
getLinePage(params).then((response) => {
|
getLinePage(params).then((response) => {
|
||||||
this.formConfig[1].selectOptions = response.data.list;
|
this.formConfig[1].selectOptions = response.data.list;
|
||||||
@@ -167,36 +253,33 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
buttonClick(val) {
|
buttonClick(val) {
|
||||||
if (val.statisticType === 2) {
|
|
||||||
this.tableProps[0].filter = (val) =>
|
|
||||||
parseTime(val, '{y}年第{w}周');
|
|
||||||
}else{
|
|
||||||
this.tableProps[0].filter = (val) =>
|
|
||||||
parseTime(val, '{y}年{m}月{d}日');
|
|
||||||
}
|
|
||||||
switch (val.btnName) {
|
switch (val.btnName) {
|
||||||
case 'search':
|
case 'search':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.bindObjectId = val.name || null;
|
this.listQuery.bindObjectId = val.name || null;
|
||||||
this.listQuery.statisticType = val.statisticType || 1;
|
this.listQuery.statisticType = val.statisticType || 1;
|
||||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||||
this.listQuery.endTime = val.searchTime
|
this.listQuery.endTime = val.searchTime
|
||||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
? val.searchTime[1]
|
||||||
: null;
|
: null;
|
||||||
|
if (this.activeName === 'his') {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
|
} else {
|
||||||
|
this.getDataList2();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'add':
|
case 'add':
|
||||||
this.addOrUpdateHandle();
|
this.addOrUpdateHandle();
|
||||||
break;
|
break;
|
||||||
case 'export':
|
case 'export':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.bindObjectId = val.name || null;
|
this.listQuery.bindObjectId = val.name || null;
|
||||||
this.listQuery.statisticType = val.statisticType || 1;
|
this.listQuery.statisticType = val.statisticType || 1;
|
||||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||||
this.listQuery.endTime = val.searchTime
|
this.listQuery.endTime = val.searchTime
|
||||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
? val.searchTime[1]
|
||||||
: null;
|
: null;
|
||||||
this.handleExport();
|
this.handleExport();
|
||||||
break;
|
break;
|
||||||
@@ -204,23 +287,74 @@ export default {
|
|||||||
console.log(val);
|
console.log(val);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
currentMenu(val) {
|
||||||
|
this.activeName = val === '产线良品率' ? 'his' : 'now';
|
||||||
|
if (this.activeName === 'his') {
|
||||||
|
this.$refs.searchBarForm.resetForm();
|
||||||
|
this.listQuery.bindObjectId = null;
|
||||||
|
this.listQuery.startTime = null;
|
||||||
|
this.listQuery.endTime = null;
|
||||||
|
this.listQuery.statisticType = 1;
|
||||||
|
this.listQuery.pageNo = 1;
|
||||||
|
this.getDataList();
|
||||||
|
} else {
|
||||||
|
this.$refs.searchBarForm.resetForm();
|
||||||
|
this.listQuery.bindObjectId = null;
|
||||||
|
this.listQuery.startTime = null;
|
||||||
|
this.listQuery.endTime = null;
|
||||||
|
this.listQuery.statisticType = 1;
|
||||||
|
this.listQuery.pageNo = 1;
|
||||||
|
this.getDataList2();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 获取数据2列表
|
||||||
|
getDataList2() {
|
||||||
|
getcostOriginWSRatioHisPage(this.listQuery).then((response) => {
|
||||||
|
this.tableData2 = response.data.list;
|
||||||
|
this.listQuery.total = response.data.total;
|
||||||
|
});
|
||||||
|
},
|
||||||
//tableBtn点击
|
//tableBtn点击
|
||||||
handleClick(val) {
|
handleClick(val) {
|
||||||
if (val.type === 'edit') {
|
if (val.type === 'edit') {
|
||||||
this.addOrUpdateVisible = true;
|
this.addOrUpdateVisible = true;
|
||||||
this.addOrEditTitle = '编辑';
|
this.addOrEditTitle = '编辑';
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.addOrUpdate.init(val.data, this.listQuery.statisticType);
|
this.$refs.addOrUpdate.init(
|
||||||
|
val.data,
|
||||||
|
this.listQuery.statisticType,
|
||||||
|
this.activeName
|
||||||
|
);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.otherMethods(val);
|
this.otherMethods(val);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
getNavDataList(){
|
||||||
|
if (this.activeName === 'his') {
|
||||||
|
this.getDataList();
|
||||||
|
} else {
|
||||||
|
this.getDataList2();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
successSubmit() {
|
||||||
|
this.handleCancel();
|
||||||
|
if (this.activeName === 'his') {
|
||||||
|
this.getDataList();
|
||||||
|
} else {
|
||||||
|
this.getDataList2();
|
||||||
|
}
|
||||||
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
let exportURL, title;
|
let exportURL, title;
|
||||||
|
if (this.activeName === 'his') {
|
||||||
exportURL = exportcostOriginRatioHisExcel;
|
exportURL = exportcostOriginRatioHisExcel;
|
||||||
title = '原片成本-原片良品率';
|
title = '原片-产线良品率';
|
||||||
|
} else {
|
||||||
|
exportURL = exportcostOriginWSRatioHisExcel;
|
||||||
|
title = '原片-工段良品率';
|
||||||
|
}
|
||||||
// 处理查询参数
|
// 处理查询参数
|
||||||
let params = { ...this.listQuery };
|
let params = { ...this.listQuery };
|
||||||
params.pageNo = undefined;
|
params.pageNo = undefined;
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
:page.sync="listQuery.pageNo"
|
:page.sync="listQuery.pageNo"
|
||||||
:limit.sync="listQuery.pageSize"
|
:limit.sync="listQuery.pageSize"
|
||||||
:total="listQuery.total"
|
:total="listQuery.total"
|
||||||
@pagination="getDataList" />
|
@pagination="getNavDataList" />
|
||||||
<base-dialog
|
<base-dialog
|
||||||
:dialogTitle="addOrEditTitle"
|
:dialogTitle="addOrEditTitle"
|
||||||
:dialogVisible="addOrUpdateVisible"
|
:dialogVisible="addOrUpdateVisible"
|
||||||
@@ -87,9 +87,12 @@ import ButtonNav from '@/components/ButtonNav';
|
|||||||
|
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
{
|
{
|
||||||
prop: 'recTime',
|
prop: 'time',
|
||||||
label: '日期',
|
label: '日期',
|
||||||
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
|
},
|
||||||
|
{
|
||||||
|
prop: 'remark',
|
||||||
|
label: '备注',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'otherCostName',
|
prop: 'otherCostName',
|
||||||
@@ -102,6 +105,10 @@ const tableProps = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
const tableProps2 = [
|
const tableProps2 = [
|
||||||
|
// {
|
||||||
|
// prop: 'remark',
|
||||||
|
// label: '备注',
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
prop: 'otherCostName',
|
prop: 'otherCostName',
|
||||||
label: '成本名称',
|
label: '成本名称',
|
||||||
@@ -182,13 +189,16 @@ export default {
|
|||||||
{
|
{
|
||||||
type: 'datePicker',
|
type: 'datePicker',
|
||||||
label: '时间范围',
|
label: '时间范围',
|
||||||
dateType: 'daterange',
|
dateType: 'datetimerange',
|
||||||
format: 'yyyy-MM-dd',
|
format: 'yyyy-MM-dd HH:mm:ss',
|
||||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||||
rangeSeparator: '-',
|
rangeSeparator: '-',
|
||||||
startPlaceholder: '开始时间',
|
startPlaceholder: '开始时间',
|
||||||
endPlaceholder: '结束时间',
|
endPlaceholder: '结束时间',
|
||||||
|
defaultTime: ['08:30:00', '08:30:00'],
|
||||||
param: 'searchTime',
|
param: 'searchTime',
|
||||||
|
width: 350,
|
||||||
|
clearable: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'button',
|
type: 'button',
|
||||||
@@ -237,24 +247,20 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
buttonClick(val) {
|
buttonClick(val) {
|
||||||
if (val.statisticType === 2) {
|
|
||||||
this.tableProps[0].filter = (val) =>
|
|
||||||
parseTime(val, '{y}年第{w}周');
|
|
||||||
}else{
|
|
||||||
this.tableProps[0].filter = (val) =>
|
|
||||||
parseTime(val, '{y}年{m}月{d}日');
|
|
||||||
}
|
|
||||||
switch (val.btnName) {
|
switch (val.btnName) {
|
||||||
case 'search':
|
case 'search':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.name = val.name || null;
|
this.listQuery.name = val.name || null;
|
||||||
this.listQuery.statisticType = val.statisticType || 1;
|
this.listQuery.statisticType = val.statisticType || 1;
|
||||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||||
this.listQuery.endTime = val.searchTime
|
this.listQuery.endTime = val.searchTime
|
||||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
? val.searchTime[1]
|
||||||
: null;
|
: null;
|
||||||
if (this.activeName === 'his') {
|
if (this.activeName === 'his') {
|
||||||
|
this.listQuery.endTime = val.searchTime
|
||||||
|
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||||
|
: null;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
} else {
|
} else {
|
||||||
this.getDataList2();
|
this.getDataList2();
|
||||||
@@ -265,13 +271,18 @@ export default {
|
|||||||
break;
|
break;
|
||||||
case 'export':
|
case 'export':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.name = val.name || null;
|
this.listQuery.name = val.name || null;
|
||||||
this.listQuery.statisticType = val.statisticType || 1;
|
this.listQuery.statisticType = val.statisticType || 1;
|
||||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||||
|
this.listQuery.endTime = val.searchTime
|
||||||
|
? val.searchTime[1]
|
||||||
|
: null;
|
||||||
|
if (this.activeName === 'his') {
|
||||||
this.listQuery.endTime = val.searchTime
|
this.listQuery.endTime = val.searchTime
|
||||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||||
: null;
|
: null;
|
||||||
|
}
|
||||||
this.handleExport();
|
this.handleExport();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -297,6 +308,13 @@ export default {
|
|||||||
this.getDataList2();
|
this.getDataList2();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
getNavDataList(){
|
||||||
|
if (this.activeName === 'his') {
|
||||||
|
this.getDataList();
|
||||||
|
} else {
|
||||||
|
this.getDataList2();
|
||||||
|
}
|
||||||
|
},
|
||||||
// 获取数据2列表
|
// 获取数据2列表
|
||||||
getDataList2() {
|
getDataList2() {
|
||||||
getRawOthercostSunPage(this.listQuery).then((response) => {
|
getRawOthercostSunPage(this.listQuery).then((response) => {
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ const tableProps = [
|
|||||||
prop: 'price',
|
prop: 'price',
|
||||||
label: '成本金额',
|
label: '成本金额',
|
||||||
align: 'right',
|
align: 'right',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'remark',
|
prop: 'remark',
|
||||||
@@ -161,7 +162,7 @@ export default {
|
|||||||
switch (val.btnName) {
|
switch (val.btnName) {
|
||||||
case 'search':
|
case 'search':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.name = val.name||null;
|
this.listQuery.name = val.name||null;
|
||||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||||
this.listQuery.endTime = val.searchTime
|
this.listQuery.endTime = val.searchTime
|
||||||
@@ -174,7 +175,7 @@ export default {
|
|||||||
break;
|
break;
|
||||||
case 'export':
|
case 'export':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.name = val.name||null;
|
this.listQuery.name = val.name||null;
|
||||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||||
this.listQuery.endTime = val.searchTime
|
this.listQuery.endTime = val.searchTime
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2023-12-05 13:45:59
|
* @Date: 2023-12-05 13:45:59
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2024-04-15 17:12:03
|
* @LastEditTime: 2024-12-25 16:20:38
|
||||||
* @Description
|
* @Description
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@@ -10,9 +10,9 @@
|
|||||||
<span>
|
<span>
|
||||||
{{
|
{{
|
||||||
injectData.type == 1
|
injectData.type == 1
|
||||||
? `每天等价,${injectData.price}元`
|
? `每天等价,${Number(injectData.price)}元`
|
||||||
: injectData.type == 2
|
: injectData.type == 2
|
||||||
? `总价${injectData.price}元,年折旧率${injectData.ratio}%,折旧年限${injectData.timeLimit}年`
|
? `总价${Number(injectData.price)}元,年折旧率${injectData.ratio}%,折旧年限${injectData.timeLimit}年`
|
||||||
: '-'
|
: '-'
|
||||||
}}
|
}}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
:page.sync="listQuery.pageNo"
|
:page.sync="listQuery.pageNo"
|
||||||
:limit.sync="listQuery.pageSize"
|
:limit.sync="listQuery.pageSize"
|
||||||
:total="listQuery.total"
|
:total="listQuery.total"
|
||||||
@pagination="getDataList" />
|
@pagination="getNavDataList" />
|
||||||
<base-dialog
|
<base-dialog
|
||||||
:dialogTitle="addOrEditTitle"
|
:dialogTitle="addOrEditTitle"
|
||||||
:dialogVisible="addOrUpdateVisible"
|
:dialogVisible="addOrUpdateVisible"
|
||||||
@@ -87,9 +87,12 @@ import ButtonNav from '@/components/ButtonNav';
|
|||||||
|
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
{
|
{
|
||||||
prop: 'recTime',
|
prop: 'time',
|
||||||
label: '时间',
|
label: '时间',
|
||||||
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
|
},
|
||||||
|
{
|
||||||
|
prop: 'remark',
|
||||||
|
label: '备注',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'bindObjectName',
|
prop: 'bindObjectName',
|
||||||
@@ -98,32 +101,41 @@ const tableProps = [
|
|||||||
{
|
{
|
||||||
prop: 'thick',
|
prop: 'thick',
|
||||||
label: '厚度',
|
label: '厚度',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(1) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'inArea',
|
prop: 'inArea',
|
||||||
label: '拉引量/m²',
|
label: '拉引量/m²',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'outArea',
|
prop: 'outArea',
|
||||||
label: '下片面积/m²',
|
label: '下片面积/m²',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'ratio',
|
prop: 'ratio',
|
||||||
label: '良品率',
|
label: '良品率',
|
||||||
filter: (val) => (val ? val * 100 + '%' : '-'),
|
filter: (val) => (val ? Number(val * 100).toFixed(2) + '%' : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'costSum',
|
prop: 'costSum',
|
||||||
label: '原片成本/元',
|
label: '原片成本/元',
|
||||||
align: 'right',
|
align: 'right',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'costArea',
|
prop: 'costArea',
|
||||||
label: '每平米成本/元',
|
label: '每平米成本/元',
|
||||||
align: 'right',
|
align: 'right',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const tableProps2 = [
|
const tableProps2 = [
|
||||||
|
{
|
||||||
|
prop: 'remark',
|
||||||
|
label: '备注',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
prop: 'bindObjectName',
|
prop: 'bindObjectName',
|
||||||
label: '产线',
|
label: '产线',
|
||||||
@@ -135,34 +147,40 @@ const tableProps2 = [
|
|||||||
{
|
{
|
||||||
prop: 'inArea',
|
prop: 'inArea',
|
||||||
label: '拉引量/m²',
|
label: '拉引量/m²',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'outArea',
|
prop: 'outArea',
|
||||||
label: '下片面积/m²',
|
label: '下片面积/m²',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'outCount',
|
prop: 'outCount',
|
||||||
label: '下片数量',
|
label: '下片数量',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'ratio',
|
prop: 'ratio',
|
||||||
label: '良品率',
|
label: '良品率',
|
||||||
filter: (val) => (val ? val * 100 + '%' : '-'),
|
filter: (val) => (val ? Number(val * 100).toFixed(2) + '%' : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'costSum',
|
prop: 'costSum',
|
||||||
label: '原片成本/元',
|
label: '原片成本/元',
|
||||||
align: 'right',
|
align: 'right',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'costPiece',
|
prop: 'costPiece',
|
||||||
label: '单片成本/元',
|
label: '单片成本/元',
|
||||||
align: 'right',
|
align: 'right',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'costArea',
|
prop: 'costArea',
|
||||||
label: '每平米成本/元',
|
label: '每平米成本/元',
|
||||||
align: 'right',
|
align: 'right',
|
||||||
|
filter: (val) => (val != null ? Number(val).toFixed(2) : '-'),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
export default {
|
export default {
|
||||||
@@ -224,13 +242,16 @@ export default {
|
|||||||
{
|
{
|
||||||
type: 'datePicker',
|
type: 'datePicker',
|
||||||
label: '时间范围',
|
label: '时间范围',
|
||||||
dateType: 'daterange',
|
dateType: 'datetimerange',
|
||||||
format: 'yyyy-MM-dd',
|
format: 'yyyy-MM-dd HH:mm:ss',
|
||||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||||
rangeSeparator: '-',
|
rangeSeparator: '-',
|
||||||
startPlaceholder: '开始时间',
|
startPlaceholder: '开始时间',
|
||||||
endPlaceholder: '结束时间',
|
endPlaceholder: '结束时间',
|
||||||
|
defaultTime: ['08:30:00', '08:30:00'],
|
||||||
param: 'searchTime',
|
param: 'searchTime',
|
||||||
|
width: 350,
|
||||||
|
clearable: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'select',
|
type: 'select',
|
||||||
@@ -287,26 +308,20 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
buttonClick(val) {
|
buttonClick(val) {
|
||||||
if (val.statisticType === 2) {
|
|
||||||
this.tableProps[0].filter = (val) =>
|
|
||||||
parseTime(val, '{y}年第{w}周');
|
|
||||||
}else{
|
|
||||||
this.tableProps[0].filter = (val) =>
|
|
||||||
parseTime(val, '{y}年{m}月{d}日');
|
|
||||||
}
|
|
||||||
this.formConfig2[0].startPlaceholder = '开始时间';
|
|
||||||
this.formConfig2[0].endPlaceholder = '结束时间';
|
|
||||||
switch (val.btnName) {
|
switch (val.btnName) {
|
||||||
case 'search':
|
case 'search':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.bindObjectId = val.name || null;
|
this.listQuery.bindObjectId = val.name || null;
|
||||||
this.listQuery.statisticType = val.statisticType || 1;
|
this.listQuery.statisticType = val.statisticType || 1;
|
||||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||||
this.listQuery.endTime = val.searchTime
|
this.listQuery.endTime = val.searchTime
|
||||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
? val.searchTime[1]
|
||||||
: null;
|
: null;
|
||||||
if (this.activeName === 'his') {
|
if (this.activeName === 'his') {
|
||||||
|
this.listQuery.endTime = val.searchTime
|
||||||
|
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||||
|
: null;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
} else {
|
} else {
|
||||||
this.getDataList2();
|
this.getDataList2();
|
||||||
@@ -317,13 +332,18 @@ export default {
|
|||||||
break;
|
break;
|
||||||
case 'export':
|
case 'export':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.bindObjectId = val.name || null;
|
this.listQuery.bindObjectId = val.name || null;
|
||||||
this.listQuery.statisticType = val.statisticType || 1;
|
this.listQuery.statisticType = val.statisticType || 1;
|
||||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||||
|
this.listQuery.endTime = val.searchTime
|
||||||
|
? val.searchTime[1]
|
||||||
|
: null;
|
||||||
|
if (this.activeName === 'his') {
|
||||||
this.listQuery.endTime = val.searchTime
|
this.listQuery.endTime = val.searchTime
|
||||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||||
: null;
|
: null;
|
||||||
|
}
|
||||||
this.handleExport();
|
this.handleExport();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -345,15 +365,26 @@ export default {
|
|||||||
const end = new Date();
|
const end = new Date();
|
||||||
const start = new Date();
|
const start = new Date();
|
||||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||||
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 00:00:00';
|
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 08:30:00';
|
||||||
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 23:59:59';
|
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 08:30:00';
|
||||||
this.formConfig2[0].startPlaceholder = parseTime(start).substr(0, 10);
|
this.$nextTick(() => {
|
||||||
this.formConfig2[0].endPlaceholder = parseTime(end).substr(0, 10);
|
this.$refs.searchBarForm2.formInline.searchTime = [
|
||||||
|
this.listQuery.startTime,
|
||||||
|
this.listQuery.endTime,
|
||||||
|
];
|
||||||
|
});
|
||||||
this.listQuery.name = null;
|
this.listQuery.name = null;
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.getDataList2();
|
this.getDataList2();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
getNavDataList(){
|
||||||
|
if (this.activeName === 'his') {
|
||||||
|
this.getDataList();
|
||||||
|
} else {
|
||||||
|
this.getDataList2();
|
||||||
|
}
|
||||||
|
},
|
||||||
// 获取数据2列表
|
// 获取数据2列表
|
||||||
getDataList2() {
|
getDataList2() {
|
||||||
if (this.listQuery.startTime) {
|
if (this.listQuery.startTime) {
|
||||||
|
|||||||
83
src/views/group/Calendar/holidayLog.vue
Normal file
83
src/views/group/Calendar/holidayLog.vue
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2025-10-23 13:43:55
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2025-10-23 16:50:43
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<div v-for="item in groupClassArr" :key="item.planId">
|
||||||
|
<small-title style="margin: 16px 0" size="sm" :no-padding="true">
|
||||||
|
{{item.planName}}
|
||||||
|
</small-title>
|
||||||
|
<base-table
|
||||||
|
:table-props="tableProps"
|
||||||
|
:table-data="
|
||||||
|
tableData.filter((titem) => titem.schedulingPlanId == item.planId)
|
||||||
|
"></base-table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import SmallTitle from '../Schedule/SmallTitle';
|
||||||
|
|
||||||
|
const tableProps = [
|
||||||
|
{
|
||||||
|
prop: 'classesName',
|
||||||
|
label: '班次名称',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'workTime',
|
||||||
|
label: '班次时间',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'teamName',
|
||||||
|
label: '班组名称',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'teamLeader',
|
||||||
|
label: '组长',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'teamLeaderPhone',
|
||||||
|
label: '组长电话',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
SmallTitle,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
tableProps,
|
||||||
|
tableData: [],
|
||||||
|
groupClassArr: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
methods: {
|
||||||
|
init(det) {
|
||||||
|
this.tableData = det;
|
||||||
|
//返回计划名和id
|
||||||
|
const arr = det.map((item) => {
|
||||||
|
const obj = {
|
||||||
|
planName: item.schedulingPlanName,
|
||||||
|
planId: item.schedulingPlanId,
|
||||||
|
};
|
||||||
|
return obj;
|
||||||
|
});
|
||||||
|
//去重
|
||||||
|
const map = new Map();
|
||||||
|
arr.forEach((item) => {
|
||||||
|
if (!map.has(item.planId)) {
|
||||||
|
map.set(item.planId, item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.groupClassArr = Array.from(map.values());
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
567
src/views/group/Calendar/index.vue
Normal file
567
src/views/group/Calendar/index.vue
Normal file
@@ -0,0 +1,567 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2025-10-23 13:43:55
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2025-10-24 11:14:55
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-row :gutter="10" style="background-color: #f2f4f9">
|
||||||
|
<!--部门数据-->
|
||||||
|
<el-col :span="4">
|
||||||
|
<div class="head-container">
|
||||||
|
<el-tabs v-model="activeName" stretch @tab-click="tabsClick">
|
||||||
|
<el-tab-pane label="部门" name="first"></el-tab-pane>
|
||||||
|
<el-tab-pane label="班组" name="second"></el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
<div v-if="activeName == 'first'">
|
||||||
|
<el-input
|
||||||
|
v-model="deptName"
|
||||||
|
placeholder="请输入部门名称"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
prefix-icon="el-icon-search"
|
||||||
|
style="margin-bottom: 20px" />
|
||||||
|
<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>
|
||||||
|
<div v-else>
|
||||||
|
<el-input
|
||||||
|
v-model="groupName"
|
||||||
|
placeholder="请输入班组名称"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
prefix-icon="el-icon-search"
|
||||||
|
style="margin-bottom: 20px" />
|
||||||
|
<el-tree
|
||||||
|
:data="groupOptions"
|
||||||
|
:props="defaultProps"
|
||||||
|
:expand-on-click-node="false"
|
||||||
|
:filter-node-method="filterNode"
|
||||||
|
ref="tree1"
|
||||||
|
default-expand-all
|
||||||
|
highlight-current
|
||||||
|
@node-click="handleNodeClick1" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="20">
|
||||||
|
<div class="groupTeamScheduling">
|
||||||
|
<div class="operationArea">
|
||||||
|
<el-form :inline="true" class="demo-form-inline">
|
||||||
|
<span class="blue-block"></span>
|
||||||
|
<el-form-item label="月份选择">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="startDay"
|
||||||
|
type="month"
|
||||||
|
placeholder="选择月"
|
||||||
|
size="small"
|
||||||
|
@change="selectMonth"
|
||||||
|
:clearable="false"
|
||||||
|
style="width: 120px"></el-date-picker>
|
||||||
|
<span
|
||||||
|
style="color: #909399; font-size: 12px"
|
||||||
|
v-if="activeName == 'first'">
|
||||||
|
提示:排班日历仅展示当前选中部门的节假日设置,若休假日中仍有排班,则表示下级组织已通过自定义假期进行排班。
|
||||||
|
</span>
|
||||||
|
<span v-else>
|
||||||
|
组长:{{ showTeamName?.leaderName || '-' }} 组长电话:{{
|
||||||
|
showTeamName?.leaderPhone || '-'
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item style="float: right">
|
||||||
|
<el-button
|
||||||
|
size="small"
|
||||||
|
type="primary"
|
||||||
|
@click="(startDay = new Date()), getHolidayPage()">
|
||||||
|
跳转到今天
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<!-- 日历区域 -->
|
||||||
|
<div class="calenderArea">
|
||||||
|
<el-calendar v-model="startDay">
|
||||||
|
<template slot="dateCell" slot-scope="{ data }">
|
||||||
|
<div v-if="data.type === 'current-month'">
|
||||||
|
<!-- 日期 -->
|
||||||
|
<div class="dateStyle">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<!-- 公历和农历 -->
|
||||||
|
<el-col :span="18">
|
||||||
|
{{ Number(data.day.split('-')[2]) }}
|
||||||
|
<div class="lunar-date">{{ getLunarDate(data.day) }}</div>
|
||||||
|
</el-col>
|
||||||
|
<!-- 显示假或班 -->
|
||||||
|
<el-col :span="6">
|
||||||
|
<div
|
||||||
|
class="work-tip"
|
||||||
|
:style="{
|
||||||
|
backgroundColor: HolidayList[
|
||||||
|
Number(data.day.split('-')[2]) - 1
|
||||||
|
]?.isHoliday
|
||||||
|
? '#67C23A'
|
||||||
|
: '#409EFF',
|
||||||
|
}">
|
||||||
|
{{
|
||||||
|
HolidayList[Number(data.day.split('-')[2]) - 1]
|
||||||
|
?.isHoliday
|
||||||
|
? '假'
|
||||||
|
: '班'
|
||||||
|
}}
|
||||||
|
<!-- //变更节假日未更新排班计划的角标 -->
|
||||||
|
<div
|
||||||
|
class="subIcon"
|
||||||
|
v-if="
|
||||||
|
HolidayList[Number(data.day.split('-')[2]) - 1]
|
||||||
|
?.isUpdate
|
||||||
|
">
|
||||||
|
<el-tooltip
|
||||||
|
effect="dark"
|
||||||
|
content="本日节假日变更已影响当前排班计划,但尚未同步,请及时处理。"
|
||||||
|
placement="top">
|
||||||
|
<i
|
||||||
|
class="el-icon-warning"
|
||||||
|
style="color: #f56c6c"></i>
|
||||||
|
</el-tooltip>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<!-- 显示排班 -->
|
||||||
|
<div
|
||||||
|
v-if="
|
||||||
|
HolidayList[Number(data.day.split('-')[2]) - 1]?.det
|
||||||
|
.length > 0
|
||||||
|
">
|
||||||
|
<el-col
|
||||||
|
:span="24"
|
||||||
|
v-for="(item, index) in HolidayList[
|
||||||
|
Number(data.day.split('-')[2]) - 1
|
||||||
|
]?.det.filter(
|
||||||
|
(item) =>
|
||||||
|
item.schedulingPlanId ==
|
||||||
|
HolidayList[Number(data.day.split('-')[2]) - 1]
|
||||||
|
?.schedulingPlanId
|
||||||
|
)"
|
||||||
|
:key="index">
|
||||||
|
<el-tooltip
|
||||||
|
effect="dark"
|
||||||
|
content="点击展示全部排班计划"
|
||||||
|
placement="top-start">
|
||||||
|
<div
|
||||||
|
class="holiday-div"
|
||||||
|
:style="{
|
||||||
|
backgroundColor:
|
||||||
|
holidayDivColor[item?.classesCode],
|
||||||
|
}"
|
||||||
|
@click="
|
||||||
|
holidayLog(
|
||||||
|
HolidayList[Number(data.day.split('-')[2]) - 1]
|
||||||
|
?.det,
|
||||||
|
HolidayList[Number(data.day.split('-')[2]) - 1]
|
||||||
|
?.date
|
||||||
|
)
|
||||||
|
"
|
||||||
|
:title="
|
||||||
|
item.classesName +
|
||||||
|
' | ' +
|
||||||
|
item.teamName +
|
||||||
|
' | ' +
|
||||||
|
item.workTime
|
||||||
|
">
|
||||||
|
{{
|
||||||
|
item.classesName +
|
||||||
|
' | ' +
|
||||||
|
item.teamName +
|
||||||
|
' | ' +
|
||||||
|
item.workTime
|
||||||
|
}}
|
||||||
|
</div>
|
||||||
|
</el-tooltip>
|
||||||
|
</el-col>
|
||||||
|
</div>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-else
|
||||||
|
style="font-size: 20px; font-weight: 500; text-align: left">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="24">
|
||||||
|
{{ Number(data.day.split('-')[2]) }}
|
||||||
|
<span style="font-size: 12px">
|
||||||
|
{{ getLunarDate(data.day) }}
|
||||||
|
</span>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-calendar>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<base-dialog
|
||||||
|
:dialogTitle="dialogTitle"
|
||||||
|
:dialogVisible="logVisible"
|
||||||
|
@cancel="cancelLog"
|
||||||
|
:before-close="cancelLog"
|
||||||
|
:destroy-on-close="true"
|
||||||
|
width="70%">
|
||||||
|
<holiday-log ref="holidayLogRef"></holiday-log>
|
||||||
|
<template #footer>
|
||||||
|
<slot name="footer">
|
||||||
|
<el-row slot="footer" type="flex" justify="end">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-button size="small" class="btnTextStyle" @click="cancelLog">
|
||||||
|
取消
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</slot>
|
||||||
|
</template>
|
||||||
|
</base-dialog>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import moment from 'moment';
|
||||||
|
import { solarToLunar } from 'chinese-lunar';
|
||||||
|
|
||||||
|
import { getUserProfile } from '@/api/system/user';
|
||||||
|
import { listByDeptId } from '@/api/group/Schedule';
|
||||||
|
import { getEnableData } from '@/api/group/holidaySetting';
|
||||||
|
import {
|
||||||
|
getDeptSchedulingList,
|
||||||
|
getClassSchedulingList,
|
||||||
|
} from '@/api/group/calendar';
|
||||||
|
import holidayLog from './holidayLog';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: '',
|
||||||
|
components: {
|
||||||
|
holidayLog,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
activeName: 'first',
|
||||||
|
startDay: '', // 查询参数
|
||||||
|
HolidayList: [],
|
||||||
|
// 选择的部门名称
|
||||||
|
showDeptName: undefined,
|
||||||
|
showTeamName: {},
|
||||||
|
// 部门树选项
|
||||||
|
deptOptions: undefined,
|
||||||
|
groupOptions: undefined,
|
||||||
|
// 查询的部门名称
|
||||||
|
deptName: undefined,
|
||||||
|
groupName: undefined,
|
||||||
|
|
||||||
|
topDept: {}, // 保存当前用户的部门id为最高级部门id
|
||||||
|
deptId: undefined,
|
||||||
|
teamId: undefined,
|
||||||
|
|
||||||
|
defaultProps: {
|
||||||
|
children: 'children',
|
||||||
|
label: 'name',
|
||||||
|
},
|
||||||
|
logVisible: false,
|
||||||
|
dialogTitle: '',
|
||||||
|
holidayDivColor: ['#67c23a', '#69d983', '#f5c931', '#4fa6f0'],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
// 根据名称筛选部门树
|
||||||
|
deptName(val) {
|
||||||
|
this.$refs.tree.filter(val);
|
||||||
|
},
|
||||||
|
groupName(val) {
|
||||||
|
this.$refs.tree1.filter(val);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.startDay = new Date();
|
||||||
|
// 查询用户个人信息
|
||||||
|
getUserProfile().then((response) => {
|
||||||
|
this.showDeptName = response.data.dept.name || '';
|
||||||
|
this.topDept = {
|
||||||
|
name: response.data.dept.name || '',
|
||||||
|
id: response.data.dept.id || '',
|
||||||
|
}; // 保存当前用户的部门为最高级部门id
|
||||||
|
this.deptId = response.data.dept.id || '';
|
||||||
|
this.getHolidayPage();
|
||||||
|
this.getTreeselect();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getHolidayPage() {
|
||||||
|
const now = new Date(this.startDay);
|
||||||
|
const year = now.getFullYear();
|
||||||
|
const month = now.getMonth();
|
||||||
|
const startTime = `${year}-${String(month + 1).padStart(2, '0')}-01`;
|
||||||
|
const lastDate = new Date(year, month + 1, 0).getDate();
|
||||||
|
const endTime = `${year}-${String(month + 1).padStart(2, '0')}-${String(
|
||||||
|
lastDate
|
||||||
|
).padStart(2, '0')}`;
|
||||||
|
|
||||||
|
this.HolidayList = [];
|
||||||
|
if (this.activeName == 'first') {
|
||||||
|
getDeptSchedulingList({
|
||||||
|
deptId: this.deptId,
|
||||||
|
startTime: Date.parse(startTime),
|
||||||
|
endTime: Date.parse(endTime),
|
||||||
|
}).then((res) => {
|
||||||
|
this.HolidayList = res.data;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
getClassSchedulingList({
|
||||||
|
teamId: this.teamId,
|
||||||
|
startTime: Date.parse(startTime),
|
||||||
|
endTime: Date.parse(endTime),
|
||||||
|
}).then((res) => {
|
||||||
|
this.HolidayList = res.data;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 切换月份
|
||||||
|
selectMonth() {
|
||||||
|
this.getHolidayPage();
|
||||||
|
},
|
||||||
|
/** 查询部门下拉树结构 */
|
||||||
|
getTreeselect() {
|
||||||
|
getEnableData().then((response) => {
|
||||||
|
// 处理 deptOptions 参数
|
||||||
|
this.deptOptions = [];
|
||||||
|
this.deptOptions.push(...this.handleTree(response.data, 'id'));
|
||||||
|
});
|
||||||
|
listByDeptId(this.topDept.id).then((response) => {
|
||||||
|
this.groupOptions = [];
|
||||||
|
this.groupOptions.push(...response.data);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 筛选节点
|
||||||
|
filterNode(value, data) {
|
||||||
|
if (!value) return true;
|
||||||
|
return data.name.indexOf(value) !== -1;
|
||||||
|
},
|
||||||
|
tabsClick() {
|
||||||
|
if (this.activeName == 'second' && this.groupOptions.length > 0) {
|
||||||
|
this.teamId = this.groupOptions[0].id;
|
||||||
|
this.showTeamName = {
|
||||||
|
leaderName: this.groupOptions[0].leaderName || '-',
|
||||||
|
leaderPhone: this.groupOptions[0].leaderPhone || '-',
|
||||||
|
};
|
||||||
|
} else if (this.activeName == 'first') {
|
||||||
|
this.deptId = this.topDept.id;
|
||||||
|
}
|
||||||
|
this.getHolidayPage();
|
||||||
|
},
|
||||||
|
// 节点单击事件
|
||||||
|
handleNodeClick(data) {
|
||||||
|
this.deptId = data.id;
|
||||||
|
this.showDeptName = data.name;
|
||||||
|
this.getHolidayPage();
|
||||||
|
},
|
||||||
|
handleNodeClick1(data) {
|
||||||
|
this.teamId = data.id;
|
||||||
|
this.showTeamName = {
|
||||||
|
leaderName: data.leaderName || '-',
|
||||||
|
leaderPhone: data.leaderPhone || '-',
|
||||||
|
};
|
||||||
|
this.getHolidayPage();
|
||||||
|
},
|
||||||
|
//获取农历
|
||||||
|
getLunarDate(solarDate) {
|
||||||
|
try {
|
||||||
|
const [year, month, day] = solarDate.split('-').map(Number);
|
||||||
|
|
||||||
|
const date = new Date(year, month - 1, day);
|
||||||
|
const lunar = solarToLunar(date);
|
||||||
|
|
||||||
|
// 将数字月份和日期转换为中文
|
||||||
|
const monthMap = {
|
||||||
|
1: '正',
|
||||||
|
2: '二',
|
||||||
|
3: '三',
|
||||||
|
4: '四',
|
||||||
|
5: '五',
|
||||||
|
6: '六',
|
||||||
|
7: '七',
|
||||||
|
8: '八',
|
||||||
|
9: '九',
|
||||||
|
10: '十',
|
||||||
|
11: '冬',
|
||||||
|
12: '腊',
|
||||||
|
};
|
||||||
|
|
||||||
|
const dayMap = {
|
||||||
|
1: '初一',
|
||||||
|
2: '初二',
|
||||||
|
3: '初三',
|
||||||
|
4: '初四',
|
||||||
|
5: '初五',
|
||||||
|
6: '初六',
|
||||||
|
7: '初七',
|
||||||
|
8: '初八',
|
||||||
|
9: '初九',
|
||||||
|
10: '初十',
|
||||||
|
11: '十一',
|
||||||
|
12: '十二',
|
||||||
|
13: '十三',
|
||||||
|
14: '十四',
|
||||||
|
15: '十五',
|
||||||
|
16: '十六',
|
||||||
|
17: '十七',
|
||||||
|
18: '十八',
|
||||||
|
19: '十九',
|
||||||
|
20: '二十',
|
||||||
|
21: '廿一',
|
||||||
|
22: '廿二',
|
||||||
|
23: '廿三',
|
||||||
|
24: '廿四',
|
||||||
|
25: '廿五',
|
||||||
|
26: '廿六',
|
||||||
|
27: '廿七',
|
||||||
|
28: '廿八',
|
||||||
|
29: '廿九',
|
||||||
|
30: '三十',
|
||||||
|
};
|
||||||
|
|
||||||
|
// 返回 "三月初四" 格式
|
||||||
|
return `${monthMap[lunar.month]}月${dayMap[lunar.day]}`;
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
holidayLog(det, date) {
|
||||||
|
this.dialogTitle = this.showDeptName + '-' + date + '-排班详情';
|
||||||
|
this.logVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.holidayLogRef.init(det);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
cancelLog() {
|
||||||
|
this.dialogTitle = '';
|
||||||
|
this.logVisible = false;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss">
|
||||||
|
.head-container {
|
||||||
|
padding: 20px 10px 0;
|
||||||
|
background-color: #fff;
|
||||||
|
min-height: calc(100vh - 120px - 8px);
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
.groupTeamScheduling {
|
||||||
|
.operationArea {
|
||||||
|
padding: 14px 10px 0 16px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
.blue-block {
|
||||||
|
display: inline-block;
|
||||||
|
width: 4px;
|
||||||
|
height: 16px;
|
||||||
|
background-color: #0b58ff;
|
||||||
|
border-radius: 1px;
|
||||||
|
margin-right: 8px;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
.el-form-item {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 日历
|
||||||
|
.calenderArea {
|
||||||
|
padding: 14px 10px 0 20px;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
min-height: calc(100vh - 120px - 8px - 168px);
|
||||||
|
.el-calendar__body {
|
||||||
|
padding: 10px 16px 16px 0;
|
||||||
|
}
|
||||||
|
.el-calendar__header {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.el-calendar-table > thead {
|
||||||
|
height: 48px;
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #000000;
|
||||||
|
background-color: rgba(242, 244, 249, 1);
|
||||||
|
}
|
||||||
|
.el-calendar-table__row {
|
||||||
|
height: 133px;
|
||||||
|
.prev,
|
||||||
|
.next {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
.is-selected,
|
||||||
|
.is-today {
|
||||||
|
background-color: #e4f0fd;
|
||||||
|
}
|
||||||
|
.el-calendar-day {
|
||||||
|
padding: 0;
|
||||||
|
height: 100%;
|
||||||
|
:hover {
|
||||||
|
background-color: #e4f0fd;
|
||||||
|
}
|
||||||
|
.dateStyle {
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #000000;
|
||||||
|
text-align: left;
|
||||||
|
height: 133px;
|
||||||
|
line-height: 28px;
|
||||||
|
padding: 10px;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.lunar-date {
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #909399;
|
||||||
|
}
|
||||||
|
.work-tip {
|
||||||
|
background: #87c1ff;
|
||||||
|
color: white;
|
||||||
|
font-size: 18px;
|
||||||
|
width: 30px;
|
||||||
|
text-align: center;
|
||||||
|
float: right;
|
||||||
|
position: relative;
|
||||||
|
.subIcon {
|
||||||
|
position: absolute;
|
||||||
|
top: -18px;
|
||||||
|
right: -10px;
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.holiday-div {
|
||||||
|
background-color: #67c23a;
|
||||||
|
border-radius: 3px;
|
||||||
|
height: 25px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 24px;
|
||||||
|
color: #fff;
|
||||||
|
margin-bottom: 2px;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2025-10-11 14:27:37
|
* @Date: 2025-10-11 14:27:37
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2025-10-15 16:47:28
|
* @LastEditTime: 2025-10-29 17:12:04
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@@ -12,6 +12,9 @@
|
|||||||
ref="searchBarForm"
|
ref="searchBarForm"
|
||||||
@headBtnClick="buttonClick" />
|
@headBtnClick="buttonClick" />
|
||||||
<base-table
|
<base-table
|
||||||
|
ref="groupTableRef"
|
||||||
|
:id="'groupTableSelectRef'"
|
||||||
|
row-key="id"
|
||||||
:selectWidth="55"
|
:selectWidth="55"
|
||||||
@selection-change="selectChange"
|
@selection-change="selectChange"
|
||||||
:table-props="tableProps"
|
:table-props="tableProps"
|
||||||
@@ -46,6 +49,7 @@ const tableProps = [
|
|||||||
{
|
{
|
||||||
prop: 'remark',
|
prop: 'remark',
|
||||||
label: '备注',
|
label: '备注',
|
||||||
|
showOverflowtooltip: true,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -84,21 +88,51 @@ export default {
|
|||||||
name: '',
|
name: '',
|
||||||
},
|
},
|
||||||
selectedList: [],
|
selectedList: [],
|
||||||
deptId: undefined
|
selectedArr: [], //已选的班组,从父组件传过来的
|
||||||
|
deptId: undefined,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {},
|
created() {},
|
||||||
methods: {
|
methods: {
|
||||||
init(id){
|
init(id, tableData) {
|
||||||
this.deptId = id
|
this.deptId = id;
|
||||||
this.getDataList()
|
this.selectedArr = tableData || [];
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.getDataList();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
getDataList() {
|
getDataList() {
|
||||||
this.urlOptions
|
this.urlOptions.getDataListURL(this.deptId).then((response) => {
|
||||||
.getDataListURL(this.deptId)
|
|
||||||
.then((response) => {
|
|
||||||
this.tableData = response.data;
|
this.tableData = response.data;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (this.selectedArr.length > 0) {
|
||||||
|
this.setSelectedRows();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
setSelectedRows() {
|
||||||
|
const table = this.$refs.groupTableRef.$children[0];
|
||||||
|
|
||||||
|
// 先清空选择
|
||||||
|
table.clearSelection();
|
||||||
|
|
||||||
|
this.selectedArr.forEach((item) => {
|
||||||
|
const rowInTable = this.tableData.find((i) => i.id === item.id);
|
||||||
|
if (rowInTable) {
|
||||||
|
//这里一定要用table.tableData,这样才是指向同一个数组
|
||||||
|
this.$set(table.store.states, 'selection', [
|
||||||
|
...table.store.states.selection,
|
||||||
|
table.tableData.find((i) => i.id === item.id),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 强制更新视图
|
||||||
|
this.$nextTick(() => {
|
||||||
|
table.$forceUpdate();
|
||||||
|
this.$forceUpdate();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
buttonClick(val) {
|
buttonClick(val) {
|
||||||
@@ -115,9 +149,25 @@ export default {
|
|||||||
selectChange(val) {
|
selectChange(val) {
|
||||||
this.selectedList = val;
|
this.selectedList = val;
|
||||||
},
|
},
|
||||||
|
// 判断两个数组是否有重复的 id
|
||||||
|
hasDuplicateIds(arr1, arr2) {
|
||||||
|
const idSet = new Set(arr1.map((item) => item.id));
|
||||||
|
return arr2.some((item) => idSet.has(item.id));
|
||||||
|
},
|
||||||
|
|
||||||
dataFormSubmit() {
|
dataFormSubmit() {
|
||||||
if (this.selectedList && this.selectedList.length > 0) {
|
if (this.selectedList && this.selectedList.length > 0) {
|
||||||
|
const haveData = this.hasDuplicateIds(
|
||||||
|
this.selectedArr,
|
||||||
|
this.selectedList
|
||||||
|
);
|
||||||
|
if (haveData) {
|
||||||
|
this.$message('请不要重复添加数组');
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.$emit('refreshTableData', this.selectedList);
|
this.$emit('refreshTableData', this.selectedList);
|
||||||
|
} else if (this.selectedArr.length > 0) {
|
||||||
|
this.$message('请不要重复添加数组');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2025-10-13 15:07:24
|
* @Date: 2025-10-13 15:07:24
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2025-10-17 17:01:35
|
* @LastEditTime: 2025-10-29 15:28:52
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@@ -111,20 +111,12 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6" v-if="dataForm.shiftType>1">
|
||||||
<el-form-item label="同班次连排" prop="shiftSustainedNum">
|
<el-form-item label="同班次连排" prop="shiftSustainedNum">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="dataForm.shiftSustainedNum"
|
v-model="dataForm.shiftSustainedNum"
|
||||||
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')">
|
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')">
|
||||||
<el-select
|
<span slot="append">日</span>
|
||||||
style="width: 80px"
|
|
||||||
v-model="dataForm.shiftSustainedType"
|
|
||||||
slot="append">
|
|
||||||
<el-option label="日" :value="1"></el-option>
|
|
||||||
<el-option label="周" :value="2"></el-option>
|
|
||||||
<el-option label="月" :value="3"></el-option>
|
|
||||||
<el-option label="季" :value="4"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -176,7 +168,10 @@
|
|||||||
</base-table>
|
</base-table>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="stepNum == 3">
|
<div v-if="stepNum == 3">
|
||||||
<small-title style="margin: 16px 0" size="sm" :no-padding="true">
|
<small-title
|
||||||
|
style="margin: 16px 0; font-size: 16px"
|
||||||
|
size="de"
|
||||||
|
:no-padding="true">
|
||||||
排班计划预览
|
排班计划预览
|
||||||
<span style="font-size: 14px; color: #ff1c15">
|
<span style="font-size: 14px; color: #ff1c15">
|
||||||
系统将根据以下设置,按班组轮班顺序依次循环每日班次,生成正式排班计划,请确认。
|
系统将根据以下设置,按班组轮班顺序依次循环每日班次,生成正式排班计划,请确认。
|
||||||
@@ -263,12 +258,38 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<small-title
|
||||||
|
style="margin: 16px 0; font-size: 16px"
|
||||||
|
size="de"
|
||||||
|
:no-padding="true">
|
||||||
|
预览周期
|
||||||
|
<span>
|
||||||
|
<el-select
|
||||||
|
style="height: 20px"
|
||||||
|
v-model="period"
|
||||||
|
size="mini"
|
||||||
|
@change="setPeriod"
|
||||||
|
placeholder="请选择">
|
||||||
|
<el-option
|
||||||
|
v-for="item in periodArr"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</span>
|
||||||
|
</small-title>
|
||||||
|
|
||||||
|
<base-table
|
||||||
|
v-if="tableProps3.length > 0"
|
||||||
|
:table-props="tableProps3"
|
||||||
|
:table-data="tableData3"></base-table>
|
||||||
</div>
|
</div>
|
||||||
<base-dialog
|
<base-dialog
|
||||||
:dialogTitle="'修改班次'"
|
:dialogTitle="'修改班次'"
|
||||||
:dialogVisible="addOrUpdateVisible1"
|
:dialogVisible="addOrUpdateVisible1"
|
||||||
@cancel="cancel1"
|
@cancel="cancel1"
|
||||||
@confirm="handleConfirm1"
|
@confirm="handleConfirm1"
|
||||||
|
:before-close="cancel1"
|
||||||
:destroy-on-close="true"
|
:destroy-on-close="true"
|
||||||
append-to-body
|
append-to-body
|
||||||
width="40%">
|
width="40%">
|
||||||
@@ -281,6 +302,7 @@
|
|||||||
:dialogVisible="addOrUpdateVisible2"
|
:dialogVisible="addOrUpdateVisible2"
|
||||||
@cancel="cancel2"
|
@cancel="cancel2"
|
||||||
@confirm="handleConfirm2"
|
@confirm="handleConfirm2"
|
||||||
|
:before-close="cancel2"
|
||||||
:destroy-on-close="true"
|
:destroy-on-close="true"
|
||||||
append-to-body
|
append-to-body
|
||||||
width="40%">
|
width="40%">
|
||||||
@@ -293,6 +315,7 @@
|
|||||||
:dialogVisible="addOrUpdateVisible3"
|
:dialogVisible="addOrUpdateVisible3"
|
||||||
@cancel="cancel3"
|
@cancel="cancel3"
|
||||||
@confirm="handleConfirm3"
|
@confirm="handleConfirm3"
|
||||||
|
:before-close="cancel3"
|
||||||
:destroy-on-close="true"
|
:destroy-on-close="true"
|
||||||
append-to-body
|
append-to-body
|
||||||
width="50%">
|
width="50%">
|
||||||
@@ -306,11 +329,24 @@
|
|||||||
<script>
|
<script>
|
||||||
import deptSelect from './../deptSelect.vue';
|
import deptSelect from './../deptSelect.vue';
|
||||||
import SmallTitle from './SmallTitle';
|
import SmallTitle from './SmallTitle';
|
||||||
|
import propfirstSpan from './propfirstSpan.vue';
|
||||||
|
import propSpan from './propSpan.vue';
|
||||||
import { parseTime } from '@/filter/code-filter';
|
import { parseTime } from '@/filter/code-filter';
|
||||||
import editClass from './edit-class.vue';
|
import editClass from './edit-class.vue';
|
||||||
import addGroup from './add-group.vue';
|
import addGroup from './add-group.vue';
|
||||||
import bindLine from './bind-line.vue';
|
import bindLine from './bind-line.vue';
|
||||||
import { getCode, createStepOne, returnStepOne } from '@/api/group/Schedule';
|
import {
|
||||||
|
getCode,
|
||||||
|
createStepOne,
|
||||||
|
returnStepOne,
|
||||||
|
createStepTwo,
|
||||||
|
returnStepTwo,
|
||||||
|
getPerView,
|
||||||
|
draftEditing,
|
||||||
|
cancelStepThree,
|
||||||
|
checkPlan,
|
||||||
|
createStepFour,
|
||||||
|
} from '@/api/group/Schedule';
|
||||||
|
|
||||||
const tableProps1 = [
|
const tableProps1 = [
|
||||||
{
|
{
|
||||||
@@ -318,18 +354,18 @@ const tableProps1 = [
|
|||||||
label: '班次名称',
|
label: '班次名称',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'startDay',
|
prop: 'startTime',
|
||||||
label: '开始时间',
|
label: '开始时间',
|
||||||
// filter: (val) => {
|
filter: (val) => {
|
||||||
// parseTime(val, '{H}:{mm}');
|
return val ? val.slice(0, -3) : '-';
|
||||||
// },
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'endDay',
|
prop: 'endTime',
|
||||||
label: '结束时间',
|
label: '结束时间',
|
||||||
// filter: (val) => {
|
filter: (val) => {
|
||||||
// parseTime(val, '{H}:{mm}');
|
return val ? val.slice(0, -3) : '-';
|
||||||
// },
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'remark',
|
prop: 'remark',
|
||||||
@@ -356,8 +392,9 @@ const tableProps2 = [
|
|||||||
width: 110,
|
width: 110,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'code1',
|
prop: 'lineName',
|
||||||
label: '产线及工段',
|
label: '产线及工段',
|
||||||
|
showOverflowtooltip: true,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -368,6 +405,8 @@ export default {
|
|||||||
editClass,
|
editClass,
|
||||||
addGroup,
|
addGroup,
|
||||||
bindLine,
|
bindLine,
|
||||||
|
propfirstSpan,
|
||||||
|
propSpan,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -383,6 +422,7 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
stepNum: 1, // 当前第几步
|
stepNum: 1, // 当前第几步
|
||||||
|
shiftTypeEdit: undefined, //该值为编辑时获取的shiftType,到第二步,判断dataForm.shiftType是否改变,同时改变班次信息
|
||||||
//第一步参数
|
//第一步参数
|
||||||
dataForm: {
|
dataForm: {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
@@ -474,6 +514,16 @@ export default {
|
|||||||
{
|
{
|
||||||
type: 'bind',
|
type: 'bind',
|
||||||
btnName: '绑定产线',
|
btnName: '绑定产线',
|
||||||
|
showParam: {
|
||||||
|
type: '&',
|
||||||
|
data: [
|
||||||
|
{
|
||||||
|
type: 'equal',
|
||||||
|
name: 'isProduction',
|
||||||
|
value: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'delete',
|
type: 'delete',
|
||||||
@@ -527,41 +577,55 @@ export default {
|
|||||||
class2: 'B',
|
class2: 'B',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
period: 7, //预览周期
|
||||||
|
periodArr: [
|
||||||
|
{
|
||||||
|
value: 7,
|
||||||
|
label: '7天',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 14,
|
||||||
|
label: '14天',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 30,
|
||||||
|
label: '30天',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
tableProps3: [],
|
||||||
|
tableData3: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//子组件获取的部门id
|
init(id) {
|
||||||
setDeptId(val) {
|
this.dataForm.id = id || undefined;
|
||||||
this.dataForm.deptId = val;
|
|
||||||
},
|
|
||||||
//详情时传给子组件的部门id
|
|
||||||
setDataForm() {
|
|
||||||
this.$refs.deptSelect.setID(this.dataForm.deptId);
|
|
||||||
},
|
|
||||||
init() {
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs['dataForm'].resetFields();
|
this.$refs['dataForm'].resetFields();
|
||||||
|
if (this.dataForm.id) {
|
||||||
|
draftEditing(this.dataForm.id).then((res) => {
|
||||||
|
this.dataForm = res.data?.stepOne;
|
||||||
|
this.shiftTypeEdit = res.data?.stepOne.shiftType;
|
||||||
|
this.setDataForm();
|
||||||
|
this.tableData1 = res.data?.stepTwo.groupPlanClassesBaseVOList;
|
||||||
|
this.tableData2 = res.data?.stepTwo.groupPlanTeamBaseVOList;
|
||||||
|
this.tableData2.forEach((item, index) => {
|
||||||
|
let lineName = '';
|
||||||
|
lineName = this.setLineName(item.bindLineTree, lineName);
|
||||||
|
this.$set(
|
||||||
|
this.tableData2[index],
|
||||||
|
'lineName',
|
||||||
|
lineName.slice(0, -1)
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
getCode().then((res) => {
|
getCode().then((res) => {
|
||||||
this.dataForm.code = res.data;
|
this.dataForm.code = res.data;
|
||||||
});
|
});
|
||||||
});
|
|
||||||
},
|
|
||||||
handleClick1(val) {
|
|
||||||
this.addOrUpdateVisible1 = true;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.editClassRef.init(val.data);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
handleClick2(val) {
|
|
||||||
if (val.type === 'bind') {
|
|
||||||
this.addOrUpdateVisible3 = true;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.bindLineRef.init(val.data.id);
|
|
||||||
});
|
|
||||||
} else if (val.type === 'delete') {
|
|
||||||
this.tableData2.splice(val.data._pageIndex - 1, 1);
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
//上一步
|
||||||
upSubmit() {
|
upSubmit() {
|
||||||
if (this.stepNum == 2) {
|
if (this.stepNum == 2) {
|
||||||
returnStepOne(this.dataForm.id).then((res) => {
|
returnStepOne(this.dataForm.id).then((res) => {
|
||||||
@@ -571,8 +635,14 @@ export default {
|
|||||||
this.setDataForm();
|
this.setDataForm();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
} else if (this.stepNum == 3) {
|
||||||
|
returnStepTwo(this.dataForm.id).then((res) => {
|
||||||
|
this.stepNum -= 1;
|
||||||
|
this.$emit('setSN', this.stepNum);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
//下一步
|
||||||
nextSubmit() {
|
nextSubmit() {
|
||||||
if (this.stepNum == 1) {
|
if (this.stepNum == 1) {
|
||||||
this.$refs['dataForm'].validate((valid) => {
|
this.$refs['dataForm'].validate((valid) => {
|
||||||
@@ -584,99 +654,216 @@ export default {
|
|||||||
this.$message('部门不能为空');
|
this.$message('部门不能为空');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const compareDate = this.compareDates(this.dataForm.startDay,this.dataForm.endDay)
|
||||||
|
|
||||||
|
if (compareDate > 0 ) {
|
||||||
|
this.$message('开始时间不能大于结束时间');
|
||||||
|
return;
|
||||||
|
}
|
||||||
createStepOne(this.dataForm).then((res) => {
|
createStepOne(this.dataForm).then((res) => {
|
||||||
|
if (!this.dataForm.id) {
|
||||||
this.dataForm.id = res.data;
|
this.dataForm.id = res.data;
|
||||||
|
}
|
||||||
this.stepNum += 1;
|
this.stepNum += 1;
|
||||||
this.$emit('setSN', this.stepNum);
|
this.$emit('setSN', this.stepNum);
|
||||||
this.setTWOclass(); // 第一步提交后,根据倒班方式设置第二部班次
|
if (
|
||||||
|
!this.dataForm.id ||
|
||||||
|
this.dataForm.shiftType !== this.shiftTypeEdit
|
||||||
|
) {
|
||||||
|
this.setTWOclass(); // (新增时或者编辑时倒班方式变了)第一步提交后,根据倒班方式设置第二部班次
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.stepNum == 2) {
|
if (this.stepNum == 2) {
|
||||||
let data = {}
|
if (!this.tableData2 || this.tableData2.length == 0) {
|
||||||
data.planId = this.dataForm.id
|
this.$message('班组不能为空');
|
||||||
data.groupPlanClassesBaseVOList = [] //排班-班次信息list
|
return;
|
||||||
this.tableData1.forEach((item,index)=>{
|
}
|
||||||
|
|
||||||
|
let isbindLine = false;
|
||||||
|
this.tableData2.forEach((item) => {
|
||||||
|
if (!item.bindLineTree || item.bindLineTree.length == 0) {
|
||||||
|
isbindLine = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (isbindLine) {
|
||||||
|
this.$message('生产班组必须绑定产线或工段');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const ids = this.tableData2.map((item) => item.id);
|
||||||
|
const uniqueIds = [...new Set(ids)];
|
||||||
|
if (ids.length !== uniqueIds.length) {
|
||||||
|
this.$message('存在重复的班组,请检查!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.dataForm.shiftType == 1 && this.tableData2.length > 1) {
|
||||||
|
this.$message('白班,班组数量仅支持 1个 班组');
|
||||||
|
return;
|
||||||
|
} else if (this.dataForm.shiftType == 2 && this.tableData2.length < 2) {
|
||||||
|
this.$message('两班倒,班组数量至少 2个 班组');
|
||||||
|
return;
|
||||||
|
} else if (this.dataForm.shiftType == 3 && this.tableData2.length < 3) {
|
||||||
|
this.$message('三班倒,班组数量至少 3个 班组');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let data = {};
|
||||||
|
data.planId = this.dataForm.id;
|
||||||
|
data.groupPlanClassesBaseVOList = []; //排班-班次信息list
|
||||||
|
this.tableData1.forEach((item, index) => {
|
||||||
const obj = {
|
const obj = {
|
||||||
sort: index+1,
|
sort: index + 1,
|
||||||
name : item.name,
|
name: item.name,
|
||||||
remark: item.remark,
|
remark: item.remark,
|
||||||
startTime: {
|
startTime: item.startTime,
|
||||||
hour:item.startDay.split(':')[0],
|
endTime: item.endTime,
|
||||||
minute:item.startDay.split(':')[1],
|
daySpan: item.daySpan,
|
||||||
},
|
};
|
||||||
endTime: {
|
data.groupPlanClassesBaseVOList.push(obj);
|
||||||
hour:item.endDay.split(':')[0],
|
});
|
||||||
minute:item.endDay.split(':')[1],
|
data.groupPlanTeamBaseVOList = []; //排班-班组信息list
|
||||||
}
|
this.tableData2.forEach((item) => {
|
||||||
}
|
|
||||||
data.groupPlanClassesBaseVOList.push(obj)
|
|
||||||
})
|
|
||||||
data.groupPlanTeamBaseVOList = [] //排班-班组信息list
|
|
||||||
this.tableData2.forEach(item=>{
|
|
||||||
const obj = {
|
const obj = {
|
||||||
teamId:item.id,
|
teamId: item.id,
|
||||||
bindData: ''
|
name: item.name,
|
||||||
}
|
leaderName: item.leaderName,
|
||||||
data.groupPlanTeamBaseVOList.push(obj)
|
leaderPhone:item.leaderPhone,
|
||||||
})
|
bindData: JSON.stringify(item.bindLineTree),
|
||||||
|
};
|
||||||
|
data.groupPlanTeamBaseVOList.push(obj);
|
||||||
|
});
|
||||||
|
createStepTwo(data).then((res) => {
|
||||||
this.stepNum += 1;
|
this.stepNum += 1;
|
||||||
this.$emit('setSN', this.stepNum);
|
this.$emit('setSN', this.stepNum);
|
||||||
|
this.getThreeGroup(7); // 第三步,进来加载预览排班,默认7天预览周期
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.stepNum == 3) {
|
if (this.stepNum == 3) {
|
||||||
|
let data = { planId: this.dataForm.id };
|
||||||
|
data.groupPlanTeamBaseVOList = []; //排班-班组信息list
|
||||||
|
this.tableData2.forEach((item) => {
|
||||||
|
const obj = {
|
||||||
|
teamId: item.id,
|
||||||
|
name: item.name,
|
||||||
|
bindData: JSON.stringify(item.bindLineTree),
|
||||||
|
};
|
||||||
|
data.groupPlanTeamBaseVOList.push(obj);
|
||||||
|
});
|
||||||
|
checkPlan(data).then((RES) => {
|
||||||
|
createStepFour(this.dataForm.id).then((res) => {
|
||||||
|
this.$modal.msgSuccess('创建计划成功');
|
||||||
this.stepNum = 1;
|
this.stepNum = 1;
|
||||||
this.$emit('setSN', this.stepNum);
|
this.$emit('setSN', this.stepNum);
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
});
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
//第一步
|
||||||
|
//子组件获取的部门id
|
||||||
|
setDeptId(val) {
|
||||||
|
this.dataForm.deptId = val;
|
||||||
|
},
|
||||||
|
//详情时传给子组件的部门id
|
||||||
|
setDataForm() {
|
||||||
|
this.$refs.deptSelect.setID(this.dataForm.deptId);
|
||||||
|
},
|
||||||
|
//比较时间,开始时间在结束时间前
|
||||||
|
compareDates(date1, date2) {
|
||||||
|
const d1 = date1;
|
||||||
|
const d2 = date2;
|
||||||
|
|
||||||
|
if (d1 === d2) {
|
||||||
|
return 0; // 日期相等
|
||||||
|
} else if (d1 < d2) {
|
||||||
|
return -1; // date1 在 date2 之前
|
||||||
|
} else {
|
||||||
|
return 1; // date1 在 date2 之后
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//第二步
|
||||||
//设置第二部班次
|
//设置第二部班次
|
||||||
setTWOclass() {
|
setTWOclass() {
|
||||||
this.tableData1 = [];
|
this.tableData1 = [];
|
||||||
if (this.dataForm.shiftType == 1) {
|
if (this.dataForm.shiftType == 1) {
|
||||||
const obj = {
|
const obj = {
|
||||||
name: '长白班',
|
name: '长白班',
|
||||||
startDay: '8:00',
|
startTime: '08:00:00',
|
||||||
endDay: '17:00',
|
endTime: '17:00:00',
|
||||||
|
daySpan: 0, //是否跨天
|
||||||
|
code: 1, //排版日历页面,根据这个字段显示颜色
|
||||||
};
|
};
|
||||||
this.tableData1.push(obj);
|
this.tableData1.push(obj);
|
||||||
} else if (this.dataForm.shiftType == 2) {
|
} else if (this.dataForm.shiftType == 2) {
|
||||||
const obj1 = {
|
const obj1 = {
|
||||||
name: '白班',
|
name: '白班',
|
||||||
startDay: '8:00',
|
startTime: '08:00:00',
|
||||||
endDay: '20:00',
|
endTime: '20:00:00',
|
||||||
|
daySpan: 0,
|
||||||
|
code: 1,
|
||||||
};
|
};
|
||||||
const obj2 = {
|
const obj2 = {
|
||||||
name: '夜班',
|
name: '夜班',
|
||||||
startDay: '20:00',
|
startTime: '20:00:00',
|
||||||
endDay: '8:00',
|
endTime: '08:00:00',
|
||||||
|
daySpan: 1,
|
||||||
|
code: 3,
|
||||||
};
|
};
|
||||||
this.tableData1.push(obj1, obj2);
|
this.tableData1.push(obj1, obj2);
|
||||||
} else if (this.dataForm.shiftType == 3) {
|
} else if (this.dataForm.shiftType == 3) {
|
||||||
const obj1 = {
|
const obj1 = {
|
||||||
name: '早班',
|
name: '早班',
|
||||||
startDay: '8:00',
|
startTime: '08:00:00',
|
||||||
endDay: '16:00',
|
endTime: '16:00:00',
|
||||||
|
daySpan: 0,
|
||||||
|
code: 1,
|
||||||
};
|
};
|
||||||
const obj2 = {
|
const obj2 = {
|
||||||
name: '中班',
|
name: '中班',
|
||||||
startDay: '16:00',
|
startTime: '16:00:00',
|
||||||
endDay: '00:00',
|
endTime: '00:00:00',
|
||||||
|
daySpan: 1,
|
||||||
|
code: 2,
|
||||||
};
|
};
|
||||||
const obj3 = {
|
const obj3 = {
|
||||||
name: '夜班',
|
name: '夜班',
|
||||||
startDay: '00:00',
|
startTime: '00:00:00',
|
||||||
endDay: '8:00',
|
endTime: '08:00:00',
|
||||||
|
daySpan: 0,
|
||||||
|
code: 3,
|
||||||
};
|
};
|
||||||
this.tableData1.push(obj1, obj2, obj3);
|
this.tableData1.push(obj1, obj2, obj3);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
//编辑班次
|
||||||
|
handleClick1(val) {
|
||||||
|
this.addOrUpdateVisible1 = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.editClassRef.init(val.data);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//班组操作
|
||||||
|
handleClick2(val) {
|
||||||
|
if (val.type === 'bind') {
|
||||||
|
this.addOrUpdateVisible3 = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.bindLineRef.init(val.data);
|
||||||
|
});
|
||||||
|
} else if (val.type === 'delete') {
|
||||||
|
this.tableData2.splice(val.data._pageIndex - 1, 1);
|
||||||
|
}
|
||||||
|
},
|
||||||
// 新增班组
|
// 新增班组
|
||||||
addNewGroup() {
|
addNewGroup() {
|
||||||
this.addOrUpdateVisible2 = true;
|
this.addOrUpdateVisible2 = true;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.addGroupRef.init(this.dataForm.deptId);
|
this.$refs.addGroupRef.init(this.dataForm.deptId,this.tableData2);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
cancel1() {
|
cancel1() {
|
||||||
@@ -705,10 +892,93 @@ export default {
|
|||||||
this.tableData2.push(...val);
|
this.tableData2.push(...val);
|
||||||
this.cancel2();
|
this.cancel2();
|
||||||
},
|
},
|
||||||
refreshTableData3(val) {
|
refreshTableData3(index, val) {
|
||||||
console.log(val);
|
this.tableData2[index].bindLineTree = val;
|
||||||
|
let lineName = '';
|
||||||
|
lineName = this.setLineName(val, lineName);
|
||||||
|
if (lineName) {
|
||||||
|
this.$set(this.tableData2[index], 'lineName', lineName.slice(0, -1));
|
||||||
|
}
|
||||||
this.cancel3();
|
this.cancel3();
|
||||||
},
|
},
|
||||||
|
//提取绑定的产线工段名展示出来
|
||||||
|
setLineName(val, lineName) {
|
||||||
|
val.forEach((item) => {
|
||||||
|
lineName += item.name + ':';
|
||||||
|
if (item.children && item.children.length > 0) {
|
||||||
|
const childName = this.setLineName(item.children, lineName);
|
||||||
|
lineName = childName;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return lineName;
|
||||||
|
},
|
||||||
|
//第三步
|
||||||
|
// 进来加载预览排班
|
||||||
|
getThreeGroup(day) {
|
||||||
|
const data = {
|
||||||
|
id: this.dataForm.id,
|
||||||
|
count: day,
|
||||||
|
};
|
||||||
|
this.tableProps3 = [];
|
||||||
|
this.tableData3 = [];
|
||||||
|
getPerView(data).then((res) => {
|
||||||
|
this.setThreeData(res.data);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
setPeriod(val) {
|
||||||
|
this.getThreeGroup(val);
|
||||||
|
},
|
||||||
|
|
||||||
|
setThreeData(data) {
|
||||||
|
//表头第一个为班次名称
|
||||||
|
const propfirst = {
|
||||||
|
prop: 'name',
|
||||||
|
label: '',
|
||||||
|
align: 'center',
|
||||||
|
fixed: true,
|
||||||
|
subcomponent: propfirstSpan,
|
||||||
|
};
|
||||||
|
this.tableProps3.push(propfirst);
|
||||||
|
data.forEach((item, index) => {
|
||||||
|
//设置所有日期为表头
|
||||||
|
const obj = {
|
||||||
|
prop: 'daydata' + index,
|
||||||
|
label: item.day,
|
||||||
|
work: item.work,
|
||||||
|
subcomponent: propSpan,
|
||||||
|
};
|
||||||
|
this.tableProps3.push(obj);
|
||||||
|
item.det.forEach((sItem, sIndex) => {
|
||||||
|
if (index === 0) {
|
||||||
|
let sObj = {
|
||||||
|
name: sItem.classesName + '/' + sItem.time,
|
||||||
|
sort: sItem.sort,
|
||||||
|
};
|
||||||
|
sObj['daydata' + index] = item.work
|
||||||
|
? sItem.teamName
|
||||||
|
: item.holidayName;
|
||||||
|
this.tableData3.push(sObj);
|
||||||
|
} else {
|
||||||
|
this.$set(
|
||||||
|
this.tableData3[sIndex],
|
||||||
|
'daydata' + index,
|
||||||
|
item.work ? sItem.teamName : item.holidayName
|
||||||
|
);
|
||||||
|
this.$set(this.tableData3[sIndex], 'sort', sItem.sort);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
cancelStep() {
|
||||||
|
if (this.stepNum > 1) {
|
||||||
|
cancelStepThree(this.dataForm.id).then((res) => {
|
||||||
|
this.$message('已取消计划');
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2021-11-18 14:16:25
|
* @Date: 2021-11-18 14:16:25
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2025-10-16 16:37:40
|
* @LastEditTime: 2025-10-30 10:47:09
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
pid="pid"
|
pid="pid"
|
||||||
:defaultProps="{ label: 'name' }"
|
:defaultProps="{ label: 'name' }"
|
||||||
height="450px"
|
height="450px"
|
||||||
style="padding-bottom:20px"
|
style="padding-bottom: 20px"
|
||||||
:mode="mode"
|
:mode="mode"
|
||||||
filter
|
filter
|
||||||
openAll></tree-transfer>
|
openAll></tree-transfer>
|
||||||
@@ -31,7 +31,6 @@ export default {
|
|||||||
components: { treeTransfer },
|
components: { treeTransfer },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
groupId: undefined,
|
|
||||||
title: ['待选', '已选'],
|
title: ['待选', '已选'],
|
||||||
mode: 'transfer',
|
mode: 'transfer',
|
||||||
fromData: [], //左边内容
|
fromData: [], //左边内容
|
||||||
@@ -39,30 +38,50 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init(id) {
|
init(val) {
|
||||||
|
this._pageIndex = val._pageIndex - 1;
|
||||||
this.fromData = [];
|
this.fromData = [];
|
||||||
this.toData = [];
|
this.toData = [];
|
||||||
this.groupId = id;
|
|
||||||
getGroupPlanTree().then((res) => {
|
getGroupPlanTree().then((res) => {
|
||||||
this.fromData = res.data;
|
this.fromData = res.data;
|
||||||
this.fromData.forEach((item) => {
|
this.fromData.forEach((item) => {
|
||||||
item.productionLineId = 0;
|
item.productionLineId = 0;
|
||||||
});
|
});
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.toData = val.bindLineTree || [];
|
||||||
|
this.getFilterLeftData(this.fromData, this.toData); //编辑时组件有bug,左边相同数据不消失
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 监听穿梭框组件添加
|
// 监听穿梭框组件添加
|
||||||
add(fromData, toData, obj) {
|
add(fromData, toData, obj) {
|
||||||
console.log('fromData:', fromData);
|
console.log('fromData:', fromData);
|
||||||
console.log('toData:', toData,obj);
|
console.log('toData:', toData, obj);
|
||||||
},
|
},
|
||||||
// 监听穿梭框组件移除
|
// 监听穿梭框组件移除
|
||||||
remove(fromData, toData, obj) {
|
remove(fromData, toData, obj) {
|
||||||
console.log('fromData:', fromData);
|
console.log('fromData:', fromData);
|
||||||
console.log('toData:', toData);
|
console.log('toData:', toData);
|
||||||
},
|
},
|
||||||
|
/** 消除组件左边与右边选中数据相同项 */
|
||||||
|
// 处理过滤数据
|
||||||
|
getFilterLeftData(data, selData) {
|
||||||
|
for (let i = data.length - 1; i >= 0; i--) {
|
||||||
|
for (let j = selData.length - 1; j >= 0; j--) {
|
||||||
|
if (data[i] && data[i].id === selData[j].id) {
|
||||||
|
// 当id相等可以删除的情况 即:没有子级可以删除;
|
||||||
|
if (!data[i].children || data[i].children.length == 0) {
|
||||||
|
data.splice(i, 1);
|
||||||
|
} else {
|
||||||
|
this.getFilterLeftData(data[i].children, selData[j].children);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
// 表单提交
|
// 表单提交
|
||||||
dataFormSubmit() {
|
dataFormSubmit() {
|
||||||
this.$emit('refreshTableData',this.toData);
|
this.$emit('refreshTableData', this._pageIndex, this.toData);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
187
src/views/group/Schedule/detail.vue
Normal file
187
src/views/group/Schedule/detail.vue
Normal file
@@ -0,0 +1,187 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2025-10-21 14:27:23
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2025-10-21 15:02:27
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div class="info-div">
|
||||||
|
<div>
|
||||||
|
<span class="title">计划编号:</span>
|
||||||
|
{{ infoData.code }}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span class="title">计划状态:</span>
|
||||||
|
{{ ['', '草稿', '已确认', '已作废'][infoData.status] }}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span class="title">计划名称:</span>
|
||||||
|
{{ infoData.name }}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span class="title">部门:</span>
|
||||||
|
{{ infoData.deptName }}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span class="title">开始时间:</span>
|
||||||
|
{{ parseTime(infoData.startDay) }}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span class="title">结束时间:</span>
|
||||||
|
{{ parseTime(infoData.endDay) }}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span class="title">周末休假方式:</span>
|
||||||
|
{{ ['', '双休', '周六休', '周日休', '不休'][infoData.weekType] }}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span class="title">倒班方式:</span>
|
||||||
|
{{ ['', '长白班', '两班倒', '三班倒'][infoData.shiftType] }}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span class="title">同班次连排:</span>
|
||||||
|
{{ infoData.shiftSustainedNum }}日
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span class="title">创建人:</span>
|
||||||
|
{{ infoData.creator }}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span class="title">创建时间:</span>
|
||||||
|
{{ parseTime(infoData.createTime) }}
|
||||||
|
</div>
|
||||||
|
<div v-if="infoData.status == 3">
|
||||||
|
<span class="title">作废时间:</span>
|
||||||
|
{{ parseTime(infoData.disableTime) }}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<span class="title">备注:</span>
|
||||||
|
{{ infoData.remark }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<el-tabs v-model="activeName" stretch>
|
||||||
|
<el-tab-pane label="班次" name="first"></el-tab-pane>
|
||||||
|
<el-tab-pane label="班组" name="second"></el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
<base-table
|
||||||
|
v-if="activeName == 'first'"
|
||||||
|
:table-props="tableProps1"
|
||||||
|
:page="1"
|
||||||
|
:limit="10"
|
||||||
|
:table-data="tableData1"></base-table>
|
||||||
|
<base-table
|
||||||
|
v-else
|
||||||
|
:table-props="tableProps2"
|
||||||
|
:page="1"
|
||||||
|
:limit="10"
|
||||||
|
:table-data="tableData2"></base-table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { parseTime } from '@/filter/code-filter';
|
||||||
|
import { getPlan } from '@/api/group/Schedule';
|
||||||
|
|
||||||
|
const tableProps1 = [
|
||||||
|
{
|
||||||
|
prop: 'name',
|
||||||
|
label: '班次名称',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'startTime',
|
||||||
|
label: '开始时间',
|
||||||
|
filter: (val) => {
|
||||||
|
return val ? val.slice(0, -3) : '-';
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'endTime',
|
||||||
|
label: '结束时间',
|
||||||
|
filter: (val) => {
|
||||||
|
return val ? val.slice(0, -3) : '-';
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'remark',
|
||||||
|
label: '备注',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const tableProps2 = [
|
||||||
|
{
|
||||||
|
prop: 'code',
|
||||||
|
label: '班组编号',
|
||||||
|
width: 140,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'name',
|
||||||
|
label: '班组名称',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'isProduction',
|
||||||
|
label: '是否生产班组',
|
||||||
|
filter: (val) => {
|
||||||
|
return val ? '是' : '否';
|
||||||
|
},
|
||||||
|
width: 110,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'lineName',
|
||||||
|
label: '产线及工段',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
infoData: {},
|
||||||
|
activeName: 'first',
|
||||||
|
tableProps1,
|
||||||
|
tableData1: [],
|
||||||
|
tableProps2,
|
||||||
|
tableData2: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
init(id) {
|
||||||
|
this.infoData = {};
|
||||||
|
getPlan(id).then((res) => {
|
||||||
|
this.infoData = res.data || {};
|
||||||
|
console.log(res);
|
||||||
|
this.tableData1 = res.data?.groupPlanClassesBaseVOList;
|
||||||
|
this.tableData2 = res.data?.groupPlanTeamBaseVOList;
|
||||||
|
this.tableData2.forEach((item, index) => {
|
||||||
|
let lineName = '';
|
||||||
|
lineName = this.setLineName(item.bindLineTree, lineName);
|
||||||
|
this.$set(this.tableData2[index], 'lineName', lineName.slice(0, -1));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//提取绑定的产线工段名展示出来
|
||||||
|
setLineName(val, lineName) {
|
||||||
|
val.forEach((item) => {
|
||||||
|
lineName += item.name + ':';
|
||||||
|
if (item.children && item.children.length > 0) {
|
||||||
|
const childName = this.setLineName(item.children, lineName);
|
||||||
|
lineName = childName;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return lineName;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.info-div {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 1fr 1fr;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
.title {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2021-11-18 14:16:25
|
* @Date: 2021-11-18 14:16:25
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2025-10-15 16:31:11
|
* @LastEditTime: 2025-10-20 10:23:52
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@@ -32,22 +32,22 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="开始时间" prop="startDay">
|
<el-form-item label="开始时间" prop="startTime">
|
||||||
<el-time-picker
|
<el-time-picker
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
format="H:mm"
|
format="H:mm"
|
||||||
value-format="H:mm"
|
value-format="HH:mm:ss"
|
||||||
v-model="dataForm.startDay"
|
v-model="dataForm.startTime"
|
||||||
placeholder="选择日期时间"></el-time-picker>
|
placeholder="选择日期时间"></el-time-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="结束时间" prop="endDay">
|
<el-form-item label="结束时间" prop="endTime">
|
||||||
<el-time-picker
|
<el-time-picker
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
format="H:mm"
|
format="H:mm"
|
||||||
value-format="H:mm"
|
value-format="HH:mm:ss"
|
||||||
v-model="dataForm.endDay"
|
v-model="dataForm.endTime"
|
||||||
placeholder="选择日期时间"></el-time-picker>
|
placeholder="选择日期时间"></el-time-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -72,8 +72,8 @@ export default {
|
|||||||
id: undefined,
|
id: undefined,
|
||||||
index: undefined,
|
index: undefined,
|
||||||
name: undefined,
|
name: undefined,
|
||||||
startDay: undefined,
|
startTime: undefined,
|
||||||
endDay: undefined,
|
endTime: undefined,
|
||||||
remark: undefined,
|
remark: undefined,
|
||||||
},
|
},
|
||||||
_pageIndex: 1,
|
_pageIndex: 1,
|
||||||
@@ -82,10 +82,10 @@ export default {
|
|||||||
name: [
|
name: [
|
||||||
{ required: true, message: '班次名称不能为空', trigger: 'blur' },
|
{ required: true, message: '班次名称不能为空', trigger: 'blur' },
|
||||||
],
|
],
|
||||||
startDay: [
|
startTime: [
|
||||||
{ required: true, message: '开始时间不能为空', trigger: 'change' },
|
{ required: true, message: '开始时间不能为空', trigger: 'change' },
|
||||||
],
|
],
|
||||||
endDay: [
|
endTime: [
|
||||||
{ required: true, message: '结束时间不能为空', trigger: 'change' },
|
{ required: true, message: '结束时间不能为空', trigger: 'change' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -96,8 +96,8 @@ export default {
|
|||||||
this._pageIndex = val._pageIndex-1;
|
this._pageIndex = val._pageIndex-1;
|
||||||
this.dataForm.index = val._pageIndex || 1;
|
this.dataForm.index = val._pageIndex || 1;
|
||||||
this.dataForm.name = val.name || undefined;
|
this.dataForm.name = val.name || undefined;
|
||||||
this.dataForm.startDay = val.startDay || undefined;
|
this.dataForm.startTime = val.startTime || undefined;
|
||||||
this.dataForm.endDay = val.endDay || undefined;
|
this.dataForm.endTime = val.endTime || undefined;
|
||||||
this.dataForm.remark = val.remark || undefined;
|
this.dataForm.remark = val.remark || undefined;
|
||||||
},
|
},
|
||||||
// 表单提交
|
// 表单提交
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2025-10-11 14:27:37
|
* @Date: 2025-10-11 14:27:37
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2025-10-15 16:42:28
|
* @LastEditTime: 2025-10-29 14:50:16
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@@ -59,12 +59,14 @@
|
|||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
size="small"
|
size="small"
|
||||||
|
v-hasPermi="['base:group-scheduling-plan:query']"
|
||||||
@click="buttonClick({ btnName: 'search' })">
|
@click="buttonClick({ btnName: 'search' })">
|
||||||
查询
|
查询
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<span class="separateStyle"></span>
|
<span class="separateStyle"
|
||||||
|
v-hasPermi="['base:group-scheduling-plan:query']"></span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button size="small" @click="buttonClick({ btnName: 'reset' })">
|
<el-button size="small" @click="buttonClick({ btnName: 'reset' })">
|
||||||
@@ -72,13 +74,15 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<span class="separateStyle"></span>
|
<span class="separateStyle"
|
||||||
|
v-hasPermi="['base:group-scheduling-plan:create']"></span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
type="success"
|
||||||
size="small"
|
size="small"
|
||||||
:plain="true"
|
:plain="true"
|
||||||
|
v-hasPermi="['base:group-scheduling-plan:create']"
|
||||||
@click="buttonClick({ btnName: 'add' })">
|
@click="buttonClick({ btnName: 'add' })">
|
||||||
新增
|
新增
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -95,7 +99,7 @@
|
|||||||
<method-btn
|
<method-btn
|
||||||
v-if="tableBtn.length"
|
v-if="tableBtn.length"
|
||||||
slot="handleBtn"
|
slot="handleBtn"
|
||||||
:width="80"
|
:width="270"
|
||||||
label="操作"
|
label="操作"
|
||||||
:method-list="tableBtn"
|
:method-list="tableBtn"
|
||||||
@clickBtn="handleClick" />
|
@clickBtn="handleClick" />
|
||||||
@@ -141,7 +145,7 @@
|
|||||||
class="btnTextStyle"
|
class="btnTextStyle"
|
||||||
size="small"
|
size="small"
|
||||||
plain
|
plain
|
||||||
@click="handleConfirm">
|
@click="successSubmit">
|
||||||
保存草稿
|
保存草稿
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
@@ -156,6 +160,30 @@
|
|||||||
</slot>
|
</slot>
|
||||||
</template>
|
</template>
|
||||||
</base-dialog>
|
</base-dialog>
|
||||||
|
<base-dialog
|
||||||
|
:dialogTitle="'排班计划详情'"
|
||||||
|
:dialogVisible="detailVisible"
|
||||||
|
@cancel="detailCancel"
|
||||||
|
:before-close="detailCancel"
|
||||||
|
:destroy-on-close="true"
|
||||||
|
append-to-body
|
||||||
|
width="50%">
|
||||||
|
<detail ref="detailRef"></detail>
|
||||||
|
<template #footer>
|
||||||
|
<slot name="footer">
|
||||||
|
<el-row slot="footer" type="flex" justify="end">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-button
|
||||||
|
size="small"
|
||||||
|
class="btnTextStyle"
|
||||||
|
@click="detailCancel">
|
||||||
|
取消
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</slot>
|
||||||
|
</template>
|
||||||
|
</base-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -165,8 +193,15 @@ import deptSelect from './../deptSelect.vue';
|
|||||||
import basicPage from '@/mixins/basic-page';
|
import basicPage from '@/mixins/basic-page';
|
||||||
import subSpan from './subSpan.vue';
|
import subSpan from './subSpan.vue';
|
||||||
import subStatus from './subStatus.vue';
|
import subStatus from './subStatus.vue';
|
||||||
|
import detail from './detail.vue';
|
||||||
import { parseTime } from '@/filter/code-filter';
|
import { parseTime } from '@/filter/code-filter';
|
||||||
import { getGroupPlanPage, deleteGroupPlan } from '@/api/group/Schedule';
|
import {
|
||||||
|
getGroupPlanPage,
|
||||||
|
deleteGroupPlan,
|
||||||
|
copyPlan,
|
||||||
|
disablePlan,
|
||||||
|
updateScheduleLater,
|
||||||
|
} from '@/api/group/Schedule';
|
||||||
|
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
{
|
{
|
||||||
@@ -206,7 +241,7 @@ const tableProps = [
|
|||||||
subcomponent: subSpan,
|
subcomponent: subSpan,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'deptId',
|
prop: 'deptName',
|
||||||
label: '部门',
|
label: '部门',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -233,6 +268,7 @@ export default {
|
|||||||
},
|
},
|
||||||
tableProps,
|
tableProps,
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
|
this.$auth.hasPermi('base:group-scheduling-plan:update')?
|
||||||
{
|
{
|
||||||
type: 'edit',
|
type: 'edit',
|
||||||
btnName: '编辑',
|
btnName: '编辑',
|
||||||
@@ -246,7 +282,8 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
}:undefined,
|
||||||
|
this.$auth.hasPermi('base:group-scheduling-plan:delete')?
|
||||||
{
|
{
|
||||||
type: 'delete',
|
type: 'delete',
|
||||||
btnName: '删除',
|
btnName: '删除',
|
||||||
@@ -260,7 +297,8 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
}:undefined,
|
||||||
|
this.$auth.hasPermi('base:group-scheduling-plan:query')?
|
||||||
{
|
{
|
||||||
type: 'detail',
|
type: 'detail',
|
||||||
btnName: '查看',
|
btnName: '查看',
|
||||||
@@ -274,7 +312,8 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
}:undefined,
|
||||||
|
this.$auth.hasPermi('base:group-scheduling-plan:delete')?
|
||||||
{
|
{
|
||||||
type: 'cancel',
|
type: 'cancel',
|
||||||
btnName: '作废',
|
btnName: '作废',
|
||||||
@@ -288,7 +327,8 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
}:undefined,
|
||||||
|
this.$auth.hasPermi('base:group-holiday:update')?
|
||||||
{
|
{
|
||||||
type: 'sync',
|
type: 'sync',
|
||||||
btnName: '同步节假日',
|
btnName: '同步节假日',
|
||||||
@@ -301,17 +341,18 @@ export default {
|
|||||||
value: 2,
|
value: 2,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'updateFlag',
|
type: 'equal',
|
||||||
name: 'status',
|
name: 'updateFlag',
|
||||||
value: true,
|
value: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
}:undefined,
|
||||||
|
this.$auth.hasPermi('base:group-scheduling-plan:create')?
|
||||||
{
|
{
|
||||||
type: 'copy',
|
type: 'copy',
|
||||||
btnName: '复制',
|
btnName: '复制',
|
||||||
},
|
}:undefined,
|
||||||
].filter((v) => v),
|
].filter((v) => v),
|
||||||
tableData: [],
|
tableData: [],
|
||||||
options: [
|
options: [
|
||||||
@@ -337,11 +378,13 @@ export default {
|
|||||||
status: '',
|
status: '',
|
||||||
},
|
},
|
||||||
stepNum: 1, // 新增编辑时当前第几步
|
stepNum: 1, // 新增编辑时当前第几步
|
||||||
|
detailVisible: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
AddOrUpdate,
|
AddOrUpdate,
|
||||||
deptSelect,
|
deptSelect,
|
||||||
|
detail
|
||||||
},
|
},
|
||||||
created() {},
|
created() {},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -396,10 +439,15 @@ export default {
|
|||||||
setStepNum(val) {
|
setStepNum(val) {
|
||||||
this.stepNum = val;
|
this.stepNum = val;
|
||||||
},
|
},
|
||||||
// dialog取消
|
successSubmit() {
|
||||||
handleCancel() {
|
|
||||||
this.addOrUpdateVisible = false;
|
this.addOrUpdateVisible = false;
|
||||||
this.addOrEditTitle = '';
|
this.addOrEditTitle = '';
|
||||||
|
this.stepNum = 1;
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
// dialog取消
|
||||||
|
handleCancel() {
|
||||||
|
this.$refs.addOrUpdate.cancelStep();
|
||||||
},
|
},
|
||||||
handleConfirm(val) {
|
handleConfirm(val) {
|
||||||
if (val == 'up') {
|
if (val == 'up') {
|
||||||
@@ -408,6 +456,41 @@ export default {
|
|||||||
this.$refs.addOrUpdate.nextSubmit();
|
this.$refs.addOrUpdate.nextSubmit();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
//tableBtn点击
|
||||||
|
handleClick(val) {
|
||||||
|
if (val.type === 'edit') {
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.addOrEditTitle = '编辑';
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init(val.data.id);
|
||||||
|
});
|
||||||
|
} else if (val.type === 'delete') {
|
||||||
|
this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex);
|
||||||
|
} else if (val.type === 'detail') {
|
||||||
|
this.detailVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.detailRef.init(val.data.id);
|
||||||
|
});
|
||||||
|
} else if (val.type === 'cancel') {
|
||||||
|
disablePlan(val.data.id).then((res) => {
|
||||||
|
this.$modal.msgSuccess('作废成功');
|
||||||
|
this.getDataList()
|
||||||
|
});
|
||||||
|
} else if (val.type === 'sync') {
|
||||||
|
updateScheduleLater({ planId: val.data.id }).then((res) => {
|
||||||
|
this.$modal.msgSuccess('同步节假日成功');
|
||||||
|
this.getDataList()
|
||||||
|
});
|
||||||
|
} else if (val.type === 'copy') {
|
||||||
|
copyPlan(val.data.id).then((res) => {
|
||||||
|
this.$modal.msgSuccess('复制成功');
|
||||||
|
this.getDataList()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
detailCancel() {
|
||||||
|
this.detailVisible = false;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -455,12 +538,12 @@ body .el-dialog__header {
|
|||||||
padding: 13px 24px;
|
padding: 13px 24px;
|
||||||
border-bottom: 1px solid #e9e9e9;
|
border-bottom: 1px solid #e9e9e9;
|
||||||
}
|
}
|
||||||
body .el-dialog__header .titleStyle::before{
|
body .el-dialog__header .titleStyle::before {
|
||||||
content: '';
|
content: '';
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 4px;
|
width: 4px;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
background-color: #0B58FF;
|
background-color: #0b58ff;
|
||||||
border-radius: 1px;
|
border-radius: 1px;
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
36
src/views/group/Schedule/propSpan.vue
Normal file
36
src/views/group/Schedule/propSpan.vue
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2025-10-13 16:18:41
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2025-10-21 13:54:52
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<span>
|
||||||
|
<el-tag
|
||||||
|
v-if="injectData.work"
|
||||||
|
size="small"
|
||||||
|
:type="['', 'success', 'warning'][injectData.sort]">
|
||||||
|
{{ injectData[injectData.prop] }}
|
||||||
|
</el-tag>
|
||||||
|
<el-tag v-else effect="dark" size="small" type="info">
|
||||||
|
{{ injectData[injectData.prop] }}
|
||||||
|
</el-tag>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
injectData: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({}),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
methods: {},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
33
src/views/group/Schedule/propfirstSpan.vue
Normal file
33
src/views/group/Schedule/propfirstSpan.vue
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2025-10-13 16:18:41
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2025-10-20 10:13:26
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
{{ injectData.name.split('/')[0] }}
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
{{ injectData.name.split('/')[1] }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
injectData: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({}),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
methods: {},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -1,9 +1,16 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2025-10-13 16:18:41
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2025-10-20 10:13:26
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
<template>
|
<template>
|
||||||
<span>
|
<span>
|
||||||
{{
|
{{
|
||||||
injectData.shiftSustainedNum +
|
injectData.shiftSustainedNum +
|
||||||
(injectDatashiftSustainedType
|
(injectData.shiftSustainedType
|
||||||
? ['', '日', '周', '月', '季'][injectDatashiftSustainedType]
|
? ['', '日', '周', '月', '季'][injectData.shiftSustainedType]
|
||||||
: '')
|
: '')
|
||||||
}}
|
}}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2021-11-18 14:16:25
|
* @Date: 2021-11-18 14:16:25
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2025-10-13 15:44:18
|
* @LastEditTime: 2025-10-29 14:47:33
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="部门">
|
<el-form-item label="部门">
|
||||||
<dept-select
|
<dept-select
|
||||||
style="width: 200px"
|
style="width: 100%"
|
||||||
ref="deptSelect"
|
ref="deptSelect"
|
||||||
@DeptId="setDeptId"></dept-select>
|
@DeptId="setDeptId"></dept-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -41,8 +41,10 @@
|
|||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="组长" prop="leaderId">
|
<el-form-item label="组长" prop="leaderId">
|
||||||
<el-select
|
<el-select
|
||||||
|
style="width: 100%"
|
||||||
v-model="dataForm.leaderId"
|
v-model="dataForm.leaderId"
|
||||||
@change="setLeaderName"
|
@change="setLeaderName"
|
||||||
|
filterable
|
||||||
placeholder="请选择组长">
|
placeholder="请选择组长">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in leaderArr"
|
v-for="item in leaderArr"
|
||||||
@@ -57,12 +59,14 @@
|
|||||||
<el-input
|
<el-input
|
||||||
v-model="dataForm.leaderPhone"
|
v-model="dataForm.leaderPhone"
|
||||||
clearable
|
clearable
|
||||||
|
maxlength="11"
|
||||||
placeholder="请输入组长电话" />
|
placeholder="请输入组长电话" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="班组人数" prop="num">
|
<el-form-item label="班组人数" prop="num">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
|
style="width: 100%"
|
||||||
v-model="dataForm.num"
|
v-model="dataForm.num"
|
||||||
:step="1"
|
:step="1"
|
||||||
:min="0"
|
:min="0"
|
||||||
@@ -72,6 +76,7 @@
|
|||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="生产班组" prop="isProduction">
|
<el-form-item label="生产班组" prop="isProduction">
|
||||||
<el-select
|
<el-select
|
||||||
|
style="width: 100%"
|
||||||
v-model="dataForm.isProduction"
|
v-model="dataForm.isProduction"
|
||||||
placeholder="请选择是否为生产班组">
|
placeholder="请选择是否为生产班组">
|
||||||
<el-option
|
<el-option
|
||||||
@@ -157,6 +162,13 @@ export default {
|
|||||||
isProduction: [
|
isProduction: [
|
||||||
{ required: true, message: '生产班组不能为空', trigger: 'change' },
|
{ required: true, message: '生产班组不能为空', trigger: 'change' },
|
||||||
],
|
],
|
||||||
|
leaderPhone: [
|
||||||
|
{
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2025-10-11 14:27:37
|
* @Date: 2025-10-11 14:27:37
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2025-10-13 14:44:29
|
* @LastEditTime: 2025-10-29 14:44:41
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@@ -45,12 +45,15 @@
|
|||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
size="small"
|
size="small"
|
||||||
|
v-hasPermi="['base:group-team:query']"
|
||||||
@click="buttonClick({ btnName: 'search' })">
|
@click="buttonClick({ btnName: 'search' })">
|
||||||
查询
|
查询
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<span class="separateStyle"></span>
|
<span
|
||||||
|
class="separateStyle"
|
||||||
|
v-hasPermi="['base:group-team:query']"></span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button size="small" @click="buttonClick({ btnName: 'reset' })">
|
<el-button size="small" @click="buttonClick({ btnName: 'reset' })">
|
||||||
@@ -58,13 +61,16 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<span class="separateStyle"></span>
|
<span
|
||||||
|
class="separateStyle"
|
||||||
|
v-hasPermi="['base:group-team:create']"></span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
type="success"
|
||||||
size="small"
|
size="small"
|
||||||
:plain="true"
|
:plain="true"
|
||||||
|
v-hasPermi="['base:group-team:create']"
|
||||||
@click="buttonClick({ btnName: 'add' })">
|
@click="buttonClick({ btnName: 'add' })">
|
||||||
新增
|
新增
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -118,16 +124,16 @@ const tableProps = [
|
|||||||
{
|
{
|
||||||
prop: 'code',
|
prop: 'code',
|
||||||
label: '班组编号',
|
label: '班组编号',
|
||||||
width: 140,
|
width: 210,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'name',
|
prop: 'name',
|
||||||
label: '班组名称',
|
label: '班组名称',
|
||||||
width: 100,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'deptId',
|
prop: 'deptName',
|
||||||
label: '所属部门',
|
label: '所属部门',
|
||||||
|
width: 110,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'leaderName',
|
prop: 'leaderName',
|
||||||
@@ -136,6 +142,7 @@ const tableProps = [
|
|||||||
{
|
{
|
||||||
prop: 'leaderPhone',
|
prop: 'leaderPhone',
|
||||||
label: '组长电话',
|
label: '组长电话',
|
||||||
|
width: 110,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'num',
|
prop: 'num',
|
||||||
@@ -145,12 +152,15 @@ const tableProps = [
|
|||||||
{
|
{
|
||||||
prop: 'isProduction',
|
prop: 'isProduction',
|
||||||
label: '是否生产班组',
|
label: '是否生产班组',
|
||||||
filter: val=>{return val?'是':'否'},
|
filter: (val) => {
|
||||||
|
return val ? '是' : '否';
|
||||||
|
},
|
||||||
width: 110,
|
width: 110,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'remark',
|
prop: 'remark',
|
||||||
label: '备注',
|
label: '备注',
|
||||||
|
showOverflowtooltip: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'createTime',
|
prop: 'createTime',
|
||||||
@@ -175,10 +185,12 @@ export default {
|
|||||||
},
|
},
|
||||||
tableProps,
|
tableProps,
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
{
|
this.$auth.hasPermi('base:group-team:update')
|
||||||
|
? {
|
||||||
type: 'edit',
|
type: 'edit',
|
||||||
btnName: '编辑',
|
btnName: '编辑',
|
||||||
},
|
}
|
||||||
|
: undefined,
|
||||||
].filter((v) => v),
|
].filter((v) => v),
|
||||||
tableData: [],
|
tableData: [],
|
||||||
formInline: {
|
formInline: {
|
||||||
@@ -231,9 +243,9 @@ export default {
|
|||||||
console.log(val);
|
console.log(val);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setDeptId(val){
|
setDeptId(val) {
|
||||||
this.formInline.deptId = val
|
this.formInline.deptId = val;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -2,10 +2,11 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2021-11-18 14:16:25
|
* @Date: 2021-11-18 14:16:25
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2025-10-19 00:09:11
|
* @LastEditTime: 2025-10-23 13:29:58
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
|
<div>
|
||||||
<el-form
|
<el-form
|
||||||
:model="dataForm"
|
:model="dataForm"
|
||||||
:rules="dataRule"
|
:rules="dataRule"
|
||||||
@@ -52,29 +53,34 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="日期" prop="dateTime">
|
<el-form-item
|
||||||
|
v-if="dataForm.dateType == 1"
|
||||||
|
label="日期"
|
||||||
|
prop="dateDay">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
:disabled="detail"
|
:disabled="detail"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
v-if="dataForm.dateType == 1"
|
|
||||||
key="date"
|
key="date"
|
||||||
v-model="dataForm.dateDay"
|
v-model="dataForm.dateDay"
|
||||||
type="date"
|
type="date"
|
||||||
placeholder="选择日期"
|
placeholder="选择日期"
|
||||||
format="yyyy-MM-dd"
|
format="yyyy-MM-dd"
|
||||||
value-format="yyyy-MM-dd"></el-date-picker>
|
value-format="--MM-dd"
|
||||||
|
:picker-options="pickerOptions"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-else label="日期" prop="dateDayArr">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
:disabled="detail"
|
:disabled="detail"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
v-else
|
|
||||||
key="daterange"
|
key="daterange"
|
||||||
v-model="dataForm.dateDayArr"
|
v-model="dataForm.dateDayArr"
|
||||||
type="daterange"
|
type="daterange"
|
||||||
format="yyyy-MM-dd"
|
format="yyyy-MM-dd"
|
||||||
value-format="yyyy-MM-dd"
|
value-format="--MM-dd"
|
||||||
range-separator="至"
|
range-separator="至"
|
||||||
start-placeholder="开始日期"
|
start-placeholder="开始日期"
|
||||||
end-placeholder="结束日期"></el-date-picker>
|
end-placeholder="结束日期"
|
||||||
|
:picker-options="pickerOptions"></el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@@ -91,12 +97,48 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="12" v-if="detail">
|
||||||
|
<el-form-item label="来源" prop="inherited">
|
||||||
|
<el-radio-group disabled v-model="dataForm.inherited">
|
||||||
|
<el-radio :label="true">继承</el-radio>
|
||||||
|
<el-radio :label="false">自定义</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
<el-dialog
|
||||||
|
title="删除确认"
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
width="30%"
|
||||||
|
append-to-body>
|
||||||
|
<span>
|
||||||
|
确认删除该节假日吗?
|
||||||
|
<br />
|
||||||
|
该节假日已被排班计划使用,建议确认是否同步更新排班计划。
|
||||||
|
<br />
|
||||||
|
此操作不可恢复,请确认是否继续
|
||||||
|
</span>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
<el-button @click="onlyDelete">仅删除</el-button>
|
||||||
|
<el-button type="primary" @click="deleteAndUpdate">
|
||||||
|
删除并更新
|
||||||
|
</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { createHoliday, updateHoliday,deleteHolidayn } from '@/api/group/holidaySetting';
|
import {
|
||||||
|
createHoliday,
|
||||||
|
updateHoliday,
|
||||||
|
checkDeleteHoliday,
|
||||||
|
deleteHoliday,
|
||||||
|
updateSchedule,
|
||||||
|
getHoliday,
|
||||||
|
} from '@/api/group/holidaySetting';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {},
|
components: {},
|
||||||
@@ -110,6 +152,8 @@ export default {
|
|||||||
dateDay: undefined,
|
dateDay: undefined,
|
||||||
dateDayArr: [],
|
dateDayArr: [],
|
||||||
repeat: true,
|
repeat: true,
|
||||||
|
inherited: true, // 是否为继承
|
||||||
|
deptId: undefined,
|
||||||
},
|
},
|
||||||
detail: false,
|
detail: false,
|
||||||
options1: [
|
options1: [
|
||||||
@@ -166,20 +210,106 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
pickerOptions: {
|
||||||
|
disabledDate(time) {
|
||||||
|
return time.getTime() < Date.now();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
dialogVisible: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init(id, detail) {
|
init(deptId, id, detail) {
|
||||||
|
this.dataForm.deptId = deptId || undefined;
|
||||||
this.dataForm.id = id || undefined;
|
this.dataForm.id = id || undefined;
|
||||||
this.detail = detail || false;
|
this.detail = detail || false;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['dataForm'].resetFields();
|
||||||
|
if (this.dataForm.id) {
|
||||||
|
getHoliday(this.dataForm.id).then((res) => {
|
||||||
|
this.dataForm = res.data;
|
||||||
|
if (
|
||||||
|
this.dataForm.dateType == 1 &&
|
||||||
|
this.dataForm.calendarType == 1
|
||||||
|
) {
|
||||||
|
this.dataForm.dateDay = this.dataForm.oneDay;
|
||||||
|
} else if (
|
||||||
|
this.dataForm.dateType == 2 &&
|
||||||
|
this.dataForm.calendarType == 1
|
||||||
|
) {
|
||||||
|
this.dataForm.dateDayArr = [
|
||||||
|
this.dataForm.startDay,
|
||||||
|
this.dataForm.endDay,
|
||||||
|
];
|
||||||
|
} else if (
|
||||||
|
this.dataForm.dateType == 1 &&
|
||||||
|
this.dataForm.calendarType == 2
|
||||||
|
) {
|
||||||
|
this.dataForm.dateDay = this.dataForm.oneDayChinese;
|
||||||
|
} else if (
|
||||||
|
this.dataForm.dateType == 2 &&
|
||||||
|
this.dataForm.calendarType == 2
|
||||||
|
) {
|
||||||
|
this.dataForm.dateDayArr = [
|
||||||
|
this.dataForm.startDayChinese,
|
||||||
|
this.dataForm.endDayChinese,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
editHoliday(){
|
editHoliday() {
|
||||||
this.detail = false
|
this.detail = false;
|
||||||
},
|
},
|
||||||
deleteHoliday(){
|
deleteHoliday() {
|
||||||
deleteHolidayn(this.dataForm.id).then(res=>{
|
//删除节假日基础信息前校验是否影响排班
|
||||||
console.log(res)
|
checkDeleteHoliday(this.dataForm.id).then((res) => {
|
||||||
|
if (res.data) {
|
||||||
|
this.dialogVisible = true;
|
||||||
|
} else {
|
||||||
|
this.$confirm(
|
||||||
|
'确认删除该节假日吗?<br/>此操作不可恢复,请确认是否继续',
|
||||||
|
'删除确认',
|
||||||
|
{
|
||||||
|
dangerouslyUseHTMLString: true,
|
||||||
|
confirmButtonText: '确认删除',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
deleteHoliday(this.dataForm.id).then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
this.$modal.msgSuccess('删除成功');
|
||||||
|
this.$emit('refreshPage');
|
||||||
|
});
|
||||||
})
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.$message({
|
||||||
|
type: 'info',
|
||||||
|
message: '已取消',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onlyDelete() {
|
||||||
|
deleteHoliday(this.dataForm.id).then((res) => {
|
||||||
|
this.dialogVisible = false;
|
||||||
|
this.$modal.msgSuccess('删除成功');
|
||||||
|
this.$emit('refreshPage');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
deleteAndUpdate() {
|
||||||
|
deleteHoliday(this.dataForm.id).then((res) => {
|
||||||
|
this.dialogVisible = false;
|
||||||
|
this.$modal.msgSuccess('删除成功');
|
||||||
|
updateSchedule({ logId: res.data.logId }).then((res1) => {
|
||||||
|
this.$modal.msgSuccess('更新成功');
|
||||||
|
this.$emit('refreshPage');
|
||||||
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
// 表单提交
|
// 表单提交
|
||||||
dataFormSubmit() {
|
dataFormSubmit() {
|
||||||
@@ -187,20 +317,63 @@ export default {
|
|||||||
if (!valid) {
|
if (!valid) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (this.dataForm.dateType == 1 && this.dataForm.calendarType == 1) {
|
||||||
|
this.dataForm.oneDay = this.dataForm.dateDay;
|
||||||
|
} else if (
|
||||||
|
this.dataForm.dateType == 2 &&
|
||||||
|
this.dataForm.calendarType == 1
|
||||||
|
) {
|
||||||
|
this.dataForm.startDay = this.dataForm.dateDayArr[0];
|
||||||
|
this.dataForm.endDay = this.dataForm.dateDayArr[1];
|
||||||
|
} else if (
|
||||||
|
this.dataForm.dateType == 1 &&
|
||||||
|
this.dataForm.calendarType == 2
|
||||||
|
) {
|
||||||
|
this.dataForm.oneDayChinese = this.dataForm.dateDay;
|
||||||
|
} else if (
|
||||||
|
this.dataForm.dateType == 2 &&
|
||||||
|
this.dataForm.calendarType == 2
|
||||||
|
) {
|
||||||
|
this.dataForm.startDayChinese = this.dataForm.dateDayArr[0];
|
||||||
|
this.dataForm.endDayChinese = this.dataForm.dateDayArr[1];
|
||||||
|
}
|
||||||
// 修改的提交
|
// 修改的提交
|
||||||
if (this.dataForm.id) {
|
if (this.dataForm.id) {
|
||||||
updateHoliday(this.dataForm).then((response) => {
|
updateHoliday(this.dataForm).then((response) => {
|
||||||
this.$modal.msgSuccess('修改成功');
|
this.$modal.msgSuccess('修改成功');
|
||||||
this.visible = false;
|
|
||||||
this.$emit('refreshPage');
|
this.$emit('refreshPage');
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 添加的提交
|
// 添加的提交
|
||||||
createHoliday(this.dataForm).then((response) => {
|
createHoliday(this.dataForm).then((res) => {
|
||||||
|
updateSchedule;
|
||||||
|
if (!res.data.updateFlag) {
|
||||||
this.$modal.msgSuccess('新增成功');
|
this.$modal.msgSuccess('新增成功');
|
||||||
this.visible = false;
|
|
||||||
this.$emit('refreshPage');
|
this.$emit('refreshPage');
|
||||||
|
} else {
|
||||||
|
this.$confirm(
|
||||||
|
'新增节假日影响已有排班计划,是否立即更新?',
|
||||||
|
'更新排班',
|
||||||
|
{
|
||||||
|
confirmButtonText: '立即更新',
|
||||||
|
cancelButtonText: '暂不更新',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
updateSchedule({ logId: res.data.logId }).then((res1) => {
|
||||||
|
this.$modal.msgSuccess('新增成功');
|
||||||
|
this.$emit('refreshPage');
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.$message({
|
||||||
|
type: 'info',
|
||||||
|
message: '已取消',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
<search-bar
|
<search-bar
|
||||||
:formConfigs="formConfig"
|
:formConfigs="formConfig"
|
||||||
ref="searchBarForm"
|
ref="searchBarForm"
|
||||||
|
:isFold="true"
|
||||||
@headBtnClick="buttonClick" />
|
@headBtnClick="buttonClick" />
|
||||||
<base-table
|
<base-table
|
||||||
:table-props="tableProps"
|
:table-props="tableProps"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2024-07-01 14:54:06
|
* @Date: 2024-07-01 14:54:06
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2025-10-19 00:35:24
|
* @LastEditTime: 2025-10-27 10:18:54
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@@ -46,10 +46,14 @@
|
|||||||
size="small"
|
size="small"
|
||||||
type="primary"
|
type="primary"
|
||||||
style="margin-right: 10px"
|
style="margin-right: 10px"
|
||||||
|
v-hasPermi="['base:group-holiday:create']"
|
||||||
@click="addHoliday">
|
@click="addHoliday">
|
||||||
新增节假日
|
新增节假日
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button size="small" @click="holidayLog">
|
<el-button
|
||||||
|
size="small"
|
||||||
|
v-hasPermi="['base:group-holiday-log:query']"
|
||||||
|
@click="holidayLog">
|
||||||
节假日变更记录
|
节假日变更记录
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -73,12 +77,13 @@
|
|||||||
<el-button
|
<el-button
|
||||||
size="small"
|
size="small"
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="startDay = new Date()">
|
@click="(startDay = new Date()), getHolidayPage()">
|
||||||
跳转到今天
|
跳转到今天
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-tag
|
<el-tag
|
||||||
|
v-if="topDeptId == deptId"
|
||||||
type="warning"
|
type="warning"
|
||||||
closable
|
closable
|
||||||
style="margin-bottom: 10px; color: black">
|
style="margin-bottom: 10px; color: black">
|
||||||
@@ -92,15 +97,61 @@
|
|||||||
<div class="calenderArea">
|
<div class="calenderArea">
|
||||||
<el-calendar v-model="startDay">
|
<el-calendar v-model="startDay">
|
||||||
<template slot="dateCell" slot-scope="{ data }">
|
<template slot="dateCell" slot-scope="{ data }">
|
||||||
<div v-if="data.type === 'current-month'" @click="showDetail">
|
<div v-if="data.type === 'current-month'">
|
||||||
<!-- 日期 -->
|
<!-- 日期 -->
|
||||||
<div class="dateStyle">
|
<div class="dateStyle">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
|
<!-- 公历和农历 -->
|
||||||
<el-col :span="18">
|
<el-col :span="18">
|
||||||
{{ Number(data.day.split('-')[2]) }}
|
{{ Number(data.day.split('-')[2]) }}
|
||||||
<div class="lunar-date">{{ getLunarDate(data.day) }}</div>
|
<div class="lunar-date">{{ getLunarDate(data.day) }}</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6"><div class="work-tip">班</div></el-col>
|
<!-- 显示假或班 -->
|
||||||
|
<el-col :span="6">
|
||||||
|
<div
|
||||||
|
class="work-tip"
|
||||||
|
:style="{
|
||||||
|
backgroundColor: HolidayList[
|
||||||
|
Number(data.day.split('-')[2]) - 1
|
||||||
|
]?.isHoliday
|
||||||
|
? '#67C23A'
|
||||||
|
: '#409EFF',
|
||||||
|
}">
|
||||||
|
{{
|
||||||
|
HolidayList[Number(data.day.split('-')[2]) - 1]
|
||||||
|
?.isHoliday
|
||||||
|
? '假'
|
||||||
|
: '班'
|
||||||
|
}}
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<!-- 显示假期名和操作 -->
|
||||||
|
<el-col
|
||||||
|
:span="24"
|
||||||
|
v-if="
|
||||||
|
HolidayList[Number(data.day.split('-')[2]) - 1]
|
||||||
|
?.isHoliday
|
||||||
|
">
|
||||||
|
<div
|
||||||
|
class="holiday-div"
|
||||||
|
@click="
|
||||||
|
new Date(data.day).getTime() > Date.now() &&
|
||||||
|
showDetail(
|
||||||
|
HolidayList[Number(data.day.split('-')[2]) - 1]
|
||||||
|
.holidayId
|
||||||
|
)
|
||||||
|
">
|
||||||
|
{{
|
||||||
|
HolidayList[Number(data.day.split('-')[2]) - 1]
|
||||||
|
?.holidayName
|
||||||
|
}}
|
||||||
|
<span
|
||||||
|
class="holiday-div-btn"
|
||||||
|
v-if="new Date(data.day).getTime() > Date.now()">
|
||||||
|
<i class="el-icon-more" style="color: #fff"></i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -126,11 +177,12 @@
|
|||||||
:dialogVisible="addOrUpdateVisible"
|
:dialogVisible="addOrUpdateVisible"
|
||||||
@cancel="cancel"
|
@cancel="cancel"
|
||||||
@confirm="handleConfirm"
|
@confirm="handleConfirm"
|
||||||
|
:before-close="cancel"
|
||||||
:destroy-on-close="true"
|
:destroy-on-close="true"
|
||||||
width="40%">
|
width="40%">
|
||||||
<add-or-updata
|
<add-or-updata
|
||||||
ref="addOrUpdataRef"
|
ref="addOrUpdataRef"
|
||||||
@refreshPage="getHolidayPage"></add-or-updata>
|
@refreshPage="successSubmit"></add-or-updata>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<slot name="footer">
|
<slot name="footer">
|
||||||
<el-row slot="footer" type="flex" justify="end">
|
<el-row slot="footer" type="flex" justify="end">
|
||||||
@@ -155,6 +207,7 @@
|
|||||||
size="small"
|
size="small"
|
||||||
type="primary"
|
type="primary"
|
||||||
class="btnTextStyle"
|
class="btnTextStyle"
|
||||||
|
v-hasPermi="['base:group-holiday:update']"
|
||||||
@click="editHoliday">
|
@click="editHoliday">
|
||||||
修改
|
修改
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -162,6 +215,7 @@
|
|||||||
v-if="detail"
|
v-if="detail"
|
||||||
class="btnTextStyle"
|
class="btnTextStyle"
|
||||||
size="small"
|
size="small"
|
||||||
|
v-hasPermi="['base:group-holiday:delete']"
|
||||||
@click="deleteHoliday">
|
@click="deleteHoliday">
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -174,6 +228,7 @@
|
|||||||
dialogTitle="节假日变更记录"
|
dialogTitle="节假日变更记录"
|
||||||
:dialogVisible="logVisible"
|
:dialogVisible="logVisible"
|
||||||
@cancel="cancelLog"
|
@cancel="cancelLog"
|
||||||
|
:before-close="cancelLog"
|
||||||
:destroy-on-close="true"
|
:destroy-on-close="true"
|
||||||
width="70%">
|
width="70%">
|
||||||
<holiday-log ref="holidayLogRef"></holiday-log>
|
<holiday-log ref="holidayLogRef"></holiday-log>
|
||||||
@@ -196,9 +251,8 @@
|
|||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { solarToLunar } from 'chinese-lunar';
|
import { solarToLunar } from 'chinese-lunar';
|
||||||
|
|
||||||
import { listSimpleDepts } from '@/api/system/dept';
|
|
||||||
import { getUserProfile } from '@/api/system/user';
|
import { getUserProfile } from '@/api/system/user';
|
||||||
import { deptHolidayList } from '@/api/group/holidaySetting';
|
import { deptHolidayList, getEnableData } from '@/api/group/holidaySetting';
|
||||||
|
|
||||||
import addOrUpdata from './add-or-updata.vue';
|
import addOrUpdata from './add-or-updata.vue';
|
||||||
import holidayLog from './holidayLog';
|
import holidayLog from './holidayLog';
|
||||||
@@ -212,12 +266,14 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
startDay: '', // 查询参数
|
startDay: '', // 查询参数
|
||||||
|
HolidayList: [],
|
||||||
// 部门树选项
|
// 部门树选项
|
||||||
deptOptions: undefined,
|
deptOptions: undefined,
|
||||||
// 查询的部门名称
|
// 查询的部门名称
|
||||||
deptName: undefined,
|
deptName: undefined,
|
||||||
// 选择的部门名称
|
// 选择的部门名称
|
||||||
showDeptName: undefined,
|
showDeptName: undefined,
|
||||||
|
topDeptId: undefined, // 保存当前用户的部门id为最高级部门id
|
||||||
deptId: undefined,
|
deptId: undefined,
|
||||||
defaultProps: {
|
defaultProps: {
|
||||||
children: 'children',
|
children: 'children',
|
||||||
@@ -240,6 +296,7 @@ export default {
|
|||||||
// 查询用户个人信息
|
// 查询用户个人信息
|
||||||
getUserProfile().then((response) => {
|
getUserProfile().then((response) => {
|
||||||
this.showDeptName = response.data.dept.name || '';
|
this.showDeptName = response.data.dept.name || '';
|
||||||
|
this.topDeptId = response.data.dept.id || ''; // 保存当前用户的部门id为最高级部门id
|
||||||
this.deptId = response.data.dept.id || '';
|
this.deptId = response.data.dept.id || '';
|
||||||
this.getHolidayPage();
|
this.getHolidayPage();
|
||||||
});
|
});
|
||||||
@@ -247,16 +304,31 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getHolidayPage() {
|
getHolidayPage() {
|
||||||
deptHolidayList({ deptId: this.deptId }).then((response) => {});
|
const now = new Date(this.startDay);
|
||||||
|
const year = now.getFullYear();
|
||||||
|
const month = now.getMonth();
|
||||||
|
const startTime = `${year}-${String(month + 1).padStart(2, '0')}-01`;
|
||||||
|
const lastDate = new Date(year, month + 1, 0).getDate();
|
||||||
|
const endTime = `${year}-${String(month + 1).padStart(2, '0')}-${String(
|
||||||
|
lastDate
|
||||||
|
).padStart(2, '0')}`;
|
||||||
|
|
||||||
|
this.HolidayList = [];
|
||||||
|
deptHolidayList({
|
||||||
|
deptId: this.deptId,
|
||||||
|
startTime: Date.parse(startTime),
|
||||||
|
endTime: Date.parse(endTime),
|
||||||
|
}).then((res) => {
|
||||||
|
this.HolidayList = res.data;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
// 切换月份
|
// 切换月份
|
||||||
selectMonth() {
|
selectMonth() {
|
||||||
console.log(this.startDay);
|
|
||||||
this.getHolidayPage();
|
this.getHolidayPage();
|
||||||
},
|
},
|
||||||
/** 查询部门下拉树结构 */
|
/** 查询部门下拉树结构 */
|
||||||
getTreeselect() {
|
getTreeselect() {
|
||||||
listSimpleDepts().then((response) => {
|
getEnableData().then((response) => {
|
||||||
// 处理 deptOptions 参数
|
// 处理 deptOptions 参数
|
||||||
this.deptOptions = [];
|
this.deptOptions = [];
|
||||||
this.deptOptions.push(...this.handleTree(response.data, 'id'));
|
this.deptOptions.push(...this.handleTree(response.data, 'id'));
|
||||||
@@ -342,7 +414,7 @@ export default {
|
|||||||
this.detail = false;
|
this.detail = false;
|
||||||
this.dialogTitle = '新增节假日';
|
this.dialogTitle = '新增节假日';
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.addOrUpdataRef.init();
|
this.$refs.addOrUpdataRef.init(this.deptId);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
holidayLog() {
|
holidayLog() {
|
||||||
@@ -352,8 +424,13 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
cancel() {
|
cancel() {
|
||||||
|
this.getHolidayPage();
|
||||||
this.addOrUpdateVisible = false;
|
this.addOrUpdateVisible = false;
|
||||||
},
|
},
|
||||||
|
successSubmit() {
|
||||||
|
this.cancel();
|
||||||
|
this.getHolidayPage();
|
||||||
|
},
|
||||||
handleConfirm() {
|
handleConfirm() {
|
||||||
this.$refs.addOrUpdataRef.dataFormSubmit();
|
this.$refs.addOrUpdataRef.dataFormSubmit();
|
||||||
},
|
},
|
||||||
@@ -362,7 +439,7 @@ export default {
|
|||||||
this.detail = true;
|
this.detail = true;
|
||||||
this.dialogTitle = '节假日详情';
|
this.dialogTitle = '节假日详情';
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.addOrUpdataRef.init(id, true);
|
this.$refs.addOrUpdataRef.init(this.deptId, id, true);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
editHoliday() {
|
editHoliday() {
|
||||||
@@ -465,6 +542,20 @@ export default {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
.holiday-div {
|
||||||
|
background-color: #67c23a;
|
||||||
|
border-radius: 3px;
|
||||||
|
height: 25px;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 24px;
|
||||||
|
color: #fff;
|
||||||
|
.holiday-div-btn {
|
||||||
|
float: right;
|
||||||
|
transform: rotate(90deg);
|
||||||
|
font-size: 14px;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user