parent
d12ca65f2c
commit
d29d649933
|
@ -1,7 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<!-- expand-column-widt 展开按钮宽度-->
|
|
||||||
<!-- :expandRowByClick="true" 点击行展开 -->
|
|
||||||
<TableProMax
|
<TableProMax
|
||||||
:expandedRowRender="expandedRowRender"
|
:expandedRowRender="expandedRowRender"
|
||||||
:expand-column-width="50"
|
:expand-column-width="50"
|
||||||
|
@ -17,9 +15,6 @@
|
||||||
<a-button type="primary" @click="saveOrUpdateEnterprisesUnit">新增企事业单位</a-button>
|
<a-button type="primary" @click="saveOrUpdateEnterprisesUnit">新增企事业单位</a-button>
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
<!-- <template #expandedRowRender="{ record }">
|
|
||||||
<p>{{ record }}</p>
|
|
||||||
</template> -->
|
|
||||||
</TableProMax>
|
</TableProMax>
|
||||||
<a-modal v-model:open="visible" :title="serviceTitle" @ok="submit" @cancel="closeModal">
|
<a-modal v-model:open="visible" :title="serviceTitle" @ok="submit" @cancel="closeModal">
|
||||||
<FormProMax ref="formRef" v-model:value="formParams" :form-item-options="formItemOptions" />
|
<FormProMax ref="formRef" v-model:value="formParams" :form-item-options="formItemOptions" />
|
||||||
|
@ -179,8 +174,6 @@ const saveOrUpdateEnterprisesUnit = (params: _FormType, callback: Function) => {
|
||||||
initMarker(_mapRef.value?.mapInstance)
|
initMarker(_mapRef.value?.mapInstance)
|
||||||
}}
|
}}
|
||||||
onSearch={debounce((val: string) => {
|
onSearch={debounce((val: string) => {
|
||||||
console.log('onSearch___________________', val)
|
|
||||||
|
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
const auto = new AMap.AutoComplete({
|
const auto = new AMap.AutoComplete({
|
||||||
city: city,
|
city: city,
|
||||||
|
@ -188,7 +181,6 @@ const saveOrUpdateEnterprisesUnit = (params: _FormType, callback: Function) => {
|
||||||
citylimit: true,
|
citylimit: true,
|
||||||
})
|
})
|
||||||
auto.search(val, (status, result) => {
|
auto.search(val, (status, result) => {
|
||||||
console.log('🚀 ~ auto.search ~ status, result:', status, result)
|
|
||||||
if (status === 'complete') {
|
if (status === 'complete') {
|
||||||
// 生成组件需要数据
|
// 生成组件需要数据
|
||||||
autoAddress.value = result.tips?.map((e) => {
|
autoAddress.value = result.tips?.map((e) => {
|
||||||
|
@ -480,8 +472,6 @@ const formItemOptions = ref<FormProMaxItemOptions<serviceProjectSaveOrUpdatePara
|
||||||
|
|
||||||
const _tableRef = ref<ComponentExposed<typeof TableProMax>>(null)
|
const _tableRef = ref<ComponentExposed<typeof TableProMax>>(null)
|
||||||
const expandedRowRender: TableProMaxProps['expandedRowRender'] = ({ record }) => {
|
const expandedRowRender: TableProMaxProps['expandedRowRender'] = ({ record }) => {
|
||||||
console.log('🚀 ~ record:', record)
|
|
||||||
|
|
||||||
const _columns: _TableProps['columns'] = [
|
const _columns: _TableProps['columns'] = [
|
||||||
{
|
{
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
|
@ -567,18 +557,12 @@ const expandedRowRender: TableProMaxProps['expandedRowRender'] = ({ record }) =>
|
||||||
return (
|
return (
|
||||||
<a-space>
|
<a-space>
|
||||||
<a-button
|
<a-button
|
||||||
type='primary'
|
class='btn-warn'
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
console.log('🚀 ~ customRender ~ record:编辑回显参数', record)
|
|
||||||
visible.value = true
|
visible.value = true
|
||||||
serviceTitle.value = '编辑服务项目'
|
serviceTitle.value = '编辑服务项目'
|
||||||
idNumberDisabled.value = record.twoType.value !== 'outsource'
|
idNumberDisabled.value = record.twoType.value !== 'outsource'
|
||||||
{
|
|
||||||
/* */
|
|
||||||
}
|
|
||||||
|
|
||||||
formParams.value.securityUnitId = record.securityUnitId //企事业单位id
|
formParams.value.securityUnitId = record.securityUnitId //企事业单位id
|
||||||
|
|
||||||
formParams.value.enterprisesUnitId = record.enterprisesUnitId //企事业单位id
|
formParams.value.enterprisesUnitId = record.enterprisesUnitId //企事业单位id
|
||||||
formParams.value.snowFlakeId = record.snowFlakeId //id
|
formParams.value.snowFlakeId = record.snowFlakeId //id
|
||||||
formParams.value.projectManagerMiniProgramUserId = record.projectManagerMiniProgramUserId //项目经理小程序用户id
|
formParams.value.projectManagerMiniProgramUserId = record.projectManagerMiniProgramUserId //项目经理小程序用户id
|
||||||
|
@ -594,10 +578,6 @@ const expandedRowRender: TableProMaxProps['expandedRowRender'] = ({ record }) =>
|
||||||
formParams.value.houseTotal = record.houseTotal //户数
|
formParams.value.houseTotal = record.houseTotal //户数
|
||||||
formParams.value.staffTotal = record.staffTotal //工作人员数量
|
formParams.value.staffTotal = record.staffTotal //工作人员数量
|
||||||
formParams.value.securityUserTotal = record.securityUserTotal //保安人员数量
|
formParams.value.securityUserTotal = record.securityUserTotal //保安人员数量
|
||||||
|
|
||||||
{
|
|
||||||
/* formParams.value.administrativeDivisionCodes = record.enterprisesUnitAdministrativeDivisionCodes */
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
编辑
|
编辑
|
||||||
|
@ -619,8 +599,7 @@ const expandedRowRender: TableProMaxProps['expandedRowRender'] = ({ record }) =>
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
const _reqApi: _TableProps['requestApi'] = async (params) => {
|
const _reqApi: _TableProps['requestApi'] = async () => {
|
||||||
console.log('🚀 ~ params:', params)
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
return await api.get('/m2/eu/listSp', { enterprisesUnitId: record?.snowFlakeId })
|
return await api.get('/m2/eu/listSp', { enterprisesUnitId: record?.snowFlakeId })
|
||||||
}
|
}
|
||||||
|
@ -635,7 +614,7 @@ const expandedRowRender: TableProMaxProps['expandedRowRender'] = ({ record }) =>
|
||||||
tableHeader: (_) => {
|
tableHeader: (_) => {
|
||||||
return (
|
return (
|
||||||
<Space>
|
<Space>
|
||||||
<Button class='btn-success' onClick={() => addService(record)}>
|
<Button type={'primary'} onClick={() => addService(record)}>
|
||||||
新增服务项目
|
新增服务项目
|
||||||
</Button>
|
</Button>
|
||||||
</Space>
|
</Space>
|
||||||
|
@ -669,12 +648,8 @@ const closeModal = async () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const submit = async () => {
|
const submit = async () => {
|
||||||
console.log('formParams.value____________________', formParams.value)
|
|
||||||
|
|
||||||
await formRef.value.validate()
|
await formRef.value.validate()
|
||||||
|
|
||||||
const serviceProjectSaveOrUpdateParams = { ...formParams.value }
|
const serviceProjectSaveOrUpdateParams = { ...formParams.value }
|
||||||
|
|
||||||
const resp = await api.post('/m2/eu/add_upd_sp', serviceProjectSaveOrUpdateParams)
|
const resp = await api.post('/m2/eu/add_upd_sp', serviceProjectSaveOrUpdateParams)
|
||||||
message.success(resp.message)
|
message.success(resp.message)
|
||||||
await _tableRef.value.requestGetTableData()
|
await _tableRef.value.requestGetTableData()
|
||||||
|
@ -686,7 +661,6 @@ onMounted(async () => {
|
||||||
securityUnitIdList.value = res.data
|
securityUnitIdList.value = res.data
|
||||||
})
|
})
|
||||||
const addService = function (record) {
|
const addService = function (record) {
|
||||||
console.log('🚀 ~ addService ~ record:', record)
|
|
||||||
formParams.value.enterprisesUnitId = record.snowFlakeId //企事业单位Id
|
formParams.value.enterprisesUnitId = record.snowFlakeId //企事业单位Id
|
||||||
visible.value = true
|
visible.value = true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue