Cette révision appartient à :
朱菊兰 2024-03-14 14:47:57 +08:00
Parent 57660ee5fd
révision 526bb8c534
6 fichiers modifiés avec 79 ajouts et 139 suppressions

Voir le fichier

@ -1,10 +1,10 @@
import axios from 'axios'
import {Message, MessageBox, Notification, Loading} from 'element-ui'
import { Message, MessageBox, Notification, Loading } from 'element-ui'
import store from '@/store'
import {getAccessToken, getRefreshToken, getTenantId, setToken} from '@/utils/auth'
import { getAccessToken, getRefreshToken, getTenantId, setToken } from '@/utils/auth'
import errorCode from '@/utils/errorCode'
import {getPath, getTenantEnable} from "@/utils/ruoyi";
import {refreshToken} from "@/api/login";
import { getPath, getTenantEnable } from "@/utils/ruoyi";
import { refreshToken } from "@/api/login";
// 需要忽略的提示。忽略后,自动 Promise.reject('error')
const ignoreMsgs = [
@ -42,7 +42,7 @@ const service = axios.create({
let loadingInstance = null
function startLoading() {
loadingInstance = Loading.service({
fullscreen: false,
fullscreen: true,
text: '拼命加载中...',
background: 'rgba(0, 0, 0, 0.1)'
})
@ -86,7 +86,7 @@ service.interceptors.request.use(config => {
for (const propName of Object.keys(config.params)) {
const value = config.params[propName];
const part = encodeURIComponent(propName) + '='
if (value !== null && typeof(value) !== "undefined") {
if (value !== null && typeof (value) !== "undefined") {
if (typeof value === 'object') {
for (const key of Object.keys(value)) {
let params = propName + '[' + key + ']';
@ -104,9 +104,9 @@ service.interceptors.request.use(config => {
}
return config
}, error => {
tryHideFullScreenLoading()
console.log(error)
Promise.reject(error)
tryHideFullScreenLoading()
console.log(error)
Promise.reject(error)
})
// 响应拦截器
@ -189,23 +189,23 @@ service.interceptors.response.use(async res => {
return res.data
}
}, error => {
tryHideFullScreenLoading()
console.log('err' + error)
let {message} = error;
if (message === "Network Error") {
message = "后端接口连接异常";
} else if (message.includes("timeout")) {
message = "系统接口请求超时";
} else if (message.includes("Request failed with status code")) {
message = "系统接口" + message.substr(message.length - 3) + "异常";
}
Message({
message: message,
type: 'error',
duration: 5 * 1000
})
return Promise.reject(error)
tryHideFullScreenLoading()
console.log('err' + error)
let { message } = error;
if (message === "Network Error") {
message = "后端接口连接异常";
} else if (message.includes("timeout")) {
message = "系统接口请求超时";
} else if (message.includes("Request failed with status code")) {
message = "系统接口" + message.substr(message.length - 3) + "异常";
}
Message({
message: message,
type: 'error',
duration: 5 * 1000
})
return Promise.reject(error)
}
)
export function getBaseHeader() {
@ -219,10 +219,10 @@ function handleAuthorized() {
if (!isRelogin.show) {
isRelogin.show = true;
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
confirmButtonText: '重新登录',
cancelButtonText: '取消',
type: 'warning'
}
confirmButtonText: '重新登录',
cancelButtonText: '取消',
type: 'warning'
}
).then(() => {
isRelogin.show = false;
store.dispatch('LogOut').then(() => {

Voir le fichier

@ -2,11 +2,7 @@
<el-form ref="form" :rules="rules" label-width="100px" :model="form">
<el-form-item label="员工" prop="workerId" v-if='!isEdit'>
<el-select v-model="form.workerId" placeholder="请选择" filterable style="width: 100%;" @change="selectWorker()">
<el-option
v-for="item in workerList"
:key="item.id"
:label="item.name"
:value="item.id">
<el-option v-for="item in workerList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-form-item>
@ -48,12 +44,12 @@ export default {
this.form.teamId = param.teamId
this.form.majorName = param.majorName
this.workName = param.workName
otherWorkerList({teamId:this.form.teamId}).then(res => {
otherWorkerList({ teamId: this.form.teamId }).then(res => {
this.workerList = res.data || []
if (param.id) {
this.isEdit = true
this.form.id = param.id
groupTeamDet({id: this.form.id}).then((res) => {
groupTeamDet({ id: this.form.id }).then((res) => {
if (res.code === 0) {
this.form.workerId = res.data.workerId
this.form.remark = res.data.remark
@ -72,7 +68,7 @@ export default {
this.form.majorName = item.majorName
}
})
}else{
} else {
this.form.majorName = ''
}
},

Voir le fichier

@ -9,18 +9,15 @@
</el-col>
<el-col :span="6">
<p class="boldTitle">车间名称</p>
<p class="lightText">{{ (queryParams.roomNameDict || queryParams.roomNameDict === 0) ? getDictDataLabel('workshop',queryParams.roomNameDict) : '-' }}</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>
</el-col>
</el-row>
<base-table
:table-props="tableProps"
:table-data="tableData"
:max-height="tableH"
/>
<base-table :table-props="tableProps" :table-data="tableData" :max-height="tableH" :page="1" :limit="1000000" />
</div>
</el-drawer>
</div>
@ -47,7 +44,7 @@ const tableProps = [
},
{
prop: 'workTime',
label: '工作时长'
label: '工作时长(h)'
}
]
export default {
@ -83,21 +80,24 @@ export default {
<style lang="scss" scoped>
.box {
padding: 0 32px;
.topBox {
padding-bottom: 30px;
margin-bottom: 30px;
border-bottom: 1px solid #E9E9E9;
.boldTitle {
font-size: 14px;
font-weight: 600;
color: rgba(0,0,0,0.85);
color: rgba(0, 0, 0, 0.85);
margin: 0;
margin-bottom: 10px;
}
.lightText {
font-size: 14px;
font-weight: 400;
color: rgba(102,102,102,0.75);
color: rgba(102, 102, 102, 0.75);
margin: 0;
}
}

Voir le fichier

@ -2,28 +2,20 @@
<el-form :inline="true" class="demo-form-inline">
<span class="blue-block"></span>
<el-form-item label="班次信息">
<el-select v-model="queryParams.classesId" placeholder="班次信息" style="width: 200px;" size="small" clearable>
<el-option
v-for="item in classesArr"
:key="item.id"
:label="(item.roomName?item.roomName:'')+'-'+item.name"
:value="item.id">
<span>{{ item.roomName }}-{{item.name}}</span>
<el-select v-model="queryParams.classesId" placeholder="班次信息" style="width: 200px;" size="small" clearable
filterable>
<el-option v-for="item in classesArr" :key="item.id"
:label="(item.roomName ? item.roomName : '') + '-' + item.name" :value="item.id">
<span>{{ item.roomName }}-{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="班组信息">
<el-input v-model="queryParams.teamName" placeholder="班组信息" style="width: 200px;" clearable></el-input>
</el-form-item>
<el-form-item label="上班时间">
<el-date-picker
v-model="queryParams.tiemStr"
type="daterange"
format='yyyy-MM-dd'
value-format='yyyy-MM-dd'
range-separator='-'
style="width: 250px;"
size="small">
<el-form-item label="上班日期">
<el-date-picker v-model="queryParams.tiemStr" type="daterange" format='yyyy-MM-dd' value-format='yyyy-MM-dd'
range-separator='-' style="width: 250px;" size="small">
</el-date-picker>
</el-form-item>
<el-form-item>
@ -69,6 +61,7 @@ export default {
font-size: 16px;
color: #0B58FF;
}
.el-input__prefix .el-icon-date {
font-size: 16px;
color: #0B58FF;
@ -83,6 +76,7 @@ export default {
background: #E8E8E8;
vertical-align: middle;
}
.demo-form-inline {
.blue-block {
display: inline-block;

Voir le fichier

@ -1,12 +1,8 @@
<template>
<div>
<el-drawer title="查看详情" :visible.sync="visible" size="70%" :wrapperClosable='false' @closed="closeDrawer">
<el-drawer title="生产情况" :visible.sync="visible" size="70%" @closed="closeDrawer" :show-close='false'>
<div class="box">
<base-table
:table-props="tableProps"
:table-data="tableData"
:max-height="tableH"
/>
<base-table :table-props="tableProps" :table-data="tableData" :max-height="tableH" />
</div>
</el-drawer>
</div>
@ -53,7 +49,7 @@ export default {
init(params) {
this.visible = true
// console.log(params)
getByScheduling({id:params.id}).then(res => {
getByScheduling({ id: params.id }).then(res => {
let dataList1 = []
let dataList2 = []
if (res.data.nameData && res.data.nameData.length > 0) {
@ -90,11 +86,11 @@ export default {
timeArr.push(this.parseTime(item.name))
tablePropsObj.prop = item.name
tablePropsObj.label = this.parseTime(item.name)
tablePropsObj.children[0].prop = item.name+'sumInput'
tablePropsObj.children[1].prop = item.name+'sumOutput'
tablePropsObj.children[2].prop = item.name+'goodArea'
tablePropsObj.children[3].prop = item.name+'dynamicValue'
tablePropsObj.children[4].prop = item.name+'dynamicRatio'
tablePropsObj.children[0].prop = item.name + 'sumInput'
tablePropsObj.children[1].prop = item.name + 'sumOutput'
tablePropsObj.children[2].prop = item.name + 'goodArea'
tablePropsObj.children[3].prop = item.name + 'dynamicValue'
tablePropsObj.children[4].prop = item.name + 'dynamicRatio'
this.tableProps.push(tablePropsObj)
})
getSchedulingMonitoringRecord({
@ -111,15 +107,15 @@ export default {
obj.workOrderList = dataList1.data[i].workOrderList
let subData1 = dataList1.data[i].data
for (let ii = 0; ii < subData1.length; ii++) {
obj[subData1[ii].dynamicName+'sumInput'] = subData1[ii].dynamicValue.sumInput
obj[subData1[ii].dynamicName+'sumOutput'] = subData1[ii].dynamicValue.sumOutput
obj[subData1[ii].dynamicName+'goodArea'] = subData1[ii].dynamicValue.goodArea
obj[subData1[ii].dynamicName + 'sumInput'] = subData1[ii].dynamicValue.sumInput
obj[subData1[ii].dynamicName + 'sumOutput'] = subData1[ii].dynamicValue.sumOutput
obj[subData1[ii].dynamicName + 'goodArea'] = subData1[ii].dynamicValue.goodArea
}
for (let j = 0; j < dataList2.data.length; j++) {
let subData2 = dataList2.data[j].data
for (let jj = 0; jj < subData2.length; jj++) {
obj[subData2[jj].dynamicName+'dynamicValue'] = subData2[jj].dynamicValue
obj[subData2[jj].dynamicName+'dynamicRatio'] = obj[subData2[jj].dynamicName+'dynamicValue'] / obj[subData2[jj].dynamicName+'sumOutput']
obj[subData2[jj].dynamicName + 'dynamicValue'] = subData2[jj].dynamicValue
obj[subData2[jj].dynamicName + 'dynamicRatio'] = obj[subData2[jj].dynamicName + 'dynamicValue'] / obj[subData2[jj].dynamicName + 'sumOutput']
}
}
this.tableData.push(obj)

Voir le fichier

@ -1,37 +1,22 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-area @submit="buttonClick"/>
<search-area @submit="buttonClick" />
<!-- <search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/> -->
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
:max-height="tableH"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
:max-height="tableH">
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="80" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
<pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
@pagination="getList" />
<!-- 查看生产情况 -->
<team-production-detail v-if='paramVisible' ref='schedulingMonitoringDetail'/>
<team-production-detail v-if='paramVisible' ref='schedulingMonitoringDetail' />
</div>
</template>
<script>
@ -86,38 +71,6 @@ export default {
name: 'GroupTeamScheduling',
data() {
return {
formConfig: [
{
type: 'select',
label: '班次信息',
selectOptions: [],
param: 'classesId'
},
{
type: 'input',
label: '班组信息',
placeholder: '班组信息',
param: 'teamName'
},
{
type: 'datePicker',
label: '上班日期',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
rangeSeparator: '-',
// valueFormat: "timestamp",
param: 'tiemStr',
defaultSelect: '',
width: 250
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary'
}
],
//
queryParams: {
pageNo: 1,
@ -128,11 +81,12 @@ export default {
},
tableProps,
tableBtn: [
this.$auth.hasPermi('base:team-production:detail')
this.$auth.hasPermi('base:team-production:detail')
? {
type: 'detail',
btnName: '详情'
}
type: 'productionDetail',
btnName: '查看',
showTip: '生产情况'
}
: undefined
].filter((v) => v),
list: [],
@ -158,7 +112,7 @@ export default {
this.getList()
},
getList() {
groupTeamSchedulingPage({...this.queryParams}).then(res => {
groupTeamSchedulingPage({ ...this.queryParams }).then(res => {
console.log(res)
this.list = res.data.list || []
this.total = res.data.total || 0