Browse Source

计划制定表单

master
巴林闲侠 2 years ago
parent
commit
6a9c3f0cae
  1. 3
      weapp/app.json
  2. 28
      weapp/package/troubleshooting/index.js
  3. 16
      weapp/package/troubleshooting/index.wxml
  4. 4
      weapp/package/troubleshooting/index.wxss
  5. 109
      weapp/package/troubleshooting/shootingForm/index.js
  6. 12
      weapp/package/troubleshooting/shootingForm/index.json
  7. 78
      weapp/package/troubleshooting/shootingForm/index.wxml
  8. 26
      weapp/package/troubleshooting/shootingForm/index.wxss
  9. 7
      weapp/project.private.config.json

3
weapp/app.json

@ -14,7 +14,8 @@
"basic/basic",
"startInspection/startInspection",
"inspectionInput/inspectionInput",
"troubleshooting/index"
"troubleshooting/index",
"troubleshooting/shootingForm/index"
]
}
],

28
weapp/package/troubleshooting/index.js

@ -12,7 +12,9 @@ Page({
structResult: ['a', 'b'],
pointList: ['a', 'b', 'c'],
pointResult: ['a', 'b'],
// 时间筛选
startTime: '',
endTime: ''
},
// 顶部tab切换
@ -58,6 +60,30 @@ Page({
},
noop () { },
// 时间选择
onStartTimeChange (event) {
this.setData({
startTime: event.detail,
});
},
onEndTimeChange (event) {
this.setData({
endTime: event.detail,
});
},
search () {
console.log(this.data);
},
// 页面跳转
toShootingForm (e) {
console.log(e);
const { shootingid } = e.currentTarget.dataset
wx.navigateTo({
url: '/package/troubleshooting/shootingForm/index?shootingid=' + shootingid,
})
},
/**
* 生命周期函数--监听页面加载

16
weapp/package/troubleshooting/index.wxml

@ -11,7 +11,7 @@
</view>
<view>
<van-dropdown-menu>
<van-dropdown-item title="{{ '结构物' }}">
<van-dropdown-item title="{{ '结构物' }}" bind:close="search">
<view style="max-height:60%">
<van-checkbox-group value="{{ structResult }}" bind:change="onStructChange">
<van-cell-group>
@ -22,7 +22,7 @@
</van-checkbox-group>
</view>
</van-dropdown-item>
<van-dropdown-item title="{{ '点位' }}">
<van-dropdown-item title="{{ '点位' }}" bind:close="search">
<view style="max-height:60%">
<van-checkbox-group value="{{ pointResult }}" bind:change="onPointChange">
<van-cell-group>
@ -33,9 +33,11 @@
</van-checkbox-group>
</view>
</van-dropdown-item>
<van-dropdown-item title="{{ '时间' }}">
<view style="max-height:60%">
<van-datetime-picker type="datetime" show-toolbar="{{false}}" type="date" value="{{ currentDate }}" bind:input="onInput"/>
<van-dropdown-item title="{{ '时间' }}" bind:close="search">
<view style="max-height:60%; display:flex" class="time-option">
<van-datetime-picker type="datetime" show-toolbar="{{false}}" type="date" value="{{ startTime }}" bind:input="onStartTimeChange" />
<view style="display:flex; align-items:center">至</view>
<van-datetime-picker type="datetime" show-toolbar="{{false}}" type="date" value="{{ endTime }}" bind:input="onEndTimeChange" />
</view>
</van-dropdown-item>
</van-dropdown-menu>
@ -44,7 +46,9 @@
<van-cell-group inset class="mission-card">
<view class="mission-card-title">
<span>asd</span>
<van-button type="info" round bind:tap="pickerShow">按钮</van-button>
<van-button type="info" round bind:tap="toShootingForm" data-shootingid="{{5}}">
按钮
</van-button>
</view>
<van-field value="输入框已禁用" label="点位名称" readonly border="{{ false }}" />
<van-field value="输入框已禁用" label="异常等级" readonly border="{{ false }}" />

4
weapp/package/troubleshooting/index.wxss

@ -54,4 +54,8 @@
.value-class {
flex: none !important;
}
.time-option .van-picker{
width: 45vw;
}

109
weapp/package/troubleshooting/shootingForm/index.js

@ -0,0 +1,109 @@
// package/troubleshooting/shootingForm/index.js
Page({
/**
* 页面的初始数据
*/
data: {
shootingid: '',
maintenancePersonId: null,
maintenanceRequirement: '',
planStartTimePopupShow: false,
planStartTime: '',
planEndTimePopupShow: false,
planEndTime: '',
},
/**
* 生命周期函数--监听页面加载
*/
onLoad (options) {
const { shootingid } = options
if (shootingid) {
this.setData({
shootingid
})
} else {
}
},
onMaintenancePersonPopupChange (e) {
this.setData({
multiIndex: e.detail.value
})
},
showPlanStartTimePopup () {
this.setData({ planStartTimePopupShow: true })
},
closePlanStartTimePopup () {
this.setData({ planStartTimePopupShow: false })
},
onPlanStartTimeChange (event) {
this.setData({ planStartTime: event.detail, })
},
showPlanEndTimePopup () {
this.setData({ planEndTimePopupShow: true })
},
closePlanEndTimePopup () {
this.setData({ planEndTimePopupShow: false })
},
onPlanEndTimeChange (event) {
this.setData({ planEndTime: event.detail, })
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage () {
}
})

12
weapp/package/troubleshooting/shootingForm/index.json

@ -0,0 +1,12 @@
{
"usingComponents": {
"van-button": "@vant/weapp/button/index",
"van-field": "@vant/weapp/field/index",
"van-cell": "@vant/weapp/cell/index",
"van-cell-group": "@vant/weapp/cell-group/index",
"van-picker": "@vant/weapp/picker/index",
"van-popup": "@vant/weapp/popup/index",
"van-icon": "@vant/weapp/icon/index",
"van-datetime-picker": "@vant/weapp/datetime-picker/index"
}
}

78
weapp/package/troubleshooting/shootingForm/index.wxml

@ -0,0 +1,78 @@
<view style="background:#F7F7FA; min-height:calc(100vh - 48rpx); padding:24rpx 0">
<van-cell-group inset class="mission-card">
<view class="mission-card-title">
<span>巡检信息</span>
</view>
<van-field value="输入框已禁用" label="结构物名称" readonly border="{{ false }}" />
<van-field value="输入框已禁用" label="巡检人" readonly border="{{ false }}" />
<van-field value="输入框已禁用" label="巡检单位" readonly border="{{ false }}" />
<van-field value="输入框已禁用" label="巡检时间" readonly border="{{ false }}" />
<view class="mission-card-title mission-center-card-title">
<span>问题详情</span>
</view>
<van-field value="输入框已禁用" label="点位名称" readonly border="{{ false }}" />
<van-field value="输入框已禁用" label="检查项" readonly border="{{ false }}" />
<van-field value="输入框已禁用" label="异常等级" readonly border="{{ false }}" />
<van-field value="输入框已禁用" label="问题描述" readonly border="{{ false }}" />
<van-cell border="{{false}}">
<view style="display:flex">
<view class="fs-cell-title" style="">现场照片</view>
<view class="fs-cell-content" style="">
123
<!-- <image class='weui-uploader__img showImg' src="{{imgUrl + item}}" data-img="{{imgUrl + item}}" data-index="{{index}}" data-key="{{key}}" mode="aspectFill" bindtap="previewImg"></image> -->
</view>
</view>
</van-cell>
<view class="mission-card-title mission-center-card-title">
<span>维修计划信息</span>
</view>
<van-cell>
<view style="display:flex">
<view class="fs-cell-title" style="">维修人</view>
<picker style="width:100%;text-align:left" bindchange="onMaintenancePersonPopupChange" value="{{0}}" range="{{['array']}}">
<view class="fs-cell-content" style="width:100%">
当前选择
<van-icon name="arrow" style="float:right;position:relative; top:4px" />
</view>
</picker>
</view>
</van-cell>
<van-field value="xxxx" label="维修单位" placeholder="请填写" readonly="{{0}}" border="{{ true }}" />
<van-cell>
<view style="display:flex">
<view class="fs-cell-title" style="">质检人</view>
<picker style="width:100%;text-align:left" bindchange="onMaintenancePersonPopupChange" value="{{0}}" range="{{['array']}}">
<view class="fs-cell-content" style="width:100%">
当前选择
<van-icon name="arrow" style="float:right;position:relative; top:4px" />
</view>
</picker>
</view>
</van-cell>
<van-cell>
<view style="display:flex">
<view class="fs-cell-title" style="">计划开始时间</view>
<view class="fs-cell-content" style="width:100%;text-align:left" bindtap="showPlanStartTimePopup">
当前选择
<van-icon name="arrow" style="float:right;position:relative; top:4px" />
</view>
<van-popup show="{{ planStartTimePopupShow }}" position="bottom" custom-style="height: 50%;" bind:close="closePlanStartTimePopup">
<van-datetime-picker value="{{ planStartTime }}" bind:input="onInput" show-toolbar="{{false}}" />
</van-popup>
</view>
</van-cell>
<van-cell>
<view style="display:flex">
<view class="fs-cell-title" style="">计划结束时间</view>
<view class="fs-cell-content" style="width:100%;text-align:left" bindtap="showPlanStartTimePopup">
当前选择
<van-icon name="arrow" style="float:right;position:relative; top:4px" />
</view>
<van-popup show="{{ planStartTimePopupShow }}" position="bottom" custom-style="height: 50%;" bind:close="closePlanStartTimePopup">
<van-datetime-picker value="{{ planStartTime }}" bind:input="onInput" show-toolbar="{{false}}" />
</van-popup>
</view>
</van-cell>
<van-field value="{{ maintenanceRequirement }}" label="维修要求" type="textarea" placeholder="请输入" autosize border="{{ true }}" />
</van-cell-group>
</view>

26
weapp/package/troubleshooting/shootingForm/index.wxss

@ -0,0 +1,26 @@
/* package/troubleshooting/shootingForm/index.wxss */
.mission-card-title {
background-color: #fff;
overflow: auto;
padding: 24rpx 16px;
display: flex;
justify-content: space-between;
align-items: center
}
.mission-center-card-title {
padding-top: 64rpx;
}
.fs-cell-title {
max-width: 6.2em;
min-width: 6.2em;
margin-right: 12px;
text-align: left;
color: var(--field-label-color, #646566)
}
.fs-cell-content {
color: var(--field-input-text-color, #323233)
}

7
weapp/project.private.config.json

@ -14,6 +14,13 @@
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "事件处理详情",
"pathName": "package/troubleshooting/shootingForm/index",
"query": "shootingid=5",
"launchMode": "default",
"scene": null
}
]
}

Loading…
Cancel
Save