<!--  -->
<template>
  <div >
    <el-form ref="formRef" :model="otherInfo"  label-position="top" disabled>
        <el-form-item label="申请事由：">
            <el-input type="textarea" v-model="otherInfo.purDesc" :autosize="{ minRows: 2, maxRows: 3 }"/>
        </el-form-item>
        <div class="hc-form-item">
            <!--prop="purType"-->
            <el-form-item label="采购类型：">
                <el-select block v-model="otherInfo.purType">
                    <el-option v-for="item in purTypeData" :label="item.dictName" :value="item.dictValue"/>
                </el-select>
            </el-form-item>
            <el-form-item label="使用单位：" prop="useOrgName">
                <el-input v-model="otherInfo.useOrgName" placeholder="部门使用或者项目使用"/>
            </el-form-item>
            <el-form-item label="期望交付日期：" prop="expectedDeliveryDate">
                <el-date-picker type="date" class="block" v-model="otherInfo.expectedDeliveryDate" format="YYYY-MM-DD" value-format="YYYY-MM-DD"/>
            </el-form-item>
        </div>
        <HcCardItem :title="'采购明细'" ui="hac-bg-grey" style="background: #f7f7f7;">
            <el-form-item label="名称：" prop="purName">
             <el-input v-model="otherInfo.purName"/>
            </el-form-item>
            <div class="hc-form-item">
                <el-form-item label="规格：" prop="purSpecification">
                    <el-input v-model="otherInfo.purSpecification"/>
                </el-form-item>
                <el-form-item label="数量：" prop="purCount">
                    <el-input v-model="otherInfo.purCount"/>
                </el-form-item>
                <el-form-item label="单位：" prop="purOrgName">
                    <el-input v-model="otherInfo.purOrgName"/>
                </el-form-item>
                <el-form-item label="价格：" prop="purPrice">
                    <el-input v-model="otherInfo.purPrice">
                        <template slot="append">元</template>
                    </el-input>
                </el-form-item>
            </div>
        </HcCardItem>
        <el-form-item label="总价格">
            <el-input v-model="otherInfo.purDesc"/>
        </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>
  </div>
</template>

<script setup>
import { ref, watch,onActivated } from 'vue'
import {getProjectList} from "~api/other";
import {getArrValue} from "js-fast-way";

//参数
const props = defineProps({
  otherInfo: {
    type: Object,
    default: {}
  }
})

const projectType=ref([])
const purTypeData=ref([])//采购类型
//监听
watch(() => [
  props.otherInfo,
], ([otherInfo]) => {
  console.log(otherInfo, 'otherInfo');
  getProjectData()

})
const getProjectData = async () => {
    const {error, code, data} = await getProjectList()
    //判断状态
    if (!error && code === 200) {
      projectType.value = getArrValue(data)
    } else {
      projectType.value = []
    }
}

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