xwt
18 小时以前 b76e716ff4656191d73eba398e9eb39ee975e13b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<template>
  <view class="container">
    <form>
      <form :modelValue="formData">
        <view class="form-group">
          <label class="form-label">工单:</label>
          <input class="form-input" type="text" v-model="formData.daA001"/>
        </view>
        <view class="form-group">
          <label class="form-label">222:</label>
          <input class="form-input" type="text" v-model="formData.daA002"/>
        </view>
        <view class="form-group">
          <label class="form-label">333:</label>
          <input class="form-input" type="text" v-model="formData.daA003"/>
        </view>
        <view class="form-group">
          <label class="form-label">444:</label>
          <input class="form-input" type="text" v-model="formData.daA004"/>
        </view>
        <view class="form-group">
          <label class="form-label">555:</label>
          <input class="form-input" type="text" v-model="formData.daA005"/>
        </view>
        <view class="form-group">
          <label class="form-label">时间:</label>
          <uni-datetime-picker
              type="datetime"
              class="form-input"
              v-model="formData.daA006"
              :start="startTime"
              :end="endTime"
              @change="bindDateChange"
          ></uni-datetime-picker>
        </view>
      </form>
    </form>
  </view>
</template>
 
<script>
export default {
  name: 'SubPage',
  props: {
    param1: {
      type: String,
      default: ''
    },
    param2: {
      type: String,
      default: ''
    },
    customData: {
      type: Object,
      default: () => ({})
    },
    onCustomEvent: {
      type: Function,
      required: true
    }
  },
  data() {
    return {
      formData: {},
      startTime: '2020-01-01 00:00:00', // 可选择的起始时间
      endTime: '2030-12-31 23:59:59' // 可选择的结束时间
    }
  },
  created() {
    if (this.customData.data) {
      this.formData = JSON.parse(this.customData.data)
    }
  },
  onLoad(options) {
    let id = options["id"];
 
    this.$post({
      url: "/Demo/getItemById",
      data: {
        id: id
      }
    }).then(res => {
      console.log(res);
      this.formData = res.data.tbBillList[0];
      console.log(JSON.stringify(this.formData));
    })
  },
  methods: {
    getData() {
      this.customData.data = JSON.stringify(this.formData);
      return this.customData;
    }
  }
}
</script>
 
<style>
.container {
  padding: 20px;
}
 
.form-group {
  margin-bottom: 10px;
}
 
.form-label {
  display: inline-block;
  width: 150px;
  font-weight: bold;
}
 
.form-input {
  padding: 5px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: calc(100% - 160px);
}
 
.btn-submit {
  padding: 10px;
  background-color: #007bff;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
</style>