<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>
|