<template>
	<div>
		<div class="content">
			<div class="content_item">
			    <div class="label">项目名称</div>
			    <div class="content_right">
			        <el-input class="ename_input" 
					placeholder="请输入项目名称关键字" v-model="establishmentDto.keyword" ></el-input>
			    </div>
			</div>
			<div class="content_item">
			    <div class="label">项目业主</div>
			    <div class="content_right">
			        <el-input class="ename_input" 
					placeholder="请输入招标采购单位名称" v-model="establishmentDto.companyName" ></el-input>
			    </div>
			</div>
			<div class="content_item">
			    <div class="label">审批部门</div>
			    <div class="content_right">
			        <el-input class="ename_input" 
					placeholder="请输入审批部门名称或关键词" v-model="establishmentDto.examineOffice" ></el-input>
			    </div>
			</div>
			<div class="content_item">
			    <div class="label">建设地点</div>
			    <div class="content_right">
			        <el-input class="ename_input" 
					placeholder="请输入审批部门名称或关键词" v-model="establishmentDto.buildAddre" ></el-input>
			    </div>
			</div>
			<div class="content_item">
			    <div class="label">建设规模</div>
			    <div class="content_right">
			        <el-input class="ename_input" 
					placeholder="请输入审批部门名称或关键词" v-model="establishmentDto.buildScale" ></el-input>
			    </div>
			</div>
			<div class="content_item">
			    <div class="label">土地信息</div>
			    <div class="content_right">
				   <div class="select-popper">
				   		<span :class="{ color_text: establishmentDto.projectType.length }">
				   			项目类型{{establishmentDto.projectType.length? establishmentDto.projectType.length + "项": ""}}
				   			<i class="el-icon-caret-bottom"></i>
				   		</span>
				   		<el-select v-model="establishmentDto.projectType" class="select-multiple" multiple placeholder="请选择">
				   			<el-option v-for="(item, i) in projectTypeOptions" :key="i" :label="item" :value="item">
				   			</el-option>
				   		</el-select>
				   	</div>
					<div class="select-popper">
						<span :class="{ color_text: establishmentDto.projectType.length }">
							项目类型{{establishmentDto.projectType.length? establishmentDto.projectType.length + "项": ""}}
							<i class="el-icon-caret-bottom"></i>
						</span>
						<el-select v-model="establishmentDto.projectType" class="select-multiple" multiple placeholder="请选择">
							<el-option v-for="(item, i) in projectTypeOptions" :key="i" :label="item" :value="item">
							</el-option>
						</el-select>
					</div>
					<div class="select-popper">
						<span :class="{ color_text: establishmentDto.industry.length }">
							所属行业{{establishmentDto.industry.length? establishmentDto.industry.length + "项": ""}}
							<i class="el-icon-caret-bottom"></i>
						</span>
					    <el-select v-model="establishmentDto.industry" class="select-multiple" multiple placeholder="请选择">
							<el-option v-for="(item, i) in industryOptions" :key="i" :label="item" :value="item">
							</el-option>
						</el-select>
					</div>
					
					<div class="select-popper">
							<span :class="{color_text:establishmentDto.province.length ||establishmentDto.city.length ||establishmentDto.district.length,}">
								项目属地{{establishmentDto.province.length ||establishmentDto.city.length ||establishmentDto.district.length
					                    ? establishmentDto.province.length +establishmentDto.city.length +establishmentDto.district.length +"项": ""}}
								<i class="el-icon-caret-bottom"></i>
							</span>
							<el-cascader ref="address" class="cascader-region" v-model="addressType" :options="addressList" :props="props" @change="domicileChange" collapse-tags clearable></el-cascader>
					</div>
					<el-dropdown @command="moneyhandleCommand"  class="el-dropdown-land" trigger="click" ref="moneyShowPopper" :hide-on-click="false">
							<span class="el-dropdown-link" :class=" establishmentDto.startMoney || establishmentDto.endMoney? 'color_text' : ''">
								总投资{{establishmentDto.startMoney || establishmentDto.endMoney? " 1项": ""}}<i class="el-icon-caret-bottom"></i>
							</span>
							<el-dropdown-menu slot="dropdown">
								<el-dropdown-item v-for="(item, i) in moneyOptions" :class="establishmentDto.startMoney == item.value[0] &&establishmentDto.endMoney == item.value[1] 
								 &&!startMoney &&!endMoney? 'color_text' : ''" :key="i" :command="item.value">{{ item.label }}</el-dropdown-item>
										<el-dropdown-item command="" style="padding: 0; text-indent: 20px">
											<div @mouseenter="moneyShowPopper = true" @mouseleave="moneyShowPopper = false">
												<span :class="(startMoney || endMoney) &&establishmentDto.startMoney == startMoney &&establishmentDto.endMoney == endMoney? 'color_text' : '' ">
															自定义<i class="el-icon-arrow-right"></i>
												</span>
												<div class="jabph_popper_box" style="position: absolute" v-if="moneyShowPopper">
													<div class="jabph_popper_wrap">
														从
														<el-input class="jabph_popper_input" v-limit-num clearable v-model="startMoney"></el-input>
														万
													</div>
													<div class="jabph_popper_wrap">
														到
														<el-input class="jabph_popper_input" v-limit-num clearable v-model="endMoney"></el-input>
														万
													</div>
													<div style="">
														<el-button size="mini" @click="moneyCancel">取消</el-button>
														<el-button type="primary" size="mini" @click="moneyPopperConfirm">确定</el-button>
													</div>
												</div>
											</div>
										</el-dropdown-item>
							</el-dropdown-menu>
					</el-dropdown>
					<div class="select-popper">
						<span class="el-dropdown-link" :class="{ color_text: establishmentDto.isProject }">
							是否为向民间推介项目{{ establishmentDto.isProject ? " 1项" : "" }}<i class="el-icon-caret-bottom"></i>
						</span>
						<el-select v-model="establishmentDto.isProject" class="select-multiple" placeholder="请选择">
							<el-option v-for="(item, i) in isProjectOptions" :key="i" :label="item.label"
								:value="item.value.toString()">
							</el-option>
						</el-select>
					</div>
					<el-dropdown @command="planStartTimehandleCommand"  class="el-dropdown-land" trigger="click" ref="planStartTimeShowPopper":hide-on-click="false">
						<span class="el-dropdown-link" :class="planStartTimeValue ? 'color_text' : ''">
							计划开工时间{{ planStartTimeValue ? " 1项" : ""}}<i class="el-icon-caret-bottom"></i>
						</span>
						<div>
							<el-dropdown-menu slot="dropdown">
								<el-dropdown-item v-for="(item, i) in handleTimeOptions" :class=" planStartTimeValue && planStartTimeValue == item.value? 'color_text': ''" :key="i" :command="item.value">
									<div @mouseenter="hidePoper1">{{ item.label }}</div>
								</el-dropdown-item>
									<el-dropdown-item command="自定义" style="padding: 0; text-indent: 20px">
										<div @mouseenter="mouseenter1">
											<span :class="planStartTimeValue == '自定义' ? 'color_text' : ''">
												自定义<i class="el-icon-arrow-right"></i>
											</span>
											<el-date-picker v-if="planStartTimeShowPopper" @change="changePlanStartTime" class="land_date_picker" v-model="planStartTime" ref="datePicker1"
												value-format="yyyy-MM-dd" type="daterange" range-separator="至"start-placeholder="开始日期" end-placeholder="结束日期">
											</el-date-picker>
										</div>
									</el-dropdown-item>
							</el-dropdown-menu>
						</div>
					</el-dropdown>
					<el-dropdown @command="planEndTimehandleCommand"  class="el-dropdown-land" trigger="click" ref="planEndTimeShowPopper" :hide-on-click="false">
						<span class="el-dropdown-link" :class="planEndTimeValue ? 'color_text' : ''">
							计划完工日期{{ planEndTimeValue ? " 1项" : ""}}<i class="el-icon-caret-bottom"></i>
						</span>
						<div>
							<el-dropdown-menu slot="dropdown">
								<el-dropdown-item v-for="(item, i) in handleTimeOptions" :class="planEndTimeValue && planEndTimeValue == item.value? 'color_text': ''" :key="i" :command="item.value">
									<div @mouseenter="hidePoper2">{{ item.label }}</div>
										</el-dropdown-item>
											<el-dropdown-item command="自定义" style="padding: 0; text-indent: 20px">
												<div @mouseenter="mouseenter2">
													<span :class="planEndTimeValue == '自定义' ? 'color_text' : ''">
														自定义<i class="el-icon-arrow-right"></i>
													</span>
													<el-date-picker v-if="planEndTimeShowPopper" @change="changePlanEndTime"class="land_date_picker" v-model="planEndTime" ref="datePicker2"
														value-format="yyyy-MM-dd" type="daterange" range-separator="至"tart-placeholder="开始日期" end-placeholder="结束日期">
													</el-date-picker>
												</div>
											</el-dropdown-item>
							</el-dropdown-menu>
						</div>
					</el-dropdown>
				 
				   
			    </div>
			</div>
			<div class="content_item content_item_padding0">
			    <div class="geduan">
			       
			    </div>
			</div>
			<div class="content_item content_item_padding0">
				
				<div class="search-new">
					<span @click="search()">查询</span>
					<span @click="reset">重置</span>
				</div>
			</div>
			
		</div>
		<div class="bottomlist">
			<div class="bottomlist-title">
				<div></div>
				<div class="title-right">
					<p>共有{{total}}条</p>
					<p>
						<img src="@/assets/images/EXCEL.png" alt="">
						<span>导出EXCEL</span>
					</p>
				</div>
				  
			</div>
			<ul class="bottomlist-content">
				<li class="bottomlist-list"  >
					<p class="list-titel">
						 <router-link  :to="'/radar/Establishment/details/'+ 1" tag="a" class="list-titel-a"  >绿色节能型压缩机基础件、汽车零配件新建项目 (芜湖旭日机械制造有限公司)</router-link>
						 <!-- <div  v-else-if="item.projectName" v-html="item.projectName"></div> -->
					</p>
					<div class="content-label">
						<span class="list-label">市政工程</span>
					</div>
					
					<div  class="list-content">
						<p class="list-content-text">
							<span>项目业主：</span>
							<span class="blue">芜湖旭日机械制造有限公司</span>
						</p>
						<p class="list-content-text">
							<span>审批部门：</span>
							<span>芜湖旭日</span>
						</p>
						<p class="list-content-text">
							<span>审批结果：</span>
							<span>12345.62万</span>
						</p>
						<p class="list-content-text">
							<span>审批结果：</span>
							<span>2014-05-12</span>
						</p>
						<p class="list-content-text">
							<span>总投资：</span>
							<span>62654</span>
						</p>
						<p class="list-content-text">
							<span>计划开工日期：</span>
							<span>62654</span>
						</p>
						<p class="list-content-text">
							<span>计划完工日期：</span>
							<span>626</span>
						</p>
						<p class="list-content-text">
							<span>是否为向民间推介项目：</span>
							<span>62654</span>
						</p>
						
					</div>
					<div  class="list-content">
						<p class="list-content-text">
							<span>土地用途：</span>
							<span >城镇村道路用地</span>
						</p>
						<p class="list-content-text">
							<span>供应方式：</span>
							<span >挂牌出让</span>
						</p>
					</div>
					<div  class="list-content ">
						<p class="list-content-text">
							<span>批准日期：</span>
							<span>62654</span>
						</p>
						<p class="list-content-text">
							<span>建设规模：</span>
							<span >许巷路西</span>
						</p>
					</div>
				</li>
			</ul>
			<div class="pagination clearfix"  v-show="total>0">
				  <el-pagination
				    background
				    :page-size="pageSize"
				    :current-page="page"
				    @current-change="handleCurrentChange"
				    layout="prev, pager, next"
				    :total="total">
				  </el-pagination>
			</div>
			
		</div>
		
		
		
	</div>
