Compare commits

...

11 Commits

Author SHA1 Message Date
kkk-ops 47a6eec1bc commit 3 weeks 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

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

@ -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' import request from '@/utils/request'

@ -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 = [ export const processTypes = [
{text: '制浆', value: 'zhijiang'}, {text: '成型', value: 'chengxing'}, {text: '制浆', value: 'zhijiang'}, {text: '成型', value: 'chengxing'},
{text: '烘干', value: 'honggan'}, {text: '转移', value: 'zhuanyi'}, {text: '烘干', value: 'honggan'}, {text: '转移', value: 'zhuanyi'},

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

@ -2,15 +2,8 @@ import App from './App.vue'
import plugins from './plugins' import plugins from './plugins'
import store from './store' import store from './store'
import uviewPlus from 'uview-plus' 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 { createSSRApp } from 'vue'
import directive from './directive' // directive import directive from './directive' // directive
import { useDict } from '@/utils/dict' import { useDict } from '@/utils/dict'
import { parseTime, resetForm, addDateRange, handleTree, selectDictLabel, selectDictLabels } from '@/utils/ruoyi' import { parseTime, resetForm, addDateRange, handleTree, selectDictLabel, selectDictLabels } from '@/utils/ruoyi'
@ -21,10 +14,6 @@ export function createApp() {
app.use(store) app.use(store)
app.use(uviewPlus) app.use(uviewPlus)
app.use(plugins) app.use(plugins)
app.use(ElementPlus, {locale})
for (const [key, component] of Object.entries(ElementPlusIconsVue)){
app.component(key, component)
}
directive(app) directive(app)
// 全局方法挂载 // 全局方法挂载

@ -21,9 +21,9 @@
width="40rpx" width="40rpx"
height="40rpx" height="40rpx"
/> />
<el-text class="u-m-l-10">{{planDo.productName}}</el-text> <u-text type="primary" class="u-m-l-10" :text="planDo.productName"></u-text>
</view> </view>
<el-text type="success">{{planDo.code}}</el-text> <view><u-text type="success" :text="planDo.code"></u-text></view>
</view> </view>
</uni-card> </uni-card>
<uni-table ref="table" stripe emptyText="暂无数据"> <uni-table ref="table" stripe emptyText="暂无数据">

@ -224,6 +224,7 @@ export default {
update(this.customFormData).then(response => { update(this.customFormData).then(response => {
modal.msgSuccess("修改成功") modal.msgSuccess("修改成功")
tab.navigateBack() tab.navigateBack()
uni.$emit('success', true)
}) })
}else{ }else{
this.customFormData.id = null this.customFormData.id = null

@ -14,7 +14,7 @@
/> />
</u-sticky> </u-sticky>
<uni-card :is-shadow="false" is-full> <uni-card :is-shadow="false" is-full>
<el-text type="warning" class="uni-h6">如个人无法填报请寻找主管代为报工</el-text> <u-text type="warning" class="uni-h6" text="如个人无法填报,请寻找主管代为报工"></u-text>
</uni-card> </uni-card>
<view class="container"> <view class="container">
<!-- 自定义表单校验 --> <!-- 自定义表单校验 -->
@ -331,7 +331,6 @@ export default {
} }
.u-button { .u-button {
height: 35px; height: 35px;
width: auto;
} }
.uni-group-title{ .uni-group-title{
height: 55px; height: 55px;

@ -13,16 +13,23 @@
}, },
"pages": [ "pages": [
{ {
"path": "pages/index", "path": "pages/login",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/application/index",
"style": { "style": {
"navigationStyle": "custom", "navigationStyle": "custom",
"enablePullDownRefresh": true "enablePullDownRefresh": true
} }
}, },
{ {
"path": "pages/login", "path": "pages/plan",
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom",
"enablePullDownRefresh": true
} }
}, },
{ {
@ -32,7 +39,13 @@
"enablePullDownRefresh": true "enablePullDownRefresh": true
} }
}, },
{
"path": "pages/report",
"style": {
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
},
{ {
"path": "pages/mine", "path": "pages/mine",
"style": { "style": {
@ -52,10 +65,52 @@
} }
}, },
{ {
"path": "pages/report", "path": "pages/application/components/deskArrangement",
"style": {
"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": { "style": {
"navigationStyle": "custom", "navigationStyle": "custom",
"enablePullDownRefresh": true "onReachBottomDistance": 50
}
},
{
"path": "pages/application/components/energyEquipmentForm",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/application/components/energyEquipmentFormReset",
"style": {
"navigationStyle": "custom"
} }
} }
], ],
@ -292,7 +347,13 @@
"backgroundColor": "#ffffff", "backgroundColor": "#ffffff",
"list": [ "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", "iconPath": "static/images/tabbar/home.png",
"selectedIconPath": "static/images/tabbar/home_.png", "selectedIconPath": "static/images/tabbar/home_.png",
"text": "计划" "text": "计划"

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

@ -95,7 +95,7 @@ function loginSuccess(result) {
// //
userStore.getInfo().then(res => { userStore.getInfo().then(res => {
uni.switchTab({ uni.switchTab({
url: '/pages/index' url: '/pages/application/index'
}); });
}) })
} }

@ -41,43 +41,41 @@
width="40rpx" width="40rpx"
height="40rpx" height="40rpx"
/> />
<text class="name"> <u-text type="primary" :text=" item.productName" class="u-m-l-10"> </u-text>
{{ item.productName }}
</text>
</view> </view>
<el-text type="success">{{item.code}}</el-text> <view><u-text type="success" :text="item.code"></u-text></view>
</view> </view>
<view class="flex-box"> <view class="u-flex u-flex-between u-m-t-30">
<el-text>计划数:{{ item.planNumber }}</el-text> <u-text :text="`计划数: ${ item.planNumber }`" size="13"></u-text>
<el-text>入库数:{{ item.finishNumber }}</el-text> <u-text :text="`入库数: ${ item.finishNumber }`" size="13"></u-text>
</view> </view>
<view class="flex-box"> <view class="u-flex u-flex-between u-m-t-30">
<el-text>计划开始时间:{{ timestampToTime(item.planStartTime) }}</el-text> <u-text :text="`计划开始时间: ${ timestampToTime(item.planStartTime) }`" size="13"></u-text>
<el-text>计划结束时间:{{ timestampToTime(item.planEndTime) }}</el-text> <u-text :text="`计划结束时间: ${ timestampToTime(item.planEndTime) }`" size="13"></u-text>
</view> </view>
<view class="text"> <view class="text">
<el-text>备注:</el-text> <u-text text="备注:" size="13"/>
</view> </view>
<view class="remark"> <view class="remark">
<el-text>{{ item.remark }}</el-text> <u-text :text="item.remark"></u-text>
</view> </view>
<view class="u-m-t-30 u-m-b-30"><u-line/></view> <view class="u-m-t-30 u-m-b-30"><u-line/></view>
<view class="u-flex justify-end"> <view class="u-flex justify-end">
<el-col v-if="auth.hasPermi('mes:plan:update')" :span="4" class="u-m-r-30"> <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> <u-button type="success" plain @click="updatePlan(item.id, item.code,'end')">完工</u-button>
</el-col> </view>
<el-col v-if="auth.hasPermi('mes:plan:update')" :span="4" class="u-m-r-30"> <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> <u-button type="error" plain @click="updatePlan(item.id,item.code,'pause')"></u-button>
</el-col> </view>
<el-col :span="4"> <view>
<u-button type="info" plain @click="planProgress(item)"></u-button> <u-button type="info" plain @click="planProgress(item)"></u-button>
</el-col> </view>
</view> </view>
</view> </view>
</u-list-item> </u-list-item>
</u-list> </u-list>
</view> </view>
<!-- 派工中--> <!-- 派工中-->
<view v-if="current === 1" class="container" > <view v-if="current === 1" class="container" >
<u-list> <u-list>
<u-list-item <u-list-item
@ -92,37 +90,35 @@
width="40rpx" width="40rpx"
height="40rpx" height="40rpx"
/> />
<text class="name"> <u-text type="primary" :text=" item.productName" class="u-m-l-10"> </u-text>
{{ item.productName }}
</text>
</view> </view>
<el-text type="success">{{item.code}}</el-text> <view><u-text type="success" :text="item.code"></u-text></view>
</view> </view>
<view class="flex-box"> <view class="u-flex u-flex-between u-m-t-30">
<el-text>计划数:{{ item.planNumber }}</el-text> <u-text :text="`计划数: ${ item.planNumber }`" size="13"></u-text>
<el-text>入库数:{{ item.finishNumber }}</el-text> <u-text :text="`入库数: ${ item.finishNumber }`" size="13"></u-text>
</view> </view>
<view class="flex-box"> <view class="u-flex u-flex-between u-m-t-30">
<el-text>计划开始时间:{{ timestampToTime(item.planStartTime) }}</el-text> <u-text :text="`计划开始时间: ${ timestampToTime(item.planStartTime) }`" size="13"></u-text>
<el-text>计划结束时间:{{ timestampToTime(item.planEndTime) }}</el-text> <u-text :text="`计划结束时间: ${ timestampToTime(item.planEndTime) }`" size="13"></u-text>
</view> </view>
<view class="text"> <view class="text">
<el-text>备注:</el-text> <u-text text="备注:" size="13"/>
</view> </view>
<view class="remark"> <view class="remark">
<el-text>{{ item.remark }}</el-text> <u-text :text="item.remark"></u-text>
</view> </view>
<view class="u-m-t-30 u-m-b-30"><u-line/></view> <view class="u-m-t-30 u-m-b-30"><u-line/></view>
<view class="u-flex justify-end"> <view class="u-flex justify-end">
<el-col v-if="auth.hasPermi('mes:plan:update')" :span="4"> <view v-if="auth.hasPermi('mes:plan:update')">
<u-button type="info" plain @click="updatePlan(item.id,item.code, 'start')">开工</u-button> <u-button type="info" plain @click="updatePlan(item.id,item.code, 'start')">开工</u-button>
</el-col> </view>
</view> </view>
</view> </view>
</u-list-item> </u-list-item>
</u-list> </u-list>
</view> </view>
<!-- 计划中--> <!--计划中-->
<view v-if="current === 2" class="container" > <view v-if="current === 2" class="container" >
<u-list> <u-list>
<u-list-item <u-list-item
@ -137,31 +133,29 @@
width="40rpx" width="40rpx"
height="40rpx" height="40rpx"
/> />
<text class="name"> <u-text type="primary" :text=" item.productName" class="u-m-l-10"> </u-text>
{{ item.productName }}
</text>
</view> </view>
<el-text type="success">{{item.code}}</el-text> <view><u-text type="success" :text="item.code"></u-text></view>
</view> </view>
<view class="flex-box"> <view class="u-flex u-flex-between u-m-t-30">
<el-text>计划数:{{ item.planNumber }}</el-text> <u-text :text="`计划数: ${ item.planNumber }`" size="13"></u-text>
<el-text>入库数:{{ item.finishNumber }}</el-text> <u-text :text="`入库数: ${ item.finishNumber }`" size="13"></u-text>
</view> </view>
<view class="flex-box"> <view class="u-flex u-flex-between u-m-t-30">
<el-text>计划开始时间:{{ timestampToTime(item.planStartTime) }}</el-text> <u-text :text="`计划开始时间: ${ timestampToTime(item.planStartTime) }`" size="13"></u-text>
<el-text>计划结束时间:{{ timestampToTime(item.planEndTime) }}</el-text> <u-text :text="`计划结束时间: ${ timestampToTime(item.planEndTime) }`" size="13"></u-text>
</view> </view>
<view class="text"> <view class="text">
<el-text>备注:</el-text> <u-text text="备注:" size="13"/>
</view> </view>
<view class="remark"> <view class="remark">
<el-text>{{ item.remark }}</el-text> <u-text :text="item.remark"></u-text>
</view> </view>
<view class="u-m-t-30 u-m-b-30"><u-line/></view> <view class="u-m-t-30 u-m-b-30"><u-line/></view>
<view class="u-flex justify-end"> <view class="u-flex justify-end">
<el-col v-if="auth.hasPermi('mes:plan:update')" :span="4"> <view v-if="auth.hasPermi('mes:plan:update')">
<u-button type="primary" plain>派工</u-button> <u-button type="primary" plain>派工</u-button>
</el-col> </view>
</view> </view>
</view> </view>
</u-list-item> </u-list-item>
@ -182,42 +176,37 @@
width="40rpx" width="40rpx"
height="40rpx" height="40rpx"
/> />
<text class="name"> <u-text type="primary" :text=" item.productName" class="u-m-l-10"> </u-text>
{{ item.productName }}
</text>
</view> </view>
<el-text type="success">{{item.code}}</el-text> <view><u-text type="success" :text="item.code"></u-text></view>
</view> </view>
<view class="flex-box"> <view class="u-flex u-flex-between u-m-t-30">
<el-text>计划数:{{ item.planNumber }}</el-text> <u-text :text="`计划数: ${ item.planNumber }`" size="13"></u-text>
<el-text>入库数:{{ item.finishNumber }}</el-text> <u-text :text="`入库数: ${ item.finishNumber }`" size="13"></u-text>
</view> </view>
<view class="flex-box"> <view class="u-flex u-flex-between u-m-t-30">
<el-text>计划开始时间:{{ timestampToTime(item.planStartTime) }}</el-text> <u-text :text="`计划开始时间: ${ timestampToTime(item.planStartTime) }`" size="13"></u-text>
<el-text>计划结束时间:{{ timestampToTime(item.planEndTime) }}</el-text> <u-text :text="`计划结束时间: ${ timestampToTime(item.planEndTime) }`" size="13"></u-text>
</view> </view>
<view class="text"> <view class="text">
<el-text>备注:</el-text> <u-text text="备注:" size="13"/>
</view> </view>
<view class="remark"> <view class="remark">
<el-text>{{ item.remark }}</el-text> <u-text :text="item.remark"></u-text>
</view> </view>
<view class="u-m-t-30 u-m-b-30"><u-line/></view> <view class="u-m-t-30 u-m-b-30"><u-line/></view>
<view class="u-flex justify-end"> <view class="u-flex justify-end">
<el-col v-if="auth.hasPermi('mes:plan:update')" :span="4" class="u-m-r-30"> <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> <u-button type="info" plain @click="updatePlan(item.id, item.code,'start')">开工</u-button>
</el-col> </view>
<el-col v-if="auth.hasPermi('mes:plan:update')" :span="4"> <view v-if="auth.hasPermi('mes:plan:update')" :span="4">
<u-button type="success" plain @click="updatePlan(item.id,item.code, 'end')">完工</u-button> <u-button type="success" plain @click="updatePlan(item.id,item.code, 'end')">完工</u-button>
</el-col> </view>
</view> </view>
</view> </view>
</u-list-item> </u-list-item>
</u-list> </u-list>
</view> </view>
<!-- <view class="charts-box">-->
<!-- <qiun-data-charts :chartData="chartData" type="column"/>-->
<!-- </view>-->
</view> </view>
</template> </template>
@ -351,12 +340,6 @@ function planProgress(plan){
.title { .title {
display: flex; display: flex;
align-items: center; align-items: center;
.name {
font-size: 28rpx;
font-weight: bold;
margin-left: 16rpx;
color: #333333;
}
} }
} }
.flex-box { .flex-box {

@ -41,41 +41,39 @@
width="40rpx" width="40rpx"
height="40rpx" height="40rpx"
/> />
<el-text type="success" class="u-m-l-10"> <u-text class="u-m-l-10" type="primary" :text="timestampToTime(item.feedingTime)"></u-text>
{{ timestampToTime(item.feedingTime) }} </view>
</el-text> <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>
<el-text type="warning">{{ findTextByValue(pipelineTypes, item.feedingPipeline)}}</el-text>
<el-text type="info">{{findTextByValue(feedingTypes, item.feedingType) }}</el-text>
</view> </view>
<view class="u-m-t-30"><el-text size="large">{{item.feedingRecordCode}}</el-text></view>
<el-row class="u-m-t-30 u-m-b-30">
<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 draftList[index].detailList" :key="index2" class="u-m-b-30">
<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>
<view class="u-m-t-30 u-m-b-30"><u-line/></view> <view class="u-m-t-30 u-m-b-30"><u-line/></view>
<view class="u-flex justify-end"> <view class="u-flex justify-end">
<el-col :span="4" class="u-m-r-30"> <text class="u-m-r-30">
<u-button type="info" @click="handleUpdate(item.id)"></u-button> <u-button type="info" @click="handleUpdate(item.id)"></u-button>
</el-col> </text>
<el-col :span="4"> <text>
<u-button type="error" @click="handleDelete(item.id)"></u-button> <u-button type="error" @click="handleDelete(item.id)"></u-button>
</el-col> </text>
</view> </view>
</view> </view>
</u-list-item> </u-list-item>
@ -96,33 +94,33 @@
width="40rpx" width="40rpx"
height="40rpx" height="40rpx"
/> />
<el-text type="success" class="u-m-l-10"> <u-text type="primary" class="u-m-l-10" :text="timestampToTime(item.feedingTime)"></u-text>
{{ timestampToTime(item.feedingTime) }} </view>
</el-text> <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>
<el-text type="warning">{{ findTextByValue(pipelineTypes, item.feedingPipeline)}}</el-text>
<el-text type="info">{{findTextByValue(feedingTypes, item.feedingType) }}</el-text>
</view> </view>
<view class="u-m-t-30"><el-text size="large">{{item.feedingRecordCode}}</el-text></view>
<el-row class="u-m-t-30 u-m-b-30">
<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" :key="index2" class="u-m-b-30">
<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>
</view> </view>
</u-list-item> </u-list-item>
</u-list> </u-list>
@ -262,4 +260,7 @@ onLoad(() => {
.u-button { .u-button {
height: 60rpx height: 60rpx
} }
.flex_1 {
flex: 1;
}
</style> </style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 569 B

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