atmosphereBz.vue 34.5 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070
<template>
	<div>
		<div style="height:58px;line-height:58px;background:#fff;padding-left:20px;">
			<div style="color:#0006"> <span>品牌策划</span> <span style="padding:0 5px;">></span> <span
					style="color:#000000e6">氛围方案新增</span></div>
		</div>
		<div style="padding:15px 10px 10px 10px;background-color:#fff">
			<el-tabs :before-leave="beforeTabLeave">
				<!-- <el-tab-pane label="方案编辑">
					<div style="border: 1px solid #E5E5E5;padding: 1px" id="bian">
						<div style="padding: 10px 13px;font-size: 14px;border-bottom: 1px solid #E5E5E5;">
							方案编辑器
						</div>
						<div style="padding: 15px;width:100%">
							<wang-editor v-model="ruleForm.solutionEditor" ref="editor"></wang-editor>
						</div>
					</div>
				</el-tab-pane> -->
				<el-tab-pane label="基本信息">
					<div style="border: 1px solid #E5E5E5;padding: 1px" id="jiben">
						<div style="padding: 10px 13px;font-size: 14px;border-bottom: 1px solid #E5E5E5;">
							基本信息
						</div>
						<div style="padding: 15px;">
							<el-form label-position="right" ref="jibenFrom" :model="ruleForm" :rules="rules"
								label-width="150px" style="position: relative">
								<el-row :gutter="20">
									<el-col :span="12">
										<el-form-item label="方案分类" class="grid-content bg-purple device-from"
											prop="classificationCode">
											<el-cascader v-model="ruleForm.classificationCode" :options="fenleiName"
												@change="fenleiChange" :props="{ checkStrictly: true }"
												:show-all-levels="false" clearable style="width: 100%;"></el-cascader>
										</el-form-item>
									</el-col>
									<el-col :span="12">
										<el-form-item label="方案名称" class="grid-content bg-purple device-from"
											prop="planName">
											<el-input v-model="ruleForm.planName" placeholder="请输入" />
										</el-form-item>
									</el-col>
								</el-row>
								<el-row :gutter="20">
									<el-col :span="12">
										<el-form-item label="类型" class="grid-content bg-purple" prop="planType">
											<el-select v-model="ruleForm.planType" placeholder="请选择" disabled
												style="width: 100%">
												<el-option label="氛围策划" value="氛围策划"></el-option>
											</el-select>
										</el-form-item>
									</el-col>

									<el-col :span="12">
										<el-form-item label="氛围地点" class="grid-content bg-purple" prop="eventAddrs">
											<el-input v-model="ruleForm.eventAddrs" placeholder="请输入" />
										</el-form-item>
									</el-col>
								</el-row>

								<el-row :gutter="20">
									<el-col :span="12">
										<el-form-item label="氛围时间" class="grid-content bg-purple" prop="plan_Time"
											style="position: relative">
											<el-date-picker style="width: 100%;" v-model="ruleForm.plan_Time"
												value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange"
												range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
												align="right" @change="dateFormat">
											</el-date-picker>
										</el-form-item>
									</el-col>
									<el-col :span="12">
										<el-form-item label="氛围主题" class="grid-content bg-purple" prop="eventTheme">
											<el-input v-model="ruleForm.eventTheme" placeholder="请输入" />
										</el-form-item>
									</el-col>
								</el-row>

								<el-row :gutter="20">
									<el-col :span="12">
										<el-form-item label="氛围主办方" class="grid-content bg-purple" prop="sponsor">
											<el-input v-model="ruleForm.sponsor" placeholder="请输入" />
										</el-form-item>
									</el-col>
									<el-col :span="12">
										<el-form-item label="氛围参与方" prop="participants" class="grid-content bg-purple">
											<el-input v-model="ruleForm.participants" placeholder="请输入" />
										</el-form-item>
									</el-col>

								</el-row>
								<el-row :gutter="20">
									<el-col :span="12">
										<el-form-item label="范围设置" class="grid-content bg-purple" prop="sponsor">
											<el-select v-model="ruleForm.rangeSetting" placeholder="请选择"
												style="width: 100%">
												<!-- <el-option label="活动绿道段内" value="活动绿道段内"></el-option>
												<el-option label="活动场地内" value="活动场地内"></el-option> -->
												<el-option v-for="(item,index) in rangeSettingList" :key="index" :label="item.label" :value="item.value"></el-option>
											</el-select>
										</el-form-item>
									</el-col>
									<el-col :span="12">
										<el-form-item label="历史氛围方案" class="grid-content bg-purple device-from">
											<el-select v-model="lishiList" placeholder="请选择" style="width:100%"
												@change="lichange">
												<el-option v-for="(item,index) in fenxiData" :key="item.id"
													:label="item.planName" :value="index">
												</el-option>
											</el-select>
										</el-form-item>
									</el-col>
								</el-row>
								<el-row :gutter="20">

									<el-col :span="12">
										<el-form-item label="氛围主要目的" prop="mainPurpose" class="grid-content bg-purple">
											<el-input v-model="ruleForm.mainPurpose" placeholder="请输入" />
										</el-form-item>
									</el-col>
								</el-row>
								<el-row :gutter="20">
									<el-col :span="24">
										<el-form-item label="氛围封面海报" prop="coverPoster" class="grid-content bg-purple">
											<upimg filePath="act" :value="ruleForm.coverPoster" inputtype="coverPoster"
												:limit="1" @changimg="e=>changimg(e,'coverPoster')"></upimg>
										</el-form-item>
									</el-col>
								</el-row>

							</el-form>
						</div>
					</div>
				</el-tab-pane>
				<el-tab-pane label="活动明细">
					<div style="border: 1px solid #E5E5E5;padding: 1px" id="huodong">
						<div style="padding: 10px 13px;font-size: 14px;border-bottom: 1px solid #E5E5E5;display: flex;">
							<div>活动明细</div>
							<div style="color: #2d8a58;margin-left: 10px;" @click="addMing = true">
								添加明细
							</div>
						</div>
						<div style="padding: 15px;">
							<div style="padding: 0px 20px 0px 0px">
								<el-table :data="tableData"
									:header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}"
									style="width: 100%">
									<!-- <el-table-column label="序号" width="auto" min-width="5%" align="center">
										<template slot-scope="scope">
											{{scope.$index + 1}}
										</template>
									</el-table-column> -->
									<el-table-column label="明细项名称" prop="detailLtemName" width="auto" min-width="22%">

									</el-table-column>
									<el-table-column label="预估数量" prop="estimatedQuantity" width="auto" min-width="15%">

									</el-table-column>
									<el-table-column label="预估费用(元)" prop="estimatedCost" width="auto" min-width="15%">
										
									</el-table-column>
									<el-table-column prop="notes" label="备注" width="auto" min-width="15%">
									</el-table-column>
									<el-table-column label="操作" width="auto" min-width="18%">
										<template slot-scope="scope">
											<!-- <div @click="handleEdit(scope.$index, scope.row)" class="tableBtn greens">编辑</div> -->
											<div @click="MingDelete(scope.$index)" class="tableBtn greens">删除</div>
										</template>
									</el-table-column>
								</el-table>
							</div>
						</div>
					</div>
				</el-tab-pane>
				<el-tab-pane label="活动成本">
					<div style="border: 1px solid #E5E5E5;padding: 1px" id="cheng">
						<div style="padding: 10px 13px;font-size: 14px;border-bottom: 1px solid #E5E5E5;display: flex;">
							<div>活动成本</div>
						</div>
						<div style="padding: 15px;">
							<div style="">
								<el-form size="mini" label-position="right" ref="ruleFormInfo" :model="ruleForm"
									label-width="180px" style="position: relative">
									<el-row :gutter="20">
										<el-col :span="12">
											<el-form-item label="内部人力成本预估(元)" class="grid-content bg-purple device-from"
												prop="internalLaborCostEstimation">
												<el-input v-model="ruleForm.internalLaborCostEstimation"
													placeholder="请输入" />
											</el-form-item>
										</el-col>
										<el-col :span="12">
											<el-form-item label="外部人力成本预估(元)" class="grid-content bg-purple"
												prop="externalLaborCostEstimation">
												<el-input v-model="ruleForm.externalLaborCostEstimation"
													placeholder="请输入" />
											</el-form-item>
										</el-col>


									</el-row>

									<el-row :gutter="20">
										<el-col :span="12">
											<el-form-item label="商品成本预估(元)" class="grid-content bg-purple"
												prop="costEstimationGoods">
												<el-input v-model="ruleForm.costEstimationGoods" placeholder="请输入" />
											</el-form-item>
										</el-col>
										<el-col :span="12">
											<el-form-item label="设备成本预估(元)" class="grid-content bg-purple"
												prop="setCostEstimate">
												<el-input v-model="ruleForm.setCostEstimate" placeholder="请输入" />
											</el-form-item>
										</el-col>


									</el-row>
									<el-row :gutter="20">


										<el-col :span="12">
											<el-form-item label="宣传费用预估(元)" class="grid-content bg-purple"
												prop="estimatedPromotionalExpenses">
												<el-input v-model="ruleForm.estimatedPromotionalExpenses"
													placeholder="请输入" />
											</el-form-item>
										</el-col>
										<el-col :span="12">
											<el-form-item label="其他必要成本预估(元)" class="grid-content bg-purple"
												prop="otherNecessaryEstimates">
												<el-input v-model="ruleForm.otherNecessaryEstimates"
													placeholder="请输入" />
											</el-form-item>
										</el-col>
									</el-row>
									<el-row :gutter="20">
										<el-col :span="12">
											<el-form-item label="总成本预估(元)" prop="totalCostEstimation"
												class="grid-content bg-purple">
												<el-input v-model="ruleForm.totalCostEstimation" placeholder="请输入" />
											</el-form-item>
										</el-col>
										<el-col :span="12">
											<el-form-item label="备注" prop="notes" class="grid-content bg-purple">
												<el-input v-model="ruleForm.notes" placeholder="请输入" />
											</el-form-item>
										</el-col>
									</el-row>
								</el-form>
							</div>
						</div>
					</div>
				</el-tab-pane>
				<el-tab-pane label="预估效果信息">
					<div style="border: 1px solid #E5E5E5;padding: 1px" id="yugu">
						<div style="padding: 10px 13px;font-size: 14px;border-bottom: 1px solid #E5E5E5;display: flex;">
							<div>预估效果信息</div>
						</div>
						<div style="padding: 15px;">
							<div>
								<el-form size="mini" label-position="right" ref="ruleFormInfo" :model="ruleForm"
									label-width="150px" style="position: relative">
									<el-row :gutter="20">
										<el-col :span="12">
											<el-form-item label="预计吸引流量" class="grid-content bg-purple device-from"
												prop="expectedAttractTraffic">
												<el-input v-model="ruleForm.expectedAttractTraffic" placeholder="请输入" />
											</el-form-item>
										</el-col>
										<el-col :span="12">
											<el-form-item label="预计参与人数" class="grid-content bg-purple"
												prop="expectedParticipation">
												<el-input v-model="ruleForm.expectedParticipation" placeholder="请输入" />
											</el-form-item>
										</el-col>


									</el-row>
									<el-row :gutter="20">
										<el-col :span="12">
											<el-form-item label="预计直接收益(元)" class="grid-content bg-purple"
												prop="expectedDirectBenefits">
												<el-input v-model="ruleForm.expectedDirectBenefits" placeholder="请输入" />
											</el-form-item>
										</el-col>
										<el-col :span="12">
											<el-form-item label="预计间接收益(元)" class="grid-content bg-purple"
												prop="expectedIndirectBenefits">
												<el-input v-model="ruleForm.expectedIndirectBenefits"
													placeholder="请输入" />
											</el-form-item>
										</el-col>

									</el-row>
								</el-form>
							</div>
						</div>
					</div>
				</el-tab-pane>
				<el-tab-pane label="相关附件">
					<div style="border: 1px solid #E5E5E5;padding: 1px" id="fu">
						<div style="padding: 10px 13px;font-size: 14px;border-bottom: 1px solid #E5E5E5;display: flex;">
							<div style="line-height:38px;">相关附件</div>
							<div>
								<upfile filePath="act" inputtype="otherImageVideos" :limit="10" :islist="false"
									:accept="'.docx'" :value="ruleForm.otherImageVideos"
									@changimg="e=>changimg(e,'otherImageVideos')"></upfile>
							</div>
						</div>
						<div style="padding: 15px;">
							<div style="padding: 0px 20px 0px 0px">
								<el-table :data="dataList"
									:header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}"
									style="width: 100%">
									<!-- <el-table-column label="序号" width="auto" min-width="7%" align="center">
										<template slot-scope="scope">
											{{scope.$index + 1}}
										</template>
									</el-table-column> -->
									<el-table-column label="附件名称" prop="name" width="auto" min-width="75%">
										<template slot-scope="scope">
											{{scope.row.name}}
										</template>
									</el-table-column>
									<el-table-column label="操作" width="auto" min-width="18%">
										<template slot-scope="scope">
											<div @click="fileDelete(scope.$index)" class="tableBtn greens">删除</div>
										</template>
									</el-table-column>
								</el-table>
							</div>
						</div>
					</div>
				</el-tab-pane>
			</el-tabs>
			<div style="display: flex;justify-content: flex-end;padding: 10px 20px 10px 0">
				<el-button plain @click="close" size="mini" style="background-color: #3F9B6A;color: #fff;">取消
				</el-button>
				<el-button @click="onSubmit(1)" style="background-color: #3F9B6A;color: #fff;">暂存
				</el-button>
				<el-button plain @click="onSubmit(0)" size="mini" style="background-color: #3F9B6A;color: #fff;">保存
				</el-button>
			</div>
		</div>




		<el-dialog title="新增明细" :visible.sync="addMing" custom-class='XDD_css' style="padding: 0;" width="50%"
			append-to-body center :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false">
			<div style="padding: 15px;width:100%">
				<div style="">
					<div style="padding: 15px;">
						<el-form size="mini" label-position="right" ref="ruleFormInfo" :model="mingFrom"
							label-width="150px" style="position: relative">
							<el-form-item label="明细项名称" class="grid-content bg-purple device-from" prop="planName">
								<el-input v-model="mingFrom.detailLtemName" placeholder="请输入" />
							</el-form-item>
							<el-form-item label="预估数量" class="grid-content bg-purple" prop=" planType">
								<el-input v-model="mingFrom.estimatedQuantity" placeholder="请输入" />
							</el-form-item>

							<el-form-item label="预估费用(元)" class="grid-content bg-purple" prop="eventAddrs">
								<el-input v-model="mingFrom.estimatedCost" placeholder="请输入" />
							</el-form-item>
							<el-form-item label="备注" class="grid-content bg-purple device-from" prop="planName">
								<el-input v-model="mingFrom.notes" placeholder="请输入" />
							</el-form-item>
						</el-form>
					</div>
				</div>

			</div>
			<div style="display: flex;justify-content: flex-end;padding: 10px 20px 10px 0">
				<el-button plain @click="addMing=false" size="mini" style="background-color: #3F9B6A;color: #fff;">取消
				</el-button>
				<el-button plain @click="minSev" size="mini" style="background-color: #3F9B6A;color: #fff;">确定
				</el-button>
				
				

			</div>
		</el-dialog>
	</div>
