<template>
    <div>
        <el-form :model="form" label-width="160px" label-position="right" inline ref="ruleFormRef" :rules="rules">
            <el-row>
                <el-col :span="6">
                    <el-form-item label="签约请示名称" prop="signReqNm">
                        <el-input v-model="form.signReqNm" style="width: 140px" readonly></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="6">
                    <el-form-item label="签约请示号">
                        <el-input v-model="form.signReqNo" style="width: 140px" disabled></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="6">
                    <el-form-item label="流程状态">
                        <el-input v-model="form.workModel.flowStatusName" style="width: 140px" disabled></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="6">
                    <el-form-item label="交易方名称">
                        <el-input v-model="form.contractParty" style="width: 140px" disabled>
                            <!-- <template #append>
                                <el-button :icon="Search" @click="handleSearchContractParty" disabled />
                            </template> -->
                        </el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="6">
                    <el-form-item label="预计签约日期">
                        <el-date-picker v-model="form.signDt" type="date" style="width: 140px;"
                            value-format="YYYY-MM-DD" format="YYYY-MM-DD" readonly>
                        </el-date-picker>
                    </el-form-item>
                </el-col>
                <el-col :span="6">
                    <el-form-item label="请示日期">
                        <el-date-picker v-model="form.reqDt" type="date" style="width: 140px;" disabled
                            value-format="YYYY-MM-DD" format="YYYY-MM-DD" readonly>
                        </el-date-picker>
                    </el-form-item>
                </el-col>
                <el-col :span="6">
                    <el-form-item label="预计签约金额">
                        <el-input-number v-model="form.contrPrice" :precision="2" :step="0.1" controls-position="right"
                            clearable style="width: 140px" readonly></el-input-number>
                    </el-form-item>
                </el-col>
                <el-col :span="6">
                    <el-form-item label="预计利润">
                        <el-input-number v-model="form.estProfit" :precision="2" :step="0.1" controls-position="right"
                            clearable style="width: 140px" readonly></el-input-number>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="合同标的物">
                        <el-input v-model="form.subMatter" clearable style="width: 430px" type="textarea"
                            readonly></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="收付款说明">
                        <el-input v-model="form.fundDesc" clearable style="width: 430px" type="textarea"
                            readonly></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="主要风险点及应对措施">
                        <el-input v-model="form.riskPoints" clearable style="width: 430px" type="textarea"
                            readonly></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="其他情况说明">
                        <el-input v-model="form.otherInformation" clearable style="width: 430px" type="textarea"
                            readonly></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>

        <Attachment ref="AttachmentRefManual" :fId="fId" :uploadButton="false"></Attachment>
    </div>

</template>

<script setup>

import Attachment from '@/components/Attachment.vue'

import {
    ref,
    reactive,
    onMounted,
    onActivated,
    getCurrentInstance,
    nextTick
} from 'vue'
import { Search } from '@element-plus/icons-vue'

const {
    proxy
} = getCurrentInstance()

import style from '@/tools/style'
const cardBodyStyle = ref(style.card)

import {
    useWorkflowStore
} from "@/stores/workflow"


const workflow = useWorkflowStore()

onMounted(() => {
    getTableData()
})

onActivated(() => {
    getTableData()
})

const fId = ref('')
const AttachmentRefManual = ref(null)
const form = ref({
    id: '',
    signReqNm: '',
    signDt: '',
    otherInformation: '',
    estProfit: null,
    ProcessInstanceSts: '',
    benefitNo: '',
    riskPoints: '',
    fundDesc: '',
    benefitName: '',
    contractParty: '',
    subMatter: '',
    contrPrice: null,
    processRemark: '',
    reqDt: '',
    signReqNo: '',
    compCd: '',
    addId: '',
    addCode: '',
    addName: '',
    addDeptId: '',
    addDeptCode: '',
    addDeptName: '',
    addTime: '',
    workModel: {
        flowStatusName: ''
    }
})

const getTableData = () => {
    var url = 'cot/SignRequest/queryByWorkId'
    var param = {
        workId: workflow.workId
    }
    proxy.$axios.get(url, param).then(response => {
        if (response.data.code == '0') {
            form.value = response.data.data
            fId.value = form.value.id
        } else {
            ElMessage.error('操作失败！' + response.data.msg)
        }
    })
}
</script>

<style></style>