<template>
|
<view>
|
|
<view class="form-container">
|
<form :modelValue="topData">
|
<view class="form-group">
|
<label class="form-label">标题:</label>
|
<input class="form-input" disabled="true" type="text" v-model="topData.title"/>
|
</view>
|
<view class="form-group">
|
<label class="form-label">单据号:</label>
|
<input class="form-input" disabled="true" type="text" v-model="topData.route"/>
|
</view>
|
<view class="form-group">
|
<label class="form-label">时间:</label>
|
<input class="form-input" disabled="true" type="text" v-model="topData.createDate"/>
|
</view>
|
|
</form>
|
</view>
|
|
<view class="text" v-if="Message">
|
<text v-text="Message"></text>
|
</view>
|
|
<view class="plus-button">
|
<button type="primary" @click="go">跳转到原单据</button>
|
</view>
|
|
</view>
|
</template>
|
|
<script>
|
|
export default {
|
data() {
|
return {
|
id: 0,
|
data: [],
|
customData: {},
|
topData: {},
|
Message: ""
|
}
|
},
|
methods: {
|
go() {
|
uni.navigateTo({
|
url: '../' + this.topData.pageName + "&msgId="+ this.id
|
});
|
},
|
setTitle(title) {
|
// 修改页面标题的方法,uni-app中可以通过api直接设置当前页面的标题
|
uni.setNavigationBarTitle({
|
title: title
|
});
|
},
|
init() {
|
this.$post({
|
url: "/MessageCenter/GetByPid",
|
data: {
|
pid: this.id
|
}
|
}).then(res => {
|
let api = res.data.tbBillList;
|
api.sort((a, b) => a.seq - b.seq);
|
this.topData = api[0];
|
this.customData = api[0];
|
this.data = api;
|
}).catch(error => {
|
console.error("Error in init:", error);
|
});
|
},
|
},
|
onLoad(options) {
|
this.setTitle(options.title);
|
this.id = options.id;
|
this.init();
|
}
|
}
|
</script>
|
|
<style>
|
/* Add your styles here */
|
.text {
|
background-color: #ffee6f;
|
}
|
|
.form-group {
|
display: flex;
|
align-items: center;
|
border-bottom: 1px solid #c9c9c9;
|
}
|
|
.form-label {
|
margin-bottom: 0;
|
padding: 5px;
|
}
|
|
.form-input {
|
flex: 1;
|
margin-bottom: 0;
|
padding: 5px;
|
}
|
|
.form-container {
|
padding: 10px;
|
/* 可选:添加一些内边距,使表单内容更美观 */
|
}
|
|
|
.plus-button {
|
line-height: 59px;
|
font-size: 24px;
|
cursor: pointer;
|
z-index: 1000;
|
margin-bottom: 10px;
|
}
|
</style>
|