基础资料模块优化

main
GaoF 2024-07-31 09:07:21 +08:00
parent 1a68eb4423
commit 36d9d228e6
7 changed files with 111 additions and 15 deletions

View File

@ -84,7 +84,7 @@
} }
}) })
const emit = defineEmits('selectTree', 'delTree') const emits = defineEmits('selectTree', 'delTree')
const tool = [ const tool = [
{ {
@ -117,7 +117,7 @@
const handleTreeClick = (selectedKeys, event) => { const handleTreeClick = (selectedKeys, event) => {
treeRow = event.node treeRow = event.node
emit('selectTree', treeRow) emits('selectTree', treeRow)
} }
const handleAddTree = () => { const handleAddTree = () => {

View File

@ -0,0 +1,70 @@
<template>
<a-row :gutter="16">
<a-col :span="colSpan">
<a-form-item label="创建人:">
<a-input disabled v-model:value="detailDataProps.createUserName" placeholder="请输入创建人" allow-clear />
</a-form-item>
</a-col>
<a-col :span="colSpan">
<a-form-item label="创建时间:">
<a-input disabled v-model:value="detailDataProps.createTime" placeholder="请输入创建人" allow-clear />
</a-form-item>
</a-col>
<a-col :span="colSpan">
<a-form-item label="修改人:">
<a-input disabled v-model:value="detailDataProps.updateUserName" placeholder="请输入创建人" allow-clear />
</a-form-item>
</a-col>
<a-col :span="colSpan">
<a-form-item label="修改人:">
<a-input disabled v-model:value="detailDataProps.updateTime" placeholder="请输入创建人" allow-clear />
</a-form-item>
</a-col>
</a-row>
</template>
<script setup>
const props = defineProps({
detailData: {
type: Object,
default: () => {
return {}
}
},
colSpan: {
type: Number,
default: 24
}
})
const detailDataProps = ref({})
// const emit = defineEmits()
//
onMounted(() => {
console.log('Component mounted')
// TODO: Add your onMounted code here
})
onUpdated(() => {
console.log('Component updated')
// TODO: Add your onUpdated code here
})
onUnmounted(() => {
console.log('Component unmounted')
// TODO: Add your onUnmounted code here
})
watch(
() => props.detailData,
() => {
detailDataProps.value = props.detailData
},
{
immediate: true
}
)
</script>
<style scoped></style>

View File

@ -26,9 +26,6 @@
ref="formRef2" ref="formRef2"
/> />
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="2" tab="上游仓库系统" force-render>
<!-- <DynamicTable :initialData="data" :columns="columns" rowKey="id"></DynamicTable>-->
</a-tab-pane>
</a-tabs> </a-tabs>
<user-selector-plus <user-selector-plus
ref="userSelectorPlusProRef" ref="userSelectorPlusProRef"
@ -93,7 +90,7 @@
secret: [required('请输入AppSecret')] secret: [required('请输入AppSecret')]
} }
const officialAccountFormItems = [ const officialAccountFormItems = reactive([
{ {
label: '编码:', label: '编码:',
name: 'number', name: 'number',
@ -148,6 +145,22 @@
}, },
defaultValue: '' defaultValue: ''
}, },
{
label: '上游仓库:',
name: 'parentId',
type: 'a-tree-select',
span: 6,
attrs: {
placeholder: '请选择上游仓库',
options: [],
fieldNames: {
children: 'children',
label: 'name',
value: 'id'
}
},
defaultValue: ''
},
{ {
label: '备注:', label: '备注:',
name: 'remarks', name: 'remarks',
@ -158,7 +171,7 @@
allowClear: true allowClear: true
} }
} }
] ])
const baseFormItems = [ const baseFormItems = [
{ {
@ -221,6 +234,15 @@
formData.manageUserId = res.manageUserId formData.manageUserId = res.manageUserId
} }
}) })
const sysStoreTreeList = await sysStoreApi.sysStoreTree()
if (Array.isArray(sysStoreTreeList)) {
officialAccountFormItems.forEach((item) => {
if (item.name === 'parentId') {
item.attrs.options = sysStoreTreeList
}
})
}
}) })
let activeKey = ref('1') let activeKey = ref('1')

View File

