<template>
	<view>
		<form @submit="updata">
			<view class="body">
				更换原因：<textarea class="input-two" name="replaceReason" />
				</view>
		<view class="">
			<button type="primary" formType="submit" class="button">
				<p class="p">提交</p>
			</button>
		</view>
	
	</form>
	</view>
</template>

<script>
	import {
		mapState,
		mapActions,
		mapMutations
	} from 'vuex'
	export default {
		data() {
			return {
				
			}
		},
		methods: {
			updata(event) {
				var serverUrl = this.serverurl;
				const {
					value: modules
				} = event.detail;
				var token = uni.getStorageSync("token");
				var coding = uni.getStorageSync("updateModules");
				var machineCoding = uni.getStorageSync("updateMachineCode");
				var personnel = uni.getStorageSync("name");
				uni.request({
					url: serverUrl + "/TModules/updateModules",
					method: "POST",
					data: {
						"replaceReason": modules.replaceReason,
						"coding": coding,
						"machineCoding": machineCoding,
						"replacePersonnel": personnel
					},
					header: {
						'token': token
					},
					success: (Result) => {
						var res = Result;
						if (res.data.code == true) {
				
						}
						uni.showModal({
							title: '提示',
							content: res.data.message,
						});
					}
				});
			
			},
		}
	}
</script>

<style>
	.body {
		background-color: #FFFFFF;
		padding: 20upx 25upx 20upx 20upx;
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
	}
	.input-two{
		padding-left: 20upx;
		width: 450upx;
		box-shadow: 0upx 0upx 20upx #D3D3D3;
		border-radius: 5upx;
	}
	.button {
		margin: auto;
		width: 60%;
		height: 100upx;
	}
	.p {
		/* #ifdef H5 */
		top: -13%;
		/* #endif */
		width: 80upx;
		height: 60upx;
		font-size: 40upx;
		padding-top: 6upx;
		/* #ifndef H5 */
		padding-top: 10upx;
		/* #endif */
	
		position: absolute;
		/* 水平居中 */
		left: 50%;
		-webkit-transform: translateX(-50%);
		transform: translateX(-50%);
	}
</style>
