<template>
	<view>
		<h3>修改报告请求说明</h3>
		<view class="centent">
			<u-input v-model="value" type="textarea" :border="true" height="200" />
			<u-button type="error" class="btn" @click="getSave">提交申请</u-button>
		</view>
	</view>
</template>

<script>
	import {
		ACCESS_TOKEN,
		USER_NAME,
		USER_INFO
	} from "@/common/util/constants"
	export default {
		props: {
			id: {
				type: String,
				default: ''
			}
		},
		data() {
			return {
				value: '',
				userid: '',
				time: ''
			}
		},
		created() {
			this.getInit()
		},
		methods: {
			getInit() {
				let info = uni.getStorageSync(USER_INFO);
				if (info.employee.id) {
					this.userid = info.employee.id || ''
				}
				var nowDate = new Date((new Date).getTime() + 8 * 60 * 60 * 1000)
				var time = nowDate.toJSON().split('T').join(' ').substr(0, 19)
				this.time = time
			},
			//提交
			getSave() {
				let pp = {
					paramWhere: [{
						id_: this.id
					}],
					tableName: "t_lhjcbgb",
					paramCond: {
						xiu_gai_bao_gao_b: this.value,
						update_time_: this.time,
						update_by_: this.userid
					}
				}
				let data = this.$sig(pp)

				this.$http.post("ibps/business/v3/sys/universal/updateDatasContextTable", data).then(res => {
					if (res.data.state == 200) {
						uni.showToast({
							title: '提交成功',
							icon: 'none',
							duration: 2000
						})
						this.$emit('saveSuccees')

					} else {
						uni.showToast({
							title: '提交失败',
							icon: 'none',
							duration: 2000
						})
					}
				});

			}
		}
	}
</script>

<style lang="scss" scoped>
	h3 {
		text-align: center;
		margin: 30rpx 0;
	}

	.centent {
		margin: 30rpx;
	}

	.btn {
		margin-top: 30rpx;
	}
</style>
