<!--  -->
<template>
  <div >
    <el-form ref="formRef" :model="otherInfo"  label-position="left" label-width="auto" disabled>
        <div class="hc-form-item">
            <el-form-item label="关联项目：">
                <el-select block v-model="otherInfo.projectId">
                    <el-option v-for="item in projectType" :label="item.projectName" :value="item.projectId"/>
                </el-select>
            </el-form-item>
     
        </div>
        <el-form-item label="对方单位：">
            <el-input v-model="otherInfo.toUnit"/>
        </el-form-item>
        <el-form-item label="支付金额：" prop="key3">
            <el-input v-model="otherInfo.payMoney">
                <template #append>元</template>
            </el-input>
        </el-form-item>
        <el-form-item label="申请支付时间：">
            <el-date-picker type="date" class="block" v-model="otherInfo.payDate" format="YYYY-MM-DD" value-format="YYYY-MM-DD"/>
        </el-form-item>
        <el-form-item label="外包类型：">
            <el-select block v-model="otherInfo.outsourcingType">
                <el-option v-for="item in outsourcingTypeData" :label="item.dictName" :value="item.dictValue"/>
            </el-select>
        </el-form-item>
    </el-form>
  </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: {}
  }
})
const outsourcingTypeData=ref([])
//项目类型
const projectType = ref([])
const getProjectData = async () => {
    const {error, code, data} = await getProjectList()
    //判断状态
    if (!error && code === 200) {
        projectType.value = getArrValue(data)
    } else {
        projectType.value = []
    }
}
//监听
watch(() => [
  props.otherInfo,
], ([otherInfo]) => {
  console.log(otherInfo, 'otherInfo');

})


</script>
<style lang='scss' scoped>
</style>