﻿<template>
	<transition name="el-zoom-in-center">
		<div class="NCC-preview-main">
			<div class="NCC-common-page-header">
				<el-page-header @back="goBack" :content="'详情'"/>
				<div class="options">
					<el-button @click="goBack">取 消</el-button>
				</div>
			</div>
			<el-row :gutter="15"  class="main" :style="{margin: '0 auto',width:'100%'}">
				<el-form ref="elForm" :model="dataForm" size="medium" label-width="100px" label-position="right" :disabled="!!isDetail" :rules="rules">
					<el-col :span="12" >
						<el-form-item label="线索/客户" prop="typeId">
						 <el-tag type="success" v-if="dataForm.typeId==1">客户</el-tag>
                         <el-tag type="info" v-else>线索</el-tag>
						</el-form-item>
					</el-col>
					<el-col :span="12" >
						<el-form-item label="名称" prop="customerId">
							{{dataForm.customerId}}
						</el-form-item>
					</el-col>
					<el-col :span="12" >
						<el-form-item label="跟进时间" prop="trackTime">
							{{dataForm.trackTime| toDate("yyyy-MM-dd")}}
						</el-form-item>
					</el-col>
					<el-col :span="12" >
						<el-form-item label="跟进阶段" prop="trackStage">
							{{dataForm.trackStage}}
						</el-form-item>
					</el-col>
					<el-col :span="24" >
						<el-form-item label="跟进结果" prop="result">
							{{dataForm.result}}
						</el-form-item>
					</el-col>
					<el-col :span="24" >
						<el-form-item label="采取措施" prop="measure">
							{{dataForm.measure}}
						</el-form-item>
					</el-col>
					<el-col :span="24" >
						<el-form-item label="跟进图片" prop="photos">
							<NCC-UploadImg v-model="dataForm.photos"  disabled  >
							</NCC-UploadImg>
						</el-form-item>
					</el-col>
					<el-col :span="24" >
						<el-form-item label="附件" prop="appendix">
							<NCC-UploadFz v-model="dataForm.appendix" disabled buttonText="点击上传" >
							</NCC-UploadFz>
						</el-form-item>
					</el-col>
					<el-col :span="12" v-if="false" >
						<el-form-item label="跟进人" prop="creater">
							{{dataForm.creater}}
						</el-form-item>
					</el-col>
					<el-col :span="12" v-if="false" >
						<el-form-item label="创建时间" prop="createTime">
							{{dataForm.createTime| toDate("yyyy-MM-dd")}}
						</el-form-item>
					</el-col>
				</el-form>
			</el-row>
		</div>
	</transition>
</template>
<script>
	import request from '@/utils/request'
	import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
	import { previewDataInterface } from '@/api/systemData/dataInterface'
	export default {
		components: {},
		props: [],
		data() {
			return {
				loading: false,
				visible: false,
				isDetail: false,
				dataForm: {
					id:'',
					typeId:undefined,
					customerId:undefined,
					trackTime:undefined,
					trackStage:undefined,
					result:undefined,
					measure:undefined,
					photos:[],
					appendix:[],
					creater:undefined,
					createTime:undefined,
				},
			}
		},
		computed: {},
        watch: {},
        created() {
		},
		mounted() {
        },
		methods: {
			
			goBack() {
                this.$emit('detailRefresh')
            },
			init(id, isDetail) {
				this.dataForm.id = id || 0;
                this.visible = true;
                this.isDetail = isDetail || false;
				this.$nextTick(() => {
					this.$refs['elForm'].resetFields();
					if (this.dataForm.id) {
						request({
							url: '/api/SubDev/ZyOaCustomerTrack/Actions/GetTrackInfo/' + this.dataForm.id,
							method: 'get'
						}).then(res =>{
							this.dataForm = res.data;
						})
					}
				})
			},
		}
	}
</script>
