<template>
	<el-container>
		<el-header class="serveTitle">公司更新信息</el-header>
		<el-main class="serveMain">
			<el-form ref="form" :model="form" :rules="rules">
				<el-form-item label="更新公司信息" prop="company" label-position="top">
					<el-input v-model="form.company" :size="size" class="formInput" type="text" placeholder="请输入公司信息"></el-input>
				</el-form-item>
				<el-form-item>
					<el-button type="primary" @click="save" :size="size" :loading="isSave">提交申请</el-button>
				</el-form-item>
			</el-form>
		</el-main>
	</el-container>
</template>

<script>
export default {
	name: "companyDetail",
	data(){
		return{
			size:"small",
			isSave:false,
			form:{
				company:""
			},
			rules:{
				company:[
					{required:true,message:"公司信息不能为空"}
				]
			}
		}
	},
	mounted() {

	},
	methods:{
		save(){
			this.$refs.form.validate(async (valid) => {
				if (valid) {
					this.isSave = true;
					const res = await this.$API.customer.orderSubmit.post(this.form);
					this.isSave = false;
					if(res.code == 200){
						this.$message.success("操作成功");
						this.form={
							company:"",
						}
					}
				}else{
					return false;
				}
			})
		}
	}
}
</script>

<style scoped lang="scss">
.serveMain{
	::v-deep .formInput{
		width: 300px;
	}
}
</style>
