This commit is contained in:
parent
a62d5530b9
commit
ec2f257a87
@ -7,7 +7,7 @@ VITE_COMPRESS=gzip
|
||||
VITE_PWA=false
|
||||
|
||||
# vue-router 的模式
|
||||
VITE_ROUTER_HISTORY=history
|
||||
VITE_ROUTER_HISTORY=hash
|
||||
|
||||
# 是否注入全局loading
|
||||
VITE_INJECT_APP_LOADING=true
|
||||
|
@ -10,7 +10,7 @@ VITE_COMPRESS=gzip
|
||||
VITE_PWA=false
|
||||
|
||||
# vue-router 的模式
|
||||
VITE_ROUTER_HISTORY=history
|
||||
VITE_ROUTER_HISTORY=hash
|
||||
|
||||
# 是否注入全局loading
|
||||
VITE_INJECT_APP_LOADING=true
|
||||
|
@ -15,6 +15,10 @@ export function assetTypeList(params?: AssetTypeQuery) {
|
||||
return requestClient.get<PageResult<AssetTypeVO>>('/property/assetType/list', { params });
|
||||
}
|
||||
|
||||
export function assetTypeselect() {
|
||||
return requestClient.get<AssetTypeVO[]>('/property/assetType/list');
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出资产类型列表
|
||||
* @param params
|
||||
|
@ -5,11 +5,16 @@ import { useVbenModal } from '@vben/common-ui';
|
||||
import { $t } from '@vben/locales';
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { type FormSchemaGetter, useVbenForm } from "#/adapter/form";
|
||||
import { applicationAdd, applicationInfo, applicationUpdate } from '#/api/property/assetManage/application';
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
|
||||
import { modalSchema } from './data';
|
||||
import { assetTypeselect } from "#/api/property/assetType";
|
||||
import { depotList } from "#/api/property/assetManage/depot";
|
||||
import { suppliersList } from "#/api/property/assetManage/suppliers";
|
||||
import { assetList } from "#/api/property/assetManage/asset";
|
||||
import { userList } from "#/api/system/user";
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
@ -41,6 +46,103 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
},
|
||||
);
|
||||
|
||||
formApi.getValues().then(setupPackageSelect);
|
||||
|
||||
async function upSelectUser(nickName: string){
|
||||
const list=await userList({
|
||||
nickName:nickName,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
const options=list.map(item=>{
|
||||
item.label=item.userName;
|
||||
item.value=item.id;
|
||||
})
|
||||
fromApi.updateSchema([
|
||||
{
|
||||
componentProps: {
|
||||
optionFilterProp: 'label',
|
||||
optionLabelProp: 'label',
|
||||
options,
|
||||
showSearch: true,
|
||||
},
|
||||
fieldName: 'userId',
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
||||
async function upSelectAssets(assetsName: string){
|
||||
const list=await assetList({
|
||||
assetsName:assetsName,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
const options=list.map(item=>{
|
||||
item.label=item.assetsName;
|
||||
item.value=item.id;
|
||||
})
|
||||
fromApi.updateSchema([
|
||||
{
|
||||
componentProps: {
|
||||
optionFilterProp: 'label',
|
||||
optionLabelProp: 'label',
|
||||
options,
|
||||
showSearch: true,
|
||||
},
|
||||
fieldName: 'assetsId',
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
||||
async function setupPackageSelect() {
|
||||
const users = await userList({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
const assets = await assetList({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
const options = users.rows.map((item) => ({
|
||||
label: item.nickName,
|
||||
value: item.userId,
|
||||
}));
|
||||
const assetOptions = assets.rows.map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
formApi.updateSchema([
|
||||
{
|
||||
componentProps: {
|
||||
optionFilterProp: 'label',
|
||||
optionLabelProp: 'label',
|
||||
options,
|
||||
showSearch: true,
|
||||
},
|
||||
async select(userId) {
|
||||
await upSelectUser(userId);
|
||||
userId=""
|
||||
},
|
||||
fieldName: 'userId',
|
||||
},
|
||||
{
|
||||
componentProps: {
|
||||
optionFilterProp: 'label',
|
||||
optionLabelProp: 'label',
|
||||
options: assetOptions,
|
||||
showSearch: true,
|
||||
},
|
||||
async select(assetsId) {
|
||||
await upSelectAssets(assetsId);
|
||||
assetsId=""
|
||||
},
|
||||
fieldName: 'assetId',
|
||||
},
|
||||
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
// 在这里更改宽度
|
||||
class: 'w-[550px]',
|
||||
@ -62,7 +164,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized();
|
||||
|
||||
await setupPackageSelect();
|
||||
modalApi.modalLoading(false);
|
||||
},
|
||||
});
|
||||
|
@ -112,46 +112,46 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '资产id',
|
||||
fieldName: 'assetId',
|
||||
component: 'Input',
|
||||
component: 'Select',
|
||||
},
|
||||
{
|
||||
label: '领用人id',
|
||||
fieldName: 'userId',
|
||||
component: 'Input',
|
||||
component: 'Select',
|
||||
},
|
||||
{
|
||||
label: '数量',
|
||||
fieldName: 'number',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
fieldName: 'state',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '审批人id',
|
||||
fieldName: 'acceptanceUserId',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '审批时间',
|
||||
fieldName: 'acceptanceTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '申请时间',
|
||||
fieldName: 'applicationTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
},
|
||||
// {
|
||||
// label: '状态',
|
||||
// fieldName: 'state',
|
||||
// component: 'Input',
|
||||
// },
|
||||
// {
|
||||
// label: '审批人id',
|
||||
// fieldName: 'acceptanceUserId',
|
||||
// component: 'Input',
|
||||
// },
|
||||
// {
|
||||
// label: '审批时间',
|
||||
// fieldName: 'acceptanceTime',
|
||||
// component: 'DatePicker',
|
||||
// componentProps: {
|
||||
// showTime: true,
|
||||
// format: 'YYYY-MM-DD HH:mm:ss',
|
||||
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// label: '申请时间',
|
||||
// fieldName: 'applicationTime',
|
||||
// component: 'DatePicker',
|
||||
// componentProps: {
|
||||
// showTime: true,
|
||||
// format: 'YYYY-MM-DD HH:mm:ss',
|
||||
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
// },
|
||||
// },
|
||||
];
|
||||
|
@ -10,6 +10,10 @@ import { assetAdd, assetInfo, assetUpdate } from '#/api/property/assetManage/ass
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
|
||||
import { modalSchema } from './data';
|
||||
import { packageSelectList } from "#/api/system/tenant-package";
|
||||
import { assetTypeselect } from "#/api/property/assetType";
|
||||
import { depotList } from "#/api/property/assetManage/depot";
|
||||
import { suppliersList } from "#/api/property/assetManage/suppliers";
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
@ -41,6 +45,55 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
},
|
||||
);
|
||||
|
||||
async function setupPackageSelect() {
|
||||
const tenantPackageList = await assetTypeselect();
|
||||
const depot = await depotList();
|
||||
const suppliers =await suppliersList();
|
||||
const options = tenantPackageList.rows.map((item) => ({
|
||||
label: item.assetTypeName,
|
||||
value: item.id,
|
||||
}));
|
||||
const depotoptions = depot.rows.map((item) => ({
|
||||
label: item.depotName,
|
||||
value: item.id,
|
||||
}));
|
||||
const supplieroptions = suppliers.rows.map((item) => ({
|
||||
label: item.suppliersName,
|
||||
value: item.id,
|
||||
}));
|
||||
|
||||
formApi.updateSchema([
|
||||
{
|
||||
componentProps: {
|
||||
optionFilterProp: 'label',
|
||||
optionLabelProp: 'label',
|
||||
options,
|
||||
showSearch: true,
|
||||
},
|
||||
fieldName: 'model',
|
||||
},
|
||||
{
|
||||
componentProps: {
|
||||
optionFilterProp: 'label',
|
||||
optionLabelProp: 'label',
|
||||
options: depotoptions,
|
||||
showSearch: true,
|
||||
},
|
||||
fieldName: 'depotId',
|
||||
},
|
||||
{
|
||||
componentProps: {
|
||||
optionFilterProp: 'label',
|
||||
optionLabelProp: 'label',
|
||||
options: supplieroptions,
|
||||
showSearch: true,
|
||||
},
|
||||
fieldName: 'suppliersId',
|
||||
},
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
// 在这里更改宽度
|
||||
class: 'w-[550px]',
|
||||
@ -52,6 +105,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
if (!isOpen) {
|
||||
return null;
|
||||
}
|
||||
|
||||
modalApi.modalLoading(true);
|
||||
|
||||
const { id } = modalApi.getData() as { id?: number | string };
|
||||
@ -62,7 +116,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized();
|
||||
|
||||
await setupPackageSelect();
|
||||
modalApi.modalLoading(false);
|
||||
},
|
||||
});
|
||||
|
@ -1,6 +1,9 @@
|
||||
import type {FormSchemaGetter} from '#/adapter/form';
|
||||
import type {VxeGridProps} from '#/adapter/vxe-table';
|
||||
import {getDictOptions} from "#/utils/dict";
|
||||
import { renderDict } from "#/utils/render";
|
||||
import { DictEnum } from '@vben/constants';
|
||||
|
||||
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
@ -44,7 +47,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
},
|
||||
{
|
||||
title: '资产类型',
|
||||
field: 'model',
|
||||
field: 'modelName',
|
||||
},
|
||||
{
|
||||
title: '规格',
|
||||
@ -63,16 +66,16 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'unit',
|
||||
},
|
||||
{
|
||||
title: '仓库id',
|
||||
field: 'depotId',
|
||||
title: '仓库',
|
||||
field: 'depotName',
|
||||
},
|
||||
{
|
||||
title: '描述信息',
|
||||
field: 'msg',
|
||||
},
|
||||
{
|
||||
title: '供应商id',
|
||||
field: 'suppliersId',
|
||||
title: '供应商',
|
||||
field: 'suppliersName',
|
||||
},
|
||||
{
|
||||
title: '入库时间',
|
||||
@ -81,6 +84,11 @@ export const columns: VxeGridProps['columns'] = [
|
||||
{
|
||||
title: '固定资产',
|
||||
field: 'type',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return renderDict(row.type, DictEnum.WY_SF);
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
@ -113,7 +121,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '类型',
|
||||
fieldName: 'model',
|
||||
component: 'Textarea',
|
||||
component: 'Select',
|
||||
},
|
||||
{
|
||||
label: '规格',
|
||||
@ -136,9 +144,9 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '仓库id',
|
||||
label: '仓库',
|
||||
fieldName: 'depotId',
|
||||
component: 'Input',
|
||||
component: 'Select',
|
||||
},
|
||||
{
|
||||
label: '描述信息',
|
||||
@ -148,7 +156,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '供应商id',
|
||||
fieldName: 'suppliersId',
|
||||
component: 'Input',
|
||||
component: 'Select',
|
||||
},
|
||||
{
|
||||
label: '入库时间',
|
||||
@ -164,6 +172,8 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
label: '固定资产类型',
|
||||
fieldName: 'type',
|
||||
component: 'Select',
|
||||
componentProps: {},
|
||||
componentProps: {
|
||||
options: getDictOptions('wy_sf'),
|
||||
},
|
||||
},
|
||||
];
|
||||
|
@ -1,18 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import type { Recordable } from '@vben/types';
|
||||
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||
import { getVxePopupContainer } from '@vben/utils';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
import {
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
vxeCheckboxChecked,
|
||||
type VxeGridProps
|
||||
type VxeGridProps
|
||||
} from '#/adapter/vxe-table';
|
||||
|
||||
import {
|
||||
@ -138,8 +131,8 @@ function handleDownloadExcel() {
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['property:floor:remove']"
|
||||
type="primary"
|
||||
v-access:code="['property:floor:remove']"
|
||||
@click="handleMultiDelete">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
|
@ -27,7 +27,8 @@ export default defineConfig(async () => {
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api/, ''),
|
||||
// mock代理目标地址
|
||||
target: 'http://47.109.37.87:3010/',
|
||||
// target: 'http://by.missmoc.top:3010/',
|
||||
target: 'http://127.0.0.1:8080/',
|
||||
ws: true,
|
||||
},
|
||||
},
|
||||
|
@ -13,6 +13,7 @@ export const DictEnum = {
|
||||
WF_BUSINESS_STATUS: 'wf_business_status', // 业务状态
|
||||
WF_FORM_TYPE: 'wf_form_type', // 表单类型
|
||||
WF_TASK_STATUS: 'wf_task_status', // 任务状态
|
||||
WY_SF: 'wy_sf',
|
||||
} as const;
|
||||
|
||||
export type DictEnumKey = keyof typeof DictEnum;
|
||||
|
Loading…
Reference in New Issue
Block a user