@ -95,6 +95,8 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
<OperationalInformation :detailData="detailData" v-if="pageType !== 'ADD'"></OperationalInformation>
</a-form> </a-form>
<template #footer> <template #footer>
<a-button style="margin-right: 8px" @click="onClose"></a-button> <a-button style="margin-right: 8px" @click="onClose"></a-button>
@ -119,6 +121,7 @@
enabledState: 'ENABLE' enabledState: 'ENABLE'
} }
const formData = ref({}) const formData = ref({})
const detailData = ref({})
const submitLoading = ref(false) const submitLoading = ref(false)
const typeOptions = ref([]) const typeOptions = ref([])
const enabledStateOptions = ref([]) const enabledStateOptions = ref([])
@ -131,6 +134,7 @@
pageType.value = record.pageType pageType.value = record.pageType
let recordData = cloneDeep(record) let recordData = cloneDeep(record)
formData.value = Object.assign({}, recordData) formData.value = Object.assign({}, recordData)
detailData.value = Object.assign({}, recordData)
} else { } else {
pageType.value = 'ADD' pageType.value = 'ADD'
formData.value = formData_enum formData.value = formData_enum

View File

@ -54,7 +54,7 @@
getTree: productionOrganizationApi.productionOrganizationTree, getTree: productionOrganizationApi.productionOrganizationTree,
delTree: productionOrganizationApi.productionOrganizationDelete delTree: productionOrganizationApi.productionOrganizationDelete
}" }"
@selectTree="selectTree" @selectTree="onSelectTree"
@delTree="delTree" @delTree="delTree"
:toolConfig="{ :toolConfig="{
plus: false, plus: false,
@ -212,7 +212,7 @@
const TissueFormRef = ref(null) const TissueFormRef = ref(null)
const dynamicTreeRef = ref(null) const dynamicTreeRef = ref(null)
const selectTree = (value) => { const onSelectTree = (value) => {
searchFormState.value.parentId = value.id searchFormState.value.parentId = value.id
tableRef.value.refresh() tableRef.value.refresh()
} }

View File

@ -30,7 +30,7 @@ export const unitColumns = [
{ {
title: '是否基本单位', title: '是否基本单位',
dataIndex: 'isBase', dataIndex: 'isBase',
width: 80, width: 200,
resizable: true, resizable: true,
align: 'center' align: 'center'
} }

View File

@ -38,7 +38,7 @@
</a-form> </a-form>
</a-card> </a-card>
<a-card class="mt-4" :border="false"> <a-card class="mt-4" :border="false" style="height: 100%">
<a-row :gutter="30"> <a-row :gutter="30">
<a-col :span="6"> <a-col :span="6">
<s-table <s-table
@ -102,7 +102,7 @@
<xn-batch-delete <xn-batch-delete
v-if="hasPerm('customerBatchDelete')" v-if="hasPerm('customerBatchDelete')"
:selectedRowKeys="selectedRowKeys" :selectedRowKeys="selectedRowKeys"
@batchDelete="deleteBatchRecords" @batchDelete="deleteBatchSysUnit"
/> />
</a-space> </a-space>
</template> </template>
@ -114,8 +114,8 @@
<a-tag color="#87d068" v-if="record.enabledState === 'ENABLE'"></a-tag> <a-tag color="#87d068" v-if="record.enabledState === 'ENABLE'"></a-tag>
<a-tag color="#f50" v-if="record.enabledState === 'DISABLED'"></a-tag> <a-tag color="#f50" v-if="record.enabledState === 'DISABLED'"></a-tag>
</template> </template>
<template v-if="column.dataIndex === 'type'"> <template v-if="column.dataIndex === 'isBase'">
{{ $TOOL.dictTypeData('OFFICIAL_ACCOUNT_TYPE', record.type) }} {{ $TOOL.dictTypeData('YES_NO', record.isBase) }}
</template> </template>
<template v-if="column.dataIndex === 'action'"> <template v-if="column.dataIndex === 'action'">
<a-space> <a-space>
@ -151,7 +151,7 @@
</a-tooltip> </a-tooltip>
<a-divider type="vertical" v-if="hasPerm(['customerEdit', 'customerDelete'], 'and')" /> <a-divider type="vertical" v-if="hasPerm(['customerEdit', 'customerDelete'], 'and')" />
<a-popconfirm title="确定要删除吗?" @confirm="deleteRecord(record)"> <a-popconfirm title="确定要删除吗?" @confirm="deleteSysUnit(record)">
<a-button type="link" danger size="small" v-if="hasPerm('customerDelete')"> <a-button type="link" danger size="small" v-if="hasPerm('customerDelete')">
<DeleteOutlined /> <DeleteOutlined />
<!-- 删除--> <!-- 删除-->