</template>

<script>
	import {
		add,
		edit,
		deleteById,
		MingAdd,
		mingTable,
		Mingdan,
		MingEdit,
		MingDel,
		fujiaAdd,
		lishiDeta,
		queryByPage
	} from '../../api/activityBz'
	import wangEditor from "@/components/editor/index";
	import upimg from "@/components/ImageUpload/index"
	import {
		uploadUrl
	} from '@/utils/request'
	import html2canvas from 'html2canvas'
	import jsPDF from 'jspdf'
	import upfile from "@/components/fujianUpload/fujianList"
	export default {
		props: {
			showAdd: {
				type: Boolean,
				default: false
			},
			fenleiName: {
				type: Array,
				default: function() {
					return []; // 返回一个空数组作为默认值
				},
			}
		},
		components: {
			wangEditor,
			upimg,
			upfile
		},
		data() {
			return {
				uploadFileUrl: uploadUrl, // 请求地址
				editTrue: false,
				addMing: false,
				ruleForm: {
					classificationCode: '',
					plan_Time: '',
					planName: '', //方案名称
					planType: '氛围策划', //类型
					eventAddrs: '', //活动地点
					eventStartTime: 0, //活动开始时间
					eventEndTime: 0, //活动结束时间
					eventTheme: '', //活动主题
					sponsor: '', //活动主办方
					participants: '', //活动参与方
					rangeSetting: '',
					mainPurpose: '', //活动主要目的
					coverPoster: '', //封面海报
					internalLaborCostEstimation: '', //内部人工成本预估
					externalLaborCostEstimation: '', //外部人工成本预估
					costEstimationGoods: '', //商品成本预估
					setCostEstimate: '', //设置成本预估
					estimatedPromotionalExpenses: '', //宣传费用预估
					otherNecessaryEstimates: '', //其他成本预估
					totalCostEstimation: '', //总成本预估
					notes: '', //备注
					expectedAttractTraffic: '', //预计吸引流量
					expectedParticipation: '', //预计参与人数
					expectedDirectBenefits: '', //预计直接收益
					expectedIndirectBenefits: '', //预计间接收益
					createDate: '',
					solutionEditor: null,
				},
				rules: {
					classificationCode: [{
						required: true,
						message: '请选择方案分类',
						trigger: 'change'
					}],
					planName: [{
						required: true,
						message: '请输入方案名称',
						trigger: 'blur'
					}],
					planType: [{
						required: true,
						message: '请选择方案类型',
						trigger: 'change'
					}],
					eventAddrs: [{
						required: true,
						message: '请输入活动地点',
						trigger: 'blur'
					}],
					plan_Time: [{
						required: true,
						message: '请选择活动时间',
						trigger: 'change'
					}],
					eventTheme: [{
						required: true,
						message: '请输入活动主题',
						trigger: 'blur'
					}],
					sponsor: [{
						required: true,
						message: '请输入活动主办方',
						trigger: 'blur'
					}],
				},
				tableData: [],
				fileData: [],
				dataList: [],
				mingFrom: {
					detailLtemName: '',
					estimatedQuantity: '',
					estimatedCost: '',
					notes: ''
				},
				currentTime: '',
				ActiveName: 0,
				tuxiangData: {
					bian: null,
					jiben: null,
					huodong: null,
					cheng: null,
					yugu: null,
					fun: null
				},
				fenxiData: [],
				lishiList: '',
			}
		},
		mounted() {

			this.lishi()
		},
		computed: {
            rangeSettingList() {
				return this.$store.state.cent.rangeSettingList;
			},
		},  
		methods: {
			changimg(e, type) {
				this.ruleForm[type] = e

				if (type == 'otherImageVideos') {
					const parts = e.split('/');
					const filename = parts[parts.length - 1];
					let file = {
						url: e,
						name: filename
					}
					this.dataList.push(file)
				}
			},
			//获取当前时间
			updateCurrentTime() {
				const now = new Date();
				const year = now.getFullYear();
				const month = (now.getMonth() + 1).toString().padStart(2, '0');
				const day = now.getDate().toString().padStart(2, '0');
				const hours = now.getHours().toString().padStart(2, '0');
				const minutes = now.getMinutes().toString().padStart(2, '0');
				const seconds = now.getSeconds().toString().padStart(2, '0');

				this.currentTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
			},
			lishi() {
			queryByPage({
				pageNumber: 1,
				pageSize: 10,
				dataOwnership: '2',
				isDraft: 0,
				state:'5'
				
			}).then(res => {
				this.fenxiData = res.data.content
			})
			
			},
			lichange(e) {
	let msg = this.fenxiData[e]
				
				// let obj = msg.originalData
				this.ruleForm={
					// classificationCode: msg.classificationCode,
					plan_Time: [msg.eventStartTime,msg.eventEndTime],
					planName: msg.planName, //方案名称
					planType: '活动策划', //类型
					eventAddrs: msg.eventAddrs, //活动地点
					eventStartTime:  msg.eventStartTime, //活动开始时间
					eventEndTime:  msg.eventEndTime, //活动结束时间
					eventTheme:msg.eventTheme, //活动主题
					sponsor: msg.sponsor, //活动主办方
					participants: msg.participants, //活动参与方
					rangeSetting: msg.rangeSetting,
					mainPurpose: msg.mainPurpose, //活动主要目的
					coverPoster: msg.coverPoster, //封面海报
					internalLaborCostEstimation:  msg.internalLaborCostEstimation, //内部人工成本预估
					externalLaborCostEstimation: msg.externalLaborCostEstimation, //外部人工成本预估
					costEstimationGoods: msg.costEstimationGoods, //商品成本预估
					setCostEstimate: msg.setCostEstimate, //设置成本预估
					estimatedPromotionalExpenses: msg.estimatedPromotionalExpenses, //宣传费用预估
					otherNecessaryEstimates:msg.otherNecessaryEstimates, //其他成本预估
					totalCostEstimation: msg.totalCostEstimation, //总成本预估
					notes:  msg.notes, //备注
					expectedAttractTraffic: msg.expectedAttractTraffic, //预计吸引流量
					expectedParticipation: msg.expectedParticipation, //预计参与人数
					expectedDirectBenefits: msg.expectedDirectBenefits, //预计直接收益
					expectedIndirectBenefits: msg.expectedIndirectBenefits, //预计间接收益
				}
				// let msg = this.fenxiData[e]
				// let obj = JSON.parse(msg.originalData)

				// for (let key in obj) {
				// 	if (this.ruleForm.hasOwnProperty(key)) {
				// 		this.ruleForm[key] = obj[key];
				// 	}
				// }
			},
			// 切换事件
			beforeTabLeave(activeName, oldActiveName) {

				//  let bian= document.getElementById('bian')
				//  let jiben= document.getElementById('jiben')
				//  let huodong= document.getElementById('huodong')
				//  let cheng= document.getElementById('cheng')
				//   let yugu= document.getElementById('yugu')
				//  let fu= document.getElementById('fu')
				//  this.ActiveName = activeName
				//    if(oldActiveName==0){
				//       html2canvas(bian).then(canvas => {
				//         // 将canvas转换为图片
				//         const imgData = canvas.toDataURL('image/png');
				//         this.tuxiangData.bian = imgData
				//       })

				//    }else if(oldActiveName==1){
				//         html2canvas(jiben).then(canvas => {
				//           // 将canvas转换为图片
				//           const imgData = canvas.toDataURL('image/png');
				//           this.tuxiangData.jiben = imgData
				//         })
				//    }else if(oldActiveName==2){
				//         html2canvas(huodong).then(canvas => {
				//           // 将canvas转换为图片
				//           const imgData = canvas.toDataURL('image/png');
				//           this.tuxiangData.huodong = imgData
				//         })
				//    }else if(oldActiveName==3){
				// html2canvas(cheng).then(canvas => {
				//   // 将canvas转换为图片
				//   const imgData = canvas.toDataURL('image/png');
				//   this.tuxiangData.cheng = imgData
				// })
				//  }else if(oldActiveName==4){
				//    html2canvas(yugu).then(canvas => {
				//      // 将canvas转换为图片
				//      const imgData = canvas.toDataURL('image/png');
				//      this.tuxiangData.yugu = imgData
				//    })
				//  }else if(oldActiveName==5){
				//    html2canvas(fu).then(canvas => {
				//      // 将canvas转换为图片
				//      const imgData = canvas.toDataURL('image/png');
				//      this.tuxiangData.fu = imgData
				//    })
				//  }
			},
			//保存
			onSubmit(val) {
				this.updateCurrentTime();
				let that = this
				let FlieName = this.ruleForm.planName
				this.ruleForm.createDate = this.currentTime
				this.ruleForm.createUser = localStorage.getItem('roleName')
				this.ruleForm.dataOwnership = '2'
				// this.$nextTick(() => {
				//   var bian = document.getElementById('bian')
				//   var jiben = document.getElementById('jiben')
				//   var huodong = document.getElementById('huodong')
				//   var cheng = document.getElementById('cheng')
				//   var yugu = document.getElementById('yugu')
				//   var fu = document.getElementById('fu')


				// })
				// if (that.ActiveName == 0) {
				//   html2canvas(bian).then(canvas => {
				//     // 将canvas转换为图片
				//     const imgData = canvas.toDataURL('image/png');
				//     that.tuxiangData.bian = imgData
				//   })
				// } else if (that.ActiveName == 1) {
				//   html2canvas(jiben).then(canvas => {
				//     // 将canvas转换为图片
				//     const imgData = canvas.toDataURL('image/png');
				//     that.tuxiangData.jiben = imgData
				//   })
				// } else if (that.ActiveName == 2) {
				//   html2canvas(huodong).then(canvas => {
				//     // 将canvas转换为图片
				//     const imgData = canvas.toDataURL('image/png');
				//     that.tuxiangData.huodong = imgData
				//   })
				// } else if (that.ActiveName == 3) {
				//   html2canvas(cheng).then(canvas => {
				//     // 将canvas转换为图片
				//     const imgData = canvas.toDataURL('image/png');
				//     that.tuxiangData.cheng = imgData
				//   })
				// } else if (that.ActiveName == 4) {
				//   html2canvas(yugu).then(canvas => {
				//     // 将canvas转换为图片
				//     const imgData = canvas.toDataURL('image/png');
				//     that.tuxiangData.yugu = imgData
				//   })
				// } else if (that.ActiveName == 5) {
				//   html2canvas(fu).then(canvas => {
				//     // 将canvas转换为图片
				//     const imgData = canvas.toDataURL('image/png');
				//     that.tuxiangData.fu = imgData
				//   })
				// }
				this.$refs.jibenFrom.validate((valid) => {
					if (valid) {
						this.ruleForm.isDraft = val
						add(this.ruleForm).then(res => {
							this.$message({
								message: '保存成功',
								type: 'success'
							});
							console.log(this.tableData,'111111111111111111')
							for (let i = 0; i < this.tableData.length; i++) {
								this.tableData[i].detailsId = res.data.id
								MingAdd(this.tableData[i]).then(res => {
									
								})
							}
							console.log(this.dataList,'22222222222222222222')
							for (let i = 0; i < this.dataList.length; i++) {
							let fuji = {
								detailsId: res.data.id,
								attachmentName: this.dataList[i].name,
								attachmentUrl: this.dataList[i].url,
							}
							fujiaAdd(fuji).then(res => {
								console.log('成功')
							})
							}

							// const pdf = new jsPDF('p', 'mm', 'a4');
							// Object.keys(that.tuxiangData).forEach((key, index) => {
							//   // console.log(this.tuxiangData[key])
							//   if (that.tuxiangData[key] != null) {
							//     pdf.addImage(that.tuxiangData[key], 'PNG', 5, 10 + index * 80, 200, 60); // 调整位置和尺寸以适应你的需求
							//   }

							// });
							// const pdfData = pdf.output('arraybuffer');
							// const blob = new Blob([pdfData], {
							//   type: `${FlieName}.pdf`
							// });
							// const url = URL.createObjectURL(blob);
							// pdf.save(`${FlieName}.pdf`)
							// // 创建FormData
							// const formData = new FormData();
							// formData.append('file', blob, `'${FlieName}.pdf'`);
							// // 使用fetch上传文件
							// fetch(uploadUrl, {
							//     method: 'POST',
							//     body: formData,
							//   })
							//   .then(response => response.json())
							//   .then(data => console.log(data))
							//   .catch(error => console.log(error));
							this.$emit('childClose', false);
							this.$refs.editor.html = '<p><br></p>'
							this.ruleForm = {
								classificationCode: '',
								plan_Time: '',
								planName: '', //方案名称
								planType: '氛围策划', //类型
								eventAddrs: '', //活动地点
								eventStartTime: 0, //活动开始时间
								eventEndTime: 0, //活动结束时间
								eventTheme: '', //活动主题
								sponsor: '', //活动主办方
								participants: '', //活动参与方
								mainPurpose: '', //活动主要目的
								coverPoster: '', //封面海报
								internalLaborCostEstimation: '', //内部人工成本预估
								externalLaborCostEstimation: '', //外部人工成本预估
								costEstimationGoods: '', //商品成本预估
								setCostEstimate: '', //设置成本预估
								estimatedPromotionalExpenses: '', //宣传费用预估
								otherNecessaryEstimates: '', //其他成本预估
								totalCostEstimation: '', //总成本预估
								notes: '', //备注
								expectedAttractTraffic: '', //预计吸引流量
								expectedParticipation: '', //预计参与人数
								expectedDirectBenefits: '', //预计直接收益
								expectedIndirectBenefits: '', //预计间接收益
								createDate: '', //创建时间
								solutionEditor: null,
							}
						})
						
					} else {
						this.$message({
							message: '请填写数据',
							type: 'error',
							offset: 100
						})
						return false;
					}
				})


			},
			//附件上传成功
			handleUploadSuccess(response, file, fileList) {
				this.dataList.push(file)
			},
			fileDelete(val) {
				const h = this.$createElement;
				this.$msgbox({
					title: '消息',
					message: h('p', null, [
						h('span', null, '是否删除 '),
					]),
					showCancelButton: true,
					showClose: false,
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					customClass: 'oe-dialog-btn',
					beforeClose: (action, instance, done) => {
						if (action === 'confirm') {
							this.dataList.splice(val, 1)
							done()
						} else {
							done();
						}
					}
				})




			},
			close() {
				this.tuxiangData = {
					bian: null,
					jiben: null,
					huodong: null,
					cheng: null,
					yugu: null,
					fun: null
				}
				this.$emit('childClose', false);
				this.$refs.editor.html = '<p><br></p>'
				this.ruleForm = {
					classificationCode: '',
					plan_Time: '',
					planName: '', //方案名称
					planType: '氛围策划', //类型
					eventAddrs: '', //活动地点
					eventStartTime: 0, //活动开始时间
					eventEndTime: 0, //活动结束时间
					eventTheme: '', //活动主题
					sponsor: '', //活动主办方
					participants: '', //活动参与方
					rangeSetting: '',
					mainPurpose: '', //活动主要目的
					coverPoster: '', //封面海报
					internalLaborCostEstimation: '', //内部人工成本预估
					externalLaborCostEstimation: '', //外部人工成本预估
					costEstimationGoods: '', //商品成本预估
					setCostEstimate: '', //设置成本预估
					estimatedPromotionalExpenses: '', //宣传费用预估
					otherNecessaryEstimates: '', //其他成本预估
					totalCostEstimation: '', //总成本预估
					notes: '', //备注
					expectedAttractTraffic: '', //预计吸引流量
					expectedParticipation: '', //预计参与人数
					expectedDirectBenefits: '', //预计直接收益
					expectedIndirectBenefits: '', //预计间接收益
					createDate: '', //创建时间
					solutionEditor: null,
				}

			},
			dateFormat() {
				this.ruleForm.eventStartTime = this.ruleForm.plan_Time[0]
				this.ruleForm.eventEndTime = this.ruleForm.plan_Time[1]

			},
			minSev() {
				this.tableData.push(this.mingFrom)
				this.mingFrom = {
					detailLtemName: '',
					estimatedQuantity: '',
					estimatedCost: '',
					notes: ''
				}
				this.addMing = false
			},
			MingDelete(item) {

				const h = this.$createElement;
				this.$msgbox({
					title: '消息',
					message: h('p', null, [
						h('span', null, '是否删除 '),
					]),
					showCancelButton: true,
					showClose: false,
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					customClass: 'oe-dialog-btn',
					beforeClose: (action, instance, done) => {
						if (action === 'confirm') {
							this.tableData.splice(item, 1);
							done();
						} else {
							done();
						}
					}
				})




			},
			fenleiChange(value) {
				this.ruleForm.classificationCode = value[value.length - 1]
			}
		}
	}
