274 lines
		
	
	
		
			9.0 KiB
		
	
	
	
		
			Vue
		
	
	
	
			
		
		
	
	
			274 lines
		
	
	
		
			9.0 KiB
		
	
	
	
		
			Vue
		
	
	
	
| <template>
 | ||
|     <view class="bg-white br12 p-0-20">
 | ||
|         <view class="d-b-c p-30-0 border-b">
 | ||
|             <view class="f28 fb">{{ $t('ENU_G_C_2') }}</view>
 | ||
|             <view @click="clickFold">
 | ||
|                 <u-icon name="arrow-down" size="28rpx" color="#999999" v-if="fold"></u-icon>
 | ||
|                 <u-icon name="arrow-right" size="28rpx" color="#999999" v-else></u-icon>
 | ||
|             </view>
 | ||
|         </view>
 | ||
|         <view class="collspaceContent" :class="{ 'closed': !fold }">
 | ||
|             <view class="d-b-c p-20-0 border-b">
 | ||
|                 <view class="f28 gray3">{{ $t('S_C_7') }}:{{ $t('S_C_58') }}</view>
 | ||
|                 <picker :range="monthList" @change="changeMonth">
 | ||
|                     <view class="common picker">
 | ||
|                         <text>{{ monthList[monthIndex] }}{{ $t('S_C_62') }}</text>
 | ||
|                         <u-icon name="arrow-down" size="28rpx" color="#333"></u-icon>
 | ||
|                     </view>
 | ||
|                 </picker>
 | ||
|             </view>
 | ||
| 
 | ||
|             <view class="prefecture form-group">
 | ||
|                 <view class="form-item">
 | ||
|                     <view class="form-label">
 | ||
|                         <text class="domation mr10">*</text>
 | ||
|                         {{ $t('S_C_15') }}({{ performanceCurrency() }})
 | ||
|                     </view>
 | ||
|                     <input class="form-input" type="text" value="" v-model="totalAchieve" :placeholder="$t('S_C_70')" />
 | ||
|                 </view>
 | ||
|                 <view class="form-item">
 | ||
|                     <view class="form-label">
 | ||
|                         <text class="domation mr10 f24">*</text>
 | ||
|                         {{ $t('S_C_16') }}({{ performanceCurrency() }})
 | ||
|                     </view>
 | ||
|                     <input class="form-input" type="text" value="" v-model="rightAchieve" :placeholder="$t('S_C_70')" />
 | ||
|                 </view>
 | ||
|                 <view class="form-item">
 | ||
|                     <view class="flex-1">
 | ||
|                         <text class="f28">{{ $t('S_C_9') }}</text>
 | ||
|                     </view>
 | ||
|                     <view class="flex-1">
 | ||
|                         <text class="f28">{{ $t('S_C_17') }}</text>
 | ||
|                     </view>
 | ||
|                     <view class="flex-1">
 | ||
|                         <text class="domation mr10">*</text>
 | ||
|                         <text class="f28">{{ $t('S_C_10') }}({{ performanceCurrency() }})</text>
 | ||
|                     </view>
 | ||
|                 </view>
 | ||
|                 <view class="form-item" v-for="(v, idx) in goalsDetailVOList" :key="idx">
 | ||
|                     <view class="flex-1">
 | ||
|                         <text class="f28" v-if="idx % 2 == 0">
 | ||
|                             {{ $t(transformZh(idx + 1)) }}
 | ||
|                         </text>
 | ||
|                     </view>
 | ||
|                     <view class="flex-1">
 | ||
|                         <text>{{ $t(getAreaName(idx)) }}</text>
 | ||
|                     </view>
 | ||
|                     <view class="flex-1">
 | ||
|                         <input class="form-input" type="text" v-model="v.cycleValue" :placeholder="$t('S_C_70')" />
 | ||
|                     </view>
 | ||
|                 </view>
 | ||
|             </view>
 | ||
|         </view>
 | ||
| 
 | ||
|     </view>
 | ||
| </template>
 | ||
| 
 | ||
| <script>
 | ||
| import utils from '@/common/utils.js';
 | ||
