mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-16 20:15:06 +08:00
添加PMS中预算管理、应收款管理的前端页面及sql语句部分;添加CMS中,外包合同部分,后端代码,前端代码及sql语句
This commit is contained in:
@ -0,0 +1,43 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
export interface ReceivablesVO {
|
||||
id: number
|
||||
projectId: number
|
||||
contractId: number
|
||||
planStage: string
|
||||
initialDesignStage: string
|
||||
constructionDrawingStage: string
|
||||
constructionStage: string
|
||||
approveStage: string
|
||||
collectionSituation: string
|
||||
}
|
||||
|
||||
// 查询应收款管理列表
|
||||
export const getReceivablesPage = async (params) => {
|
||||
return await request.get({ url: '/pms/receivables/page', params })
|
||||
}
|
||||
|
||||
// 查询应收款管理详情
|
||||
export const getReceivables = async (id: number) => {
|
||||
return await request.get({ url: '/pms/receivables/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增应收款管理
|
||||
export const createReceivables = async (data: ReceivablesVO) => {
|
||||
return await request.post({ url: '/pms/receivables/create', data })
|
||||
}
|
||||
|
||||
// 修改应收款管理
|
||||
export const updateReceivables = async (data: ReceivablesVO) => {
|
||||
return await request.put({ url: '/pms/receivables/update', data })
|
||||
}
|
||||
|
||||
// 删除应收款管理
|
||||
export const deleteReceivables = async (id: number) => {
|
||||
return await request.delete({ url: '/pms/receivables/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 导出应收款管理 Excel
|
||||
export const exportReceivablesApi = async (params) => {
|
||||
return await request.download({ url: '/pms/receivables/export-excel', params })
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||
<Form ref="formRef" :schema="allSchemas.formSchema" :rules="rules" v-loading="formLoading" />
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import * as ReceivablesApi from '@/api/pms/receivables'
|
||||
import { rules, allSchemas } from './receivables.data'
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = t('action.' + type)
|
||||
formType.value = type
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = await ReceivablesApi.getReceivables(id)
|
||||
formRef.value.setValues(data)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
if (!formRef) return
|
||||
const valid = await formRef.value.getElFormRef().validate()
|
||||
if (!valid) return
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formRef.value.formModel as ReceivablesApi.ReceivablesVO
|
||||
if (formType.value === 'create') {
|
||||
await ReceivablesApi.createReceivables(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await ReceivablesApi.updateReceivables(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,85 @@
|
||||
<template>
|
||||
<!-- 搜索工作栏 -->
|
||||
<ContentWrap>
|
||||
<Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams">
|
||||
<!-- 新增等操作按钮 -->
|
||||
<template #actionMore>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="openForm('create')"
|
||||
v-hasPermi="['pms:receivables:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
</template>
|
||||
</Search>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<Table
|
||||
:columns="allSchemas.tableColumns"
|
||||
:data="tableObject.tableList"
|
||||
:loading="tableObject.loading"
|
||||
:pagination="{
|
||||
total: tableObject.total
|
||||
}"
|
||||
v-model:pageSize="tableObject.pageSize"
|
||||
v-model:currentPage="tableObject.currentPage"
|
||||
>
|
||||
<template #action="{ row }">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openForm('update', row.id)"
|
||||
v-hasPermi="['pms:receivables:update']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
v-hasPermi="['pms:receivables:delete']"
|
||||
@click="handleDelete(row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</Table>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<ReceivablesForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
<script setup lang="ts" name="Receivables">
|
||||
import { allSchemas } from './receivables.data'
|
||||
import * as ReceivablesApi from '@/api/pms/receivables'
|
||||
import ReceivablesForm from './ReceivablesForm.vue'
|
||||
|
||||
// tableObject:表格的属性对象,可获得分页大小、条数等属性
|
||||
// tableMethods:表格的操作对象,可进行获得分页、删除记录等操作
|
||||
// 详细可见:https://doc.iocoder.cn/vue3/crud-schema/
|
||||
const { tableObject, tableMethods } = useTable({
|
||||
getListApi: ReceivablesApi.getReceivablesPage, // 分页接口
|
||||
delListApi: ReceivablesApi.deleteReceivables // 删除接口
|
||||
})
|
||||
// 获得表格的各种操作
|
||||
const { getList, setSearchParams } = tableMethods
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = (id: number) => {
|
||||
tableMethods.delList(id, false)
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
@ -0,0 +1,85 @@
|
||||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
|
||||
// 表单校验
|
||||
export const rules = reactive({
|
||||
projectId: [required],
|
||||
})
|
||||
|
||||
// CrudSchema https://doc.iocoder.cn/vue3/crud-schema/
|
||||
const crudSchemas = reactive<CrudSchema[]>([
|
||||
{
|
||||
label: '主键',
|
||||
field: 'id',
|
||||
isForm: false,
|
||||
},
|
||||
{
|
||||
label: '项目id',
|
||||
field: 'projectId',
|
||||
isSearch: true,
|
||||
form: {
|
||||
component: 'InputNumber',
|
||||
value: 0
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '主合同id ',
|
||||
field: 'contractId',
|
||||
isSearch: true,
|
||||
form: {
|
||||
component: 'InputNumber',
|
||||
value: 0
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '方案阶段比例',
|
||||
field: 'planStage',
|
||||
isSearch: true,
|
||||
},
|
||||
{
|
||||
label: '初设阶段比例',
|
||||
field: 'initialDesignStage',
|
||||
isSearch: true,
|
||||
},
|
||||
{
|
||||
label: '施工图阶段比例',
|
||||
field: 'constructionDrawingStage',
|
||||
isSearch: true,
|
||||
},
|
||||
{
|
||||
label: '施工配合阶段',
|
||||
field: 'constructionStage',
|
||||
isSearch: true,
|
||||
},
|
||||
{
|
||||
label: '审定阶段',
|
||||
field: 'approveStage',
|
||||
isSearch: true,
|
||||
},
|
||||
{
|
||||
label: '回款情况',
|
||||
field: 'collectionSituation',
|
||||
isSearch: true,
|
||||
},
|
||||
{
|
||||
label: '创建时间',
|
||||
field: 'createTime',
|
||||
formatter: dateFormatter,
|
||||
isSearch: true,
|
||||
search: {
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
type: 'daterange',
|
||||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
|
||||
}
|
||||
},
|
||||
isForm: false,
|
||||
},
|
||||
{
|
||||
label: '操作',
|
||||
field: 'action',
|
||||
isForm: false
|
||||
}
|
||||
])
|
||||
export const { allSchemas } = useCrudSchemas(crudSchemas)
|
Reference in New Issue
Block a user