增加设备保养

This commit is contained in:
2024-05-07 19:37:20 +08:00
parent 162ef0ef26
commit ef313b9399
18 changed files with 1116 additions and 257 deletions

View File

@ -3,72 +3,51 @@
<view class="page_padding">
<view class="page_content contentboxsty font14">
<view class="content_row">
<view class="name">值班工程师</view>
<view class="name font_bold">值班工程师</view>
<view class="flex1">
<picker placeholder="请选择设备" @change="bindPickerChange" :value="index" :range="array" >
<input type="text" :value="array[index]" placeholder="请选择设备" disabled />
</picker>
<pickerSelect class="comView" @change="bindOperatorChange" :list="setMap.operatorList" :id="form.operator_id" placeholder="请选择工程师" />
</view>
<view class="iconfont icon-xiala"></view>
</view>
<view class="content_row">
<view class="name">故障时间</view>
<view class="name font_bold">故障时间</view>
<view class="flex1">
<view :class="[downtime ? 'haveTime' : 'noTime']">
<uni-datetime-picker placeholder="选择时间" type="datetime" v-model="downtime" @change="changeLog" />
<view class='input_date' :class="[form.failure_at && form.failure_at!=''? 'haveTime' : '']">
<uni-datetime-picker placeholder="选择时间" type="datetime" v-model="form.failure_at" />
</view>
</view>
<!-- <view class=""></view> -->
</view>
<view class="content_row">
<view class="name">报修时间</view>
<view class="">
<view :class="[repairtime ? 'haveTime' : 'noTime']">
<uni-datetime-picker placeholder="选择时间" type="datetime" v-model="repairtime" @change="changeLog" />
<view class="name font_bold">报修时间</view>
<view class="flex1">
<view class='input_date' :class="[form.report_at && form.report_at!=''? 'haveTime' : '']">
<uni-datetime-picker placeholder="选择时间" type="datetime" v-model="form.report_at" />
</view>
</view>
<view class=""></view>
</view>
<view class="content_row">
<view class="name">报修人</view>
<view class="">
<picker placeholder="请选择" @change="bindPickerChange" :value="index" :range="array" >
<input type="text" :value="array[index]" placeholder="请选择" disabled />
</picker>
<view class="name font_bold">报修人</view>
<view class="flex1">
<pickerSelect class="comView" @change="bindRepairChange" :list="setMap.operatorList" :id="form.report_id" placeholder="请选择报修人" />
</view>
<view class=""></view>
</view>
<view class="content_row">
<view class="name">报修设备</view>
<view class="">
<picker placeholder="请选择" @change="bindPickerChange" :value="index" :range="array" >
<input type="text" :value="array[index]" placeholder="请选择" disabled />
</picker>
<view class="name font_bold">报修设备</view>
<view class="flex1">
<pickerSelect class="comView" @change="bindeQuipmentChange" :list="setMap.equipmentList" :id="form.equipment_id" placeholder="请选择报修设备" />
</view>
<view class=""></view>
</view>
<view class="textarea_row">
<view class="name">故障描述</view>
<textarea placeholder="请输入维修描述..."/>
<!-- <uni-easyinput type="textarea" v-model="value" placeholder="请输入维修描述..."></uni-easyinput> -->
<view class="name font_bold">故障描述</view>
<textarea class="textarea" placeholder="请输入故障描述..." v-model="form.remark" cursor-spacing="180px" :auto-blur="true" placeholder-class="placeholderStyle"/>
</view>
<view class="img_row">
<view class="name">故障照片</view>
<uni-file-picker limit="3" v-model="imageValue" title="">
<view class="img_but">
<view class="iconfont icon-a-shangchuanzhaopian2 font35"></view>
<view class="font12">
上传图片
</view>
</view>
</uni-file-picker>
<view class="img_row">
<uploadImg limit="3" name="故障图片" :list="form.failure_photo" />
</view>
</view>
</view>
<view class="bottom_but flex_layout">
<view class="font13">保存</view>
<view class="font13">取消</view>
<view class="bottom_but flex_layout">
<view class="font13 but_color" @click="save">保存</view>
<view class="font13" @click="cancel">取消</view>
</view>
</view>
</template>
@ -76,22 +55,113 @@
export default {
data() {
return {
array: ['中国', '美国', '巴西', '日本'],
downtime:'',
setMap:{
operatorList:[],
equipmentList:[],
},
form:{
id:'',
operator_id:'',
failure_at:'',
report_at:'',
report_id:'',
equipment_id:'',
remark:'',
failure_photo:[],
},
id:0,
oss:{},
}
},
methods: {
changeLog(){
console.log(this.downtime)
},
onLoad(option) {
if(option.id != undefined){
this.getInfo(Number(option.id));
}
},
mounted() {
this.userList();
this.equipment();
},
methods: {
getInfo(id){
this.$api.request('/equipment.repair.info',{id:id}).then(res=>{
this.form = {
id:id,
operator_id:res.data.operator_id,
failure_at:res.data.failure_at,
report_at:res.data.report_at,
report_id:res.data.report_id,
equipment_id:res.data.equipment_id,
remark:res.data.remark,
failure_photo:res.data.failure_photo,
}
}).catch(err=>{})
},
userList(){
this.$api.request('/user.options','').then(res=>{
res.data.forEach(item=>{
item.value = item.id;
})
this.setMap['operatorList'] = res.data;
}).catch(err=>{})
},
equipment(){
this.$api.request('/device.options','').then(res=>{
res.data.forEach(item=>{
item.name = item.name;
item.value = item.id;
})
this.setMap['equipmentList'] = res.data;
}).catch(err=>{})
},
bindOperatorChange(e){
this.form.operator_id = e.value;
},
bindRepairChange(e){
this.form.report_id = e.value;
},
bindeQuipmentChange(e){
this.form.equipment_id = e.value;
},
save(){
this.$api.postFuncLoading('/create.repair.notice',this.form).then(res=>{
this.parentClick();
this.reset();
this.$wf.toast({type:'success',text:'保存成功'});
}).catch(err=>{})
},
cancel(){
this.reset();
},
reset(){
this.form = {
id:'',
operator_id:'',
failure_at:'',
report_at:'',
report_id:'',
equipment_id:'',
remark:'',
failure_photo:[],
}
},
parentClick(){
const pages = getCurrentPages();
if (pages.length >= 2) {
const prevPage = pages[pages.length - 2];
prevPage.$vm.getList();
}
}
}
}
</script>
<style lang="scss">
<style scoped lang="scss">
.page_padding{padding-bottom: 100px;}
.page_content{padding: 0 12px 10px;}
.content_row{display: flex;border-bottom: 1px solid #2D3A6F;height: 44px;align-items: center;
.name{width: 30%;}
.name{flex-basis: 96px;}
.flex_layout{
.contenticon{width: 20px;height: 20px;}
.text{padding: 0 20px 0 5px;}
@ -99,21 +169,10 @@
}
.textarea_row{
.name{padding: 12px 0;}
textarea{border-radius: 4px;background: rgba(255, 255, 255, 0.50);padding: 10px;height: 100px;}
.textarea{border-radius: 4px;background: $uni-bg-color-placeholder;padding: 10px;width: 100%;box-sizing: border-box;}
}
.img_row{
.name{padding: 12px 0;}
.file-title {color: #fff;}
.is-add{background: rgba(255, 255, 255, 0.5);}
.img_but{ position: relative;display: flex;align-items: center;justify-content: center;flex-direction: column;}
.img_row{
padding: 12px 0 6px 0;
height: 100%;
}
.uni-date-x{
background-color: #1C2755 !important;color: #fff!important;
}
.uni-date-x--border{border:none !important}
.haveTime{
.uni-date__x-input{color: #fff;}
}
.noTime{.uni-date__x-input{color: #666;}}
</style>

View File

@ -0,0 +1,117 @@
<template>
<view class="page_padding">
<view class="padd_bot12 font14 flex_layout">
<text>{{type==1?'硬件设备报修详情':'硬件设备维修详情'}}</text>
</view>
<view class="detail_list padd_top12 contentboxsty page_content font13">
<template v-if="type==2">
<view class="row flex_layout">
<view class="name font_bold">维修工程师</view>
<view class="text">{{info.repair_name}}</view>
</view>
<view class="row flex_layout">
<view class="name font_bold">故障解除时间</view>
<view class="text">{{info.repair_at_label}}</view>
</view>
<view class="row">
<view class="name font_bold">维修描述</view>
<view class="text remarkText padd_top12">{{info.repair_remark}}</view>
</view>
<view class="row">
<view class="name font_bold">维修照片</view>
<view class="text imgList">
<view class="imgView" v-for="(em,ind) in info.repair_photo" :key="ind">
<image class="img" :src="em" mode="aspectFill" @click="imgPreview(info.repair_photo,em)"></image>
</view>
</view>
</view>
</template>
<template v-if="type ==1">
<view class="row flex_layout">
<view class="name font_bold">值班工程师</view>
<view class="text">{{info.operator_name}}</view>
</view>
<view class="row flex_layout">
<view class="name font_bold">故障时间</view>
<view class="text">{{info.failure_at}}</view>
</view>
<view class="row flex_layout">
<view class="name font_bold">报修时间</view>
<view class="text">{{info.report_at}}</view>
</view>
<view class="row flex_layout">
<view class="name font_bold">报修人</view>
<view class="text">{{info.repair_name}}</view>
</view>
<view class="row flex_layout">
<view class="name font_bold">报修设备</view>
<view class="text">{{info.eq_name}}</view>
</view>
<view class="row">
<view class="name font_bold">故障描述</view>
<view class="text remarkText padd_top12">{{info.remark}}</view>
</view>
<view class="row">
<view class="name font_bold">故障照片</view>
<view class="text imgList">
<view class="imgView" v-for="(em,ind) in info.failure_photo" :key="ind">
<image class="img" :src="em" mode="aspectFill" @click="imgPreview(info.failure_photo,em)"></image>
</view>
</view>
</view>
</template>
</view>
</view>
</template>
<script>
export default{
data(){
return{
type:1,
id:0,
info:{}
}
},
onLoad(option) {
this.type = option.type;
this.id = option.id;
},
mounted() {
this.getData();
},
methods:{
getData(){
this.$api.postFuncLoading('/equipment.repair.info',{id:this.id}).then(res=>{
this.info = res.data;
}).catch(err=>{})
},
imgPreview(list,url){
uni.previewImage({
urls: list,
current:url,
});
}
}
}
</script>
<style scoped lang="scss">
.row{
padding-bottom: 12px;
.name{flex-basis: 90px;}
.text{flex: 1;}
}
.row:last-child{
padding-bottom: 0;
}
.imgList{
display: flex;flex-direction: row;flex-wrap: wrap;padding: 6px 0;
.imgView{width: 32%;height: 100px;margin-right: 2%;box-sizing: border-box;padding: 6px 0 0 0;}
.imgView:nth-child(3n){
margin-right: 0;
}
.img{width: 100%;height: 100%;border-radius:4px;}
}
</style>

View File

@ -2,45 +2,50 @@
<!-- 设备报修 -->
<view class="page_padding bot_padding">
<view v-for="(item,index) in list" :key="index">
<view class="page_list contentboxsty font13">
<view class="page_list contentboxsty font13" @click="toDetail(item)">
<view class="list_top flex_layout">
<view class="top_left flex_layout">
<view class="iconfont icon-gengduo-1"></view>
<view class="">双头带锯</view>
<view class="icon iconfont icon-daiju"></view>
<view class="font_bold">{{item.eq_name}}</view>
</view>
<view class="card_right top_right">
<text class="status error">故障中</text>
</view>
<view class="top_right">故障中</view>
</view>
<view class="list_centre">
<view class="list_centre padd_bot12">
<view class="row_data">
<view class="row_name">值班工程师</view>
<view class="row_content">章三</view>
<view class="name font_bold">值班工程师</view>
<view class="text">{{item.operator_name}}</view>
</view>
<view class="row_data">
<view class="name font_bold">故障时间</view>
<view class="text">{{item.failure_at}}</view>
</view>
<view class="row_data">
<view class="name font_bold">报修人</view>
<view class="text">{{item.repair_name}}</view>
</view>
<view class="row_data">
<view class="row_name">故障时间</view>
<view class="row_content">2024-01-11 13:09:11</view>
<view class="name font_bold">报修时间</view>
<view class="text">{{item.report_at}}</view>
</view>
<view class="row_data">
<view class="row_name">报修人</view>
<view class="row_content">李四</view>
<view class="name font_bold">处理状态</view>
<view class="text">{{item.status_label}}</view>
</view>
<view class="row_data">
<view class="row_name">故障时间</view>
<view class="row_content">3.5H</view>
</view>
<view class="row_data">
<view class="row_name">处理状态</view>
<view class="row_content">故障处理中</view>
</view>
<view class="row_data">
<view class="row_name">故障解除时间</view>
<view class="row_content">2024-01-11 14:09:07</view>
<view class="name font_bold">故障解除时间</view>
<view class="text">{{item.repair_at_label}}</view>
</view>
</view>
<view class="list_below flex_layout">
<view class="below_left" @click="toRepairOrder()">
<view class="below_left btn" @click.stop="toRepairOrder(item)">
<text class="icon iconfont icon-bianji font16"></text>
维修单
</view>
<view class="below_right">
<view class="below_right btn" @click.stop="editRepairOrder(item)">
<text class="icon iconfont icon-bianji font16"></text>
修改
</view>
</view>
@ -49,13 +54,9 @@
</view>
<view class="page_bottom_button">
<view class="page_add" @click="toAddRepairReport()">
<!-- <view class="name_left font14">
系统设备管理
</view> -->
<view class="iconfont icon-tianjia font24"></view>
<text>添加</text>
<view class="icon iconfont icon-tianjia font20"></view>
<text class="font14">添加</text>
</view>
</view>
</template>
@ -63,49 +64,128 @@
export default {
data() {
return {
list:[{name:"双头立锯"},
{name:"双头立锯"},
{name:"双头立锯"},
{name:"双头立锯"},
{name:"双头立锯"},
{name:"双头立锯"},
{name:"双头立锯"},
{name:"双头立锯"},
{name:"双头立锯"},
]
params:{
page:1,
pageSize:10,
},
loadParams:{
noData:false,
loading:false,
loadEnd:false
},
list:[],
}
},
mounted() {
this.getList();
},
// 上拉刷新
onPullDownRefresh(){
this.params.page = 1;
this.loadParams = {
noData:false,
loading:false,
loadEnd:false
};
this.getList(2);
},
// 加载下一页
onReachBottom(){
if(!(this.loadParams.loadEnd || this.loadParams.noData)){
this.loadParams.loading = true;
this.params.page ++;
this.getList();
}
},
methods: {
methods: {
getList(type=1){
if(this.params.page == 1){
uni.showLoading({
title: '加载中',
mask: true
})
}
this.$api.request('/equipment.repair.list',this.params).then(res=>{
if(type ==2){
uni.stopPullDownRefresh();
}
setTimeout( ()=> {
uni.hideLoading();
}, 200);
this.loadParams.loading = false;
if(res.data.rows.length ==0 && this.params.page == 1){
this.loadParams.noData = true;
}
if(res.data.rows.length>0 && res.data.rows.length < this.params.pageSize){
this.loadParams.loadEnd = true;
}
if(this.params.page == 1){
this.list = res.data.rows;
}else{
this.list = this.list.concat(res.data.rows);
}
}).catch(err=>{
setTimeout(()=> {
uni.hideLoading();
}, 200);
})
},
//新增报修页面
toAddRepairReport(){
uni.navigateTo({
url:'/pages/deviceRepair/RepairReport'
})
uni.navigateTo({
url:'/pages/deviceRepair/repairReport'
})
},
//维修页面
toRepairOrder(){
uni.navigateTo({
url:'/pages/deviceRepair/repairOrder'
toRepairOrder(item){
// if(item.repair_id && item.repair_id>0){
// uni.navigateTo({
// url:'./deviceDetail?id='+item.id+'&type='+2
// })
// }else{
// uni.navigateTo({
// url:'/pages/deviceRepair/repairOrder?id='+item.id
// })
// }
uni.navigateTo({
url:'/pages/deviceRepair/repairOrder?id='+item.id
})
},
editRepairOrder(item){
uni.navigateTo({
url:'/pages/deviceRepair/repairReport?id='+item.id
})
},
toDetail(item){
uni.navigateTo({
url:'./deviceDetail?id='+item.id+'&type='+1
})
}
}
}
</script>
<style lang="scss">
<style scoped lang="scss">
.page_list{
.list_top{line-height: 44px;align-items: center;border-bottom: 1px solid #2D3A6F;
.top_left{flex: 1;}
.list_top{height: 44px;align-items: center;border-bottom: 1px solid $uni-border-color-primary;
.top_left{flex: 1;display: flex;align-items: center;
.icon{margin-right: 5px;color: $uni-text-color-primary;}
}
}
.list_centre{
.row_name{width: 30%;}
.row_data{display: flex;display: flex;padding: 6px 0;}
.list_centre{
.row_data{
display: flex;align-items: center;padding-top: 12px;
.name{flex-basis: 95px;}
.text{display: flex;display: flex;}
}
}
.list_below{line-height: 49px;align-items: center;border-top: 1px solid #2D3A6F;
view{width: 50%; text-align: center;}
.below_left{border-right: 1px solid #2D3A6F;}
.list_below{height: 49px;align-items: center;border-top: 1px solid $uni-border-color-primary;
.btn{width: 50%;display: flex;align-items: center;justify-content: center;height: 100%;
.icon{margin-right: 5px;}
}
.below_left{border-right: 1px solid $uni-border-color-primary;}
}
}
</style>

View File

@ -3,67 +3,118 @@
<view class="page_padding">
<view class="page_content contentboxsty font14">
<view class="content_row">
<view class="name">维修工程师</view>
<view class="name font_bold">维修工程师</view>
<view class="flex1">
<picker placeholder="请选择" @change="bindPickerChange" :value="index" :range="array" >
<input type="text" :value="array[index]" placeholder="请选择" disabled />
</picker>
<pickerSelect class="comView" @change="bindPickerChange" :list="setMap.operatorList" :id="form.repair_id" placeholder="请选择工程师" />
</view>
<view class="iconfont icon-xiala"></view>
</view>
<view class="content_row">
<view class="name">故障解除时间</view>
<view class="flex1">
<view :class="[downtime ? 'haveTime' : 'noTime']">
<uni-datetime-picker placeholder="选择时间" type="datetime" v-model="downtime" @change="changeLog" />
<view class="name font_bold">故障解除时间</view>
<view class="flex1">
<view class='input_date' :class="[form.repair_at && form.repair_at!=''? 'haveTime' : '']">
<uni-datetime-picker placeholder="选择时间" type="datetime" v-model="form.repair_at" />
</view>
</view>
</view>
<view class="textarea_row">
<view class="name">维修描述</view>
<textarea placeholder="请输入维修描述..."/>
<!-- <uni-easyinput type="textarea" v-model="value" placeholder="请输入维修描述..."></uni-easyinput> -->
<view class="name font_bold">维修描述</view>
<textarea class="textarea" v-model="form.repair_remark" placeholder="请输入维修描述..." cursor-spacing="180px" :auto-blur="true" placeholder-class="placeholderStyle" />
</view>
<view class="img_row">
<view class="name">维修照片</view>
<uni-file-picker limit="3" v-model="imageValue" title="">
<view class="img_but">
<view class="iconfont icon-a-shangchuanzhaopian2 font35"></view>
<view class="font12">
上传图片
</view>
</view>
</uni-file-picker>
<view class="img_row">
<uploadImg limit="3" name="维修照片" :list="form.repair_photo" />
</view>
</view>
</view>
<view class="bottom_but flex_layout">
<view class="font13">保存</view>
<view class="font13">取消</view>
<view class="bottom_but flex_layout">
<view class="font13 but_color" @click="save">保存</view>
<view class="font13" @click="cancel">取消</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
return {
setMap:{
operatorList:[],
},
form:{
id:'',
repair_id:'',
repair_at:'',
repair_remark:'',
repair_photo:[]
},
array: ['中国', '美国', '巴西', '日本'],
downtime:'',
}
},
onLoad(option) {
if(option.id !=undefined){
// this.form.id = Number(option.id);
this.getInfo(Number(option.id));
}
},
mounted() {
this.userList();
},
methods: {
changeLog(){
console.log(this.downtime)
methods: {
getInfo(id){
this.$api.request('/equipment.repair.info',{id:id}).then(res=>{
this.form = {
id:id,
repair_id:res.data.repair_id,
repair_at:res.data.repair_at,
repair_remark:res.data.repair_remark,
repair_photo:res.data.repair_photo,
}
}).catch(err=>{})
},
userList(){
this.$api.request('/user.options','').then(res=>{
res.data.forEach(item=>{
item.value = item.id;
})
this.setMap['operatorList'] = res.data;
}).catch(err=>{})
},
bindPickerChange(e){
this.form.repair_id = e.value;
},
save(){
this.$api.postFuncLoading('/create.equipment.repair',this.form).then(res=>{
this.parentClick();
this.$wf.toast({type:'success',text:'保存成功'});
}).catch(err=>{})
},
cancel(){
this.reset();
},
reset(){
this.form = {
id:'',
repair_id:'',
repair_at:'',
repair_remark:'',
repair_photo:[]
}
},
parentClick(){
const pages = getCurrentPages();
if (pages.length >= 2) {
const prevPage = pages[pages.length - 2];
prevPage.$vm.getList();
}
}
}
}
</script>
<style lang="scss">
<style scoped lang="scss">
.page_content{padding: 0 12px 10px;}
.content_row{display: flex;border-bottom: 1px solid #2D3A6F;height: 44px;align-items: center;
.name{width: 30%;}
.name{flex-basis: 100px;}
.flex_layout{
.contenticon{width: 20px;height: 20px;}
.text{padding: 0 20px 0 5px;}
@ -71,21 +122,14 @@
}
.textarea_row{
.name{padding: 12px 0;}
textarea{border-radius: 4px;background: rgba(255, 255, 255, 0.50);padding: 10px;height: 100px;}
.textarea{border-radius: 4px;background: $uni-bg-color-placeholder;padding: 10px;width: 100%;box-sizing: border-box;}
}
.img_row{
.name{padding: 12px 0;}
.file-title {color: #fff;}
.is-add{background: rgba(255, 255, 255, 0.5);}
.img_but{ position: relative;display: flex;align-items: center;justify-content: center;flex-direction: column;}
.img_row{
padding: 12px 0 6px 0;
.img_but{
display: flex;flex-direction: column;align-items: center;
.icon{color: $uni-text-color-inverse;}
.text{margin-top: 5px;}
}
}
.uni-date-x{
background-color: #1C2755 !important;color: #fff!important;
}
.uni-date-x--border{border:none !important}
.haveTime{
.uni-date__x-input{color: #fff;}
}
.noTime{.uni-date__x-input{color: #666;}}
</style>

View File

@ -8,7 +8,6 @@
<view class="name font_bold">设备名称</view>
<view class="text">
{{item.name}}
<view class="iconfont icon-bianji font20" @click.stop="toAddDevice(item.id)"></view>
</view>
</view>
<view class="list_row padd_top12">
@ -19,8 +18,11 @@
<view class="name font_bold">已绑定设备</view>
<view class="text">
{{item.equipment_monitor_config && item.equipment_monitor_config.eq_name?item.equipment_monitor_config.eq_name:'-'}}
<view class="iconfont icon-bangding font20" @click="toBindingDevice(item.id)"></view>
</view>
</view>
<view class="rightBtnView">
<view class="iconfont icon-bianji font18" @click.stop="toAddDevice(item.id)"></view>
<view class="iconfont icon-bangding font18" @click.stop="toBindingDevice(item.id)"></view>
</view>
</view>
</view>
@ -128,8 +130,9 @@
</script>
<style scoped lang="scss">
.page_list{padding: 12px;}
.page_list{padding: 12px;position: relative;}
.list_row{display: flex;align-items: center;}
.list_row .name{flex-basis: 84px;text-align: right;padding-right: 12px;box-sizing: border-box;}
.list_row .text{flex: 1;display: flex;justify-content: space-between;align-items: center;}
.list_row .text{flex: 1;display: flex;justify-content: space-between;align-items: center;}
.rightBtnView{position: absolute;right: 12px;top: 12px;height: calc(100% - 24px);display: flex;flex-direction: column;justify-content: space-between;}
</style>

View File

@ -86,9 +86,6 @@
{name:'',sn:"SO20240426000001",num:90,status:'待生产',type:1,time:'03:00'},
{name:'',sn:"SO20240426000001",num:90,status:'待生产',type:1},
],
dateList:[
{time:'00:00'},{time:'00:30'},{time:'01:00'},{time:'03:30'},{time:'04:00'},{time:'05:30'}
],
dateList:[
{name:'日',id:'',value:'day'},
{name:'周',id:'',value:'week'},