6 changed files with 392 additions and 233 deletions
@ -0,0 +1,55 @@
|
||||
.content{ |
||||
background-color: white; |
||||
padding-bottom: 20upx; |
||||
.card-up{ |
||||
@include wh(710upx,auto); |
||||
margin: auto; |
||||
padding-top: 1upx; |
||||
.mode-up{ |
||||
@include flex(center,flex-start); |
||||
margin-top: 20upx; |
||||
view{ |
||||
font-size: 24upx; |
||||
@include flex(center,flex-start); |
||||
view{ |
||||
border: 1upx solid #808080; |
||||
font-size: 24upx; |
||||
margin-left: 40upx; |
||||
text-indent: 20upx; |
||||
width: 200upx; |
||||
} |
||||
input{ |
||||
width: 200upx; |
||||
border: 1upx solid #808080; |
||||
font-size: 24upx; |
||||
margin-left: 40upx; |
||||
text-indent: 20upx; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
.card-down{ |
||||
@include wh(710upx,auto); |
||||
margin: auto; |
||||
padding-top: 20upx; |
||||
border: 1upx solid #808080; |
||||
margin-top: 20upx; |
||||
padding-bottom: 20upx; |
||||
.list{ |
||||
@include flex(center,flex-start); |
||||
margin-top: 20upx; |
||||
view{ |
||||
@include fonts(26upx,#333) |
||||
width:180upx; |
||||
} |
||||
text{ |
||||
@include fonts(24upx,#999999); |
||||
margin-left: 20upx; |
||||
} |
||||
.bor{ |
||||
width:200upx; |
||||
border: 1upx solid #808080; |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,19 +1,125 @@
|
||||
<template> |
||||
<view> |
||||
|
||||
<view class="content"> |
||||
<view class="card-up"> |
||||
<view class="mode-up"> |
||||
<view> |
||||
<text>模具编号</text> |
||||
<input disabled="true" v-model="modeNo" /> |
||||
</view> |
||||
</view> |
||||
<view class="mode-up"> |
||||
<view> |
||||
<text>模具名称</text> |
||||
<input disabled="true" v-model="modeName" /> |
||||
</view> |
||||
</view> |
||||
<picker @change="modeStaff($event,staffList)" :value="staffId" :range="staffList" :range-key="'name'"> |
||||
<view class="mode-up"> |
||||
<view> |
||||
<text>保养人员</text> |
||||
<view>{{staffList[staffId]?staffList[staffId].name:''}}</view> |
||||
</view> |
||||
</view> |
||||
</picker> |
||||
<picker mode="date" :value="date" :start="startDate" :end="endDate" @change="bindDateChange"> |
||||
<view class="mode-up"> |
||||
<view> |
||||
<text>保养时间</text> |
||||
<input disabled="true" v-model="date" /> |
||||
</view> |
||||
</view> |
||||
</picker> |
||||
</view> |
||||
<view class="card-down"> |
||||
<view class="list"> |
||||
<view>检测部位</view> |
||||
<text>各模板</text> |
||||
</view> |
||||
<view class="list"> |
||||
<view>检测内容</view> |
||||
<text>各模板</text> |
||||
</view> |
||||
<view class="list"> |
||||
<view>检测结果</view> |
||||
<text class="bor">各模板</text> |
||||
</view> |
||||
<view class="list"> |
||||
<view>问题位置</view> |
||||
<text class="bor">各模板</text> |
||||
</view> |
||||
<view class="list"> |
||||
<view>措施</view> |
||||
<text class="bor">各模板</text> |
||||
</view> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import { |
||||
staff |
||||
} from "../../api/user.js" |
||||
export default { |
||||
data() { |
||||
const currentDate = this.getDate({ |
||||
format: true |
||||
}) |
||||
return { |
||||
|
||||
modeId: '', |
||||
modeNo: '', |
||||
modeName: '', |
||||
staffList: [], |
||||
staffId: 0, |
||||
date: currentDate |
||||
}; |
||||
}, |
||||
onLoad(e) { |
||||
this.modeId = e.id; |
||||
this.modeNo = e.no |
||||
this.modeName = e.name |
||||
this.getStaff() |
||||
}, |
||||
computed: { |
||||
startDate() { |
||||
return this.getDate('start'); |
||||
}, |
||||
endDate() { |
||||
return this.getDate('end'); |
||||
} |
||||
}, |
||||
methods: { |
||||
getStaff() { |
||||
staff().then(res => { |
||||
this.staffList = res; |
||||
|
||||
console.log("员工", res) |
||||
}) |
||||
}, |
||||
modeStaff(e, item) { |
||||
this.staffId = e.detail.value |
||||
}, |
||||
bindDateChange: function(e) { |
||||
this.date = e.target.value |
||||
}, |
||||
getDate(type) { |
||||
const date = new Date(); |
||||
let year = date.getFullYear(); |
||||
let month = date.getMonth() + 1; |
||||
let day = date.getDate(); |
||||
|
||||
if (type === 'start') { |
||||
year = year - 60; |
||||
} else if (type === 'end') { |
||||
year = year + 2; |
||||
} |
||||
month = month > 9 ? month : '0' + month; |
||||
day = day > 9 ? day : '0' + day; |
||||
return `${year}-${month}-${day}`; |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss"> |
||||
|
||||
@import "./index.scss" |
||||
</style> |
||||
|
Loading…
Reference in new issue