</template>

<script>
	import jsk_data from '../../../../../public/jsk.json';
	
	export default {
		name: 'Establishment',
		components: {
		},
		data() {
			return {
				//是否为向民间推介项目
				isProjectOptions: [{
						value: 0,
						label: "否",
					},
					{
						value: 1,
						label: "是",
					}
				],
				isShow: false,
				openVip: {
					open: false,
				},
				loginData: {
					loginShow: false
				},
				token: "",
				example: 'search-njxm',
				selectedHeight: 64,
				addressList: [],
				addressType: [],
				props: {
					multiple: true,
					expandTrigger: "hover",
					value: "id",
				},
				field: "",
				fieldOptions: [{
						value: "",
						label: "默认排序",
					},
					{
						value: "money",
						label: "总投资从大到小",
					},
					{
						value: "acreage",
						label: "出让面积从大到小",
					},
				],

				page: 1,
				limit: 20,
				moneyOptions: [{
						value: "不限",
						label: "不限",
					},
					{
						value: [0, 100],
						label: "100万元以下",
					},
					{
						value: [100, 1000],
						label: "100万-1000万元",
					},
					{
						value: [1000, 5000],
						label: "1000万-5000万元",
					},
					{
						value: [5000, 20000],
						label: "5000万-2亿元",
					},
					{
						value: [20000, ""],
						label: "2亿元以上",
					},
				],
				handleTimeOptions: [{
						label: "不限",
						value: "",
					},
					{
						label: "近1个月",
						value: "近1个月",
					},
					{
						label: "近半年",
						value: "近半年",
					},
					{
						label: "近1年",
						value: "近1年",
					},
					{
						label: "近3年",
						value: "近3年",
					},
				],
				handleTimeValue: "",
				planStartTimeValue: "",
				planEndTimeValue: "",
				industryOptions: [],
				examineStatusOptions: [
					"不通过",
					"作废",
					"变更",
					"备案",
					"审批",
					"申报",
					"退回",
					"通过",
					"其他"
				],
				projectTypeOptions: [
					"房建工程",
					"市政工程",
					"公路工程",
					"水利工程",
					"铁路工程",
					"通信工程",
					"电力工程",
					"机电工程",
					"冶金工程",
					"矿山工程",
					"石油化工工程",
					"港口与航道工程",
					"其他",
					"空白"
				],
				buildNatureOptions: [
					"扩建",
					"技改",
					"技改及其他",
					"改建",
					"改扩建",
					"新建",
					"迁建",
					"其他"
				],
				establishmentDto: {
					examineStatus: [],
					province: [],
					city: [],
					district: [],
					projectType: [],
					industry: [],
					buildNature: [],
				},
				conditionTitles: {
					keyword: "关键词:",
					companyName: "项目业主:",
					examineOffice: "审批部门:",
					buildAddre: "建设地点:",
					buildScale: "建设规模:",
				},
				domicile: [],
				startMoney: "",
				endMoney: "",
				moneyShowPopper: false,
				handleTime: "",
				handleTimeShowPopper: false,
				planStartTime: "",
				planStartTimeShowPopper: false,
				planEndTime: "",
				planEndTimeShowPopper: false,
				pageFlag: true,
				conditionsArr: [],
				
				tableData:[],
				total:6000,
				page:1,
				pageSize:20
			};
		},
		
		computed: {
			checkEstablishmentDto() {
				let arr = [];
				let flag = false;
				let data = {};
				let keyid, value, title;
				if (this.domicile.length > 0) {
					data = {
						title: "项目属地:",
						keyid: "domicile",
						value: this.domicile.join(","),
						key: "domicile"
					}
					arr.push(data)
				}
				if (this.handleTimeValue == "自定义") {
					data = {
						title: "办结时间:",
						keyid: "handleTime",
						value: this.establishmentDto.handleTimeStart + "~" + this.establishmentDto.handleTimeEnd,
						key: "handleTime"
					}
					arr.push(data)
				}
				if (this.handleTimeValue && this.handleTimeValue != "自定义") {
					data = {
						title: "办结时间:",
						keyid: "handleTime",
						value: this.handleTimeValue,
						key: "handleTime"
					}
					arr.push(data)
				}
				if (this.planStartTimeValue && this.planStartTimeValue != "自定义") {
					data = {
						title: "计划开工时间:",
						keyid: "planStartTime",
						value: this.planStartTimeValue,
						key: "planStartTime"
					}
					arr.push(data)
				}
				if (this.planStartTimeValue == "自定义") {
					data = {
						title: "计划开工时间:",
						keyid: "planStartTime",
						value: this.establishmentDto.planStartTimeStart + "~" + this.establishmentDto.planStartTimeEnd,
						key: "planStartTime"
					}
					arr.push(data)
				}
				if (this.planEndTimeValue && this.planEndTimeValue != "自定义") {
					data = {
						title: "计划完工日期:",
						keyid: "planEndTime",
						value: this.planEndTimeValue,
						key: "planEndTime"
					}
					arr.push(data)
				}
				if (this.planEndTimeValue == "自定义") {
					data = {
						title: "计划完工日期:",
						keyid: "planEndTime",
						value: this.establishmentDto.planEndTimeStart + "~" + this.establishmentDto.planEndTimeEnd,
						key: "planEndTime"
					}
					arr.push(data)
				}
				for (var i in this.establishmentDto) {
					if (this.establishmentDto[i]) {
						keyid = i;
						value = this.establishmentDto[i];
						if (
							Object.prototype.toString.call(this.establishmentDto[i]) ===
							"[object Array]"
						) {
							if (this.establishmentDto[i].length > 0) {
								flag = true;
								switch (i) {
									case 'examineStatus':
										title = "审批结果:";
										break;
									case 'projectType':
										title = "项目类型:";
										break;
									case 'industry':
										title = "所属行业:";
										break;
									case 'buildNature':
										title = "建设性质:";
										break;
									case 'isProject':
										title = "是否为向民间推介项目:";
										break;
									default:
										title = "";
										break;
								}
							} else {
								title = ""
							}
						} else {
							title = this.conditionTitles[i];
							flag = true;
						}
						if (title) {
							data = {
								keyid: keyid,
								value: value,
								title: title,
								key: value
							}
							arr.push(data)
						}
					}
				}
				this.conditionsArr = arr
				return flag;
			},
		},
		mounted() {
			if (this.$route.query.keyword) {
				var obj = JSON.parse(JSON.stringify(this.establishmentDto));
				obj.keyword = this.$route.query.keyword;
				this.establishmentDto = obj;
			}
			// this.addressListfn();
			// this.$axios.get('https://files.jiansheku.com/file/json/common/searchDic.json').then(res => {
			// 	 				if (res && res.status == 200) {
			// 	 					this.projectTypeOptions = res.data.projectType;
			// 						this.industryOptions = res.data.establishmentIndustry
			// 	 				}
			// 	 			}).catch(error=>{
			// 	 　　
			//  });

			//  if(this.industryOptions.length==0){
			// 	 this.$axios
			// 	   .post("/nationzj/project/recently/typeList", {
			// 	     timeout: "49999",
			// 	     headers: {
			// 	       "Content-Type": "application/json;charset=UTF-8",
			// 	     },
			// 	   })
			// 	   .then((res) => {
			// 	     if (res.data.code == 200) {
			// 	       this.industryOptions = res.data.data.establishmentIndustryList;

			// 	     }
			// 	   })
			// 	   .catch((err) => {});
			//  }


		},
		methods: {
		
			refresh(value) {
				if (value) {
					this.$router.go(0)
				}
			},
			search(page, limit, exportFlag) {
				if (!page) {
					this.page = 1;
				}
				if (!limit) {
					this.limit = 20;
				}
				if (!page && !limit) {
					this.reloadPage();
				}
				var data = JSON.parse(JSON.stringify(this.establishmentDto));
				data.province = data.province.join(",");
				data.city = data.city.join(",");
				data.district = data.district.join(",");
				data.projectType = data.projectType.join(",");
				data.industry = data.industry.join(",");
				if (data.isProject && data.isProject === 0) {
					data.isProject = parseInt(data.isProject);
				}
				let params = {
					page: {
						page: this.page,
						limit: this.limit,
						field: this.field,
					},
					establishmentDto: data,
				};
				if (exportFlag) {
					if (!this.goThrough('', this.permissions.export)) {
						this.goThrough('', this.permissions.export);
					} else {
						this.$refs.ExportData.exportCount('BUSINESS_SEARCH_NIJIAN', params) //商机-拟建项目
					}
				} else {
					this.$emit("search", params)
				}
			},
			//关闭支付弹窗
			cancelVipPay(val) {
				this.openVip.open = false
				if (val) {
					this.resolve(val);
				}
			},
			cancelLogin(val) {
				this.loginData.loginShow = false;
				if (val) {
					this.resolve(val);
				}
			},
			resolve(value) {
				if (value) {
					this.$router.go(0)
				}
			},
			selectedHeightfn() {
				if (this.selectedHeight == 64) {
					this.selectedHeight = 'auto'
				} else {
					this.selectedHeight = 64;
				}
			},
			copyText() {
				var value = "";
				if (this.establishmentDto.startMoney && !this.establishmentDto.endMoney) {
					this.establishmentDto.startMoney > 9999 ?
						value = this.establishmentDto.startMoney / 10000 + "亿元以上" :
						value = this.establishmentDto.startMoney + "万元以上"

				}
				if (!this.establishmentDto.startMoney && this.establishmentDto.endMoney) {
					this.establishmentDto.endMoney > 9999 ?
						value = this.establishmentDto.endMoney / 10000 + "亿元以上" :
						value = this.establishmentDto.endMoney + "万元以上"
				}
				if (this.establishmentDto.startMoney && this.establishmentDto.endMoney) {
					value = (this.establishmentDto.startMoney > 9999 ? this.establishmentDto.startMoney / 10000 + "亿-" :
						this.establishmentDto.startMoney + '万-') + (this.establishmentDto.endMoney > 9999 ? this
						.establishmentDto.endMoney / 10000 + "亿" : this.establishmentDto.endMoney + '万')
				}
				if (value) {
					var data = {
						title: "总投资:",
						keyid: "money",
						value: value,
						key: "money"
					}
					var arr1 = [];
					arr1.push(data);
					this.conditionsArr = this.conditionsArr.concat(arr1)
				}
				let arr = this.conditionsArr
				let newArr = []
				for (var i = 0; i < arr.length; i++) {
					newArr.push(arr[i].title + (arr[i].value == 'yes' ? '' : arr[i].value))
				}
				let val = newArr.join(";")
				let _this = this
				_this.$copyText(val).then(function(e) {
					_this.$message({
						message: "已复制到剪切板，您可以粘贴至对话框！",
						type: "success"
					})
				}, function(e) {
					_this.$message({
						message: "已复制到剪切板，您可以粘贴至对话框！",
						type: "success"
					})
				}).catch(err => {
					console.log(err)
				})
			},
			reloadPage() {
				this.pageFlag = false;
				this.$nextTick(() => {
					this.pageFlag = true;
				});
			},
			handleCurrentChange(page) {
				this.page = page;
				this.search(page, this.limit);
			},
			handleSizeChange(limit) {
				this.limit = limit;
				this.search(this.page, limit);
			},
			deleteDomicile() {
				this.$refs.address.handleClear();
			},
			domicileChange() {
				let arr = this.$refs.address.getCheckedNodes();
				let province = [],
					city = [],
					district = [];
				this.domicile = [];
				for (var i in arr) {
					if (arr[i].parent) {
						if (!arr[i].parent.checked) {
							arr[i].hasChildren && city.push(arr[i].value);
							arr[i].hasChildren && this.domicile.push(arr[i].label);
							!arr[i].hasChildren && district.push(arr[i].value);
							!arr[i].hasChildren && this.domicile.push(arr[i].label);
						}
					} else {
						province.push(arr[i].value);
						this.domicile.push(arr[i].label);
					}
				}
				var obj = JSON.parse(JSON.stringify(this.establishmentDto));
				obj.province = province;
				obj.city = city;
				obj.district = district;
				this.establishmentDto = obj;
			},
			moneyPopperConfirm() {
				if (
					this.startMoney &&
					this.endMoney &&
					!(Number(this.endMoney) > Number(this.startMoney))
				) {
					return this.$message.warning("最小值必须小于最大值,请重新输入！");
				}
				this.moneyShowPopper = false;
				var obj = JSON.parse(JSON.stringify(this.establishmentDto));
				obj.startMoney = this.startMoney;
				obj.endMoney = this.endMoney;
				this.establishmentDto = obj;
				this.$refs.moneyShowPopper.hide();
			},
			moneyCancel() {
				this.moneyShowPopper = false;
				this.$refs.moneyShowPopper.hide();
			},
			moneyhandleCommand(command) {
				if (command) {
					this.$refs.moneyShowPopper.hide();
					var obj = JSON.parse(JSON.stringify(this.establishmentDto));
					this.startMoney = "";
					this.endMoney = "";
					if (command == "不限") {
						obj.startMoney = "";
						obj.endMoney = "";
					} else {
						obj.startMoney = command[0];
						obj.endMoney = command[1];
					}
					this.establishmentDto = obj;
				}
			},
			handleTimehandleCommand(command) {
				var obj = JSON.parse(JSON.stringify(this.establishmentDto));
				if (command && command != "自定义") {
					this.handleTimeValue = command;
					this.$refs.handleTimeShowPopper.hide();
					const datetime = new Date();
					var startTime, endTime, Year, Month, Day;
					Year = datetime.getFullYear();
					Month = datetime.getMonth() + 1;
					Day = datetime.getDate();
					switch (command) {
						case "近1个月":
							if (Month > 1) {
								startTime = Year + "-" + (Month - 1) + "-1";
							} else {
								startTime = Year - 1 + "-" + (12 + Month - 1) + "-1";
							}
							endTime = Year + "-" + Month + "-" + Day;
							break;
						case "近半年":
							if (Month > 6) {
								startTime = Year + "-" + (Month - 6) + "-1";
							} else {
								startTime = Year - 1 + "-" + (12 + Month - 6) + "-1";
							}
							endTime = Year + "-" + Month + "-" + Day;
							break;
						case "近1年":
							startTime = Year - 1 + "-" + Month + "-" + Day;
							endTime = Year + "-" + Month + "-" + Day;
							break;
						case "近3年":
							startTime = Year - 3 + "-" + Month + "-" + Day;
							endTime = Year + "-" + Month + "-" + Day;
							break;
						case "自定义":
							if (!this.handleTime) {
								this.handleTimeValue = "";
							}
							break;
					}
					if (startTime) {
						var start = startTime.split('-');
						startTime = start.map((item) => {
							if (item.length == 1) {
								return '0' + item
							} else {
								return item
							}
						})
						startTime = startTime.join('-')
					}
					if (endTime) {
						var end = endTime.split('-');
						endTime = end.map((item) => {
							if (item.length == 1) {
								return '0' + item
							} else {
								return item
							}
						})
						endTime = endTime.join('-')
					}
					obj.handleTimeStart = startTime;
					obj.handleTimeEnd = endTime;
				} else if (command == "自定义") {
					this.$refs.datePicker.pickerVisible = true;
				} else {
					this.$refs.handleTimeShowPopper.hide();
					this.handleTimeValue = "";
					this.handleTime = "";
					obj.handleTimeStart = "";
					obj.handleTimeEnd = "";
				}
				this.establishmentDto = obj;
			},
			planStartTimehandleCommand(command) {
				var obj = JSON.parse(JSON.stringify(this.establishmentDto));
				if (command && command != "自定义") {
					this.planStartTimeValue = command;
					this.$refs.planStartTimeShowPopper.hide();
					const datetime = new Date();
					var startTime, endTime, Year, Month, Day;
					Year = datetime.getFullYear();
					Month = datetime.getMonth() + 1;
					Day = datetime.getDate();
					switch (command) {
						case "近1个月":
							if (Month > 1) {
								startTime = Year + "-" + (Month - 1) + "-1";
							} else {
								startTime = Year - 1 + "-" + (12 + Month - 1) + "-1";
							}
							endTime = Year + "-" + Month + "-" + Day;
							break;
						case "近半年":
							if (Month > 6) {
								startTime = Year + "-" + (Month - 6) + "-1";
							} else {
								startTime = Year - 1 + "-" + (12 + Month - 6) + "-1";
							}
							endTime = Year + "-" + Month + "-" + Day;
							break;
						case "近1年":
							startTime = Year - 1 + "-" + Month + "-" + Day;
							endTime = Year + "-" + Month + "-" + Day;
							break;
						case "近3年":
							startTime = Year - 3 + "-" + Month + "-" + Day;
							endTime = Year + "-" + Month + "-" + Day;
							break;
						case "自定义":
							if (!this.planStartTime) {
								this.planStartTimeValue = "";
							}
							break;
					}
					if (startTime) {
						var start = startTime.split('-');
						startTime = start.map((item) => {
							if (item.length == 1) {
								return '0' + item
							} else {
								return item
							}
						})
						startTime = startTime.join('-')
					}
					if (endTime) {
						var end = endTime.split('-');
						endTime = end.map((item) => {
							if (item.length == 1) {
								return '0' + item
							} else {
								return item
							}
						})
						endTime = endTime.join('-')
					}
					obj.planStartTimeStart = startTime;
					obj.planStartTimeEnd = endTime;
				} else if (command == "自定义") {
					this.$refs.datePicker1.pickerVisible = true;
				} else {
					this.$refs.planStartTimeShowPopper.hide();
					this.planStartTimeValue = "";
					this.planStartTime = "";
					obj.planStartTimeStart = "";
					obj.planStartTimeEnd = "";
				}
				this.establishmentDto = obj;
			},
			planEndTimehandleCommand(command) {
				var obj = JSON.parse(JSON.stringify(this.establishmentDto));
				if (command && command != "自定义") {
					this.planEndTimeValue = command;
					this.$refs.planEndTimeShowPopper.hide();
					const datetime = new Date();
					var startTime, endTime, Year, Month, Day;
					Year = datetime.getFullYear();
					Month = datetime.getMonth() + 1;
					Day = datetime.getDate();
					switch (command) {
						case "近1个月":
							if (Month > 1) {
								startTime = Year + "-" + (Month - 1) + "-1";
							} else {
								startTime = Year - 1 + "-" + (12 + Month - 1) + "-1";
							}
							endTime = Year + "-" + Month + "-" + Day;
							break;
						case "近半年":
							if (Month > 6) {
								startTime = Year + "-" + (Month - 6) + "-1";
							} else {
								startTime = Year - 1 + "-" + (12 + Month - 6) + "-1";
							}
							endTime = Year + "-" + Month + "-" + Day;
							break;
						case "近1年":
							startTime = Year - 1 + "-" + Month + "-" + Day;
							endTime = Year + "-" + Month + "-" + Day;
							break;
						case "近3年":
							startTime = Year - 3 + "-" + Month + "-" + Day;
							endTime = Year + "-" + Month + "-" + Day;
							break;
						case "自定义":
							if (!this.planEndTime) {
								this.planEndTimeValue = "";
							}
							break;
					}
					if (startTime) {
						var start = startTime.split('-');
						startTime = start.map((item) => {
							if (item.length == 1) {
								return '0' + item
							} else {
								return item
							}
						})
						startTime = startTime.join('-')
					}
					if (endTime) {
						var end = endTime.split('-');
						endTime = end.map((item) => {
							if (item.length == 1) {
								return '0' + item
							} else {
								return item
							}
						})
						endTime = endTime.join('-')
					}
					obj.planEndTimeStart = startTime;
					obj.planEndTimeEnd = endTime;
				} else if (command == "自定义") {
					this.$refs.datePicker2.pickerVisible = true;
				} else {
					this.$refs.planEndTimeShowPopper.hide();
					this.planEndTimeValue = "";
					this.planEndTime = "";
					obj.planEndTimeStart = "";
					obj.planEndTimeEnd = "";
				}
				this.establishmentDto = obj;
			},
			changeHandleTime() {
				if (this.handleTime) {
					this.handleTimeValue = "自定义";
					var obj = JSON.parse(JSON.stringify(this.establishmentDto));
					obj.handleTimeStart = this.handleTime[0];
					obj.handleTimeEnd = this.handleTime[1];
					this.establishmentDto = obj;
				}
			},
			changePlanStartTime() {
				if (this.planStartTime) {
					this.planStartTimeValue = "自定义";
					var obj = JSON.parse(JSON.stringify(this.establishmentDto));
					obj.planStartTimeStart = this.planStartTime[0];
					obj.planStartTimeEnd = this.planStartTime[1];
					this.establishmentDto = obj;
				}
			},
			changePlanEndTime() {
				if (this.planEndTime) {
					this.planEndTimeValue = "自定义";
					var obj = JSON.parse(JSON.stringify(this.establishmentDto));
					obj.planEndTimeStart = this.planEndTime[0];
					obj.planEndTimeEnd = this.planEndTime[1];
					this.establishmentDto = obj;
				}
			},
			addressListfn() {
				var str = [];
				for (let x = 0; x < 3; x++) {
					for (let i = 0; i < jsk_data.length; i++) {
						if (jsk_data[i].regionLevel == x + 1 && x + 1 == 1) {
							str.push({
								id: jsk_data[i].id,
								label: jsk_data[i].regionName,
								short: jsk_data[i].short,
								value: jsk_data[i].parentId,
								children: jsk_data[i].id == 900000 ? undefined : [],
							});
						} else if (jsk_data[i].regionLevel == x + 1 && x + 1 == 2 && str) {
							for (let j = 0; j < str.length; j++) {
								if (str[j].id == jsk_data[i].parentId) {
									str[j].children.push({
										id: jsk_data[i].id,
										label: jsk_data[i].regionName,
										short: jsk_data[i].short,
										value: jsk_data[i].parentId,
										children: [],
									});
								}
							}
						} else if (jsk_data[i].regionLevel == x + 1 && x + 1 == 3) {
							for (let j = 0; j < str.length; j++) {
								if (str[j].children) {
									for (let k = 0; k < str[j].children.length; k++) {
										if (str[j].children[k].id == jsk_data[i].parentId) {
											str[j].children[k].children.push({
												id: jsk_data[i].id,
												label: jsk_data[i].regionName,
												short: jsk_data[i].short,
												value: jsk_data[i].parentId,
											});
										}
									}
								}
							}
						}
					}
				}
				this.addressList = str;
			},
			hidePoper() {
				if (this.$refs.datePicker) {
					this.$refs.datePicker.pickerVisible = false;
				}
			},
			mouseenter() {
				this.handleTimeShowPopper = true;
				if (this.handleTimeValue == "自定义") {
					this.$nextTick(() => {
						this.$refs.datePicker.pickerVisible = true;
					});
				}
			},
			hidePoper1() {
				if (this.$refs.datePicker1) {
					this.$refs.datePicker1.pickerVisible = false;
				}
			},
			mouseenter1() {
				this.planStartTimeShowPopper = true;
				if (this.planStartTimeValue == "自定义") {
					this.$nextTick(() => {
						this.$refs.datePicker1.pickerVisible = true;
					});
				}
			},
			hidePoper2() {
				if (this.$refs.datePicker2) {
					this.$refs.datePicker2.pickerVisible = false;
				}
			},
			mouseenter2() {
				this.planEndTimeShowPopper = true;
				if (this.planEndTimeValue == "自定义") {
					this.$nextTick(() => {
						this.$refs.datePicker2.pickerVisible = true;
					});
				}
			},
			fieldCommand(command) {
				this.field = command;
				this.search();
			},
			clearHandleTime() {
				this.handleTime = "";
				this.handleTimeValue = "";
				var obj = JSON.parse(JSON.stringify(this.establishmentDto));
				obj.handleTimeStart = "";
				obj.handleTimeEnd = "";
				this.establishmentDto = obj;
			},
			clearPlanStartTime() {
				this.planStartTime = "";
				this.planStartTimeValue = "";
				var obj = JSON.parse(JSON.stringify(this.establishmentDto));
				obj.planStartTimeStart = "";
				obj.planStartTimeEnd = "";
				this.establishmentDto = obj;
			},
			clearPlanEndTime() {
				this.planEndTime = "";
				this.planEndTimeValue = "";
				var obj = JSON.parse(JSON.stringify(this.establishmentDto));
				obj.planEndTimeStart = "";
				obj.planEndTimeEnd = "";
				this.establishmentDto = obj;
			},
			reset() {
				Object.assign(this.$data, this.$options.data.call(this)); //重置data
				this.init();
				this.$emit("reset");
				this.token = getCookie("tokenNew");
			},
			init() {
				this.search();
				this.addressListfn();
				this.$axios.get('https://files.jiansheku.com/file/json/common/searchDic.json').then(res => {
					if (res && res.status == 200) {
						this.projectTypeOptions = res.data.projectType;
						this.industryOptions = res.data.establishmentIndustry
					}
				}).catch(error => {

				});
				if (this.industryOptions.length == 0) {
					this.$axios
						.post("/nationzj/project/recently/typeList", {
							timeout: "49999",
							headers: {
								"Content-Type": "application/json;charset=UTF-8",
							},
						})
						.then((res) => {
							if (res.data.code == 200) {
								this.industryOptions = res.data.data.establishmentIndustryList;

							}
						})
						.catch((err) => {});
				}

			},
		},
	};
