权限
This commit is contained in:
parent
5ccb9297e1
commit
5d3622bf62
@ -1,5 +1,11 @@
|
||||
<template>
|
||||
<el-switch v-model="state" type="text" size="small" :disabled="readonly" @change="changeHandler" />
|
||||
<el-switch
|
||||
v-hasPermi="['base:group-team:edit-worker']"
|
||||
v-model="state"
|
||||
type="text"
|
||||
size="small"
|
||||
:disabled="readonly"
|
||||
@change="changeHandler" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -7,40 +13,40 @@ export default {
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
state: false
|
||||
}
|
||||
state: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
readonly() {
|
||||
return !!this.injectData.readonly
|
||||
}
|
||||
return !!this.injectData.readonly;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.mapToState()
|
||||
this.mapToState();
|
||||
},
|
||||
methods: {
|
||||
mapToState() {
|
||||
if (this.injectData.prop === 'enabled') {
|
||||
this.state = this.injectData.enabled === 1 ? true : false
|
||||
this.state = this.injectData.enabled === 1 ? true : false;
|
||||
}
|
||||
},
|
||||
changeHandler() {
|
||||
let params = {}
|
||||
let payload = {}
|
||||
params.name = 'state'
|
||||
payload.id = this.injectData.id
|
||||
payload.enabled = this.state ? '1' : '0'
|
||||
payload.code = this.injectData.code
|
||||
payload.name = this.injectData.name
|
||||
payload.leaderId = this.injectData.leaderId
|
||||
params.payload = payload
|
||||
this.$emit('emitData', params)
|
||||
}
|
||||
}
|
||||
}
|
||||
let params = {};
|
||||
let payload = {};
|
||||
params.name = 'state';
|
||||
payload.id = this.injectData.id;
|
||||
payload.enabled = this.state ? '1' : '0';
|
||||
payload.code = this.injectData.code;
|
||||
payload.name = this.injectData.name;
|
||||
payload.leaderId = this.injectData.leaderId;
|
||||
params.payload = payload;
|
||||
this.$emit('emitData', params);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -1,8 +1,18 @@
|
||||
<template>
|
||||
<div class="workerOperate">
|
||||
<div class="operateBtn">
|
||||
<span class="view" v-if="this.$auth.hasPermi('base:group-team:view-worker')" @click="emitParams('view')">查看</span>
|
||||
<span class="edit" v-if="this.$auth.hasPermi('base:group-team:edit-worker')" @click="emitParams('edit')">编辑</span>
|
||||
<span
|
||||
class="view"
|
||||
v-hasPermi="['base:group-team:view-worker']"
|
||||
@click="emitParams('view')">
|
||||
查看
|
||||
</span>
|
||||
<span
|
||||
class="edit"
|
||||
v-hasPermi="['base:group-team:edit-worker']"
|
||||
@click="emitParams('edit')">
|
||||
编辑
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -12,23 +22,23 @@ export default {
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
emitParams(data) {
|
||||
let params = {}
|
||||
params.name = data
|
||||
params.payload = this.injectData
|
||||
this.$emit('emitData', params)
|
||||
}
|
||||
}
|
||||
}
|
||||
let params = {};
|
||||
params.name = data;
|
||||
params.payload = this.injectData;
|
||||
this.$emit('emitData', params);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang='scss' scoped>
|
||||
.workerOperate {
|
||||
.operateBtn {
|
||||
color: #0B58FF;
|
||||
color: #0b58ff;
|
||||
.view {
|
||||
margin-right: 10px;
|
||||
cursor: pointer;
|
||||
|
@ -125,7 +125,7 @@ export default {
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
type: this.$auth.hasPermi('base:group-team:create') ? 'separate' : '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:group-team:create') ? 'button' : '',
|
||||
|
@ -1,8 +1,12 @@
|
||||
<template>
|
||||
<div class="groupTeamScheduling">
|
||||
<TopTab :roomNameDict='roomNameDict' @emitFun='toggleName'/>
|
||||
<TopTab
|
||||
:roomNameDict="roomNameDict"
|
||||
@emitFun="toggleName" />
|
||||
<div class="operationArea">
|
||||
<el-form :inline="true" class="demo-form-inline">
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline">
|
||||
<span class="blue-block"></span>
|
||||
<el-form-item label="月份选择">
|
||||
<el-date-picker
|
||||
@ -13,37 +17,81 @@
|
||||
:disabled="showSetting"
|
||||
@change="selectMonth"
|
||||
:clearable="false"
|
||||
style="width: 120px">
|
||||
</el-date-picker>
|
||||
style="width: 120px"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<span class="separateStyle" v-if="this.$auth.hasPermi('base:group-team-scheduling:set')"></span>
|
||||
<span
|
||||
class="separateStyle"
|
||||
v-if="this.$auth.hasPermi('base:group-team-scheduling:set')"></span>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" size="small" v-if="this.$auth.hasPermi('base:group-team-scheduling:set')" :disabled="showSetting || settingBtnDis" @click="settingMsg">设置</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
v-if="this.$auth.hasPermi('base:group-team-scheduling:set')"
|
||||
:disabled="showSetting || settingBtnDis"
|
||||
@click="settingMsg">
|
||||
设置
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" size="small" v-show="showSetting && autoScheduling" @click="schedulingBtn">自动排班</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
v-show="showSetting && autoScheduling"
|
||||
@click="schedulingBtn">
|
||||
自动排班
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<span class="separateStyle" v-show="showSetting"></span>
|
||||
<span
|
||||
class="separateStyle"
|
||||
v-show="showSetting"></span>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" size="small" v-show="showSetting" @click="confirmSetting">确认</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
v-show="showSetting"
|
||||
@click="confirmSetting">
|
||||
确认
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" size="small" plain v-show="showSetting" @click="cancelSetting">取消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
plain
|
||||
v-show="showSetting"
|
||||
@click="cancelSetting">
|
||||
取消
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="请先选择查询的班组" class="rightItem">
|
||||
<el-form-item
|
||||
v-hasPermi="[
|
||||
'base:quality-inspection-record:query',
|
||||
'base:core-work-order:query',
|
||||
'base:core-product:query',
|
||||
]"
|
||||
label="请先选择查询的班组"
|
||||
class="rightItem">
|
||||
<!-- <el-button type="primary" size="small" :disabled="jumpDisabled" @click="toOtherPage('1')">班组上下片查询</el-button> -->
|
||||
<el-button type="primary" size="small" :disabled="jumpDisabled" @click="toOtherPage('2')">班组能源查询</el-button>
|
||||
<el-button type="primary" size="small" :disabled="jumpDisabled" @click="toOtherPage('3')">班组检测查询</el-button>
|
||||
<!-- <el-button type="primary" size="small" :disabled="jumpDisabled" @click="toOtherPage('2')">班组能源查询</el-button> -->
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
:disabled="jumpDisabled"
|
||||
@click="toOtherPage('3')">
|
||||
班组检测查询
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<!-- 日历区域 -->
|
||||
<div class="calenderArea">
|
||||
<div style="font-size: 24px;font-weight: 500">{{ this.month }} {{ this.year }}</div>
|
||||
<div style="font-size: 24px; font-weight: 500">
|
||||
{{ this.month }} {{ this.year }}
|
||||
</div>
|
||||
<el-calendar v-model="startDay">
|
||||
<!-- 这里使用的是 2.5 slot 语法,对于新项目请使用 2.6 slot 语法-->
|
||||
<template
|
||||
@ -56,27 +104,64 @@
|
||||
</div>
|
||||
<!-- 班次班组 -->
|
||||
<!-- class有两个样式,一个是类似class1,还有个是选中红框显示 -->
|
||||
<el-row :gutter="2" :class="'class' + (index+1) + (chooseTip === (item.startDay+item.classesId) ? ' team-active' : '')" v-for="(item, index) in list[Number(data.day.split('-')[2])]" :key='index'>
|
||||
<el-row
|
||||
:gutter="2"
|
||||
:class="
|
||||
'class' +
|
||||
(index + 1) +
|
||||
(chooseTip === item.startDay + item.classesId
|
||||
? ' team-active'
|
||||
: '')
|
||||
"
|
||||
v-for="(item, index) in list[Number(data.day.split('-')[2])]"
|
||||
:key="index">
|
||||
<el-col :span="12">
|
||||
<div class="selectDiv">
|
||||
<!-- 选择班组图标 -->
|
||||
<div class="toggle-icon" v-show="showSetting && (new Date(data.day).valueOf() < new Date().valueOf() ? false: true)">
|
||||
<div
|
||||
class="toggle-icon"
|
||||
v-show="
|
||||
showSetting &&
|
||||
(new Date(data.day).valueOf() < new Date().valueOf()
|
||||
? false
|
||||
: true)
|
||||
">
|
||||
<svg-icon icon-class="toggle" />
|
||||
</div>
|
||||
<!-- 不能选择班组 -->
|
||||
<div class="toggle-icon-hide" v-show="!(showSetting && (new Date(data.day).valueOf() < new Date().valueOf() ? false: true))"></div>
|
||||
<el-select v-model="item.teamId" size='small' :disabled="!showSetting || (new Date(data.day).valueOf() > new Date().valueOf() ? false: true)">
|
||||
<div
|
||||
class="toggle-icon-hide"
|
||||
v-show="
|
||||
!(
|
||||
showSetting &&
|
||||
(new Date(data.day).valueOf() < new Date().valueOf()
|
||||
? false
|
||||
: true)
|
||||
)
|
||||
"></div>
|
||||
<el-select
|
||||
v-model="item.teamId"
|
||||
size="small"
|
||||
:disabled="
|
||||
!showSetting ||
|
||||
(new Date(data.day).valueOf() > new Date().valueOf()
|
||||
? false
|
||||
: true)
|
||||
">
|
||||
<el-option
|
||||
v-for="i in teamList"
|
||||
:key="i.id"
|
||||
:label="i.name"
|
||||
:value="i.id">
|
||||
</el-option>
|
||||
:value="i.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-button class="labelClass" @click="chooseTeam(item)">{{ item.classesName }}</el-button>
|
||||
<el-button
|
||||
class="labelClass"
|
||||
@click="chooseTeam(item)">
|
||||
{{ item.classesName }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
@ -87,20 +172,37 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getPreset, createOrUpdateList, autoSet } from "@/api/base/groupTeamScheduling";
|
||||
import { listEnabledByRoom } from "@/api/base/groupTeam";
|
||||
import {
|
||||
getPreset,
|
||||
createOrUpdateList,
|
||||
autoSet,
|
||||
} from '@/api/base/groupTeamScheduling';
|
||||
import { listEnabledByRoom } from '@/api/base/groupTeam';
|
||||
import moment from 'moment';
|
||||
import TopTab from './components/topTab'
|
||||
import TopTab from './components/topTab';
|
||||
|
||||
export default {
|
||||
name: "GroupTeamScheduling",
|
||||
name: 'GroupTeamScheduling',
|
||||
data() {
|
||||
return {
|
||||
roomNameDict: null,
|
||||
startDay: '', // 查询参数
|
||||
year: '', // 2023
|
||||
month: '', // 九月
|
||||
monthList: ["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],
|
||||
monthList: [
|
||||
'一月',
|
||||
'二月',
|
||||
'三月',
|
||||
'四月',
|
||||
'五月',
|
||||
'六月',
|
||||
'七月',
|
||||
'八月',
|
||||
'九月',
|
||||
'十月',
|
||||
'十一月',
|
||||
'十二月',
|
||||
],
|
||||
list: {},
|
||||
teamList: [], // 班组下拉
|
||||
showSetting: false, // 设置模式。自动排班,确认,取消按钮显示
|
||||
@ -108,242 +210,261 @@ export default {
|
||||
jumpDisabled: true, // 操作按钮控制
|
||||
chooseObj: {}, //当前选中的数据,查询按钮用
|
||||
chooseTip: '', // 当前选中数据的唯一值,显示红框
|
||||
autoScheduling: false // 只有在当前日期后的月份才生效
|
||||
autoScheduling: false, // 只有在当前日期后的月份才生效
|
||||
};
|
||||
},
|
||||
components: { TopTab },
|
||||
created() {
|
||||
this.roomNameDict = this.getDictDatas('workshop')[0].value
|
||||
this.startDay = new Date()
|
||||
this.roomNameDict = this.getDictDatas('workshop')[0].value;
|
||||
this.startDay = new Date();
|
||||
// 设置按钮是否置灰
|
||||
this.settingBtn()
|
||||
this.getTeamList()
|
||||
this.toggleMonth()
|
||||
this.getList()
|
||||
this.settingBtn();
|
||||
this.getTeamList();
|
||||
this.toggleMonth();
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
// 切换车间
|
||||
toggleName(val) {
|
||||
this.roomNameDict = val
|
||||
this.roomNameDict = val;
|
||||
// 如果当前在设置,则取消设置
|
||||
if (this.showSetting) {
|
||||
this.showSetting = !this.showSetting
|
||||
this.showSetting = !this.showSetting;
|
||||
}
|
||||
// 如果红框选中,清除红框选中
|
||||
if (!this.jumpDisabled) {
|
||||
this.clearChoose()
|
||||
this.clearChoose();
|
||||
}
|
||||
// 获取班组列表
|
||||
this.getTeamList()
|
||||
this.getTeamList();
|
||||
// 重新获取日历数据
|
||||
this.getList()
|
||||
this.getList();
|
||||
},
|
||||
// 切换月份
|
||||
selectMonth() {
|
||||
if (this.startDay) {
|
||||
this.settingBtn() // 设置按钮状态,需在getlist前面
|
||||
this.toggleMonth()
|
||||
this.getList()
|
||||
this.clearChoose()
|
||||
if ( moment(this.startDay).valueOf() > moment().endOf('month').valueOf()) {
|
||||
this.autoScheduling = true
|
||||
this.settingBtn(); // 设置按钮状态,需在getlist前面
|
||||
this.toggleMonth();
|
||||
this.getList();
|
||||
this.clearChoose();
|
||||
if (
|
||||
moment(this.startDay).valueOf() > moment().endOf('month').valueOf()
|
||||
) {
|
||||
this.autoScheduling = true;
|
||||
} else {
|
||||
this.autoScheduling = false
|
||||
this.autoScheduling = false;
|
||||
}
|
||||
}
|
||||
},
|
||||
// 获取班组列表
|
||||
getTeamList() {
|
||||
console.log(this.roomNameDict)
|
||||
console.log(this.roomNameDict);
|
||||
listEnabledByRoom({
|
||||
room: this.roomNameDict
|
||||
}).then(res => {
|
||||
this.teamList = res.data || []
|
||||
})
|
||||
room: this.roomNameDict,
|
||||
}).then((res) => {
|
||||
this.teamList = res.data || [];
|
||||
});
|
||||
},
|
||||
// 获取日历数据
|
||||
getList() {
|
||||
let year = moment(this.startDay).format('YYYY')
|
||||
let month = moment(this.startDay).format('M')
|
||||
let year = moment(this.startDay).format('YYYY');
|
||||
let month = moment(this.startDay).format('M');
|
||||
getPreset({
|
||||
year: year,
|
||||
month: month,
|
||||
roomNameDict: this.roomNameDict
|
||||
}).then(res => {
|
||||
let obj = res.data || {}
|
||||
roomNameDict: this.roomNameDict,
|
||||
})
|
||||
.then((res) => {
|
||||
let obj = res.data || {};
|
||||
if (obj) {
|
||||
for (let item in obj) {
|
||||
for (let i = 0; i < obj[item].length; i++) {
|
||||
if (!obj[item][i].teamId) {
|
||||
obj[item][i].teamId = ''
|
||||
obj[item][i].teamId = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.list = obj
|
||||
this.settingBtnDis = false
|
||||
}).catch(() => {
|
||||
this.list = {}
|
||||
this.settingBtnDis = true // 禁用设置按钮
|
||||
this.list = obj;
|
||||
this.settingBtnDis = false;
|
||||
})
|
||||
.catch(() => {
|
||||
this.list = {};
|
||||
this.settingBtnDis = true; // 禁用设置按钮
|
||||
});
|
||||
},
|
||||
// 设置
|
||||
settingMsg() {
|
||||
this.showSetting = !this.showSetting
|
||||
this.clearChoose()
|
||||
this.showSetting = !this.showSetting;
|
||||
this.clearChoose();
|
||||
},
|
||||
// 取消
|
||||
cancelSetting() {
|
||||
this.showSetting = !this.showSetting
|
||||
this.getList() // 数据还原
|
||||
this.showSetting = !this.showSetting;
|
||||
this.getList(); // 数据还原
|
||||
},
|
||||
// 确认
|
||||
confirmSetting() {
|
||||
let num = 0
|
||||
let num = 0;
|
||||
// 当月数据的话,今天及今天之前的不传
|
||||
if (moment(this.startDay).format('YYYY-MM') === moment().format('YYYY-MM')) {
|
||||
num = Number(moment().format('DD'))
|
||||
if (
|
||||
moment(this.startDay).format('YYYY-MM') === moment().format('YYYY-MM')
|
||||
) {
|
||||
num = Number(moment().format('DD'));
|
||||
} else {
|
||||
num = 0
|
||||
num = 0;
|
||||
}
|
||||
// 下月数据全部都传
|
||||
// 打平数据
|
||||
let tempArr = Object.values(this.list)
|
||||
let arr = []
|
||||
let tempArr = Object.values(this.list);
|
||||
let arr = [];
|
||||
for (let i = num; i < tempArr.length; i++) {
|
||||
for (let j = 0; j < tempArr[i].length; j++) {
|
||||
arr.push(tempArr[i][j])
|
||||
arr.push(tempArr[i][j]);
|
||||
}
|
||||
}
|
||||
createOrUpdateList(arr).then(res => {
|
||||
createOrUpdateList(arr).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.showSetting = !this.showSetting
|
||||
this.$modal.msgSuccess("操作成功")
|
||||
this.getList() // 数据更新
|
||||
this.showSetting = !this.showSetting;
|
||||
this.$modal.msgSuccess('操作成功');
|
||||
this.getList(); // 数据更新
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
// 点击班次红框选中当前数据
|
||||
chooseTeam(value) {
|
||||
if (this.showSetting) {
|
||||
this.$modal.msgWarning("当前处于设置模式")
|
||||
return false
|
||||
this.$modal.msgWarning('当前处于设置模式');
|
||||
return false;
|
||||
}
|
||||
this.chooseObj = value
|
||||
this.chooseTip = value.startDay + value.classesId // 匹配当前的样式
|
||||
this.jumpDisabled = false //查询按钮不禁用
|
||||
this.chooseObj = value;
|
||||
this.chooseTip = value.startDay + value.classesId; // 匹配当前的样式
|
||||
this.jumpDisabled = false; //查询按钮不禁用
|
||||
},
|
||||
// 自动排班
|
||||
schedulingBtn() {
|
||||
let tempData = this.list
|
||||
let tempData = this.list;
|
||||
// 次月1号有值前端排班
|
||||
if (this.list[1][0].teamId) {
|
||||
let tempArr = Object.values(this.list)
|
||||
let arr = []
|
||||
let n = 0
|
||||
let tempArr = Object.values(this.list);
|
||||
let arr = [];
|
||||
let n = 0;
|
||||
for (let i = 0; i < tempArr.length; i++) {
|
||||
if (n > 0) {
|
||||
break;
|
||||
}
|
||||
for (let j = 0; j < tempArr[i].length; j++) {
|
||||
if (tempArr[i][j].teamId) {
|
||||
arr.push(tempArr[i][j].teamId)
|
||||
arr.push(tempArr[i][j].teamId);
|
||||
} else {
|
||||
n++
|
||||
n++;
|
||||
}
|
||||
}
|
||||
}
|
||||
let tempNum = 0
|
||||
let tempNum = 0;
|
||||
for (let k = 0; k < tempArr.length; k++) {
|
||||
for (let v = 0; v < tempArr[k].length; v++) {
|
||||
let t = tempNum % arr.length
|
||||
let t = tempNum % arr.length;
|
||||
if (arr.length === 1) {
|
||||
tempData[k+1][v].teamId = arr[0]
|
||||
tempData[k + 1][v].teamId = arr[0];
|
||||
} else {
|
||||
tempData[k+1][v].teamId = arr[t]
|
||||
tempData[k + 1][v].teamId = arr[t];
|
||||
}
|
||||
tempNum++
|
||||
tempNum++;
|
||||
}
|
||||
}
|
||||
this.list = []
|
||||
this.list = tempData
|
||||
this.list = [];
|
||||
this.list = tempData;
|
||||
} else {
|
||||
// 次月1号没有值,接口排班
|
||||
// console.log(moment(this.startDay).format("YYYY-MM-DD"))
|
||||
autoSet({
|
||||
year: this.year,
|
||||
month: moment(this.startDay).month() + 1,
|
||||
roomNameDict: this.roomNameDict
|
||||
}).then(res => {
|
||||
this.list = res.data || {}
|
||||
})
|
||||
roomNameDict: this.roomNameDict,
|
||||
}).then((res) => {
|
||||
this.list = res.data || {};
|
||||
});
|
||||
}
|
||||
},
|
||||
// 设置按钮如果是上个月或者今天是本月最后一天,设置按钮置灰
|
||||
settingBtn() {
|
||||
let nowMonth = moment().startOf('month').valueOf()
|
||||
let startMonth = moment(this.startDay).valueOf()
|
||||
let nowDate = moment(new Date()).date()
|
||||
let sumDate = moment().daysInMonth()
|
||||
if (nowMonth > startMonth) { // 之前月
|
||||
this.settingBtnDis = true
|
||||
let nowMonth = moment().startOf('month').valueOf();
|
||||
let startMonth = moment(this.startDay).valueOf();
|
||||
let nowDate = moment(new Date()).date();
|
||||
let sumDate = moment().daysInMonth();
|
||||
if (nowMonth > startMonth) {
|
||||
// 之前月
|
||||
this.settingBtnDis = true;
|
||||
} else {
|
||||
if (nowDate < sumDate) {
|
||||
this.settingBtnDis = false
|
||||
this.settingBtnDis = false;
|
||||
} else {
|
||||
this.settingBtnDis = true
|
||||
this.settingBtnDis = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
// 清除红框选中数据
|
||||
clearChoose() {
|
||||
this.chooseObj = {}
|
||||
this.chooseTip = ""
|
||||
this.jumpDisabled = true
|
||||
this.chooseObj = {};
|
||||
this.chooseTip = '';
|
||||
this.jumpDisabled = true;
|
||||
},
|
||||
// 切换月份显示
|
||||
toggleMonth() {
|
||||
this.year = moment(this.startDay).format("YYYY")
|
||||
let month = Number(moment(this.startDay).format("MM"))
|
||||
this.month = this.monthList[month - 1]
|
||||
this.year = moment(this.startDay).format('YYYY');
|
||||
let month = Number(moment(this.startDay).format('MM'));
|
||||
this.month = this.monthList[month - 1];
|
||||
},
|
||||
// 3个跳转按钮
|
||||
toOtherPage(val) {
|
||||
switch (val) {
|
||||
case '1':
|
||||
this.$router.push({
|
||||
path: '/core/enhance/product-line-24h?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime,
|
||||
})
|
||||
path:
|
||||
'/core/enhance/product-line-24h?startTime=' +
|
||||
this.chooseObj.startTime +
|
||||
'&endTime=' +
|
||||
this.chooseObj.endTime,
|
||||
});
|
||||
break;
|
||||
case '2': // 能源
|
||||
this.$router.push({
|
||||
path: '/energy/base/energy-quantity-realtime?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime
|
||||
})
|
||||
path:
|
||||
'/energy/base/energy-quantity-realtime?startTime=' +
|
||||
this.chooseObj.startTime +
|
||||
'&endTime=' +
|
||||
this.chooseObj.endTime,
|
||||
});
|
||||
break;
|
||||
default:
|
||||
this.$router.push({
|
||||
path: '/quality/base/quality-inspection-data/detection-information/statistical-data?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime,
|
||||
path:
|
||||
'/quality/base/quality-inspection-data/detection-information/statistical-data?startTime=' +
|
||||
this.chooseObj.startTime +
|
||||
'&endTime=' +
|
||||
this.chooseObj.endTime,
|
||||
// name: 'QualityStatistics',
|
||||
// params: { startTime: this.chooseObj.startTime, endTime: this.chooseObj.endTime }
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang='scss'>
|
||||
.demo-form-inline {
|
||||
.el-date-editor .el-range__icon {
|
||||
font-size: 16px;
|
||||
color: #0B58FF;
|
||||
color: #0b58ff;
|
||||
}
|
||||
.el-input__prefix .el-icon-date {
|
||||
font-size: 16px;
|
||||
color: #0B58FF;
|
||||
color: #0b58ff;
|
||||
}
|
||||
}
|
||||
.groupTeamScheduling {
|
||||
background-color: #F2F4F9;
|
||||
background-color: #f2f4f9;
|
||||
.operationArea {
|
||||
padding: 14px 10px 0 16px;
|
||||
margin-bottom: 8px;
|
||||
@ -353,7 +474,7 @@ export default {
|
||||
display: inline-block;
|
||||
width: 4px;
|
||||
height: 16px;
|
||||
background-color: #0B58FF;
|
||||
background-color: #0b58ff;
|
||||
border-radius: 1px;
|
||||
margin-right: 8px;
|
||||
margin-top: 10px;
|
||||
@ -362,7 +483,7 @@ export default {
|
||||
display: inline-block;
|
||||
width: 1px;
|
||||
height: 24px;
|
||||
background: #E8E8E8;
|
||||
background: #e8e8e8;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.el-form-item {
|
||||
@ -394,7 +515,8 @@ export default {
|
||||
}
|
||||
.el-calendar-table__row {
|
||||
height: 133px;
|
||||
.prev, .next {
|
||||
.prev,
|
||||
.next {
|
||||
pointer-events: none;
|
||||
}
|
||||
.el-calendar-day {
|
||||
@ -411,10 +533,13 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
.team-active {// 选中班组
|
||||
border:2px solid red
|
||||
.team-active {
|
||||
// 选中班组
|
||||
border: 2px solid red;
|
||||
}
|
||||
.class1, .class2, .class3 {
|
||||
.class1,
|
||||
.class2,
|
||||
.class3 {
|
||||
padding: 0;
|
||||
font-weight: 600;
|
||||
margin-bottom: 2px;
|
||||
@ -458,47 +583,50 @@ export default {
|
||||
}
|
||||
.class1 {
|
||||
.selectDiv {
|
||||
.toggle-icon, .toggle-icon-hide {
|
||||
background-color: #FACE00;
|
||||
.toggle-icon,
|
||||
.toggle-icon-hide {
|
||||
background-color: #face00;
|
||||
}
|
||||
.el-input--small .el-input__inner {
|
||||
color: #E7A200;
|
||||
background-color: #FFEFC0;
|
||||
color: #e7a200;
|
||||
background-color: #ffefc0;
|
||||
}
|
||||
}
|
||||
.labelClass {
|
||||
color: #E7A200;
|
||||
background-color: #FFEFC0;
|
||||
color: #e7a200;
|
||||
background-color: #ffefc0;
|
||||
}
|
||||
}
|
||||
.class2 {
|
||||
.selectDiv {
|
||||
.toggle-icon, .toggle-icon-hide {
|
||||
background-color: #3984FF;
|
||||
.toggle-icon,
|
||||
.toggle-icon-hide {
|
||||
background-color: #3984ff;
|
||||
}
|
||||
.el-input--small .el-input__inner {
|
||||
color: #2D7BFF;
|
||||
background-color: #BEEAFF;
|
||||
color: #2d7bff;
|
||||
background-color: #beeaff;
|
||||
}
|
||||
}
|
||||
.labelClass {
|
||||
color: #2D7BFF;
|
||||
background-color: #BEEAFF;
|
||||
color: #2d7bff;
|
||||
background-color: #beeaff;
|
||||
}
|
||||
}
|
||||
.class3 {
|
||||
.selectDiv {
|
||||
.toggle-icon, .toggle-icon-hide {
|
||||
background-color: #37D97F;
|
||||
.toggle-icon,
|
||||
.toggle-icon-hide {
|
||||
background-color: #37d97f;
|
||||
}
|
||||
.el-input--small .el-input__inner {
|
||||
color: #129F51;
|
||||
background-color: #E0FFEE;
|
||||
color: #129f51;
|
||||
background-color: #e0ffee;
|
||||
}
|
||||
}
|
||||
.labelClass {
|
||||
color: #129F51;
|
||||
background-color: #E0FFEE;
|
||||
color: #129f51;
|
||||
background-color: #e0ffee;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ export default {
|
||||
workOrderList: [],
|
||||
workOrderName: '',
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:group-team-view:detail')
|
||||
this.$auth.hasPermi('monitoring:group-team-scheduling:query')
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
|
@ -97,7 +97,7 @@ export default {
|
||||
},
|
||||
tableProps,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:team-production:detail')
|
||||
this.$auth.hasPermi('monitoring:group-team-scheduling:query')
|
||||
? {
|
||||
type: 'productionDetail',
|
||||
btnName: '查看',
|
||||
|
@ -173,12 +173,24 @@ export default {
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:order-group:create')
|
||||
type: this.$auth.hasPermiAnd([
|
||||
'base:order-group:create',
|
||||
'base:core-product:query',
|
||||
'base:core-customer:query',
|
||||
'base:order:query',
|
||||
])
|
||||
? 'separate'
|
||||
: '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:order-group:create') ? 'button' : '',
|
||||
type: this.$auth.hasPermiAnd([
|
||||
'base:order-group:create',
|
||||
'base:core-product:query',
|
||||
'base:core-customer:query',
|
||||
'base:order:query',
|
||||
])
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
@ -197,7 +209,10 @@ export default {
|
||||
tableProps,
|
||||
list: [],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:order-group:bind')
|
||||
this.$auth.hasPermiAnd([
|
||||
'base:order:query',
|
||||
'base:order-con-group-order:create',
|
||||
])
|
||||
? {
|
||||
type: 'bind',
|
||||
btnName: '绑定',
|
||||
@ -214,7 +229,7 @@ export default {
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-group:complete')
|
||||
this.$auth.hasPermi('base:order-group:update')
|
||||
? {
|
||||
type: 'complete',
|
||||
btnName: '完成',
|
||||
@ -231,7 +246,7 @@ export default {
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-group:termination')
|
||||
this.$auth.hasPermi('base:order-group:update')
|
||||
? {
|
||||
type: 'termination',
|
||||
btnName: '终止',
|
||||
@ -248,7 +263,7 @@ export default {
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-group:cancel')
|
||||
this.$auth.hasPermi('base:order-group:update')
|
||||
? {
|
||||
type: 'cancel',
|
||||
btnName: '作废',
|
||||
@ -265,11 +280,17 @@ export default {
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
{
|
||||
this.$auth.hasPermi('base:order-group:update')
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
},
|
||||
this.$auth.hasPermi('base:order-group:edit')
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermiAnd([
|
||||
'base:order-group:update',
|
||||
'base:core-product:query',
|
||||
'base:core-customer:query',
|
||||
])
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
|
@ -15,7 +15,7 @@
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="290"
|
||||
:width="250"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
@ -169,12 +169,22 @@ export default {
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:order-manage:create')
|
||||
type: this.$auth.hasPermiAnd([
|
||||
'base:order:query',
|
||||
'base:core-product:query',
|
||||
'base:order:create',
|
||||
])
|
||||
? 'separate'
|
||||
: '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:order-manage:create') ? 'button' : '',
|
||||
type: this.$auth.hasPermiAnd([
|
||||
'base:order:query',
|
||||
'base:core-product:query',
|
||||
'base:order:create',
|
||||
])
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
@ -210,7 +220,14 @@ export default {
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:bindWorkOrder')
|
||||
this.$auth.hasPermiAnd([
|
||||
'base:order:update',
|
||||
'base:core-product:query',
|
||||
'base:production-line:query',
|
||||
'extend:process-flow:query',
|
||||
'base:core-work-order:query',
|
||||
'base:order:query',
|
||||
])
|
||||
? {
|
||||
type: 'bind',
|
||||
btnName: '绑定',
|
||||
@ -227,7 +244,7 @@ export default {
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:complete')
|
||||
this.$auth.hasPermi('base:order:update')
|
||||
? {
|
||||
type: 'complete',
|
||||
btnName: '完成',
|
||||
@ -244,7 +261,7 @@ export default {
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:termination')
|
||||
this.$auth.hasPermi('base:order:update')
|
||||
? {
|
||||
type: 'termination',
|
||||
btnName: '终止',
|
||||
@ -261,7 +278,7 @@ export default {
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:cancel')
|
||||
this.$auth.hasPermi('base:order:update')
|
||||
? {
|
||||
type: 'cancel',
|
||||
btnName: '作废',
|
||||
@ -278,13 +295,20 @@ export default {
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:detail')
|
||||
this.$auth.hasPermiAnd([
|
||||
'base:order:query',
|
||||
'extend:process-flow:query',
|
||||
])
|
||||
? {
|
||||
type: 'detail',
|
||||
btnName: '详情',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-manage:edit')
|
||||
this.$auth.hasPermiAnd([
|
||||
'base:order:query',
|
||||
'base:core-product:query',
|
||||
'base:order:update',
|
||||
])
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
|
@ -181,7 +181,10 @@ export default {
|
||||
list: [],
|
||||
total: 0,
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:order-completion-monitoring:orderDet')
|
||||
this.$auth.hasPermiAnd([
|
||||
'base:order:query',
|
||||
'extend:process-flow:query',
|
||||
])
|
||||
? {
|
||||
type: 'orderDetail',
|
||||
btnName: '详情',
|
||||
@ -198,7 +201,11 @@ export default {
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:order-completion-monitoring:qualityDet')
|
||||
this.$auth.hasPermiAnd([
|
||||
'base:quality-inspection-record:query',
|
||||
'base:core-product:query',
|
||||
'base:core-work-order:query',
|
||||
])
|
||||
? {
|
||||
type: 'qualityDetail',
|
||||
btnName: '质量',
|
||||
|
@ -99,10 +99,14 @@ export default {
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:voc:export') ? 'separate' : '',
|
||||
type: this.$auth.hasPermi('base:environmental-check-record:export')
|
||||
? 'separate'
|
||||
: '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:voc:export') ? 'button' : '',
|
||||
type: this.$auth.hasPermi('base:environmental-check-record:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'primary',
|
||||
|
@ -103,10 +103,14 @@ export default {
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:voc:create') ? 'separate' : '',
|
||||
type: this.$auth.hasPermi('base:environmental-check:create')
|
||||
? 'separate'
|
||||
: '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:voc:create') ? 'button' : '',
|
||||
type: this.$auth.hasPermi('base:environmental-check:create')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
@ -124,13 +128,16 @@ export default {
|
||||
tableProps,
|
||||
list: [],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:voc:update')
|
||||
this.$auth.hasPermiAnd([
|
||||
'base:environmental-check:update',
|
||||
'base:environmental-check:query',
|
||||
])
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:voc:delete')
|
||||
this.$auth.hasPermi('base:environmental-check:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
|
@ -99,10 +99,14 @@ export default {
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:waste-gas:export') ? 'separate' : '',
|
||||
type: this.$auth.hasPermi('base:environmental-check-record:export')
|
||||
? 'separate'
|
||||
: '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:waste-gas:export') ? 'button' : '',
|
||||
type: this.$auth.hasPermi('base:environmental-check-record:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'primary',
|
||||
|
@ -103,10 +103,14 @@ export default {
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:waste-gas:create') ? 'separate' : '',
|
||||
type: this.$auth.hasPermi('base:environmental-check:create')
|
||||
? 'separate'
|
||||
: '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:waste-gas:create') ? 'button' : '',
|
||||
type: this.$auth.hasPermi('base:environmental-check:create')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
@ -124,13 +128,16 @@ export default {
|
||||
tableProps,
|
||||
list: [],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:waste-gas:update')
|
||||
this.$auth.hasPermiAnd([
|
||||
'base:environmental-check:update',
|
||||
'base:environmental-check:query',
|
||||
])
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:waste-gas:delete')
|
||||
this.$auth.hasPermi('base:environmental-check:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
|
@ -99,12 +99,14 @@ export default {
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:waste-water:export')
|
||||
type: this.$auth.hasPermi('base:environmental-check-record:export')
|
||||
? 'separate'
|
||||
: '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:waste-water:export') ? 'button' : '',
|
||||
type: this.$auth.hasPermi('base:environmental-check-record:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'primary',
|
||||
|
@ -103,12 +103,14 @@ export default {
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:waste-water:create')
|
||||
type: this.$auth.hasPermi('base:environmental-check:create')
|
||||
? 'separate'
|
||||
: '',
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('base:waste-water:create') ? 'button' : '',
|
||||
type: this.$auth.hasPermi('base:environmental-check:create')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
@ -126,13 +128,13 @@ export default {
|
||||
tableProps,
|
||||
list: [],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('base:waste-water:update')
|
||||
this.$auth.hasPermi('base:environmental-check:update')
|
||||
? {
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
}
|
||||
: undefined,
|
||||
this.$auth.hasPermi('base:waste-water:delete')
|
||||
this.$auth.hasPermi('base:environmental-check:delete')
|
||||
? {
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
|
Loading…
Reference in New Issue
Block a user