<template>
	<view class="enterpriseSituateItem">
		<view class="d-flex px-4">
			<view class="w-100 font-md text-dark font-weight">情况反馈</view>
		</view>
		<view class="px-4">
			<u--form labelPosition="left" :model="model" ref="situateForm" labelWidth="80">
				<u-form-item label="员工总数：" prop="staffTotal" ref="situateItem">
					<u--input v-model="model.staffTotal" type="number" :readonly="onlyFlag"
						:border="onlyFlag ? 'none' : 'surround'" :placeholder="!onlyFlag ? '请输入员工总数' : ''"></u--input>
				</u-form-item>
				<!-- <u-form-item label="在岗人数：" prop="onlineStaffTotal" ref="situateItem">
					<u--input v-model="model.onlineStaffTotal" :readonly="onlyFlag" type="number"
						:border="onlyFlag ? 'none' : 'surround'" :placeholder="!onlyFlag ? '请输入在岗人数' : ''"></u--input>
				</u-form-item> -->
				<u-form-item label="主导产品及年产能：" prop="productCapacity" ref="situateItem" class="questionDesc">
					<u--textarea v-model="model.productCapacity" :disabled="onlyFlag" :border="onlyFlag ? 'none' : 'surround'"
						:placeholder="!onlyFlag ? '请填写主导产品及年产能' : ''">
					</u--textarea>
				</u-form-item>
			<!-- 	<u-form-item label="企业下游客户名称：" prop="lowerCustomer" ref="situateItem" class="questionDesc">
					<u--textarea v-model="model.lowerCustomer" :disabled="onlyFlag" :border="onlyFlag ? 'none' : 'surround'"
						:placeholder="!onlyFlag ? '请填写企业下游客户名称' : ''">
					</u--textarea>
				</u-form-item> -->
				<u-form-item label="目前在手订单金额(万元)(每月更新)：" prop="orderAmount" ref="situateItem">
					<u--input v-model="model.orderAmount" type="number" :readonly="onlyFlag"
						:border="onlyFlag ? 'none' : 'surround'" :placeholder="!onlyFlag ? '请输入目前在手订单金额' : ''"></u--input>
				</u-form-item>
				<!-- <u-form-item label="持续到哪个月：" prop="endDate" @click="endDateTap">
					<u--input v-model="model.endDate" readonly :border="onlyFlag ? 'none' : 'surround'"
						:placeholder="!onlyFlag ? '请选择持续到哪个月' : ''">
					</u--input>
				</u-form-item> -->
				<!-- <u-form-item label="产品库存金额(万元)：" prop="productStockAmount" ref="situateItem">
					<u--input v-model="model.productStockAmount" :readonly="onlyFlag" type="number"
						:border="onlyFlag ? 'none' : 'surround'" :placeholder="!onlyFlag ? '请输入产品库存金额' : ''"></u--input>
				</u-form-item> -->
				<!-- <u-form-item label="主要原材料名称：" prop="rawMaterialName" ref="situateItem" labelPosition="top"
					class="questionDesc">
					<u--textarea v-model="model.rawMaterialName" :disabled="onlyFlag"
						:border="onlyFlag ? 'none' : 'surround'" :placeholder="!onlyFlag ? '请填写主要原材料名称' : ''">
					</u--textarea>
				</u-form-item> -->
				<u-form-item label="原材料价格及增幅：" prop="rawMaterialSupplier" ref="situateItem" labelPosition="top"
					class="questionDesc">
					<u--textarea v-model="model.rawMaterialSupplier" :disabled="onlyFlag" :border="onlyFlag ? 'none' : 'surround'"
						:placeholder="!onlyFlag ? '请填写原材料价格及增幅' : ''">
					</u--textarea>
				</u-form-item>
				<u-form-item label="2023年开票销售实际（万元)：" prop="lastYearInvoicingSaleActual" ref="situateItem" labelWidth="110">
					<u--input v-model="model.lastYearInvoicingSaleActual" type="number" :readonly="onlyFlag"
						:border="onlyFlag ? 'none' : 'surround'" :placeholder="!onlyFlag ? '请输入2023年开票销售实际（万元)' : ''">
					</u--input>
				</u-form-item>
				<u-form-item label="2023年开票销售增幅（%）：" prop="lastYearInvoicingSaleGrowth" ref="situateItem" labelWidth="110">
					<u--input v-model="model.lastYearInvoicingSaleGrowth" type="number" :readonly="onlyFlag"
						:border="onlyFlag ? 'none' : 'surround'" :placeholder="!onlyFlag ? '2023年开票销售增幅（%）' : ''">
					</u--input>
				</u-form-item>
				<u-form-item label="2024年全年实时开票销售预测：" prop="yearInvoicingSalePlan" ref="situateItem" labelWidth="110">
					<u--input v-model="model.yearInvoicingSalePlan" type="number" :readonly="onlyFlag"
						:border="onlyFlag ? 'none' : 'surround'" :placeholder="!onlyFlag ? '请输入2024年全年实时开票销售预测' : ''">
					</u--input>
				</u-form-item>
				<view class="d-flex a-center py-2">
					<view class="d-flex flex-wrap j-sb a-start commomWidth">
						<view class="border border-light-opc px-2 d-flex month">
							<song-data-picker class="flex-1" style="width: 100%;" @click.native="hideKeyboard" :clearIcon="false"
								:readonly="readOnlyFlag" :localdata="monthColumn" placeholder="请选择月份" popup-title="请选择月份"
								@nodeclick="monthTypeTap('monthInvoicingSalePlan', $event)">
								<slot>
									<view class="d-flex j-sb a-center">
										<text class="text-secondary">{{model.monthInvoicingSalePlan.month || '请选择月份'}}</text>
										<u-icon v-if="!readOnlyFlag" name="arrow-down" color="#303133" size="15">
										</u-icon>
									</view>
								</slot>
							</song-data-picker>
						</view>
						<view class="text-primary font-md monthDesc">月累计实时开票销售(万元)：</view>
					</view>
					<u--input v-model="model.monthInvoicingSalePlan.value" :readonly="onlyFlag" type="number"
						:border="onlyFlag ? 'none' : 'surround'" :placeholder="!onlyFlag ? '请输入月累计实时开票销售(万元)' : ''">
					</u--input>
				</view>
				<view class="d-flex a-center py-2">
					<view class="d-flex flex-wrap j-sb a-start commomWidth">
						<view class="border border-light-opc px-2 d-flex month">
							<song-data-picker class="flex-1" style="width: 100%;" @click.native="hideKeyboard" :clearIcon="false"
								:readonly="readOnlyFlag" :localdata="monthColumn" placeholder="请选择月份" popup-title="请选择月份"
								@nodeclick="monthTypeTap('monthInvoicingSaleGrowth', $event)">
								<slot>
									<view class="d-flex j-sb a-center">
										<text class="text-secondary">{{model.monthInvoicingSaleGrowth.month || '请选择'}}</text>
										<u-icon v-if="!readOnlyFlag" name="arrow-down" color="#303133" size="15">
										</u-icon>
									</view>
								</slot>
							</song-data-picker>
						</view>
						<view class="text-primary font-md monthDesc">月累计实时开票销增幅（%）：</view>
					</view>
					<u--input v-model="model.monthInvoicingSaleGrowth.value" :readonly="onlyFlag" type="number"
						:border="onlyFlag ? 'none' : 'surround'" :placeholder="!onlyFlag ? '请输入月累计实时开票销增幅（%）' : ''">
					</u--input>
				</view>
				<u-form-item label="2023年工业总产值（万元）：" prop="lastIndustryTotal" ref="situateItem" labelWidth="110">
					<u--input v-model="model.lastIndustryTotal" type="number" :readonly="onlyFlag"
						:border="onlyFlag ? 'none' : 'surround'" :placeholder="!onlyFlag ? '请输入2023年工业总产值（万元）' : ''">
					</u--input>
				</u-form-item>
				<u-form-item label="2023年工业总产值增幅（%）：" prop="lastIndustryGrowth" ref="situateItem" labelWidth="110">
					<u--input v-model="model.lastIndustryGrowth" type="number" :readonly="onlyFlag"
						:border="onlyFlag ? 'none' : 'surround'" :placeholder="!onlyFlag ? '2023年工业总产值增幅（%）' : ''">
					</u--input>
				</u-form-item>
				<u-form-item label="2024年全年工业总产值预测(万元)：" prop="industryTotalPlan" ref="situateItem" labelWidth="110">
					<u--input v-model="model.industryTotalPlan" type="number" :readonly="onlyFlag"
						:border="onlyFlag ? 'none' : 'surround'" :placeholder="!onlyFlag ? '请输入2024年全年工业总产值预测(万元)' : ''">
					</u--input>
				</u-form-item>
				<view class="d-flex a-center py-2">
					<view class="d-flex flex-wrap j-sb a-start commomWidth">
						<view class="border border-light-opc px-2 d-flex month">
							<song-data-picker class="flex-1" style="width: 100%;" @click.native="hideKeyboard" :clearIcon="false"
								:readonly="readOnlyFlag" :localdata="monthColumn" placeholder="请选择月份" popup-title="请选择月份"
								@nodeclick="monthTypeTap('monthIndustryTotal', $event)">
								<slot>
									<view class="d-flex j-sb a-center">
										<text class="text-secondary">{{model.monthIndustryTotal.month || '请选择月份'}}</text>
										<u-icon v-if="!readOnlyFlag" name="arrow-down" color="#303133" size="15">
										</u-icon>
									</view>
								</slot>
							</song-data-picker>
						</view>
						<view class="text-primary font-md monthDesc">月累计工业总产值（万元）：</view>
					</view>
					<u--input v-model="model.monthIndustryTotal.value" :readonly="onlyFlag" type="number"
						:border="onlyFlag ? 'none' : 'surround'" :placeholder="!onlyFlag ? '请输入月累计工业总产值（万元）' : ''">
					</u--input>
				</view>
				<view class="d-flex a-center py-2">
					<view class="d-flex flex-wrap j-sb a-start commomWidth">
						<view class="border border-light-opc px-2 d-flex month">
							<song-data-picker class="flex-1" style="width: 100%;" @click.native="hideKeyboard" :clearIcon="false"
								:readonly="readOnlyFlag" :localdata="monthColumn" placeholder="请选择月份" popup-title="请选择月份"
								@nodeclick="monthTypeTap('monthIndustryTotalGrowth', $event)">
								<slot>
									<view class="d-flex j-sb a-center">
										<text class="text-secondary">{{model.monthIndustryTotalGrowth.month || '请选择'}}</text>
										<u-icon v-if="!readOnlyFlag" name="arrow-down" color="#303133" size="15">
										</u-icon>
									</view>
								</slot>
							</song-data-picker>
						</view>
						<view class="text-primary font-md monthDesc">月累计工业总产值增幅（%）：</view>
					</view>
					<u--input v-model="model.monthIndustryTotalGrowth.value" :readonly="onlyFlag" type="number"
						:border="onlyFlag ? 'none' : 'surround'" :placeholder="!onlyFlag ? '请输入月累计工业总产值增幅（%）' : ''">
					</u--input>
				</view>
				
				
				<u-form-item label="2023年利润（万元）：" prop="lastProfit" ref="situateItem" labelWidth="110">
					<u--input v-model="model.lastProfit" type="number" :readonly="onlyFlag"
						:border="onlyFlag ? 'none' : 'surround'" :placeholder="!onlyFlag ? '请输入2023年利润（万元）' : ''">
					</u--input>
				</u-form-item>
				<u-form-item label="2023年利润增幅（%）：" prop="lastProfitGrowth" ref="situateItem" labelWidth="110">
					<u--input v-model="model.lastProfitGrowth" type="number" :readonly="onlyFlag"
						:border="onlyFlag ? 'none' : 'surround'" :placeholder="!onlyFlag ? '2023年利润增幅（%）' : ''">
					</u--input>
				</u-form-item>
				<u-form-item label="2024年全年利润预测(万元)：" prop="profitPlan" ref="situateItem" labelWidth="110">
					<u--input v-model="model.profitPlan" type="number" :readonly="onlyFlag"
						:border="onlyFlag ? 'none' : 'surround'" :placeholder="!onlyFlag ? '请输入2024年全年利润预测(万元)' : ''">
					</u--input>
				</u-form-item>
				<view class="d-flex a-center py-2">
					<view class="d-flex flex-wrap j-sb a-start commomWidth">
						<view class="border border-light-opc px-2 d-flex month">
							<song-data-picker class="flex-1" style="width: 100%;" @click.native="hideKeyboard" :clearIcon="false"
								:readonly="readOnlyFlag" :localdata="monthColumn" placeholder="请选择月份" popup-title="请选择月份"
								@nodeclick="monthTypeTap('monthProfit', $event)">
								<slot>
									<view class="d-flex j-sb a-center">
										<text class="text-secondary">{{model.monthProfit.month || '请选择月份'}}</text>
										<u-icon v-if="!readOnlyFlag" name="arrow-down" color="#303133" size="15">
										</u-icon>
									</view>
								</slot>
							</song-data-picker>
						</view>
						<view class="text-primary font-md monthDesc">月累计利润（万元）：</view>
					</view>
					<u--input v-model="model.monthProfit.value" :readonly="onlyFlag" type="number"
						:border="onlyFlag ? 'none' : 'surround'" :placeholder="!onlyFlag ? '月累计利润（万元）' : ''">
					</u--input>
				</view>
				<view class="d-flex a-center py-2">
					<view class="d-flex flex-wrap j-sb a-start commomWidth">
						<view class="border border-light-opc px-2 d-flex month">
							<song-data-picker class="flex-1" style="width: 100%;" @click.native="hideKeyboard" :clearIcon="false"
								:readonly="readOnlyFlag" :localdata="monthColumn" placeholder="请选择月份" popup-title="请选择月份"
								@nodeclick="monthTypeTap('monthProfitGrowth', $event)">
								<slot>
									<view class="d-flex j-sb a-center">
										<text class="text-secondary">{{model.monthProfitGrowth.month || '请选择'}}</text>
										<u-icon v-if="!readOnlyFlag" name="arrow-down" color="#303133" size="15">
										</u-icon>
									</view>
								</slot>
							</song-data-picker>
						</view>
						<view class="text-primary font-md monthDesc">月累计利润增幅（%）：</view>
					</view>
					<u--input v-model="model.monthProfitGrowth.value" :readonly="onlyFlag" type="number"
						:border="onlyFlag ? 'none' : 'surround'" :placeholder="!onlyFlag ? '请输入月累计利润增幅（%）' : ''">
					</u--input>
				</view>
				
				
				
				<u-form-item label="2023年工业用电量（千瓦时）：" prop="industryPower" ref="situateItem" labelWidth="110">
					<u--input v-model="model.industryPower" type="number" :readonly="onlyFlag"
						:border="onlyFlag ? 'none' : 'surround'" :placeholder="!onlyFlag ? '请输入2023年工业用电量（千瓦时）' : ''">
					</u--input>
				</u-form-item>
				<u-form-item label="2024全年预计工业用电量：" prop="yearReceiptTaxPlan" ref="situateItem" labelWidth="110">
					<u--input v-model="model.yearReceiptTaxPlan" type="number" :readonly="onlyFlag"
						:border="onlyFlag ? 'none' : 'surround'" :placeholder="!onlyFlag ? '2024全年预计工业用电量' : ''">
					</u--input>
				</u-form-item>
				<view class="d-flex a-center py-2">
					<view class="d-flex flex-wrap j-sb a-start commomWidth">
						<view class="border border-light-opc px-2 d-flex month">
							<song-data-picker class="flex-1" style="width: 100%;" @click.native="hideKeyboard" :clearIcon="false"
								:readonly="readOnlyFlag" :localdata="monthColumn" placeholder="请选择月份" popup-title="请选择月份"
								@nodeclick="monthTypeTap('monthPower', $event)">
								<slot>
									<view class="d-flex j-sb a-center">
										<text class="text-secondary">{{model.monthPower.month || '请选择'}}</text>
										<u-icon v-if="!readOnlyFlag" name="arrow-down" color="#303133" size="15">
										</u-icon>
									</view>
								</slot>
							</song-data-picker>
						</view>
						<view class="text-primary font-md monthDesc">月累计工业用电量（千瓦时）：</view>
					</view>
					<u--input v-model="model.monthPower.value" :readonly="onlyFlag" type="number"
						:border="onlyFlag ? 'none' : 'surround'" :placeholder="!onlyFlag ? '月累计工业用电量（千瓦时）' : ''">
					</u--input>
				</view>
				<view class="d-flex a-center py-2">
					<view class="d-flex flex-wrap j-sb a-start commomWidth">
						<view class="border border-light-opc px-2 d-flex month">
							<song-data-picker class="flex-1" style="width: 100%;" @click.native="hideKeyboard" :clearIcon="false"
								:readonly="readOnlyFlag" :localdata="monthColumn" placeholder="请选择月份" popup-title="请选择月份"
								@nodeclick="monthTypeTap('monthPowerGrowth', $event)">
								<slot>
									<view class="d-flex j-sb a-center">
										<text class="text-secondary">{{model.monthPowerGrowth.month || '请选择'}}</text>
										<u-icon v-if="!readOnlyFlag" name="arrow-down" color="#303133" size="15">
										</u-icon>
									</view>
								</slot>
							</song-data-picker>
						</view>
						<view class="text-primary font-md monthDesc">月累计工业用电量增幅（%）：</view>
					</view>
					<u--input v-model="model.monthPowerGrowth.value" :readonly="onlyFlag" type="number"
						:border="onlyFlag ? 'none' : 'surround'" :placeholder="!onlyFlag ? '月累计工业用电量增幅（%）' : ''">
					</u--input>
				</view>
				<u-form-item label="2023年入库税收实绩（万元）：" prop="lastYearReceiptTaxActual" ref="situateItem" labelWidth="110">
					<u--input v-model="model.lastYearReceiptTaxActual" type="number" :readonly="onlyFlag"
						:border="onlyFlag ? 'none' : 'surround'" :placeholder="!onlyFlag ? '请输入2023年入库税收实绩（万元）' : ''">
					</u--input>
				</u-form-item>
				<u-form-item label="2024全年预计入库税收：" prop="yearReceiptTaxGrowth" ref="situateItem" labelWidth="110">
					<u--input v-model="model.yearReceiptTaxGrowth" type="number" :readonly="onlyFlag"
						:border="onlyFlag ? 'none' : 'surround'" :placeholder="!onlyFlag ? '2024全年预计入库税收' : ''">
					</u--input>
				</u-form-item>
				<view class="d-flex a-center py-2">
					<view class="d-flex flex-wrap j-sb a-start commomWidth">
						<view class="border border-light-opc px-2 d-flex month">
							<song-data-picker class="flex-1" style="width: 100%;" @click.native="hideKeyboard" :clearIcon="false"
								:readonly="readOnlyFlag" :localdata="monthColumn" placeholder="请选择月份" popup-title="请选择月份"
								@nodeclick="monthTypeTap('monthReceiptTax', $event)">
								<slot>
									<view class="d-flex j-sb a-center">
										<text class="text-secondary">{{model.monthReceiptTax.month || '请选择'}}</text>
										<u-icon v-if="!readOnlyFlag" name="arrow-down" color="#303133" size="15">
										</u-icon>
									</view>
								</slot>
							</song-data-picker>
						</view>
						<view class="text-primary font-md monthDesc">月累计入库税收（万元）：</view>
					</view>
					<u--input v-model="model.monthReceiptTax.value" :readonly="onlyFlag" type="number"
						:border="onlyFlag ? 'none' : 'surround'" :placeholder="!onlyFlag ? '月累计入库税收（万元）' : ''">
					</u--input>
				</view>
				<view class="d-flex a-center py-2">
					<view class="d-flex flex-wrap j-sb a-start commomWidth">
						<view class="border border-light-opc px-2 d-flex month">
							<song-data-picker class="flex-1" style="width: 100%;" @click.native="hideKeyboard" :clearIcon="false"
								:readonly="readOnlyFlag" :localdata="monthColumn" placeholder="请选择月份" popup-title="请选择月份"
								@nodeclick="monthTypeTap('monthReceiptTaxGrowth', $event)">
								<slot>
									<view class="d-flex j-sb a-center">
										<text class="text-secondary">{{model.monthReceiptTaxGrowth.month || '请选择'}}</text>
										<u-icon v-if="!readOnlyFlag" name="arrow-down" color="#303133" size="15">
										</u-icon>
									</view>
								</slot>
							</song-data-picker>
						</view>
						<view class="text-primary font-md monthDesc">月累计入库税收增幅（%）：</view>
					</view>
					<u--input v-model="model.monthReceiptTaxGrowth.value" :readonly="onlyFlag" type="number"
						:border="onlyFlag ? 'none' : 'surround'" :placeholder="!onlyFlag ? '月累计入库税收增幅（%）' : ''">
					</u--input>
				</view>
				<u-form-item label="企业3-5年发展计划：" prop="developmentFuture" ref="situateItem" class="questionDesc">
					<u--textarea v-model="model.developmentFuture" :disabled="onlyFlag" maxlength="300"
						:border="onlyFlag ? 'none' : 'surround'" :placeholder="!onlyFlag ? '企业3-5年发展计划' : ''">
					</u--textarea>
				</u-form-item>
			</u--form>
			<!-- 年月控件 -->
			<u-datetime-picker :show="showDatetime" mode="year-month" @confirm="calendarConfirm" @close="showDatetime=false"
				@cancel="showDatetime=false" :minDate="1672531200000" confirmDisabledText="请选择截止日期" closeOnClickOverlay>
			</u-datetime-picker>
		</view>
	</view>