</script>

<style lang="scss" scoped>
	
	.content{
	  padding: 0px 16px;
	  border-radius: 4px 4px 4px 4px;
	   background: #FFFFFF;
	   .content_item{
		   padding-top: 12px;
		   display: flex;
		   align-items: center;
	       .label{
	           width: 84px;
			   font-size: 14px;
			   font-weight: 400;
			   color: rgba(35,35,35,0.8);
	       }
	       .content_right{
	           
	           .ename_input{
	               width: 640px;
	               margin-right: 20px;
	           }
			   .land_ipt_470 {
			   	width: 640px;
			   }
	       }
		   
		 .item_ckquery_list {
			display: flex;
		
		}
		
		 .item_ckquery_list .el-input__icon {
			position: relative;
			top: 1px;
		}
		.ckquery_list_right {
			width: 640px;
		}
		.register_count_ipt{
			margin-left: 0px;
			
		}
		.register_count_ipt .el-input__inner{
			width: 174px;
		}
		::v-deep .el-input-group__prepend{
			padding: 0 8px;
		}
		.content-projecttype{
			display: flex;
			align-items: center;
			justify-content: center;
			.projecttype{
				font-weight: 400;
				color: #232323;
				padding: 1px 5px;
				margin-right: 4px;
				cursor: pointer;
				border-radius: 3px 3px 3px 3px;
				font-size: 14px;
			}
			.projecttype:first-child{
				padding-left: 0px;
			}
			.projecttype:hover{
				background: #F3F4F5;
				padding: 1px 5px;
			}
			.activetype{
				background: #F3F4F5;
				padding: 1px 5px !important;
			}
		}
		
		
	   
	   }
	   .content_item_padding0{
		   padding: 0;
	   }
		
	}
	.bottomlist{
		width: 100%;
		background-color: #FFFFFF;
		
	     border-radius: 4px 4px 4px 4px;
		.bottomlist-title{
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin-top: 12px;
			padding: 16px ;
			border-bottom: 1px solid #EFEFEF;
			 
			.title-right{
				display: flex;
				align-items: center;
				p:first-child{
					font-size: 12px;
					font-weight: 400;
					color: #3D3D3D;
					margin-right: 10px;
				}
				p:last-child{
					display: flex;
					align-items: center;
					font-size: 14px;
					font-weight: 400;
					color: rgba(35,35,35,0.8);
				}
				img{
					width: 18px;
					height: 18px;
				}
			}
			
		}
		.bottomlist-content{
			
			padding-bottom: 0px;
		}
		.bottomlist-list{
			padding: 16px;
			font-size: 14px;
			border-bottom: 1px solid #EFEFEF;
			padding-bottom: 14px;
			.list-titel{
				font-size: 16px;
				font-weight: 700;
				color: #3D3D3D;
				line-height: 19px;
				.list-titel-a{
					text-decoration: none;
					color:#3D3D3D;
				}
				a:hover, a:visited, a:link, a:active{
					color:#3D3D3D;
				}
			}
			.content-label{
				margin-top: 7px;
				.list-label{
					background: #F3F3FF;
					color: #8491E8;
					border-radius: 1px 1px 1px 1px;
				
					padding: 3px 7px;
					font-size: 12px;
					
				}
			}
			
			
			.list-content{
				margin-top: 3px;
				display: flex;
				justify-content: start;
				align-items: center;
				
				.list-content-text{
					margin-top: 7px;
					display: flex;
					justify-content: start;
					align-items: center;
					margin-right: 27px;
					font-size: 14px;
					
					span:first-child{
						font-weight: 400;
						color: rgba(35,35,35,0.4);
						line-height: 15px
					}
					span:last-child{
						font-weight: 400;
						color: rgba(35,35,35,0.8);
						line-height: 15px
					}
					.blue{
						color: #0081FF !important;
						cursor: pointer;
						
					}
					
				}
				
				
			}
			.list-addree{
				width: auto;
				background: #F3F4F5;
				display: inline-flex;
				margin-top: 7px;
				.list-content-text{
					margin-top: 0px;
					span{
						line-height: 30px!important;
					}
				}
				img{
					width: 14px;
					margin: 0  8px;
					
				}
			}
			
			
		}
		.bottomlist-list:hover{
			background: #F6F9FC;
			cursor: pointer;
		}
		.pagination{
			padding: 14px ;
		   .el-pagination{
			   float: right;
		   }
		}
	}
	
	
</style>