<template>
	<view class="">
		<u-sticky offset-top="50">
			<u-subsection fontSize='25' mode='subsection' :list="list" :current="curNow" @change="sectionChange"
				activeColor='#157A2C'></u-subsection>
		</u-sticky>
		<view v-show='curNow===0'>
			<u--form style="margin: 0 20px;" labelPosition="left" :model="form" ref="uForm" labelWidth='200rpx'>
				<u-form-item label="关联商机名称" prop="opportunityName" borderBottom>
					{{ form.opportunityName || '-' }}
				</u-form-item>
				<u-form-item label="报价方名称" prop="quoteName" borderBottom>
					{{ form.quoteName || '-' }}
				</u-form-item>
				<u-form-item label="询价方名称" prop="contactName" borderBottom>
					{{ form.contactName || '-' }}
				</u-form-item>
				<u-form-item label="报价方联系人" prop="quoteLinkName" borderBottom>
					{{ form.quoteLinkName || '-' }}
				</u-form-item>
				<u-form-item label="询价方联系人" prop="contactLinkName" borderBottom>
					{{ form.contactLinkName || '-' }}
				</u-form-item>
				<u-form-item label="报价方联系电话" prop="quoteTel" borderBottom>
					{{ form.quoteTel || '-' }}
				</u-form-item>
				<u-form-item label="询价方电话" prop="contactTel" borderBottom>
					{{ form.contactTel || '-' }}
				</u-form-item>
				<u-form-item label="报价方传真" prop="quoteFax" borderBottom>
					{{ form.quoteFax || '-' }}
				</u-form-item>
				<u-form-item label="询价方传真" prop="contactFax" borderBottom>
					{{ form.contactFax || '-' }}
				</u-form-item>
				<u-form-item label="报价方Email" prop="quoteEmail" borderBottom>
					{{ form.quoteEmail || '-' }}
				</u-form-item>
				<u-form-item label="询价方Email" prop="contactEmail" borderBottom>
					{{ form.contactEmail || '-' }}
				</u-form-item>
				<u-form-item label="报价方地址" prop="quoteAddress" borderBottom>
					{{ form.quoteAddress || '-' }}
				</u-form-item>
				<u-form-item label="询价方地址" prop="contactAddress" borderBottom>
					{{ form.contactAddress || '-' }}
				</u-form-item>
				<u-form-item label="是否接受拆单" prop="acceptUnpack" borderBottom>
					{{ form.acceptUnpack == 1 ? '接受' : '不接受' }}
				</u-form-item>
				<u-form-item label="附件" prop="askFile" borderBottom>
					<fileMain v-model="form.askFile" type="view"></fileMain>
				</u-form-item>
				<u-form-item label="结算方式" prop="settlementModeName" borderBottom>
					{{ form.settlementModeName || '-' }}
				</u-form-item>
			</u--form>
		</view>
		<view v-show='curNow===1'>
			<u-sticky offset-top="100">
				<u-tag
					:text="`总计: ${form.totalPrice || 0}`"
					size="large" type="success"></u-tag>
			</u-sticky>
			<quote-product-list :list="form.quoteProductList"></quote-product-list>
		</view>
	</view>
</template>

<script>
	import {
		getQuotationDetailAPI
	} from '@/api/saleManage/quotation.js'
	import fileMain from "@/pages/doc/index.vue"
	import quoteProductList from "../common/commonProductList.vue"
	import {transactionMethodsOp,shippingModeOp,shippingModePurchaseOp, pricingWayList, levelList, quoteTypeOp} from '@/enum/dict.js'
	export default {
		components: {
			fileMain,
			quoteProductList
		},
		props: {
			businessId: {
				default: ''
			},
			taskDefinitionKey: {
				default: ''
			},
		},
		computed: {
	
		},
		data() {
			return {
				form: {},
				list: ['基本信息', '物品清单'],
				curNow: 0
			}
		},
		async mounted() {
			await this.getDetailData(this.businessId);
		},
		methods: {
			sectionChange(index) {
				this.curNow = index;
			},
			async getDetailData(id) {
				const data = await getQuotationDetailAPI(id);
				this.form = data;
			}
		}
	}
</script>

<style scoped>
.btnConcel {
		margin-top: 20rpx;
	}
</style>