Compare commits

...

47 Commits
newUI ... main

Author SHA1 Message Date
HuangHuiKang 2f68f5a6bb chore:添加dockerfile和nginx 2 months ago
kkk-ops 47a6eec1bc commit 4 months ago
sunshine a4f21f07c9 fix: bug 2 years ago
sunshine 48c7103996 日期格式化 2 years ago
guopeiyu 8a2d92aa21
!20 工位安排
Merge pull request !20 from guopeiyu/guopeiyu
2 years ago
sunshine 57a6ab4d16 工位安排 2 years ago
guopeiyu 1120c34489
!19 能源设备
Merge pull request !19 from guopeiyu/guopeiyu
2 years ago
sunshine e541a43e5f 能源设备 2 years ago
guopeiyu 1792a29b2f
!18 能源设备
Merge pull request !18 from guopeiyu/guopeiyu
2 years ago
sunshine dd0d818353 能源设备 2 years ago
guopeiyu e9eec7986a
!17 移除element-plus
Merge pull request !17 from guopeiyu/guopeiyu
2 years ago
sunshine f9ad9772c2 移除element-plus 2 years ago
guopeiyu 947a4fc212
!16 样式调整
Merge pull request !16 from guopeiyu/guopeiyu
2 years ago
sunshine 6afabd42e0 样式调整 2 years ago
guopeiyu 461dddb0b8
引入持久化插件,解决刷新后丢失token,导致需要重新登录bug
Merge pull request !15 from guopeiyu/guopeiyu
2 years ago
sunshine fc7167246d 引入持久化插件,解决刷新后丢失token,导致需要重新登录bug 2 years ago
sunshine 81ce913696 fix: 报工页面使用el-button的bug 2 years ago
guopeiyu 4974f02a8d
!14 fix: 新增后页面没有刷新bug以及投料页面详情不显示bug。
Merge pull request !14 from guopeiyu/guopeiyu
2 years ago
sunshine 28ae1cd079 fix: 新增后页面没有刷新bug以及投料页面详情不显示bug。 2 years ago
guopeiyu cab3cba37c
!13 报工报表添加用户选择
Merge pull request !13 from guopeiyu/guopeiyu
2 years ago
sunshine 018010a937 30天报工数据 2 years ago
guopeiyu d69c1ac7d6
!12 30天报工数据
Merge pull request !12 from guopeiyu/guopeiyu
2 years ago
sunshine fce93bddd4 30天报工数据 2 years ago
guopeiyu 4c0bc9fff3
!11 报工报表接口对接,投料bug修复
Merge pull request !11 from guopeiyu/guopeiyu
2 years ago
sunshine 226b2d295e 报工报表接口对接,投料bug修复 2 years ago
guopeiyu 16f59c10be
!10 投料bug修复,页面样式调整
Merge pull request !10 from guopeiyu/guopeiyu
2 years ago
sunshine 1baaf3556b 投料bug修复,页面样式调整 2 years ago
guopeiyu a6c783b127
!9 新增报工页面样式调整
Merge pull request !9 from guopeiyu/guopeiyu
2 years ago
sunshine d75dcb015c 新增报工页面样式调整 2 years ago
guopeiyu 1549c39821
!8 fix: 生产报工bug
Merge pull request !8 from guopeiyu/guopeiyu
2 years ago
sunshine 206fd98524 fix: 生产报工bug 2 years ago
guopeiyu 4c98ce1cb0
!7 fix: 计划进度bug
Merge pull request !7 from guopeiyu/guopeiyu
2 years ago
sunshine 89e9a63dfb fix: 计划进度bug 2 years ago
guopeiyu 4fade454c1
!6 1.生产计划样式调整; 2.修复小程序中,按钮点击无效bug,请使用u-button, el-button小程序无法使用。
Merge pull request !6 from guopeiyu/guopeiyu
2 years ago
sunshine ad6ea92473 1.生产计划样式调整;
2.修复小程序中,按钮点击无效bug,请使用u-button,el-button小程序无法使用
2 years ago
guopeiyu 57215aae78
!5 生产计划样式调整
Merge pull request !5 from guopeiyu/guopeiyu
2 years ago
sunshine 3c230ed76a 生产计划样式调整 2 years ago
guopeiyu b41b2a243d
!4 修复白屏问题
Merge pull request !4 from guopeiyu/guopeiyu
2 years ago
sunshine 3516636669 修复白屏问题 2 years ago
guopeiyu 1d80b171d6
!3 fix: 控制台报错
Merge pull request !3 from guopeiyu/guopeiyu
2 years ago
sunshine f298f375a2 fix: 控制台报错 2 years ago
guopeiyu 42af1d83fd
!2 navbar添加背景色
Merge pull request !2 from guopeiyu/guopeiyu
2 years ago
sunshine d3fc4183f0 navbar添加背景色 2 years ago
guopeiyu 8d11f83d70
!1 样式调整
Merge pull request !1 from guopeiyu/guopeiyu
2 years ago
sunshine 6e6fd66eb0 navbar添加背景色 2 years ago
sunshine e2b96c0c12 登录页背景,导航栏图标更换 2 years ago
chenshuichuan 90dc46c2a1 fix bug 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;
}
}

@ -56,15 +56,14 @@
"@dcloudio/uni-mp-xhs": "3.0.0-4020320240708001",
"@dcloudio/uni-quickapp-webview": "3.0.0-4020320240708001",
"@dcloudio/uni-ui": "^1.5.6",
"@element-plus/icons-vue": "^2.3.1",
"@jridgewell/sourcemap-codec": "^1.4.15",
"@qiun/wx-ucharts": "2.5.0-20230101",
"@ttou/uview-typings": "^2.0.5",
"clipboard": "^2.0.11",
"dayjs": "^1.11.9",
"element-plus": "^2.7.6",
"mqtt": "4.1.0",
"pinia": "2.0.17",
"pinia": "2.0.28",
"pinia-plugin-persistedstate": "^3.1.0",
"tslib": "^2.6.2",
"uview-plus": "^3.1.45",
"vue": "3.4.23",

@ -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'
})
}

@ -1,4 +1,3 @@
import request from '@/utils/request'

@ -61,3 +61,43 @@ export function deleteByReportId(id) {
method: 'delete'
})
}
// 30天报工数据
export function getReportTime(id) {
return request({
url: '/admin-api/mes/app/product/get30DaysReportList?userId='+id,
method: 'get'
})
}
// 上月报工汇总
export function getLastMonthSum(id) {
return request({
url: '/admin-api/mes/app/product/getLastMonthSum?userId='+id,
method: 'get'
})
}
// 本月报工汇总
export function getThisMonthSum(id) {
return request({
url: '/admin-api/mes/app/product/getThisMonthSum?userId='+id,
method: 'get'
})
}
// 本月上月计时汇总
export function getSumReportTime(id) {
return request({
url: '/admin-api/mes/app/product/getSumReportTime?userId='+id,
method: 'get'
})
}
// 最近30天计时列表
export function getDayReportTime(id) {
return request({
url: '/admin-api/mes/app/product/getDay30ReportTime?userId='+id,
method: 'get'
})
}

