<template>
	<view class="appWrapper">
		<form action="">
			<view style="height:30rpx"></view>
			<view class="form-item">
				<view class="title">
					<text class="necessary">*</text>
					户号:
				</view>
				<input name="input" v-model="formMess.account_number" maxlength="20" :disabled="isdisabledFn"></input>
			</view>
			<view class="form-item">
				<view class="title"><text class="necessary">*</text>流变变比:</view>
				<input name="input" v-model="formMess.rheological_change" maxlength="20"></input>
			</view>
			<view class="form-item">
				<view class="title" style="width:240rpx"><text class="necessary">*</text>单路电源容量:</view>
				<input name="input" v-model="formMess.power_capacity" maxlength="20"></input>
			</view>
			<view class="form-item">
				<view class="title"><text class="necessary">*</text>线路:</view>
				<select name="" id="" filterable clearable v-model="formMess.route_id">
					<option value="0">请选择</option>
					<option :value=item.id v-for="item in routeListData" :title="item.route_name">{{ item.route_name}}
					</option>
				</select>
			</view>
			<view class="form-item">
				<view class="title"><text class="necessary">*</text>站点名称:</view>
				<select name="" id="" v-model="formMess.site_id" filterable clearable :disabled="isdisabledFn">
					<option value="0">请选择</option>
					<option :value="item.id" v-for="item in siteListData">{{ item.site_name}}</option>
				</select>
			</view>
			<view class="form-item margin-bottom-xs">
				<view class="title"><text class="necessary">*</text>监察:</view>
				<select name="" id="" filterable clearable v-model="formMess.supervision_department_id">
					<option value="0">请选择</option>
					<option :value=item.id v-for="item in supervisionListData">{{ item.supervision_name}}</option>
				</select>
			</view>
			<view class="info-tit margin-left-xs">
				<text class="cuIcon-titles margin-right-xs"></text>
				电试
			</view>
			<view class="form-item extraDis">
				<view class="title"><text class="necessary">*</text>电试报告时间:</view>
				<input name="input" v-model="formMess.electric_test_overdue" maxlength="20"></input>
			</view>
			<view class="info-tit margin-left-xs">
				<text class="cuIcon-titles "></text>
				四防一通
			</view>
			<view class="form-item extraDis radioSec">
				<view class="title">
					<text class="necessary">*</text>电缆孔洞:
				</view>
				<view class="radioCameraflex">
					<evan-radio v-model="formMess.cable_hole" label="1" class="margin-right-xl">是</evan-radio>
					<evan-radio v-model="formMess.cable_hole" label="0" class="margin-right-xl">否</evan-radio>
					<evan-radio v-model="formMess.cable_hole" label="2" class="margin-right-xs">其他</evan-radio>
					<input type="text" v-if="this.formMess.cable_hole!=2" disabled="disabled"
						v-model="formMess.cable_hole_describe">
					<input type="text" v-else v-model="formMess.cable_hole_describe">
					<image mode="aspectFit"
						:src="this.formMess.cable_hole_picture?this.formMess.cable_hole_picture:'/static/cameraIcon.png'"
						@tap="goCamera('cable_hole_image','cable_hole_picture')"></image>
				</view>
			</view>
			<view class="form-item extraDis radioSec">
				<view class="title"><text class="necessary">*</text>门窗、墙壁破损:</view>
				<view class="radioCameraflex">
					<evan-radio v-model="formMess.damage" label="1" class="margin-right-xl">是</evan-radio>
					<evan-radio v-model="formMess.damage" label="0" class="margin-right-xl">否</evan-radio>
					<evan-radio v-model="formMess.damage" label="2" class="margin-right-xs">其他</evan-radio>
					<input v-if="this.formMess.damage!=2" disabled="disabled" type="text"
						v-model="formMess.damage_describe">
					<input v-else type="text" v-model="formMess.damage_describe">
					<image mode="aspectFit"
						:src="this.formMess.damage_picture?this.formMess.damage_picture:'/static/cameraIcon.png'"
						@tap="goCamera('damage_image','damage_picture')"></image>
				</view>
			</view>
			<view class="form-item extraDis radioSec">
				<view class="title"><text class="necessary">*</text>屋顶墙壁渗漏水:</view>
				<view class="radioCameraflex">
					<evan-radio v-model="formMess.water_leakage" label="1" class="margin-right-xl">是</evan-radio>
					<evan-radio v-model="formMess.water_leakage" label="0" class="margin-right-xl">否</evan-radio>
					<evan-radio v-model="formMess.water_leakage" label="2" class="margin-right-xs">其他</evan-radio>
					<input v-if="this.formMess.water_leakage!=2" disabled="disabled" type="text"
						v-model="formMess.water_leakage_describe">
					<input v-else type="text" v-model="formMess.water_leakage_describe">
					<image mode="aspectFit"
						:src="this.formMess.water_leakage_picture?this.formMess.water_leakage_picture:'/static/cameraIcon.png'"
						@tap="goCamera('water_leakage_image','water_leakage_picture')"></image>
				</view>
			</view>
			<view class="form-item extraDis radioSec">
				<view class="title"><text class="necessary">*</text>灭火器配置不足:</view>
				<view class="radioCameraflex">
					<evan-radio v-model="formMess.annihilator_insufficient_configuration" label="1"
						class="margin-right-xl">是</evan-radio>
					<evan-radio v-model="formMess.annihilator_insufficient_configuration" label="0"
						class="margin-right-xl">否</evan-radio>
					<evan-radio v-model="formMess.annihilator_insufficient_configuration" label="2"
						class="margin-right-xs">其他</evan-radio>
					<input v-if="this.formMess.annihilator_insufficient_configuration!=2" disabled="disabled"
						type="text" v-model="formMess.annihilator_insufficient_configuration_describe">
					<input v-else type="text" v-model="formMess.annihilator_insufficient_configuration_describe">
					<image mode="aspectFit"
						:src="this.formMess.annihilator_insufficient_configuration_picture?this.formMess.annihilator_insufficient_configuration_picture:'/static/cameraIcon.png'"
						@tap="goCamera('annihilator_insufficient_configuration_image','annihilator_insufficient_configuration_picture')">
					</image>
				</view>
			</view>
			<view class="form-item extraDis radioSec">
				<view class="title"><text class="necessary">*</text>灭火器超期:</view>
				<view class="radioCameraflex">
					<evan-radio v-model="formMess.annihilator_overdue" label="1" class="margin-right-xl">是</evan-radio>
					<evan-radio v-model="formMess.annihilator_overdue" label="0" class="margin-right-xl">否</evan-radio>
					<evan-radio v-model="formMess.annihilator_overdue" label="2" class="margin-right-xs">其他</evan-radio>
					<input v-if="this.formMess.annihilator_overdue!=2" disabled="disabled" type="text"
						v-model="formMess.annihilator_overdue_describe">
					<input v-else type="text" v-model="formMess.annihilator_overdue_describe">
					<image mode="aspectFit"
						:src="this.formMess.annihilator_overdue_picture?this.formMess.annihilator_overdue_picture:'/static/cameraIcon.png'"
						@tap="goCamera('annihilator_overdue_image','annihilator_overdue_picture')"></image>
				</view>
			</view>
			<view class="info-tit margin-left-xs">
				<text class="cuIcon-titles margin-right-xs"></text>
				室内环境
			</view>
			<view class="form-item extraDis radioSec">
				<view class="title"><text class="necessary">*</text>堆放杂物:</view>
				<view class="radioCameraflex">
					<evan-radio v-model="formMess.pile_up_sundries" label="1" class="margin-right-xl">是</evan-radio>
					<evan-radio v-model="formMess.pile_up_sundries" label="0" class="margin-right-xl">否</evan-radio>
					<evan-radio v-model="formMess.pile_up_sundries" label="2" class="margin-right-xs">其他</evan-radio>
					<input v-if="this.formMess.pile_up_sundries!=2" disabled="disabled" type="text"
						v-model="formMess.pile_up_sundries_describe">
					<input v-else type="text" v-model="formMess.pile_up_sundries_describe">
					<image mode="aspectFit"
						:src="this.formMess.pile_up_sundries_picture?this.formMess.pile_up_sundries_picture:'/static/cameraIcon.png'"
						@tap="goCamera('pile_up_sundries_image','pile_up_sundries_picture')"></image>
				</view>
			</view>
			<view class="form-item extraDis radioSec">
				<view class="title"><text class="necessary">*</text>积灰严重:</view>
				<view class="radioCameraflex">
					<evan-radio v-model="formMess.serious_ash_deposition" label="1" class="margin-right-xl">是
					</evan-radio>
					<evan-radio v-model="formMess.serious_ash_deposition" label="0" class="margin-right-xl">否
					</evan-radio>
					<evan-radio v-model="formMess.serious_ash_deposition" label="2" class="margin-right-xs">其他
					</evan-radio>
					<input v-if="this.formMess.serious_ash_deposition!=2" disabled="disabled" type="text"
						v-model="formMess.serious_ash_deposition_describe">
					<input v-else type="text" v-model="formMess.serious_ash_deposition_describe">
					<image mode="aspectFit"
						:src="this.formMess.serious_ash_deposition_picture?this.formMess.serious_ash_deposition_picture:'/static/cameraIcon.png'"
						@tap="goCamera('serious_ash_deposition_image','serious_ash_deposition_picture')"></image>
				</view>
			</view>
			<view class="form-item extraDis radioSec">
				<view class="title"><text class="necessary">*</text>配电房周围环境潮湿:</view>
				<view class="radioCameraflex">
					<evan-radio v-model="formMess.around_environment_humid" label="1" class="margin-right-xl">是
					</evan-radio>
					<evan-radio v-model="formMess.around_environment_humid" label="0" class="margin-right-xl">否
					</evan-radio>
					<evan-radio v-model="formMess.around_environment_humid" label="2" class="margin-right-xs">其他
					</evan-radio>
					<input v-if="this.formMess.around_environment_humid!=2" disabled="disabled" type="text"
						v-model="formMess.around_environment_humid_describe">
					<input v-else type="text" v-model="formMess.around_environment_humid_describe">
					<image mode="aspectFit"
						:src="this.formMess.around_environment_humid_picture?this.formMess.around_environment_humid_picture:'/static/cameraIcon.png'"
						@tap="goCamera('around_environment_humid_image','around_environment_humid_picture')"></image>
				</view>
			</view>
			<view class="form-item extraDis radioSec">
				<view class="title"><text class="necessary">*</text>配电房周围对方杂物:</view>
				<view class="radioCameraflex">
					<evan-radio v-model="formMess.around_pile_up_sundries" label="1" class="margin-right-xl">是
					</evan-radio>
					<evan-radio v-model="formMess.around_pile_up_sundries" label="0" class="margin-right-xl">否
					</evan-radio>
					<evan-radio v-model="formMess.around_pile_up_sundries" label="2" class="margin-right-xs">其他
					</evan-radio>
					<input v-if="this.formMess.around_pile_up_sundries!=2" disabled="disabled" type="text"
						v-model="formMess.around_pile_up_sundries_describe">
					<input v-else type="text" v-model="formMess.around_pile_up_sundries_describe">
					<image mode="aspectFit"
						:src="this.formMess.around_pile_up_sundries_picture?this.formMess.around_pile_up_sundries_picture:'/static/cameraIcon.png'"
						@tap="goCamera('around_pile_up_sundries_image','around_pile_up_sundries_picture')"></image>
				</view>
			</view>
			<view class="info-tit margin-left-xs">
				<text class="cuIcon-titles margin-right-xs"></text>
				电工
			</view>
			<view class="form-item extraDis radioSec">
				<view class="title"><text class="necessary">*</text>无电工:</view>
				<view class="radioCameraflex">
					<evan-radio v-model="formMess.no_electrician" label="1" class="margin-right-xl">是</evan-radio>
					<evan-radio v-model="formMess.no_electrician" label="0" class="margin-right-xl">否</evan-radio>
					<evan-radio v-model="formMess.no_electrician" label="2" class="margin-right-xs">其他</evan-radio>
					<input v-if="this.formMess.no_electrician!=2" disabled="disabled" type="text"
						v-model="formMess.no_electrician_describe">
					<input v-else type="text" v-model="formMess.no_electrician_describe">
					<image mode="aspectFit"
						:src="this.formMess.no_electrician_picture?this.formMess.no_electrician_picture:'/static/cameraIcon.png'"
						@tap="goCamera('no_electrician_image','no_electrician_picture')"></image>
				</view>
			</view>
			<view class="form-item extraDis radioSec">
				<view class="title"><text class="necessary">*</text>电工人数配置不足:</view>
				<view class="radioCameraflex">
					<evan-radio v-model="formMess.electrician_lack" label="1" class="margin-right-xl">是</evan-radio>
					<evan-radio v-model="formMess.electrician_lack" label="0" class="margin-right-xl">否</evan-radio>
					<evan-radio v-model="formMess.electrician_lack" label="2" class="margin-right-xs">其他</evan-radio>
					<input v-if="this.formMess.electrician_lack!=2" disabled="disabled" type="text"
						v-model="formMess.electrician_lack_describe">
					<input v-else type="text" v-model="formMess.electrician_lack_describe">
					<image mode="aspectFit"
						:src="this.formMess.electrician_lack_picture?this.formMess.electrician_lack_picture:'/static/cameraIcon.png'"
						@tap="goCamera('electrician_lack_image','electrician_lack_picture')"></image>
				</view>
			</view>
			<view class="form-item extraDis radioSec">
				<view class="title"><text class="necessary">*</text>电工证超期:</view>
				<view class="radioCameraflex">
					<evan-radio v-model="formMess.overdue_electrician_certificate" label="1" class="margin-right-xl">是
					</evan-radio>
					<evan-radio v-model="formMess.overdue_electrician_certificate" label="0" class="margin-right-xl">否
					</evan-radio>
					<evan-radio v-model="formMess.overdue_electrician_certificate" label="2" class="margin-right-xs">其他
					</evan-radio>
					<input v-if="this.formMess.overdue_electrician_certificate!=2" disabled="disabled" type="text"
						v-model="formMess.overdue_electrician_certificate_describe">
					<input v-else type="text" v-model="formMess.overdue_electrician_certificate_describe">
					<image mode="aspectFit"
						:src="this.formMess.overdue_electrician_certificate_picture?this.formMess.overdue_electrician_certificate_picture:'/static/cameraIcon.png'"
						@tap="goCamera('overdue_electrician_certificate_image','overdue_electrician_certificate_picture')">
					</image>
				</view>
			</view>
			<view class="info-tit margin-left-xs">
				<text class="cuIcon-titles margin-right-xs"></text>
				设备
			</view>
			<view class="form-item extraDis">
				<view class="title">设备老旧(标明出厂或投运日期):</view>
				<input type="text" style="width:35%" v-model="formMess.old_equipment">
			</view>
			<view class="info-tit margin-left-xs">
				<text class="cuIcon-titles margin-right-xs"></text>
				安全工器具
			</view>
			<view class="form-item extraDis radioSec">
				<view class="title"><text class="necessary">*</text>配置不足（绝缘体):</view>
				<view class="radioCameraflex">
					<evan-radio v-model="formMess.blanket_insufficient_configuration" label="1" class="margin-right-xl">
						是</evan-radio>
					<evan-radio v-model="formMess.blanket_insufficient_configuration" label="0" class="margin-right-xl">
						否</evan-radio>
					<evan-radio v-model="formMess.blanket_insufficient_configuration" label="2" class="margin-right-xs">
						其他</evan-radio>
					<input v-if="this.formMess.blanket_insufficient_configuration!=2" disabled="disabled" type="text"
						v-model="formMess.blanket_insufficient_configuration_describe">
					<input v-else type="text" v-model="formMess.blanket_insufficient_configuration_describe">
					<image mode="aspectFit"
						:src="this.formMess.blanket_insufficient_configuration_picture?this.formMess.blanket_insufficient_configuration_picture:'/static/cameraIcon.png'"
						@tap="goCamera('blanket_insufficient_configuration_image','blanket_insufficient_configuration_picture')">
					</image>
				</view>
			</view>
			<view class="form-item extraDis radioSec">
				<view class="title"><text class="necessary">*</text>接地线与存放位置编号:</view>
				<view class="radioCameraflex">
					<evan-radio v-model="formMess.ground_wire" label="1" class="margin-right-xl">是</evan-radio>
					<evan-radio v-model="formMess.ground_wire" label="0" class="margin-right-xl">否</evan-radio>
					<evan-radio v-model="formMess.ground_wire" label="2" class="margin-right-xs">其他</evan-radio>
					<input v-if="this.formMess.ground_wire!=2" disabled="disabled" type="text"
						v-model="formMess.ground_wire_describe">
					<input v-else type="text" v-model="formMess.ground_wire_describe">
					<image mode="aspectFit"
						:src="this.formMess.ground_wire_picture?this.formMess.ground_wire_picture:'/static/cameraIcon.png'"
						@tap="goCamera('ground_wire_image','ground_wire_picture')"></image>
				</view>
			</view>
			<view class="info-tit margin-left-xs">
				<text class="cuIcon-titles margin-right-xs"></text>
				模拟屏
			</view>
			<view class="form-item extraDis radioSec">
				<view class="title"><text class="necessary">*</text>模拟屏:</view>
				<view class="radioCameraflex">
					<evan-radio v-model="formMess.analog_screen" label="1" class="margin-right-xl">是</evan-radio>
					<evan-radio v-model="formMess.analog_screen" label="0" class="margin-right-xl">否</evan-radio>
					<evan-radio v-model="formMess.analog_screen" label="2" class="margin-right-xs">其他</evan-radio>
					<input v-if="this.formMess.analog_screen!=2" disabled="disabled" type="text"
						v-model="formMess.analog_screen_describe">
					<input v-else type="text" v-model="formMess.analog_screen_describe">
					<image mode="aspectFit"
						:src="this.formMess.analog_screen_picture?this.formMess.analog_screen_picture:'/static/cameraIcon.png'"
						@tap="goCamera('analog_screen_image','analog_screen_picture')"></image>
				</view>
			</view>
			<view class="form-item">
				<view class="title">备注:</view>
				<textarea name="" id="" v-model="formMess.remarks"></textarea>
			</view>
			<view class="btn-area submitBottomBtn padding-lr-sm  " style="position:static">
				<button class="bg-blue round  margin-top" @click="$noMultipleClicks(addSubmit)">提 交 </button>
			</view>
			<br>
		</form>
	</view>
