基础资料模块优化

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 = [
{
@ -117,7 +117,7 @@
const handleTreeClick = (selectedKeys, event) => {
treeRow = event.node
emit('selectTree', treeRow)
emits('selectTree', treeRow)
}
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"
/>
</a-tab-pane>
<a-tab-pane key="2" tab="上游仓库系统" force-render>
<!-- <DynamicTable :initialData="data" :columns="columns" rowKey="id"></DynamicTable>-->
</a-tab-pane>
</a-tabs>
<user-selector-plus
ref="userSelectorPlusProRef"
@ -93,7 +90,7 @@
secret: [required('请输入AppSecret')]
}
const officialAccountFormItems = [
const officialAccountFormItems = reactive([
{
label: '编码:',
name: 'number',
@ -148,6 +145,22 @@
},
defaultValue: ''
},
{
label: '上游仓库:',
name: 'parentId',
type: 'a-tree-select',
span: 6,
attrs: {
placeholder: '请选择上游仓库',
options: [],
fieldNames: {
children: 'children',
label: 'name',
value: 'id'
}
},
defaultValue: ''
},
{
label: '备注:',
name: 'remarks',
@ -158,7 +171,7 @@
allowClear: true
}
}
]
])
const baseFormItems = [
{
@ -221,6 +234,15 @@
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')

View File

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

View File

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

View File

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

View File

@ -38,7 +38,7 @@
</a-form>
</a-card>
<a-card class="mt-4" :border="false">
<a-card class="mt-4" :border="false" style="height: 100%">
<a-row :gutter="30">
<a-col :span="6">
<s-table
@ -102,7 +102,7 @@
<xn-batch-delete
v-if="hasPerm('customerBatchDelete')"
:selectedRowKeys="selectedRowKeys"
@batchDelete="deleteBatchRecords"
@batchDelete="deleteBatchSysUnit"
/>
</a-space>
</template>
@ -114,8 +114,8 @@
<a-tag color="#87d068" v-if="record.enabledState === 'ENABLE'"></a-tag>
<a-tag color="#f50" v-if="record.enabledState === 'DISABLED'"></a-tag>
</template>
<template v-if="column.dataIndex === 'type'">
{{ $TOOL.dictTypeData('OFFICIAL_ACCOUNT_TYPE', record.type) }}
<template v-if="column.dataIndex === 'isBase'">
{{ $TOOL.dictTypeData('YES_NO', record.isBase) }}
</template>
<template v-if="column.dataIndex === 'action'">
<a-space>
@ -151,7 +151,7 @@
</a-tooltip>
<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')">
<DeleteOutlined />
<!-- 删除-->