</script>

<style scoped>
	.zhuti {
		background-color: #Fff;
		min-height: calc(100vh - 50px - 20px);
	}

	/deep/ .avatar-uploader .el-upload {
		border: 1px dashed #d9d9d9;
		border-radius: 6px;
		cursor: pointer;
		position: relative;
		overflow: hidden;
	}

	.avatar-uploader .el-upload:hover {
		border-color: #409EFF;
	}

	.avatar-uploader-icon {
		font-size: 28px;
		color: #8c939d;
		width: 108px;
		height: 108px;
		line-height: 108px;
		/*text-align: center;*/
	}

	.avatar {
		width: 108px;
		height: 108px;
		display: block;
	}

	::v-deep .el-input__inner {
		height: 32px;
		line-height: 32px;
	}

	::v-deep .el-input__inner:focus {
		border: #3F9B6A 1px solid;
	}

	::v-deep .el-input__inner:hover {
		border: #3F9B6A 1px solid;
	}

	::v-deep .el-select .el-input.is-focus .el-input__inner {
		border-color: #3F9B6A
	}

	::v-deep .el-form-item__label {
		font-weight: 100;
		font-size: 14px;
		color: #000000e6;
	}

	.greens {
		color: #3F9B6A;
	}

	.tableBtn {
		display: inline-block;
		margin-right: 10px;
	}
