projects/mesxc-zhp #197

Merged
gtz217 merged 2 commits from projects/mesxc-zhp into projects/mesxc-test 2024-02-01 16:52:02 +08:00
14 changed files with 277 additions and 34 deletions
Showing only changes of commit 009cf3b8e6 - Show all commits

View File

@ -1,7 +1,7 @@
###
# @Author: Do not edit
# @Date: 2023-08-29 09:40:39
# @LastEditTime: 2024-02-01 09:50:59
# @LastEditTime: 2024-02-01 16:49:38
# @LastEditors: zhp
# @Description:
###

View File

@ -59,6 +59,15 @@ export function listEnabled() {
})
}
// 获得可用的排班列表(根据车间筛选)
export function listEnabledByRoom(query) {
return request({
url: '/base/group-team/listEnabledByRoom',
method: 'get',
params: query
})
}
// 获得班组组员信息分页
export function groupTeamPage(query) {
return request({

View File

@ -96,6 +96,7 @@ export const DICT_TYPE = {
TIME_DIM: 'time_dim',
TABLE_NAME: 'table_name',
METHOD: 'method',
PUSH: 'push',
// ============== ORDER - 订单模块 =============
ORDER_STATUS: 'order_status',
@ -109,7 +110,10 @@ export const DICT_TYPE = {
FAULT_LEVEL: 'fault-level',
// ============== ENVIRONMENTAL - 环保模块 =============
ENVIRONMENT_CHECK_UNIT: 'environment_check_unit'
ENVIRONMENT_CHECK_UNIT: 'environment_check_unit',
// ============== GROUP - 班组模块 =============
WORK_SHOP: 'workshop'
}
/**

View File

@ -93,7 +93,12 @@
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-col :span="12">
<el-form-item label="是否推送" prop="push">
<el-switch v-model="form.push"></el-switch>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="描述" prop="description">
<el-input v-model="form.description"></el-input>
</el-form-item>
@ -149,7 +154,8 @@ export default {
code: '',
nuit: '',
pricingMethod: 2,
leaderName: ''
leaderName: '',
push: false
},
isEdit: false, //
rules: {
@ -178,18 +184,24 @@ export default {
this.form.id = id
getEnergyType( id ).then((res) => {
if (res.code === 0) {
this.form = res.data
this.form.name = res.data.name
this.form.code = res.data.code
this.form.nuit = res.data.nuit
this.form.pricingMethod = res.data.pricingMethod
this.form.leaderName = res.data.leaderName
this.form.push = res.data.push ? true : false
switch(this.form.pricingMethod) {
case 0:
this.tableData1 = this.form.segPriceList
this.tableData1 = this.form.segPriceList || []
break;
case 1:
this.tableData2 = this.form.usedPriceList
this.tableData2 = this.form.usedPriceList || []
break;
default:
}
}
})
console.log(this.form)
} else {
this.isEdit = false
this.form.id = ''
@ -288,6 +300,7 @@ export default {
return false
}
}
console.log(this.form)
if (this.isEdit) {
//
updateEnergyType({
@ -300,7 +313,8 @@ export default {
dim: this.form.pricingMethod === 1 ? this.form.dim: '',
singlePrice: this.form.pricingMethod === 2 ? this.form.singlePrice : '',
segPriceList: this.form.pricingMethod === 0 ? this.tableData1: [],
usedPriceList: this.form.pricingMethod === 1 ? this.tableData2: []
usedPriceList: this.form.pricingMethod === 1 ? this.tableData2: [],
push:this.form.push ? 1 : 0
}).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");
@ -317,7 +331,8 @@ export default {
dim: this.form.pricingMethod === 1 ? this.form.dim: '',
singlePrice: this.form.pricingMethod === 2 ? this.form.singlePrice : '',
segPriceList: this.form.pricingMethod === 0 ? this.tableData1: [],
usedPriceList: this.form.pricingMethod === 1 ? this.tableData2: []
usedPriceList: this.form.pricingMethod === 1 ? this.tableData2: [],
push:this.form.push ? 1 : 0
}).then((res) => {
if (res.code === 0) {
this.$modal.msgSuccess("操作成功");

View File

@ -52,7 +52,8 @@ const tableProps = [
{
prop: 'code',
label: '类型编码',
showOverflowtooltip: true
showOverflowtooltip: true,
minWidth: 150
},
{
prop: 'name',
@ -67,6 +68,11 @@ const tableProps = [
prop: 'pricingMethod',
label: '计价方式'
},
{
prop: 'push',
label: '是否推送',
filter: publicFormatter('push')
},
{
prop: 'price',
label: '价格(元)',

View File

@ -1,18 +1,30 @@
<template>
<el-form ref="form" :rules="rules" label-width="110px" :model="form">
<el-row>
<el-col :span="12">
<el-form-item label="车间名称" prop="roomNameDict">
<el-select v-model="form.roomNameDict" placeholder="请选择" style="width: 100%;" filterable>
<el-option
v-for="item in getDictDatas(DICT_TYPE.WORK_SHOP)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="班次名称" prop="name">
<el-input v-model="form.name"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="编码" prop="code">
<el-input v-model="form.code" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="生效时间" prop="enableTime">
<el-date-picker
@ -25,6 +37,8 @@
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="失效时间" prop="disableTime">
<el-date-picker
@ -37,8 +51,6 @@
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="班次开始时间" prop="startTime">
<el-time-picker
@ -51,6 +63,8 @@
</el-time-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="班次结束时间" prop="endTime">
<el-time-picker
@ -63,13 +77,6 @@
</el-time-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否跨天" prop="daySpan">
<el-select v-model="form.daySpan" placeholder="请选择" disabled style="width: 100%;">
@ -79,6 +86,13 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
@ -89,6 +103,7 @@ export default {
return {
form: {
id: '',
roomNameDict: '',
name: '',
code: '',
enableTime: '',
@ -100,6 +115,7 @@ export default {
},
isEdit: false, //
rules: {
roomNameDict:[{ required: true, message: '请选择车间名称', trigger: 'select' }],
name: [{ required: true, message: '请输入班组名称', trigger: 'blur' }],
enableTime: [{ required: true, message: '请选择班次开始时间', trigger: 'change' }],
code: [{ required: true, message: '请输入编码', trigger: 'blur' }],
@ -118,6 +134,8 @@ export default {
this.form = res.data
this.form.name = res.data.name
this.form.code = res.data.code
// this.form.roomNameDict = (res.data.roomNameDict || res.data.roomNameDict===0) ? String(res.data.roomNameDict) : ''
this.$set(this.form, 'roomNameDict',(res.data.roomNameDict || res.data.roomNameDict===0) ? String(res.data.roomNameDict) : '')
this.form.enableTime = res.data.enableTime
// this.form.disableTime = res.data.disableTime || null
this.$set(this.form, 'disableTime', res.data.disableTime || null)

View File

@ -46,14 +46,21 @@
<script>
import { getGroupClassesPage, deleteGroupClasses, updateGroupClasses } from "@/api/base/groupClasses";
import GroupClassAdd from './components/groupClassAdd.vue'
import GroupClassAdd from './components/groupClassAdd'
import { formatDate } from '@/utils'
import { publicFormatter } from '@/utils/dict'
const tableProps = [
{
prop: 'enableTimeStr',
label: '生效时段',
minWidth: 300
},
{
prop: 'roomNameDict',
label: '车间名称',
filter: publicFormatter('workshop'),
minWidth: 100
},
{
prop: 'name',
label: '班次名称'

View File

@ -1,18 +1,30 @@
<template>
<el-form ref="form" :rules="rules" label-width="100px" :model="form">
<el-row>
<el-col :span="12">
<el-form-item label="车间名称" prop="roomNameDict">
<el-select v-model="form.roomNameDict" placeholder="请选择" style="width: 100%;" filterable>
<el-option
v-for="item in getDictDatas(DICT_TYPE.WORK_SHOP)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="班组名称" prop="name">
<el-input v-model="form.name"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="班组编码" prop="code">
<el-input v-model="form.code" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="班组组长" prop="leaderId">
<el-select v-model="form.leaderId" placeholder="请选择" style="width: 100%;" filterable @change="selectLeader">
@ -25,6 +37,8 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="手机号" prop="telephone">
<el-input v-model="form.telephone" disabled></el-input>
@ -45,10 +59,12 @@ export default {
name: '',
code: '',
leaderId: '',
telephone: ''
telephone: '',
roomNameDict: ''
},
isEdit: false, //
rules: {
roomNameDict: [{ required: true, message: '请选择车间名称', trigger: 'select' }],
name: [{ required: true, message: '请输入班组名称', trigger: 'blur' }],
code: [{ required: true, message: '请输入班组编码', trigger: 'blur' }],
leaderId: [{ required: true, message: '请选择组长', trigger: 'select' }]
@ -64,7 +80,11 @@ export default {
this.form.id = id
getGroupTeam( id ).then((res) => {
if (res.code === 0) {
this.form = res.data
this.form.name = res.data.name
this.form.code = res.data.code
this.form.leaderId = res.data.leaderId
this.form.telephone = res.data.telephone
this.form.roomNameDict = (res.data.roomNameDict || res.data.roomNameDict===0) ? String(res.data.roomNameDict) : ''
this.selectLeader()
}
})

View File

@ -54,6 +54,7 @@ import GroupTeamAdd from './components/groupTeamAdd'
import StatusBtn from './components/statusBtn'
import WorkerOperate from './components/workerOperate'
import WorkerEdit from './components/workerEdit'
import { publicFormatter } from '@/utils/dict'
const tableProps = [
{
prop: 'createTime',
@ -61,6 +62,11 @@ const tableProps = [
filter: parseTime,
minWidth: 160
},
{
prop: 'roomNameDict',
label: '车间名称',
filter: publicFormatter('workshop')
},
{
prop: 'name',
label: '班组名称'

View File

@ -0,0 +1,108 @@
<template>
<div class="topTab">
<div class="arr leftArr" @click='toLeft'></div>
<div class="arr rightArr" @click='toRight'></div>
<el-scrollbar ref="groupTeamScroll" :vertical="false" class="scrollTab">
<ul class="tabBox">
<li :class="{'active':roomNameDict===item.value}" v-for="(item, index) in getDictDatas('workshop')" :key='index' @click='toggleName(item.value)'>{{item.label}}</li>
</ul>
</el-scrollbar>
</div>
</template>
<script>
export default {
name: 'TopTab',
data() {
return {
}
},
props:['roomNameDict'],
computed: {
scrollWrapper() {
return this.$refs.groupTeamScroll.$refs.wrap
}
},
methods:{
toLeft() {
const container = this.scrollWrapper
container.scrollLeft-=100
},
toRight() {
const container = this.scrollWrapper
container.scrollLeft+=100
},
toggleName(val) {
this.$emit('emitFun',val)
}
}
}
</script>
<style lang="scss" scoped>
.topTab {
height: 56px;
padding: 0px 48px 0px 56px;
position: relative;
.arr {
position: absolute;
width: 48px;
height: 48px;
line-height: 48px;
background-color: #fff;
border-radius: 8px;
cursor: pointer;
}
.leftArr{
left: 0;
padding-left: 10px;
}
.leftArr::before{
display: inline-block;
content: '';
width: 0;
height: 0;
border-width: 8px;
border-style: solid;
border-color: transparent #0B58FF transparent transparent;
}
.rightArr{
right: 0;
top:0;
padding-left: 22px;
}
.rightArr::before{
display: inline-block;
content: '';
width: 0;
height: 0;
border-width: 8px;
border-style: solid;
border-color: transparent transparent transparent #0B58FF;
}
.scrollTab{
white-space: nowrap;
overflow: hidden;
font-size: 16px;
width: 100%;
height: 100%;
ul,li{
list-style: none;
margin: 0;
padding: 0;
}
.tabBox >.active {
border-bottom: 4px solid #0B58FF;
}
.tabBox>li {
display: inline-block;
height: 48px;
line-height: 48px;
background: #FFFFFF;
border-radius: 8px;
padding: 0px 10px;
margin-right: 8px;
cursor: pointer;
}
}
}
</style>

View File

@ -1,5 +1,6 @@
<template>
<div class="groupTeamScheduling">
<TopTab :roomNameDict='roomNameDict' @emitFun='toggleName'/>
<div class="operationArea">
<el-form :inline="true" class="demo-form-inline">
<span class="blue-block"></span>
@ -87,13 +88,15 @@
<script>
import { getPreset, createOrUpdateList, autoSet } from "@/api/base/groupTeamScheduling";
import { listEnabled } from "@/api/base/groupTeam";
import { listEnabledByRoom } from "@/api/base/groupTeam";
import moment from 'moment';
import TopTab from './components/topTab'
export default {
name: "GroupTeamScheduling",
data() {
return {
roomNameDict:null,
startDay: '',//
year: '',// 2023
month: '',//
@ -108,7 +111,9 @@ export default {
autoScheduling: false //
};
},
components:{ TopTab },
created() {
this.roomNameDict = this.getDictDatas('workshop')[0].value
this.startDay = new Date()
//
this.settingBtn()
@ -117,6 +122,22 @@ export default {
this.getList()
},
methods: {
//
toggleName(val) {
this.roomNameDict = val
//
if (this.showSetting) {
this.showSetting = !this.showSetting
}
//
if (!this.jumpDisabled) {
this.clearChoose()
}
//
this.getTeamList()
//
this.getList()
},
//
selectMonth() {
if (this.startDay) {
@ -133,7 +154,10 @@ export default {
},
//
getTeamList() {
listEnabled().then(res => {
console.log(this.roomNameDict)
listEnabledByRoom({
room: this.roomNameDict
}).then(res => {
this.teamList = res.data || []
})
},
@ -143,7 +167,8 @@ export default {
let month = moment(this.startDay).format('M')
getPreset({
year: year,
month: month
month: month,
roomNameDict: this.roomNameDict
}).then(res => {
let obj = res.data || {}
if (obj) {
@ -156,6 +181,7 @@ export default {
}
}
this.list = obj
this.settingBtnDis = false
}).catch(() => {
this.list = {}
this.settingBtnDis = true //
@ -246,7 +272,8 @@ export default {
// console.log(moment(this.startDay).format("YYYY-MM-DD"))
autoSet({
year: this.year,
month: moment(this.startDay).month() + 1
month: moment(this.startDay).month() + 1,
roomNameDict: this.roomNameDict
}).then(res => {
this.list = res.data || {}
})
@ -350,6 +377,8 @@ export default {
padding: 14px 10px 0 20px;
background-color: #fff;
border-radius: 8px;
height: calc(100vh - 255px);
overflow-y: auto;
.el-calendar__body {
padding: 10px 16px 16px 0;
}

View File

@ -7,6 +7,10 @@
<p class="boldTitle">工单名称</p>
<p class="lightText">{{ queryParams.workOrderName ? queryParams.workOrderName : '-' }}</p>
</el-col>
<el-col :span="6">
<p class="boldTitle">车间名称</p>
<p class="lightText">{{ (queryParams.roomNameDict || queryParams.roomNameDict === 0) ? getDictDataLabel('workshop',queryParams.roomNameDict) : '-' }}</p>
</el-col>
<el-col :span="6">
<p class="boldTitle">班组名称</p>
<p class="lightText">{{ queryParams.teamName ? queryParams.teamName : '-' }}</p>

View File

@ -31,7 +31,15 @@
import { getByWorkOrder } from '@/api/monitoring/groupTeamView'
import { workOrderList } from '@/api/base/workOrder'
import GroupTeamViewDetail from './components/groupTeamViewDetail.vue'
import { publicFormatter } from '@/utils/dict'
const tableProps = [
{
prop: 'roomNameDict',
label: '车间名称',
filter: publicFormatter('workshop'),
showOverflowtooltip: true,
minWidth: 100
},
{
prop: 'name',
label: '班组名称'
@ -134,6 +142,7 @@ export default {
})
params.workOrderId = this.queryParams.workOrderId
params.workOrderName = this.workOrderName
params.roomNameDict = val.data.roomNameDict
this.$nextTick(() => {
this.$refs.groupTeamViewDetail.init(params)
})

View File

@ -37,13 +37,21 @@
import { groupTeamSchedulingPage, groupClassesListAll } from '@/api/monitoring/teamProduction'
import { parseTime } from '@/utils/ruoyi'
import TeamProductionDetail from './components/teamProductionDetail'
import { publicFormatter } from '@/utils/dict'
const tableProps = [
{
prop: 'createTime',
label: '排班创建时间',
filter: parseTime,
minWidth: 160
prop: 'roomNameDict',
label: '车间名称',
filter: publicFormatter('workshop'),
showOverflowtooltip: true,
minWidth: 100
},
// {
// prop: 'createTime',
// label: '',
// filter: parseTime,
// minWidth: 160
// },
{
prop: 'startDay',
label: '上班日期',