 <!--  -->
 <template>
       <div class="record-form-box">
                <el-scrollbar>
                    <el-form ref="formRef" :model="otherInfo" label-position="top"  disabled>
                      <div class="hc-form-item">
                        <el-form-item label="申请时间：" prop="afDate">
                            <el-date-picker type="date" class="block" v-model="otherInfo.afDate" format="YYYY-MM-DD" value-format="YYYY-MM-DD"/>
                        </el-form-item>
                        <el-form-item label="关联项目：" v-if="otherInfo.isProjectBonus !== 1">
                            <el-select block v-model="otherInfo.projectId">
                                <el-option v-for="items in projectData" :label="items.projectName" :value="items.projectId"/>
                            </el-select>
                        </el-form-item>
                      </div>
                 
                        <div class="hc-form-item">
                            <el-form-item label="申请人：" prop="afUserId">
                                <el-select block v-model="otherInfo.afUserId">
                                    <el-option label="暂无接口1" value="1" />
                                    <el-option label="暂无接口2" value="2" />
                                </el-select>
                            </el-form-item>
                            <el-form-item label="是否为项目提成申请：" prop="isProjectBonus">
                                <el-select block v-model="otherInfo.isProjectBonus" placeholder="">
                                    <el-option label="否" :value="0"/>
                                    <el-option label="是" :value="1"/>
                                </el-select>
                            </el-form-item>
                        </div>
                        <div class="hc-form-item" v-if="otherInfo.isProjectBonus === 1">
                            <el-form-item label="关联项目：" prop="projectId">
                                <el-select block v-model="otherInfo.projectId">
                                    <el-option v-for="items in projectData" :label="items.projectName" :value="items.projectId"/>
                                </el-select>
                            </el-form-item>
                            <div class="ml-2">
                                <el-button type="default" style="margin-top: 34px;" @click="budgetModalShow">
                                    <HcIcon name="add"/>
                                    <span>关联合同数据</span>
                                </el-button>
                            </div>
                        </div>
                        <el-form-item label="回款时间：" prop="collectionDate" v-if="otherInfo.isProjectBonus === 1">
                            <el-input v-model="otherInfo.collectionDate" disabled/>
                        </el-form-item>
                        <el-form-item label="回款金额：" prop="collectionMoney" v-if="otherInfo.isProjectBonus === 1">
                            <el-input v-model="otherInfo.collectionMoney" disabled>
                                <template #append>元</template>
                            </el-input>
                        </el-form-item>
                        <el-form-item label="申请比例：" prop="afProportion" v-if="otherInfo.isProjectBonus === 1">
                            <el-input v-model="otherInfo.afProportion">
                                <template #append>%</template>
                            </el-input>
                        </el-form-item>
                        <el-form-item label="请款金额：" prop="afMoney">
                            <el-input v-model="otherInfo.afMoney" :disabled="otherInfo.isProjectBonus === 1">
                                <template #append>元</template>
                            </el-input>
                        </el-form-item>
                        <el-form-item label="收款人：" prop="payeeUserName">
                            <el-input v-model="otherInfo.payeeUserName"/>
                        </el-form-item>
                        <el-form-item label="收款人开户行：" prop="payeeUserBankName">
                            <el-input v-model="otherInfo.payeeUserBankName"/>
                        </el-form-item>
                        <el-form-item label="收款账号：" prop="payeeUserBankId">
                            <el-input v-model="otherInfo.payeeUserBankId"/>
                        </el-form-item>
                        <el-form-item label="请款用途：" prop="payeeUseInfo" v-if="otherInfo.isProjectBonus !== 1">
                            <el-input type="textarea" v-model="otherInfo.payeeUseInfo" :autosize="{ minRows: 3, maxRows: 5 }"/>
                        </el-form-item>
                    
                        <el-form-item label="备注：">
                            <el-input type="textarea" v-model="otherInfo.remarks" :autosize="{ minRows: 3, maxRows: 5 }"/>
                        </el-form-item>
                    </el-form>
                </el-scrollbar>
            </div>
 </template>
 
 <script setup>
 import {ref, watch,onActivated} from  'vue'
 import {getProjectList} from "~api/other";
 import {getArrValue} from "js-fast-way";
 onActivated(()=>{
  getProjectData()
 })
 //参数
 const props = defineProps({
   otherInfo: {
         type: Object,
         default: {}
     }
 })
 //监听
 watch(() => [
  props.otherInfo,
 ], ([otherInfo]) => {
    console.log(otherInfo,'otherInfo');
 
 })
 //获取项目数据
const projectData = ref([])
const getProjectData = async () => {
    const {error, code, data} = await getProjectList()
    //判断状态
    if (!error && code === 200) {
        projectData.value = getArrValue(data)
    } else {
        projectData.value = []
    }
}
 </script>
 <style lang='scss' scoped>
 </style>