Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
This commit is contained in:
@@ -59,7 +59,7 @@ export interface AssetVO {
|
|||||||
/**
|
/**
|
||||||
* 固定资产类型
|
* 固定资产类型
|
||||||
*/
|
*/
|
||||||
type: number;
|
type: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
|
@@ -61,9 +61,9 @@ export function floorRemove(id: ID | IDS) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据单元ID查询楼层
|
* 根据楼层ID查询楼层
|
||||||
* @param id id
|
* @param id id
|
||||||
*/
|
*/
|
||||||
export function queryByUnitId(id: ID | IDS) {
|
export function queryByBuildingId(id: ID | IDS) {
|
||||||
return requestClient.get<FloorVO[]>(`/property/floor/queryByUnitId/${id}`);
|
return requestClient.get<FloorVO[]>(`/property/floor/queryByBuildingId/${id}`);
|
||||||
}
|
}
|
||||||
|
@@ -96,6 +96,22 @@ export interface ElevatorInfoVO {
|
|||||||
*/
|
*/
|
||||||
controlPwd: string
|
controlPwd: string
|
||||||
|
|
||||||
|
elevatorControlDeviceId: {
|
||||||
|
value: number,
|
||||||
|
deviceIp: string,
|
||||||
|
deviceId: number,
|
||||||
|
}
|
||||||
|
|
||||||
|
remoteCallElevatorDeviceId: {
|
||||||
|
value: number,
|
||||||
|
deviceIp: string,
|
||||||
|
deviceId: number,
|
||||||
|
}[]
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 建筑ID
|
||||||
|
*/
|
||||||
|
buildingId?: number | string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ElevatorInfoForm extends BaseEntity {
|
export interface ElevatorInfoForm extends BaseEntity {
|
||||||
@@ -195,10 +211,9 @@ export interface ElevatorInfoForm extends BaseEntity {
|
|||||||
controlPwd?: string
|
controlPwd?: string
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单元ID
|
* 建筑ID
|
||||||
*/
|
*/
|
||||||
unitId?: number
|
buildingId?: number
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ElevatorInfoQuery extends PageQuery {
|
export interface ElevatorInfoQuery extends PageQuery {
|
||||||
|
@@ -1,20 +1,25 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref } from 'vue';
|
import {computed, ref} from 'vue';
|
||||||
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import {useVbenModal} from '@vben/common-ui';
|
||||||
import { $t } from '@vben/locales';
|
import {$t} from '@vben/locales';
|
||||||
import { cloneDeep } from '@vben/utils';
|
import {cloneDeep} from '@vben/utils';
|
||||||
|
|
||||||
import { type FormSchemaGetter, useVbenForm } from "#/adapter/form";
|
import {type FormSchemaGetter, useVbenForm} from "#/adapter/form";
|
||||||
import { applicationAdd, applicationInfo, applicationUpdate } from '#/api/property/assetManage/application';
|
import {
|
||||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
applicationAdd,
|
||||||
|
applicationInfo,
|
||||||
|
applicationUpdate
|
||||||
|
} from '#/api/property/assetManage/application';
|
||||||
|
import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
|
||||||
|
|
||||||
import { modalSchema } from './data';
|
import {modalSchema} from './data';
|
||||||
import { assetTypeselect } from "#/api/property/assetType";
|
import {assetTypeselect} from "#/api/property/assetType";
|
||||||
import { depotList } from "#/api/property/assetManage/depot";
|
import {depotList} from "#/api/property/assetManage/depot";
|
||||||
import { suppliersList } from "#/api/property/assetManage/suppliers";
|
import {suppliersList} from "#/api/property/assetManage/suppliers";
|
||||||
import { assetList } from "#/api/property/assetManage/asset";
|
import {assetList} from "#/api/property/assetManage/asset";
|
||||||
import { userList } from "#/api/system/user";
|
import {userList} from "#/api/system/user";
|
||||||
|
import type {AssetVO} from "#/api/property/assetManage/asset/model";
|
||||||
|
|
||||||
const emit = defineEmits<{ reload: [] }>();
|
const emit = defineEmits<{ reload: [] }>();
|
||||||
|
|
||||||
@@ -39,7 +44,7 @@ const [BasicForm, formApi] = useVbenForm({
|
|||||||
wrapperClass: 'grid-cols-2',
|
wrapperClass: 'grid-cols-2',
|
||||||
});
|
});
|
||||||
|
|
||||||
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
const {onBeforeClose, markInitialized, resetInitialized} = useBeforeCloseDiff(
|
||||||
{
|
{
|
||||||
initializedGetter: defaultFormValueGetter(formApi),
|
initializedGetter: defaultFormValueGetter(formApi),
|
||||||
currentGetter: defaultFormValueGetter(formApi),
|
currentGetter: defaultFormValueGetter(formApi),
|
||||||
@@ -48,15 +53,15 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
|||||||
|
|
||||||
formApi.getValues().then(setupPackageSelect);
|
formApi.getValues().then(setupPackageSelect);
|
||||||
|
|
||||||
async function upSelectUser(nickName: string){
|
async function upSelectUser(nickName: string) {
|
||||||
const list=await userList({
|
const list = await userList({
|
||||||
nickName:nickName,
|
nickName: nickName,
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
});
|
});
|
||||||
const options=list.map(item=>{
|
const options = list.map(item => {
|
||||||
item.label=item.userName;
|
item.label = item.userName;
|
||||||
item.value=item.id;
|
item.value = item.id;
|
||||||
})
|
})
|
||||||
fromApi.updateSchema([
|
fromApi.updateSchema([
|
||||||
{
|
{
|
||||||
@@ -71,15 +76,15 @@ async function upSelectUser(nickName: string){
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function upSelectAssets(assetsName: string){
|
async function upSelectAssets(assetsName: string) {
|
||||||
const list=await assetList({
|
const list = await assetList({
|
||||||
assetsName:assetsName,
|
assetsName: assetsName,
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
});
|
});
|
||||||
const options=list.map(item=>{
|
const options = list.map(item => {
|
||||||
item.label=item.assetsName;
|
item.label = item.assetsName;
|
||||||
item.value=item.id;
|
item.value = item.id;
|
||||||
})
|
})
|
||||||
fromApi.updateSchema([
|
fromApi.updateSchema([
|
||||||
{
|
{
|
||||||
@@ -94,15 +99,18 @@ async function upSelectAssets(assetsName: string){
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const assetsData = ref<AssetVO[]>([])
|
||||||
|
|
||||||
async function setupPackageSelect() {
|
async function setupPackageSelect() {
|
||||||
const users = await userList({
|
const users = await userList({
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 1000,
|
||||||
});
|
});
|
||||||
const assets = await assetList({
|
const assets = await assetList({
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 1000,
|
||||||
});
|
});
|
||||||
|
assetsData.value = assets.rows
|
||||||
const options = users.rows.map((item) => ({
|
const options = users.rows.map((item) => ({
|
||||||
label: item.nickName,
|
label: item.nickName,
|
||||||
value: item.userId,
|
value: item.userId,
|
||||||
@@ -121,7 +129,7 @@ async function setupPackageSelect() {
|
|||||||
},
|
},
|
||||||
async select(userId) {
|
async select(userId) {
|
||||||
await upSelectUser(userId);
|
await upSelectUser(userId);
|
||||||
userId=""
|
userId = ""
|
||||||
},
|
},
|
||||||
fieldName: 'userId',
|
fieldName: 'userId',
|
||||||
},
|
},
|
||||||
@@ -131,18 +139,30 @@ async function setupPackageSelect() {
|
|||||||
optionLabelProp: 'label',
|
optionLabelProp: 'label',
|
||||||
options: assetOptions,
|
options: assetOptions,
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
|
onChange: async (value: string) => {
|
||||||
|
// 找到选中的服务数据
|
||||||
|
const assetInfo = assetsData.value.find(item => item.id === value);
|
||||||
|
if (assetInfo) {
|
||||||
|
formApi.updateSchema([{
|
||||||
|
componentProps: {
|
||||||
|
max:assetInfo.stock
|
||||||
|
},
|
||||||
|
fieldName: 'number',
|
||||||
|
}])
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
async select(assetsId) {
|
async select(assetsId) {
|
||||||
await upSelectAssets(assetsId);
|
await upSelectAssets(assetsId);
|
||||||
assetsId=""
|
assetsId = ""
|
||||||
},
|
},
|
||||||
fieldName: 'assetId',
|
fieldName: 'assetId',
|
||||||
},
|
},
|
||||||
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const [BasicModal, modalApi] = useVbenModal({
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
// 在这里更改宽度
|
// 在这里更改宽度
|
||||||
class: 'w-[550px]',
|
class: 'w-[550px]',
|
||||||
@@ -156,7 +176,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
}
|
}
|
||||||
modalApi.modalLoading(true);
|
modalApi.modalLoading(true);
|
||||||
|
|
||||||
const { id } = modalApi.getData() as { id?: number | string };
|
const {id} = modalApi.getData() as { id?: number | string };
|
||||||
isUpdate.value = !!id;
|
isUpdate.value = !!id;
|
||||||
|
|
||||||
if (isUpdate.value && id) {
|
if (isUpdate.value && id) {
|
||||||
@@ -172,7 +192,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
async function handleConfirm() {
|
async function handleConfirm() {
|
||||||
try {
|
try {
|
||||||
modalApi.lock(true);
|
modalApi.lock(true);
|
||||||
const { valid } = await formApi.validate();
|
const {valid} = await formApi.validate();
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -197,7 +217,7 @@ async function handleClosed() {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<BasicModal :title="title">
|
<BasicModal :title="title">
|
||||||
<BasicForm />
|
<BasicForm/>
|
||||||
</BasicModal>
|
</BasicModal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@@ -2,65 +2,65 @@ import type { FormSchemaGetter } from '#/adapter/form';
|
|||||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||||
import { renderDict } from "#/utils/render";
|
import { renderDict } from "#/utils/render";
|
||||||
import { DictEnum } from '@vben/constants';
|
import { DictEnum } from '@vben/constants';
|
||||||
|
import {getDictOptions} from "#/utils/dict";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export const querySchema: FormSchemaGetter = () => [
|
export const querySchema: FormSchemaGetter = () => [
|
||||||
|
// {
|
||||||
|
// component: 'Input',
|
||||||
|
// fieldName: 'assetId',
|
||||||
|
// label: '资产id',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// component: 'Input',
|
||||||
|
// fieldName: 'userId',
|
||||||
|
// label: '领用人id',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// component: 'Input',
|
||||||
|
// fieldName: 'number',
|
||||||
|
// label: '数量',
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Select',
|
||||||
fieldName: 'assetId',
|
componentProps:{
|
||||||
label: '资产id',
|
options:getDictOptions(DictEnum.WY_ZCSHZT)
|
||||||
},
|
},
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'userId',
|
|
||||||
label: '领用人id',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'number',
|
|
||||||
label: '数量',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'state',
|
fieldName: 'state',
|
||||||
label: '状态',
|
label: '领用状态',
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'acceptanceUserId',
|
|
||||||
label: '审批人id',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'DatePicker',
|
|
||||||
componentProps: {
|
|
||||||
showTime: true,
|
|
||||||
format: 'YYYY-MM-DD HH:mm:ss',
|
|
||||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
||||||
},
|
|
||||||
fieldName: 'acceptanceTime',
|
|
||||||
label: '审批时间',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'DatePicker',
|
|
||||||
componentProps: {
|
|
||||||
showTime: true,
|
|
||||||
format: 'YYYY-MM-DD HH:mm:ss',
|
|
||||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
||||||
},
|
|
||||||
fieldName: 'applicationTime',
|
|
||||||
label: '申请时间',
|
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// component: 'Input',
|
||||||
|
// fieldName: 'acceptanceUserId',
|
||||||
|
// label: '审批人id',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// component: 'DatePicker',
|
||||||
|
// componentProps: {
|
||||||
|
// showTime: true,
|
||||||
|
// format: 'YYYY-MM-DD HH:mm:ss',
|
||||||
|
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||||
|
// },
|
||||||
|
// fieldName: 'acceptanceTime',
|
||||||
|
// label: '审批时间',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// component: 'DatePicker',
|
||||||
|
// componentProps: {
|
||||||
|
// showTime: true,
|
||||||
|
// format: 'YYYY-MM-DD HH:mm:ss',
|
||||||
|
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||||
|
// },
|
||||||
|
// fieldName: 'applicationTime',
|
||||||
|
// label: '申请时间',
|
||||||
|
// },
|
||||||
];
|
];
|
||||||
|
|
||||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||||
// export const columns: () => VxeGridProps['columns'] = () => [
|
// export const columns: () => VxeGridProps['columns'] = () => [
|
||||||
export const columns: VxeGridProps['columns'] = [
|
export const columns: VxeGridProps['columns'] = [
|
||||||
{ type: 'checkbox', width: 60 },
|
{ type: 'checkbox', width: 60 },
|
||||||
{
|
|
||||||
title: '主键',
|
|
||||||
field: 'id',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '资产',
|
title: '资产',
|
||||||
field: 'assetName',
|
field: 'assetName',
|
||||||
@@ -74,7 +74,11 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
field: 'number',
|
field: 'number',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '申请时间',
|
||||||
|
field: 'applicationTime',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '领用状态',
|
||||||
field: 'state',
|
field: 'state',
|
||||||
slots: {
|
slots: {
|
||||||
default: ({ row }) => {
|
default: ({ row }) => {
|
||||||
@@ -90,14 +94,6 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
title: '审批时间',
|
title: '审批时间',
|
||||||
field: 'acceptanceTime',
|
field: 'acceptanceTime',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '申请时间',
|
|
||||||
field: 'applicationTime',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '创建时间',
|
|
||||||
field: 'createTime',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
field: 'action',
|
field: 'action',
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
@@ -118,19 +114,25 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '资产id',
|
label: '资产',
|
||||||
fieldName: 'assetId',
|
fieldName: 'assetId',
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
|
rules:'selectRequired'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '领用人id',
|
label: '领用人',
|
||||||
fieldName: 'userId',
|
fieldName: 'userId',
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
|
rules:'selectRequired'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '数量',
|
label: '数量',
|
||||||
fieldName: 'number',
|
fieldName: 'number',
|
||||||
component: 'Input',
|
component: 'InputNumber',
|
||||||
|
componentProps:{
|
||||||
|
min:1,
|
||||||
|
},
|
||||||
|
rules:'required'
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// label: '状态',
|
// label: '状态',
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
|
||||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
import {Page, useVbenModal, type VbenFormProps} from '@vben/common-ui';
|
||||||
import { getVxePopupContainer } from '@vben/utils';
|
import {getVxePopupContainer} from '@vben/utils';
|
||||||
|
|
||||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
import {Modal, Popconfirm, Space} from 'ant-design-vue';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
useVbenVxeGrid,
|
useVbenVxeGrid,
|
||||||
@@ -14,14 +14,15 @@ import {
|
|||||||
import {
|
import {
|
||||||
applicationExport,
|
applicationExport,
|
||||||
applicationList,
|
applicationList,
|
||||||
applicationRemove,
|
applicationRemove, applicationUpdate,
|
||||||
} from '#/api/property/assetManage/application';
|
} from '#/api/property/assetManage/application';
|
||||||
import type { ApplicationForm } from '#/api/property/assetManage/application/model';
|
import type {ApplicationForm} from '#/api/property/assetManage/application/model';
|
||||||
import { commonDownloadExcel } from '#/utils/file/download';
|
import {commonDownloadExcel} from '#/utils/file/download';
|
||||||
|
|
||||||
import applicationModal from './application-modal.vue';
|
import applicationModal from './application-modal.vue';
|
||||||
import { columns, querySchema } from './data';
|
import {columns, querySchema} from './data';
|
||||||
|
import {useUserStore} from "@vben/stores";
|
||||||
|
import { cloneDeep } from '@vben/utils';
|
||||||
const formOptions: VbenFormProps = {
|
const formOptions: VbenFormProps = {
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
labelWidth: 80,
|
labelWidth: 80,
|
||||||
@@ -50,7 +51,7 @@ const gridOptions: VxeGridProps = {
|
|||||||
pagerConfig: {},
|
pagerConfig: {},
|
||||||
proxyConfig: {
|
proxyConfig: {
|
||||||
ajax: {
|
ajax: {
|
||||||
query: async ({ page }, formValues = {}) => {
|
query: async ({page}, formValues = {}) => {
|
||||||
return await applicationList({
|
return await applicationList({
|
||||||
pageNum: page.currentPage,
|
pageNum: page.currentPage,
|
||||||
pageSize: page.pageSize,
|
pageSize: page.pageSize,
|
||||||
@@ -81,7 +82,7 @@ function handleAdd() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function handleEdit(row: Required<ApplicationForm>) {
|
async function handleEdit(row: Required<ApplicationForm>) {
|
||||||
modalApi.setData({ id: row.id });
|
modalApi.setData({id: row.id});
|
||||||
modalApi.open();
|
modalApi.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,6 +91,17 @@ async function handleDelete(row: Required<ApplicationForm>) {
|
|||||||
await tableApi.query();
|
await tableApi.query();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const userStore = useUserStore();
|
||||||
|
|
||||||
|
async function handleAudit(row: Required<ApplicationForm>, status: number) {
|
||||||
|
const info = cloneDeep(row)
|
||||||
|
info.state = status
|
||||||
|
info.acceptanceTime = new Date()
|
||||||
|
info.acceptanceUserId = userStore.userInfo?.userId
|
||||||
|
await applicationUpdate(info)
|
||||||
|
await tableApi.query();
|
||||||
|
}
|
||||||
|
|
||||||
function handleMultiDelete() {
|
function handleMultiDelete() {
|
||||||
const rows = tableApi.grid.getCheckboxRecords();
|
const rows = tableApi.grid.getCheckboxRecords();
|
||||||
const ids = rows.map((row: Required<ApplicationForm>) => row.id);
|
const ids = rows.map((row: Required<ApplicationForm>) => row.id);
|
||||||
@@ -141,12 +153,29 @@ function handleDownloadExcel() {
|
|||||||
</template>
|
</template>
|
||||||
<template #action="{ row }">
|
<template #action="{ row }">
|
||||||
<Space>
|
<Space>
|
||||||
|
<!-- <ghost-button-->
|
||||||
|
<!-- v-access:code="['property:application:edit']"-->
|
||||||
|
<!-- @click.stop="handleEdit(row)"-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- {{ $t('pages.common.edit') }}-->
|
||||||
|
<!-- </ghost-button>-->
|
||||||
|
<Popconfirm
|
||||||
|
:get-popup-container="getVxePopupContainer"
|
||||||
|
placement="left"
|
||||||
|
title="资产领用审核"
|
||||||
|
@confirm="handleAudit(row,1)"
|
||||||
|
cancelText="不通过"
|
||||||
|
okText="通过"
|
||||||
|
@cancel="handleAudit(row,2)"
|
||||||
|
>
|
||||||
<ghost-button
|
<ghost-button
|
||||||
v-access:code="['property:application:edit']"
|
v-access:code="['property:application:edit']"
|
||||||
@click.stop="handleEdit(row)"
|
@click.stop=""
|
||||||
|
:disabled="row.state!=0"
|
||||||
>
|
>
|
||||||
{{ $t('pages.common.edit') }}
|
审核
|
||||||
</ghost-button>
|
</ghost-button>
|
||||||
|
</Popconfirm>
|
||||||
<Popconfirm
|
<Popconfirm
|
||||||
:get-popup-container="getVxePopupContainer"
|
:get-popup-container="getVxePopupContainer"
|
||||||
placement="left"
|
placement="left"
|
||||||
@@ -164,6 +193,6 @@ function handleDownloadExcel() {
|
|||||||
</Space>
|
</Space>
|
||||||
</template>
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<ApplicationModal @reload="tableApi.query()" />
|
<ApplicationModal @reload="tableApi.query()"/>
|
||||||
</Page>
|
</Page>
|
||||||
</template>
|
</template>
|
||||||
|
@@ -10,8 +10,6 @@ import { assetAdd, assetInfo, assetUpdate } from '#/api/property/assetManage/ass
|
|||||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||||
|
|
||||||
import { modalSchema } from './data';
|
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 { depotList } from "#/api/property/assetManage/depot";
|
||||||
import { suppliersList } from "#/api/property/assetManage/suppliers";
|
import { suppliersList } from "#/api/property/assetManage/suppliers";
|
||||||
|
|
||||||
@@ -25,9 +23,9 @@ const title = computed(() => {
|
|||||||
const [BasicForm, formApi] = useVbenForm({
|
const [BasicForm, formApi] = useVbenForm({
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
// 默认占满两列
|
// 默认占满两列
|
||||||
formItemClass: 'col-span-2',
|
formItemClass: 'col-span-1',
|
||||||
// 默认label宽度 px
|
// 默认label宽度 px
|
||||||
labelWidth: 80,
|
labelWidth: 100,
|
||||||
// 通用配置项 会影响到所有表单项
|
// 通用配置项 会影响到所有表单项
|
||||||
componentProps: {
|
componentProps: {
|
||||||
class: 'w-full',
|
class: 'w-full',
|
||||||
@@ -45,14 +43,9 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
async function setupPackageSelect() {
|
async function setupPackageSelect(assetTypeOptions) {
|
||||||
const tenantPackageList = await assetTypeselect();
|
|
||||||
const depot = await depotList();
|
const depot = await depotList();
|
||||||
const suppliers =await suppliersList();
|
const suppliers =await suppliersList();
|
||||||
const options = tenantPackageList.rows.map((item) => ({
|
|
||||||
label: item.assetTypeName,
|
|
||||||
value: item.id,
|
|
||||||
}));
|
|
||||||
const depotoptions = depot.rows.map((item) => ({
|
const depotoptions = depot.rows.map((item) => ({
|
||||||
label: item.depotName,
|
label: item.depotName,
|
||||||
value: item.id,
|
value: item.id,
|
||||||
@@ -67,7 +60,7 @@ async function setupPackageSelect() {
|
|||||||
componentProps: {
|
componentProps: {
|
||||||
optionFilterProp: 'label',
|
optionFilterProp: 'label',
|
||||||
optionLabelProp: 'label',
|
optionLabelProp: 'label',
|
||||||
options,
|
options:assetTypeOptions,
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
},
|
},
|
||||||
fieldName: 'model',
|
fieldName: 'model',
|
||||||
@@ -96,7 +89,7 @@ async function setupPackageSelect() {
|
|||||||
|
|
||||||
const [BasicModal, modalApi] = useVbenModal({
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
// 在这里更改宽度
|
// 在这里更改宽度
|
||||||
class: 'w-[550px]',
|
class: 'w-[70%]',
|
||||||
fullscreenButton: false,
|
fullscreenButton: false,
|
||||||
onBeforeClose,
|
onBeforeClose,
|
||||||
onClosed: handleClosed,
|
onClosed: handleClosed,
|
||||||
@@ -108,15 +101,15 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
|
|
||||||
modalApi.modalLoading(true);
|
modalApi.modalLoading(true);
|
||||||
|
|
||||||
const { id } = modalApi.getData() as { id?: number | string };
|
const { id,assetTypeOptions } = modalApi.getData() as { id?: number | string,assetTypeOptions:any[] };
|
||||||
isUpdate.value = !!id;
|
isUpdate.value = !!id;
|
||||||
|
|
||||||
if (isUpdate.value && id) {
|
if (isUpdate.value && id) {
|
||||||
const record = await assetInfo(id);
|
const record = await assetInfo(id);
|
||||||
|
record.type=record.type.toString()
|
||||||
await formApi.setValues(record);
|
await formApi.setValues(record);
|
||||||
}
|
}
|
||||||
await markInitialized();
|
await markInitialized();
|
||||||
await setupPackageSelect();
|
await setupPackageSelect(assetTypeOptions);
|
||||||
modalApi.modalLoading(false);
|
modalApi.modalLoading(false);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@@ -6,7 +6,7 @@ import { DictEnum } from '@vben/constants';
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
export const querySchema: FormSchemaGetter = () => [
|
export const querySchema: FormSchemaGetter = (assetTypeOptions) => [
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
fieldName: 'name',
|
fieldName: 'name',
|
||||||
@@ -14,6 +14,9 @@ export const querySchema: FormSchemaGetter = () => [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
|
componentProps:{
|
||||||
|
options: assetTypeOptions
|
||||||
|
},
|
||||||
fieldName: 'model',
|
fieldName: 'model',
|
||||||
label: '资产类型',
|
label: '资产类型',
|
||||||
},
|
},
|
||||||
@@ -32,54 +35,50 @@ export const querySchema: FormSchemaGetter = () => [
|
|||||||
// export const columns: () => VxeGridProps['columns'] = () => [
|
// export const columns: () => VxeGridProps['columns'] = () => [
|
||||||
export const columns: VxeGridProps['columns'] = [
|
export const columns: VxeGridProps['columns'] = [
|
||||||
{type: 'checkbox', width: 60},
|
{type: 'checkbox', width: 60},
|
||||||
{
|
|
||||||
title: '序号',
|
|
||||||
field: 'id',
|
|
||||||
slots: {
|
|
||||||
default: ({ rowIndex }) => {
|
|
||||||
return (rowIndex + 1).toString();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '资产名称',
|
title: '资产名称',
|
||||||
field: 'name',
|
field: 'name',
|
||||||
|
minWidth: 180,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '资产类型',
|
title: '资产类型',
|
||||||
field: 'modelName',
|
field: 'modelName',
|
||||||
|
width: 150,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '规格',
|
title: '规格',
|
||||||
field: 'specs',
|
field: 'specs',
|
||||||
|
width: 100,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '价格',
|
title: '价格',
|
||||||
field: 'price',
|
field: 'price',
|
||||||
},
|
width: 100,
|
||||||
{
|
|
||||||
title: '库存',
|
|
||||||
field: 'stock',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '计量单位',
|
title: '计量单位',
|
||||||
field: 'unit',
|
field: 'unit',
|
||||||
},
|
width: 100,
|
||||||
{
|
|
||||||
title: '仓库',
|
|
||||||
field: 'depotName',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '描述信息',
|
|
||||||
field: 'msg',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '供应商',
|
title: '供应商',
|
||||||
field: 'suppliersName',
|
field: 'suppliersName',
|
||||||
|
width: 180,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '仓库',
|
||||||
|
field: 'depotName',
|
||||||
|
width: 180,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '库存',
|
||||||
|
field: 'stock',
|
||||||
|
width: 100,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '入库时间',
|
title: '入库时间',
|
||||||
field: 'storageTime',
|
field: 'storageTime',
|
||||||
|
width: 150,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '固定资产',
|
title: '固定资产',
|
||||||
@@ -89,10 +88,12 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
return renderDict(row.type, DictEnum.WY_SF);
|
return renderDict(row.type, DictEnum.WY_SF);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
width: 80,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '创建时间',
|
title: '描述信息',
|
||||||
field: 'createTime',
|
field: 'msg',
|
||||||
|
width: 150,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'action',
|
field: 'action',
|
||||||
@@ -117,46 +118,56 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
label: '资产名称',
|
label: '资产名称',
|
||||||
fieldName: 'name',
|
fieldName: 'name',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
|
rules:'required',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '类型',
|
label: '类型',
|
||||||
fieldName: 'model',
|
fieldName: 'model',
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
|
rules:'selectRequired',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '规格',
|
label: '规格',
|
||||||
fieldName: 'specs',
|
fieldName: 'specs',
|
||||||
component: 'Textarea',
|
component: 'Input',
|
||||||
|
rules:'required',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '价格',
|
label: '价格',
|
||||||
fieldName: 'price',
|
fieldName: 'price',
|
||||||
component: 'Input',
|
component: 'InputNumber',
|
||||||
|
componentProps:{
|
||||||
|
min:0,
|
||||||
|
precision:2,
|
||||||
|
},
|
||||||
|
rules:'required',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '库存',
|
label: '库存',
|
||||||
fieldName: 'stock',
|
fieldName: 'stock',
|
||||||
component: 'Input',
|
component: 'InputNumber',
|
||||||
|
componentProps:{
|
||||||
|
min:0,
|
||||||
|
},
|
||||||
|
rules:'required',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '计量单位',
|
label: '计量单位',
|
||||||
fieldName: 'unit',
|
fieldName: 'unit',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
|
rules:'required',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '仓库',
|
label: '仓库',
|
||||||
fieldName: 'depotId',
|
fieldName: 'depotId',
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
|
rules:'required',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '描述信息',
|
label: '供应商',
|
||||||
fieldName: 'msg',
|
|
||||||
component: 'Textarea',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '供应商id',
|
|
||||||
fieldName: 'suppliersId',
|
fieldName: 'suppliersId',
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
|
rules:'required',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '入库时间',
|
label: '入库时间',
|
||||||
@@ -167,13 +178,23 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
format: 'YYYY-MM-DD HH:mm:ss',
|
format: 'YYYY-MM-DD HH:mm:ss',
|
||||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||||
},
|
},
|
||||||
|
rules:'required',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '固定资产类型',
|
label: '是否固定资产',
|
||||||
fieldName: 'type',
|
fieldName: 'type',
|
||||||
component: 'Select',
|
component: 'RadioGroup',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
|
buttonStyle: 'solid',
|
||||||
options: getDictOptions('wy_sf'),
|
options: getDictOptions('wy_sf'),
|
||||||
},
|
},
|
||||||
|
defaultValue:'0',
|
||||||
|
rules:'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '描述信息',
|
||||||
|
fieldName: 'msg',
|
||||||
|
component: 'Textarea',
|
||||||
|
formItemClass:'col-span-2'
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
|
||||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
import {Page, useVbenModal, type VbenFormProps} from '@vben/common-ui';
|
||||||
import { getVxePopupContainer } from '@vben/utils';
|
import {getVxePopupContainer} from '@vben/utils';
|
||||||
|
|
||||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
import {Modal, Popconfirm, Space} from 'ant-design-vue';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
useVbenVxeGrid,
|
useVbenVxeGrid,
|
||||||
@@ -16,22 +16,27 @@ import {
|
|||||||
assetList,
|
assetList,
|
||||||
assetRemove,
|
assetRemove,
|
||||||
} from '#/api/property/assetManage/asset';
|
} from '#/api/property/assetManage/asset';
|
||||||
import type { AssetForm } from '#/api/property/assetManage/asset/model';
|
import type {AssetForm} from '#/api/property/assetManage/asset/model';
|
||||||
import { commonDownloadExcel } from '#/utils/file/download';
|
import {commonDownloadExcel} from '#/utils/file/download';
|
||||||
|
|
||||||
import assetModal from './asset-modal.vue';
|
import assetModal from './asset-modal.vue';
|
||||||
import { columns, querySchema } from './data';
|
import {columns, querySchema} from './data';
|
||||||
|
import {assetTypeList} from "#/api/property/assetManage/assetType";
|
||||||
|
import type {AssertType} from "vitest";
|
||||||
|
import {computed, onMounted, ref} from "vue";
|
||||||
|
|
||||||
const formOptions: VbenFormProps = {
|
const assetTypeOptions=ref<AssertType[]>([])
|
||||||
|
|
||||||
|
const formOptions = computed(() => ({
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
labelWidth: 80,
|
labelWidth: 80,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
schema: querySchema(),
|
schema: querySchema(assetTypeOptions.value),
|
||||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||||
};
|
}));
|
||||||
|
|
||||||
const gridOptions: VxeGridProps = {
|
const gridOptions: VxeGridProps = {
|
||||||
checkboxConfig: {
|
checkboxConfig: {
|
||||||
@@ -47,7 +52,7 @@ const gridOptions: VxeGridProps = {
|
|||||||
pagerConfig: {},
|
pagerConfig: {},
|
||||||
proxyConfig: {
|
proxyConfig: {
|
||||||
ajax: {
|
ajax: {
|
||||||
query: async ({ page }, formValues = {}) => {
|
query: async ({page}, formValues = {}) => {
|
||||||
return await assetList({
|
return await assetList({
|
||||||
pageNum: page.currentPage,
|
pageNum: page.currentPage,
|
||||||
pageSize: page.pageSize,
|
pageSize: page.pageSize,
|
||||||
@@ -73,12 +78,12 @@ const [AssetModal, modalApi] = useVbenModal({
|
|||||||
});
|
});
|
||||||
|
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
modalApi.setData({});
|
modalApi.setData({assetTypeOptions:assetTypeOptions.value});
|
||||||
modalApi.open();
|
modalApi.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleEdit(row: Required<AssetForm>) {
|
async function handleEdit(row: Required<AssetForm>) {
|
||||||
modalApi.setData({ id: row.id });
|
modalApi.setData({id: row.id,assetTypeOptions:assetTypeOptions.value});
|
||||||
modalApi.open();
|
modalApi.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -106,6 +111,24 @@ function handleDownloadExcel() {
|
|||||||
fieldMappingTime: formOptions.fieldMappingTime,
|
fieldMappingTime: formOptions.fieldMappingTime,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function queryAssetType() {
|
||||||
|
let params = {
|
||||||
|
pageSize: 1000,
|
||||||
|
pageNum: 1,
|
||||||
|
}
|
||||||
|
const res = await assetTypeList(params)
|
||||||
|
assetTypeOptions.value = res.rows.map((item) => ({
|
||||||
|
label: item.assetTypeName,
|
||||||
|
value: item.id,
|
||||||
|
}));
|
||||||
|
return assetTypeOptions.value
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(()=>{
|
||||||
|
queryAssetType()
|
||||||
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -161,6 +184,6 @@ function handleDownloadExcel() {
|
|||||||
</Space>
|
</Space>
|
||||||
</template>
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<AssetModal @reload="tableApi.query()" />
|
<AssetModal @reload="tableApi.query()"/>
|
||||||
</Page>
|
</Page>
|
||||||
</template>
|
</template>
|
||||||
|
@@ -1,130 +1,137 @@
|
|||||||
import type { FormSchemaGetter } from '#/adapter/form';
|
import type { FormSchemaGetter } from '#/adapter/form';
|
||||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||||
|
import {getDictOptions} from "#/utils/dict";
|
||||||
|
|
||||||
|
|
||||||
export const querySchema: FormSchemaGetter = () => [
|
export const querySchema: FormSchemaGetter = () => [
|
||||||
{
|
// {
|
||||||
component: 'Input',
|
// component: 'Input',
|
||||||
fieldName: 'depotId',
|
// fieldName: 'depotId',
|
||||||
label: '仓库id',
|
// label: '仓库id',
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
component: 'Input',
|
// component: 'Input',
|
||||||
fieldName: 'assetId',
|
// fieldName: 'assetId',
|
||||||
label: '资产id',
|
// label: '资产id',
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
|
options:getDictOptions('wy_cklzlx')
|
||||||
},
|
},
|
||||||
fieldName: 'type',
|
fieldName: 'type',
|
||||||
label: '流转类型',
|
label: '流转类型',
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
component: 'DatePicker',
|
// component: 'DatePicker',
|
||||||
componentProps: {
|
// componentProps: {
|
||||||
showTime: true,
|
// showTime: true,
|
||||||
format: 'YYYY-MM-DD HH:mm:ss',
|
// format: 'YYYY-MM-DD HH:mm:ss',
|
||||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||||
},
|
// },
|
||||||
fieldName: 'time',
|
// fieldName: 'time',
|
||||||
label: '流转时间',
|
// label: '流转时间',
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
component: 'Input',
|
// component: 'Input',
|
||||||
fieldName: 'userId',
|
// fieldName: 'userId',
|
||||||
label: '操作人id',
|
// label: '操作人id',
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
component: 'Input',
|
// component: 'Input',
|
||||||
fieldName: 'state',
|
// fieldName: 'state',
|
||||||
label: '状态',
|
// label: '状态',
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
component: 'Input',
|
// component: 'Input',
|
||||||
fieldName: 'price',
|
// fieldName: 'price',
|
||||||
label: '价格',
|
// label: '价格',
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
component: 'Input',
|
// component: 'Input',
|
||||||
fieldName: 'priceSum',
|
// fieldName: 'priceSum',
|
||||||
label: '总价',
|
// label: '总价',
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
component: 'Input',
|
// component: 'Input',
|
||||||
fieldName: 'number',
|
// fieldName: 'number',
|
||||||
label: '数量',
|
// label: '数量',
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
component: 'Input',
|
// component: 'Input',
|
||||||
fieldName: 'supplierId',
|
// fieldName: 'supplierId',
|
||||||
label: '供应商id',
|
// label: '供应商id',
|
||||||
},
|
// },
|
||||||
];
|
];
|
||||||
|
|
||||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||||
// export const columns: () => VxeGridProps['columns'] = () => [
|
// export const columns: () => VxeGridProps['columns'] = () => [
|
||||||
export const columns: VxeGridProps['columns'] = [
|
export const columns: VxeGridProps['columns'] = [
|
||||||
{ type: 'checkbox', width: 60 },
|
{ type: 'checkbox', width: 60 },
|
||||||
{
|
|
||||||
title: '主键',
|
|
||||||
field: 'id',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '仓库id',
|
title: '仓库id',
|
||||||
field: 'depotId',
|
field: 'depotId',
|
||||||
|
minWidth:150,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '资产id',
|
title: '资产id',
|
||||||
field: 'assetId',
|
field: 'assetId',
|
||||||
|
width:180,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '流转类型',
|
title: '流转类型',
|
||||||
field: 'type',
|
field: 'type',
|
||||||
|
width:120,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
title: '数量',
|
||||||
|
field: 'number',
|
||||||
|
width:120,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '流转时间',
|
title: '流转时间',
|
||||||
field: 'time',
|
field: 'time',
|
||||||
|
width:150,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作人id',
|
title: '操作人id',
|
||||||
field: 'userId',
|
field: 'userId',
|
||||||
},
|
width:150,
|
||||||
{
|
|
||||||
title: '状态',
|
|
||||||
field: 'state',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '备注',
|
title: '备注',
|
||||||
field: 'remark',
|
field: 'remark',
|
||||||
|
width:180,
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
title: '价格',
|
// title: '状态',
|
||||||
field: 'price',
|
// field: 'state',
|
||||||
},
|
// width:150,
|
||||||
{
|
// },
|
||||||
title: '总价',
|
// {
|
||||||
field: 'priceSum',
|
// title: '价格',
|
||||||
},
|
// field: 'price',
|
||||||
{
|
// },
|
||||||
title: '数量',
|
// {
|
||||||
field: 'number',
|
// title: '总价',
|
||||||
},
|
// field: 'priceSum',
|
||||||
{
|
// },
|
||||||
title: '供应商id',
|
// {
|
||||||
field: 'supplierId',
|
// title: '供应商id',
|
||||||
},
|
// field: 'supplierId',
|
||||||
{
|
// },
|
||||||
title: '创建时间',
|
// {
|
||||||
field: 'createTime',
|
// title: '创建时间',
|
||||||
},
|
// field: 'createTime',
|
||||||
{
|
// },
|
||||||
field: 'action',
|
// {
|
||||||
fixed: 'right',
|
// field: 'action',
|
||||||
slots: { default: 'action' },
|
// fixed: 'right',
|
||||||
title: '操作',
|
// slots: { default: 'action' },
|
||||||
width: 180,
|
// title: '操作',
|
||||||
},
|
// width: 180,
|
||||||
|
// },
|
||||||
];
|
];
|
||||||
|
|
||||||
export const modalSchema: FormSchemaGetter = () => [
|
export const modalSchema: FormSchemaGetter = () => [
|
||||||
|
@@ -135,47 +135,47 @@ function handleDownloadExcel() {
|
|||||||
>
|
>
|
||||||
{{ $t('pages.common.export') }}
|
{{ $t('pages.common.export') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button
|
<!-- <a-button-->
|
||||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
<!-- :disabled="!vxeCheckboxChecked(tableApi)"-->
|
||||||
danger
|
<!-- danger-->
|
||||||
type="primary"
|
<!-- type="primary"-->
|
||||||
v-access:code="['property:log:remove']"
|
<!-- v-access:code="['property:log:remove']"-->
|
||||||
@click="handleMultiDelete">
|
<!-- @click="handleMultiDelete">-->
|
||||||
{{ $t('pages.common.delete') }}
|
<!-- {{ $t('pages.common.delete') }}-->
|
||||||
</a-button>
|
<!-- </a-button>-->
|
||||||
<a-button
|
<!-- <a-button-->
|
||||||
type="primary"
|
<!-- type="primary"-->
|
||||||
v-access:code="['property:log:add']"
|
<!-- v-access:code="['property:log:add']"-->
|
||||||
@click="handleAdd"
|
<!-- @click="handleAdd"-->
|
||||||
>
|
<!-- >-->
|
||||||
{{ $t('pages.common.add') }}
|
<!-- {{ $t('pages.common.add') }}-->
|
||||||
</a-button>
|
<!-- </a-button>-->
|
||||||
</Space>
|
|
||||||
</template>
|
|
||||||
<template #action="{ row }">
|
|
||||||
<Space>
|
|
||||||
<ghost-button
|
|
||||||
v-access:code="['property:log:edit']"
|
|
||||||
@click.stop="handleEdit(row)"
|
|
||||||
>
|
|
||||||
{{ $t('pages.common.edit') }}
|
|
||||||
</ghost-button>
|
|
||||||
<Popconfirm
|
|
||||||
:get-popup-container="getVxePopupContainer"
|
|
||||||
placement="left"
|
|
||||||
title="确认删除?"
|
|
||||||
@confirm="handleDelete(row)"
|
|
||||||
>
|
|
||||||
<ghost-button
|
|
||||||
danger
|
|
||||||
v-access:code="['property:log:remove']"
|
|
||||||
@click.stop=""
|
|
||||||
>
|
|
||||||
{{ $t('pages.common.delete') }}
|
|
||||||
</ghost-button>
|
|
||||||
</Popconfirm>
|
|
||||||
</Space>
|
</Space>
|
||||||
</template>
|
</template>
|
||||||
|
<!-- <template #action="{ row }">-->
|
||||||
|
<!-- <Space>-->
|
||||||
|
<!-- <ghost-button-->
|
||||||
|
<!-- v-access:code="['property:log:edit']"-->
|
||||||
|
<!-- @click.stop="handleEdit(row)"-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- {{ $t('pages.common.edit') }}-->
|
||||||
|
<!-- </ghost-button>-->
|
||||||
|
<!-- <Popconfirm-->
|
||||||
|
<!-- :get-popup-container="getVxePopupContainer"-->
|
||||||
|
<!-- placement="left"-->
|
||||||
|
<!-- title="确认删除?"-->
|
||||||
|
<!-- @confirm="handleDelete(row)"-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- <ghost-button-->
|
||||||
|
<!-- danger-->
|
||||||
|
<!-- v-access:code="['property:log:remove']"-->
|
||||||
|
<!-- @click.stop=""-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- {{ $t('pages.common.delete') }}-->
|
||||||
|
<!-- </ghost-button>-->
|
||||||
|
<!-- </Popconfirm>-->
|
||||||
|
<!-- </Space>-->
|
||||||
|
<!-- </template>-->
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<LogModal @reload="tableApi.query()" />
|
<LogModal @reload="tableApi.query()" />
|
||||||
</Page>
|
</Page>
|
||||||
|
@@ -24,6 +24,14 @@ export const querySchema: FormSchemaGetter = () => [
|
|||||||
fieldName: 'status',
|
fieldName: 'status',
|
||||||
label: '状态',
|
label: '状态',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
component: 'Select',
|
||||||
|
componentProps: {
|
||||||
|
options: getDictOptions('pro_processing_weight'),
|
||||||
|
},
|
||||||
|
fieldName: 'processingWeight',
|
||||||
|
label: '处理权重',
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export const columns: VxeGridProps['columns'] = [
|
export const columns: VxeGridProps['columns'] = [
|
||||||
@@ -148,6 +156,15 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
componentProps: {},
|
componentProps: {},
|
||||||
rules: 'selectRequired',
|
rules: 'selectRequired',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '处理权重',
|
||||||
|
fieldName: 'processingWeight',
|
||||||
|
component: 'Select',
|
||||||
|
componentProps: {
|
||||||
|
options: getDictOptions('pro_processing_weight'),
|
||||||
|
},
|
||||||
|
rules: 'selectRequired',
|
||||||
|
},
|
||||||
// {
|
// {
|
||||||
// label: '状态',
|
// label: '状态',
|
||||||
// fieldName: 'status',
|
// fieldName: 'status',
|
||||||
@@ -216,9 +233,8 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
label: '备注',
|
label: '备注',
|
||||||
fieldName: 'remarkremark',
|
fieldName: 'remark',
|
||||||
component: 'Textarea',
|
component: 'Textarea',
|
||||||
rules: 'required',
|
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// label: '是否超时',
|
// label: '是否超时',
|
||||||
@@ -230,6 +246,15 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
// },
|
// },
|
||||||
// rules: 'selectRequired',
|
// rules: 'selectRequired',
|
||||||
// },
|
// },
|
||||||
|
{
|
||||||
|
label: '工单图片',
|
||||||
|
fieldName: 'orderImgUrl',
|
||||||
|
component: 'ImageUpload',
|
||||||
|
componentProps: {
|
||||||
|
maxCount: 1,
|
||||||
|
},
|
||||||
|
formItemClass: 'col-span-2',
|
||||||
|
},
|
||||||
];
|
];
|
||||||
export const ordersModalSchema: FormSchemaGetter = () => [
|
export const ordersModalSchema: FormSchemaGetter = () => [
|
||||||
{
|
{
|
||||||
|
@@ -77,6 +77,11 @@ async function handleOpenChange(open: boolean) {
|
|||||||
<DescriptionsItem label="完成时间">
|
<DescriptionsItem label="完成时间">
|
||||||
{{ orderDetail.compleTime }}
|
{{ orderDetail.compleTime }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="处理权重">
|
||||||
|
<component
|
||||||
|
:is="renderDict(orderDetail.processingWeight,'pro_processing_weight')"
|
||||||
|
/>
|
||||||
|
</DescriptionsItem>
|
||||||
<DescriptionsItem label="是否超时" v-if="orderDetail.isTimeOut!=null">
|
<DescriptionsItem label="是否超时" v-if="orderDetail.isTimeOut!=null">
|
||||||
<component
|
<component
|
||||||
:is="renderDict(orderDetail.isTimeOut,'wy_sf')"
|
:is="renderDict(orderDetail.isTimeOut,'wy_sf')"
|
||||||
@@ -91,6 +96,9 @@ async function handleOpenChange(open: boolean) {
|
|||||||
<DescriptionsItem label="评价图片" v-if="orderDetail.imgUrl" :span="2">
|
<DescriptionsItem label="评价图片" v-if="orderDetail.imgUrl" :span="2">
|
||||||
{{ orderDetail.imgUrl }}
|
{{ orderDetail.imgUrl }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="工单图片" v-if="orderDetail.orderImgUrl" :span="2">
|
||||||
|
{{ orderDetail.orderImgUrl }}
|
||||||
|
</DescriptionsItem>
|
||||||
</Descriptions>
|
</Descriptions>
|
||||||
<Divider orientation="left" orientation-margin="0px">
|
<Divider orientation="left" orientation-margin="0px">
|
||||||
处理记录
|
处理记录
|
||||||
|
@@ -48,6 +48,7 @@ const {onBeforeClose, markInitialized, resetInitialized} = useBeforeCloseDiff(
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const recordEdit = ref({});
|
||||||
const [BasicModal, modalApi] = useVbenModal({
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
// 在这里更改宽度
|
// 在这里更改宽度
|
||||||
class: 'w-[70%]',
|
class: 'w-[70%]',
|
||||||
@@ -61,7 +62,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
}
|
}
|
||||||
modalApi.modalLoading(true);
|
modalApi.modalLoading(true);
|
||||||
await queryPersonData()
|
await queryPersonData()
|
||||||
await queryWorkOrdersType()
|
|
||||||
const {id} = modalApi.getData() as { id?: number | string };
|
const {id} = modalApi.getData() as { id?: number | string };
|
||||||
isUpdate.value = !!id;
|
isUpdate.value = !!id;
|
||||||
|
|
||||||
@@ -69,6 +70,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
const record = await workOrdersInfo(id);
|
const record = await workOrdersInfo(id);
|
||||||
record.isTimeOut = record.isTimeOut?.toString()
|
record.isTimeOut = record.isTimeOut?.toString()
|
||||||
await formApi.setValues(record);
|
await formApi.setValues(record);
|
||||||
|
recordEdit.value = record;
|
||||||
}
|
}
|
||||||
await markInitialized();
|
await markInitialized();
|
||||||
|
|
||||||
@@ -85,6 +87,9 @@ async function handleConfirm() {
|
|||||||
}
|
}
|
||||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||||
const data = cloneDeep(await formApi.getValues());
|
const data = cloneDeep(await formApi.getValues());
|
||||||
|
if(isUpdate.value){
|
||||||
|
data.status = recordEdit?.value.status
|
||||||
|
}
|
||||||
await (isUpdate.value ? workOrdersUpdate(data) : workOrdersAdd(data));
|
await (isUpdate.value ? workOrdersUpdate(data) : workOrdersAdd(data));
|
||||||
resetInitialized();
|
resetInitialized();
|
||||||
emit('reload');
|
emit('reload');
|
||||||
@@ -129,30 +134,6 @@ async function queryPersonData() {
|
|||||||
}])
|
}])
|
||||||
}
|
}
|
||||||
|
|
||||||
async function queryWorkOrdersType() {
|
|
||||||
let params = {
|
|
||||||
pageSize: 1000,
|
|
||||||
pageNum: 1
|
|
||||||
}
|
|
||||||
const res = await workOrdersTypeList(params)
|
|
||||||
const options = res.rows.map((item) => ({
|
|
||||||
label: item.orderTypeName,
|
|
||||||
value: item.id,
|
|
||||||
}));
|
|
||||||
formApi.updateSchema([{
|
|
||||||
componentProps: () => ({
|
|
||||||
options: options,
|
|
||||||
filterOption: filterOption,
|
|
||||||
showSearch:true,
|
|
||||||
}),
|
|
||||||
fieldName: 'type',
|
|
||||||
}])
|
|
||||||
}
|
|
||||||
|
|
||||||
const filterOption = (input: string, option: any) => {
|
|
||||||
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@@ -10,6 +10,7 @@ import { inspectionPointAdd, inspectionPointInfo, inspectionPointUpdate } from '
|
|||||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||||
|
|
||||||
import { modalSchema } from './data';
|
import { modalSchema } from './data';
|
||||||
|
import {workOrdersTypeList} from "#/api/property/businessManagement/workOrdersType";
|
||||||
|
|
||||||
const emit = defineEmits<{ reload: [] }>();
|
const emit = defineEmits<{ reload: [] }>();
|
||||||
|
|
||||||
@@ -53,7 +54,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
modalApi.modalLoading(true);
|
modalApi.modalLoading(true);
|
||||||
|
await queryWorkOrdersType()
|
||||||
const { id } = modalApi.getData() as { id?: number | string };
|
const { id } = modalApi.getData() as { id?: number | string };
|
||||||
isUpdate.value = !!id;
|
isUpdate.value = !!id;
|
||||||
|
|
||||||
@@ -91,6 +92,31 @@ async function handleClosed() {
|
|||||||
await formApi.resetForm();
|
await formApi.resetForm();
|
||||||
resetInitialized();
|
resetInitialized();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async function queryWorkOrdersType() {
|
||||||
|
let params = {
|
||||||
|
pageSize: 1000,
|
||||||
|
pageNum: 1
|
||||||
|
}
|
||||||
|
const res = await workOrdersTypeList(params)
|
||||||
|
const options = res.rows.map((item) => ({
|
||||||
|
label: item.orderTypeName,
|
||||||
|
value: item.id,
|
||||||
|
}));
|
||||||
|
formApi.updateSchema([{
|
||||||
|
componentProps: () => ({
|
||||||
|
options: options,
|
||||||
|
filterOption: filterOption,
|
||||||
|
showSearch:true,
|
||||||
|
}),
|
||||||
|
fieldName: 'type',
|
||||||
|
}])
|
||||||
|
}
|
||||||
|
|
||||||
|
const filterOption = (input: string, option: any) => {
|
||||||
|
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import type { FormSchemaGetter } from '#/adapter/form';
|
import {type FormSchemaGetter, z} from '#/adapter/form';
|
||||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||||
|
|
||||||
|
|
||||||
@@ -61,6 +61,16 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
component: 'Input',
|
component: 'Input',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '巡检点',
|
||||||
|
fieldName: 'pointId',
|
||||||
|
component: 'ApiSelect',
|
||||||
|
componentProps:{
|
||||||
|
mode: 'multiple',
|
||||||
|
},
|
||||||
|
rules: z.array(z.string()).min(1, { message: '请选择' }),
|
||||||
|
formItemClass: 'col-span-2',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '备注',
|
label: '备注',
|
||||||
fieldName: 'remark',
|
fieldName: 'remark',
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
import { $t } from '@vben/locales';
|
import { $t } from '@vben/locales';
|
||||||
import { cloneDeep } from '@vben/utils';
|
import { cloneDeep } from '@vben/utils';
|
||||||
|
|
||||||
import { useVbenForm } from '#/adapter/form';
|
import { useVbenForm } from '#/adapter/form';
|
||||||
import { inspectionRouteAdd, inspectionRouteInfo, inspectionRouteUpdate } from '#/api/property/inspectionManagement/inspectionRoute';
|
import { inspectionRouteAdd, inspectionRouteInfo, inspectionRouteUpdate } from '#/api/property/inspectionManagement/inspectionRoute';
|
||||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||||
|
import {
|
||||||
|
inspectionPointList,
|
||||||
|
} from '#/api/property/inspectionManagement/inspectionPoint';
|
||||||
import { modalSchema } from './data';
|
import { modalSchema } from './data';
|
||||||
|
|
||||||
const emit = defineEmits<{ reload: [] }>();
|
const emit = defineEmits<{ reload: [] }>();
|
||||||
@@ -21,7 +21,7 @@ const title = computed(() => {
|
|||||||
const [BasicForm, formApi] = useVbenForm({
|
const [BasicForm, formApi] = useVbenForm({
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
// 默认占满两列
|
// 默认占满两列
|
||||||
formItemClass: 'col-span-2',
|
formItemClass: 'col-span-1',
|
||||||
// 默认label宽度 px
|
// 默认label宽度 px
|
||||||
labelWidth: 100,
|
labelWidth: 100,
|
||||||
// 通用配置项 会影响到所有表单项
|
// 通用配置项 会影响到所有表单项
|
||||||
@@ -43,7 +43,7 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
|||||||
|
|
||||||
const [BasicModal, modalApi] = useVbenModal({
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
// 在这里更改宽度
|
// 在这里更改宽度
|
||||||
class: 'w-[550px]',
|
class: 'w-[60%]',
|
||||||
fullscreenButton: false,
|
fullscreenButton: false,
|
||||||
onBeforeClose,
|
onBeforeClose,
|
||||||
onClosed: handleClosed,
|
onClosed: handleClosed,
|
||||||
@@ -53,12 +53,13 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
modalApi.modalLoading(true);
|
modalApi.modalLoading(true);
|
||||||
|
await queryWorkOrdersType()
|
||||||
const { id } = modalApi.getData() as { id?: number | string };
|
const { id } = modalApi.getData() as { id?: number | string };
|
||||||
isUpdate.value = !!id;
|
isUpdate.value = !!id;
|
||||||
|
|
||||||
if (isUpdate.value && id) {
|
if (isUpdate.value && id) {
|
||||||
const record = await inspectionRouteInfo(id);
|
const record = await inspectionRouteInfo(id);
|
||||||
|
record.pointId = record.pointId?.split(',')
|
||||||
await formApi.setValues(record);
|
await formApi.setValues(record);
|
||||||
}
|
}
|
||||||
await markInitialized();
|
await markInitialized();
|
||||||
@@ -76,6 +77,7 @@ async function handleConfirm() {
|
|||||||
}
|
}
|
||||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||||
const data = cloneDeep(await formApi.getValues());
|
const data = cloneDeep(await formApi.getValues());
|
||||||
|
data.pointId = data.pointId?.join(',')
|
||||||
await (isUpdate.value ? inspectionRouteUpdate(data) : inspectionRouteAdd(data));
|
await (isUpdate.value ? inspectionRouteUpdate(data) : inspectionRouteAdd(data));
|
||||||
resetInitialized();
|
resetInitialized();
|
||||||
emit('reload');
|
emit('reload');
|
||||||
@@ -91,6 +93,31 @@ async function handleClosed() {
|
|||||||
await formApi.resetForm();
|
await formApi.resetForm();
|
||||||
resetInitialized();
|
resetInitialized();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function queryWorkOrdersType() {
|
||||||
|
let params = {
|
||||||
|
pageSize: 1000,
|
||||||
|
pageNum: 1
|
||||||
|
}
|
||||||
|
const res = await inspectionPointList(params)
|
||||||
|
const options = res.rows.map((item) => ({
|
||||||
|
label: item.pointName,
|
||||||
|
value: item.id,
|
||||||
|
}));
|
||||||
|
formApi.updateSchema([{
|
||||||
|
componentProps: () => ({
|
||||||
|
options: options,
|
||||||
|
showSearch: true,
|
||||||
|
filterOption: filterOption,
|
||||||
|
mode: 'multiple',
|
||||||
|
}),
|
||||||
|
fieldName: 'pointId',
|
||||||
|
}])
|
||||||
|
}
|
||||||
|
|
||||||
|
const filterOption = (input: string, option: any) => {
|
||||||
|
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@@ -1,35 +1,35 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import {ref, watch} from 'vue';
|
import {onMounted, ref, watch} from 'vue';
|
||||||
import {Select} from 'ant-design-vue';
|
import {Select} from 'ant-design-vue';
|
||||||
import {resident_unitList,resident_unitInfo} from "#/api/property/resident/unit";
|
import {resident_unitList, resident_unitInfo} from "#/api/property/resident/unit";
|
||||||
|
|
||||||
defineOptions({name: 'QueryUnitList'});
|
defineOptions({name: 'QueryUnitList'});
|
||||||
|
|
||||||
const props= withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
isUpdate?:boolean;
|
isUpdate?: boolean;
|
||||||
unitId?:string;
|
unitId?: string;
|
||||||
}>(), {
|
}>(), {
|
||||||
disabled: false,
|
disabled: false,
|
||||||
placeholder: '可根据单位名称进行搜索...',
|
placeholder: '可根据单位名称进行搜索...',
|
||||||
isUpdate:false,
|
isUpdate: false,
|
||||||
unitId:'',
|
unitId: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
async function queryUnit(value: string, callback: any) {
|
async function queryUnit(value: string|undefined, callback: any) {
|
||||||
const queryData = {
|
const queryData = {
|
||||||
name: value,
|
name: value,
|
||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
state:1,
|
state: 1,
|
||||||
}
|
}
|
||||||
const res = await resident_unitList(queryData);
|
const res = await resident_unitList(queryData);
|
||||||
const options = res.rows.map((unit) => ({
|
const options = res.rows.map((unit) => ({
|
||||||
label: unit.name+'-'+unit.id,
|
label: unit.name + '-' + unit.id,
|
||||||
value: unit.id,
|
value: unit.id,
|
||||||
name:unit.name,
|
name: unit.name,
|
||||||
unitNumber:unit.unitNumber,
|
unitNumber: unit.unitNumber,
|
||||||
}));
|
}));
|
||||||
callback(options);
|
callback(options);
|
||||||
}
|
}
|
||||||
@@ -46,24 +46,28 @@ const handleChange = (val: string) => {
|
|||||||
emit('update:unitInfo', unitInfo);
|
emit('update:unitInfo', unitInfo);
|
||||||
};
|
};
|
||||||
|
|
||||||
async function getUnitInfo(val:string) {
|
async function getUnitInfo(val: string) {
|
||||||
const unit = await resident_unitInfo(val)
|
const unit = await resident_unitInfo(val)
|
||||||
if (unit) {
|
if (unit) {
|
||||||
data.value = [{
|
data.value = [{
|
||||||
label: unit.name+'-'+unit.id,
|
label: unit.name + '-' + unit.id,
|
||||||
value: unit.id,
|
value: unit.id,
|
||||||
name:unit.name,
|
name: unit.name,
|
||||||
unitNumber:unit.id,
|
unitNumber: unit.id,
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(() => props.unitId,
|
watch(() => props.unitId,
|
||||||
(newX) => {
|
(newX) => {
|
||||||
if (props.isUpdate&&newX) {
|
if (props.isUpdate && newX) {
|
||||||
getUnitInfo(newX)
|
getUnitInfo(newX)
|
||||||
}
|
}
|
||||||
}, {immediate: true})
|
}, {immediate: true})
|
||||||
|
|
||||||
|
onMounted(()=>{
|
||||||
|
queryUnit(undefined, (d: any[]) => (data.value = d));
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@@ -105,7 +105,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'TreeSelect',
|
component: 'TreeSelect',
|
||||||
fieldName: 'unitId',
|
fieldName: 'buildingId',
|
||||||
defaultValue: undefined,
|
defaultValue: undefined,
|
||||||
label: '社区建筑',
|
label: '社区建筑',
|
||||||
rules: 'selectRequired',
|
rules: 'selectRequired',
|
||||||
|
@@ -1,29 +1,32 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref, reactive } from 'vue'
|
||||||
|
import { Tabs, TabPane, Form, FormItem, Space, Input } from 'ant-design-vue'
|
||||||
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import { useVbenModal } from '@vben/common-ui'
|
||||||
import { $t } from '@vben/locales';
|
import { $t } from '@vben/locales'
|
||||||
import { cloneDeep, getPopupContainer, handleNode } from '@vben/utils';
|
import { cloneDeep, getPopupContainer, handleNode } from '@vben/utils'
|
||||||
|
|
||||||
import { useVbenForm } from '#/adapter/form';
|
import { useVbenForm } from '#/adapter/form'
|
||||||
import {
|
import {
|
||||||
elevatorInfoAdd,
|
elevatorInfoAdd,
|
||||||
elevatorInfoInfo,
|
elevatorInfoInfo,
|
||||||
elevatorInfoUpdate,
|
elevatorInfoUpdate,
|
||||||
} from '#/api/sis/elevatorInfo';
|
} from '#/api/sis/elevatorInfo'
|
||||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup'
|
||||||
|
|
||||||
import { modalSchema } from './data';
|
import { modalSchema } from './data'
|
||||||
import { communityTree } from '#/api/property/community';
|
import { communityTree } from '#/api/property/community'
|
||||||
import type { DeviceManageForm, DeviceManageQuery } from '#/api/sis/deviceManage/model';
|
import { queryByBuildingId } from '#/api/property/floor'
|
||||||
import { deviceManageList } from '#/api/sis/deviceManage';
|
import type { DeviceManageForm, DeviceManageQuery } from '#/api/sis/deviceManage/model'
|
||||||
|
import { deviceManageList } from '#/api/sis/deviceManage'
|
||||||
|
|
||||||
const emit = defineEmits<{ reload: [] }>();
|
|
||||||
|
|
||||||
const isUpdate = ref(false);
|
const emit = defineEmits<{ reload: [] }>()
|
||||||
|
|
||||||
|
const isUpdate = ref(false)
|
||||||
const title = computed(() => {
|
const title = computed(() => {
|
||||||
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add')
|
||||||
});
|
})
|
||||||
|
|
||||||
const [BasicForm, formApi] = useVbenForm({
|
const [BasicForm, formApi] = useVbenForm({
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
@@ -39,14 +42,14 @@ const [BasicForm, formApi] = useVbenForm({
|
|||||||
schema: modalSchema(),
|
schema: modalSchema(),
|
||||||
showDefaultActions: false,
|
showDefaultActions: false,
|
||||||
wrapperClass: 'grid-cols-2',
|
wrapperClass: 'grid-cols-2',
|
||||||
});
|
})
|
||||||
|
|
||||||
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||||
{
|
{
|
||||||
initializedGetter: defaultFormValueGetter(formApi),
|
initializedGetter: defaultFormValueGetter(formApi),
|
||||||
currentGetter: defaultFormValueGetter(formApi),
|
currentGetter: defaultFormValueGetter(formApi),
|
||||||
},
|
},
|
||||||
);
|
)
|
||||||
|
|
||||||
const [BasicModal, modalApi] = useVbenModal({
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
// 在这里更改宽度
|
// 在这里更改宽度
|
||||||
@@ -57,57 +60,87 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
onConfirm: handleConfirm,
|
onConfirm: handleConfirm,
|
||||||
onOpenChange: async (isOpen) => {
|
onOpenChange: async (isOpen) => {
|
||||||
if (!isOpen) {
|
if (!isOpen) {
|
||||||
return null;
|
return null
|
||||||
}
|
}
|
||||||
modalApi.modalLoading(true);
|
modalApi.modalLoading(true)
|
||||||
// 加载社区树
|
// 加载社区树
|
||||||
setupCommunitySelect();
|
setupCommunitySelect()
|
||||||
// 加载未绑定的设备
|
// 加载未绑定的设备
|
||||||
loadDeviceList();
|
loadDeviceList()
|
||||||
const { id } = modalApi.getData() as { id?: number | string };
|
const { id } = modalApi.getData() as { id?: number | string }
|
||||||
isUpdate.value = !!id;
|
isUpdate.value = !!id
|
||||||
|
|
||||||
if (isUpdate.value && id) {
|
if (isUpdate.value && id) {
|
||||||
const record = await elevatorInfoInfo(id);
|
const record = await elevatorInfoInfo(id)
|
||||||
await formApi.setValues(record);
|
|
||||||
}
|
|
||||||
await markInitialized();
|
|
||||||
|
|
||||||
modalApi.modalLoading(false);
|
if (record.elevatorControlDeviceId) {
|
||||||
|
record.elevatorControlDeviceId = {
|
||||||
|
value: record.elevatorControlDeviceId.deviceId,
|
||||||
|
deviceIp: record.elevatorControlDeviceId.deviceIp,
|
||||||
|
deviceId: record.elevatorControlDeviceId.deviceId,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (record.remoteCallElevatorDeviceId) {
|
||||||
|
record.remoteCallElevatorDeviceId = record.remoteCallElevatorDeviceId.map(item => {
|
||||||
|
return {
|
||||||
|
value: item.deviceId,
|
||||||
|
deviceIp: item.deviceIp,
|
||||||
|
deviceId: item.deviceId,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
await handleGetFloor(record.buildingId)
|
||||||
|
await formApi.setValues(record)
|
||||||
|
}
|
||||||
|
await markInitialized()
|
||||||
|
|
||||||
|
modalApi.modalLoading(false)
|
||||||
},
|
},
|
||||||
});
|
})
|
||||||
|
|
||||||
async function handleConfirm() {
|
async function handleConfirm() {
|
||||||
try {
|
try {
|
||||||
modalApi.lock(true);
|
modalApi.lock(true)
|
||||||
const { valid } = await formApi.validate();
|
const { valid } = await formApi.validate()
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||||
const data = cloneDeep(await formApi.getValues());
|
const data = cloneDeep(await formApi.getValues())
|
||||||
await (isUpdate.value ? elevatorInfoUpdate(data) : elevatorInfoAdd(data));
|
// 通道信息
|
||||||
resetInitialized();
|
const filteredChannels = dynamicValidateForm.floor
|
||||||
emit('reload');
|
.filter(item => !(item.out.length === 0 && item.in.length === 0))
|
||||||
modalApi.close();
|
.map(item => ({
|
||||||
|
floorId: item.id,
|
||||||
|
inChannel: item.in,
|
||||||
|
outChannel: item.out
|
||||||
|
}))
|
||||||
|
|
||||||
|
data.channels = filteredChannels
|
||||||
|
await (isUpdate.value ? elevatorInfoUpdate(data) : elevatorInfoAdd(data))
|
||||||
|
resetInitialized()
|
||||||
|
emit('reload')
|
||||||
|
modalApi.close()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error)
|
||||||
} finally {
|
} finally {
|
||||||
modalApi.lock(false);
|
modalApi.lock(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let rows: any = [];
|
let rows: any = []
|
||||||
|
|
||||||
async function loadDeviceList() {
|
async function loadDeviceList() {
|
||||||
if (rows.length === 0) {
|
if (rows.length === 0) {
|
||||||
const params: DeviceManageQuery = {
|
const params: DeviceManageQuery = {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 500,
|
pageSize: 500,
|
||||||
};
|
}
|
||||||
const res = await deviceManageList(params);
|
const res = await deviceManageList(params)
|
||||||
if (res && res.rows && res.rows.length > 0) {
|
if (res && res.rows && res.rows.length > 0) {
|
||||||
rows = res.rows;
|
rows = res.rows
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const arr = rows.map((item: DeviceManageForm) => {
|
const arr = rows.map((item: DeviceManageForm) => {
|
||||||
@@ -116,8 +149,8 @@ async function loadDeviceList() {
|
|||||||
value: item.id,
|
value: item.id,
|
||||||
deviceIp: item.deviceIp,
|
deviceIp: item.deviceIp,
|
||||||
deviceId: item.id,
|
deviceId: item.id,
|
||||||
};
|
}
|
||||||
});
|
})
|
||||||
|
|
||||||
formApi.updateSchema([
|
formApi.updateSchema([
|
||||||
{
|
{
|
||||||
@@ -125,9 +158,9 @@ async function loadDeviceList() {
|
|||||||
options: arr,
|
options: arr,
|
||||||
mode: 'multiple', // 关键属性,启用多选模式
|
mode: 'multiple', // 关键属性,启用多选模式
|
||||||
onChange: async (value: string, option: any) => {
|
onChange: async (value: string, option: any) => {
|
||||||
const data = cloneDeep(await formApi.getValues());
|
const data = cloneDeep(await formApi.getValues())
|
||||||
data.remoteCallElevatorDeviceId = option;
|
data.remoteCallElevatorDeviceId = option
|
||||||
formApi.setValues(data);
|
formApi.setValues(data)
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
fieldName: 'remoteCallElevatorDeviceId',
|
fieldName: 'remoteCallElevatorDeviceId',
|
||||||
@@ -137,29 +170,29 @@ async function loadDeviceList() {
|
|||||||
options: arr,
|
options: arr,
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
onChange: async (value: string, option: any) => {
|
onChange: async (value: string, option: any) => {
|
||||||
const data = cloneDeep(await formApi.getValues());
|
const data = cloneDeep(await formApi.getValues())
|
||||||
data.elevatorControlDeviceId = option;
|
data.elevatorControlDeviceId = option
|
||||||
formApi.setValues(data);
|
formApi.setValues(data)
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
fieldName: 'elevatorControlDeviceId',
|
fieldName: 'elevatorControlDeviceId',
|
||||||
},
|
},
|
||||||
]);
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 初始化城市
|
* 初始化城市
|
||||||
*/
|
*/
|
||||||
async function setupCommunitySelect() {
|
async function setupCommunitySelect() {
|
||||||
const areaList = await communityTree(3);
|
const areaList = await communityTree(2)
|
||||||
// 选中后显示在输入框的值 即父节点 / 子节点
|
// 选中后显示在输入框的值 即父节点 / 子节点
|
||||||
// addFullName(areaList, 'areaName', ' / ');
|
// addFullName(areaList, 'areaName', ' / ');
|
||||||
const splitStr = '/';
|
const splitStr = '/'
|
||||||
handleNode(areaList, 'label', splitStr, function (node: any) {
|
handleNode(areaList, 'label', splitStr, function (node: any) {
|
||||||
if (node.level != 3) {
|
if (node.level != 2) {
|
||||||
node.disabled = true;
|
node.disabled = true
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
formApi.updateSchema([
|
formApi.updateSchema([
|
||||||
{
|
{
|
||||||
componentProps: () => ({
|
componentProps: () => ({
|
||||||
@@ -170,6 +203,9 @@ async function setupCommunitySelect() {
|
|||||||
value: 'code',
|
value: 'code',
|
||||||
children: 'children',
|
children: 'children',
|
||||||
},
|
},
|
||||||
|
onChange: async (value: any) => {
|
||||||
|
await handleGetFloor(value)
|
||||||
|
},
|
||||||
getPopupContainer,
|
getPopupContainer,
|
||||||
placeholder: '请选择建筑',
|
placeholder: '请选择建筑',
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
@@ -181,19 +217,66 @@ async function setupCommunitySelect() {
|
|||||||
// 选中后显示在输入框的值
|
// 选中后显示在输入框的值
|
||||||
treeNodeLabelProp: 'fullName',
|
treeNodeLabelProp: 'fullName',
|
||||||
}),
|
}),
|
||||||
fieldName: 'unitId',
|
fieldName: 'buildingId',
|
||||||
},
|
},
|
||||||
]);
|
])
|
||||||
|
}
|
||||||
|
|
||||||
|
interface floor {
|
||||||
|
out: string
|
||||||
|
in: string
|
||||||
|
num: string | number
|
||||||
|
id: string | number
|
||||||
|
}
|
||||||
|
const floorList = ref<floor[]>([])
|
||||||
|
const dynamicValidateForm = reactive<{ floor: floor[] }>({
|
||||||
|
floor: [],
|
||||||
|
})
|
||||||
|
async function handleGetFloor(unitId: string | number) {
|
||||||
|
try {
|
||||||
|
const res = await queryByBuildingId(unitId)
|
||||||
|
floorList.value = []
|
||||||
|
res.forEach((item) => {
|
||||||
|
floorList.value.push({
|
||||||
|
out: '',
|
||||||
|
in: '',
|
||||||
|
num: item.floorNumber,
|
||||||
|
id: item.id,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
dynamicValidateForm.floor = floorList.value
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取楼层列表失败:', error)
|
||||||
|
floorList.value = []
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleClosed() {
|
async function handleClosed() {
|
||||||
await formApi.resetForm();
|
await formApi.resetForm()
|
||||||
resetInitialized();
|
resetInitialized()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<BasicModal :title="title">
|
<BasicModal :title="title">
|
||||||
|
<Tabs style="height: 600px !important">
|
||||||
|
<TabPane key="1" tab="基本信息">
|
||||||
<BasicForm />
|
<BasicForm />
|
||||||
|
</TabPane>
|
||||||
|
<TabPane key="2" tab="楼层信息">
|
||||||
|
<Form :model="dynamicValidateForm" layout="inline">
|
||||||
|
<Space v-for="(floor, index) in dynamicValidateForm.floor" :key="floor.id"
|
||||||
|
style="display: flex; margin-bottom: 8px" align="baseline">
|
||||||
|
<FormItem :label="'楼层' + (floor.num)" :name="['floor', index, 'out']">
|
||||||
|
<Input v-model:value="floor.out" placeholder="外部按键通道" />
|
||||||
|
</FormItem>
|
||||||
|
<FormItem :name="['floor', index, 'in']">
|
||||||
|
<Input v-model:value="floor.in" placeholder="内部按键通道" />
|
||||||
|
</FormItem>
|
||||||
|
</Space>
|
||||||
|
</Form>
|
||||||
|
</TabPane>
|
||||||
|
</Tabs>
|
||||||
</BasicModal>
|
</BasicModal>
|
||||||
</template>
|
</template>
|
||||||
|
Reference in New Issue
Block a user