产权公司

This commit is contained in:
weicw
2023-06-06 10:26:22 +08:00
parent 2c11634cfa
commit 372843d129
4 changed files with 48 additions and 19 deletions

View File

@@ -52,6 +52,7 @@ export interface Company {
export interface CompanyParam {
companyId?: number;
shortName?: string;
companyTypeMultiple?: string;
companyName?: string;
domain?: string;
keywords?: string;

View File

@@ -4,6 +4,7 @@ export interface TowerFall {
id?: number;
code?: string;
model?: string;
companyId?: number;
factory?: string;
factoryDate?: string;
discardDate?: string;

View File

@@ -40,16 +40,19 @@
<a-form-item label="制造厂家" name="factory">
<a-input
allow-clear
placeholder="factory"
placeholder="请输入制造厂家"
v-model:value="form.factory"
/>
</a-form-item>
<a-form-item label="产权单位" name="company">
<TowerCompany
:placeholder="`请选择产权单位`"
v-model:value="form.company"
:customer-type="`产权单位`"
@done="chooseCompanyName"
<a-form-item label="产权单位" name="companyId">
<a-select
v-model:value="form.companyId"
:options="companyList"
:field-names="{
label: 'companyName',
value: 'companyId',
options: 'children'
}"
/>
</a-form-item>
<a-form-item label="出厂日期" name="factoryDate">
@@ -157,7 +160,7 @@
import { User } from '@/api/user/model';
import { Organization } from '@/api/system/organization/model';
import { Customer } from '@/api/oa/customer/model';
import { Company } from '@/api/system/company/model';
// 是否是修改
const isUpdate = ref(false);
const useForm = Form.useForm;
@@ -170,6 +173,8 @@
visible: boolean;
// 修改回显的数据
data?: TowerFall | null;
companyList: Company[] | null;
}>();
const emit = defineEmits<{
@@ -214,6 +219,7 @@
const form = reactive<TowerFall>({
id: undefined,
code: undefined,
companyId: undefined,
model: undefined,
factory: '',
factoryDate: '',
@@ -238,11 +244,11 @@
// 表单验证规则
const rules = reactive({
name: [
code: [
{
required: true,
type: 'string',
message: '请输入设备',
message: '请输入防坠器编号',
trigger: 'blur'
}
],
@@ -254,11 +260,27 @@
trigger: 'blur'
}
],
factoryNo: [
factory: [
{
required: true,
type: 'string',
message: '请输入出厂编号',
message: '请输入制造厂家',
trigger: 'blur'
}
],
factoryDate: [
{
required: true,
type: 'string',
message: '请输入出厂日期',
trigger: 'blur'
}
],
discardDate: [
{
required: true,
type: 'string',
message: '请输入报废日期',
trigger: 'blur'
}
]
@@ -266,9 +288,6 @@
const { resetFields } = useForm(form, rules);
const onLifeYaer = () => {
form.surplusYear = form.lifeYear;
};
// const onFactoryDate = () => {
// form.scrapDate = form.factoryDate;
// };

View File

@@ -54,7 +54,7 @@
</a-card>
</div>
<!-- 编辑弹窗 -->
<FallEdit v-model:visible="showEdit" :data="current" @done="reload" />
<FallEdit v-model:visible="showEdit" :company-list="companys" :data="current" @done="reload" />
</div>
</template>
@@ -76,6 +76,9 @@
updateBatchTowerFall
} from '@/api/tower/fall';
import { TowerFall, TowerFallParam } from '@/api/tower/fall/model';
import { pageCompany } from '@/api/system/company';
import { Customer } from '@/api/oa/customer/model';
import { Company } from '@/api/system/company/model';
defineProps<{
activeKey?: boolean;
@@ -118,8 +121,8 @@
},
{
title: '产权单位',
dataIndex: 'company',
key: 'company'
dataIndex: 'companyName',
key: 'companyName'
},
{
title: '出厂日期',
@@ -154,7 +157,12 @@
const current = ref<TowerFall | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
const companys = ref<Company[] | undefined>();
pageCompany({
companyTypeMultiple: '产权单位'
}).then((res) => {
companys.value = res?.list;
});
// 表格数据源
const datasource: DatasourceFunction = ({
page,