</template>

<script>
	export default {

		data() {
			return {
				noClick: true,

				supervisionListData: [],
				routeListData: [],
				siteListData: [],

				id: 0,

				formMess: {
					"account_number": "",
					"rheological_change": "",
					"power_capacity": "",
					"route_id": 0,
					"site_id": 0,
					"supervision_department_id": 0,

					"electric_test_overdue": "",

					"cable_hole": "0",
					cable_hole_describe: '',

					"damage": "0",
					"damage_describe": "",

					"water_leakage": "0",
					"water_leakage_describe": "",

					"annihilator_insufficient_configuration": "0",
					"annihilator_insufficient_configuration_describe": "",

					"annihilator_overdue": "0",
					"annihilator_overdue_describe": "",

					"pile_up_sundries": "0",
					"pile_up_sundries_describe": "",

					"serious_ash_deposition": "0",
					"serious_ash_deposition_describe": "",

					"around_environment_humid": "0",
					"around_environment_humid_describe": "",

					"around_pile_up_sundries": "0",
					"around_pile_up_sundries_describe": "",

					"no_electrician": "0",
					"no_electrician_describe": "",

					"electrician_lack": "0",
					"electrician_lack_describe": "",

					"overdue_electrician_certificate": "0",
					"overdue_electrician_certificate_describe": "",

					"old_equipment": "",

					"blanket_insufficient_configuration": "0",
					"blanket_insufficient_configuration_describe": "",

					"ground_wire": "0",
					"ground_wire_describe": "",

					"analog_screen": "0",
					"analog_screen_describe": "",
					"remarks": "",

					cable_hole_picture: '',
					damage_picture: '',
					water_leakage_picture: '',
					annihilator_insufficient_configuration_picture: '',
					annihilator_overdue_picture: '',
					pile_up_sundries_picture: '',
					serious_ash_deposition_picture: '',
					around_environment_humid_picture: '',
					around_pile_up_sundries_picture: '',
					no_electrician_picture: '',
					electrician_lack_picture: '',
					overdue_electrician_certificate_picture: '',
					blanket_insufficient_configuration_picture: '',
					ground_wire_picture: '',
					analog_screen_picture: '',
				},
			}
		},
		computed: {
			isdisabledFn() {
				if (this.id == null) {
					return this.isdisabled = false;

				} else {
					return this.isdisabled = true;
				}
			}
		},
		onLoad: function(option) {
			this.getDataList();
			this.getTitleList();
			this.getRoutrBox();

			this.id = option.id;
			if (option.id) {
				uni.setNavigationBarTitle({
					title: '现场档案修改'
				});
				this.getDetailList({
					"id": option.id
				})
			} else {
				uni.setNavigationBarTitle({
					title: '现场档案新增'
				});
			}

		},
		methods: {
			// 正则表达式匹配年月日
			isDate(d) {
				return (
						/^((((1[6-9]|[2-9]\d)\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})-0?2-(0?[1-9]|1\d|2[0-8]))|(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))-0?2-29))$/
					)
					.test(d);
			},
			// 相机拍照
			goCamera(name, upimage) {
				const that = this;
				uni.chooseImage({
					count: 1, // 最多可以选择的图片张数
					sizeType: ['original', 'compressed'], //original 原图，compressed 压缩图，默认二者都有
					sourceType: ['camera'], //album 从相册选图，camera 使用相机，默认二者都有。如需直接开相机或直接选相册，请只使用一个选项
					success: function(res) {
						console.log(res.tempFilePaths[0])
						that.formMess[upimage] = res.tempFilePaths[0];
						console.log(res.tempFilePaths[0])
						uni.uploadFile({
							url: 'https://wx.ewoogi.com/wx/USKYOF/USKYOF.php/Home/MonitoringReporting/setUpload',
							filePath: that.formMess[upimage],
							name: 'file',
							formData: {
								'user': 'test'
							},
							success: (uploadFileRes) => {
								that.formMess[upimage] = 'https://wx.ewoogi.com' + JSON.parse(
										uploadFileRes.data)
									.img_url;
								console.log(that.formMess)
							}
						});
					}
				})
			},

			// 修改回显请求
			async getDetailList(ming = {}) {
				const res = await this.$myRequest({
					url: 'Archives/getArchivesList',
					showLoading: true,
					data: ming
				})
				this.formMess = res.data.data[0];
			},

			//线路名称下拉数据请求
			async getRoutrBox(params = {}) {
				const res = await this.$myRequest({
					url: 'Archives/getRoutrBox',
					showLoading: true,
					data: params
				})
				this.routeListData = res.data.data;
			},

			//监察下拉下拉数据请求
			async getTitleList(params = {}) {
				const res = await this.$myRequest({
					url: 'Archives/getsupervisionBox',
					showLoading: true,
					data: params
				})
				this.supervisionListData = res.data.data
			},

			//站点下拉请求
			async getDataList(params = {}) {
				const res = await this.$myRequest({
					url: 'BlackoutPlan/getSiteBox',
					showLoading: true,
					data: params
				})
				this.siteListData = res.data.data
			},

			//修改提交
			async addSubmit() {
				//提交验证
				if (!this.formMess.account_number.replace(/^\s*/g, '')) {
					uni.showToast({
						title: "请输入户号",
						icon: "none"
					});
					return
				}
				if (!this.formMess.rheological_change.replace(/^\s*/g, '')) {
					uni.showToast({
						title: "请输入流变变化",
						icon: "none"
					});
					return
				}
				if (!this.formMess.power_capacity.replace(/^\s*/g, '')) {
					uni.showToast({
						title: "请输入单路电源容量",
						icon: "none"
					});
					return
				}
				if (!this.formMess.route_id) {
					uni.showToast({
						title: "请输入所属线路",
						icon: "none"
					});
					return
				}
				if (!this.formMess.site_id) {
					uni.showToast({
						title: "请选择所属站点",
						icon: "none"
					});
					return
				}
				if (!this.formMess.supervision_department_id) {
					uni.showToast({
						title: "请选择所属监察",
						icon: "none"
					});
					return
				}
				if (!this.formMess.electric_test_overdue) {
					uni.showToast({
						title: "请输入电试报告时间",
						icon: "none"
					});
					return
				}
				if (this.isDate(this.formMess.electric_test_overdue) == false) {
					uni.showToast({
						title: "日期格式不正确，正确格式为：yyyy-mm-dd",
						icon: "none"
					});
					return
				}

				let data = this.formMess;
				// let url = 'Archives/addArchives';

				if (this.id) {
					this.formMess.id = this.id;
				}
				let res = await this.addArchive(this.formMess)
				if (!res.data.flag) {
					uni.showToast({
						title: "提交失败",
						icon: "none"
					});
				} else {
					uni.showToast({
						title: "提交成功",
					});
				}
				setTimeout(() => {
					uni.navigateTo({
						url: '/pages/siteArchive/siteArchive',
					});
				}, 1000);
			},
			addArchive(params = {}) {
				return this.$myRequest({
					url: !this.id ? 'Archives/addArchives' : 'Archives/setArchives',
					data: params
				})
			},
		}
	}
</script>