| export default {
 | ||
|     components: {},
 | ||
|     props: ['data', 'monthList', 'monthIndex'],
 | ||
|     data() {
 | ||
|         return { 
 | ||
|             fold: false,
 | ||
|             totalAchieve: "",
 | ||
|             rightAchieve: "",
 | ||
|             goalsDetailVOList: [
 | ||
|                 {
 | ||
|                     cycleKey: "ml1",
 | ||
|                     cycleValue: "",
 | ||
|                 },
 | ||
|                 {
 | ||
|                     cycleKey: "mr1",
 | ||
|                     cycleValue: "",
 | ||
|                 },
 | ||
|                 {
 | ||
|                     cycleKey: "ml2",
 | ||
|                     cycleValue: "",
 | ||
|                 },
 | ||
|                 {
 | ||
|                     cycleKey: "mr2",
 | ||
|                     cycleValue: "",
 | ||
|                 },
 | ||
|                 {
 | ||
|                     cycleKey: "ml3",
 | ||
|                     cycleValue: "",
 | ||
|                 },
 | ||
|                 {
 | ||
|                     cycleKey: "mr3",
 | ||
|                     cycleValue: "",
 | ||
|                 },
 | ||
|                 {
 | ||
|                     cycleKey: "ml4",
 | ||
|                     cycleValue: "",
 | ||
|                 },
 | ||
|                 {
 | ||
|                     cycleKey: "mr4",
 | ||
|                     cycleValue: "",
 | ||
|                 },
 | ||
|                 {
 | ||
|                     cycleKey: "ml5",
 | ||
|                     cycleValue: "",
 | ||
|                 },
 | ||
|                 {
 | ||
|                     cycleKey: "mr5",
 | ||
|                     cycleValue: "",
 | ||
|                 },
 | ||
|                 {
 | ||
|                     cycleKey: "ml6",
 | ||
|                     cycleValue: "",
 | ||
|                 },
 | ||
|                 {
 | ||
|                     cycleKey: "mr6",
 | ||
|                     cycleValue: "",
 | ||
|                 },
 | ||
|                 {
 | ||
|                     cycleKey: "ml7",
 | ||
|                     cycleValue: "",
 | ||
|                 },
 | ||
|                 {
 | ||
|                     cycleKey: "mr7",
 | ||
|                     cycleValue: "",
 | ||
|                 },
 | ||
|                 {
 | ||
|                     cycleKey: "ml8",
 | ||
|                     cycleValue: "",
 | ||
|                 },
 | ||
|                 {
 | ||
|                     cycleKey: "mr8",
 | ||
|                     cycleValue: "",
 | ||
|                 },
 | ||
|                 {
 | ||
|                     cycleKey: "ml9",
 | ||
|                     cycleValue: "",
 | ||
|                 },
 | ||
|                 {
 | ||
|                     cycleKey: "mr9",
 | ||
|                     cycleValue: "",
 | ||
|                 },
 | ||
|                 {
 | ||
|                     cycleKey: "ml10",
 | ||
|                     cycleValue: "",
 | ||
|                 },
 | ||
|                 {
 | ||
|                     cycleKey: "mr10",
 | ||
|                     cycleValue: "",
 | ||
|                 },
 | ||
|                 {
 | ||
|                     cycleKey: "ml11",
 | ||
|                     cycleValue: "",
 | ||
|                 },
 | ||
|                 {
 | ||
|                     cycleKey: "mr11",
 | ||
|                     cycleValue: "",
 | ||
|                 },
 | ||
|                 {
 | ||
|                     cycleKey: "ml12",
 | ||
|                     cycleValue: "",
 | ||
|                 },
 | ||
|                 {
 | ||
|                     cycleKey: "mr12",
 | ||
|                     cycleValue: "",
 | ||
|                 },
 | ||
|             ]
 | ||
|         };
 | ||
|     },
 | ||
|     methods: {
 | ||
|         clickFold(){
 | ||
|             this.fold = !this.fold;
 | ||
|         },
 | ||
|         changeMonth(e) {
 | ||
|             this.$emit('change-month', e)
 | ||
|         },
 | ||
|         transformZh(index) {
 | ||
|             if (index == 1) {
 | ||
|                 return utils.numberToChinese(1,'year')
 | ||
|             } else if (index == 3) {
 | ||
|                 return utils.numberToChinese(2,'year')
 | ||
|             } else if (index == 5) {
 | ||
|                 return utils.numberToChinese(3,'year')
 | ||
|             } else if (index == 7) {
 | ||
|                 return utils.numberToChinese(4,'year')
 | ||
|             } else if (index == 9) {
 | ||
|                 return utils.numberToChinese(5,'year')
 | ||
|             }else if (index == 11) {
 | ||
|                 return utils.numberToChinese(6,'year')
 | ||
|             }else if (index == 13) {
 | ||
|                 return utils.numberToChinese(7,'year')
 | ||
|             }else if (index == 15) {
 | ||
|                 return utils.numberToChinese(8,'year')
 | ||
|             }else if (index == 17) {
 | ||
|                 return utils.numberToChinese(9,'year')
 | ||
|             }else if (index == 19) {
 | ||
|                 return utils.numberToChinese(10,'year')
 | ||
|             }else if (index == 21) {
 | ||
|                 return utils.numberToChinese(11,'year')
 | ||
|             }else if (index == 23) {
 | ||
|                 return utils.numberToChinese(12,'year')
 | ||
|             }
 | ||
|         },
 | ||
|         getAreaName(idx) {
 | ||
|             if (idx % 2 == 0) {
 | ||
|                 return 'S_C_18'
 | ||
|             } else {
 | ||
|                 return 'S_C_19'
 | ||
|             }
 | ||
|         },
 | ||
|         submit() {
 | ||
|             if (!this.totalAchieve) {
 | ||
|                 uni.showToast({
 | ||
|                     title: `${this.$t('S_C_70')}${this.$t('S_C_15')}`,
 | ||
|                     duration: 1000,
 | ||
|                     icon: 'none'
 | ||
|                 });
 | ||
|                 return
 | ||
|             }
 | ||
|             if (!this.rightAchieve) {
 | ||
|                 uni.showToast({
 | ||
|                     title: `${this.$t('S_C_70')}${this.$t('S_C_16')}`,
 | ||
|                     duration: 1000,
 | ||
|                     icon: 'none'
 | ||
|                 });
 | ||
|                 return
 | ||
|             }
 | ||
|             if (this.goalsDetailVOList.length < 1) {
 | ||
|                 uni.showToast({
 | ||
|                     title: `${this.$t('S_C_70')}${this.$t('S_C_10')}`,
 | ||
|                     duration: 1000,
 | ||
|                     icon: 'none'
 | ||
|                 });
 | ||
|                 return
 | ||
|             }
 | ||
|             let flag = this.goalsDetailVOList.every((item) => {
 | ||
|                 return item.cycleValue
 | ||
|             })
 | ||
|             if (!flag) {
 | ||
|                 uni.showToast({
 | ||
|                     title: `${this.$t('S_C_70')}${this.$t('S_C_10')}`,
 | ||
|                     duration: 1000,
 | ||
|                     icon: 'none'
 | ||
|                 });
 | ||
|                 return
 | ||
|             }
 | ||
|             this.$props.data.totalAchieve = this.totalAchieve;
 | ||
|             this.$props.data.rightAchieve = this.rightAchieve;
 | ||
|             this.$props.data.goalsDetailVOList = JSON.parse(JSON.stringify(this.goalsDetailVOList));
 | ||
|             return true
 | ||
|         }
 | ||
|     }
 | ||
| };
 | ||
| </script>
 | ||
| 
 | ||
| <style lang="scss" scoped>
 | ||
| .collspaceContent {
 | ||
|     max-height: 5000rpx;
 | ||
|     overflow: hidden;
 | ||
|     transition: all ease 0.8s;
 | ||
| 
 | ||
|     &.closed {
 | ||
|         max-height: 0;
 | ||
|         transition: all ease 0.6s;
 | ||
|     }
 | ||
| }
 | ||
| </style> |