This commit is contained in:
ljx
2025-08-29 10:36:51 +08:00
28 changed files with 2299 additions and 780 deletions

View File

@ -81,6 +81,11 @@
<el-form-item label="公司名称" prop="name">
<el-input v-model="form.name" placeholder="请输入公司名称" />
</el-form-item>
<el-form-item label="供应商" prop="supplier">
<el-select v-model="form.supplierId" value-key="id" placeholder="请选择供应商" clearable filterable @change="">
<el-option v-for="item in supplierOptions" :key="item.id" :label="item.supplierName" :value="item.id"> </el-option>
</el-select>
</el-form-item>
<el-form-item label="负责人" prop="principal">
<el-input v-model="form.principal" placeholder="请输入负责人" />
</el-form-item>
@ -121,6 +126,7 @@ import { ContractorForm, ContractorQuery, ContractorVO } from '@/api/project/con
import ContractorFileDialog from '@/views/project/contractor/component/ContractorFileDialog.vue';
import { useUserStoreHook } from '@/store/modules/user';
import { getDicts, listData } from '@/api/system/dict/data';
import { listSupplierInput } from '@/api/supplierInput/supplierInput';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@ -152,6 +158,8 @@ const initFormData: ContractorForm = {
principalPhone: undefined,
custodian: undefined,
custodianPhone: undefined,
supplierId: undefined,
supplier: undefined,
contractorType: undefined,
fileMap: undefined,
remark: undefined,
@ -257,6 +265,8 @@ const submitForm = () => {
if (valid) {
form.value.projectId = currentProject.value?.id;
buttonLoading.value = true;
form.value.supplier = supplierOptions.value.find((item) => item.id == form.value.supplierId)?.supplierName;
if (form.value.id) {
await updateContractor(form.value).finally(() => (buttonLoading.value = false));
} else {
@ -278,15 +288,16 @@ const handleDelete = async (row?: ContractorVO) => {
await getList();
};
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download(
'project/contractor/export',
{
...queryParams.value
},
`contractor_${new Date().getTime()}.xlsx`
);
/** 获取供应商 */
const supplierOptions = ref([]);
const getSupplierList = async () => {
const res = await listSupplierInput({
projectId: currentProject.value?.id,
pageNum: 1,
state: 'finish',
pageSize: 10000
});
supplierOptions.value = res.rows;
};
/** 文件操作 **/
@ -304,6 +315,7 @@ const listeningProject = watch(
queryParams.value.projectId = nid;
form.value.projectId = nid;
console.log('监听项目id', queryParams.value.projectId, form.value.projectId);
getSupplierList();
getList();
}
);
@ -314,5 +326,6 @@ onUnmounted(() => {
onMounted(() => {
getDictList();
getList();
getSupplierList();
});
</script>

View File

@ -1,8 +1,37 @@
<template>
<div class="p-2">
<div class="p-2 detailbox">
<div class="box1">
<div>
<div>
<span>设计面积</span>
<span>{{ detailInfo.designArea }} </span>
</div>
<el-icon :size="50" color="#3176ff">
<Postcard />
</el-icon>
</div>
<div>
<div>
<span>已流转面积</span>
<span>{{ detailInfo.transferAea }} </span>
</div>
<el-icon :size="50" color="#3176ff">
<Postcard />
</el-icon>
</div>
<div>
<div>
<span>租金</span>
<span>{{ detailInfo.landRent / 1000 }} 万元</span>
</div>
<el-icon :size="50" color="#3176ff">
<Postcard />
</el-icon>
</div>
</div>
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-card shadow="never">
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="110px">
<el-form-item label="对应地块" prop="landBlockId">
<el-select v-model="queryParams.landBlockId" clearable placeholder="请选择对应地块">
@ -33,21 +62,6 @@
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['land:landTransferLedger:add']">新增</el-button>
</el-col>
<el-col :span="6"></el-col>
<el-col :span="1.5">
<el-tag size="large" type="primary"
><span style="font-size: 20px">设计面积{{ detailInfo.designArea }} </span></el-tag
>
</el-col>
<el-col :span="1.5">
<el-tag size="large" type="success"
><span style="font-size: 20px">已流转面积{{ detailInfo.transferAea }} </span></el-tag
>
</el-col>
<el-col :span="1.5">
<el-tag size="large" type="warning"
><span style="font-size: 20px">租金{{ detailInfo.landRent / 1000 }} 万元</span></el-tag
>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</template>
@ -562,3 +576,36 @@ onMounted(() => {
Promise.all([getLandBlockList(), getListLand(), getList()]);
});
</script>
<style lang="scss">
.detailbox {
width: 100%;
.box1 {
width: 100%;
display: flex;
justify-content: center;
margin: 20px 0;
> div {
width: 300px;
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px 15px;
border: 1px solid #e7e7e7;
margin: 0 20px;
border-radius: 6px;
> div {
display: flex;
flex-direction: column;
> span:first-child {
font-size: 16px;
margin-bottom: 10px;
}
> span:last-child {
font-size: 24px;
/* font-weight: bold; */
}
}
}
}
}
</style>