123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- <template>
- <view class=" uni-container">
- <view class="example container" :style="'height: ' + (screenHeight - wheight - 75) + 'px'">
- <!-- 自定义表单校验 1-->
- <u--form :model="formData" labelPosition="top" labelWidth="300" labelAlign="left">
- <view class=" flex flex-direction width100">
- <u-form-item label="地点" prop="dd" :required="true">
- <u-input v-model="formData.dd" placeholder="地点" disabled />
- </u-form-item>
- <u-form-item label="起火时间" prop="qhsj" :required="true">
- <uni-datetime-picker v-model="formData.qhsj" mode="date" closeOnClickOverlay
- disabled></uni-datetime-picker>
- </u-form-item>
- <u-form-item label="事故原因" prop="sgyy" :required="true">
- <u-input v-model="formData.sgyy" disabled placeholder="事故原因" />
- </u-form-item>
- <u-form-item label="财产损失金额" :required="true">
- <u-input v-model="formData.ccssje" disabled placeholder="财产损失金额" />
- </u-form-item>
- <u-form-item label="调查单位 "><u-input disabled v-model="formData.dcdw" placeholder="调查单位" /></u-form-item>
- <u-form-item label="人员伤亡情况 ">
- <u-input v-model="formData.ryswqk" disabled placeholder="人员伤亡情况" />
- </u-form-item>
- <u-form-item label="过火面积"><u-input disabled v-model="formData.ghmj" placeholder="是否过火面积" /></u-form-item>
- <u-form-item label="受灾户数"><u-input disabled v-model="formData.szhs" placeholder="受灾户数" /></u-form-item>
- <u-form-item label="备注">
- <u-textarea auto-height maxlength="-1" disabled v-model="formData.remark"
- placeholder="备注"></u-textarea>
- </u-form-item>
- </view>
- </u--form>
- </view>
- <uni-row class="heigthButton">
- <u-button
- @click="gotoEditArchive(formData)"
- shape="circle"
- size="large"
- color="#4cb2b6"
- text="修改信息"
- style="width: 60%;"
- ></u-button>
- </uni-row>
- </view>
- </template>
- <script>
- var that = null;
- export default {
- data() {
- return {
- formData: {
- orgName: ''
- },
- screenHeight: this.$screenHeight,
- wheight: '',
- };
- },
- mounted() {
- uni.createSelectorQuery().in(this).select('.heigthButton').boundingClientRect(data => {
- this.wheight = data.height
- }).exec()
- },
- onLoad: function(option) {
- that = this;
- var data = option.id;
- // 接收来自上个页面传递的参数
- const eventChannel = this.getOpenerEventChannel();
- eventChannel.on('acceptDataFromOpenerPage', function(val) {
- that.formData = val;
- console.log('val+++++++++++++++++++', that.formData);
- });
- this.formData.orgName = option.orgName;
- console.log('option: ', that.formData);
- },
- methods: {
- // 传递当前页面数据到 ‘修改信息’
- gotoEditArchive(val) {
- uni.navigateTo({
- url: '/pagesA/fire/archive/edit_archive/edit_archive4',
- events: {
- // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
- acceptDataFromOpenedPage: function(val) {
- this.formData = val;
- }
- },
- success: function(res) {
- // 通过eventChannel向被打开页面传送数据
- res.eventChannel.emit('acceptDataFromOpenerPage', val);
- }
- });
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- page{
- background-color: #F5F7F9;
- }
- .container {
- position: relative;
- // height: 220vh;
- background-color: rgb(245, 247, 249);
- overflow: auto;
- .buju {
- margin: 40rpx 0;
- }
- }
- .cont {
- }
- .weiwan {
- color: #d51a52;
- background: rgba(213, 26, 82, 0.2);
- padding: 5rpx 20rpx;
- border-radius: 2px;
- border: 1px solid #d51a52;
- }
- .yiwan {
- color: #4cb2b6;
- background: rgba(76, 178, 182, 0.2);
- padding: 5rpx 20rpx;
- border-radius: 2px;
- border: 1px solid #4cb2b6;
- }
- .miaoshu {
- margin-right: 20rpx;
- color: #274647;
- font-weight: 600;
- }
- </style>
|