Commit 117d7e19 by zhangzhen

模块添加

parent 9f47bdf4
import http from "@/common/vmeitime-http/index.js"
import config from "@/config/index.config.js"
const setResultData = (data,params=undefined) => {
let obj = {}
for (let i in data) {
obj[i] = data[i]
}
let paramsData = {
"__version__": "2.0",
"__sys__": {},
"__blocks__": {
"inqu_status": {
"attr": {},
"meta": {
"desc": "",
"attr": {},
"columns": []
},
"rows": []
},
"result": {
"attr": {},
"meta": {
"desc": "",
"attr": {},
"columns": []
},
"rows": []
},
"detail": {
"attr": {},
"meta": {
"desc": "",
"attr": {},
"columns": []
},
"rows": []
}
}
}
let keyList = Object.keys(obj);
keyList.forEach((item, index) => {
paramsData.__blocks__.result.meta.columns.push({
pos: index,
name: item
})
})
paramsData.__blocks__.result.rows.push(Object.values(obj));
if(params){
let keyList2 = Object.keys(params);
keyList2.forEach((item, index) => {
paramsData.__blocks__.inqu_status.meta.columns.push({
pos: index,
name: item
})
})
paramsData.__blocks__.inqu_status.rows.push(Object.values(params));
}
return paramsData
}
const setParamsData = (data = {},pageData) => {
let obj = {}
for (let i in data) {
obj[i] = data[i]
}
let paramsData = {
"__version__": "2.0",
"__sys__": {},
"__blocks__": {
"inqu_status": {
"attr": {},
"meta": {
"desc": "",
"attr": {},
"columns": []
},
"rows": []
},
"result": {
"attr": {
count: 0,
limit: pageData && pageData.limit? pageData.limit : 10,
offset: pageData && pageData.offset? pageData.offset*pageData.limit : 0,
orderBy: "",
showCount: pageData && pageData.showCount? pageData.showCount : "true"
},
"meta": {
"desc": "",
"attr": {},
"columns": []
},
"rows": []
},
"detail": {
"attr": {},
"meta": {
"desc": "",
"attr": {},
"columns": []
},
"rows": []
}
}
}
let keyList = Object.keys(obj);
keyList.forEach((item, index) => {
paramsData.__blocks__.inqu_status.meta.columns.push({
pos: index,
name: item
})
})
paramsData.__blocks__.inqu_status.rows.push(Object.values(obj));
return paramsData
}
// 列表
export const getList = (params={},pageData={}) => {
let url = `/service/S_SB_JH_03`
let d = setParamsData(params,pageData)
return http.post(url,d)
}
export const getDeviceList = (params={},pageData={}) => {
let url = `/service/S_SB_JH_05`
let d = setParamsData(params,pageData)
return http.post(url,d)
}
// 数据提交接口
export const orderSave = (data,p) => {
let url = `/service/S_SB_JH_02`
let d = setResultData(data,p)
return http.post(url,d)
}
export const getSubList = (params={},pageData={}) => {
let url = `/service/S_SB_JH_01`
let d = setParamsData(params,pageData)
d.__blocks__.inqu_status.attr.filterLogic = "and"
return http.post(url,d)
}
// 数据提交接口
export const orderSubSave = (data) => {
let url = `/service/S_SB_JH_04`
let d = setResultData(data)
return http.post(url,d)
}
export const getPlanDeviceList = (params={},pageData={}) => {
let url = `/service/S_SB_JH_06`
let d = setParamsData(params,pageData)
return http.post(url,d)
}
export const updatePlanDeviceInfo = (data) => {
let url = `/service/S_SB_JH_07`
let d = setResultData(data)
return http.post(url,d)
}
import http from "@/common/vmeitime-http/index.js"
import config from "@/config/index.config.js"
const setResultData = (data,params=undefined) => {
let obj = {}
for (let i in data) {
obj[i] = data[i]
}
let paramsData = {
"__version__": "2.0",
"__sys__": {},
"__blocks__": {
"inqu_status": {
"attr": {},
"meta": {
"desc": "",
"attr": {},
"columns": []
},
"rows": []
},
"result": {
"attr": {},
"meta": {
"desc": "",
"attr": {},
"columns": []
},
"rows": []
},
"detail": {
"attr": {},
"meta": {
"desc": "",
"attr": {},
"columns": []
},
"rows": []
}
}
}
let keyList = Object.keys(obj);
keyList.forEach((item, index) => {
paramsData.__blocks__.result.meta.columns.push({
pos: index,
name: item
})
})
paramsData.__blocks__.result.rows.push(Object.values(obj));
if(params){
let keyList2 = Object.keys(params);
keyList2.forEach((item, index) => {
paramsData.__blocks__.inqu_status.meta.columns.push({
pos: index,
name: item
})
})
paramsData.__blocks__.inqu_status.rows.push(Object.values(params));
}
return paramsData
}
const setParamsData = (data = {},pageData) => {
let obj = {}
for (let i in data) {
obj[i] = data[i]
}
let paramsData = {
"__version__": "2.0",
"__sys__": {},
"__blocks__": {
"inqu_status": {
"attr": {},
"meta": {
"desc": "",
"attr": {},
"columns": []
},
"rows": []
},
"result": {
"attr": {
count: 0,
limit: pageData && pageData.limit? pageData.limit : 10,
offset: pageData && pageData.offset? pageData.offset*pageData.limit : 0,
orderBy: "",
showCount: pageData && pageData.showCount? pageData.showCount : "true"
},
"meta": {
"desc": "",
"attr": {},
"columns": []
},
"rows": []
},
"detail": {
"attr": {},
"meta": {
"desc": "",
"attr": {},
"columns": []
},
"rows": []
}
}
}
let keyList = Object.keys(obj);
keyList.forEach((item, index) => {
paramsData.__blocks__.inqu_status.meta.columns.push({
pos: index,
name: item
})
})
paramsData.__blocks__.inqu_status.rows.push(Object.values(obj));
return paramsData
}
// 列表
export const getList = (params={},pageData={}) => {
let url = `/service/S_SB_JH_11`
let d = setParamsData(params,pageData)
return http.post(url,d)
}
export const getDeviceList = (params={},pageData={}) => {
let url = `/service/S_SB_JH_12`
let d = setParamsData(params,pageData)
return http.post(url,d)
}
// 数据提交接口
export const orderSave = (data,p) => {
let url = `/service/S_SB_JH_02`
let d = setResultData(data,p)
return http.post(url,d)
}
export const getSubList = (params={},pageData={}) => {
let url = `/service/S_SB_JH_01`
let d = setParamsData(params,pageData)
d.__blocks__.inqu_status.attr.filterLogic = "and"
return http.post(url,d)
}
// 数据提交接口
export const orderSubSave = (data) => {
let url = `/service/S_SB_JH_15`
let d = setResultData(data)
return http.post(url,d)
}
export const getPlanDeviceList = (params={},pageData={}) => {
let url = `/service/S_SB_JH_06`
let d = setParamsData(params,pageData)
return http.post(url,d)
}
export const updatePlanDeviceInfo = (data) => {
let url = `/service/S_SB_JH_13`
let d = setResultData(data)
return http.post(url,d)
}
......@@ -444,6 +444,72 @@
"navigationStyle": "custom",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/device-inspection/index",
"style" :
{
"navigationBarTitleText" : "设备点检",
"navigationBarBackgroundColor": "#0072fc",
"navigationBarTextStyle": "white",
"navigationStyle": "custom",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/device-inspection/edit",
"style" :
{
"navigationBarTitleText" : "详情",
"navigationBarBackgroundColor": "#0072fc",
"navigationBarTextStyle": "white",
"navigationStyle": "custom",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/device-inspection/detail",
"style" :
{
"navigationBarTitleText" : "详情",
"navigationBarBackgroundColor": "#0072fc",
"navigationBarTextStyle": "white",
"navigationStyle": "custom",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/device-maintain/index",
"style" :
{
"navigationBarTitleText" : "设备保养",
"navigationBarBackgroundColor": "#0072fc",
"navigationBarTextStyle": "white",
"navigationStyle": "custom",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/device-maintain/edit",
"style" :
{
"navigationBarTitleText" : "详情",
"navigationBarBackgroundColor": "#0072fc",
"navigationBarTextStyle": "white",
"navigationStyle": "custom",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/device-maintain/detail",
"style" :
{
"navigationBarTitleText" : "详情",
"navigationBarBackgroundColor": "#0072fc",
"navigationBarTextStyle": "white",
"navigationStyle": "custom",
"enablePullDownRefresh" : false
}
}
],
"globalStyle": {
......
<template>
<view>
<cu-custom bgColor="bg-blue" :isBack="true">
<block slot="backText">
<view class="list-icon" @tap="onBack">
<text class="cuIcon-back text-white text-bold text-xl"></text>
</view>
</block>
<block slot="content">
<text class="text-white">点检计划详情</text>
</block>
</cu-custom>
<view v-if="statusBarHeight>0" class="content-black" :style="{height:statusBarHeight+45+'px'}">
</view>
<view class="flex-col content-part-1">
<view class="flex-row header">
<image src="../../static/icon10.png" mode="widthFix"></image>
<text class="text-lg text-bold text-black">详情</text>
</view>
<view class="form-content-box">
<form>
<view class="cu-form-group">
<view class="title">
<text>公司名称:</text>
</view>
<view class="">
<text>{{orderInfo.companyName}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>计划单号:</text>
</view>
<view class="">
<text>{{orderInfo.planCode}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>开始日期:</text>
</view>
<view class="">
<text>{{orderInfo.planStartDate}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>结束日期:</text>
</view>
<view class="">
<text>{{orderInfo.planEndDate}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>计划人:</text>
</view>
<view class="">
<text>{{orderInfo.planUserName}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>任务状态:</text>
</view>
<view class="">
<text>{{statusEnum[orderInfo.taskStatus]}}</text>
</view>
</view>
</form>
</view>
</view>
<view class="flex-col content-part-1 content-part-2">
<view class="flex-row header">
<text class="text-lg text-bold text-black">设备明细</text>
</view>
<view class="form-content-box margin-bottom">
<view v-for="(item,i) in subList" :key="i" class="sub-item-box">
<form class="item-form">
<view class="cu-form-group">
<view class="title">
<text>设备名称:</text>
</view>
<view class="">
<text>{{item.deviceName}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>设备编码:</text>
</view>
<view class="">
<text>{{item.deviceCode}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>设备区域:</text>
</view>
<view class="">
<text>{{item.groupName}}</text>
</view>
</view>
<view v-if="item.deviceModel.length>2" class="cu-form-group">
<view class="title">
<text>设备型号:</text>
</view>
<view class="">
<text>{{item.deviceModel}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>设备类型:</text>
</view>
<view class="">
<text>{{deviceTypeEnum[item.deviceType]}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>检查项:</text>
</view>
<view class="">
<text>{{item.checkItem}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>检查描述:</text>
</view>
<view class="">
<text>{{item.checkDescrip}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>检查结果:</text>
</view>
<view class="">
<text>{{item.checkResult}}</text>
</view>
</view>
</form>
</view>
</view>
<view v-if="subList.length <= 0" class="empty-box">
<u-empty text="暂无数据" textColor='#C1C1C1' width="120">
</u-empty>
</view>
</view>
<view v-if="orderInfo.taskStatus < 1" class="footer-box">
<button class="cu-btn block bg-blue" @tap="onSubmit">立即领取</button>
</view>
<u-modal :show="show" title="提示" :content='content' :showCancelButton="true" @confirm="onSave"
@cancel="onCancel" :asyncClose="true"></u-modal>
</view>
</template>
<script>
import {
getDict
} from "@/api/index.js";
import {toJsonData} from "@/utils/tools.js";
import moment from "@/common/moment.js";
import { getSubList,getPlanDeviceList,orderSave } from "@/api/device-inspection.js";
export default {
data() {
return {
show: false,
show2: false,
border: "none",
minDate: moment().subtract(2, 'M').format("YYYY-MM-DD"),
content: "请确认是否进行入库提交操作?",
addStatus: false,
statusBarHeight: uni.getStorageSync("statusHeight") || 0,
status: 'nomore ',
showText: false,
target: 60,
modelVale: 100,
current: 0,
value: 0,
orderInfo: {},
userInfo: uni.getStorageSync("userInfor"),
form: {},
factoryIndex: -1,
factoryList: [],
subOrderList: [],
delInfo: {},
factoryEnum: {},
formData: {},
projectList: [],
projectIndex: -1,
queryData: {
offset: 0,
pageSize: 100
},
orgNoList: [],
submitStatusEnum: {
1: '已提交',
0: "待提交"
},
submitType: 1,
subList: [],
statusEnum: {
0: "待领取",
1: "已领取"
},
deviceTypeList:[],
deviceTypeEnum:{}
};
},
onLoad(option) {
if (option && option.id) {
this.id = option.id
this.onLoading();
}
},
methods: {
onSubmit(t) {
this.content = '请确认是否领取计划单?'
this.show = true
},
onOpenCalendar() {
this.show2 = true;
},
onCancel() {
this.show = false;
this.show2 = false;
},
onSave() {
this.show = false;
uni.showLoading({
title: "加载中..."
})
orderSave({
...this.orderInfo,
taskStatus:'0'
},{
pageNumber:'HGSB004',
inspecUserId:this.userInfo.userId,
inspecUserName:this.userInfo.userName
}).then(res2 => {
uni.hideLoading();
if (res2.data.__sys__.status === 0) {
uni.showToast({
icon: "none",
title: "操作成功"
})
this.onBack();
}
})
},
onProjectChange(e) {
let index = Number(e.target.value);
if (this.projectIndex === index) return
this.projectIndex = index;
},
onBack() {
uni.redirectTo({
url: "/pages/device-inspection/index"
})
},
onLoading() {
getDict({
codeset: 'hpjx.hpsb.deviceType'
}).then(res => {
this.deviceTypeList = res.data.list.map( item => {
this.deviceTypeEnum[item.value] = item.label;
return item
})
this.onGetList();
})
},
onGetList() {
uni.showLoading({
title: "加载中"
})
getSubList({
planDate: "",
id: this.id
}).then(res => {
uni.hideLoading()
let list = toJsonData(res.data.__blocks__.result.rows, res.data.__blocks__.result.meta
.columns);
if (list && list.length) {
this.orderInfo = list[0]
}
this.onGetSubList();
})
},
onGetSubList() {
uni.showLoading({
title: "加载中"
})
getPlanDeviceList({
parentId: this.id
}).then(res => {
uni.hideLoading()
this.subList = toJsonData(res.data.__blocks__.result.rows, res.data.__blocks__.result.meta
.columns).map(item => {
let updatedTime = item.createdTime ? item.createdTime.split('') : [];
return {
...item,
createdTime: updatedTime.length >= 13 ?
`${updatedTime[0]}${updatedTime[1]}${updatedTime[2]}${updatedTime[3]}/${updatedTime[4]}${updatedTime[5]}/${updatedTime[6]}${updatedTime[7]} ${updatedTime[8]}${updatedTime[9]}:${updatedTime[10]}${updatedTime[11]}:${updatedTime[12]}${updatedTime[13]}` :
''
}
});
})
}
}
}
</script>
<style>
page {
background-color: #f1f1f1;
}
</style>
<style lang="scss" scoped>
.cu-form-group {
picker {
padding-right: 0;
}
}
.header-title {
display: flex;
flex-direction: row;
width: 90%;
align-items: center;
margin: 30upx auto 12upx;
.flex-between {
display: flex;
flex: 1;
justify-content: center;
align-items: center;
border-radius: 20upx;
padding: 16upx 20upx;
background-color: rgba(246, 246, 248, 1);
.image {
width: 34upx;
margin-right: 8upx;
max-height: 42upx;
}
.text-blue {
color: #4a93f8;
font-weight: bold;
}
}
}
.u-tabs-box {
width: 70%;
margin: 0 auto;
}
.data-content {
display: flex;
flex-direction: column;
margin: 0 auto 30upx;
width: 96%;
.circle-par {
display: flex;
justify-content: center;
align-items: center;
}
.header {
border-radius: 12upx 12upx 0 0;
background-color: #eef2fe;
color: #101010;
font-size: 30upx;
border: 1px solid #d1dcfd;
padding: 14upx 24upx;
}
.content {
border-radius: 0 0 12upx 12upx;
background-color: #ffffff;
color: #101010;
font-size: 30upx;
border: 1px solid #cecece;
border-top: none;
}
}
.flex-content {
display: flex;
width: 100%;
justify-content: center;
}
.part-3 {
flex-direction: column;
padding-bottom: 120upx;
.content-item {
display: flex;
flex-direction: column;
width: 90%;
margin: 24upx auto 8upx;
padding-bottom: 24upx;
.header-title {
position: relative;
width: 100%;
margin: 0;
image {
width: 100%;
max-height: 100upx;
}
.flex-between {
position: absolute;
top: 0;
left: 12%;
width: 88%;
height: 70%;
padding: 0;
justify-content: space-between;
background-color: transparent;
}
}
.content-box {
position: relative;
z-index: 2;
box-shadow: 0 0 12upx rgba(0, 0, 0, 0.34);
border-radius: 12upx;
margin-top: -20upx;
background-color: #ffffff;
padding: 24upx;
.flex-wrap {
display: flex;
flex-wrap: wrap;
.margin-sm {
margin: 10upx;
}
}
}
}
.content-item:last-child {
border-bottom: none;
}
}
.flex-center {
display: flex;
align-items: center;
}
.line-progress {
align-items: center;
}
.u-page__item__slot-icon {
width: 24px;
height: 24px;
}
.part-left {
align-items: center;
}
.circle-center {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.margin-top-sm {
margin-top: 10upx;
}
.flex-row {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
}
.icon {
width: 36upx;
max-height: 50upx;
margin-right: 6upx;
}
.flex-row-center {
display: flex;
flex-direction: row;
align-items: center;
}
.content-part-1 {
display: flex;
flex-direction: column;
align-items: center;
.header {
display: flex;
flex-direction: row;
align-items: center;
width: 92%;
padding: 30upx 0;
image {
width: 20px;
height: 20px;
margin-right: 6upx;
}
}
.form-content-box {
display: flex;
flex-direction: column;
width: 100%;
padding: 12upx 0;
border-radius: 4upx;
// box-shadow: 0 0 8upx rgba(0, 0, 0, 0.34);
background-color: #ffffff;
.cu-form-group {
height: 32px;
min-height: 32px;
.title {
display: flex;
flex-direction: row;
width: 220upx;
align-items: center;
}
.text-blue {
white-space: normal;
}
}
.action-box {
display: flex;
flex-direction: row;
justify-content: flex-end;
}
}
.footer-content {
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 120upx;
margin-bottom: 100upx;
.btn-box {
width: 80%;
}
}
}
.order-content-box {
display: flex;
flex-direction: column;
width: 100%;
background-color: #ffffff;
.header {
display: flex;
flex-direction: row;
align-items: center;
width: 100%;
padding: 24upx;
image {
width: 20px;
height: 20px;
margin-right: 6upx;
}
}
.content-box {
position: relative;
z-index: 2;
padding: 0 24upx 24upx;
.flex-row {
margin: 6upx 0;
.text-title {
font-size: 30upx;
}
.part-1 {
font-size: 32upx;
width: 140upx;
text-align-last: justify;
}
.part-2 {
margin-right: 24upx;
}
}
.btn-box {
position: absolute;
right: 24upx;
bottom: 16upx;
}
}
}
.footer-box {
position: fixed;
left: 0;
bottom: 0;
display: flex;
flex-direction: row;
width: 100%;
padding: 24upx 36upx;
background-color: #ffffff;
z-index: 8;
.cu-btn {
display: flex;
flex: 1;
margin: 0 20upx;
}
}
.content-part-2 {
.form-content-box {
display: flex;
background-color: transparent;
justify-content: center;
}
.form-content-box:last-child {
margin-bottom: 120upx;
}
}
.sub-item-box {
display: flex;
flex-direction: column;
width: 94%;
margin: 0 auto 8upx;
padding-bottom: 24upx;
.item-form {
position: relative;
z-index: 2;
border-radius: 12upx;
background-color: #ffffff;
box-shadow: 0 0 6upx rgba(0, 0, 0, 0.34);
margin-top: -20upx;
padding: 24upx;
}
.header-title {
position: relative;
width: 100%;
margin: 0;
image {
width: 100%;
max-height: 100upx;
}
.flex-between {
position: absolute;
top: 0;
left: 12%;
width: 88%;
height: 70%;
padding: 0;
justify-content: space-between;
background-color: transparent;
}
}
}
.cu-form-group uni-picker::after {
color: transparent;
}
</style>
\ No newline at end of file
<template>
<view>
<cu-custom bgColor="bg-blue" :isBack="true">
<block slot="backText">
<view class="list-icon" @tap="onBack">
<text class="cuIcon-back text-white text-bold text-xl"></text>
</view>
</block>
<block slot="content">
<text class="text-white">点检详情</text>
</block>
</cu-custom>
<view v-if="statusBarHeight>0" class="content-black" :style="{height:statusBarHeight+45+'px'}">
</view>
<view class="flex-col content-part-1">
<view class="flex-row header">
<image src="../../static/icon10.png" mode="widthFix"></image>
<text class="text-lg text-bold text-black">详情</text>
</view>
<view class="form-content-box">
<form>
<view class="cu-form-group">
<view class="title">
<text>公司名称:</text>
</view>
<view class="">
<text>{{orderInfo.companyName}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>点检单号:</text>
</view>
<view class="">
<text>{{orderInfo.inspecCode}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>计划单号:</text>
</view>
<view class="">
<text>{{orderInfo.planCode}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>点检日期:</text>
</view>
<view class="">
<text>{{orderInfo.inspecDate}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>开始日期:</text>
</view>
<view class="">
<text>{{orderInfo.planStartDate}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>结束日期:</text>
</view>
<view class="">
<text>{{orderInfo.planEndDate}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>点检人名称:</text>
</view>
<view class="">
<text>{{orderInfo.inspecUserName || orderInfo.planUserId}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>提交状态:</text>
</view>
<view class="">
<text>{{statusEnum[orderInfo.checkStatus]}}</text>
</view>
</view>
</form>
</view>
</view>
<view class="flex-col content-part-1 content-part-2">
<view class="flex-row header">
<text class="text-lg text-bold text-black">设备明细</text>
</view>
<view class="form-content-box margin-bottom">
<view v-for="(item,i) in subList" :key="i" class="sub-item-box">
<form class="item-form">
<view class="cu-form-group">
<view class="title">
<text>设备名称:</text>
</view>
<view class="">
<text>{{item.deviceName}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>设备编码:</text>
</view>
<view class="">
<text>{{item.deviceCode}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>设备区域:</text>
</view>
<view class="">
<text>{{item.groupName}}</text>
</view>
</view>
<view v-if="item.deviceModel.length>2" class="cu-form-group">
<view class="title">
<text>设备型号:</text>
</view>
<view class="">
<text>{{item.deviceModel}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>设备类型:</text>
</view>
<view class="">
<text>{{deviceTypeEnum[item.deviceType]}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>检查项:</text>
</view>
<view class="">
<text>{{item.checkItem}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>检查描述:</text>
</view>
<view v-if="orderInfo.checkStatus < 1" class="">
<u-input v-model="item.checkDescrip" color="#0081ff" inputAlign="right" type="text"
:border="border" placeholder="请输入检查描述" />
</view>
<view v-else class="">
<text>{{item.checkDescrip}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>检查结果:</text>
</view>
<view v-if="orderInfo.checkStatus < 1" class="">
<u-input v-model="item.checkResult" color="#0081ff" inputAlign="right" type="text"
:border="border" placeholder="请输入检查结果" />
</view>
<view v-else class="">
<text>{{item.checkResult}}</text>
</view>
</view>
<view v-if="orderInfo.checkStatus < 1" class="cu-form-group flex-row-center">
<button class="cu-btn bg-green sm" @tap="onUpdateDeviceInfo(i)">点检提交</button>
</view>
</form>
</view>
</view>
<view v-if="subList.length <= 0" class="empty-box">
<u-empty text="暂无数据" textColor='#C1C1C1' width="120">
</u-empty>
</view>
</view>
<view v-if="orderInfo.checkStatus < 1" class="footer-box">
<button class="cu-btn block bg-blue" @tap="onSubmit">点检完成</button>
</view>
<u-modal :show="show" title="提示" :content='content' :showCancelButton="true" @confirm="onSave"
@cancel="onCancel" :asyncClose="true"></u-modal>
</view>
</template>
<script>
import {
getDict
} from "@/api/index.js";
import {
toJsonData
} from "@/utils/tools.js";
import moment from "@/common/moment.js";
import {
getList,
getDeviceList,
orderSubSave,
updatePlanDeviceInfo
} from "@/api/device-inspection.js";
export default {
data() {
return {
show: false,
show2: false,
border: "none",
minDate: moment().subtract(2, 'M').format("YYYY-MM-DD"),
content: "请确认是否进行入库提交操作?",
addStatus: false,
statusBarHeight: uni.getStorageSync("statusHeight") || 0,
status: 'nomore ',
showText: false,
target: 60,
modelVale: 100,
current: 0,
value: 0,
orderInfo: {},
form: {},
factoryIndex: -1,
factoryList: [],
subOrderList: [],
delInfo: {},
factoryEnum: {},
formData: {},
projectList: [],
projectIndex: -1,
queryData: {
offset: 0,
pageSize: 100
},
orgNoList: [],
submitStatusEnum: {
1: '已提交',
0: "待提交"
},
submitType: 1,
subList: [],
statusEnum: {
0: "点检中",
1: "已点检"
},
deviceTypeList: [],
deviceTypeEnum: {}
};
},
onLoad(option) {
if (option && option.id) {
this.id = option.id
this.onLoading();
}
},
methods: {
onUpdateDeviceInfo(i) {
uni.showLoading({
title: "提交中..."
})
updatePlanDeviceInfo(this.subList[i]).then(res => {
uni.hideLoading();
if (res.data.__sys__.status === 0) {
uni.showToast({
icon: "none",
title: "提交成功"
})
} else {
uni.showToast({
icon: "none",
title: res.data.__sys__.msg
})
}
})
},
onSubmit(t) {
this.content = '请确认设备是否已全部点检?'
this.show = true
},
onCancel() {
this.show = false;
},
onSave() {
this.show = false;
uni.showLoading({
title: "加载中..."
})
orderSubSave({
id: this.orderInfo.id,
checkStatus: '1'
}).then(res2 => {
uni.hideLoading();
if (res2.data.__sys__.status === 1) {
uni.showToast({
icon: "none",
title: "操作成功"
})
this.onGetList();
}
})
},
onBack() {
uni.redirectTo({
url: "/pages/device-inspection/index"
})
},
onLoading() {
getDict({
codeset: 'hpjx.hpsb.deviceType'
}).then(res => {
this.deviceTypeList = res.data.list.map(item => {
this.deviceTypeEnum[item.value] = item.label;
return item
})
this.onGetList();
})
},
onGetList() {
uni.showLoading({
title: "加载中"
})
getList({
inspecDate: "",
id: this.id
}).then(res => {
uni.hideLoading()
let list = toJsonData(res.data.__blocks__.result.rows, res.data.__blocks__.result.meta
.columns);
if (list && list.length) {
this.orderInfo = {
...list[0],
inspecDate: moment(list[0].inspecDate).format("YYYY-MM-DD"),
planStartDate: moment(list[0].planStartDate).format("YYYY-MM-DD"),
planEndDate: moment(list[0].planEndDate).format("YYYY-MM-DD")
}
}
this.onGetSubList();
})
},
onGetSubList() {
uni.showLoading({
title: "加载中"
})
getDeviceList({
parentId: this.id
}).then(res => {
uni.hideLoading()
this.subList = toJsonData(res.data.__blocks__.result.rows, res.data.__blocks__.result.meta
.columns)
})
}
}
}
</script>
<style>
page {
background-color: #f1f1f1;
}
</style>
<style lang="scss" scoped>
.cu-form-group {
picker {
padding-right: 0;
}
}
.header-title {
display: flex;
flex-direction: row;
width: 90%;
align-items: center;
margin: 30upx auto 12upx;
.flex-between {
display: flex;
flex: 1;
justify-content: center;
align-items: center;
border-radius: 20upx;
padding: 16upx 20upx;
background-color: rgba(246, 246, 248, 1);
.image {
width: 34upx;
margin-right: 8upx;
max-height: 42upx;
}
.text-blue {
color: #4a93f8;
font-weight: bold;
}
}
}
.u-tabs-box {
width: 70%;
margin: 0 auto;
}
.data-content {
display: flex;
flex-direction: column;
margin: 0 auto 30upx;
width: 96%;
.circle-par {
display: flex;
justify-content: center;
align-items: center;
}
.header {
border-radius: 12upx 12upx 0 0;
background-color: #eef2fe;
color: #101010;
font-size: 30upx;
border: 1px solid #d1dcfd;
padding: 14upx 24upx;
}
.content {
border-radius: 0 0 12upx 12upx;
background-color: #ffffff;
color: #101010;
font-size: 30upx;
border: 1px solid #cecece;
border-top: none;
}
}
.flex-content {
display: flex;
width: 100%;
justify-content: center;
}
.part-3 {
flex-direction: column;
padding-bottom: 120upx;
.content-item {
display: flex;
flex-direction: column;
width: 90%;
margin: 24upx auto 8upx;
padding-bottom: 24upx;
.header-title {
position: relative;
width: 100%;
margin: 0;
image {
width: 100%;
max-height: 100upx;
}
.flex-between {
position: absolute;
top: 0;
left: 12%;
width: 88%;
height: 70%;
padding: 0;
justify-content: space-between;
background-color: transparent;
}
}
.content-box {
position: relative;
z-index: 2;
box-shadow: 0 0 12upx rgba(0, 0, 0, 0.34);
border-radius: 12upx;
margin-top: -20upx;
background-color: #ffffff;
padding: 24upx;
.flex-wrap {
display: flex;
flex-wrap: wrap;
.margin-sm {
margin: 10upx;
}
}
}
}
.content-item:last-child {
border-bottom: none;
}
}
.flex-center {
display: flex;
align-items: center;
}
.line-progress {
align-items: center;
}
.u-page__item__slot-icon {
width: 24px;
height: 24px;
}
.part-left {
align-items: center;
}
.circle-center {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.margin-top-sm {
margin-top: 10upx;
}
.flex-row {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
}
.icon {
width: 36upx;
max-height: 50upx;
margin-right: 6upx;
}
.flex-row-center {
display: flex;
flex-direction: row;
align-items: center;
}
.content-part-1 {
display: flex;
flex-direction: column;
align-items: center;
.header {
display: flex;
flex-direction: row;
align-items: center;
width: 92%;
padding: 30upx 0;
image {
width: 20px;
height: 20px;
margin-right: 6upx;
}
}
.form-content-box {
display: flex;
flex-direction: column;
width: 100%;
padding: 12upx 0;
border-radius: 4upx;
// box-shadow: 0 0 8upx rgba(0, 0, 0, 0.34);
background-color: #ffffff;
.cu-form-group {
height: 32px;
min-height: 32px;
.title {
display: flex;
flex-direction: row;
width: 220upx;
align-items: center;
}
.text-blue {
white-space: normal;
}
}
.action-box {
display: flex;
flex-direction: row;
justify-content: flex-end;
}
}
.footer-content {
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 120upx;
margin-bottom: 100upx;
.btn-box {
width: 80%;
}
}
}
.order-content-box {
display: flex;
flex-direction: column;
width: 100%;
background-color: #ffffff;
.header {
display: flex;
flex-direction: row;
align-items: center;
width: 100%;
padding: 24upx;
image {
width: 20px;
height: 20px;
margin-right: 6upx;
}
}
.content-box {
position: relative;
z-index: 2;
padding: 0 24upx 24upx;
.flex-row {
margin: 6upx 0;
.text-title {
font-size: 30upx;
}
.part-1 {
font-size: 32upx;
width: 140upx;
text-align-last: justify;
}
.part-2 {
margin-right: 24upx;
}
}
.btn-box {
position: absolute;
right: 24upx;
bottom: 16upx;
}
}
}
.footer-box {
position: fixed;
left: 0;
bottom: 0;
display: flex;
flex-direction: row;
width: 100%;
padding: 24upx 36upx;
background-color: #ffffff;
z-index: 8;
.cu-btn {
display: flex;
flex: 1;
margin: 0 20upx;
}
}
.content-part-2 {
.form-content-box {
display: flex;
background-color: transparent;
justify-content: center;
}
.form-content-box:last-child {
margin-bottom: 120upx;
}
}
.sub-item-box {
display: flex;
flex-direction: column;
width: 94%;
margin: 0 auto 8upx;
padding-bottom: 24upx;
.item-form {
position: relative;
z-index: 2;
border-radius: 12upx;
background-color: #ffffff;
box-shadow: 0 0 6upx rgba(0, 0, 0, 0.34);
margin-top: -20upx;
padding: 24upx;
.flex-row-center {
height: auto;
justify-content: flex-end;
padding: 24upx 10upx 10upx 0;
}
}
.header-title {
position: relative;
width: 100%;
margin: 0;
image {
width: 100%;
max-height: 100upx;
}
.flex-between {
position: absolute;
top: 0;
left: 12%;
width: 88%;
height: 70%;
padding: 0;
justify-content: space-between;
background-color: transparent;
}
}
}
.cu-form-group uni-picker::after {
color: transparent;
}
</style>
\ No newline at end of file
<template>
<view>
<cu-custom bgColor="bg-blue" :isBack="true">
<block slot="backText">
<view class="list-icon" @tap="onBack">
<text class="cuIcon-back text-white text-bold text-xl"></text>
</view>
</block>
<block slot="content">
<text class="text-white">设备点检</text>
</block>
</cu-custom>
<u-tabbar zIndex="99" :value="value" :fixed="true" activeColor="#1890FF" :placeholder="false"
:safeAreaInsetBottom="false">
<u-tabbar-item text="点检单" @click="onNavChange">
<image class="u-page__item__slot-icon" slot="active-icon" :src="nav2"></image>
<image class="u-page__item__slot-icon" slot="inactive-icon" :src="nav1"></image>
</u-tabbar-item>
<u-tabbar-item text="点检计划" @click="onNavChange">
<image class="u-page__item__slot-icon" slot="active-icon" :src="nav4"></image>
<image class="u-page__item__slot-icon" slot="inactive-icon" :src="nav3"></image>
</u-tabbar-item>
</u-tabbar>
<view v-if="statusBarHeight>0" class="content-black" :style="{height:statusBarHeight+50+'px'}">
</view>
<view v-if="value===0" class="title-view">
<picker mode="selector" :range="factoryList" @change="onChange" range-key="label">
<view class="flex-row">
<text
class="text-title text-bold text-lg">{{factoryList.length? factoryList[index].label:'请选择'}}</text>
<view class="text-xl">
<text class="cuIcon-unfold"></text>
</view>
</view>
</picker>
</view>
<!-- <view v-else-if="value===1" class="title-view">
<u--input placeholder="请输入产品名称" v-model="queryData.productName" suffixIcon="search"
suffixIconStyle="color: #909399" :customStyle="{padding:'3px 6px'}" :fontSize="13" confirmType="search"
@blur="onSearchByName"></u--input>
</view> -->
<view v-if="value===0" class="flex-col data-content">
<view class="u-tabs-box">
<u-tabs :current="current" :list="tabList" @click="onChangeTab" :lineWidth="55" :scrollable="false"
lineColor="#0072fc" :activeStyle="{color: '#0072fc',fontWeight:'bold',fontSize:'16px'}"></u-tabs>
</view>
<view class="flex-col part-3">
<view v-for="(item,k) in projectDataList" :key="k" class="content-item" @tap="onNavTo(item)">
<view class="header-title">
<image src="../../static/icon5.png" mode="widthFix"></image>
<view class="flex-between">
<text class="text-black text-bold">{{item.companyName}}</text>
<view class="text-blue">
<!-- <text :class="item.status==1?'text-red':'text-gray'">{{statusEnum[item.status]}}</text> -->
<text>详情</text>
<text class="cuIcon-right"></text>
</view>
</view>
</view>
<view class="flex-col content-box">
<view class="flex-row">
<text class="text-gray part-1">点检单号</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.inspecCode}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">计划单号</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.planCode}}</text>
</view>
<view v-if="item.inspecDate" class="flex-row">
<text class="text-gray part-1">点检日期</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.inspecDate}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">开始日期</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.planStartDate}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">结束日期</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.planEndDate}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">点检人</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.inspecUserName}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">点检状态</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{statusEnum[item.checkStatus]}}</text>
</view>
</view>
</view>
<view v-if="projectDataList.length" style="padding: 12px 6% 0;">
<u-loadmore :status="status" :icon="true" :line='true' :loading-text="loadingText"
:loadmore-text="loadmoreText" :nomore-text="nomoreText" />
</view>
<view v-if="projectDataList.length <= 0" class="empty-box">
<u-empty text="暂无数据" textColor='#C1C1C1' width="120">
</u-empty>
</view>
</view>
</view>
<view v-else-if="value===1" class="flex-col data-content">
<view class="flex-col part-3">
<view v-for="(item,k) in subList" :key="k" class="content-item" @tap="onNavTo2(item)">
<view class="header-title">
<image src="../../static/icon5.png" mode="widthFix"></image>
<view class="flex-between">
<text class="text-black text-bold">{{item.companyName|| ''}}</text>
<view class="text-blue">
<!-- <text :class="item.status==1?'text-red':'text-gray'">{{statusEnum[item.status]}}</text> -->
<text>去点检</text>
<text class="cuIcon-right"></text>
</view>
</view>
</view>
<view class="flex-col content-box">
<view class="flex-row">
<text class="text-gray part-1">计划单号</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.planCode}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">设备区域</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.groupName}}</text>
</view>
<view v-if="item.inspecDate" class="flex-row">
<text class="text-gray part-1">点检日期</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.inspecDate}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">开始日期</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.planStartDate}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">结束日期</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.planEndDate}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">计划人</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.planUserName}}</text>
</view>
</view>
</view>
<view v-if="subList.length" style="padding: 12px 6% 0;">
<u-loadmore :status="status" :icon="true" :line='true' :loading-text="loadingText"
:loadmore-text="loadmoreText" :nomore-text="nomoreText" />
</view>
<view v-if="subList.length <= 0" class="empty-box">
<u-empty text="暂无数据" textColor='#C1C1C1' width="120">
</u-empty>
</view>
</view>
</view>
</view>
</template>
<script>
import nav1 from "@/static/big-data/nav_1.png"
import nav2 from "@/static/big-data/nav_1_active.png"
import nav3 from "@/static/big-data/nav_2.png"
import nav4 from "@/static/big-data/nav_2_active.png"
import {
pathToBase64,
base64ToPath
} from '@/utils/index.js'
import {
toJsonData
} from "@/utils/tools.js";
import moment from "@/common/moment.js";
import {
getParamsList
} from "@/api/product-order.js";
import {
getList,
getSubList
} from "@/api/device-inspection.js";
export default {
data() {
return {
nav1,
nav2,
nav3,
nav4,
projectDataList: [],
subList: [],
statusBarHeight: uni.getStorageSync("statusHeight") || 0,
status: 'nomore ',
loadingText: '努力加载中',
loadmoreText: '上划加载',
nomoreText: '到底啦',
showText: false,
target: 60,
modelVale: 100,
value: 0,
title: '日常巡检',
eChartData: [],
current: 0,
formData: {},
//不良品类
form: {},
index: 0,
factoryList: [{
value: "",
label: "全部"
}],
innerHeight: window.innerHeight,
innerWidth: window.innerWidth,
startTimeStamp: 0,
endTimeStamp: 0,
factoryEnum: {},
tabList: [{
name: '全部',
value: ''
},
{
name: '点检中',
value: 0
},
{
name: '已点检',
value: 1
}
],
statusEnum: {
0: "点检中",
1: "已点检"
},
queryData: {},
pageData: {
showCount: "true",
limit: 5,
offset: 0
},
unCount: 0,
count: 0,
countData: {},
subStatusEnum: {
0: '已收货',
1: '已入库',
2: '部分入库',
3: '退货'
}
};
},
onLoad(option) {
console.log(option, 99999)
this.value = Number(option.tabIndex) || 0;
this.onLoading();
},
onReachBottom() {
if (this.status == 'loadmore') {
this.pageData.offset += 1;
if (this.value == 1) {
this.onGetSubList();
} else {
this.onGetList();
}
}
},
methods: {
onBack() {
uni.redirectTo({
url: "/"
})
},
onLoading() {
getParamsList().then(res => {
let list = res.data.map(item => {
return {
label: item.companyName,
value: item.companyCode
}
})
this.factoryList = [...this.factoryList, ...list]
this.pageData.offset = 0;
this.projectDataList = [];
this.subList = []
if (this.value === 0) {
this.onGetList()
} else {
this.onGetSubList()
}
})
},
onGetList() {
uni.showLoading({
title: "加载中"
})
getList({
inspecDate: "",
companyCode: this.factoryList[this.index].value,
checkStatus: this.tabList[this.current].value
}, this.pageData).then(res => {
uni.hideLoading();
let list = toJsonData(res.data.__blocks__.result.rows, res.data.__blocks__.result.meta.columns)
.map(item => {
return {
...item,
receiptDate: moment(item.receiptDate).format("YYYY-MM-DD")
}
})
if (this.pageData.offset == 0) {
this.projectDataList = list
} else {
this.projectDataList = [...this.projectDataList, ...list]
}
if (this.projectDataList.length < res.data.__blocks__.result.attr.count) {
this.status = "loadmore"
} else {
this.status = 'nomore'
}
})
},
onSearchByName() {
this.pageData.offset = 0;
this.onGetSubList()
},
onGetSubList() {
uni.showLoading({
title: "加载中"
})
getSubList({
...this.queryData,
groupName: "",
planDate: "",
planType: "1",
taskStatus: "0",
planStatus: '1'
}, this.pageData).then(res => {
uni.hideLoading();
let list = toJsonData(res.data.__blocks__.result.rows, res.data.__blocks__.result.meta.columns)
.map(item => {
return {
...item,
receiveDate: moment(item.receiveDate).format("YYYY-MM-DD")
}
})
if (this.pageData.offset == 0) {
this.subList = list
} else {
this.subList = [...this.subList, ...list]
}
if (this.subList.length < res.data.__blocks__.result.attr.count) {
this.status = "loadmore"
} else {
this.status = 'nomore'
}
})
},
onChange(e) {
this.index = e.target.value;
this.pageData.offset = 0;
this.projectDataList = [];
this.subList = []
if (this.value === 0) {
this.onGetList()
} else {
this.onGetSubList()
}
},
onSearchByName() {
this.pageData.offset = 0;
this.onGetList();
},
onChangeTab(e) {
if (this.current === e.index) return;
this.current = e.index;
this.pageData.offset = 0
this.queryData.status = this.tabList[this.current].value;
this.onGetList();
},
onNavTo(val) {
uni.navigateTo({
url: `/pages/device-inspection/edit?id=${val.id}`
})
},
onNavTo2(val) {
uni.navigateTo({
url: `/pages/device-inspection/detail?id=${val.id}`
})
},
onNavChange(e) {
if (this.value === e) return;
this.value = e;
this.pageData.offset = 0;
this.projectDataList = [];
this.subList = []
if (this.value === 0) {
this.onGetList()
} else {
this.onGetSubList()
}
}
}
}
</script>
<style>
page {
background-color: #ffffff;
}
</style>
<style lang="scss" scoped>
.title-view {
padding: 20upx 30upx;
background: #ffffff;
}
.overview-view {
display: flex;
flex-direction: row;
padding: 20upx 0;
background: #ffffff;
border-bottom: 2px solid rgba(226, 226, 226, 0.6);
.part-1 {
display: flex;
flex: 1;
flex-direction: column;
justify-content: center;
align-items: center;
.text-black {
margin-top: 10upx;
}
}
.line {
display: flex;
width: 2px;
height: 100upx;
background-color: rgba(226, 226, 226, 0.6);
}
}
.page-content-box {
width: 100vw;
height: 100vh;
overflow: hidden;
}
.cu-form-group {
picker {
padding-right: 0;
}
}
.header-title {
display: flex;
flex-direction: row;
width: 90%;
align-items: center;
margin: 10upx auto 12upx;
.flex-between {
display: flex;
flex: 1;
justify-content: center;
align-items: center;
border-radius: 20upx;
padding: 16upx 20upx;
background-color: rgba(246, 246, 248, 1);
.image {
width: 34upx;
margin-right: 8upx;
max-height: 42upx;
}
.text-blue {
color: #4a93f8;
font-weight: bold;
}
}
}
.u-tabs-box {
width: 100%;
margin: 0 auto;
}
.data-content {
display: flex;
flex-direction: column;
margin: 0 auto 30upx;
width: 96%;
.circle-par {
display: flex;
justify-content: center;
align-items: center;
}
.header {
border-radius: 12upx 12upx 0 0;
background-color: #eef2fe;
color: #101010;
font-size: 30upx;
border: 1px solid #d1dcfd;
padding: 14upx 24upx;
}
.content {
border-radius: 0 0 12upx 12upx;
background-color: #ffffff;
color: #101010;
font-size: 30upx;
border: 1px solid #cecece;
border-top: none;
}
}
.flex-content {
display: flex;
width: 100%;
justify-content: center;
}
.part-3 {
flex-direction: column;
padding-bottom: 120upx;
.content-item {
display: flex;
flex-direction: column;
width: 94%;
margin: 24upx auto 8upx;
padding-bottom: 24upx;
.header-title {
position: relative;
width: 100%;
margin: 0;
image {
width: 100%;
max-height: 100upx;
}
.flex-between {
position: absolute;
top: 0;
left: 12%;
width: 88%;
height: 70%;
padding: 0;
justify-content: space-between;
background-color: transparent;
}
}
.content-box {
position: relative;
z-index: 2;
box-shadow: 0 0 12upx rgba(0, 0, 0, 0.34);
border-radius: 12upx;
margin-top: -20upx;
background-color: #ffffff;
padding: 24upx;
.flex-row {
margin: 6upx 0;
align-items: center;
.part-1 {
width: 140upx;
text-align-last: justify;
}
.part-2 {
margin-right: 24upx;
}
.text-title {
display: flex;
flex: 1;
}
}
}
}
.content-item:last-child {
border-bottom: none;
}
}
.flex-center {
display: flex;
align-items: center;
}
.line-progress {
align-items: center;
}
.u-page__item__slot-icon {
width: 24px;
height: 24px;
}
.part-left {
align-items: center;
}
.circle-center {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.margin-top-sm {
margin-top: 10upx;
}
.flex-row {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
}
.icon {
width: 36upx;
max-height: 50upx;
margin-right: 6upx;
}
.flex-row-center {
display: flex;
flex-direction: row;
align-items: center;
}
.content-part-1 {
display: flex;
flex-direction: column;
align-items: center;
.header {
display: flex;
flex-direction: row;
align-items: center;
width: 92%;
padding: 30upx 0;
image {
width: 20px;
height: 20px;
margin-right: 6upx;
}
}
.form-content-box {
width: 92%;
padding: 12upx 0;
border-radius: 12upx;
box-shadow: 0 0 8upx rgba(0, 0, 0, 0.34);
background-color: #ffffff;
.cu-form-group {
.title {
display: flex;
flex-direction: row;
width: 240upx;
align-items: center;
}
}
}
.footer-content {
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 120upx;
margin-bottom: 100upx;
.btn-box {
width: 80%;
}
}
}
</style>
\ No newline at end of file
<template>
<view>
<cu-custom bgColor="bg-blue" :isBack="true">
<block slot="backText">
<view class="list-icon" @tap="onBack">
<text class="cuIcon-back text-white text-bold text-xl"></text>
</view>
</block>
<block slot="content">
<text class="text-white">保养计划详情</text>
</block>
</cu-custom>
<view v-if="statusBarHeight>0" class="content-black" :style="{height:statusBarHeight+45+'px'}">
</view>
<view class="flex-col content-part-1">
<view class="flex-row header">
<image src="../../static/icon10.png" mode="widthFix"></image>
<text class="text-lg text-bold text-black">详情</text>
</view>
<view class="form-content-box">
<form>
<view class="cu-form-group">
<view class="title">
<text>公司名称:</text>
</view>
<view class="">
<text>{{orderInfo.companyName}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>计划单号:</text>
</view>
<view class="">
<text>{{orderInfo.planCode}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>开始日期:</text>
</view>
<view class="">
<text>{{orderInfo.planStartDate}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>结束日期:</text>
</view>
<view class="">
<text>{{orderInfo.planEndDate}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>计划人:</text>
</view>
<view class="">
<text>{{orderInfo.planUserName}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>任务状态:</text>
</view>
<view class="">
<text>{{statusEnum[orderInfo.taskStatus]}}</text>
</view>
</view>
</form>
</view>
</view>
<view class="flex-col content-part-1 content-part-2">
<view class="flex-row header">
<text class="text-lg text-bold text-black">设备明细</text>
</view>
<view class="form-content-box margin-bottom">
<view v-for="(item,i) in subList" :key="i" class="sub-item-box">
<form class="item-form">
<view class="cu-form-group">
<view class="title">
<text>设备名称:</text>
</view>
<view class="">
<text>{{item.deviceName}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>设备编码:</text>
</view>
<view class="">
<text>{{item.deviceCode}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>设备区域:</text>
</view>
<view class="">
<text>{{item.groupName}}</text>
</view>
</view>
<view v-if="item.deviceModel.length>2" class="cu-form-group">
<view class="title">
<text>设备型号:</text>
</view>
<view class="">
<text>{{item.deviceModel}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>设备类型:</text>
</view>
<view class="">
<text>{{deviceTypeEnum[item.deviceType]}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>检查项:</text>
</view>
<view class="">
<text>{{item.checkItem}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>检查描述:</text>
</view>
<view class="">
<text>{{item.checkDescrip}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>检查结果:</text>
</view>
<view class="">
<text>{{item.checkResult}}</text>
</view>
</view>
</form>
</view>
</view>
<view v-if="subList.length <= 0" class="empty-box">
<u-empty text="暂无数据" textColor='#C1C1C1' width="120">
</u-empty>
</view>
</view>
<view v-if="orderInfo.taskStatus < 1" class="footer-box">
<button class="cu-btn block bg-blue" @tap="onSubmit">立即领取</button>
</view>
<u-modal :show="show" title="提示" :content='content' :showCancelButton="true" @confirm="onSave"
@cancel="onCancel" :asyncClose="true"></u-modal>
</view>
</template>
<script>
import {
getDict
} from "@/api/index.js";
import {toJsonData} from "@/utils/tools.js";
import moment from "@/common/moment.js";
import { getSubList,getPlanDeviceList,orderSave } from "@/api/device-maintain.js";
export default {
data() {
return {
show: false,
show2: false,
border: "none",
minDate: moment().subtract(2, 'M').format("YYYY-MM-DD"),
content: "请确认是否进行入库提交操作?",
addStatus: false,
statusBarHeight: uni.getStorageSync("statusHeight") || 0,
status: 'nomore ',
showText: false,
target: 60,
modelVale: 100,
current: 0,
value: 0,
orderInfo: {},
form: {},
factoryIndex: -1,
factoryList: [],
subOrderList: [],
delInfo: {},
factoryEnum: {},
formData: {},
projectList: [],
projectIndex: -1,
queryData: {
offset: 0,
pageSize: 100
},
userInfo: uni.getStorageSync("userInfor"),
orgNoList: [],
submitStatusEnum: {
1: '已提交',
0: "待提交"
},
submitType: 1,
subList: [],
statusEnum: {
0: "待领取",
1: "已领取"
},
deviceTypeList:[],
deviceTypeEnum:{}
};
},
onLoad(option) {
if (option && option.id) {
this.id = option.id
this.onLoading();
}
},
methods: {
onSubmit(t) {
this.content = '请确认是否领取计划单?'
this.show = true
},
onOpenCalendar() {
this.show2 = true;
},
onCancel() {
this.show = false;
this.show2 = false;
},
onSave() {
this.show = false;
uni.showLoading({
title: "加载中..."
})
orderSave({
...this.orderInfo,
taskStatus:'0'
},{
pageNumber:'HGSB005',
inspecUserId:this.userInfo.userId,
inspecUserName:this.userInfo.userName
}).then(res2 => {
uni.hideLoading();
if (res2.data.__sys__.status === 0) {
uni.showToast({
icon: "none",
title: "操作成功"
})
this.onBack();
}
})
},
onProjectChange(e) {
let index = Number(e.target.value);
if (this.projectIndex === index) return
this.projectIndex = index;
},
onBack() {
uni.redirectTo({
url: "/pages/device-maintain/index"
})
},
onLoading() {
getDict({
codeset: 'hpjx.hpsb.deviceType'
}).then(res => {
this.deviceTypeList = res.data.list.map( item => {
this.deviceTypeEnum[item.value] = item.label;
return item
})
this.onGetList();
})
},
onGetList() {
uni.showLoading({
title: "加载中"
})
getSubList({
planDate: "",
id: this.id
}).then(res => {
uni.hideLoading()
let list = toJsonData(res.data.__blocks__.result.rows, res.data.__blocks__.result.meta
.columns);
if (list && list.length) {
this.orderInfo = list[0]
}
this.onGetSubList();
})
},
onGetSubList() {
uni.showLoading({
title: "加载中"
})
getPlanDeviceList({
parentId: this.id
}).then(res => {
uni.hideLoading()
this.subList = toJsonData(res.data.__blocks__.result.rows, res.data.__blocks__.result.meta
.columns).map(item => {
let updatedTime = item.createdTime ? item.createdTime.split('') : [];
return {
...item,
createdTime: updatedTime.length >= 13 ?
`${updatedTime[0]}${updatedTime[1]}${updatedTime[2]}${updatedTime[3]}/${updatedTime[4]}${updatedTime[5]}/${updatedTime[6]}${updatedTime[7]} ${updatedTime[8]}${updatedTime[9]}:${updatedTime[10]}${updatedTime[11]}:${updatedTime[12]}${updatedTime[13]}` :
''
}
});
})
}
}
}
</script>
<style>
page {
background-color: #f1f1f1;
}
</style>
<style lang="scss" scoped>
.cu-form-group {
picker {
padding-right: 0;
}
}
.header-title {
display: flex;
flex-direction: row;
width: 90%;
align-items: center;
margin: 30upx auto 12upx;
.flex-between {
display: flex;
flex: 1;
justify-content: center;
align-items: center;
border-radius: 20upx;
padding: 16upx 20upx;
background-color: rgba(246, 246, 248, 1);
.image {
width: 34upx;
margin-right: 8upx;
max-height: 42upx;
}
.text-blue {
color: #4a93f8;
font-weight: bold;
}
}
}
.u-tabs-box {
width: 70%;
margin: 0 auto;
}
.data-content {
display: flex;
flex-direction: column;
margin: 0 auto 30upx;
width: 96%;
.circle-par {
display: flex;
justify-content: center;
align-items: center;
}
.header {
border-radius: 12upx 12upx 0 0;
background-color: #eef2fe;
color: #101010;
font-size: 30upx;
border: 1px solid #d1dcfd;
padding: 14upx 24upx;
}
.content {
border-radius: 0 0 12upx 12upx;
background-color: #ffffff;
color: #101010;
font-size: 30upx;
border: 1px solid #cecece;
border-top: none;
}
}
.flex-content {
display: flex;
width: 100%;
justify-content: center;
}
.part-3 {
flex-direction: column;
padding-bottom: 120upx;
.content-item {
display: flex;
flex-direction: column;
width: 90%;
margin: 24upx auto 8upx;
padding-bottom: 24upx;
.header-title {
position: relative;
width: 100%;
margin: 0;
image {
width: 100%;
max-height: 100upx;
}
.flex-between {
position: absolute;
top: 0;
left: 12%;
width: 88%;
height: 70%;
padding: 0;
justify-content: space-between;
background-color: transparent;
}
}
.content-box {
position: relative;
z-index: 2;
box-shadow: 0 0 12upx rgba(0, 0, 0, 0.34);
border-radius: 12upx;
margin-top: -20upx;
background-color: #ffffff;
padding: 24upx;
.flex-wrap {
display: flex;
flex-wrap: wrap;
.margin-sm {
margin: 10upx;
}
}
}
}
.content-item:last-child {
border-bottom: none;
}
}
.flex-center {
display: flex;
align-items: center;
}
.line-progress {
align-items: center;
}
.u-page__item__slot-icon {
width: 24px;
height: 24px;
}
.part-left {
align-items: center;
}
.circle-center {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.margin-top-sm {
margin-top: 10upx;
}
.flex-row {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
}
.icon {
width: 36upx;
max-height: 50upx;
margin-right: 6upx;
}
.flex-row-center {
display: flex;
flex-direction: row;
align-items: center;
}
.content-part-1 {
display: flex;
flex-direction: column;
align-items: center;
.header {
display: flex;
flex-direction: row;
align-items: center;
width: 92%;
padding: 30upx 0;
image {
width: 20px;
height: 20px;
margin-right: 6upx;
}
}
.form-content-box {
display: flex;
flex-direction: column;
width: 100%;
padding: 12upx 0;
border-radius: 4upx;
// box-shadow: 0 0 8upx rgba(0, 0, 0, 0.34);
background-color: #ffffff;
.cu-form-group {
height: 32px;
min-height: 32px;
.title {
display: flex;
flex-direction: row;
width: 220upx;
align-items: center;
}
.text-blue {
white-space: normal;
}
}
.action-box {
display: flex;
flex-direction: row;
justify-content: flex-end;
}
}
.footer-content {
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 120upx;
margin-bottom: 100upx;
.btn-box {
width: 80%;
}
}
}
.order-content-box {
display: flex;
flex-direction: column;
width: 100%;
background-color: #ffffff;
.header {
display: flex;
flex-direction: row;
align-items: center;
width: 100%;
padding: 24upx;
image {
width: 20px;
height: 20px;
margin-right: 6upx;
}
}
.content-box {
position: relative;
z-index: 2;
padding: 0 24upx 24upx;
.flex-row {
margin: 6upx 0;
.text-title {
font-size: 30upx;
}
.part-1 {
font-size: 32upx;
width: 140upx;
text-align-last: justify;
}
.part-2 {
margin-right: 24upx;
}
}
.btn-box {
position: absolute;
right: 24upx;
bottom: 16upx;
}
}
}
.footer-box {
position: fixed;
left: 0;
bottom: 0;
display: flex;
flex-direction: row;
width: 100%;
padding: 24upx 36upx;
background-color: #ffffff;
z-index: 8;
.cu-btn {
display: flex;
flex: 1;
margin: 0 20upx;
}
}
.content-part-2 {
.form-content-box {
display: flex;
background-color: transparent;
justify-content: center;
}
.form-content-box:last-child {
margin-bottom: 120upx;
}
}
.sub-item-box {
display: flex;
flex-direction: column;
width: 94%;
margin: 0 auto 8upx;
padding-bottom: 24upx;
.item-form {
position: relative;
z-index: 2;
border-radius: 12upx;
background-color: #ffffff;
box-shadow: 0 0 6upx rgba(0, 0, 0, 0.34);
margin-top: -20upx;
padding: 24upx;
}
.header-title {
position: relative;
width: 100%;
margin: 0;
image {
width: 100%;
max-height: 100upx;
}
.flex-between {
position: absolute;
top: 0;
left: 12%;
width: 88%;
height: 70%;
padding: 0;
justify-content: space-between;
background-color: transparent;
}
}
}
.cu-form-group uni-picker::after {
color: transparent;
}
</style>
\ No newline at end of file
<template>
<view>
<cu-custom bgColor="bg-blue" :isBack="true">
<block slot="backText">
<view class="list-icon" @tap="onBack">
<text class="cuIcon-back text-white text-bold text-xl"></text>
</view>
</block>
<block slot="content">
<text class="text-white">保养详情</text>
</block>
</cu-custom>
<view v-if="statusBarHeight>0" class="content-black" :style="{height:statusBarHeight+45+'px'}">
</view>
<view class="flex-col content-part-1">
<view class="flex-row header">
<image src="../../static/icon10.png" mode="widthFix"></image>
<text class="text-lg text-bold text-black">详情</text>
</view>
<view class="form-content-box">
<form>
<view class="cu-form-group">
<view class="title">
<text>公司名称:</text>
</view>
<view class="">
<text>{{orderInfo.companyName}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>保养单号:</text>
</view>
<view class="">
<text>{{orderInfo.upkeepCode}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>计划单号:</text>
</view>
<view class="">
<text>{{orderInfo.planCode}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>保养日期:</text>
</view>
<view class="">
<text>{{orderInfo.upkeepDate}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>开始日期:</text>
</view>
<view class="">
<text>{{orderInfo.planStartDate}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>结束日期:</text>
</view>
<view class="">
<text>{{orderInfo.planEndDate}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>保养人名称:</text>
</view>
<view class="">
<text>{{orderInfo.upkeepUserName || orderInfo.upkeepUserId}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>提交状态:</text>
</view>
<view class="">
<text>{{statusEnum[orderInfo.checkStatus]}}</text>
</view>
</view>
</form>
</view>
</view>
<view class="flex-col content-part-1 content-part-2">
<view class="flex-row header">
<text class="text-lg text-bold text-black">设备明细</text>
</view>
<view class="form-content-box margin-bottom">
<view v-for="(item,i) in subList" :key="i" class="sub-item-box">
<form class="item-form">
<view class="cu-form-group">
<view class="title">
<text>设备名称:</text>
</view>
<view class="">
<text>{{item.deviceName}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>设备编码:</text>
</view>
<view class="">
<text>{{item.deviceCode}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>设备区域:</text>
</view>
<view class="">
<text>{{item.groupName}}</text>
</view>
</view>
<view v-if="item.deviceModel.length>2" class="cu-form-group">
<view class="title">
<text>设备型号:</text>
</view>
<view class="">
<text>{{item.deviceModel}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>设备类型:</text>
</view>
<view class="">
<text>{{deviceTypeEnum[item.deviceType]}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>检查项:</text>
</view>
<view class="">
<text>{{item.checkItem}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>检查描述:</text>
</view>
<view v-if="orderInfo.checkStatus < 1" class="">
<u-input v-model="item.checkDescrip" color="#0081ff" inputAlign="right" type="text"
:border="border" placeholder="请输入检查描述" />
</view>
<view v-else class="">
<text>{{item.checkDescrip}}</text>
</view>
</view>
<view class="cu-form-group">
<view class="title">
<text>检查结果:</text>
</view>
<view v-if="orderInfo.checkStatus < 1" class="">
<u-input v-model="item.checkResult" color="#0081ff" inputAlign="right" type="text"
:border="border" placeholder="请输入检查结果" />
</view>
<view v-else class="">
<text>{{item.checkResult}}</text>
</view>
</view>
<view v-if="orderInfo.checkStatus < 1" class="cu-form-group flex-row-center">
<button class="cu-btn bg-green sm" @tap="onUpdateDeviceInfo(i)">保养提交</button>
</view>
</form>
</view>
</view>
<view v-if="subList.length <= 0" class="empty-box">
<u-empty text="暂无数据" textColor='#C1C1C1' width="120">
</u-empty>
</view>
</view>
<view v-if="orderInfo.checkStatus < 1" class="footer-box">
<button class="cu-btn block bg-blue" @tap="onSubmit">保养完成</button>
</view>
<u-modal :show="show" title="提示" :content='content' :showCancelButton="true" @confirm="onSave"
@cancel="onCancel" :asyncClose="true"></u-modal>
</view>
</template>
<script>
import {
getDict
} from "@/api/index.js";
import {
toJsonData
} from "@/utils/tools.js";
import moment from "@/common/moment.js";
import {
getList,
getDeviceList,
orderSubSave,
updatePlanDeviceInfo
} from "@/api/device-maintain.js";
export default {
data() {
return {
show: false,
show2: false,
border: "none",
minDate: moment().subtract(2, 'M').format("YYYY-MM-DD"),
content: "请确认是否进行入库提交操作?",
addStatus: false,
statusBarHeight: uni.getStorageSync("statusHeight") || 0,
status: 'nomore ',
showText: false,
target: 60,
modelVale: 100,
current: 0,
value: 0,
orderInfo: {},
form: {},
factoryIndex: -1,
factoryList: [],
subOrderList: [],
delInfo: {},
factoryEnum: {},
formData: {},
projectList: [],
projectIndex: -1,
queryData: {
offset: 0,
pageSize: 100
},
orgNoList: [],
submitStatusEnum: {
1: '已提交',
0: "待提交"
},
submitType: 1,
subList: [],
statusEnum: {
0: "保养中",
1: "已保养"
},
deviceTypeList: [],
deviceTypeEnum: {}
};
},
onLoad(option) {
if (option && option.id) {
this.id = option.id
this.onLoading();
}
},
methods: {
onUpdateDeviceInfo(i) {
uni.showLoading({
title: "提交中..."
})
updatePlanDeviceInfo(this.subList[i]).then(res => {
uni.hideLoading();
if (res.data.__sys__.status === 0) {
uni.showToast({
icon: "none",
title: "提交成功"
})
} else {
uni.showToast({
icon: "none",
title: res.data.__sys__.msg
})
}
})
},
onSubmit(t) {
this.content = '请确认设备是否已全部保养?'
this.show = true
},
onCancel() {
this.show = false;
},
onSave() {
this.show = false;
uni.showLoading({
title: "加载中..."
})
orderSubSave({
id: this.orderInfo.id,
checkStatus: '1'
}).then(res2 => {
uni.hideLoading();
if (res2.data.__sys__.status === 1) {
uni.showToast({
icon: "none",
title: "操作成功"
})
this.onGetList();
}
})
},
onBack() {
uni.redirectTo({
url: "/pages/device-maintain/index"
})
},
onLoading() {
getDict({
codeset: 'hpjx.hpsb.deviceType'
}).then(res => {
this.deviceTypeList = res.data.list.map(item => {
this.deviceTypeEnum[item.value] = item.label;
return item
})
this.onGetList();
})
},
onGetList() {
uni.showLoading({
title: "加载中"
})
getList({
upkeepDate: "",
id: this.id
}).then(res => {
uni.hideLoading()
let list = toJsonData(res.data.__blocks__.result.rows, res.data.__blocks__.result.meta
.columns);
if (list && list.length) {
this.orderInfo = {
...list[0],
upkeepDate: moment(list[0].upkeepDate).format("YYYY-MM-DD"),
planStartDate: moment(list[0].planStartDate).format("YYYY-MM-DD"),
planEndDate: moment(list[0].planEndDate).format("YYYY-MM-DD")
}
}
this.onGetSubList();
})
},
onGetSubList() {
uni.showLoading({
title: "加载中"
})
getDeviceList({
parentId: this.id
}).then(res => {
uni.hideLoading()
this.subList = toJsonData(res.data.__blocks__.result.rows, res.data.__blocks__.result.meta
.columns)
})
}
}
}
</script>
<style>
page {
background-color: #f1f1f1;
}
</style>
<style lang="scss" scoped>
.cu-form-group {
picker {
padding-right: 0;
}
}
.header-title {
display: flex;
flex-direction: row;
width: 90%;
align-items: center;
margin: 30upx auto 12upx;
.flex-between {
display: flex;
flex: 1;
justify-content: center;
align-items: center;
border-radius: 20upx;
padding: 16upx 20upx;
background-color: rgba(246, 246, 248, 1);
.image {
width: 34upx;
margin-right: 8upx;
max-height: 42upx;
}
.text-blue {
color: #4a93f8;
font-weight: bold;
}
}
}
.u-tabs-box {
width: 70%;
margin: 0 auto;
}
.data-content {
display: flex;
flex-direction: column;
margin: 0 auto 30upx;
width: 96%;
.circle-par {
display: flex;
justify-content: center;
align-items: center;
}
.header {
border-radius: 12upx 12upx 0 0;
background-color: #eef2fe;
color: #101010;
font-size: 30upx;
border: 1px solid #d1dcfd;
padding: 14upx 24upx;
}
.content {
border-radius: 0 0 12upx 12upx;
background-color: #ffffff;
color: #101010;
font-size: 30upx;
border: 1px solid #cecece;
border-top: none;
}
}
.flex-content {
display: flex;
width: 100%;
justify-content: center;
}
.part-3 {
flex-direction: column;
padding-bottom: 120upx;
.content-item {
display: flex;
flex-direction: column;
width: 90%;
margin: 24upx auto 8upx;
padding-bottom: 24upx;
.header-title {
position: relative;
width: 100%;
margin: 0;
image {
width: 100%;
max-height: 100upx;
}
.flex-between {
position: absolute;
top: 0;
left: 12%;
width: 88%;
height: 70%;
padding: 0;
justify-content: space-between;
background-color: transparent;
}
}
.content-box {
position: relative;
z-index: 2;
box-shadow: 0 0 12upx rgba(0, 0, 0, 0.34);
border-radius: 12upx;
margin-top: -20upx;
background-color: #ffffff;
padding: 24upx;
.flex-wrap {
display: flex;
flex-wrap: wrap;
.margin-sm {
margin: 10upx;
}
}
}
}
.content-item:last-child {
border-bottom: none;
}
}
.flex-center {
display: flex;
align-items: center;
}
.line-progress {
align-items: center;
}
.u-page__item__slot-icon {
width: 24px;
height: 24px;
}
.part-left {
align-items: center;
}
.circle-center {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.margin-top-sm {
margin-top: 10upx;
}
.flex-row {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
}
.icon {
width: 36upx;
max-height: 50upx;
margin-right: 6upx;
}
.flex-row-center {
display: flex;
flex-direction: row;
align-items: center;
}
.content-part-1 {
display: flex;
flex-direction: column;
align-items: center;
.header {
display: flex;
flex-direction: row;
align-items: center;
width: 92%;
padding: 30upx 0;
image {
width: 20px;
height: 20px;
margin-right: 6upx;
}
}
.form-content-box {
display: flex;
flex-direction: column;
width: 100%;
padding: 12upx 0;
border-radius: 4upx;
// box-shadow: 0 0 8upx rgba(0, 0, 0, 0.34);
background-color: #ffffff;
.cu-form-group {
height: 32px;
min-height: 32px;
.title {
display: flex;
flex-direction: row;
width: 220upx;
align-items: center;
}
.text-blue {
white-space: normal;
}
}
.action-box {
display: flex;
flex-direction: row;
justify-content: flex-end;
}
}
.footer-content {
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 120upx;
margin-bottom: 100upx;
.btn-box {
width: 80%;
}
}
}
.order-content-box {
display: flex;
flex-direction: column;
width: 100%;
background-color: #ffffff;
.header {
display: flex;
flex-direction: row;
align-items: center;
width: 100%;
padding: 24upx;
image {
width: 20px;
height: 20px;
margin-right: 6upx;
}
}
.content-box {
position: relative;
z-index: 2;
padding: 0 24upx 24upx;
.flex-row {
margin: 6upx 0;
.text-title {
font-size: 30upx;
}
.part-1 {
font-size: 32upx;
width: 140upx;
text-align-last: justify;
}
.part-2 {
margin-right: 24upx;
}
}
.btn-box {
position: absolute;
right: 24upx;
bottom: 16upx;
}
}
}
.footer-box {
position: fixed;
left: 0;
bottom: 0;
display: flex;
flex-direction: row;
width: 100%;
padding: 24upx 36upx;
background-color: #ffffff;
z-index: 8;
.cu-btn {
display: flex;
flex: 1;
margin: 0 20upx;
}
}
.content-part-2 {
.form-content-box {
display: flex;
background-color: transparent;
justify-content: center;
}
.form-content-box:last-child {
margin-bottom: 120upx;
}
}
.sub-item-box {
display: flex;
flex-direction: column;
width: 94%;
margin: 0 auto 8upx;
padding-bottom: 24upx;
.item-form {
position: relative;
z-index: 2;
border-radius: 12upx;
background-color: #ffffff;
box-shadow: 0 0 6upx rgba(0, 0, 0, 0.34);
margin-top: -20upx;
padding: 24upx;
.flex-row-center {
height: auto;
justify-content: flex-end;
padding: 24upx 10upx 10upx 0;
}
}
.header-title {
position: relative;
width: 100%;
margin: 0;
image {
width: 100%;
max-height: 100upx;
}
.flex-between {
position: absolute;
top: 0;
left: 12%;
width: 88%;
height: 70%;
padding: 0;
justify-content: space-between;
background-color: transparent;
}
}
}
.cu-form-group uni-picker::after {
color: transparent;
}
</style>
\ No newline at end of file
<template>
<view>
<cu-custom bgColor="bg-blue" :isBack="true">
<block slot="backText">
<view class="list-icon" @tap="onBack">
<text class="cuIcon-back text-white text-bold text-xl"></text>
</view>
</block>
<block slot="content">
<text class="text-white">设备保养</text>
</block>
</cu-custom>
<u-tabbar zIndex="99" :value="value" :fixed="true" activeColor="#1890FF" :placeholder="false"
:safeAreaInsetBottom="false">
<u-tabbar-item text="保养单" @click="onNavChange">
<image class="u-page__item__slot-icon" slot="active-icon" :src="nav2"></image>
<image class="u-page__item__slot-icon" slot="inactive-icon" :src="nav1"></image>
</u-tabbar-item>
<u-tabbar-item text="保养计划" @click="onNavChange">
<image class="u-page__item__slot-icon" slot="active-icon" :src="nav4"></image>
<image class="u-page__item__slot-icon" slot="inactive-icon" :src="nav3"></image>
</u-tabbar-item>
</u-tabbar>
<view v-if="statusBarHeight>0" class="content-black" :style="{height:statusBarHeight+50+'px'}">
</view>
<view v-if="value===0" class="title-view">
<picker mode="selector" :range="factoryList" @change="onChange" range-key="label">
<view class="flex-row">
<text
class="text-title text-bold text-lg">{{factoryList.length? factoryList[index].label:'请选择'}}</text>
<view class="text-xl">
<text class="cuIcon-unfold"></text>
</view>
</view>
</picker>
</view>
<!-- <view v-else-if="value===1" class="title-view">
<u--input placeholder="请输入产品名称" v-model="queryData.productName" suffixIcon="search"
suffixIconStyle="color: #909399" :customStyle="{padding:'3px 6px'}" :fontSize="13" confirmType="search"
@blur="onSearchByName"></u--input>
</view> -->
<view v-if="value===0" class="flex-col data-content">
<view class="u-tabs-box">
<u-tabs :current="current" :list="tabList" @click="onChangeTab" :lineWidth="55" :scrollable="false"
lineColor="#0072fc" :activeStyle="{color: '#0072fc',fontWeight:'bold',fontSize:'16px'}"></u-tabs>
</view>
<view class="flex-col part-3">
<view v-for="(item,k) in projectDataList" :key="k" class="content-item" @tap="onNavTo(item)">
<view class="header-title">
<image src="../../static/icon5.png" mode="widthFix"></image>
<view class="flex-between">
<text class="text-black text-bold">{{item.companyName}}</text>
<view class="text-blue">
<!-- <text :class="item.status==1?'text-red':'text-gray'">{{statusEnum[item.status]}}</text> -->
<text>详情</text>
<text class="cuIcon-right"></text>
</view>
</view>
</view>
<view class="flex-col content-box">
<view class="flex-row">
<text class="text-gray part-1">保养单号</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.upkeepCode}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">计划单号</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.planCode}}</text>
</view>
<view v-if="item.upkeepDate" class="flex-row">
<text class="text-gray part-1">保养日期</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.upkeepDate}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">开始日期</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.planStartDate}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">结束日期</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.planEndDate}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">保养人</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.upkeepUserName}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">保养状态</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{statusEnum[item.checkStatus]}}</text>
</view>
</view>
</view>
<view v-if="projectDataList.length" style="padding: 12px 6% 0;">
<u-loadmore :status="status" :icon="true" :line='true' :loading-text="loadingText"
:loadmore-text="loadmoreText" :nomore-text="nomoreText" />
</view>
<view v-if="projectDataList.length <= 0" class="empty-box">
<u-empty text="暂无数据" textColor='#C1C1C1' width="120">
</u-empty>
</view>
</view>
</view>
<view v-else-if="value===1" class="flex-col data-content">
<view class="flex-col part-3">
<view v-for="(item,k) in subList" :key="k" class="content-item" @tap="onNavTo2(item)">
<view class="header-title">
<image src="../../static/icon5.png" mode="widthFix"></image>
<view class="flex-between">
<text class="text-black text-bold">{{item.companyName|| ''}}</text>
<view class="text-blue">
<!-- <text :class="item.status==1?'text-red':'text-gray'">{{statusEnum[item.status]}}</text> -->
<text>去保养</text>
<text class="cuIcon-right"></text>
</view>
</view>
</view>
<view class="flex-col content-box">
<view class="flex-row">
<text class="text-gray part-1">计划单号</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.planCode}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">设备区域</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.groupName}}</text>
</view>
<view v-if="item.inspecDate" class="flex-row">
<text class="text-gray part-1">点检日期</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.inspecDate}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">开始日期</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.planStartDate}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">结束日期</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.planEndDate}}</text>
</view>
<view class="flex-row">
<text class="text-gray part-1">计划人</text>
<text class="text-gray part-2">:</text>
<text class="text-title">{{item.planUserName}}</text>
</view>
</view>
</view>
<view v-if="subList.length" style="padding: 12px 6% 0;">
<u-loadmore :status="status" :icon="true" :line='true' :loading-text="loadingText"
:loadmore-text="loadmoreText" :nomore-text="nomoreText" />
</view>
<view v-if="subList.length <= 0" class="empty-box">
<u-empty text="暂无数据" textColor='#C1C1C1' width="120">
</u-empty>
</view>
</view>
</view>
</view>
</template>
<script>
import nav1 from "@/static/big-data/nav_1.png"
import nav2 from "@/static/big-data/nav_1_active.png"
import nav3 from "@/static/big-data/nav_2.png"
import nav4 from "@/static/big-data/nav_2_active.png"
import {
pathToBase64,
base64ToPath
} from '@/utils/index.js'
import {
toJsonData
} from "@/utils/tools.js";
import moment from "@/common/moment.js";
import {
getParamsList
} from "@/api/product-order.js";
import {
getList,
getSubList
} from "@/api/device-maintain.js";
export default {
data() {
return {
nav1,
nav2,
nav3,
nav4,
projectDataList: [],
subList: [],
statusBarHeight: uni.getStorageSync("statusHeight") || 0,
status: 'nomore ',
loadingText: '努力加载中',
loadmoreText: '上划加载',
nomoreText: '到底啦',
showText: false,
target: 60,
modelVale: 100,
value: 0,
title: '日常巡检',
eChartData: [],
current: 0,
formData: {},
//不良品类
form: {},
index: 0,
factoryList: [{
value: "",
label: "全部"
}],
innerHeight: window.innerHeight,
innerWidth: window.innerWidth,
startTimeStamp: 0,
endTimeStamp: 0,
factoryEnum: {},
tabList: [{
name: '全部',
value: ''
},
{
name: '保养中',
value: 0
},
{
name: '已保养',
value: 1
}
],
statusEnum: {
0: "保养中",
1: "已保养"
},
queryData: {},
pageData: {
showCount: "true",
limit: 5,
offset: 0
}
};
},
onLoad(option) {
console.log(option, 99999)
this.value = Number(option.tabIndex) || 0;
this.onLoading();
},
onReachBottom() {
if (this.status == 'loadmore') {
this.pageData.offset += 1;
if (this.value == 1) {
this.onGetSubList();
} else {
this.onGetList();
}
}
},
methods: {
onBack() {
uni.redirectTo({
url: "/"
})
},
onLoading() {
getParamsList().then(res => {
let list = res.data.map(item => {
return {
label: item.companyName,
value: item.companyCode
}
})
this.factoryList = [...this.factoryList, ...list]
this.pageData.offset = 0;
this.projectDataList = [];
this.subList = []
if (this.value === 0) {
this.onGetList()
} else {
this.onGetSubList()
}
})
},
onGetList() {
uni.showLoading({
title: "加载中"
})
getList({
upkeepDate: "",
companyCode: this.factoryList[this.index].value,
checkStatus: this.tabList[this.current].value
}, this.pageData).then(res => {
uni.hideLoading();
let list = toJsonData(res.data.__blocks__.result.rows, res.data.__blocks__.result.meta.columns)
.map(item => {
return {
...item,
receiptDate: moment(item.receiptDate).format("YYYY-MM-DD")
}
})
if (this.pageData.offset == 0) {
this.projectDataList = list
} else {
this.projectDataList = [...this.projectDataList, ...list]
}
if (this.projectDataList.length < res.data.__blocks__.result.attr.count) {
this.status = "loadmore"
} else {
this.status = 'nomore'
}
})
},
onSearchByName() {
this.pageData.offset = 0;
this.onGetSubList()
},
onGetSubList() {
uni.showLoading({
title: "加载中"
})
getSubList({
...this.queryData,
groupName: "",
planDate: "",
planType: "2",
taskStatus: "0",
planStatus: '1'
}, this.pageData).then(res => {
uni.hideLoading();
let list = toJsonData(res.data.__blocks__.result.rows, res.data.__blocks__.result.meta.columns)
.map(item => {
return {
...item,
receiveDate: moment(item.receiveDate).format("YYYY-MM-DD")
}
})
if (this.pageData.offset == 0) {
this.subList = list
} else {
this.subList = [...this.subList, ...list]
}
if (this.subList.length < res.data.__blocks__.result.attr.count) {
this.status = "loadmore"
} else {
this.status = 'nomore'
}
})
},
onChange(e) {
this.index = e.target.value;
this.pageData.offset = 0;
this.projectDataList = [];
this.subList = []
if (this.value === 0) {
this.onGetList()
} else {
this.onGetSubList()
}
},
onSearchByName() {
this.pageData.offset = 0;
this.onGetList();
},
onChangeTab(e) {
if (this.current === e.index) return;
this.current = e.index;
this.pageData.offset = 0
this.queryData.status = this.tabList[this.current].value;
this.onGetList();
},
onNavTo(val) {
uni.navigateTo({
url: `/pages/device-maintain/edit?id=${val.id}`
})
},
onNavTo2(val) {
uni.navigateTo({
url: `/pages/device-maintain/detail?id=${val.id}`
})
},
onNavChange(e) {
if (this.value === e) return;
this.value = e;
this.pageData.offset = 0;
this.projectDataList = [];
this.subList = []
if (this.value === 0) {
this.onGetList()
} else {
this.onGetSubList()
}
}
}
}
</script>
<style>
page {
background-color: #ffffff;
}
</style>
<style lang="scss" scoped>
.title-view {
padding: 20upx 30upx;
background: #ffffff;
}
.overview-view {
display: flex;
flex-direction: row;
padding: 20upx 0;
background: #ffffff;
border-bottom: 2px solid rgba(226, 226, 226, 0.6);
.part-1 {
display: flex;
flex: 1;
flex-direction: column;
justify-content: center;
align-items: center;
.text-black {
margin-top: 10upx;
}
}
.line {
display: flex;
width: 2px;
height: 100upx;
background-color: rgba(226, 226, 226, 0.6);
}
}
.page-content-box {
width: 100vw;
height: 100vh;
overflow: hidden;
}
.cu-form-group {
picker {
padding-right: 0;
}
}
.header-title {
display: flex;
flex-direction: row;
width: 90%;
align-items: center;
margin: 10upx auto 12upx;
.flex-between {
display: flex;
flex: 1;
justify-content: center;
align-items: center;
border-radius: 20upx;
padding: 16upx 20upx;
background-color: rgba(246, 246, 248, 1);
.image {
width: 34upx;
margin-right: 8upx;
max-height: 42upx;
}
.text-blue {
color: #4a93f8;
font-weight: bold;
}
}
}
.u-tabs-box {
width: 100%;
margin: 0 auto;
}
.data-content {
display: flex;
flex-direction: column;
margin: 0 auto 30upx;
width: 96%;
.circle-par {
display: flex;
justify-content: center;
align-items: center;
}
.header {
border-radius: 12upx 12upx 0 0;
background-color: #eef2fe;
color: #101010;
font-size: 30upx;
border: 1px solid #d1dcfd;
padding: 14upx 24upx;
}
.content {
border-radius: 0 0 12upx 12upx;
background-color: #ffffff;
color: #101010;
font-size: 30upx;
border: 1px solid #cecece;
border-top: none;
}
}
.flex-content {
display: flex;
width: 100%;
justify-content: center;
}
.part-3 {
flex-direction: column;
padding-bottom: 120upx;
.content-item {
display: flex;
flex-direction: column;
width: 94%;
margin: 24upx auto 8upx;
padding-bottom: 24upx;
.header-title {
position: relative;
width: 100%;
margin: 0;
image {
width: 100%;
max-height: 100upx;
}
.flex-between {
position: absolute;
top: 0;
left: 12%;
width: 88%;
height: 70%;
padding: 0;
justify-content: space-between;
background-color: transparent;
}
}
.content-box {
position: relative;
z-index: 2;
box-shadow: 0 0 12upx rgba(0, 0, 0, 0.34);
border-radius: 12upx;
margin-top: -20upx;
background-color: #ffffff;
padding: 24upx;
.flex-row {
margin: 6upx 0;
align-items: center;
.part-1 {
width: 140upx;
text-align-last: justify;
}
.part-2 {
margin-right: 24upx;
}
.text-title {
display: flex;
flex: 1;
}
}
}
}
.content-item:last-child {
border-bottom: none;
}
}
.flex-center {
display: flex;
align-items: center;
}
.line-progress {
align-items: center;
}
.u-page__item__slot-icon {
width: 24px;
height: 24px;
}
.part-left {
align-items: center;
}
.circle-center {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.margin-top-sm {
margin-top: 10upx;
}
.flex-row {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
}
.icon {
width: 36upx;
max-height: 50upx;
margin-right: 6upx;
}
.flex-row-center {
display: flex;
flex-direction: row;
align-items: center;
}
.content-part-1 {
display: flex;
flex-direction: column;
align-items: center;
.header {
display: flex;
flex-direction: row;
align-items: center;
width: 92%;
padding: 30upx 0;
image {
width: 20px;
height: 20px;
margin-right: 6upx;
}
}
.form-content-box {
width: 92%;
padding: 12upx 0;
border-radius: 12upx;
box-shadow: 0 0 8upx rgba(0, 0, 0, 0.34);
background-color: #ffffff;
.cu-form-group {
.title {
display: flex;
flex-direction: row;
width: 240upx;
align-items: center;
}
}
}
.footer-content {
display: flex;
justify-content: center;
align-items: center;
width: 100vw;
height: 120upx;
margin-bottom: 100upx;
.btn-box {
width: 80%;
}
}
}
</style>
\ No newline at end of file
......@@ -128,7 +128,12 @@
//不良品类
form: {},
factoryIndex:0,
factoryList:[],
factoryList:[
{
value:"",
label:"全部"
}
],
floatTop:"",
floatLeft: "",
floatBoxStatus: false,
......@@ -185,13 +190,14 @@
},
onLoading() {
getParamsList().then(res=>{
this.factoryList = res.data.map(item=>{
let list = res.data.map(item=>{
this.factoryEnum[item.companyCode] = item.companyName
return {
label: item.companyName,
value: item.companyCode
}
})
this.factoryList = [...this.factoryList,...list];
this.$forceUpdate();
this.onGetList();
})
......
......@@ -127,7 +127,12 @@
//不良品类
form: {},
factoryIndex:0,
factoryList:[],
factoryList:[
{
value:"",
label:"全部"
}
],
floatTop:"",
floatLeft: "",
floatBoxStatus: false,
......@@ -186,13 +191,14 @@
},
onLoading() {
getParamsList().then(res=>{
this.factoryList = res.data.map(item=>{
let list = res.data.map(item=>{
this.factoryEnum[item.companyCode] = item.companyName
return {
label: item.companyName,
value: item.companyCode
}
})
this.factoryList = [...this.factoryList,...list];
this.$forceUpdate();
this.onGetList();
})
......
......@@ -164,7 +164,12 @@
//不良品类
form: {},
factoryIndex:0,
factoryList:[],
factoryList:[
{
value:"",
label:"全部"
}
],
floatTop:"",
floatLeft: "",
floatBoxStatus: false,
......@@ -212,13 +217,14 @@
onLoading() {
getParamsList().then(res=>{
console.log(res,9999999)
this.factoryList = res.data.map(item=>{
let list = res.data.map(item=>{
this.factoryEnum[item.companyCode] = item.companyName
return {
label: item.companyName,
value: item.companyCode
}
})
this.factoryList = [...this.factoryList,...list];
this.$forceUpdate();
this.onGetList();
})
......
......@@ -224,7 +224,12 @@
2:"已完工",
},
index:0,
factoryList:[],
factoryList:[
{
value:'',
label:"全部"
}
],
factoryEnum:{},
unCount: 0,
count: 0
......@@ -267,12 +272,13 @@
onLoading() {
getParamsList().then(res=>{
if(res.data && res.data.length){
this.factoryList = res.data.map(item=>{
let list = res.data.map(item=>{
return {
label: item.companyName,
value: item.companyCode
}
})
this.factoryList = [...this.factoryList,...list];
this.ongetCount();
this.onGetList();
}
......
......@@ -161,7 +161,12 @@
//不良品类
form: {},
factoryIndex:0,
factoryList:[],
factoryList:[
{
value:"",
label:"全部"
}
],
floatTop:"",
floatLeft: "",
floatBoxStatus: false,
......@@ -208,14 +213,14 @@
},
onLoading() {
getParamsList().then(res=>{
console.log(res,9999999)
this.factoryList = res.data.map(item=>{
let list = res.data.map(item=>{
this.factoryEnum[item.companyCode] = item.companyName
return {
label: item.companyName,
value: item.companyCode
}
})
this.factoryList = [...this.factoryList,...list];
this.$forceUpdate();
this.onGetList();
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment