huangli865118801 4 years ago
parent
commit
a55d35273b
  1. 12
      api/user.js
  2. 9
      pages.json
  3. 111
      pages/deviceByAdd/deviceByAdd.vue
  4. 57
      pages/deviceByAdd/index.scss
  5. 11
      pages/deviceList/deviceList.vue
  6. 8
      pages/stampingRecordList/stampingRecordList.vue

12
api/user.js

@ -619,3 +619,15 @@ export function lineCheckDevice(data) {
data
});
}
/**
* 设备列表
* @param {Object} data
*/
export function deviceRecord(data) {
console.log(data)
return request({
url: `${functions.getDomain()}/api/device-record`,
method: "post",
data
});
}

9
pages.json

@ -274,6 +274,15 @@
}
}
,{
"path" : "pages/deviceByAdd/deviceByAdd",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {
"navigationBarTextStyle": "white",

111
pages/deviceByAdd/deviceByAdd.vue

@ -0,0 +1,111 @@
<template>
<view>
<view class="card">
<view>设备名:{{info?info.name:''}}</view>
<view>设备型号:{{info?info.model:''}}</view>
<view>设备编号:{{info?info.in_number:''}}</view>
<view>检测项目:{{info?info.check_item:''}}</view>
<view>检测目的:{{info?info.check_aim:''}}</view>
</view>
<view class="from">
<picker @change="bindTypeCircle($event,typeCircle)" :value="typeCircleIds" :range="typeCircle" :range-key="'title'" >
<view class="list">
<view>检测周期</view>
<view class="right">
<text>{{typeCircle[typeCircleIds].title}}</text>
<image class="next" src="../../static/next.png"></image>
</view>
</view>
</picker>
<picker @change="bindMaterial" :value="materialIds" :range="material" >
<view class="list">
<view>保养情况</view>
<view class="right">
<text>{{material[materialIds]}}</text>
<image class="next" src="../../static/next.png"></image>
</view>
</view>
</picker>
<view class="remark">
<view>
备注
</view>
<textarea v-model="from.device[0].remark" placeholder="" />
</view>
<view class="remark">
<view>
设备其他情况
</view>
<textarea v-model="from.remark" placeholder="" />
</view>
</view>
<view class="submit-btn" >
<button type="primary" :disabled="buttonState==false?true:false" @tap="submit()">提交</button>
</view>
</view>
</template>
<script>
import {deviceRecord} from "../../api/user.js"
export default {
data() {
return {
type:0,
info:{},
lineId:0,
typeCircle:[
{id:1,title:'半月检'},
{id:2,title:'月检'},
{id:3,title:'半年检'}
],
typeCircleIds:0,
material:["未完成","已完成"],
materialIds:0,
from:{
line_id:0,
remark:'',//
type:1,//1=2=3=,
device:[
{
device_id:'',
status:1,
remark:''
}
]
},
buttonState:true
};
},onLoad(e) {
this.type=e.type;
this.info = JSON.parse(decodeURIComponent(e.planInfo));
this.lineId=e.id
},methods:{
bindTypeCircle(e,list){
this.typeCircleIds=e.detail.value
},
bindMaterial(e){
this.materialIds=e.detail.value
},
submit(){
this.from.line_id=this.lineId;
this.from.type=this.typeCircle[this.typeCircleIds].id;
this.from.device[0].status=this.materialIds+1;
this.from.device[0].device_id=this.info.id;
this.buttonState=false
deviceRecord(this.from).then(res=>{
this.buttonState=false
this.$functions.success("操作成功").then(() => {
uni.navigateBack()
}).catch(res=>{
this.buttonState=true
})
console.log("biaodan",this.from)
})
}
}
}
</script>
<style lang="scss">
@import "./index.scss"
</style>

57
pages/deviceByAdd/index.scss

@ -0,0 +1,57 @@
.card{
@include wh(710upx,auto);
padding: 30upx;
margin: auto;
background: white;
view{
@include fonts(26upx,#333);
line-height: 55upx;
}
}
.from{
@include wh(750upx,auto);
background: white;
margin-top: 30upx;
.list{
width: 710upx;
margin: auto;
padding-top: 25upx;
padding-bottom: 25upx;
@include flex(center,space-between);
view{
@include fonts(26upx,#333);
width: 600upx;
}
.right{
width: 100upx;
@include flex(center,flex-end);
text{
@include fonts(24upx,#666)
}
image{
@include wh(22upx,33upx)
}
}
}
.remark{
width: 710upx;
margin: auto;
padding-top: 25upx;
padding-bottom: 25upx;
@include flex(flex-start,space-between);
textarea{
font-size: 26upx;
border: 1upx solid #F1F1F1;
padding: 10upx;
}
view{
@include fonts(26upx,#333);
width: 200upx;
}
}
}
.submit-btn{
@include wh(710upx,auto);
margin: auto;
margin-top: 30upx;
}

11
pages/deviceList/deviceList.vue

@ -1,6 +1,6 @@
<template>
<view>
<view class="card" v-for="(item,index) in list" :key="index" @tap="firstInspectionInfo(item.plan_id,item)">
<view class="card" v-for="(item,index) in list" :key="index" @tap="deviceByAdd(item,type)">
<view class="card-left">
<view class="card-up-list">
<view class="card-up-list-list">
@ -54,6 +54,15 @@
lineCheckDevice({line_id:this.id,type:this.type}).then(res=>{
this.list=res
})
},
deviceByAdd(item,type){
console.log("type",type)
uni.navigateTo({
url: `../deviceByAdd/deviceByAdd?type=${type}&id=${this.id}&planInfo=${encodeURIComponent(JSON.stringify(item))}`,
success: res => {},
fail: () => {},
complete: () => {}
});
}
}
}

8
pages/stampingRecordList/stampingRecordList.vue

@ -15,6 +15,11 @@
<view>物料编号:</view><text>{{item.product_number}}</text>
</view>
</view>
<view class="card-up-list">
<view class="card-up-list-list">
<view>工时投入:</view><text></text>
</view>
</view>
<view class="card-dow-list">
<view class="card-up-list-list">
<view>班次:</view>
@ -153,7 +158,8 @@
firstCheckLists({type:1}).then(res => {
this.list = res;
this.list.map(item=>{
this.dateFormat(item.open_time)
console.log("时间",this.dateFormat(item.open_time))
})
})
},

Loading…
Cancel
Save