Compare commits
47 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
2f68f5a6bb | 2 months ago |
|
|
47a6eec1bc | 4 months ago |
|
|
a4f21f07c9 | 2 years ago |
|
|
48c7103996 | 2 years ago |
|
|
8a2d92aa21 | 2 years ago |
|
|
57a6ab4d16 | 2 years ago |
|
|
1120c34489 | 2 years ago |
|
|
e541a43e5f | 2 years ago |
|
|
1792a29b2f | 2 years ago |
|
|
dd0d818353 | 2 years ago |
|
|
e9eec7986a | 2 years ago |
|
|
f9ad9772c2 | 2 years ago |
|
|
947a4fc212 | 2 years ago |
|
|
6afabd42e0 | 2 years ago |
|
|
461dddb0b8 | 2 years ago |
|
|
fc7167246d | 2 years ago |
|
|
81ce913696 | 2 years ago |
|
|
4974f02a8d | 2 years ago |
|
|
28ae1cd079 | 2 years ago |
|
|
cab3cba37c | 2 years ago |
|
|
018010a937 | 2 years ago |
|
|
d69c1ac7d6 | 2 years ago |
|
|
fce93bddd4 | 2 years ago |
|
|
4c0bc9fff3 | 2 years ago |
|
|
226b2d295e | 2 years ago |
|
|
16f59c10be | 2 years ago |
|
|
1baaf3556b | 2 years ago |
|
|
a6c783b127 | 2 years ago |
|
|
d75dcb015c | 2 years ago |
|
|
1549c39821 | 2 years ago |
|
|
206fd98524 | 2 years ago |
|
|
4c98ce1cb0 | 2 years ago |
|
|
89e9a63dfb | 2 years ago |
|
|
4fade454c1 | 2 years ago |
|
|
ad6ea92473 | 2 years ago |
|
|
57215aae78 | 2 years ago |
|
|
3c230ed76a | 2 years ago |
|
|
b41b2a243d | 2 years ago |
|
|
3516636669 | 2 years ago |
|
|
1d80b171d6 | 2 years ago |
|
|
f298f375a2 | 2 years ago |
|
|
42af1d83fd | 2 years ago |
|
|
d3fc4183f0 | 2 years ago |
|
|
8d11f83d70 | 2 years ago |
|
|
6e6fd66eb0 | 2 years ago |
|
|
e2b96c0c12 | 2 years ago |
|
|
90dc46c2a1 | 2 years ago |
@ -0,0 +1,10 @@
|
||||
FROM nginx:alpine
|
||||
|
||||
RUN rm -f /etc/nginx/conf.d/default.conf
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
COPY dist/build/h5 /usr/share/nginx/html
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
@ -0,0 +1,70 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
client_max_body_size 100m;
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://besure_server:48081;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location /admin-api/ {
|
||||
proxy_pass http://besure_server:48081;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location /jmreport/ {
|
||||
proxy_pass http://besure_server:48081;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location /v3/api-docs/ {
|
||||
proxy_pass http://besure_server:48081;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location /doc.html {
|
||||
proxy_pass http://besure_server:48081;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location /swagger-ui/ {
|
||||
proxy_pass http://besure_server:48081;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
}
|
||||
|
||||
location /webjars/ {
|
||||
proxy_pass http://besure_server:48081;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
}
|
||||
|
||||
location ~ /v3/api-docs/.*\.json$ {
|
||||
proxy_pass http://besure_server:48081;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
}
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,80 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 新增能源设备
|
||||
export function createEnergyDevice(data) {
|
||||
return request({
|
||||
url: '/admin-api/mes/energy-device/create',
|
||||
method: 'POST',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 查询能源设备详情
|
||||
export function getEnergyDeviceById(id) {
|
||||
return request({
|
||||
url: '/admin-api/mes/energy-device/get?id=' + id,
|
||||
method: 'GET',
|
||||
})
|
||||
}
|
||||
|
||||
// 修改能源设备
|
||||
export function updateEnergyDevice(data) {
|
||||
return request({
|
||||
url: '/admin-api/mes/energy-device/update',
|
||||
method: 'PUT',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 查询能源设备列表
|
||||
export function getEnergyDevice(params) {
|
||||
return request({
|
||||
url: '/admin-api/mes/energy-device/page',
|
||||
method: 'GET',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
// 删除能源设备
|
||||
export function deleteEnergyDevice(id) {
|
||||
return request({
|
||||
url: '/admin-api/mes/energy-device/delete?id='+id,
|
||||
method: 'DELETE'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增抄表记录
|
||||
export function createEnergyDeviceCheckRecord(data) {
|
||||
return request({
|
||||
url: '/admin-api/mes/energy-device/energy-device-check-record/create',
|
||||
method: 'POST',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 查询抄表记录
|
||||
export function getEnergyDeviceCheckRecord(params) {
|
||||
return request({
|
||||
url: '/admin-api/mes/energy-device/energy-device-check-record/page',
|
||||
method: 'GET',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 修改抄表记录
|
||||
export function updateEnergyDeviceCheckRecord(data) {
|
||||
return request({
|
||||
url: '/admin-api/mes/energy-device/update',
|
||||
method: 'PUT',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除抄表记录
|
||||
export function deleteEnergyDeviceCheckRecordById(id) {
|
||||
return request({
|
||||
url: '/admin-api/mes/energy-device/energy-device-check-record/delete?id='+id,
|
||||
method: 'DELETE'
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询产线工位列表
|
||||
export function getListOrgWorker(params) {
|
||||
return request({
|
||||
url: '/admin-api/mes/organization/listOrgWorker',
|
||||
method: 'GET',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
// 获得班组成员
|
||||
export function getUserList2(params) {
|
||||
return request({
|
||||
url: '/admin-api/mes/work-team/work-team-detail/getUserList2',
|
||||
method: 'GET',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
// 多个日期新增工位安排
|
||||
export function createWorker(params) {
|
||||
return request({
|
||||
url: '/admin-api/mes/org-worker/createWorker',
|
||||
method: 'GET',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
// 查询工位安排分页
|
||||
export function getOrgWorkerPage(params) {
|
||||
return request({
|
||||
url: '/admin-api/mes/org-worker/page',
|
||||
method: 'GET',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
// 删除工位安排
|
||||
export function deleteOrgWorker(id) {
|
||||
return request({
|
||||
url: '/admin-api/mes/org-worker/delete?id='+id,
|
||||
method: 'DELETE'
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,89 @@
|
||||
<template>
|
||||
<view>
|
||||
<u-sticky
|
||||
class="sticky"
|
||||
:custom-nav-height="0"
|
||||
>
|
||||
<u-navbar
|
||||
title="重置最后抄表值"
|
||||
bg-color="transparent"
|
||||
:auto-back="true"
|
||||
:title-style="{ fontWeight: 'bold' }"
|
||||
safe-area-inset-top
|
||||
placeholder
|
||||
/>
|
||||
</u-sticky>
|
||||
<view class="container">
|
||||
<!-- 自定义表单校验 -->
|
||||
<uni-forms labelWidth="105px" :modelValue="formData">
|
||||
<uni-forms-item label="名称">
|
||||
<u-input v-model="formData.name" disabled/>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="编码">
|
||||
<u-input v-model="formData.code" disabled/>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="上次抄表时间" name="lastCheckTime">
|
||||
<uni-datetime-picker v-model="formData.lastCheckTime" type="date" :clear-icon="true" placeholder="选择上次抄表时间"/>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="最后抄表值" name="lastCheckValue">
|
||||
<u-input v-model="formData.lastCheckValue"></u-input>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
<view class="u-flex justify-end">
|
||||
<view @click="submit()">
|
||||
<u-button type="success">
|
||||
<uni-icons type="checkbox" class="u-m-r-10"/>
|
||||
确定
|
||||
</u-button></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import tab from "@/plugins/tab";
|
||||
import { updateEnergyDeviceCheckRecord } from "@/api/mes/application";
|
||||
import modal from "@/plugins/modal";
|
||||
|
||||
const formData = ref({
|
||||
name: undefined,
|
||||
code: undefined,
|
||||
id: undefined,
|
||||
lastCheckTime: undefined,
|
||||
lastCheckValue: undefined,
|
||||
})
|
||||
|
||||
const submit = async ()=>{
|
||||
await updateEnergyDeviceCheckRecord(formData.value)
|
||||
modal.msgSuccess("修改成功")
|
||||
await tab.navigateBack()
|
||||
// 通知组件刷新列表
|
||||
uni.$emit('success', true)
|
||||
}
|
||||
|
||||
onLoad(() => {
|
||||
formData.value.name = tab.getParams().name
|
||||
formData.value.id = tab.getParams().id
|
||||
formData.value.lastCheckTime = tab.getParams().time
|
||||
formData.value.lastCheckValue = tab.getParams().value
|
||||
formData.value.code = tab.getParams().code
|
||||
formData.value.isEnable = tab.getParams().isEnable
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="sass" scoped>
|
||||
.sticky
|
||||
background: linear-gradient(180deg, #d4e9ff 0%, #f3f9ff 100%)
|
||||
backdrop-filter: blur(27.18px)
|
||||
box-shadow: 0 1px 1px 0 rgba(0, 72, 145, 0.1), 0 0.5px 0 0 rgba(0, 0, 0, 0.1)
|
||||
.container
|
||||
padding: 20rpx
|
||||
margin: 20rpx
|
||||
background-color: #ffffff
|
||||
.uniui-checkbox:before
|
||||
color: #ffffff
|
||||
.u-button
|
||||
height: 35px
|
||||
</style>
|
||||
@ -0,0 +1,119 @@
|
||||
<template>
|
||||
<view>
|
||||
<u-sticky
|
||||
class="sticky"
|
||||
:custom-nav-height="0"
|
||||
>
|
||||
<u-navbar
|
||||
title="我的应用"
|
||||
bg-color="transparent"
|
||||
:auto-back="false"
|
||||
:title-style="{ fontWeight: 'bold' }"
|
||||
left-icon=""
|
||||
safe-area-inset-top
|
||||
placeholder
|
||||
/>
|
||||
</u-sticky>
|
||||
<view class="container-wrap">
|
||||
<view
|
||||
v-for="(item,index) in appList"
|
||||
:key="item.title"
|
||||
class="app-list"
|
||||
>
|
||||
<view
|
||||
class="u-flex u-flex-between"
|
||||
>
|
||||
<view class="app-title">
|
||||
{{ item.title }}
|
||||
</view>
|
||||
<u-icon
|
||||
name="arrow-right"
|
||||
color="#333333"
|
||||
size="14"
|
||||
/>
|
||||
</view>
|
||||
<u-row class="model-container">
|
||||
<u-col v-for="(app, index) in item.list" :key="app.id" span="3">
|
||||
<view class="u-flex u-flex-center" @click="navTo(path[index])">
|
||||
<view class="item u-flex u-flex-column">
|
||||
<u-image
|
||||
:show-loading="true"
|
||||
:src="app.img"
|
||||
width="96rpx"
|
||||
height="96rpx"
|
||||
/>
|
||||
<text class="text">
|
||||
{{ app.text }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</u-col>
|
||||
</u-row>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import tab from "@/plugins/tab";
|
||||
|
||||
const appList = ref([
|
||||
{
|
||||
title: '基础数据',
|
||||
list: [
|
||||
{
|
||||
id: 1,
|
||||
img: '/static/images/icon/arrangement.png',
|
||||
text: '工位安排'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
img: '/static/images/icon/energy.png',
|
||||
text: '能源设备'
|
||||
}
|
||||
]
|
||||
}
|
||||
])
|
||||
|
||||
const path = ['/pages/application/components/deskArrangement','/pages/application/components/energyEquipment']
|
||||
const navTo = (url) => {
|
||||
tab.navigateTo(url)
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="sass" scoped>
|
||||
.page
|
||||
width: 100%
|
||||
|
||||
.sticky
|
||||
background: linear-gradient(180deg, #d4e9ff 0%, #f3f9ff 100%)
|
||||
backdrop-filter: blur(27.18px)
|
||||
box-shadow: 0 1px 1px 0 rgba(0, 72, 145, 0.1), 0 0.5px 0 0 rgba(0, 0, 0, 0.1)
|
||||
|
||||
.container-wrap
|
||||
padding: 20rpx
|
||||
.app-list
|
||||
background-color: #ffffff
|
||||
padding: 20rpx 10rpx
|
||||
border-radius: 20rpx
|
||||
.app-title
|
||||
color: #343434
|
||||
font-size: 28rpx
|
||||
font-weight: bold
|
||||
.model-container
|
||||
flex-wrap: wrap
|
||||
.item
|
||||
box-sizing: border-box
|
||||
padding: 24rpx
|
||||
&:active
|
||||
background-color: #f1f1f1
|
||||
border-radius: 20rpx
|
||||
.text
|
||||
margin-top: 8rpx
|
||||
color: #595959
|
||||
font-size: 24rpx
|
||||
+ .app-list
|
||||
margin-top: 20rpx
|
||||
</style>
|
||||
@ -1,232 +0,0 @@
|
||||
<template>
|
||||
<view >
|
||||
<uni-notice-bar show-icon scrollable text="安全生产!有序生产!高效生产!" />
|
||||
|
||||
<uni-section title="开工中" type="line" title-color="#18bc37"> </uni-section>
|
||||
<el-collapse accordion>
|
||||
<el-collapse-item v-for="(item, index) in startList" :name="item.id">
|
||||
<template #title>
|
||||
<el-icon><Tickets /></el-icon>
|
||||
<el-text type="success">{{item.code}}</el-text>-
|
||||
<el-text size="large">{{item.productName}}</el-text>
|
||||
</template>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-text type="success">计划开始:{{ timestampToTime(item.planStartTime) }}</el-text>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-text type="success">计划数:{{ item.planNumber }}</el-text>
|
||||
</el-col>
|
||||
<el-col v-if="auth.hasPermi('mes:plan:update')" :span="4">
|
||||
<el-button type="success" plain @click="updatePlan(item.id, item.code,'end')">完工</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-text type="warning">计划结束:{{ timestampToTime(item.planEndTime) }}</el-text>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-text type="warning">入库数:{{ item.finishNumber }}</el-text>
|
||||
</el-col>
|
||||
<el-col v-if="auth.hasPermi('mes:plan:update')" :span="4">
|
||||
<el-button type="warning" plain @click="updatePlan(item.id,item.code,'pause')">暂停</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="20">
|
||||
<el-text>备注:{{ item.remark }}</el-text>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-button type="info" plain @click="planProgress(item)">进度</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
|
||||
<!-- 派工中-->
|
||||
<uni-section title="派工中" type="line" title-color="#2979ff"></uni-section>
|
||||
<el-collapse accordion>
|
||||
<el-collapse-item v-for="(item, index) in paigongList" :name="item.id">
|
||||
<template #title>
|
||||
<el-icon><Tickets /></el-icon>
|
||||
<el-text type="success">{{item.code}}</el-text>-
|
||||
<el-text size="large">{{item.productName}}</el-text>
|
||||
</template>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-text type="success">计划开始:{{ timestampToTime(item.planStartTime) }}</el-text>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-text type="success">计划数:{{ item.planNumber }}</el-text>
|
||||
</el-col>
|
||||
<el-col v-if="auth.hasPermi('mes:plan:update')" :span="4">
|
||||
<el-button type="info" plain @click="updatePlan(item.id,item.code, 'start')">开工</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-text type="warning">计划结束:{{ timestampToTime(item.planEndTime) }}</el-text>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-text>备注:{{ item.remark }}</el-text>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
<!-- 计划中-->
|
||||
<uni-section title="计划中" type="line" title-color="#f3a73f"></uni-section>
|
||||
<el-collapse accordion>
|
||||
<el-collapse-item v-for="(item, index) in planList" :name="item.id">
|
||||
<template #title>
|
||||
<el-icon><Tickets /></el-icon>
|
||||
<el-text type="success">{{item.code}}</el-text>-
|
||||
<el-text size="large">{{item.productName}}</el-text>
|
||||
</template>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-text type="success">计划开始:{{ timestampToTime(item.planStartTime) }}</el-text>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-text type="success">计划数:{{ item.planNumber }}</el-text>
|
||||
</el-col>
|
||||
<el-col v-if="auth.hasPermi('mes:plan:update')" :span="4">
|
||||
<el-button type="primary" plain>派工</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-text type="warning">计划结束:{{ timestampToTime(item.planEndTime) }}</el-text>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-text>备注:{{ item.remark }}</el-text>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
<!-- 暂停中 -->
|
||||
<uni-section title="暂停中" type="line" title-color="#e43d33"></uni-section>
|
||||
<el-collapse accordion>
|
||||
<el-collapse-item v-for="(item, index) in pauseList" :name="item.id">
|
||||
<template #title>
|
||||
<el-icon><Tickets /></el-icon>
|
||||
<el-text type="success">{{item.code}}</el-text>-
|
||||
<el-text size="large">{{item.productName}}</el-text>
|
||||
</template>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-text type="success">计划开始:{{ timestampToTime(item.planStartTime) }}</el-text>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-text type="success">计划数:{{ item.planNumber }}</el-text>
|
||||
</el-col>
|
||||
<el-col v-if="auth.hasPermi('mes:plan:update')" :span="4">
|
||||
<el-button type="success" plain @click="updatePlan(item.id,item.code, 'end')">完工</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-text type="warning">计划结束:{{ timestampToTime(item.planEndTime) }}</el-text>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-text type="warning">入库数:{{ item.finishNumber }}</el-text>
|
||||
</el-col>
|
||||
<el-col v-if="auth.hasPermi('mes:plan:update')" :span="4">
|
||||
<el-button type="info" plain @click="updatePlan(item.id, item.code,'start')">开工</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-text>备注:{{ item.remark }}</el-text>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
<!-- <view class="charts-box">-->
|
||||
<!-- <qiun-data-charts :chartData="chartData" type="column"/>-->
|
||||
<!-- </view>-->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {ref, onMounted} from 'vue';
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import {getPage, getById, paigong, updateStatus, getByStatus} from "@/api/mes/plan"
|
||||
import {timestampToTime} from "@/utils/dateUtil";
|
||||
import {Tickets} from "@element-plus/icons-vue";
|
||||
import modal from "@/plugins/modal";
|
||||
import tab from "@/plugins/tab";
|
||||
import {showConfirm} from "@/utils/common";
|
||||
import auth from "@/plugins/auth";
|
||||
const userStore = useUserStore()
|
||||
const startList = ref([]);
|
||||
const paigongList = ref([]);
|
||||
const pauseList = ref([]);
|
||||
const planList = ref([]);
|
||||
const chartData = ref({});
|
||||
|
||||
onMounted(() => {
|
||||
getServerData()
|
||||
getPlanList()
|
||||
});
|
||||
function getServerData() {
|
||||
// 模拟从服务器获取数据时的延时
|
||||
setTimeout(() => {
|
||||
let res = {
|
||||
categories: ['2016', '2017', '2018', '2019', '2020', '2021'],
|
||||
series: [
|
||||
{
|
||||
name: '目标值',
|
||||
data: [35, 36, 31, 33, 13, 34],
|
||||
},
|
||||
{
|
||||
name: '完成量',
|
||||
data: [18, 27, 21, 24, 6, 28],
|
||||
},
|
||||
],
|
||||
};
|
||||
chartData.value = JSON.parse(JSON.stringify(res));
|
||||
}, 500);
|
||||
}
|
||||
// 加载列表数据
|
||||
function getPlanList() {
|
||||
getByStatus(0).then(response => {
|
||||
planList.value = response.data
|
||||
})
|
||||
getByStatus(1).then(response => {
|
||||
paigongList.value = response.data
|
||||
})
|
||||
getByStatus(2).then(response => {
|
||||
startList.value = response.data
|
||||
})
|
||||
getByStatus(3).then(response => {
|
||||
pauseList.value = response.data
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
/** 开工 */
|
||||
function updatePlan(id, planCode, type){
|
||||
let content = '确定['
|
||||
if(type==='start')content= content+'开工]' + planCode +'?'
|
||||
else if(type==='end')content= content+'完工]'+ planCode +'?'
|
||||
else if(type==='pause')content= content+'暂停]'+ planCode +'?'
|
||||
showConfirm(content).then(res => {
|
||||
if (res.confirm) {
|
||||
const data = {'id':id, 'code':type}
|
||||
updateStatus(data).then(response => {
|
||||
console.log(response)
|
||||
getPlanList()
|
||||
})
|
||||
modal.msgSuccess("操作成功")
|
||||
}
|
||||
})
|
||||
}
|
||||
//看进度
|
||||
function planProgress(plan){
|
||||
tab.navigateTo('/page_report/planProgress',plan)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.title {
|
||||
font-size: 36rpx;
|
||||
color: #8f8f94;
|
||||
}
|
||||
.charts-box {
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,79 @@
|
||||
|
||||
const COLOR = [
|
||||
"#EE6A66", "#6BC588", "#FFC300", "#24ABFD"
|
||||
];
|
||||
|
||||
var ISCANVAS2D = true;
|
||||
|
||||
switch (uni.getSystemInfoSync().platform) {
|
||||
case 'android':
|
||||
ISCANVAS2D = true
|
||||
break;
|
||||
case 'ios':
|
||||
ISCANVAS2D = true
|
||||
break;
|
||||
default:
|
||||
ISCANVAS2D = false
|
||||
break;
|
||||
}
|
||||
|
||||
const RESPOND = {
|
||||
success: 0,
|
||||
warn: 301,
|
||||
error: 500,
|
||||
};
|
||||
|
||||
const TIMEARRAY = [
|
||||
{
|
||||
text: '当天',
|
||||
value: 'today'
|
||||
},
|
||||
{
|
||||
text: '昨天',
|
||||
value: 'yesterday'
|
||||
},
|
||||
{
|
||||
text: '本周',
|
||||
value: 'week'
|
||||
},
|
||||
{
|
||||
text: '上周',
|
||||
value: 'weeklast'
|
||||
},
|
||||
{
|
||||
text: '本月',
|
||||
value: 'month'
|
||||
},
|
||||
{
|
||||
text: '上月',
|
||||
value: 'monthlast'
|
||||
},
|
||||
{
|
||||
text: '指定日期',
|
||||
value: 'auto'
|
||||
}
|
||||
];
|
||||
const TABLIST = [
|
||||
{name:"企业微信",type:"WECHAT"},
|
||||
{name:"会员运营",type:"OPERATE"},
|
||||
{name:"会员健康",type:"GJJK"},
|
||||
{name:"会员服务",type:"SERVICE"},
|
||||
];
|
||||
|
||||
const CARD_MENU = [
|
||||
{title:"会员报表中心",author:"howcode",img:"https://s1.ax1x.com/2023/03/31/ppRp4iV.jpg",url:"/myPackageA/pages/main/index"},
|
||||
{title:"智慧教育报表中心",author:"howcode",img:"https://s1.ax1x.com/2023/03/31/ppRp5GT.jpg",url:"/myPackageA/pages/school/index"},
|
||||
{title:"差旅报表中心",author:"秋云",img:"https://s1.ax1x.com/2023/03/31/ppRpfI0.jpg",url:""},
|
||||
{title:"运动报表中心",author:"howcode",img:"https://s1.ax1x.com/2023/03/31/ppRpWaq.jpg",url:"/myPackageA/pages/sport/index"},
|
||||
{title:"财务报表中心",author:"howcode",img:"https://s1.ax1x.com/2023/03/31/ppRpozF.jpg",url:"/myPackageA/pages/finance/index"},
|
||||
]
|
||||
|
||||
|
||||
export default {
|
||||
COLOR,
|
||||
TIMEARRAY,
|
||||
TABLIST,
|
||||
RESPOND,
|
||||
ISCANVAS2D,
|
||||
CARD_MENU
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
{
|
||||
"sumNumber":{
|
||||
"categories": [],
|
||||
"series": [
|
||||
{
|
||||
"name": "总数",
|
||||
"data": [],
|
||||
"type": "line",
|
||||
"style": "curve",
|
||||
"color": "#4ECDB6",
|
||||
"unit":""
|
||||
}
|
||||
],
|
||||
"yAxis":[
|
||||
{"calibration":true,"position":"left","titleFontSize":12,"unit":"","tofix":0,"min":0,"disableGrid":true}
|
||||
]
|
||||
},
|
||||
"totalQualityNumber":{
|
||||
"categories": [],
|
||||
"series": [
|
||||
{
|
||||
"name": "合格数",
|
||||
"data": [],
|
||||
"type": "line",
|
||||
"style": "curve",
|
||||
"color": "#4ECDB6",
|
||||
"unit":""
|
||||
}
|
||||
],
|
||||
"yAxis":[
|
||||
{"calibration":true,"position":"left","titleFontSize":12,"unit":"","tofix":0,"min":0,"disableGrid":true}
|
||||
]
|
||||
},
|
||||
"totalWasteNumber":{
|
||||
"categories": [
|
||||
"1月",
|
||||
"2月",
|
||||
"2月",
|
||||
"4月",
|
||||
"5月"
|
||||
],
|
||||
"series": [
|
||||
{
|
||||
"name": "废品数",
|
||||
"data": [],
|
||||
"type": "line",
|
||||
"style": "curve",
|
||||
"color": "#4ECDB6",
|
||||
"unit":""
|
||||
}
|
||||
],
|
||||
"yAxis":[
|
||||
{"calibration":true,"position":"left","titleFontSize":12,"unit":"","tofix":0,"min":0,"disableGrid":true}
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,370 @@
|
||||
<template>
|
||||
<view>
|
||||
<u-sticky
|
||||
class="sticky"
|
||||
:custom-nav-height="0"
|
||||
>
|
||||
<u-navbar
|
||||
title="生产计划"
|
||||
bg-color="transparent"
|
||||
:auto-back="false"
|
||||
:title-style="{ fontWeight: 'bold' }"
|
||||
left-icon=""
|
||||
safe-area-inset-top
|
||||
placeholder
|
||||
/>
|
||||
<u-tabs
|
||||
:list="menuList"
|
||||
:current="current"
|
||||
key-name="name"
|
||||
:scrollable="false"
|
||||
:active-style="{
|
||||
color: '#0E85FF',
|
||||
}"
|
||||
@change="change"
|
||||
>
|
||||
</u-tabs>
|
||||
</u-sticky>
|
||||
<uni-notice-bar show-icon scrollable text="安全生产!有序生产!高效生产!" />
|
||||
<!-- 开工中-->
|
||||
<view v-if="current === 0" class="container" >
|
||||
<u-list>
|
||||
<u-list-item
|
||||
v-for="item in startList"
|
||||
:key="item"
|
||||
>
|
||||
<view class="content">
|
||||
<view class="header">
|
||||
<view class="title">
|
||||
<u-image
|
||||
src="@/static/images/icon/product.png"
|
||||
width="40rpx"
|
||||
height="40rpx"
|
||||
/>
|
||||
<u-text type="primary" :text=" item.productName" class="u-m-l-10"> </u-text>
|
||||
</view>
|
||||
<view><u-text type="success" :text="item.code"></u-text></view>
|
||||
</view>
|
||||
<view class="u-flex u-flex-between u-m-t-30">
|
||||
<u-text :text="`计划数: ${ item.planNumber }`" size="13"></u-text>
|
||||
<u-text :text="`入库数: ${ item.finishNumber }`" size="13"></u-text>
|
||||
</view>
|
||||
<view class="u-flex u-flex-between u-m-t-30">
|
||||
<u-text :text="`计划开始时间: ${ timestampToTime(item.planStartTime) }`" size="13"></u-text>
|
||||
<u-text :text="`计划结束时间: ${ timestampToTime(item.planEndTime) }`" size="13"></u-text>
|
||||
</view>
|
||||
<view class="text">
|
||||
<u-text text="备注:" size="13"/>
|
||||
</view>
|
||||
<view class="remark">
|
||||
<u-text :text="item.remark"></u-text>
|
||||
</view>
|
||||
<view class="u-m-t-30 u-m-b-30"><u-line/></view>
|
||||
<view class="u-flex justify-end">
|
||||
<view v-if="auth.hasPermi('mes:plan:update')" class="u-m-r-30">
|
||||
<u-button type="success" plain @click="updatePlan(item.id, item.code,'end')">完工</u-button>
|
||||
</view>
|
||||
<view v-if="auth.hasPermi('mes:plan:update')" class="u-m-r-30">
|
||||
<u-button type="error" plain @click="updatePlan(item.id,item.code,'pause')">暂停</u-button>
|
||||
</view>
|
||||
<view>
|
||||
<u-button type="info" plain @click="planProgress(item)">进度</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-list-item>
|
||||
</u-list>
|
||||
</view>
|
||||
<!-- 派工中-->
|
||||
<view v-if="current === 1" class="container" >
|
||||
<u-list>
|
||||
<u-list-item
|
||||
v-for="item in dispatch"
|
||||
:key="item"
|
||||
>
|
||||
<view class="content">
|
||||
<view class="header">
|
||||
<view class="title">
|
||||
<u-image
|
||||
src="@/static/images/icon/product.png"
|
||||
width="40rpx"
|
||||
height="40rpx"
|
||||
/>
|
||||
<u-text type="primary" :text=" item.productName" class="u-m-l-10"> </u-text>
|
||||
</view>
|
||||
<view><u-text type="success" :text="item.code"></u-text></view>
|
||||
</view>
|
||||
<view class="u-flex u-flex-between u-m-t-30">
|
||||
<u-text :text="`计划数: ${ item.planNumber }`" size="13"></u-text>
|
||||
<u-text :text="`入库数: ${ item.finishNumber }`" size="13"></u-text>
|
||||
</view>
|
||||
<view class="u-flex u-flex-between u-m-t-30">
|
||||
<u-text :text="`计划开始时间: ${ timestampToTime(item.planStartTime) }`" size="13"></u-text>
|
||||
<u-text :text="`计划结束时间: ${ timestampToTime(item.planEndTime) }`" size="13"></u-text>
|
||||
</view>
|
||||
<view class="text">
|
||||
<u-text text="备注:" size="13"/>
|
||||
</view>
|
||||
<view class="remark">
|
||||
<u-text :text="item.remark"></u-text>
|
||||
</view>
|
||||
<view class="u-m-t-30 u-m-b-30"><u-line/></view>
|
||||
<view class="u-flex justify-end">
|
||||
<view v-if="auth.hasPermi('mes:plan:update')">
|
||||
<u-button type="info" plain @click="updatePlan(item.id,item.code, 'start')">开工</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-list-item>
|
||||
</u-list>
|
||||
</view>
|
||||
<!--计划中-->
|
||||
<view v-if="current === 2" class="container" >
|
||||
<u-list>
|
||||
<u-list-item
|
||||
v-for="item in planList"
|
||||
:key="item"
|
||||
>
|
||||
<view class="content">
|
||||
<view class="header">
|
||||
<view class="title">
|
||||
<u-image
|
||||
src="@/static/images/icon/product.png"
|
||||
width="40rpx"
|
||||
height="40rpx"
|
||||
/>
|
||||
<u-text type="primary" :text=" item.productName" class="u-m-l-10"> </u-text>
|
||||
</view>
|
||||
<view><u-text type="success" :text="item.code"></u-text></view>
|
||||
</view>
|
||||
<view class="u-flex u-flex-between u-m-t-30">
|
||||
<u-text :text="`计划数: ${ item.planNumber }`" size="13"></u-text>
|
||||
<u-text :text="`入库数: ${ item.finishNumber }`" size="13"></u-text>
|
||||
</view>
|
||||
<view class="u-flex u-flex-between u-m-t-30">
|
||||
<u-text :text="`计划开始时间: ${ timestampToTime(item.planStartTime) }`" size="13"></u-text>
|
||||
<u-text :text="`计划结束时间: ${ timestampToTime(item.planEndTime) }`" size="13"></u-text>
|
||||
</view>
|
||||
<view class="text">
|
||||
<u-text text="备注:" size="13"/>
|
||||
</view>
|
||||
<view class="remark">
|
||||
<u-text :text="item.remark"></u-text>
|
||||
</view>
|
||||
<view class="u-m-t-30 u-m-b-30"><u-line/></view>
|
||||
<view class="u-flex justify-end">
|
||||
<view v-if="auth.hasPermi('mes:plan:update')">
|
||||
<u-button type="primary" plain>派工</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-list-item>
|
||||
</u-list>
|
||||
</view>
|
||||
<!-- 暂停中 -->
|
||||
<view v-if="current === 3" class="container" >
|
||||
<u-list>
|
||||
<u-list-item
|
||||
v-for="item in pauseList"
|
||||
:key="item"
|
||||
>
|
||||
<view class="content">
|
||||
<view class="header">
|
||||
<view class="title">
|
||||
<u-image
|
||||
src="@/static/images/icon/product.png"
|
||||
width="40rpx"
|
||||
height="40rpx"
|
||||
/>
|
||||
<u-text type="primary" :text=" item.productName" class="u-m-l-10"> </u-text>
|
||||
</view>
|
||||
<view><u-text type="success" :text="item.code"></u-text></view>
|
||||
</view>
|
||||
<view class="u-flex u-flex-between u-m-t-30">
|
||||
<u-text :text="`计划数: ${ item.planNumber }`" size="13"></u-text>
|
||||
<u-text :text="`入库数: ${ item.finishNumber }`" size="13"></u-text>
|
||||
</view>
|
||||
<view class="u-flex u-flex-between u-m-t-30">
|
||||
<u-text :text="`计划开始时间: ${ timestampToTime(item.planStartTime) }`" size="13"></u-text>
|
||||
<u-text :text="`计划结束时间: ${ timestampToTime(item.planEndTime) }`" size="13"></u-text>
|
||||
</view>
|
||||
<view class="text">
|
||||
<u-text text="备注:" size="13"/>
|
||||
</view>
|
||||
<view class="remark">
|
||||
<u-text :text="item.remark"></u-text>
|
||||
</view>
|
||||
<view class="u-m-t-30 u-m-b-30"><u-line/></view>
|
||||
<view class="u-flex justify-end">
|
||||
<view v-if="auth.hasPermi('mes:plan:update')" :span="4" class="u-m-r-30">
|
||||
<u-button type="info" plain @click="updatePlan(item.id, item.code,'start')">开工</u-button>
|
||||
</view>
|
||||
<view v-if="auth.hasPermi('mes:plan:update')" :span="4">
|
||||
<u-button type="success" plain @click="updatePlan(item.id,item.code, 'end')">完工</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-list-item>
|
||||
</u-list>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { updateStatus, getByStatus } from "@/api/mes/plan"
|
||||
import { timestampToTime } from "@/utils/dateUtil";
|
||||
import modal from "@/plugins/modal";
|
||||
import tab from "@/plugins/tab";
|
||||
import { showConfirm } from "@/utils/common";
|
||||
import auth from "@/plugins/auth";
|
||||
|
||||
const startList = ref([]);
|
||||
const dispatch = ref([]);
|
||||
const pauseList = ref([]);
|
||||
const planList = ref([]);
|
||||
const chartData = ref({});
|
||||
|
||||
const menuList = ref([
|
||||
{
|
||||
name: '开工中'
|
||||
},
|
||||
{
|
||||
name: '派工中'
|
||||
},
|
||||
{
|
||||
name: '计划中'
|
||||
},
|
||||
{
|
||||
name: '暂停中'
|
||||
}
|
||||
])
|
||||
const current = ref(0)
|
||||
const change = (index)=>{
|
||||
current.value = index.index
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getServerData()
|
||||
getPlanList()
|
||||
});
|
||||
|
||||
function getServerData() {
|
||||
// 模拟从服务器获取数据时的延时
|
||||
setTimeout(() => {
|
||||
let res = {
|
||||
categories: ['2016', '2017', '2018', '2019', '2020', '2021'],
|
||||
series: [
|
||||
{
|
||||
name: '目标值',
|
||||
data: [35, 36, 31, 33, 13, 34],
|
||||
},
|
||||
{
|
||||
name: '完成量',
|
||||
data: [18, 27, 21, 24, 6, 28],
|
||||
},
|
||||
],
|
||||
};
|
||||
chartData.value = JSON.parse(JSON.stringify(res));
|
||||
}, 500);
|
||||
}
|
||||
// 加载列表数据
|
||||
function getPlanList() {
|
||||
getByStatus(0).then(response => {
|
||||
planList.value = response.data
|
||||
})
|
||||
getByStatus(1).then(response => {
|
||||
dispatch.value = response.data
|
||||
})
|
||||
getByStatus(2).then(response => {
|
||||
startList.value = response.data
|
||||
})
|
||||
getByStatus(3).then(response => {
|
||||
pauseList.value = response.data
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
/** 开工 */
|
||||
function updatePlan(id, planCode, type){
|
||||
let content = '确定['
|
||||
if(type==='start')content= content+'开工]' + planCode +'?'
|
||||
else if(type==='end')content= content+'完工]'+ planCode +'?'
|
||||
else if(type==='pause')content= content+'暂停]'+ planCode +'?'
|
||||
showConfirm(content).then(res => {
|
||||
if (res.confirm) {
|
||||
const data = {'id':id, 'code':type}
|
||||
updateStatus(data).then(response => {
|
||||
getPlanList()
|
||||
})
|
||||
modal.msgSuccess("操作成功")
|
||||
}
|
||||
})
|
||||
}
|
||||
//看进度
|
||||
function planProgress(plan){
|
||||
tab.navigateTo('/page_report/planProgress',plan)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page {
|
||||
width: 100%
|
||||
}
|
||||
.sticky {
|
||||
background: linear-gradient(180deg, #d4e9ff 0%, #f3f9ff 100%);
|
||||
backdrop-filter: blur(27.18px);
|
||||
box-shadow: 0 1px 1px 0 rgba(0, 72, 145, 0.1),
|
||||
0 0.5px 0 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.title {
|
||||
font-size: 36rpx;
|
||||
color: #8f8f94;
|
||||
}
|
||||
.charts-box {
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
}
|
||||
.container {
|
||||
background-color: #f1f1f1;
|
||||
padding: 0 20rpx 20rpx 20rpx;
|
||||
.content {
|
||||
margin: 0 0 20rpx 0;
|
||||
padding: 20rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 10rpx;
|
||||
.header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
.flex-box {
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.text {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
.remark {
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 20rpx;
|
||||
background-color: #f5f7f9;
|
||||
border-radius: 10rpx;
|
||||
font-size: 24rpx;
|
||||
color: #555555;
|
||||
}
|
||||
.u-button {
|
||||
height: 60rpx
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<view>
|
||||
<view v-if="copyContent.length > 0" class="ranking">
|
||||
<view class="ranking-item" v-for="(content,index) in copyContent" :key="index" :style="{padding:progressPadding+'rpx'}">
|
||||
<view class="name">{{content.name}}</view>
|
||||
<view class="progress" >
|
||||
<text :style="{background:content.background,width:content.width + '%',height:progressWidth+'rpx'}"></text>
|
||||
</view>
|
||||
<view class="num">{{content.num}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default{
|
||||
name:'ranking-list',
|
||||
props:{
|
||||
content:{
|
||||
type: Array,
|
||||
default() {
|
||||
return []
|
||||
}
|
||||
},
|
||||
isPC:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
isRank:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
progressWidth:24,
|
||||
progressPadding:10,
|
||||
maxNumber:0,
|
||||
culCount:0,
|
||||
copyContent:[]
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
content(newV){
|
||||
this.init()
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
init(){
|
||||
this.copyContent = this.deepClone(this.content)
|
||||
if(this.copyContent && this.copyContent.length >0){
|
||||
if(this.isRank){
|
||||
this.copyContent = this.copyContent.sort((a,b) => b.num - a.num);
|
||||
this.maxNumber = this.copyContent[0].num;
|
||||
}else{
|
||||
this.maxNumber = Math.max.apply(Math,this.copyContent.map(item => { return item.num }));
|
||||
}
|
||||
this.copyContent.map((item,index) =>{
|
||||
item.width = this.computeWidth(this.maxNumber,item.num);
|
||||
});
|
||||
}
|
||||
},
|
||||
computeWidth(max,current){
|
||||
let num = (current / max) * 100;
|
||||
return num.toFixed(2);
|
||||
},
|
||||
deepClone(obj) {
|
||||
var cloneObj = new obj.constructor()
|
||||
if(obj === null) return obj
|
||||
if(obj instanceof Date) return new Date(obj)
|
||||
if(obj instanceof RegExp) return new RegExp(obj)
|
||||
if (typeof obj !== 'object') return obj
|
||||
for (var i in obj) {
|
||||
if (obj.hasOwnProperty(i)) {
|
||||
cloneObj[i] = this.deepClone(obj[i])
|
||||
}
|
||||
}
|
||||
return cloneObj
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if(this.isPC){
|
||||
this.progressWidth = 40;
|
||||
this.progressPadding = 30;
|
||||
}
|
||||
this.init();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.ranking-item{
|
||||
display: flex;
|
||||
margin-bottom: 13rpx;
|
||||
align-content: center;
|
||||
height: 50rpx;
|
||||
|
||||
.name{
|
||||
padding-right: 10rpx;
|
||||
color: #868688;
|
||||
font-size: 20rpx;
|
||||
flex: 1;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.progress{
|
||||
flex:5;
|
||||
text-align: left;
|
||||
padding-right: 10rpx;
|
||||
|
||||
text{
|
||||
display: inline-block;
|
||||
border-radius: 30rpx;
|
||||
vertical-align:top;
|
||||
}
|
||||
|
||||
}
|
||||
.num{
|
||||
font-size: 26rpx;
|
||||
color: #3EB2F5;
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,511 @@
|
||||
<template>
|
||||
<view class="body">
|
||||
<view class="top_head">
|
||||
<view class="text_des">
|
||||
<text class="month_num">{{ nowTime.month }}</text>
|
||||
<text class="month_text">月</text>
|
||||
<text class="month_year">{{ nowTime.year }}</text>
|
||||
<text class="point">.</text>
|
||||
<text class="title">报工报表</text>
|
||||
</view>
|
||||
<uni-data-select v-if="auth.hasPermi('mes:produce-report-detail:replace')" class="select" v-model="userId" :localdata="userList" placement="top">
|
||||
</uni-data-select>
|
||||
<view class="top_desc">
|
||||
<view>
|
||||
<view class="text">上月报工汇总</view>
|
||||
<view class="text-gray">总数</view>
|
||||
<view class="remaining">{{ lastMonthSum.sumNumber }}</view>
|
||||
<view class="row head_block">
|
||||
<view class="flex_1">
|
||||
<text class="text-gray">合格数</text>
|
||||
<text class="text_green">{{ lastMonthSum.totalQualityNumber }}</text>
|
||||
</view>
|
||||
<view class="flex_1">
|
||||
<text class="text-gray">废品数</text>
|
||||
<text class="income">{{ lastMonthSum.totalWasteNumber }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="text">本月报工汇总</view>
|
||||
<view class="text-gray">总数</view>
|
||||
<view class="remaining">{{ thisMonthSum.sumNumber }}</view>
|
||||
<view class="row head_block">
|
||||
<view class="flex_1">
|
||||
<text class="text-gray">合格数</text>
|
||||
<text class="text_green">{{ thisMonthSum.totalQualityNumber }}</text>
|
||||
</view>
|
||||
<view class="flex_1">
|
||||
<text class="text-gray">废品数</text>
|
||||
<text class="income">{{ thisMonthSum.totalWasteNumber }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="main">
|
||||
<view class="row_block">
|
||||
<view class="the_title" style="justify-content: space-between;">
|
||||
<view class="left_title">
|
||||
<view class="title_icon"></view>
|
||||
<text class="margin_stand-samll font-big wide">30天报工数据</text>
|
||||
</view>
|
||||
<view class="right_btn">
|
||||
<view v-for="(item, index) in historyBtn" :key="index" :class="item.state ? 'active_btn' : ''"
|
||||
@click="changeHistoryBtn(item.type)">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="charts-box" style="height: 200px;">
|
||||
<qiun-data-charts type="line" canvasId="finance_a" :canvas2d="isCanvas2d" :reshow="delayload"
|
||||
:opts="{ xAxis: { itemCount: historyData.length, disableGrid: true, labelCount: 5 }, yAxis: { disableGrid: true, data: [{ disabled: true }] } }"
|
||||
:chartData="historyData"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="row_block">
|
||||
<view class="the_title">
|
||||
<view class="title_icon"></view>
|
||||
<text class="margin_stand-samll font-big wide">最近30天计时列表</text>
|
||||
</view>
|
||||
<view class="detail_list">
|
||||
<view v-for="(item, index) in detailList" :key="index" class="detail_item">
|
||||
<view>
|
||||
<view class="font-middle">报工日期</view>
|
||||
<view class="font-small">{{ item.reportDay }}</view>
|
||||
</view>
|
||||
<view class="right_content">
|
||||
<view class="hour">计时时长</view>
|
||||
<view class="text-gray font-middle">{{ item.reportTime }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="end_block">
|
||||
<view class="the_title" style="margin-bottom: 40rpx;">
|
||||
<view class="title_icon"></view>
|
||||
<text class="margin_stand-samll font-big wide">本月上月计时汇总</text>
|
||||
</view>
|
||||
<view class="flex_wrap">
|
||||
<view>
|
||||
<text class="text-gray" style="margin-right: 10px">上月总计时</text>
|
||||
<text class="text_green">{{ sumReportTime.totalWasteNumber }}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="text-gray" style="margin-right: 10px">本月总计时</text>
|
||||
<text class="text_green">{{ sumReportTime.totalQualityNumber }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import dataOne from '@/pages/json/1.json';
|
||||
import { getDayReportTime, getLastMonthSum, getReportTime, getSumReportTime, getThisMonthSum } from "@/api/mes/report";
|
||||
import useUserStore from "@/store/modules/user";
|
||||
import Config from '@/pages/js/config'
|
||||
import { ref, watch } from 'vue';
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import auth from "@/plugins/auth";
|
||||
import {getOtherPersonalUser} from "@/api/mes/organization";
|
||||
|
||||
const now = new Date();
|
||||
const nowTime = {
|
||||
year: now.getFullYear(),
|
||||
month: now.getMonth() + 1,
|
||||
day: now.getDate()
|
||||
};
|
||||
|
||||
const useStore = useUserStore()
|
||||
const userId = ref()
|
||||
userId.value = useStore.userId
|
||||
const isCanvas2d = ref(Config.ISCANVAS2D)
|
||||
|
||||
let delayload = ref(false);
|
||||
let historyData = ref({});
|
||||
const reportTime = ref([])
|
||||
const lastMonthSum = ref({});
|
||||
const thisMonthSum = ref({});
|
||||
const sumReportTime = ref({})
|
||||
const detailList = ref([]);
|
||||
|
||||
const historyBtn = ref([
|
||||
{
|
||||
name: "总数",
|
||||
state: true,
|
||||
type: "sumNumber"
|
||||
},
|
||||
{
|
||||
name: "合格数",
|
||||
state: false,
|
||||
type: "totalQualityNumber"
|
||||
},
|
||||
{
|
||||
name: "废品数",
|
||||
state: false,
|
||||
type: "totalWasteNumber"
|
||||
}
|
||||
]);
|
||||
|
||||
const userList = ref([])
|
||||
|
||||
const getUserList = ()=> {
|
||||
getOtherPersonalUser().then(response => {
|
||||
userList.value = response.data
|
||||
})
|
||||
}
|
||||
const handleChange = ()=>{
|
||||
getLastMonthSumList()
|
||||
getThisMonthSumList()
|
||||
getReportTimeList()
|
||||
getSumReportTimeList()
|
||||
getDayReportTimeList()
|
||||
}
|
||||
|
||||
watch(()=>userId.value, (newValue)=> {
|
||||
if (newValue) {
|
||||
handleChange()
|
||||
}
|
||||
})
|
||||
|
||||
const changeHistoryBtn = (type) => {
|
||||
historyBtn.value.forEach(btn => {
|
||||
btn.state = false;
|
||||
});
|
||||
for (let i = 0; i < historyBtn.value.length; i++) {
|
||||
historyBtn.value[i].state = historyBtn.value[i].type === type;
|
||||
}
|
||||
if(type === 'sumNumber') {
|
||||
dataOne.sumNumber.categories = []
|
||||
dataOne.sumNumber.series[0].data = []
|
||||
reportTime.value.forEach(item => {
|
||||
dataOne.sumNumber.categories.push(`${new Date(item.reportDay).getMonth() + 1}月${new Date(item.reportDay).getDate()}日`)
|
||||
dataOne.sumNumber.series[0].data.push(item.sumNumber)
|
||||
})
|
||||
historyData.value = dataOne.sumNumber
|
||||
} else if (type === 'totalQualityNumber') {
|
||||
dataOne.totalQualityNumber.categories = []
|
||||
dataOne.totalQualityNumber.series[0].data = []
|
||||
reportTime.value.forEach(item => {
|
||||
dataOne.totalQualityNumber.categories.push(`${new Date(item.reportDay).getMonth() + 1}月${new Date(item.reportDay).getDate()}日`)
|
||||
dataOne.totalQualityNumber.series[0].data.push(item.totalQualityNumber)
|
||||
})
|
||||
historyData.value = dataOne.totalQualityNumber
|
||||
} else {
|
||||
dataOne.totalWasteNumber.categories = []
|
||||
dataOne.totalWasteNumber.series[0].data = []
|
||||
reportTime.value.forEach(item => {
|
||||
dataOne.totalWasteNumber.categories.push(`${new Date(item.reportDay).getMonth() + 1}月${new Date(item.reportDay).getDate()}日`)
|
||||
dataOne.totalWasteNumber.series[0].data.push(item.totalWasteNumber)
|
||||
})
|
||||
historyData.value = dataOne.totalWasteNumber
|
||||
}
|
||||
}
|
||||
|
||||
// 30天报工数据
|
||||
const defaultBtnIndex = ref(0)
|
||||
const getReportTimeList = async () => {
|
||||
defaultBtnIndex.value = 0;
|
||||
historyBtn.value.forEach((btn, index) => {
|
||||
btn.state = (index === defaultBtnIndex.value);
|
||||
});
|
||||
historyData.value= {}
|
||||
reportTime.value = []
|
||||
dataOne.sumNumber.categories = [];
|
||||
dataOne.sumNumber.series[0].data = [];
|
||||
const response = await getReportTime(userId.value);
|
||||
reportTime.value = response.data;
|
||||
reportTime.value.forEach(item => {
|
||||
const month = new Date(item.reportDay).getMonth() + 1;
|
||||
const day = new Date(item.reportDay).getDate();
|
||||
dataOne.sumNumber.categories.push(`${month}月${day}日`);
|
||||
dataOne.sumNumber.series[0].data.push(item.sumNumber);
|
||||
});
|
||||
historyData.value = dataOne.sumNumber;
|
||||
}
|
||||
|
||||
// 上月报工汇总
|
||||
const getLastMonthSumList = async () => {
|
||||
const response = await getLastMonthSum(userId.value);
|
||||
lastMonthSum.value = response.data;
|
||||
}
|
||||
|
||||
// 本月报工汇总
|
||||
const getThisMonthSumList = async () => {
|
||||
const response = await getThisMonthSum(userId.value);
|
||||
thisMonthSum.value = response.data;
|
||||
}
|
||||
|
||||
// 本月上月计时汇总
|
||||
const getSumReportTimeList = async () => {
|
||||
const response = await getSumReportTime(userId.value);
|
||||
sumReportTime.value = response.data;
|
||||
}
|
||||
|
||||
// 最近30天计时列表
|
||||
const getDayReportTimeList = async () => {
|
||||
const response = await getDayReportTime(userId.value);
|
||||
detailList.value = response.data;
|
||||
}
|
||||
|
||||
onLoad(() => {
|
||||
getUserList()
|
||||
getReportTimeList()
|
||||
getLastMonthSumList()
|
||||
getThisMonthSumList()
|
||||
getSumReportTimeList()
|
||||
getDayReportTimeList()
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.body {
|
||||
height: 100%;
|
||||
background-color: #f1f1f1;
|
||||
margin: 0;
|
||||
padding-bottom: 20rpx;
|
||||
|
||||
.text_green {
|
||||
color: #4ECDB6;
|
||||
}
|
||||
|
||||
.main {
|
||||
width: 100%;
|
||||
padding: 0 10rpx;
|
||||
box-sizing: border-box;
|
||||
margin-top: 20rpx;
|
||||
|
||||
.detail_list {
|
||||
height: 700rpx;
|
||||
overflow: auto;
|
||||
color: #9E9E9E;
|
||||
|
||||
.detail_item {
|
||||
display: flex;
|
||||
margin: 20rpx 0;
|
||||
align-items: center;
|
||||
.right_content {
|
||||
width: 75%;
|
||||
text-align: center;
|
||||
}
|
||||
.hour {
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.right_btn {
|
||||
float: right;
|
||||
display: flex;
|
||||
color: #ccc;
|
||||
font-size: 22rpx;
|
||||
|
||||
view {
|
||||
line-height: 50rpx;
|
||||
height: 50rpx;
|
||||
margin: 0 20rpx;
|
||||
}
|
||||
|
||||
.active_btn {
|
||||
padding: 0 20rpx;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.end_block {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
border-radius: 12rpx;
|
||||
position: relative;
|
||||
padding: 20rpx;
|
||||
.flex_wrap {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
|
||||
.row_block {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
border-radius: 12rpx;
|
||||
position: relative;
|
||||
padding: 20rpx;
|
||||
|
||||
&::after {
|
||||
content: "";
|
||||
height: 0;
|
||||
width: 92%;
|
||||
position: absolute;
|
||||
transform: translateX(-50%);
|
||||
left: 50%;
|
||||
bottom: 0;
|
||||
border-top: 1px dashed #ccc;
|
||||
}
|
||||
}
|
||||
|
||||
.the_title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.left_title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.title_icon {
|
||||
background-color: #7E7E7E;
|
||||
height: 40rpx;
|
||||
width: 10rpx;
|
||||
border-radius: 10rpx;
|
||||
margin-right: 20rpx;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
.extend_rank {
|
||||
width: 100%;
|
||||
background-color: #F5F5F5;
|
||||
box-sizing: border-box;
|
||||
padding: 10rpx;
|
||||
|
||||
.rank_item {
|
||||
width: 100%;
|
||||
margin: 20rpx 0;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
font-size: 26rpx;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
image {
|
||||
width: 10%;
|
||||
}
|
||||
|
||||
text {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.name {
|
||||
margin: 0 10rpx;
|
||||
color: #7D7D7D;
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.desc {
|
||||
width: 50%;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.money {
|
||||
width: 20%;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.top_head {
|
||||
position: relative;
|
||||
height: 495rpx;
|
||||
width: 100%;
|
||||
padding: 110rpx 10rpx 0 10rpx;
|
||||
background: url('@/static/images/icon/background.png') no-repeat center 0;
|
||||
box-sizing: border-box;
|
||||
|
||||
.select {
|
||||
position: absolute;
|
||||
width: 240rpx;
|
||||
top: 155rpx;
|
||||
right: 30rpx;
|
||||
:deep(.uni-select__input-text) {
|
||||
color: #ffffff;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.top_desc {
|
||||
width: 100%;
|
||||
border-radius: 20rpx;
|
||||
background-color: #fff;
|
||||
margin-top: 20rpx;
|
||||
padding: 20rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.text {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: #1783f2;
|
||||
margin-bottom: 10px
|
||||
}
|
||||
.text-gray {
|
||||
font-size: 28rpx;
|
||||
color: #ccc;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.remaining {
|
||||
font-size: 46rpx;
|
||||
}
|
||||
|
||||
.flex_1 {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.head_block {
|
||||
margin-top: 20rpx;
|
||||
|
||||
.income {
|
||||
color: #E34B5E;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.text_des {
|
||||
height: 100rpx;
|
||||
color: #fff;
|
||||
font-weight: 900;
|
||||
position: relative;
|
||||
margin-left: 60rpx;
|
||||
margin-bottom: 40rpx;
|
||||
|
||||
text {
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.month_num {
|
||||
font-size: 90rpx;
|
||||
}
|
||||
|
||||
.month_text {
|
||||
font-size: 56rpx;
|
||||
}
|
||||
|
||||
.month_year {
|
||||
font-size: 22rpx;
|
||||
position: absolute;
|
||||
left: 60rpx;
|
||||
top: 20rpx;
|
||||
}
|
||||
|
||||
.point {
|
||||
font-size: 40rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 40rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 691 B |
|
After Width: | Height: | Size: 874 KiB |
|
After Width: | Height: | Size: 543 B |
|
After Width: | Height: | Size: 569 B |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 501 B |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 526 B |
|
After Width: | Height: | Size: 493 B |
|
After Width: | Height: | Size: 506 B |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 712 B |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 688 B |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 791 B |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 767 B |
@ -1,4 +1,6 @@
|
||||
import { createPinia } from "pinia"
|
||||
import piniaPluginPersistedState from 'pinia-plugin-persistedstate'
|
||||
|
||||
const store = createPinia()
|
||||
store.use(piniaPluginPersistedState)
|
||||
export default store
|
||||