</template>

<script>
	import {formatDate} from "@/common/util2.js"
	export default {
		props: {
			model: {
				type: Object,
				default: () => {}
			},
			readOnlyFlag: {
				type: Boolean,
				default: false
			}
		},
		data() {
			return {
				showDatetime: false,
				monthColumn: [{
						text: '1',
						value: '1'
					},
					{
						text: '1~2',
						value: '1~2'
					},
					{
						text: '1~3',
						value: '1~3'
					},
					{
						text: '1~4',
						value: '1~4'
					},
					{
						text: '1~5',
						value: '1~5'
					},
					{
						text: '1~6',
						value: '1~6'
					},
					{
						text: '1~7',
						value: '1~7'
					},
					{
						text: '1~8',
						value: '1~8'
					},
					{
						text: '1~9',
						value: '1~9'
					},
					{
						text: '1~10',
						value: '1~10'
					},
					{
						text: '1~11',
						value: '1~11'
					},
					{
						text: '1~12',
						value: '1~12'
					}
					// ['1', '1~2', '1~3', '1~4', '1~5', '1~6', '1~7', '1~8', '1~9', '1~10', '1~11', '1~12']
				],
				monthType: '',
			}
		},
		computed: {
			onlyFlag() {
				return this.readOnlyFlag
			}
		},
		methods: {
			// 月份选择切换
			monthTypeTap(type, ele) {
				if (this.readOnlyFlag) return
				this.monthType = type;
				this.monthSelect(ele)
				this.hideKeyboard()
			},
			// 持续到哪个月-->点击
			endDateTap() {
				if (this.readOnlyFlag) return
				this.showDatetime = true;
				this.hideKeyboard()
			},
			// 持续到哪个月-->日期选择确认
			calendarConfirm(e) {
				this.showDatetime = false
				this.model.endDate = formatDate(e.value, 'yyyy-MM')
			},
			// 月份选择确认
			monthSelect(e) {
				switch (this.monthType) {
					case 'monthInvoicingSalePlan':
						this.model.monthInvoicingSalePlan.month = e['value']
						break;
					case 'monthInvoicingSaleGrowth':
						this.model.monthInvoicingSaleGrowth.month = e['value']
						break;
					case 'monthPower':
						this.model.monthPower.month = e['value']
						break;
					case 'monthPowerGrowth':
						this.model.monthPowerGrowth.month = e['value']
						break;
					case 'monthIndustryTotal':
						this.model.monthIndustryTotal.month = e['value']
						break;
					case 'monthIndustryTotalGrowth':
						this.model.monthIndustryTotalGrowth.month = e['value']
						break;
					case 'monthReceiptTax':
						this.model.monthReceiptTax.month = e['value']
						break;
					case 'monthReceiptTaxGrowth':
						this.model.monthReceiptTaxGrowth.month = e['value']
						break;
					case 'monthProfitGrowth':
						this.model.monthProfitGrowth.month = e['value']
						break;
					case 'monthProfit':
						this.model.monthProfit.month = e['value']
						break;
					default:
						break;
				}
			},
			// 隐藏键盘
			hideKeyboard() {
				uni.hideKeyboard()
			}
		},
	}
</script>

<style lang="scss" scoped>
	.enterpriseSituateItem {
		.commomWidth {
			width: 400rpx;

			.month {
				width: 150rpx;
			}

			.monthDesc {
				width: 230rpx;
			}
		}
	}
</style>