@ -51,6 +51,22 @@ export function delData(dictCode) {
})
}
//
export const deviceTypes=[
{text: '电表', value: '电表'},
{text: '水表', value: '水表'},
{text: '燃气表', value: '燃气表'},
]
export const organizationalStatus=[
{text: '关闭', value: 'close'},
{text: '空闲', value: 'free'},
{text: '使用', value: 'inuse'},
]
export const isEnable=[
{text: '是', value: true},
{text: '否', value: false},
]
export const processTypes = [
{text: '制浆', value: 'zhijiang'}, {text: '成型', value: 'chengxing'},
{text: '烘干', value: 'honggan'}, {text: '转移', value: 'zhuanyi'},
@ -72,4 +88,4 @@ export const feedingTypes = [
export function findTextByValue(enums,value){
const foundItem = enums.find(item => item.value === value);
return foundItem ? foundItem.text : null;
}
}

@ -1,7 +1,7 @@
// 应用全局配置
const config = {
// baseUrl: 'http://47.106.185.127:48080',127.0.0.1
baseUrl: 'http://47.106.185.127:48080',
baseUrl: 'http://localhost:48081',
// 应用信息
appInfo: {
// 应用名称

@ -2,15 +2,8 @@ import App from './App.vue'
import plugins from './plugins'
import store from './store'
import uviewPlus from 'uview-plus'
import ElementPlus from 'element-plus' //添加
import 'element-plus/dist/index.css' //添加
import locale from "element-plus/es/locale/lang/zh-cn"
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import { createSSRApp } from 'vue'
import directive from './directive' // directive
import { useDict } from '@/utils/dict'
import { parseTime, resetForm, addDateRange, handleTree, selectDictLabel, selectDictLabels } from '@/utils/ruoyi'
@ -21,10 +14,6 @@ export function createApp() {
app.use(store)
app.use(uviewPlus)
app.use(plugins)
app.use(ElementPlus, {locale})
for (const [key, component] of Object.entries(ElementPlusIconsVue)){
app.component(key, component)
}
directive(app)
// 全局方法挂载

@ -1,12 +1,24 @@
<template>
<view class="container">
<view class="example">
<uni-forms ref="customForm" :rules="customRules" labelWidth="60px" :modelValue="formData">
<uni-forms-item label="制浆线" required name="feedingPipeline">
<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 ref="customForm" :rules="customRules" labelWidth="80px" :modelValue="formData">
<uni-forms-item label="制浆线" required name="feedingPipeline" class="u-flex align-center">
<uni-data-checkbox v-model="formData.feedingPipeline" :localdata="pipelineTypes()" />
</uni-forms-item>
<uni-forms-item label="投料类型" required name="feedingType">
<uni-forms-item label="投料类型" required name="feedingType" class="u-flex align-center">
<uni-data-checkbox v-model="formData.feedingType" :localdata="feedingTypes()" @change="handleTypeChange"/>
</uni-forms-item>
<uni-forms-item v-if="formData.feedingType==='wet' || formData.feedingType==='dry'" label="重量/kg" name="weight">
@ -15,37 +27,39 @@
<uni-forms-item label="备注" name="remark">
<uni-easyinput v-model="formData.remark" placeholder="" />
</uni-forms-item>
<uni-group title="card 模式" mode="card" v-for="(item,index) in formData.productList" :key="item.id"
:name="['productList',index,'value']">
<uni-group title="card 模式" mode="card" v-for="(item,index) in formData.feedingRecordDetails" :key="item.id"
:name="['feedingRecordDetails',index,'value']">
<template v-slot:title>
<view class="uni-group-title">
<uni-row>
<uni-col :span="18">
<uni-col :span="22">
<uni-forms-item label="原料" required name="itemId">
<uni-data-select placement="top" v-model="formData.productList[index].itemId" :localdata="itemList"></uni-data-select>
<uni-data-select placement="top" v-model="formData.feedingRecordDetails[index].itemId" :localdata="itemList"></uni-data-select>
</uni-forms-item>
</uni-col>
<uni-col :span="6" align="center">
<uni-col :span="2" class="u-p-t-10">
<uni-icons type="trash" size="25" color="red" @click="del(item.id)"></uni-icons>
</uni-col>
</uni-row>
</view>
</template>
<uni-forms-item label="单位" required name="unitId">
<uni-data-select v-model="formData.productList[index].unitId" :localdata="unitList"></uni-data-select>
<uni-data-select v-model="formData.feedingRecordDetails[index].unitId" :localdata="unitList"></uni-data-select>
</uni-forms-item>
<uni-forms-item label="数量" required name="weight">
<uni-easyinput type="number" v-model="formData.productList[index].weight"/>
<uni-easyinput type="number" v-model="formData.feedingRecordDetails[index].weight"/>
</uni-forms-item>
</uni-group>
</uni-forms>
<view class="button-group">
<button v-if="formData.feedingType==='org'" type="primary" size="mini" @click="add">
<uni-icons type="plus" size="15"></uni-icons>
添加原料
</button>
<button type="primary" size="mini" @click="submit('customForm')"></button>
<view class="u-flex justify-end">
<view class="u-flex u-m-t-30">
<u-button v-if="formData.feedingType==='org'" type="primary" @click="add" class="u-m-r-30">
<uni-icons type="plus" class="u-m-r-10"/> 添加原料
</u-button>
<u-button type="success" @click="submit('customForm')">
<uni-icons type="checkbox" class="u-m-r-10"/>保存
</u-button>
</view>
</view>
</view>
</view>
@ -67,15 +81,15 @@ export default {
id: undefined,
feedingPipeline: undefined,
feedingType: undefined,
weight: undefined,
weight: 0,
remark: undefined,
productList: []
feedingRecordDetails: []
},
//
customRules: {
feedingPipeline: {rules: [{required: true, errorMessage: '姓名不能为空'}]},
feedingType: {rules: [{required: true, errorMessage: '工位不能为空'}]},
productList: {rules: [
feedingRecordDetails: {rules: [
{format: 'array', errorMessage: '产品列表格式错误'},
{validateFunction: function(rule, value, data, callback) {
if (value.length < 2) {
@ -105,10 +119,10 @@ export default {
submit(ref) {
this.$refs[ref].validate().then(res => {
var ok = 1;
if(this.formData.productList && this.formData.productList.length > 0) {
for (let i = 0; i < this.formData.productList.length; i++) {
if(!this.formData.productList[i].itemId || this.formData.productList[i].itemId===''
|| !this.formData.productList[i].weight|| this.formData.productList[i].weight <= 0) {
if(this.formData.feedingRecordDetails && this.formData.feedingRecordDetails.length > 0) {
for (let i = 0; i < this.formData.feedingRecordDetails.length; i++) {
if(!this.formData.feedingRecordDetails[i].itemId || this.formData.feedingRecordDetails[i].itemId===''
|| !this.formData.feedingRecordDetails[i].weight|| this.formData.feedingRecordDetails[i].weight <= 0) {
ok = 0;
uni.showToast({
title: `原料信息不能为空!`,
@ -124,18 +138,17 @@ export default {
create(this.formData).then(response => {
modal.msgSuccess("保存成功")
tab.navigateBack()
uni.$emit('saveDraft', true)
})
}
})
}
}).catch(err => {
console.log('err', err);
})
}).catch(err => {})
},
handleTypeChange(e){
this.formData.feedingType =e.detail.value;
if(this.formData.feedingType === 'wet' || this.formData.feedingType==='dry'){
this.formData.productList = []
this.formData.feedingRecordDetails = []
}
},
getItemList() {
@ -147,7 +160,7 @@ export default {
})
},
add() {
this.formData.productList.push({
this.formData.feedingRecordDetails.push({
id: Date.now(),
itemId: undefined,
unitId: 3,
@ -155,15 +168,21 @@ export default {
})
},
del(id) {
let index = this.formData.productList.findIndex(v => v.id === id)
this.formData.productList.splice(index, 1)
let index = this.formData.feedingRecordDetails.findIndex(v => v.id === id)
this.formData.feedingRecordDetails.splice(index, 1)
}
}
}
</script>
<style lang="scss">
.example {
<style lang="scss" 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: 15px;
background-color: #fff;
}
@ -182,7 +201,21 @@ export default {
margin-left: 10px;
}
.uni-group-title{
padding-top: 5px;
background-color: #f4c7c7;
height: 55px;
padding: 10px;
background: linear-gradient(180deg, #d4e9ff 0%, #f3f9ff 100%);
}
.uni-group--card {
margin :0
}
.uniui-plus:before{
color: #ffffff
}
.uniui-checkbox:before{
color: #ffffff
}
.u-button {
height: 35px;
width: auto;
}
</style>

@ -0,0 +1,326 @@
<template>
<view class="container">
<uni-card :is-shadow="false" is-full>
<text class="uni-h6">如个人无法填报请寻找主管代为报工</text>
</uni-card>
<view class="example">
<!-- 自定义表单校验 -->
<uni-forms ref="customForm" :rules="customRules" labelWidth="60px" :modelValue="customFormData">
<uni-forms-item label="工序" required name="orgType">
<uni-data-checkbox disabled v-model="customFormData.orgType" :localdata="processTypes()" @change="handleOrgTypeChange" />
</uni-forms-item>
<uni-forms-item label="班别" required name="groupType">
<uni-data-checkbox disabled v-model="customFormData.groupType" :localdata="groupTypes()" />
</uni-forms-item>
<uni-forms-item label="日期" required name="reportDateString">
<uni-datetime-picker disabled v-model="customFormData.reportDateString" type="date" :clear-icon="true" @change="maskClick" />
</uni-forms-item>
<uni-forms-item label="工位" required name="orgId">
<uni-data-select disabled v-model="customFormData.orgId" :localdata="orgIdList"></uni-data-select>
</uni-forms-item>
<uni-forms-item label="计时时段" name="reportTime">
<uni-easyinput disabled type="text" v-model="customFormData.reportTime" placeholder="如:8:00-12:00" />
</uni-forms-item>
<uni-forms-item label="总计时/h" required name="totalTime">
<uni-easyinput disabled type="number" v-model="customFormData.totalTime" placeholder="" />
</uni-forms-item>
<uni-group title="card 模式" mode="card" v-for="(item,index) in customFormData.produceReportDetails" :key="item.id"
:name="['produceReportDetails',index,'value']">
<template v-slot:title>
<view class="uni-group-title">
<uni-row>
<uni-col :span="20">
<uni-forms-item label="产品" required name="planId">
<uni-data-select disabled v-model="customFormData.produceReportDetails[index].planId" :localdata="planProductList"></uni-data-select>
</uni-forms-item>
</uni-col>
<uni-col :span="4" align="center">
<!-- <button class="button" size="mini" type="warn" @click="del(item.id)"></button>-->
<!-- <uni-icons type="trash" size="25" color="red" @click="del(item.id)"></uni-icons>-->
</uni-col>
</uni-row>
</view>
</template>
<uni-row>
<uni-col :span="12">
<uni-forms-item label="成品数" required name="qualityNumber">
<uni-easyinput disabled type="number" v-model="customFormData.produceReportDetails[index].qualityNumber" @change="changeNumber(item.id)"/>
</uni-forms-item>
</uni-col>
<uni-col :span="12">
<uni-forms-item label="废品数" name="wasteNumber">
<uni-easyinput disabled type="number" v-model="customFormData.produceReportDetails[index].wasteNumber" @change="changeNumber(item.id)"/>
</uni-forms-item>
</uni-col>
</uni-row>
<uni-row>
<uni-col :span="12">
<uni-forms-item label="总数" name="totalNumber">
<uni-easyinput disabled v-model="customFormData.produceReportDetails[index].totalNumber" placeholder="" />
</uni-forms-item>
</uni-col>
<uni-col :span="12">
<uni-forms-item label="成品率%" required name="qualityRate">
<uni-easyinput disabled type="number" v-model="customFormData.produceReportDetails[index].qualityRate" />
</uni-forms-item>
</uni-col>
</uni-row>
<uni-row>
<uni-col :span="12">
<uni-forms-item label="打包数" name="packageNumber">
<uni-easyinput disabled type="number" v-model="customFormData.produceReportDetails[index].packageNumber" />
</uni-forms-item>
</uni-col>
<uni-col :span="12">
<uni-forms-item label="备注" name="remark">
<uni-easyinput disabled type="text" v-model="customFormData.produceReportDetails[index].remark" />
</uni-forms-item>
</uni-col>
</uni-row>
</uni-group>
</uni-forms>
<view class="button-group">
<!-- <button type="primary" size="mini" @click="add">-->
<!-- <uni-icons type="plus" size="15"></uni-icons>-->
<!-- 新增产品-->
<!-- </button>-->
<button type="primary" size="mini" @click="handleBack"></button>
</view>
</view>
</view>
</template>
<script>
import useUserStore from "@/store/modules/user";
import {processTypes, groupTypes} from "@/api/system/dict/data";
import {getOrgList, getProductList, createReport, getPlanProductList} from "@/api/mes/organization"
import {getCurrentDate, timestampToTime} from "@/utils/dateUtil"
import {showConfirm} from "@/utils/common";
import tab from "@/plugins/tab";
import modal from "@/plugins/modal";
import {getById, getDetailByReportId, update} from "@/api/mes/report";
export default {
components: {},
data() {
return {
//
customFormData: {
id: undefined,
name: this.getUserInfo().name,
userId: this.getUserInfo().userId,
orgId: undefined,
orgType: undefined,
reportTime: undefined,
totalTime: 0,
reportStatus: undefined,
remark: undefined,
groupType: undefined,
reportType: undefined,
reportDateString: getCurrentDate(),
reportDate: undefined,
produceReportDetails: []
},
//
customRules: {
userId: {rules: [{required: true, errorMessage: '姓名不能为空'}]},
orgId: {rules: [{required: true, errorMessage: '工位不能为空'}]},
orgType: {rules: [{required: true, errorMessage: '工序不能为空'}]},
reportDateString: {rules: [{required: true, errorMessage: '报工日期不能为空'}]},
totalTime: {rules: [{required: true, errorMessage: '总计时不能为空'},
{format: 'number', errorMessage: '总计时格式错误,应填计时小时数'}]},
groupType: {rules: [{required: true, errorMessage: '班别不能为空'}]},
produceReportDetails: {rules: [
{format: 'array', errorMessage: '产品列表格式错误'},
{validateFunction: function(rule, value, data, callback) {
if (value.length < 2) {
callback('产品信息不能为空')
}
return true
}
}]
}
},
orgIdList:[],
planProductList:[],
updateId: undefined
}
},
computed: {
},
onLoad() {
this.getOrgIdList()
// this.getPlanProductList()
this.updateId = tab.getParams()
if(this.updateId){
this.disableEnable = true
//
getById(this.updateId).then(response => {
this.customFormData = response.data
this.customFormData.reportDateString = timestampToTime(this.customFormData.reportDate)
getDetailByReportId(this.updateId).then(res => {
this.customFormData.produceReportDetails = res.data
})
this.getPlanProductList()
})
}
},
onReady() {
//
this.$refs.customForm.setRules(this.customRules)
},
methods: {
getUserInfo() {
return useUserStore()
},
processTypes() {
return processTypes
},
groupTypes() {
return groupTypes
},
submit(ref) {
if(this.customFormData.reportDateString.length<11)this.customFormData.reportDateString+=' 00:00:00';
this.customFormData.reportType = '个人';
console.log(this.customFormData);
this.$refs[ref].validate().then(res => {
var ok = 1;
if(this.customFormData.produceReportDetails && this.customFormData.produceReportDetails.length > 0) {
for (let i = 0; i < this.customFormData.produceReportDetails.length; i++) {
if(!this.customFormData.produceReportDetails[i].planId || this.customFormData.produceReportDetails[i].planId===''
|| !this.customFormData.produceReportDetails[i].qualityNumber|| this.customFormData.produceReportDetails[i].qualityNumber <= 0) {
ok = 0;
uni.showToast({
title: `产品信息不能为空!`,
icon: 'error'
})
break;
}
}
}
if(ok===1){
showConfirm("确认保存生产报工单吗?").then(res => {
if (res.confirm) {
if(this.updateId){
this.customFormData.id = this.updateId
update(this.customFormData).then(response => {
modal.msgSuccess("修改成功")
tab.navigateBack()
})
}else {
this.customFormData.id = null
createReport(this.customFormData).then(response => {
modal.msgSuccess("保存成功")
tab.switchTab('/pages/report')
})
}
}
})
}
}).catch(err => {
console.log('err', err);
})
},
maskClick(e){
this.customFormData.reportDateString =e
this.getOrgIdList()
},
getOrgIdList() {
let data = {
'orgType': this.customFormData.orgType,
'reportDate': this.customFormData.reportDateString+" 00:00:00",
'groupType': this.customFormData.groupType
}
getOrgList(data).then(response => {
this.orgIdList = response.data;
if(!this.orgIdList || this.orgIdList.length===0){
uni.showToast({
title: '日期:'+this.customFormData.reportDateString+`未查询到工位安排!`,
icon: 'error'
})
}
else if(this.orgIdList.length===1){
this.customFormData.orgId = this.orgIdList[0].value
}
})
},
getPlanProductList() {
if(this.customFormData.orgType)
getPlanProductList(this.customFormData.orgType).then(response => {
this.planProductList = response.data;
if(!this.planProductList || this.orgIdList.planProductList===0){}
})
},
add() {
if(this.customFormData.orgType){
this.customFormData.produceReportDetails.push({
id: Date.now(),
productId: undefined,
planId: undefined,
qualityNumber: 0,
wasteNumber: 0,
totalNumber: 0,
qualityRate:0,
packageNumber: 0,
remark: ''
})
}else{
uni.showToast({
title: `请先选择工序!`,
icon: 'error'
})
}
},
del(id) {
let index = this.customFormData.produceReportDetails.findIndex(v => v.id === id)
this.customFormData.produceReportDetails.splice(index, 1)
},
changeNumber(id){
let index = this.customFormData.produceReportDetails.findIndex(v => v.id === id)
if(!this.customFormData.produceReportDetails[index].qualityNumber)
this.customFormData.produceReportDetails[index].qualityNumber=0;
if(!this.customFormData.produceReportDetails[index].wasteNumber)
this.customFormData.produceReportDetails[index].wasteNumber=0;
this.customFormData.produceReportDetails[index].totalNumber =
Number(this.customFormData.produceReportDetails[index].qualityNumber) + Number(this.customFormData.produceReportDetails[index].wasteNumber);
this.customFormData.produceReportDetails[index].qualityRate =
(Number(this.customFormData.produceReportDetails[index].qualityNumber)*100/Number(this.customFormData.produceReportDetails[index].totalNumber)).toFixed(2);
},
handleOrgTypeChange(e){
console.log(e)
this.getPlanProductList()
},
handleBack(){
tab.navigateBack()
}
}
}
</script>
<style lang="scss">
.example {
padding: 15px;
background-color: #fff;
}
.button-group {
margin-top: 15px;
display: flex;
justify-content: space-around;
}
.button {
display: flex;
align-items: center;
height: 35px;
line-height: 35px;
margin-left: 10px;
}
.uni-group-title{
padding-top: 5px;
background-color: #f4c7c7;
}
</style>

@ -1,54 +1,68 @@
<template>
<view class="container">
<u-sticky
class="sticky"
:custom-nav-height="0"
>
<u-navbar
title="计划进度"
bg-color="transparent"
:title-style="{ fontWeight: 'bold' }"
:auto-back="true"
safe-area-inset-top
placeholder
/>
</u-sticky>
<uni-card :is-shadow="false" is-full>
<uni-row>
<uni-col :span="10">
<text class="uni-h6" >计划:
<el-text class="mx-1" type="primary">{{planDo.code}}</el-text>
</text>
</uni-col>
<uni-col :span="14">
<text class="uni-h6">产品:
<el-text class="mx-1" type="warning">{{planDo.productName}}</el-text>
</text>
</uni-col>
</uni-row>
<view class="u-flex justify-between">
<view class="u-flex">
<u-image
src="@/static/images/icon/product.png"
width="40rpx"
height="40rpx"
/>
<u-text type="primary" class="u-m-l-10" :text="planDo.productName"></u-text>
</view>
<view><u-text type="success" :text="planDo.code"></u-text></view>
</view>
</uni-card>
<ContentWrap>
<el-table :data="progressList" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="工序" align="center" prop="orgType" >
<template #default="scope">
<text> {{findTextByValue(scope.row.orgType)}}</text>
</template>
</el-table-column>
<el-table-column label="数量" align="center" prop="totalQualityNumber" width="80px"/>
<el-table-column label="进度" align="center">
<template #default="scope">
<el-progress
:percentage="Number((scope.row.totalQualityNumber/planDo.planNumber)*100).toFixed(2)"
:stroke-width="15"
:color="finishColors"
:striped="true"
:striped-flow="true"
/>
</template>
</el-table-column>
<el-table-column label="废品" align="center" prop="totalWasteNumber" width="60px"/>
<el-table-column label="废品率" align="center" >
<template #default="scope">
<span class="percentage-value">{{Number((scope.row.totalWasteNumber/(scope.row.totalQualityNumber+scope.row.totalWasteNumber))*100 ).toFixed(2)}}%</span>
</template>
</el-table-column>
</el-table>
</ContentWrap>
<uni-table ref="table" stripe emptyText="暂无数据">
<uni-tr>
<uni-th width="60" align="center">工序</uni-th>
<uni-th width="60" align="center">数量</uni-th>
<uni-th width="80" align="center">进度</uni-th>
<uni-th width="60" align="center">废品</uni-th>
<uni-th width="60" align="center">废品率</uni-th>
</uni-tr>
<uni-tr v-for="(item, index) in progressList" :key="index">
<uni-td align="center"><text> {{ findTextByValue(item.orgType )}}</text></uni-td>
<uni-td align="center">
<view class="name">{{ item.totalQualityNumber }}</view>
</uni-td>
<uni-td align="center">
<u-line-progress
:percentage="Number((item.totalQualityNumber / planDo.planNumber) * 100).toFixed(2)"
active-color="#50E0C1"
inactive-color="rgba(139, 237, 215, 0.47)"
>
<text class="u-percentage-slot">{{Number((item.totalQualityNumber / planDo.planNumber) * 100).toFixed(2)}}%</text>
</u-line-progress>
</uni-td>
<uni-td align="center">
<view class="name">{{ item.totalWasteNumber }}</view>
</uni-td>
<uni-td align="center">
<view class="name">{{ Number((item.totalWasteNumber/(item.totalQualityNumber + item.totalWasteNumber))*100 ).toFixed(2)}}%</view>
</uni-td>
</uni-tr>
</uni-table>
</view>
</template>
<script>
import {processTypes,findTextByValue} from "@/api/system/dict/data";
import {getPlanProgress,getById} from "@/api/mes/plan"
import { processTypes, findTextByValue } from "@/api/system/dict/data";
import { getPlanProgress } from "@/api/mes/plan"
import tab from "@/plugins/tab";
import modal from "@/plugins/modal";
export default {
@ -84,6 +98,21 @@ export default {
}
</script>
<style lang="scss">
<style lang="scss" 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);
}
.u-percentage-slot {
font-size: 10px;
margin-left: 40px;
}
:deep(.u-line-progress__line) {
display: flex;
align-items: center;
justify-content: center;
}
</style>

@ -1,90 +1,106 @@
<template>
<view class="container">
<view class="example">
<view>
<u-sticky
class="sticky"
:custom-nav-height="0"
>
<u-navbar
title="代报工"
bg-color="transparent"
:title-style="{ fontWeight: 'bold' }"
:auto-back="true"
safe-area-inset-top
placeholder
/>
</u-sticky>
<view class="container">
<!-- 自定义表单校验 -->
<uni-forms ref="customForm" :rules="customRules" labelWidth="60px" :modelValue="customFormData">
<uni-forms-item required label="工人" name="userId">
<uni-data-select v-model="customFormData.userId" :localdata="userList" @change="handleUserChange" :disabled="disableEnable">
</uni-data-select>
</uni-forms-item>
<uni-forms-item label="工序" required name="orgType">
<uni-forms-item label="工序" required name="orgType" label-width="75px">
<uni-data-checkbox v-model="customFormData.orgType" :localdata="processTypes()" :disabled="disableEnable" @change="handleOrgTypeChange"/>
</uni-forms-item>
<uni-forms-item label="班别" required name="groupType">
<uni-forms-item label="班别" required name="groupType" label-width="75px">
<uni-data-checkbox v-model="customFormData.groupType" :localdata="groupTypes()" :disabled="disableEnable"/>
</uni-forms-item>
<uni-forms-item label="日期" required name="reportDateString">
<uni-forms-item label="日期" required name="reportDateString" label-width="75px">
<uni-datetime-picker v-model="customFormData.reportDateString" type="date" :clear-icon="true" @change="maskClick" :disabled="disableEnable"/>
</uni-forms-item>
<uni-forms-item v-if="customFormData.userId && customFormData.reportDateString" label="工位" required name="orgId">
<uni-data-select v-model="customFormData.orgId" :localdata="orgIdList" :disabled="disableEnable" ></uni-data-select>
</uni-forms-item>
<uni-forms-item label="计时段" name="reportTime">
<uni-forms-item label="计时段" name="reportTime" label-width="75px">
<uni-easyinput type="text" v-model="customFormData.reportTime" placeholder="如:8:00-12:00" />
</uni-forms-item>
<uni-forms-item label="/h" required name="totalTime">
<uni-forms-item label="计时/h" required name="totalTime" label-width="75px">
<uni-easyinput type="number" v-model="customFormData.totalTime" placeholder="" />
</uni-forms-item>
<uni-group title="card 模式" mode="card" v-for="(item,index) in customFormData.productList" :key="item.id"
:name="['productList',index,'value']">
<uni-group title="card 模式" mode="card" v-for="(item,index) in customFormData.produceReportDetails" :key="item.id"
:name="['produceReportDetails',index,'value']">
<template v-slot:title>
<view class="uni-group-title">
<uni-row>
<uni-col :span="20">
<uni-forms-item label="产品" required name="planId">
<uni-data-select v-model="customFormData.productList[index].planId" :localdata="planProductList" @change="handleProductChange"></uni-data-select>
<uni-col :span="22">
<uni-forms-item label="产品" required name="planId" label-width="50px">
<uni-data-select v-model="customFormData.produceReportDetails[index].planId" :localdata="planProductList" @change="handleProductChange"></uni-data-select>
</uni-forms-item>
</uni-col>
<uni-col :span="4" align="center">
<uni-col :span="2" class="u-p-t-10">
<uni-icons type="trash" size="25" color="red" @click="del(item.id)"></uni-icons>
</uni-col>
</uni-row>
</view>
</template>
<uni-row>
<uni-col :span="12">
<uni-forms-item label="成品数" required name="qualityNumber">
<uni-easyinput type="number" v-model="customFormData.productList[index].qualityNumber" @change="changeNumber(item.id)"/>
<uni-col :span="12" class="u-p-r-20">
<uni-forms-item label="成品数" required name="qualityNumber" label-width="72px">
<uni-easyinput type="number" v-model="customFormData.produceReportDetails[index].qualityNumber" @change="changeNumber(item.id)"/>
</uni-forms-item>
</uni-col>
<uni-col :span="12">
<uni-forms-item label="废品数" name="wasteNumber">
<uni-easyinput type="number" v-model="customFormData.productList[index].wasteNumber" @change="changeNumber(item.id)"/>
<uni-forms-item label="废品数" name="wasteNumber" label-width="72px">
<uni-easyinput type="number" v-model="customFormData.produceReportDetails[index].wasteNumber" @change="changeNumber(item.id)"/>
</uni-forms-item>
</uni-col>
</uni-row>
<uni-row>
<uni-col :span="12">
<uni-forms-item label="总数" name="totalNumber">
<uni-easyinput disabled v-model="customFormData.productList[index].totalNumber" placeholder="" />
<uni-col :span="12" class="u-p-r-20">
<uni-forms-item label="总数" name="totalNumber" label-width="72px">
<uni-easyinput disabled v-model="customFormData.produceReportDetails[index].totalNumber" placeholder="" />
</uni-forms-item>
</uni-col>
<uni-col :span="12">
<uni-forms-item label="成品率%" required name="qualityRate">
<uni-easyinput disabled type="number" v-model="customFormData.productList[index].qualityRate" />
<uni-forms-item label="成品率%" required name="qualityRate" label-width="72px">
<uni-easyinput disabled type="number" v-model="customFormData.produceReportDetails[index].qualityRate" />
</uni-forms-item>
</uni-col>
</uni-row>
<uni-row>
<uni-col :span="12">
<uni-forms-item label="打包数" name="packageNumber">
<uni-easyinput type="number" v-model="customFormData.productList[index].packageNumber" />
<uni-col :span="12" class="u-p-r-20">
<uni-forms-item label="打包数" name="packageNumber" label-width="72px">
<uni-easyinput type="number" v-model="customFormData.produceReportDetails[index].packageNumber" />
</uni-forms-item>
</uni-col>
<uni-col :span="12">
<uni-forms-item label="备注" name="remark">
<uni-easyinput type="text" v-model="customFormData.productList[index].remark" />
<uni-forms-item label="备注" name="remark" label-width="72px">
<uni-easyinput type="text" v-model="customFormData.produceReportDetails[index].remark" />
</uni-forms-item>
</uni-col>
</uni-row>
</uni-group>
</uni-forms>
<view class="button-group">
<button type="primary" size="mini" @click="add">
<uni-icons type="plus" size="15"></uni-icons>
新增产品
</button>
<button type="primary" size="mini" @click="submit('customForm')"></button>
<view class="u-flex justify-end">
<view class="u-flex u-m-t-30">
<u-button type="primary" @click="add" class="u-m-r-30">
<uni-icons type="plus" class="u-m-r-10"/>新增产品
</u-button>
<u-button type="success" @click="submit('customForm')">
<uni-icons type="checkbox" class="u-m-r-10"/>保存
</u-button>
</view>
</view>
</view>
</view>
@ -94,7 +110,6 @@
import {processTypes, groupTypes} from "@/api/system/dict/data";
import {
getProductList,
createReport,
getOtherPersonalUser,
getOtherOrgList,
@ -124,7 +139,7 @@ export default {
reportType: undefined,
reportDateString: getCurrentDate(),
reportDate: undefined,
productList: []
produceReportDetails: []
},
//
customRules: {
@ -135,11 +150,9 @@ export default {
totalTime: {rules: [{required: true, errorMessage: '计件时间不能为空'},
{format: 'number', errorMessage: '计件时间格式错误,应填计件小时数'}]},
groupType: {rules: [{required: true, errorMessage: '班别不能为空'}]},
productList: {rules: [
produceReportDetails: {rules: [
{format: 'array', errorMessage: '产品列表格式错误'},
{validateFunction: function(rule, value, data, callback) {
console.log('value:'+value)
console.log('data:'+data)
if (value.length < 2) {
callback('产品信息不能为空')
}
@ -160,18 +173,22 @@ export default {
onLoad() {
this.getUserList()
this.updateId = tab.getParams()
console.log(this.updateId)
if(this.updateId){
this.disableEnable = true
//
getById(this.updateId).then(response => {
this.customFormData = response.data
this.customFormData.reportDateString = timestampToTime(this.customFormData.reportDate)
// this.getOrgIdList()
//
this.getOrgIdList()
//
this.getPlanProductList()
getDetailByReportId(this.updateId).then(res => {
this.customFormData.productList = res.data
this.customFormData.produceReportDetails = res.data
})
})
}
},
onReady() {
@ -184,13 +201,12 @@ export default {
submit(ref) {
if(this.customFormData.reportDateString.length<11)this.customFormData.reportDateString+=' 00:00:00';
this.customFormData.reportType = '代报工';
console.log(this.customFormData);
this.$refs[ref].validate().then(res => {
var ok = 1;
if(this.customFormData.productList && this.customFormData.productList.length > 0) {
for (let i = 0; i < this.customFormData.productList.length; i++) {
if(!this.customFormData.productList[i].planId || this.customFormData.productList[i].planId===''
|| !this.customFormData.productList[i].qualityNumber|| this.customFormData.productList[i].qualityNumber <= 0) {
if(this.customFormData.produceReportDetails && this.customFormData.produceReportDetails.length > 0) {
for (let i = 0; i < this.customFormData.produceReportDetails.length; i++) {
if(!this.customFormData.produceReportDetails[i].planId || this.customFormData.produceReportDetails[i].planId===''
|| !this.customFormData.produceReportDetails[i].qualityNumber|| this.customFormData.produceReportDetails[i].qualityNumber <= 0) {
ok = 0;
uni.showToast({
title: `产品信息不能为空!`,
@ -208,19 +224,22 @@ export default {
update(this.customFormData).then(response => {
modal.msgSuccess("修改成功")
tab.navigateBack()
uni.$emit('success', true)
})
}else{
this.customFormData.id = null
createReport(this.customFormData).then(response => {
modal.msgSuccess("保存成功")
tab.navigateBack()
//
uni.$emit('success', true)
})
}
}
})
}
}).catch(err => {
console.log('err', err);
})
},
maskClick(e){
@ -229,7 +248,6 @@ export default {
this.getOrgIdList()
},
getOrgIdList() {
this.customFormData.orgId = undefined
let dateStr = this.customFormData.reportDateString.length < 11 ?
this.customFormData.reportDateString+" 00:00:00": this.customFormData.reportDateString;
let data = {
@ -246,6 +264,7 @@ export default {
icon: 'error'
})
}
if(this.updateId){}
else if(this.orgIdList.length===1){
this.customFormData.orgId = this.orgIdList[0].value
}
@ -265,7 +284,7 @@ export default {
},
add() {
if(this.customFormData.orgType){
this.customFormData.productList.push({
this.customFormData.produceReportDetails.push({
id: Date.now(),
productId: undefined,
planId: undefined,
@ -284,20 +303,20 @@ export default {
}
},
del(id) {
let index = this.customFormData.productList.findIndex(v => v.id === id)
this.customFormData.productList.splice(index, 1)
let index = this.customFormData.produceReportDetails.findIndex(v => v.id === id)
this.customFormData.produceReportDetails.splice(index, 1)
},
changeNumber(id){
let index = this.customFormData.productList.findIndex(v => v.id === id)
if(!this.customFormData.productList[index].qualityNumber)
this.customFormData.productList[index].qualityNumber=0;
if(!this.customFormData.productList[index].wasteNumber)
this.customFormData.productList[index].wasteNumber=0;
let index = this.customFormData.produceReportDetails.findIndex(v => v.id === id)
if(!this.customFormData.produceReportDetails[index].qualityNumber)
this.customFormData.produceReportDetails[index].qualityNumber=0;
if(!this.customFormData.produceReportDetails[index].wasteNumber)
this.customFormData.produceReportDetails[index].wasteNumber=0;
this.customFormData.productList[index].totalNumber =
Number(this.customFormData.productList[index].qualityNumber) + Number(this.customFormData.productList[index].wasteNumber);
this.customFormData.productList[index].qualityRate =
(Number(this.customFormData.productList[index].qualityNumber)*100/Number(this.customFormData.productList[index].totalNumber)).toFixed(2);
this.customFormData.produceReportDetails[index].totalNumber =
Number(this.customFormData.produceReportDetails[index].qualityNumber) + Number(this.customFormData.produceReportDetails[index].wasteNumber);
this.customFormData.produceReportDetails[index].qualityRate =
(Number(this.customFormData.produceReportDetails[index].qualityNumber)*100/Number(this.customFormData.produceReportDetails[index].totalNumber)).toFixed(2);
},
handleUserChange(e){
this.customFormData.userId = e
@ -307,33 +326,39 @@ export default {
this.getPlanProductList()
},
handleProductChange(e){
console.log(e)
}
}
}
</script>
<style lang="scss">
.example {
padding: 15px;
background-color: #fff;
}
.button-group {
margin-top: 15px;
display: flex;
justify-content: space-around;
}
<style lang="scss" 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: 10px;
background-color: #fff;
}
.button {
display: flex;
align-items: center;
height: 35px;
line-height: 35px;
margin-left: 10px;
}
.uni-group-title{
padding-top: 5px;
background-color: #f4c7c7;
}
.uniui-plus:before{
color: #ffffff
}
.uniui-checkbox:before{
color: #ffffff
}
.u-button {
height: 35px;
width: auto;
}
.uni-group-title{
height: 55px;
padding: 10px;
background: linear-gradient(180deg, #d4e9ff 0%, #f3f9ff 100%);
}
.uni-group--card {
margin :0
}
</style>

@ -1,40 +1,53 @@
<template>
<view class="container">
<view>
<u-sticky
class="sticky"
:custom-nav-height="0"
>
<u-navbar
title="生产报工"
bg-color="transparent"
:title-style="{ fontWeight: 'bold' }"
:auto-back="true"
safe-area-inset-top
placeholder
/>
</u-sticky>
<uni-card :is-shadow="false" is-full>
<text class="uni-h6">如个人无法填报请寻找主管代为报工</text>
<u-text type="warning" class="uni-h6" text="如个人无法填报,请寻找主管代为报工"></u-text>
</uni-card>
<view class="example">
<view class="container">
<!-- 自定义表单校验 -->
<uni-forms ref="customForm" :rules="customRules" labelWidth="60px" :modelValue="customFormData">
<uni-forms ref="customForm" :rules="customRules" label-width="75px" :modelValue="customFormData">
<uni-forms-item label="工序" required name="orgType">
<uni-data-checkbox v-model="customFormData.orgType" :localdata="processTypes()" @change="handleOrgTypeChange" />
</uni-forms-item>
<uni-forms-item label="班别" required name="groupType">
<uni-forms-item label="班别" required name="groupType" label-width="75px">
<uni-data-checkbox v-model="customFormData.groupType" :localdata="groupTypes()" />
</uni-forms-item>
<uni-forms-item label="日期" required name="reportDateString">
<uni-forms-item label="日期" required name="reportDateString" label-width="75px">
<uni-datetime-picker v-model="customFormData.reportDateString" type="date" :clear-icon="true" @change="maskClick" />
</uni-forms-item>
<uni-forms-item label="工位" required name="orgId">
<uni-forms-item label="工位" required name="orgId" label-width="75px">
<uni-data-select v-model="customFormData.orgId" :localdata="orgIdList"></uni-data-select>
</uni-forms-item>
<uni-forms-item label="计时段" name="reportTime">
<uni-forms-item label="计时段" name="reportTime" label-width="75px">
<uni-easyinput type="text" v-model="customFormData.reportTime" placeholder="如:8:00-12:00" />
</uni-forms-item>
<uni-forms-item label="/h" required name="totalTime">
<uni-forms-item label="计时/h" required name="totalTime" label-width="75px">
<uni-easyinput type="number" v-model="customFormData.totalTime" placeholder="" />
</uni-forms-item>
<uni-group title="card 模式" mode="card" v-for="(item,index) in customFormData.productList" :key="item.id"
:name="['productList',index,'value']">
<uni-group title="card 模式" mode="card" v-for="(item,index) in customFormData.produceReportDetails" :key="item.id"
:name="['produceReportDetails',index,'value']">
<template v-slot:title>
<view class="uni-group-title">
<uni-row>
<uni-col :span="12">
<uni-forms-item label="产品" required name="planId">
<uni-data-select v-model="customFormData.productList[index].planId" :localdata="planProductList"></uni-data-select>
<uni-col :span="22">
<uni-forms-item label="产品" required name="planId" label-width="50px">
<uni-data-select v-model="customFormData.produceReportDetails[index].planId" :localdata="planProductList"></uni-data-select>
</uni-forms-item>
</uni-col>
<uni-col :span="12" align="center">
<uni-col :span="2" class="u-p-t-10">
<!-- <button class="button" size="mini" type="warn" @click="del(item.id)"></button>-->
<uni-icons type="trash" size="25" color="red" @click="del(item.id)"></uni-icons>
</uni-col>
@ -42,49 +55,52 @@
</view>
</template>
<uni-row>
<uni-col :span="12">
<uni-col :span="12" class="u-p-r-30">
<uni-forms-item label="成品数" required name="qualityNumber">
<uni-easyinput type="number" v-model="customFormData.productList[index].qualityNumber" @change="changeNumber(item.id)"/>
<uni-easyinput type="number" v-model="customFormData.produceReportDetails[index].qualityNumber" @change="changeNumber(item.id)"/>
</uni-forms-item>
</uni-col>
<uni-col :span="12">
<uni-forms-item label="废品数" name="wasteNumber">
<uni-easyinput type="number" v-model="customFormData.productList[index].wasteNumber" @change="changeNumber(item.id)"/>
<uni-easyinput type="number" v-model="customFormData.produceReportDetails[index].wasteNumber" @change="changeNumber(item.id)"/>
</uni-forms-item>
</uni-col>
</uni-row>
<uni-row>
<uni-col :span="12">
<uni-col :span="12" class="u-p-r-30">
<uni-forms-item label="总数" name="totalNumber">
<uni-easyinput disabled v-model="customFormData.productList[index].totalNumber" placeholder="" />
<uni-easyinput disabled v-model="customFormData.produceReportDetails[index].totalNumber" placeholder="" />
</uni-forms-item>
</uni-col>
<uni-col :span="12">
<uni-forms-item label="成品率%" required name="qualityRate">
<uni-easyinput disabled type="number" v-model="customFormData.productList[index].qualityRate" />
<uni-easyinput disabled type="number" v-model="customFormData.produceReportDetails[index].qualityRate" />
</uni-forms-item>
</uni-col>
</uni-row>
<uni-row>
<uni-col :span="12">
<uni-col :span="12" class="u-p-r-30">
<uni-forms-item label="打包数" name="packageNumber">
<uni-easyinput type="number" v-model="customFormData.productList[index].packageNumber" />
<uni-easyinput type="number" v-model="customFormData.produceReportDetails[index].packageNumber" />
</uni-forms-item>
</uni-col>
<uni-col :span="12">
<uni-forms-item label="备注" name="remark">
<uni-easyinput type="text" v-model="customFormData.productList[index].remark" />
<uni-easyinput type="text" v-model="customFormData.produceReportDetails[index].remark" />
</uni-forms-item>
</uni-col>
</uni-row>
</uni-group>
</uni-forms>
<view class="button-group">
<button type="primary" size="mini" @click="add">
<uni-icons type="plus" size="15"></uni-icons>
新增产品
</button>
<button type="primary" size="mini" @click="submit('customForm')"></button>
<view class="u-flex justify-end">
<view class="u-flex u-m-t-30">
<u-button type="primary" @click="add" class="u-m-r-30">
<uni-icons type="plus" class="u-m-r-10"/>新增产品
</u-button>
<u-button type="success" @click="submit('customForm')">
<uni-icons type="checkbox" class="u-m-r-10"/>保存
</u-button>
</view>
</view>
</view>
</view>
@ -93,13 +109,14 @@
<script>
import useUserStore from "@/store/modules/user";
import {processTypes, groupTypes} from "@/api/system/dict/data";
import {getOrgList, getProductList, createReport, getPlanProductList} from "@/api/mes/organization"
import {getCurrentDate} from "@/utils/dateUtil"
import {showConfirm} from "@/utils/common";
import { processTypes, groupTypes } from "@/api/system/dict/data";
import { getOrgList, createReport, getPlanProductList} from "@/api/mes/organization"
import { getCurrentDate, timestampToTime } from "@/utils/dateUtil"
import { showConfirm } from "@/utils/common";
import tab from "@/plugins/tab";
import modal from "@/plugins/modal";
const userStore = useUserStore()
import { getById, getDetailByReportId, update } from "@/api/mes/report";
export default {
components: {},
data() {
@ -107,8 +124,8 @@ export default {
//
customFormData: {
id: undefined,
name: userStore.name,
userId: userStore.userId,
name: this.getUserInfo().name,
userId: this.getUserInfo().userId,
orgId: undefined,
orgType: undefined,
reportTime: undefined,
@ -119,7 +136,7 @@ export default {
reportType: undefined,
reportDateString: getCurrentDate(),
reportDate: undefined,
productList: []
produceReportDetails: []
},
//
customRules: {
@ -127,10 +144,10 @@ export default {
orgId: {rules: [{required: true, errorMessage: '工位不能为空'}]},
orgType: {rules: [{required: true, errorMessage: '工序不能为空'}]},
reportDateString: {rules: [{required: true, errorMessage: '报工日期不能为空'}]},
totalTime: {rules: [{required: true, errorMessage: '不能为空'},
{format: 'number', errorMessage: '计件时间格式错误,应填计件小时数'}]},
totalTime: {rules: [{required: true, errorMessage: '计时不能为空'},
{format: 'number', errorMessage: '总计时格式错误,应填计时小时数'}]},
groupType: {rules: [{required: true, errorMessage: '班别不能为空'}]},
productList: {rules: [
produceReportDetails: {rules: [
{format: 'array', errorMessage: '产品列表格式错误'},
{validateFunction: function(rule, value, data, callback) {
if (value.length < 2) {
@ -142,20 +159,36 @@ export default {
}
},
orgIdList:[],
planProductList:[]
planProductList:[],
updateId: undefined
}
},
computed: {
},
onLoad() {
this.getOrgIdList()
// this.getPlanProductList()
this.updateId = tab.getParams();
if(this.updateId){
this.disableEnable = true
//
getById(this.updateId).then(response => {
this.customFormData = response.data
this.customFormData.reportDateString = timestampToTime(this.customFormData.reportDate)
getDetailByReportId(this.updateId).then(res => {
this.customFormData.produceReportDetails = res.data
})
this.getPlanProductList()
})
}
},
onReady() {
//
this.$refs.customForm.setRules(this.customRules)
},
methods: {
getUserInfo() {
return useUserStore()
},
processTypes() {
return processTypes
},
@ -165,13 +198,12 @@ export default {
submit(ref) {
if(this.customFormData.reportDateString.length<11)this.customFormData.reportDateString+=' 00:00:00';
this.customFormData.reportType = '个人';
console.log(this.customFormData);
this.$refs[ref].validate().then(res => {
var ok = 1;
if(this.customFormData.productList && this.customFormData.productList.length > 0) {
for (let i = 0; i < this.customFormData.productList.length; i++) {
if(!this.customFormData.productList[i].planId || this.customFormData.productList[i].planId===''
|| !this.customFormData.productList[i].qualityNumber|| this.customFormData.productList[i].qualityNumber <= 0) {
if(this.customFormData.produceReportDetails && this.customFormData.produceReportDetails.length > 0) {
for (let i = 0; i < this.customFormData.produceReportDetails.length; i++) {
if(!this.customFormData.produceReportDetails[i].planId || this.customFormData.produceReportDetails[i].planId===''
|| !this.customFormData.produceReportDetails[i].qualityNumber|| this.customFormData.produceReportDetails[i].qualityNumber <= 0) {
ok = 0;
uni.showToast({
title: `产品信息不能为空!`,
@ -184,15 +216,26 @@ export default {
if(ok===1){
showConfirm("确认保存生产报工单吗?").then(res => {
if (res.confirm) {
createReport(this.customFormData).then(response => {
modal.msgSuccess("保存成功")
tab.switchTab('/pages/report')
})
if(this.updateId){
this.customFormData.id = this.updateId
update(this.customFormData).then(response => {
modal.msgSuccess("修改成功")
tab.navigateBack()
uni.$emit('handleSuccess', true)
})
}else {
this.customFormData.id = null
createReport(this.customFormData).then(response => {
modal.msgSuccess("保存成功")
tab.switchTab('/pages/report')
//
uni.$emit('handleSuccess', true)
})
}
}
})
}
}).catch(err => {
console.log('err', err);
})
},
maskClick(e){
@ -227,7 +270,7 @@ export default {
},
add() {
if(this.customFormData.orgType){
this.customFormData.productList.push({
this.customFormData.produceReportDetails.push({
id: Date.now(),
productId: undefined,
planId: undefined,
@ -246,50 +289,55 @@ export default {
}
},
del(id) {
let index = this.customFormData.productList.findIndex(v => v.id === id)
this.customFormData.productList.splice(index, 1)
let index = this.customFormData.produceReportDetails.findIndex(v => v.id === id)
this.customFormData.produceReportDetails.splice(index, 1)
},
changeNumber(id){
let index = this.customFormData.productList.findIndex(v => v.id === id)
if(!this.customFormData.productList[index].qualityNumber)
this.customFormData.productList[index].qualityNumber=0;
if(!this.customFormData.productList[index].wasteNumber)
this.customFormData.productList[index].wasteNumber=0;
let index = this.customFormData.produceReportDetails.findIndex(v => v.id === id)
if(!this.customFormData.produceReportDetails[index].qualityNumber)
this.customFormData.produceReportDetails[index].qualityNumber=0;
if(!this.customFormData.produceReportDetails[index].wasteNumber)
this.customFormData.produceReportDetails[index].wasteNumber=0;
this.customFormData.productList[index].totalNumber =
Number(this.customFormData.productList[index].qualityNumber) + Number(this.customFormData.productList[index].wasteNumber);
this.customFormData.productList[index].qualityRate =
(Number(this.customFormData.productList[index].qualityNumber)*100/Number(this.customFormData.productList[index].totalNumber)).toFixed(2);
this.customFormData.produceReportDetails[index].totalNumber =
Number(this.customFormData.produceReportDetails[index].qualityNumber) + Number(this.customFormData.produceReportDetails[index].wasteNumber);
this.customFormData.produceReportDetails[index].qualityRate =
(Number(this.customFormData.produceReportDetails[index].qualityNumber)*100/Number(this.customFormData.produceReportDetails[index].totalNumber)).toFixed(2);
},
handleOrgTypeChange(e){
console.log(e)
this.getPlanProductList()
}
}
}
</script>
<style lang="scss">
.example {
padding: 15px;
background-color: #fff;
}
.button-group {
margin-top: 15px;
display: flex;
justify-content: space-around;
}
<style lang="scss" 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: 15px;
background-color: #fff;
}
.button {
display: flex;
align-items: center;
height: 35px;
line-height: 35px;
margin-left: 10px;
}
.uni-group-title{
padding-top: 5px;
background-color: #f4c7c7;
}
.uniui-plus:before{
color: #ffffff
}
.uniui-checkbox:before{
color: #ffffff
}
.u-button {
height: 35px;
}
.uni-group-title{
height: 55px;
padding: 10px;
background: linear-gradient(180deg, #d4e9ff 0%, #f3f9ff 100%);
}
.uni-group--card {
margin :0
}
</style>

@ -13,30 +13,43 @@
},
"pages": [
{
"path": "pages/index",
"path": "pages/login",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/application/index",
"style": {
"navigationBarTitleText": "生产计划",
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
},
{
"path": "pages/login",
"path": "pages/plan",
"style": {
"navigationBarTitleText": "登录"
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
},
{
"path": "pages/work",
"style": {
"navigationBarTitleText": "近三天投料记录",
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
},
{
"path": "pages/report",
"style": {
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
},
{
"path": "pages/mine",
"style": {
"navigationBarTitleText": "个人中心"
"navigationStyle": "custom"
}
},
{
@ -48,14 +61,56 @@
{
"path": "pages/common/textview/index",
"style": {
"navigationBarTitleText": "浏览文本"
"navigationStyle": "custom"
}
},
{
"path": "pages/report",
"path": "pages/application/components/deskArrangement",
"style": {
"navigationBarTitleText": "生产报工",
"enablePullDownRefresh": true
"navigationStyle": "custom"
}
},
{
"path": "pages/application/components/deskArrangementHandle",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/application/components/assigningWork",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/application/components/energyEquipment",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/application/components/energyEquipmentCreateOrEdit",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/application/components/energyEquipmentDetail",
"style": {
"navigationStyle": "custom",
"onReachBottomDistance": 50
}
},
{
"path": "pages/application/components/energyEquipmentForm",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/application/components/energyEquipmentFormReset",
"style": {
"navigationStyle": "custom"
}
}
],
@ -66,20 +121,26 @@
{
"path": "reportForm",
"style": {
"navigationBarTitleText": "生产报工"
"navigationStyle": "custom"
}
},
{
"path": "ViewForm",
"style": {
"navigationBarTitleText": "报工详情"
}
},
{
"path": "replaceForm",
"style": {
"navigationBarTitleText": "代报工"
"navigationStyle": "custom"
}
}
,
{
"path": "planProgress",
"style": {
"navigationBarTitleText": "计划进度"
"navigationStyle": "custom"
}
}
]
@ -90,7 +151,7 @@
{
"path": "feedingRecordForm",
"style": {
"navigationBarTitleText": "新增投料记录"
"navigationStyle": "custom"
}
}
]
@ -107,37 +168,37 @@
{
"path": "info/index",
"style": {
"navigationBarTitleText": "个人信息"
"navigationStyle": "custom"
}
},
{
"path": "info/edit",
"style": {
"navigationBarTitleText": "编辑资料"
"navigationStyle": "custom"
}
},
{
"path": "pwd/index",
"style": {
"navigationBarTitleText": "修改密码"
"navigationStyle": "custom"
}
},
{
"path": "setting/index",
"style": {
"navigationBarTitleText": "应用设置"
"navigationStyle": "custom"
}
},
{
"path": "help/index",
"style": {
"navigationBarTitleText": "常见问题"
"navigationStyle": "custom"
}
},
{
"path": "about/index",
"style": {
"navigationBarTitleText": "关于我们"
"navigationStyle": "custom"
}
}
]
@ -286,7 +347,13 @@
"backgroundColor": "#ffffff",
"list": [
{
"pagePath": "pages/index",
"pagePath": "pages/application/index",
"iconPath": "static/images/tabbar/app.png",
"selectedIconPath": "static/images/tabbar/app_.png",
"text": "我的应用"
},
{
"pagePath": "pages/plan",
"iconPath": "static/images/tabbar/home.png",
"selectedIconPath": "static/images/tabbar/home_.png",
"text": "计划"
@ -299,8 +366,8 @@
},
{
"pagePath": "pages/work",
"iconPath": "static/images/tabbar/work.png",
"selectedIconPath": "static/images/tabbar/work_.png",
"iconPath": "static/images/tabbar/material.png",
"selectedIconPath": "static/images/tabbar/material_.png",
"text": "投料"
},
{
@ -314,6 +381,6 @@
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "BESURE",
"navigationBarBackgroundColor": "#FFFFFF"
"navigationBarBackgroundColor": "#ffffff"
}
}

@ -0,0 +1,140 @@
<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 ref="customForm" :rules="customRules" labelWidth="80px" :modelValue="formData">
<uni-forms-item label="工位" required name="name">
<u-input v-model="name" placholder="请输入名称" disabled/>
</uni-forms-item>
<uni-forms-item label="班别" required name="groupType">
<uni-data-checkbox v-model="formData.groupType" :localdata="groupTypes" @change="getUserList"/>
</uni-forms-item>
<uni-forms-item label="工作日期" required name="planDates">
<u-input v-model="formData.planDates" placeholder="请选择工作日期" prefixIcon="calendar" @click="show=true"></u-input>
<u-calendar :show="show" mode="multiple" @confirm="confirm" @close="show=false"></u-calendar>
</uni-forms-item>
<uni-forms-item v-if="formData.groupType" required label="工人" name="workerId">
<uni-data-select v-model="formData.workerId" :localdata="userList"/>
</uni-forms-item>
</uni-forms>
<view class="u-flex justify-end">
<view @click="submit()">
<u-button type="primary">
<uni-icons type="checkbox" class="u-m-r-10"/>
确定
</u-button></view>
</view>
</view>
</view>
</template>
<script setup>
import { ref } from "vue";
import { onLoad, onReady } from "@dcloudio/uni-app";
import tab from "@/plugins/tab";
import modal from "@/plugins/modal";
import { groupTypes } from "@/api/system/dict/data";
import { createWorker, getUserList2 } from "@/api/mes/deskArrangement";
const formData = ref({
orgId: undefined,
groupType: undefined,
workerId: undefined,
planDates: undefined,
orgType: undefined
})
const name = ref('')
const userList = ref([])
/** 工序类型变化,可选负责人跟着变化 */
const getUserList = ()=>{
if(formData.value.orgId && formData.value.groupType) {
getUserList2({ orgId: formData.value.orgId, groupType: formData.value.groupType } ).then(response => {
userList.value = response.data
userList.value.forEach(user => {
user.text = user.nickname;
user.value = user.id;
delete user.nickname;
delete user.id;
});
})
}
}
const customForm = ref()
//
const customRules = ref({
groupType: { rules: [{ required: true, errorMessage: '班别不能为空'}]},
workerId: { rules: [{ required: true, errorMessage: '工人不能为空'}]},
planDates: { rules: [{ required: true, errorMessage: '工作日期不能为空'}]}
})
const submit = ()=>{
customForm.value.validate(async(valid)=>{
if(!valid){
//
for (let i = 0; i < formData.value.planDates.length; i++) {
const dateObj = new Date(formData.value.planDates[i]);
formData.value.planDates[i] = dateObj.toISOString().replace('T', ' ').split('.')[0];
}
await createWorker(formData.value)
modal.msgSuccess("保存成功")
await tab.navigateBack()
uni.$emit('success', true)
}
})
}
onReady(()=>{
//
customForm.value.setRules(customRules.value)
})
const show = ref(false)
const confirm = (e)=>{
formData.value.planDates = e
show.value = false
}
onLoad(() => {
name.value = tab.getParams().name
formData.value.orgId = tab.getParams().id
formData.value.orgType = tab.getParams().orgType
getUserList()
});
</script>
<style scoped lang="sass">
.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)
padding-bottom: 20rpx
.container
padding: 20rpx
margin: 20rpx
background-color: #ffffff
.uniui-checkbox:before
color: #ffffff
.u-button
height: 70rpx
:deep(.u-calendar-header)
padding: 40rpx
:deep(.u-calendar-header__title)
display: block
:deep(.u-calendar-month__title)
padding: 40rpx
</style>

@ -0,0 +1,240 @@
<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
/>
<view class="u-flex u-flex-center u-m-20">
<u-input
v-model="queryParams.name"
placeholder="请输入组织名称"
border="surround"
:clear-icon="true"
suffixIcon="search"
font-size="12"
class="u-flex u-flex-center u-m-r-20"
@click="getOrgWorkerList"
/>
<u-input
v-model="queryParams.machineId"
placeholder="请输入关联机台"
border="surround"
:clear-icon="true"
suffixIcon="search"
font-size="12"
@click="getOrgWorkerList"
/>
</view>
<view class="u-flex u-flex-center u-m-l-20 u-m-r-20">
<uni-data-select v-model="queryParams.status" placeholder="请选择组织状态" :localdata="organizationalStatus" @click="getOrgWorkerList">
</uni-data-select>
<view class="u-m-l-20">
<u-button @click="getOrgWorkerList" plain style="height: 35px; background: transparent">搜索</u-button>
</view>
</view>
</u-sticky>
<view class="container">
<view class="u-menu-wrap">
<scroll-view scroll-y="" scroll-with-animation="" class="u-tab-view menu-scroll-view" :scroll-top="scrollTop">
<view v-for="(item, index) in tabbar" :key="index" class="u-tab-item"
:class="[current === index ? 'u-tab-item-active' : '']" :data-current="index"
@tap.stop="switchMenu(index)">
<text class="u-line-1">{{ item.text }}</text>
</view>
</scroll-view>
</view>
<view v-if="orgWorkerList.length" class="wrap">
<view>
<u-list>
<u-list-item
v-for="(item, index) in orgWorkerList"
:key="index"
>
<view class="content" @click="tab.navigateTo('/pages/application/components/deskArrangementHandle', { orgId: item.id, orgType: item.name})">
<view class="u-flex u-m-t-30 u-m-b-30">
<view class="u-flex flex_1">组织名称
<u-text type="success" :text="item.name" class="u-m-l-10" size="12"></u-text>
</view>
<view class="u-flex flex_1">组织等级
<u-text type="primary" :text="findTextByValue(orgClass, item.orgClass)" class="u-flex" size="12"> </u-text>
</view>
</view>
<view class="u-flex u-m-b-30">
<view class="u-flex flex_1">类型
<u-text type="success" :text="findTextByValue(tabbar, item.orgType)" class="u-m-l-10" size="12"></u-text>
</view>
<view class="u-flex flex_1">今日工人
<u-text type="primary" :text="item.workerUserName" class="u-m-l-10" size="12"></u-text>
</view>
</view>
<view class="u-m-t-10 u-m-b-20"><u-line/></view>
<view class="u-flex justify-end">
<view v-if="item.orgClass==='workplace' && item.status==='free'" class="u-m-r-20" @click.stop="navigatorTo(item.orgType, item.id, item.name, item.workerUserName)"> <u-button type="error" plain>派工</u-button></view>
</view>
</view>
</u-list-item>
</u-list>
</view>
</view>
<view v-else class="flex_1"> <u-empty icon="http://cdn.uviewui.com/uview/empty/data.png" /></view>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue'
import { findTextByValue, organizationalStatus } from "@/api/system/dict/data";
import tab from "@/plugins/tab";
import { getListOrgWorker } from "@/api/mes/deskArrangement";
import { onLoad } from "@dcloudio/uni-app";
import { showConfirm } from "@/utils/common";
const tabbar = ref([
{ text: '所有', value: ''}, { text: '制浆', value: 'zhijiang'},{ text: '成型', value: 'chengxing'},{ text: '烘干', value: 'honggan'},{ text: '转移', value: 'zhuanyi'},{ text: '加湿', value: 'jiashi'},
{ text: '热压',value: 'reya'},{ text: '切边',value: 'qiebian'},{ text: '品检',value: 'pinjian'},{ text: '打包',value: 'dabao'},{ text: '贴标',value: 'tiebiao'},{ text: '品印',value: 'pinyin'},{ text: '塑封',value: 'sufeng'}
])
const orgClass = ref([
{ text: '工位', value: 'workplace'}, { text: '工序', value: 'process'}, { text: '产线', value: 'pipeline'}, { text: '车间', value: 'workshop'}, { text: '工厂', value: 'factory'}
])
const current = ref(0)
const scrollTop = ref(0)
const menuHeight = ref(0) //
const menuItemHeight = ref(0) // item
const switchMenu = async (index)=>{
if (index === current.value) return;
current.value = index;
// item
scrollTop.value = index * menuItemHeight.value + menuItemHeight.value / 2 - menuHeight.value / 2;
orgWorkerList.value = []
getOrgWorkerList()
}
//
const getElRect = (elClass, dataVal) =>{
new Promise(() => {
const query = uni.createSelectorQuery().in(this);
query.select('.' + elClass).fields({ size: true }, res => {
// resnull
if (!res) {
setTimeout(() => {
getElRect(elClass);
}, 10);
return;
}
this[dataVal] = res.height;
}).exec();
})
}
const queryParams = ref({
name: '',
machineId: '',
status: '',
orgType: '',
pageNo: 1
})
const orgWorkerList = ref([])
const getOrgWorkerList = ()=> {
queryParams.value.orgType = tabbar.value[current.value].value
getListOrgWorker(queryParams.value).then(response => {
orgWorkerList.value = response.data
})
}
const navigatorTo = (type, id, orgName, workerName)=>{
if(workerName != null && workerName.length > 0){
showConfirm("工位:"+orgName+",今天已经派工,确定要重新派工吗?").then(
)
}
tab.navigateTo('/pages/application/components/assigningWork', { orgType: type, id: id, name: orgName })
}
onLoad(() => {
getOrgWorkerList()
uni.$on('success', data => {
if (data) {
getOrgWorkerList();
}
});
});
</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)
padding-bottom: 20rpx
.container
margin: 10rpx
background-color: #f1f1f1
display: flex
flex-grow: 1
.u-menu-wrap
display: flex
overflow: hidden
.wrap
flex-grow: 1
background-color: #f1f1f1
padding: 0 0 20rpx 20rpx
font-size: 24rpx
.content
margin: 0 0 20rpx 0
padding: 20rpx
background-color: #ffffff
border-radius: 10rpx
.flex_1
flex: 1
.u-tab-view
width: 120rpx
height: 100%
.u-tab-item
height: 110rpx
background: #f6f6f6
box-sizing: border-box
display: flex
align-items: center
justify-content: center
font-size: 26rpx
color: #444
font-weight: 400
line-height: 1
.u-tab-item-active
position: relative
color: #000
font-size: 30rpx
font-weight: 600
background: #ffffff
.u-tab-item-active::before
border-left: 4px solid #3c9cff
content: ""
position: absolute
height: 32rpx
left: 0
top: 39rpx
.u-tab-view
height: 100%
.u-button
height: 60rpx
</style>

@ -0,0 +1,169 @@
<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-tabs
:list="menuList"
:current="current"
key-name="name"
:scrollable="false"
:active-style="{
color: '#0E85FF',
}"
@change="change"
>
</u-tabs>
</u-sticky>
<view class="u-m-l-20 u-m-r-20 u-m-t-20">
<uni-datetime-picker v-model="queryParams.workDate" type="datetimerange" :clear-icon="true" @change="getOrgWorkerList"/>
</view>
<view v-if="orgWorkerList.length" class="wrap">
<view>
<u-list>
<u-list-item
v-for="(item, index) in orgWorkerList"
:key="index"
>
<view class="content" @click="">
<view class="u-flex u-m-t-30 u-m-b-30">
<view class="u-flex flex_1">工作日期
<u-text type="success" :text="timestampToTime(item.workDate)" class="u-m-l-10" size="12"></u-text>
</view>
<view class="u-flex flex_1">工位
<u-text type="primary" :text="item.orgName" class="u-flex" size="12"> </u-text>
</view>
</view>
<view class="u-flex u-m-b-30">
<view class="u-flex flex_1">班别
<u-text type="success" :text="item.groupType" class="u-m-l-10" size="12"></u-text>
</view>
<view class="u-flex flex_1">工人
<u-text type="primary" :text="item.workerName" class="u-m-l-10" size="12"></u-text>
</view>
</view>
<view class="u-m-t-10 u-m-b-20"><u-line/></view>
<view class="u-flex justify-end">
<view class="u-m-r-20">
<u-button type="error" plain @click="handleDelete(item.id)"></u-button>
</view>
</view>
</view>
</u-list-item>
</u-list>
</view>
</view>
<view v-else class="flex_1"> <u-empty icon="http://cdn.uviewui.com/uview/empty/data.png" /></view>
</view>
</template>
<script setup>
import { ref } from 'vue'
import tab from "@/plugins/tab";
import { deleteOrgWorker, getOrgWorkerPage } from "@/api/mes/deskArrangement";
import { onLoad, onReachBottom } from "@dcloudio/uni-app";
import { showConfirm } from "@/utils/common";
import { modal } from "@/plugins";
import { timestampToTime } from "@/utils/dateUtil";
const queryParams = ref({
workDate: '',
groupType: '',
orgId: '',
orgType: '',
pageNo: 1,
pageSize: 10
})
const menuList = ref([
{
name: '所有',
value: ''
},
{
name: '白班',
value: '1'
},
{
name: '夜班',
value: '2'
},
{
name: '长白班',
value: '3'
}
])
const show = ref(false)
const current = ref(0)
const change = (index)=>{
current.value = index.index
queryParams.value.groupType = menuList.value[current.value].value
getOrgWorkerList()
}
const orgWorkerList = ref([])
const total = ref()
const getOrgWorkerList = ()=> {
getOrgWorkerPage(queryParams.value).then(response => {
orgWorkerList.value = response.data.list
total.value = response.data.total
})
}
onReachBottom(()=>{
if ((queryParams.value.pageNo - 1) * queryParams.value.pageSize >= total.value) {
return
}
queryParams.value.pageNo++
getOrgWorkerList()
})
const handleDelete = (id)=>{
showConfirm("确认删除工作安排吗?").then(res => {
if (res.confirm) {
deleteOrgWorker(id).then(() => {
queryParams.value.pageNo = 1
orgWorkerList.value = [];
getOrgWorkerList()
modal.msgSuccess("操作成功")
})
}
})
}
onLoad(() => {
queryParams.value.orgId = tab.getParams().orgId
getOrgWorkerList()
});
</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)
padding-bottom: 20rpx
.wrap
background-color: #f1f1f1
padding: 20rpx
font-size: 24rpx
.content
margin: 0 0 20rpx 0
padding: 20rpx
background-color: #ffffff
border-radius: 10rpx
.flex_1
flex: 1
</style>

@ -0,0 +1,190 @@
<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
/>
<view class="search">
<u-input
v-model="queryParams.name"
placeholder="搜索:设备名称"
border="surround"
:clear-icon="true"
suffixIcon="search"
class="u-m-r-30"
font-size="12"
@click="getEnergyDeviceList"
/>
<uni-data-select v-model="queryParams.deviceType" placeholder="请选择设备类型" :localdata="deviceTypes" @click="getEnergyDeviceList" >
</uni-data-select>
</view>
</u-sticky>
<view v-if="total" class="wrap">
<u-list>
<u-list-item
v-for="(item, index) in energy_device_list"
:key="index"
>
<view class="content" @click="navTo({name: item.name, id: item.id})">
<view class="header">
<view class="title">
<u-image
src="@/static/images/icon/product.png"
width="40rpx"
height="40rpx"
/>
<u-text type="primary" class="u-m-l-10" :text="item.name"></u-text>
</view>
<view><u-text type="info" :text="item.code"></u-text></view>
</view>
<view class="u-flex u-m-t-30 u-m-b-30">
<view class="u-flex flex_1">设备类型
<u-text type="success" :text="item.deviceType" class="u-m-l-10"></u-text>
</view>
<view class="flex_1">抄表周期
<u-text :text="item.checkCron" class="u-flex"> </u-text>
</view>
</view>
<view class="u-m-b-30">
<view class="u-flex flex_1">最后抄表时间
<u-text type="warning" :text="item.lastCheckTime ? timestampToTime(item.lastCheckTime) : ''" class="u-m-l-10"></u-text>
</view>
</view>
<view class="u-flex u-m-b-30">
<view class="u-flex flex_1">最后抄表值
<u-text type="success" :text="item.lastCheckValue" class="u-m-l-10"></u-text>
</view>
<view class="u-flex flex_1">单位
<u-text :text="item.unitName" class="u-m-l-10"></u-text>
</view>
</view>
<view class="u-flex u-m-b-30">
<view class="u-flex flex_1">设备资料
<u-text type="success" :text="item.info" class="u-m-l-10"></u-text>
</view>
<view class="u-flex flex_1">是否启用
<u-text :text="item.isEnable ? '是':'否'" class="u-m-l-10"></u-text>
</view>
</view>
<view class="u-m-t-30 u-m-b-30"><u-line/></view>
<view class="u-flex justify-end">
<view class="u-m-r-20" @click.stop="tab.navigateTo('/pages/application/components/energyEquipmentForm', { name: item.name, id: item.id, time: item.lastCheckTime, value: item.lastCheckValue })"> <u-button type="success" plain>抄表</u-button></view>
<view class="u-m-r-20" @click.stop="tab.navigateTo('/pages/application/components/energyEquipmentFormReset', { name: item.name, id: item.id, time: item.lastCheckTime, value: item.lastCheckValue, code: item.code, isEnable: item.isEnable })"> <u-button type="error" plain>重置</u-button></view>
<view class="u-m-r-20" @click.stop="tab.navigateTo('/pages/application/components/energyEquipmentCreateOrEdit', { id: item.id })"> <u-button type="primary" plain >编辑</u-button></view>
<view class="u-m-r-20" @click.stop="deleteEnergyDeviceById(item.id)"> <u-button type="error" plain>删除</u-button></view>
</view>
</view>
</u-list-item>
</u-list>
</view>
<u-empty v-else icon="http://cdn.uviewui.com/uview/empty/data.png" />
<uni-fab ref="fab" @fabClick="tab.navigateTo('/pages/application/components/energyEquipmentCreateOrEdit')" />
</view>
</template>
<script setup>
import { ref } from 'vue'
import { deleteEnergyDevice, getEnergyDevice} from "@/api/mes/application";
import {onLoad, onReachBottom} from "@dcloudio/uni-app";
import { timestampToTime } from "@/utils/dateUtil";
import tab from "@/plugins/tab";
import { showConfirm } from "@/utils/common";
import { modal } from "@/plugins";
import { deviceTypes } from "@/api/system/dict/data";
const queryParams = ref({
name: '',
deviceType: '',
pageNo: 1,
pageSize: 10
})
const total = ref()
const energy_device_list = ref([])
const getEnergyDeviceList = ()=> {
getEnergyDevice(queryParams.value).then(response => {
energy_device_list.value = response.data.list
total.value = response.data.total
})
}
const deleteEnergyDeviceById = (id)=>{
showConfirm("确认删除能源设备吗?").then(res => {
if (res.confirm) {
deleteEnergyDevice(id).then(() => {
queryParams.value.pageNo = 1
energy_device_list.value = [];
getEnergyDeviceList()
modal.msgSuccess("操作成功")
})
}
})
}
const navTo = (params) => {
tab.navigateTo('/pages/application/components/energyEquipmentDetail',params)
}
onReachBottom(()=>{
if (queryParams.value.pageNo * queryParams.value.pageSize >= total.value) {
return
}
queryParams.value.pageNo++
getEnergyDeviceList()
})
onLoad(() => {
getEnergyDeviceList()
uni.$on('success', data => {
if (data) {
getEnergyDeviceList();
}
});
});
</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)
.search
margin: 20rpx
padding: 20rpx
display: flex
align-items: center
.wrap
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
.u-button
height: 60rpx
.flex_1
flex: 1
.u-empty
background: #ffffff
margin: 20rpx
padding-bottom: 20rpx
border-radius: 10rpx
.u-input
height: 35px
</style>

@ -0,0 +1,126 @@
<template>
<view>
<u-sticky
class="sticky"
:custom-nav-height="0"
>
<u-navbar
:title="id ? '编辑能源设备':'新增能源设备'"
bg-color="transparent"
:auto-back="true"
:title-style="{ fontWeight: 'bold' }"
safe-area-inset-top
placeholder
/>
</u-sticky>
<view class="container">
<!-- 自定义表单校验 -->
<uni-forms ref="customForm" :rules="customRules" labelWidth="105px" :modelValue="formData">
<uni-forms-item label="名称" required name="name">
<u-input v-model="formData.name" placholder="请输入名称"/>
</uni-forms-item>
<uni-forms-item label="编码">
<u-input v-model="formData.code" placholder="请输入编码"/>
</uni-forms-item>
<uni-forms-item label="设备类型" required name="deviceType">
<uni-data-checkbox v-model="formData.deviceType" :localdata="deviceTypes"/>
</uni-forms-item>
<uni-forms-item label="抄表周期cron">
<u-input v-model="formData.checkCron" placholder="请输入抄表周期cron"/>
</uni-forms-item>
<uni-forms-item label="单位">
<u-input v-model="formData.unitName" placholder="单位"/>
</uni-forms-item>
<uni-forms-item label="是否启用" required name="isEnable">
<uni-data-checkbox v-model="formData.isEnable" :localdata="isEnable"/>
</uni-forms-item>
<uni-forms-item label="信息资料">
<u-input v-model="formData.info" />
</uni-forms-item>
</uni-forms>
<view class="u-flex justify-end">
<view @click="submit()">
<u-button type="primary">
<uni-icons type="checkbox" class="u-m-r-10"/>
确定
</u-button></view>
</view>
</view>
</view>
</template>
<script setup>
import { ref } from "vue";
import { onLoad, onReady } from "@dcloudio/uni-app";
import tab from "@/plugins/tab";
import {createEnergyDevice, getEnergyDeviceById, updateEnergyDevice} from "@/api/mes/application";
import modal from "@/plugins/modal";
import { deviceTypes, isEnable } from "@/api/system/dict/data";
const formData = ref({
id: undefined,
name: undefined,
code: undefined,
deviceType: undefined,
info: undefined,
checkCron: undefined,
lastCheckTime: undefined,
lastCheckValue: undefined,
unitName: undefined,
isEnable: undefined
})
const id = ref()
const customForm = ref()
//
const customRules = ref({
name: { rules: { required: true, errorMessage: '设备名称不能为空' }},
deviceType: { rules: { required: true, errorMessage: '设备类型不能为空'}},
isEnable: { rules: { required: true, errorMessage: '是否启用不能为空' }}
})
const submit = ()=>{
customForm.value.validate(async(valid)=>{
if(!valid && !id.value) {
await createEnergyDevice(formData.value)
modal.msgSuccess("保存成功")
} else {
await updateEnergyDevice(formData.value)
modal.msgSuccess("修改成功")
}
await tab.navigateBack()
uni.$emit('success', true)
})
}
onReady(()=>{
//
customForm.value.setRules(customRules.value)
})
onLoad(() => {
id.value = tab.getParams().id
if(id.value) {
getEnergyDeviceById(id.value).then(response => {
formData.value = response.data
})
}
});
</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
:deep(.uni-forms-item__content)
display: flex
align-items: center
</style>

@ -0,0 +1,132 @@
<template>
<view>
<u-sticky
class="sticky"
:custom-nav-height="0"
>
<u-navbar
:title="'抄表记录:' + name"
bg-color="transparent"
:auto-back="true"
:title-style="{ fontWeight: 'bold' }"
safe-area-inset-top
placeholder
/>
</u-sticky>
<view class="container">
<u-list>
<u-list-item
v-for="(item, index) in energy_device_detail_list"
:key="index"
>
<view class="content">
<view class="u-flex u-m-t-30 u-m-b-30">
<view class="u-flex flex_1">抄表时间
<u-text type="success" :text="timestampToTime(item.checkTime)" class="u-m-l-10" size="12"></u-text>
</view>
<view class="u-flex flex_1">抄表值
<u-text :text="item.checkValue" class="u-flex" size="12"> </u-text>
</view>
</view>
<view class="u-flex u-m-t-30 u-m-b-30">
<view class="u-flex flex_1">上次抄表时间
<u-text type="success" :text="timestampToTime(item.lastCheckTime)" class="u-m-l-10" size="12"></u-text>
</view>
<view class="u-flex flex_1">上次抄表值
<u-text :text="item.lastCheckValue" class="u-flex" size="12"> </u-text>
</view>
</view>
<view class="u-flex u-m-b-30">
<view class="u-flex flex_1">差值
<u-text type="success" :text="item.diffValue" class="u-m-l-10" size="12"></u-text>
</view>
<view class="u-flex flex_1">单价
<u-text type="success" :text="item.unitPrice" class="u-m-l-10" size="12"></u-text>
</view>
</view>
<view class="u-flex flex_1">备注
<u-text type="info" :text="item.remark" class="u-m-l-10" size="12"></u-text>
</view>
<view class="u-m-t-30 u-m-b-30"><u-line/></view>
<view class="u-flex justify-end">
<view> <u-button type="error" plain @click="deleteEnergyDeviceCheckRecord(item.id)"></u-button></view>
</view>
</view>
</u-list-item>
</u-list>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue'
import { deleteEnergyDeviceCheckRecordById, getEnergyDeviceCheckRecord } from "@/api/mes/application";
import { onLoad, onReachBottom } from "@dcloudio/uni-app";
import { timestampToTime } from "@/utils/dateUtil";
import tab from "@/plugins/tab";
import { showConfirm } from "@/utils/common";
import { modal } from "@/plugins";
const queryParams = ref({
pageNo: 1,
pageSize: 10,
deviceId: undefined
})
const name = ref('')
const total = ref()
const energy_device_detail_list = ref([])
const getEnergyDeviceCheckRecordList = ()=> {
getEnergyDeviceCheckRecord(queryParams.value).then(response => {
energy_device_detail_list.value = [...energy_device_detail_list.value, ...response.data.list]
total.value = response.data.total
})
}
/** 删除 */
function deleteEnergyDeviceCheckRecord(id){
showConfirm("确认删除抄表记录吗?").then(res => {
if (res.confirm) {
deleteEnergyDeviceCheckRecordById(id).then(response => {
queryParams.value.pageNo = 1
energy_device_detail_list.value = [];
getEnergyDeviceCheckRecordList()
modal.msgSuccess("操作成功")
})
}
})
}
onReachBottom(()=>{
if ((queryParams.value.pageNo - 1) * queryParams.value.pageSize >= total.value) {
return
}
queryParams.value.pageNo++
getEnergyDeviceCheckRecordList()
})
onLoad(() => {
name.value = tab.getParams().name
queryParams.value.deviceId = tab.getParams().id
getEnergyDeviceCheckRecordList()
});
</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
background-color: #f1f1f1
padding: 20rpx
.content
margin: 0 0 20rpx 0
padding: 20rpx
background-color: #ffffff
border-radius: 10rpx
.u-button
height: 60rpx
.flex_1
flex: 1
</style>

@ -0,0 +1,114 @@
<template>
<view>
<u-sticky
class="sticky"
:custom-nav-height="0"
>
<u-navbar
:title="'新增:'+name+'抄表'"
bg-color="transparent"
:auto-back="true"
:title-style="{ fontWeight: 'bold' }"
safe-area-inset-top
placeholder
/>
</u-sticky>
<view class="container">
<!-- 自定义表单校验 -->
<uni-forms ref="customForm" :rules="customRules" labelWidth="105px" :modelValue="formData">
<uni-forms-item label="抄表时间" name="checkTime">
<uni-datetime-picker v-model="formData.checkTime" type="date" :clear-icon="true" placeholder="选择抄表时间"/>
</uni-forms-item>
<uni-forms-item label="抄表值" required name="checkValue">
<u-number-box v-model="formData.checkValue" min="0" inputWidth="100%"></u-number-box>
</uni-forms-item>
<uni-forms-item label="上次抄表时间" name="lastCheckTime">
<uni-datetime-picker v-model="formData.lastCheckTime" type="date" :clear-icon="true" placeholder="上次抄表时间" disabled/>
</uni-forms-item>
<uni-forms-item label="上次抄表值" name="lastCheckValue">
<u-number-box v-model="formData.lastCheckValue" min="0" disabled inputWidth="100%"></u-number-box>
</uni-forms-item>
<uni-forms-item label="单价" name="unitPrice">
<u-number-box v-model="formData.unitPrice" min="0" inputWidth="100%"></u-number-box>
</uni-forms-item>
<uni-forms-item label="差值" name="diffValue">
<u-number-box v-model="formData.diffValue" min="0" disabled inputWidth="100%"></u-number-box>
</uni-forms-item>
<uni-forms-item label="备注" name="remark">
<u-input type="text" placeholder="请输入备注" />
</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, onReady } from "@dcloudio/uni-app";
import tab from "@/plugins/tab";
import { createEnergyDeviceCheckRecord } from "@/api/mes/application";
import modal from "@/plugins/modal";
const formData = ref({
checkTime: undefined,
checkValue: undefined,
deviceId: undefined,
lastCheckTime: undefined,
lastCheckValue: undefined,
diffValue: undefined,
unitPrice: undefined,
remark: undefined
})
const name = ref('')
const customForm = ref()
//
const customRules = ref({
checkValue: { rules: [{ required: true, errorMessage: '抄表值不能为空'}]},
})
const submit = ()=>{
customForm.value.validate(async(valid)=>{
if(!valid) {
formData.value.checkTime = new Date(formData.value.checkTime).getTime()
await createEnergyDeviceCheckRecord(formData.value)
modal.msgSuccess("保存成功")
await tab.navigateBack()
uni.$emit('success', true)
}
})
}
onReady(()=>{
//
customForm.value.setRules(customRules.value)
})
onLoad(() => {
name.value = tab.getParams().name
formData.value.deviceId = tab.getParams().id
formData.value.lastCheckTime = tab.getParams().time
formData.value.lastCheckValue = tab.getParams().value
});
</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,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,5 +1,18 @@
<template>
<view>
<u-sticky
class="sticky"
:custom-nav-height="0"
>
<u-navbar
:title="title"
bg-color="transparent"
:auto-back="true"
:title-style="{ fontWeight: 'bold' }"
safe-area-inset-top
placeholder
/>
</u-sticky>
<uni-card class="view-title" :title="title">
<text class="uni-body view-content">{{ content }}</text>
</uni-card>
@ -24,11 +37,16 @@
}
</script>
<style scoped>
<style scoped lang="scss">
page {
background-color: #ffffff;
}
.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);
}
.view-title {
font-weight: bold;
}

@ -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,170 @@
let isReadyLogin = 1
let loginFlag = 1
export default {
//提示窗
tipMsg: function (title, icon, time, mask,callback) {
title = title == undefined ? "系统繁忙" : title;
icon = icon == undefined ? "none" : icon;
time = time == undefined ? 1300 : time;
mask = mask == undefined ? true : mask;
uni.showToast({
title: title,
icon: icon,
mask: mask,
duration: time,
success() {
if(callback){
setTimeout(()=>{
callback()
},time);
}
}
})
},
getTelephoneInfo(){
return new Promise((resolve, reject) => {
var data = uni.getStorageSync("telephoneInfo");
if(!data){
// 获取右上角胶囊的位置信息
//#ifndef H5
let btn = wx.getMenuButtonBoundingClientRect();
uni.getSystemInfo({
success: e => {
let info = {
screenHeight:e.screenHeight,
statusBarHeight:e.statusBarHeight,
windowWidth:e.windowWidth,
top:btn.top
}
uni.setStorageSync("telephoneInfo",info);
resolve(info);
},
fail: (err) => {
reject(err);
}
})
//#endif
}else{
resolve(data);
}
})
},
// 获取当前年月日
getNowDate(){
let date = new Date;
let now = date.getFullYear() + "-" + (date.getMonth()+1) + "-" + date.getDate();
return now;
},
// 获取上个月的年月日
getPreMonth(date) {
var arr = date.split('-');
var year = arr[0]; //获取当前日期的年份
var month = arr[1]; //获取当前日期的月份
var day = arr[2]; //获取当前日期的日
var days = new Date(year, month, 0);
days = days.getDate(); //获取当前日期中月的天数
var year2 = year;
var month2 = parseInt(month) - 1;
if (month2 == 0) {
year2 = parseInt(year2) - 1;
month2 = 12;
}
var day2 = day;
var days2 = new Date(year2, month2, 0);
days2 = days2.getDate();
if (day2 > days2) {
day2 = days2;
}
if (month2 < 10) {
month2 = '0' + month2;
}
var t2 = year2 + '-' + month2 + '-' + "01";
return t2;
},
//检测小程序更新
checkUpdateVersion(){
//新版本更新
if (uni.canIUse('getUpdateManager')) {
//判断当前微信版本是否支持版本更新
const updateManager = uni.getUpdateManager();
updateManager.onCheckForUpdate(function (res) {
if (res.hasUpdate) {
// 请求完新版本信息的回调
updateManager.onUpdateReady(function () {
uni.showModal({
title: '更新提示',
content: '已更新版本,是否重启小程序?',
showCancel:false,
cancelColor:'#eeeeee',
confirmColor:'#40A2ED',
success: function (res) {
if (res.confirm) {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate();
}
},
});
});
// 新的版本下载失败
updateManager.onUpdateFailed(function () {
uni.showModal({
title: '更新失败',
content: '请检查网络设置,若仍更新失败,重新搜索打开',
success(res) {
if (res.confirm) {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate();
}
}
});
});
}
});
} else {
uni.showModal({
// 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示
title: '提示',
content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。',
});
}
},
/**
* @param {string} url 目标页面的路由
* @param {Object} param 传递给目标页面的参数
* @description 处理目标页面的参数转成json字符串传递给param字段在目标页面通过JSON.parse(options.param)接收
*/
navigateTo(url, param = {},flag) {
if(isReadyLogin<=0 && !flag){
this.loginTip();
}else{
let part = '';
for(var item in param){
part += '&' + item + '=' + param[item];
}
url = url + part.replace('&','?');
uni.navigateTo({
url: url,
fail:err=> {
this.tipMsg('页面正在火速开发中,敬请期待!');
},
})
}
},
navigateBack(url, param = {}) {
if (loginFlag <= 0) {
this.tipMsg("很抱歉,你没有权限!");
} else {
let part = '';
for (var item in param) {
part += '&' + item + '=' + param[item];
}
url = "/pages" + url + part.replace('&', '?');
uni.navigateBack({
url: url,
fail: err => {
this.tipMsg('暂未开放该功能!');
},
})
}
},
}

@ -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}
]
}
}

@ -1,24 +1,24 @@
<template>
<view class="normal-login-container">
<view class="logo-content align-center justify-center flex">
<image style="width: 100rpx;height: 100rpx;" :src="globalConfig.appInfo.logo" mode="widthFix">
<image style="width: 100rpx;height: 100rpx;" :src="globalConfig.appInfo.logo" mode="widthFix" data="">
</image>
<text class="title">生产运营管理系统</text>
</view>
<view class="login-form-content">
<view class="input-item flex align-center">
<view class="iconfont icon-user icon"></view>
<input v-model="loginForm.username" class="input" type="text" placeholder="请输入账号" maxlength="30" />
<input v-model="loginForm.username" class="input" type="text" placeholder="请输入账号" maxlength="30" icon="" label="" max="" tip="" validator=""/>
</view>
<view class="input-item flex align-center">
<view class="iconfont icon-password icon"></view>
<input v-model="loginForm.password" type="password" class="input" placeholder="请输入密码" maxlength="20" />
<input v-model="loginForm.password" type="password" class="input" placeholder="请输入密码" maxlength="20" icon="" label="" max="" tip="" validator=""/>
</view>
<view v-if="captchaEnabled" class="input-item flex align-center" style="width: 60%;margin: 0px;">
<view v-if="captchaEnabled" class="input-item flex align-center" style="width: 60%;margin: 0;">
<view class="iconfont icon-code icon"></view>
<input v-model="loginForm.code" type="number" class="input" placeholder="请输入验证码" maxlength="4" />
<input v-model="loginForm.code" type="number" class="input" placeholder="请输入验证码" maxlength="4" icon="" label="" max="" tip="" validator=""/>
<view class="login-code">
<image :src="codeUrl" @click="getCode" class="login-code-img"></image>
<image :src="codeUrl" @click="getCode" class="login-code-img" data=""></image>
</view>
</view>
<view class="action-btn">
@ -39,9 +39,7 @@ import { getCodeImg } from '@/api/login'
import { ref } from "vue";
import config from '@/config.js'
import useUserStore from '@/store/modules/user'
import { getWxCode } from '@/utils/geek';
import { wxLogin } from '@/api/oauth';
import { setToken } from '@/utils/auth';
const userStore = useUserStore()
const codeUrl = ref("");
const captchaEnabled = ref(false); //
@ -49,8 +47,8 @@ const captchaEnabled = ref(false); // 是否开启验证码
const globalConfig = ref(config);
const loginForm = ref({
tenantName: '内蒙必硕',
username: "admin",
password: "admin123",
username: "",
password: "",
captchaVerification: '',
rememberMe: '',
code: '',
@ -77,9 +75,9 @@ async function handleLogin() {
modal.msgError("请输入验证码")
} else {
modal.loading("登录中,请耐心等待...")
pwdLogin()
await pwdLogin()
}
};
}
//
async function pwdLogin() {
userStore.login(loginForm.value).then(() => {
@ -91,33 +89,30 @@ async function pwdLogin() {
getCode()
}
})
};
}
function loginSuccess(result) {
//
userStore.getInfo().then(res => {
uni.switchTab({
url: '/pages/index'
url: '/pages/application/index'
});
})
}
</script>
<style lang="scss">
page {
background-color: #ffffff;
}
<style lang="scss" scoped>
.normal-login-container {
width: 100%;
height: 100vh;
overflow: hidden;
background-image: url(@/static/images/login/background.svg);
background-size: cover;
.logo-content {
width: 100%;
font-size: 21px;
text-align: center;
padding-top: 15%;
padding-top: 50%;
image {
border-radius: 4px;
@ -130,8 +125,7 @@ page {
.login-form-content {
text-align: center;
margin: 20px auto;
margin-top: 15%;
margin: 15% auto 20px;
width: 80%;
.input-item {

@ -1,5 +1,19 @@
<template>
<view class="mine-container" :style="{ height: `${windowHeight}px` }">
<u-sticky
class="sticky"
:custom-nav-height="0"
>
<u-navbar
title="个人中心"
bg-color="transparent"
:auto-back="false"
:left-icon="''"
:title-style="{ fontWeight: 'bold' }"
safe-area-inset-top
placeholder
/>
</u-sticky>
<!--顶部个人信息栏-->
<view class="header-section">
<view class="flex padding justify-between">
@ -100,8 +114,6 @@ uni.$on('refresh', () => {
avatar.value = userStore.avatar;
})
console.log(avatar.value)
function handleToInfo() {
uni.navigateTo({
url: '/pages_mine/pages/info/index'
@ -167,20 +179,29 @@ function handleBuilding() {
</script>
<style lang="scss">
page {
<style lang="scss" scoped>
.page {
background-color: #f5f6f7;
}
.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);
}
.mine-container {
width: 100%;
height: 100%;
.header-section {
padding: 15px 15px 45px 15px;
background-color: #3c96f3;
color: white;
margin: 10rpx 0;
padding: 40rpx 10rpx 80rpx 0;
box-sizing: border-box;
background-image: url('@/static/images/icon/background.png');
background-position: center center;
background-size: 100% 100%;
overflow: hidden;
color: #fff;
.login-tip {
font-size: 18px;
@ -208,10 +229,11 @@ page {
.content-section {
position: relative;
top: -50px;
margin: 10rpx;
.mine-actions {
margin: 15px 15px;
padding: 20px 0px;
padding: 20px 0;
border-radius: 8px;
background-color: white;
@ -223,7 +245,7 @@ page {
.text {
display: block;
font-size: 13px;
margin: 8px 0px;
margin: 8px 0;
}
}
}

@ -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>

@ -1,10 +1,34 @@
<template>
<view class="container">
<view class="example">
<el-tabs v-loading="loading" v-model="activeName" class="demo-tabs" @tab-click="handleTabClick">
<el-tab-pane label="个人报工" name="first">
<view>
<u-sticky
class="sticky"
:custom-nav-height="0"
>
<u-navbar
title="生产报工"
bg-color="transparent"
:title-style="{ fontWeight: 'bold' }"
:auto-back="false"
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>
<view class="container">
<view v-if="current === 0" >
<uni-list :border="true">
<uni-list-item v-for="(item, index) in reportList">
<uni-list-item v-for="(item, index) in reportList" :key="index">
<!-- 自定义 header -->
<template v-slot:header>
<div onclick="">
@ -20,36 +44,31 @@
</template>
<!-- 自定义 footer-->
<template v-slot:footer>
<el-button v-if="item.reportStatus === 0" type="primary" size="small" :icon="Edit" circle @click="editOrAddReport(item.id)"/>
<el-button v-if="item.reportStatus === 0" type="success" size="small" :icon="Check" circle @click="updateReport(item.id)"/>
<el-button v-if="item.reportStatus < 2" type="danger" size="small" :icon="Delete" circle @click="deleteReport(item.id)"/>
<u-button v-if="item.reportStatus === 0" type="primary" icon="edit-pen" @click="editOrAddReport(item.id)"/>
<u-button v-if="item.reportStatus === 0" type="success" icon="share-square" @click="updateReport(item.id,1,'提交')"/>
<u-button v-if="item.reportStatus === 0" type="error" icon="trash" @click="deleteReport(item.id)"/>
<u-button v-if="item.reportStatus >= 1" type="primary" icon="view" @click="handleView(item.id)"/>
</template>
</uni-list-item>
</uni-list>
<uni-fab ref="fab" @fabClick="editOrAddReport" />
</el-tab-pane>
<el-tab-pane label="代报工" name="second" v-if="auth.hasPermi('mes:produce-report-detail:replace')">
</view>
<view v-if="auth('mes:produce-report-detail:replace') && current === 1">
<uni-fab :pattern="pattern" ref="fabReplace" @fabClick="addReplaceReport" />
<uni-forms ref="valiReplaceForm" :model="valiFormData">
<uni-row>
<uni-col :xs="14" :sm="12" :md="6" :lg="3" :xl="1">
<uni-forms-item label-width="50px" label-align="left" label="日期" name="reportDateString">
<uni-datetime-picker v-model="valiFormData.reportDateString" type="date" :clear-icon="true" @change="maskClick" />
</uni-forms-item>
</uni-col>
<uni-col :xs="10" :sm="8" :md="6" :lg="3" :xl="1">
<uni-forms-item label-width="50px" label-align="left" label="工人" name="userId">
<uni-data-select v-model="valiFormData.userId" :localdata="userList" placement="top" @change="handleReplaceReportChange()">
</uni-data-select>
</uni-forms-item>
</uni-col>
</uni-row>
<uni-forms-item label-width="50px" label-align="left" label="日期" name="reportDateString">
<uni-datetime-picker v-model="valiFormData.reportDateString" type="date" :clear-icon="true" @change="maskClick" />
</uni-forms-item>
<uni-forms-item label-width="50px" label-align="left" label="工人" name="userId">
<uni-data-select v-model="valiFormData.userId" :localdata="userList" placement="top" @change="handleReplaceReportChange()">
</uni-data-select>
</uni-forms-item>
<uni-forms-item label="工序" name="orgType">
<uni-data-checkbox v-model="valiFormData.orgType" :localdata="processTypes()" @change="handleReplaceReportChange()"/>
</uni-forms-item>
</uni-forms>
<uni-list :border="true">
<uni-list-item v-for="(item, index) in replaceReportList">
<uni-list-item v-for="(item, index) in replaceReportList" :key="index">
<!-- 自定义 header -->
<template v-slot:header>
<div onclick="">
@ -65,36 +84,30 @@
</template>
<!-- 自定义 footer-->
<template v-slot:footer>
<el-button v-if="item.reportStatus === 0" type="primary" size="small" :icon="Edit" circle @click="addReplaceReport(item.id)"/>
<el-button v-if="item.reportStatus === 0" type="success" size="small" :icon="Promotion" circle @click="updateReport(item.id,1,'提交')"/>
<el-button v-if="item.reportStatus === 1" type="success" size="small" :icon="Check" circle @click="updateReport(item.id,2,'通过')"/>
<el-button v-if="item.reportStatus < 2" type="danger" size="small" :icon="Delete" circle @click="deleteReport(item.id)"/>
<u-button v-if="item.reportStatus < 2" type="primary" icon="edit-pen" @click="addReplaceReport(item.id)"/>
<u-button v-if="item.reportStatus === 0" type="success" icon="share-square" @click="updateReport(item.id,1,'提交')"/>
<u-button v-if="item.reportStatus === 1" type="success" icon="checkmark" @click="updateReport(item.id,2,'通过')"/>
<u-button v-if="item.reportStatus < 2" type="error" icon="trash" @click="deleteReport(item.id)"/>
</template>
</uni-list-item>
</uni-list>
</el-tab-pane>
<el-tab-pane label="个人报工审核" name="third" v-if="auth.hasPermi('mes:produce-report-detail:replace')">
</view>
<view v-if="current === 2 && auth('mes:produce-report-detail:replace')">
<uni-forms ref="valiForm" :model="valiFormData">
<uni-row>
<uni-col :xs="14" :sm="12" :md="6" :lg="3" :xl="1">
<uni-forms-item label-width="50px" label-align="left" label="日期" name="reportDateString">
<uni-datetime-picker v-model="valiFormData.reportDateString" type="date" :clear-icon="true" @change="maskClick" />
</uni-forms-item>
</uni-col>
<uni-col :xs="10" :sm="8" :md="6" :lg="3" :xl="1">
<uni-forms-item label-width="50px" label-align="left" label="工人" name="userId">
<uni-data-select v-model="valiFormData.userId" :localdata="userList" placement="top" @change="handleOtherReportChange()">
</uni-data-select>
</uni-forms-item>
</uni-col>
</uni-row>
<uni-forms-item label-width="50px" label-align="left" label="日期" name="reportDateString">
<uni-datetime-picker v-model="valiFormData.reportDateString" type="date" :clear-icon="true" @change="maskClick" />
</uni-forms-item>
<uni-forms-item label-width="50px" label-align="left" label="工人" name="userId">
<uni-data-select v-model="valiFormData.userId" :localdata="userList" placement="top" @change="handleOtherReportChange()">
</uni-data-select>
</uni-forms-item>
<uni-forms-item label="工序" name="orgType">
<uni-data-checkbox v-model="valiFormData.orgType" :localdata="processTypes()" @change="handleOtherReportChange()"/>
</uni-forms-item>
</uni-forms>
<uni-list :border="true">
<uni-list-item v-for="(item, index) in otherReportList">
<uni-list-item v-for="(item, index) in otherReportList" :key="index">
<!-- 自定义 header -->
<template v-slot:header>
<div onclick="">
@ -110,45 +123,36 @@
</template>
<!-- 自定义 footer-->
<template v-slot:footer>
<el-button v-if="item.reportStatus === 0" type="primary" size="small" :icon="Edit" circle @click="addReplaceReport(item.id)"/>
<el-button v-if="item.reportStatus === 0" type="success" size="small" :icon="Promotion" circle @click="updateReport(item.id,1,'提交')"/>
<el-button v-if="item.reportStatus === 1" type="success" size="small" :icon="Check" circle @click="updateReport(item.id,2,'通过')"/>
<el-button v-if="item.reportStatus === 1" type="warning" size="small" :icon="Close" circle @click="updateReport(item.id,3,'驳回')"/>
<el-button v-if="item.reportStatus < 2" type="danger" size="small" :icon="Delete" circle @click="deleteReport(item.id)"/>
<u-button v-if="item.reportStatus === 0" type="primary" icon="edit-pen" @click="addReplaceReport(item.id)"/>
<u-button v-if="item.reportStatus === 0" type="success" icon="share-square" @click="updateReport(item.id,1,'提交')"/>
<u-button v-if="item.reportStatus === 1" type="success" icon="checkmark" @click="updateReport(item.id,2,'通过')"/>
<u-button v-if="item.reportStatus === 1" type="warning" icon="close" @click="updateReport(item.id,3,'驳回')"/>
<u-button v-if="item.reportStatus < 2" type="error" icon="trash" @click="deleteReport(item.id)"/>
</template>
</uni-list-item>
</uni-list>
<view>
<div></div>
</view>
</el-tab-pane>
<el-tab-pane label="报工报表" name="four">报工报表</el-tab-pane>
</el-tabs>
</view>
<view v-if="current === 3" ><WorkReport /></view>
</view>
</view>
</view>
</template>
<script>
import {getMyList, getOtherList, getById, updateStatus,deleteByReportId } from "@/api/mes/report";
import {Check, Delete, Edit,Promotion,Close} from '@element-plus/icons-vue'
import { getMyList, getOtherList, updateStatus,deleteByReportId } from "@/api/mes/report";
import tab from "@/plugins/tab";
import modal from "@/plugins/modal";
import auth from "@/plugins/auth";
import {showConfirm} from "@/utils/common";
import {getCurrentDate, timestampToTime} from "@/utils/dateUtil";
import {processTypes} from "@/api/system/dict/data";
import {getOtherPersonalUser} from "@/api/mes/organization";
import { showConfirm } from "@/utils/common";
import { getCurrentDate, timestampToTime } from "@/utils/dateUtil";
import { processTypes } from "@/api/system/dict/data";
import { getOtherPersonalUser } from "@/api/mes/organization";
import WorkReport from "@/pages/workReport.vue";
export default {
computed: {
auth() {return auth},
Delete() {return Delete},
Promotion() {return Promotion},
Close() {return Close},
Edit() {return Edit},
Check() {return Check}
},
components: { WorkReport },
data() {
return {
currentPaneName: '',
loading: false,
reportList: [],
otherReportList: [],
@ -161,7 +165,6 @@ export default {
buttonColor: '#e66126',
iconColor: '#fff'
},
activeName: 'first',
valiFormData: {
reportDate: [],
reportDateString: getCurrentDate(),
@ -169,55 +172,65 @@ export default {
orgType: 'chengxing',
reportType: '个人',
},
menuList: [
{
name: '个人报工'
},
{
name: '代报工'
},
{
name: '个人报工审核'
},
{
name: '报工报表'
}
],
current: 0
};
},
onLoad() {
this.loading = true
this.getList();
uni.$on('handleSuccess', data => {
if (data) {
this.getList();
}
});
this.getReplaceReportList()
uni.$on('success', data => {
if (data) {
this.getReplaceReportList();
}
});
this.getOtherReportList()
this.getUserList()
this.loading = false
},
onPullDownRefresh() {
console.log('refresh');
setTimeout(function () {
uni.stopPullDownRefresh();
}, 1000);
},
methods: {
change(index) {
this.current = index.index
},
auth(permission) {
return auth.hasPermi(permission)
},
processTypes() {
return processTypes
},
handleTabClick(tab) {
this.loading = true
console.log(tab.paneName)
//
if(tab.paneName==='third'){
this.getOtherReportList()
}
//
else if(tab.paneName==='second'){
this.getReplaceReportList();
}
else {
//
this.getList();
}
this.loading = false
},
timestampToTime,
getOtherReportList(){
getOtherReportList() {
let date = this.valiFormData.reportDateString
if(date.length<5)date = getCurrentDate()
this.valiFormData.reportDate = [date+' 00:00:00', date+' 23:59:59']
if (date.length < 5) date = getCurrentDate()
this.valiFormData.reportDate = [date + ' 00:00:00', date + ' 23:59:59']
this.valiFormData.reportType = '个人'
getOtherList(this.valiFormData).then(response => {
this.otherReportList = response.data
})
},
getReplaceReportList(){
getReplaceReportList() {
let date = this.valiFormData.reportDateString
if(date.length<5)date = getCurrentDate()
this.valiFormData.reportDate = [date+' 00:00:00', date+' 23:59:59']
if (date.length < 5) date = getCurrentDate()
this.valiFormData.reportDate = [date + ' 00:00:00', date + ' 23:59:59']
this.valiFormData.reportType = '代报工'
getOtherList(this.valiFormData).then(response => {
this.replaceReportList = response.data
@ -239,83 +252,123 @@ export default {
if (res.confirm) {
deleteByReportId(id).then(response => {
modal.msgSuccess("操作成功")
if(this.activeName==='first')this.getList()
if(this.activeName==='third')this.getOtherReportList()
if(this.activeName==='second')this.getReplaceReportList()
if (this.current === 0) {
this.getList()
}
if (this.current === 1) {
this.getReplaceReportList()
}
if (this.current === 2) {
this.getOtherReportList()
}
})
}
this.loading = false
})
},
updateReport(id,status,type) {
showConfirm("确认"+type+"该报工信息吗?").then(res => {
updateReport(id, status, type) {
showConfirm("确认" + type + "该报工信息吗?").then(res => {
this.loading = true
if (res.confirm) {
updateStatus(id,status).then(response => {
updateStatus(id, status).then(response => {
modal.msgSuccess("操作成功")
if(this.activeName==='first')this.getList()
if(this.activeName==='third')this.getOtherReportList()
if(this.activeName==='second')this.getReplaceReportList()
if (this.current === 0) {
this.getList()
}
if (this.current === 1) {
this.getReplaceReportList()
}
if (this.current === 2) {
this.getOtherReportList()
}
})
}
this.loading = false
})
},
editOrAddReport(id){
if(id===null || id===undefined)tab.navigateTo('/page_report/reportForm')
else tab.navigateTo("",id)
editOrAddReport(id) {
if (id === null || id === undefined) tab.navigateTo('/page_report/reportForm')
else tab.navigateTo('/page_report/reportForm', id)
},
addReplaceReport(id){
if(id===null || id===undefined)tab.navigateTo('/page_report/replaceForm')
else tab.navigateTo('/page_report/replaceForm',id)
addReplaceReport(id) {
if (id === null || id === undefined) tab.navigateTo('/page_report/replaceForm')
else tab.navigateTo('/page_report/replaceForm', id)
},
maskClick(e){
maskClick(e) {
this.valiFormData.reportDateString = e
if(this.activeName==='first')this.getList()
if(this.activeName==='third')this.getOtherReportList()
if(this.activeName==='second')this.getReplaceReportList()
if (this.current === 0) {
this.getList()
}
if (this.current === 1) {
this.getReplaceReportList()
}
if (this.current === 2) {
this.getOtherReportList()
}
},
handleOtherReportChange(){
handleOtherReportChange() {
this.loading = true
//
this.getOtherReportList()
this.loading = false
},
handleReplaceReportChange(){
handleReplaceReportChange() {
this.loading = true
//
this.getReplaceReportList()
this.loading = false
},
handleView(id) {
tab.navigateTo('/page_report/ViewForm', id)
}
}
};
</script>
<style lang="scss" scoped>
.example {
.container {
padding: 15px;
background-color: #fff;
background-color: #ffffff;
}
.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);
}
.addSite {
display: flex;
justify-content: space-around;
width: 600rpx;
line-height: 100rpx;
position: absolute;
bottom: 30rpx;
left: 80rpx;
background-color: red;
border-radius: 60rpx;
font-size: 30rpx;
.add{
display: flex;
align-items: center;
color: #ffffff;
.icon{
margin-right: 10rpx;
}
}
display: flex;
justify-content: space-around;
width: 600rpx;
line-height: 100rpx;
position: absolute;
bottom: 30rpx;
left: 80rpx;
background-color: red;
border-radius: 60rpx;
font-size: 30rpx;
.add {
display: flex;
align-items: center;
color: #ffffff;
.icon {
margin-right: 10rpx;
}
}
}
.u-button {
width: 50rpx;
height: 50rpx;
border-radius: 50%;
margin-right: 10rpx;
}
:deep(.u-icon__icon) {
font-size: 30rpx !important;
margin: 0 !important;
}
</style>

@ -1,95 +1,163 @@
<template>
<view >
<u-sticky
class="sticky"
:custom-nav-height="0"
>
<u-navbar
title="近三天投料"
bg-color="transparent"
:title-style="{ fontWeight: 'bold' }"
:auto-back="false"
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-sticky>
<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 finishList" :name="item.id" @click="handleFinishClick(item.id,index)">
<template #title>
<el-icon><Tickets /></el-icon>
<el-text type="success">{{timestampToTime(item.feedingTime)}}</el-text>-
<el-text size="large">{{item.feedingRecordCode}}</el-text>-
<el-text type="warning">{{ findTextByValue(pipelineTypes, item.feedingPipeline)}}</el-text>
</template>
<el-row>
<el-col :span="6">投料类型:
<el-text type="warning">{{findTextByValue(feedingTypes, item.feedingType) }}</el-text>
</el-col>
<el-col :span="8">记录人:
<el-text type="success">{{ item.userName }}</el-text>
</el-col>
<el-col :span="8" v-if="item.feedingType !=='org'">/kg:
<el-text>{{ item.weight }} </el-text>
</el-col>
</el-row>
<el-row v-for="(item2, index2) in finishList[index].detailList">
<el-col :span="8">原料:
<el-text type="warning">{{item2.itemName}}</el-text>
</el-col>
<el-col :span="8">数量:
<el-text type="success">{{ item2.weight }}</el-text>
</el-col>
<el-col :span="8">单位:
<el-text>{{item2.unitName }} </el-text>
</el-col>
</el-row>
</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 draftList" :name="item.id" @click="handleDraftClick(item.id,index)">
<template #title>
<el-icon><Tickets /></el-icon>
<el-text type="success">{{timestampToTime(item.feedingTime)}}</el-text>-
<el-text size="large">{{item.feedingRecordCode}}</el-text>-
<el-text type="warning">{{ findTextByValue(pipelineTypes, item.feedingPipeline)}}</el-text>
</template>
<el-row>
<el-col :span="6">投料类型:
<el-text type="warning">{{findTextByValue(feedingTypes, item.feedingType) }}</el-text>
</el-col>
<el-col :span="8">记录人:
<el-text type="success">{{ item.userName }}</el-text>
</el-col>
<el-col :span="4" v-if="item.feedingType !=='org'">/kg:
<el-text>{{ item.weight }} </el-text>
</el-col>
<el-col :span="3">
<el-button type="info" @click="handleUpdate(item.id)"></el-button>
</el-col>
<el-col :span="3">
<el-button type="danger" @click="handleDelete(item.id)"></el-button>
</el-col>
</el-row>
<el-row v-for="(item2, index2) in draftList[index].detailList">
<el-col :span="8">原料:
<el-text type="warning">{{item2.itemName}}</el-text>
</el-col>
<el-col :span="8">数量:
<el-text type="success">{{ item2.weight }}</el-text>
</el-col>
<el-col :span="8">单位:
<el-text>{{item2.unitName }} </el-text>
</el-col>
</el-row>
</el-collapse-item>
</el-collapse>
<uni-fab ref="fab" :pattern="pattern" @fabClick="handleAdd" />
<view v-if="current === 0" class="container" >
<u-list>
<u-list-item
v-for="(item, index) in draftList"
: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 class="u-m-l-10" type="primary" :text="timestampToTime(item.feedingTime)"></u-text>
</view>
<view><u-text type="warning" :text="findTextByValue(pipelineTypes, item.feedingPipeline)"></u-text></view>
<view><u-text type="info" :text="findTextByValue(feedingTypes, item.feedingType)"></u-text></view>
</view>
<view class="u-m-t-30"><u-text :text="item.feedingRecordCode"></u-text></view>
<view class="u-flex u-flex-between u-m-t-30 u-m-b-30">
<view class="u-flex">记录人
<u-text type="success" :text="item.userName"></u-text>
</view>
<view class="u-flex" v-if="item.feedingType !=='org'">/kg
<u-text :text="item.weight"></u-text>
</view>
</view>
<view v-for="(item2, index2) in draftList[index].detailList" :key="index2" class="u-flex u-flex-between u-m-b-30">
<view class="u-flex flex_1">原料
<u-text type="warning" :text="item2.itemName"></u-text>
</view>
<view class="u-flex flex_1">数量
<u-text type="success" :text="item2.weight"></u-text>
</view>
<view class="u-flex flex_1">单位
<u-text :text="item2.unitName"></u-text>
</view>
</view>
<view class="u-m-t-30 u-m-b-30"><u-line/></view>
<view class="u-flex justify-end">
<text class="u-m-r-30">
<u-button type="info" @click="handleUpdate(item.id)"></u-button>
</text>
<text>
<u-button type="error" @click="handleDelete(item.id)"></u-button>
</text>
</view>
</view>
</u-list-item>
</u-list>
</view>
<!-- 已提交-->
<view v-if="current === 1" class="container" >
<u-list>
<u-list-item
v-for="(item, index) in finishList"
: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" class="u-m-l-10" :text="timestampToTime(item.feedingTime)"></u-text>
</view>
<view><u-text type="warning" :text="findTextByValue(pipelineTypes, item.feedingPipeline)"></u-text></view>
<view><u-text type="info" :text="findTextByValue(feedingTypes, item.feedingType)"></u-text></view>
</view>
<view class="u-m-t-30">
<u-text :text="item.feedingRecordCode"></u-text>
</view>
<view class="u-flex u-flex-between u-m-t-30 u-m-b-30">
<view class="u-flex">记录人
<u-text type="success" :text="item.userName" class="u-m-l-10"></u-text>
</view>
<view v-if="item.feedingType !=='org'" class="u-flex">/kg
<u-text :text="item.weight" class="u-flex"> </u-text>
</view>
</view>
<view v-for="(item2, index2) in finishList[index].detailList" :key="index2" class="u-flex u-flex-between u-m-b-30">
<view class="u-flex flex_1">原料
<u-text type="warning" :text="item2.itemName" class="u-m-l-10"></u-text>
</view>
<view class="u-flex flex_1">数量
<u-text type="success" :text="item2.weight" class="u-m-l-10"></u-text>
</view>
<view class="u-flex flex_1">单位
<u-text :text="item2.unitName" class="u-m-l-10"></u-text>
</view>
</view>
</view>
</u-list-item>
</u-list>
</view>
<uni-fab v-if="auth.hasPermi('mes:feeding-record:create') && current===0" ref="fab" :pattern="pattern" @fabClick="handleAdd" />
</view>
</template>
<script setup>
import {ref, onMounted} from 'vue';
import {getRecordList, updateStatus, deleteById, getDetailByRecordId} from "@/api/mes/record"
import {timestampToTime,timestampToDateTime} from "@/utils/dateUtil";
import { ref } from 'vue';
import { getRecordList, updateStatus, deleteById, getDetailByRecordId } from "@/api/mes/record"
import { timestampToTime } from "@/utils/dateUtil";
import { pipelineTypes,feedingTypes, findTextByValue} from "@/api/system/dict/data";
import {Tickets} from "@element-plus/icons-vue";
import modal from "@/plugins/modal";
import tab from "@/plugins/tab";
import {showConfirm} from "@/utils/common";
import { showConfirm } from "@/utils/common";
import auth from "@/plugins/auth";
import { onLoad } from "@dcloudio/uni-app";
const menuList = ref([
{
name: '草稿'
},
{
name: '已提交'
}
])
const current = ref(0)
const change = (index)=>{
current.value = index.index
if(current.value === 0) {
getDraftList()
} else {
getFinishList()
}
}
//
const finishList = ref([]);
@ -103,35 +171,35 @@ const pattern = {
iconColor: '#fff'
}
onMounted(() => {
getList()
});
//
function getList() {
function getFinishList() {
getRecordList("2").then(response => {
finishList.value = response.data
finishList.value.forEach((item, index) => {
getDetailByRecordId(item.id).then(response => {
finishList.value[index].detailList = response.data
})
})
})
}
function getDraftList(){
getRecordList("1").then(response => {
draftList.value = response.data
draftList.value.forEach((item,index)=>{
getDetailByRecordId(item.id).then(response => {
draftList.value[index].detailList = response.data
})
})
})
}
function handleFinishClick(id, index){
getDetailByRecordId(id).then(response => {
finishList.value[index].detailList = response.data
})
}
function handleDraftClick(id, index){
getDetailByRecordId(id).then(response => {
draftList.value[index].detailList = response.data
})
}
/** 提交 */
function handleUpdate(id){
showConfirm("确认提交投料记录吗?").then(res => {
if (res.confirm) {
updateStatus(id, 2).then(response => {
modal.msgSuccess("操作成功")
getList()
getDraftList()
})
}
})
@ -142,7 +210,7 @@ function handleDelete(id){
if (res.confirm) {
deleteById(id).then(response => {
modal.msgSuccess("操作成功")
getList()
getDraftList()
})
}
})
@ -152,8 +220,47 @@ function handleDelete(id){
function handleAdd(){
tab.navigateTo('/page_record/feedingRecordForm')
}
</script>
<style scoped>
onLoad(() => {
getDraftList()
uni.$on('saveDraft', data => {
if (data) {
getDraftList();
}
});
});
</script>
<style scoped lang="scss">
.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 {
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;
}
}
}
}
.u-button {
height: 60rpx
}
.flex_1 {
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>

@ -1,5 +1,18 @@
<template>
<view class="about-container">
<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="header-section text-center">
<image style="width: 150rpx;height: 150rpx;" src="/static/logo.png" mode="widthFix">
</image>
@ -50,22 +63,29 @@
</script>
<style lang="scss">
page {
background-color: #f8f8f8;
}
<style lang="scss" scoped>
.page {
background-color: #f8f8f8;
}
.copyright {
margin-top: 50rpx;
text-align: center;
line-height: 60rpx;
color: #999;
}
.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);
}
.header-section {
display: flex;
padding: 30rpx 0 0;
flex-direction: column;
align-items: center;
}
.copyright {
margin-top: 50rpx;
text-align: center;
line-height: 60rpx;
color: #999;
}
.header-section {
display: flex;
padding: 30rpx 0 0;
flex-direction: column;
align-items: center;
}
</style>

@ -1,6 +1,19 @@
<template>
<view class="help-container">
<view v-for="(item, findex) in list" :key="findex" :title="item.title" class="list-title">
<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 v-for="(item, findex) in list" :key="findex" :title="item.title" class="list-title" >
<view class="text-title">
<view :class="item.icon"></view>{{ item.title }}
</view>
@ -62,21 +75,22 @@
page {
background-color: #f8f8f8;
}
.help-container {
margin-bottom: 100rpx;
padding: 30rpx;
.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);
}
.list-title {
margin-bottom: 30rpx;
padding: 30rpx;
}
.childList {
background: #ffffff;
box-shadow: 0px 0px 10rpx rgba(193, 193, 193, 0.2);
box-shadow: 0 0 10rpx rgba(193, 193, 193, 0.2);
border-radius: 16rpx;
margin-top: 10rpx;
margin-top: 30rpx;
}
.line {

@ -1,5 +1,18 @@
<template>
<view class="container">
<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="example">
<uni-forms ref="form" :model="user" labelWidth="80px">
<uni-forms-item label="用户昵称" name="nickName">
@ -100,7 +113,12 @@ export default {
page {
background-color: #ffffff;
}
.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);
}
.example {
padding: 15px;
background-color: #fff;

@ -1,5 +1,18 @@
<template>
<view class="container">
<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>
<uni-list>
<uni-list-item showExtraIcon="true" :extraIcon="{ type: 'contact' }" title="用户名称" :rightText="user.email" />
<uni-list-item showExtraIcon="true" :extraIcon="{ type: 'person-filled' }" title="昵称" :rightText="user.nickname" />
@ -48,8 +61,14 @@ function register(){
</script>
<style lang="scss">
<style lang="scss" scoped>
page {
background-color: #ffffff;
}
.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);
}
</style>

@ -1,6 +1,19 @@
<template>
<view class="pwd-retrieve-container">
<uni-forms ref="form" :value="user" labelWidth="80px">
<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>
<uni-forms ref="form" :value="user" labelWidth="80px" class="pwd-retrieve-container">
<uni-forms-item required name="oldPassword" label="旧密码">
<uni-easyinput type="password" v-model="user.oldPassword" placeholder="请输入旧密码" />
</uni-forms-item>
@ -79,13 +92,18 @@
}
</script>
<style lang="scss">
page {
<style lang="scss" scoped>
page {
background-color: #ffffff;
}
.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);
}
.pwd-retrieve-container {
padding: 30rpx
}
.pwd-retrieve-container {
padding-top: 36rpx;
padding: 15px;
}
</style>

@ -1,5 +1,18 @@
<template>
<view class="setting-container" :style="{ height: `${windowHeight}px` }">
<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="menu-list">
<view class="list-cell list-cell-arrow" @click="handleToPwd">
<view class="menu-item-box">
@ -89,6 +102,13 @@ function dialogClose() {
background-color: #f8f8f8;
}
.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);
}
.item-box {
background-color: #FFFFFF;
margin: 30rpx;

@ -88,6 +88,10 @@ export default {
*
*/
getParams(): any {
return JSON.parse(_params)
if(_params) {
return JSON.parse(_params)
} else {
return undefined
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 691 B

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 874 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 569 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 501 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 526 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 493 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 506 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 712 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 688 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 791 B

Binary file not shown.

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

@ -91,6 +91,10 @@ const useUserStore = defineStore("user", {
});
},
},
persist: {
key: 'user',
storage: localStorage
}
});
export default useUserStore;

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save