<template>
	<div>
		<div class="content">
			<dataBreadcrumb :breads="breads"></dataBreadcrumb>
			<changeNav :navs="navs"></changeNav>
			<div class="message">
				<el-form ref="form" :model="form" :rules="rules" label-width="160px" class="demo-ruleForm">
					<div class="flex-between">
						<div>项目编号：{{projectCode}}</div>
						<div>项目名称：{{projectName}}</div>
					</div>
					<div class="flex-between">
						<el-form-item label="合同名称：" prop="name">
							<el-input v-model="form.name" placeholder="请输入"></el-input>
						</el-form-item>
						<el-form-item label="合同类型：" prop="name">
							<el-input v-model="form.type" placeholder="请输入"></el-input>
						</el-form-item>
					</div>
					<div class="flex-between">
						<el-form-item label="工期：" prop="name">
							<el-input v-model="form.name" placeholder="请输入"></el-input>
						</el-form-item>
						<el-form-item label="总负责人名称：" prop="name">
							<el-input v-model="form.type" placeholder="请输入"></el-input>
						</el-form-item>
					</div>
					<div class="flex-between">
						<el-form-item label="总负责人身份证号：" prop="name">
							<el-input v-model="form.name" placeholder="请输入"></el-input>
						</el-form-item>
						<el-form-item label="采购商名称：" prop="name">
							<el-input v-model="form.type" placeholder="请输入"></el-input>
						</el-form-item>
					</div>
					<div class="flex-between">
						<el-form-item label="是否联合体投标：" prop="name">
							<el-radio v-model="form.type" label="1">是</el-radio>
							<el-radio v-model="form.type" label="2">否</el-radio>
						</el-form-item>
						<el-form-item label="合同总价（元）：" prop="name">
							<el-input v-model="form.type" placeholder="请输入"></el-input>
						</el-form-item>
					</div>
					<div class="flex-between">
						<el-form-item label="合同有效期起止日期：" prop="data">
							<el-date-picker v-model="form.data" type="datetimerange" range-separator="至" start-placeholder="开始日期"
							 end-placeholder="结束日期">
							</el-date-picker>
						</el-form-item>
						<el-form-item label="合同期限（天）：" prop="name">
							<el-input v-model="form.type" placeholder="请输入"></el-input>
						</el-form-item>
					</div>
					<el-form-item label="合同文件：" prop="name">
						<el-input v-model="form.type" placeholder="请输入"></el-input>
					</el-form-item>
					<el-form-item label="其它附件：" prop="name">
						<el-input v-model="form.type" placeholder="请输入"></el-input>
					</el-form-item>
					<el-form-item label="合同范围：" prop="name">
						<el-input v-model="form.type" :rows="4" placeholder="请输入" type="textarea"></el-input>
					</el-form-item>
				</el-form>
			</div>
			<div class="centerButton">
				<el-button @click="back">返回</el-button>
				<el-button type="primary">保存</el-button>
			</div>
		</div>
	</div>
</template>

<script>
	import {
		contractdetail
	} from '@api/supply/bid'
	import dataBreadcrumb from '@components/dataBreadcrumb.vue'
	import changeNav from '@components/changeNav.vue'
	export default {
		components: {
			dataBreadcrumb,
			changeNav
		},
		data() {
			return {
				projectCode:"",
				projectName:"",
				breads: ['投标管理 ', '我参加的项目', '工作台'],
				navs: ['合同管理'],
				form: {
					name: '',
					data: '',
					type: ''
				},
				rules: {
					name: [{
						required: true,
						message: '请选择时间',
						trigger: 'blur'
					}]
				},
				projectCode: "",
				projectName: ""
			}
		},
		methods: {
			back() {
				this.$router.go(-1)
			},
			async getcontractdetaill() {
				let projectId = localStorage.getItem("projectId")
				const {
					data,
					code
				} = await contractdetail(projectId)
				this.form=data
			}
		},
		created() {
			this.projectCode = localStorage.getItem("projectCode");
			this.projectName = localStorage.getItem("projectName");
			this.getcontractdetaill()
		}

	}
</script>
<style scoped>
	.message {
		width: 60%;
		margin: 0 auto
	}
</style>