</style>
<style lang="scss" scoped>
	::v-deep .dialog_css {
		margin-top: 11vh;
		margin-left: 13%;

		.el-dialog__body {
			padding: 0px;
			background-color: #fff;
		}

		.el-dialog__header {
			background-color: #fff;
			padding: 10px 20px 10px 20px;
			border-bottom: 1px solid #EFEFEF;
		}

		.el-dialog__title {
			font-size: 14px;
			color: #000;
		}
	}

	::v-deep .el-tabs--border-card {
		border: none;
		-webkit-box-shadow: none;
		box-shadow: none;

		.el-tabs__content {
			border: 1px solid #E4E7ED;
			padding: 0;
		}

		.el-tabs__header {
			background-color: #fff;
			border-bottom: none;
		}

		.el-tabs__content {
			border: none;
		}

		.el-tabs__header .el-tabs__item {
			border: none;
			margin-right: 10px;
			background-color: #F2F2F2;
			font-size: 14px;
			border-top-left-radius: 8px;
			border-top-right-radius: 8px;
			padding: 0 15px;
		}

		.el-tabs__header .el-tabs__item.is-active {
			color: #fff;
			background-color: #3F9B6A;
		}

		.el-tabs__header .el-tabs__item:not(.is-disabled):hover {
			color: #3F9B6A;
		}
	}

	::v-deep .el-date-table td.end-date span,
	.el-date-table td.start-date span {
		background-color: #3F9B6A;
	}

	::v-deep .el-date-table td.available:hover {
		color: #3F9B6A;
	}

	::v-deep .el-button.is-plain:focus,
	.el-button.is-plain:hover {
		border-color: fff;
		color: #3F9B6A;
	}
</style>