合并代码
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import type { PageParam } from '@/api';
|
import type { PageParam } from '@/api';
|
||||||
import { ProjectOrder } from "@/api/tower/project/order/model";
|
import { ProjectOrder } from '@/api/tower/project/order/model';
|
||||||
import { ProjectPlace } from "@/api/tower/project/place/model";
|
import { ProjectPlace } from '@/api/tower/project/place/model';
|
||||||
|
import { ProjectUser } from '@/api/tower/project/user/model';
|
||||||
|
|
||||||
interface FileItem {
|
interface FileItem {
|
||||||
uid: number;
|
uid: number;
|
||||||
@@ -38,8 +39,10 @@ export interface Project {
|
|||||||
userId?: number;
|
userId?: number;
|
||||||
comments?: string;
|
comments?: string;
|
||||||
sortNumber?: number;
|
sortNumber?: number;
|
||||||
|
users?: ProjectUser[];
|
||||||
orders?: ProjectOrder[];
|
orders?: ProjectOrder[];
|
||||||
places?: ProjectPlace[];
|
places1?: ProjectPlace[];
|
||||||
|
places2?: ProjectPlace[];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ export interface ProjectUser {
|
|||||||
avatar?: string;
|
avatar?: string;
|
||||||
email?: string;
|
email?: string;
|
||||||
phone?: string;
|
phone?: string;
|
||||||
|
organizationName?: string;
|
||||||
projectId?: number;
|
projectId?: number;
|
||||||
status?: string;
|
status?: string;
|
||||||
createTime?: string;
|
createTime?: string;
|
||||||
|
|||||||
64
src/components/DictSelectMultiple/index.vue
Normal file
64
src/components/DictSelectMultiple/index.vue
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
<template>
|
||||||
|
<a-select
|
||||||
|
show-search
|
||||||
|
optionFilterProp="label"
|
||||||
|
:options="data"
|
||||||
|
allow-clear
|
||||||
|
:value="value"
|
||||||
|
mode="multiple"
|
||||||
|
:placeholder="placeholder"
|
||||||
|
@update:value="updateValue"
|
||||||
|
@blur="onBlur"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { message } from 'ant-design-vue';
|
||||||
|
import { listDictionaryData } from '@/api/system/dictionary-data';
|
||||||
|
import type { SelectProps } from 'ant-design-vue';
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'update:value', value: string): void;
|
||||||
|
(e: 'blur'): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const props = withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
value?: string;
|
||||||
|
placeholder?: string;
|
||||||
|
dictCode?: string;
|
||||||
|
}>(),
|
||||||
|
{
|
||||||
|
placeholder: '请选择服务器厂商'
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// 字典数据
|
||||||
|
const data = ref<SelectProps['options']>([]);
|
||||||
|
|
||||||
|
/* 更新选中数据 */
|
||||||
|
const updateValue = (value: string) => {
|
||||||
|
emit('update:value', value);
|
||||||
|
};
|
||||||
|
/* 获取字典数据 */
|
||||||
|
listDictionaryData({
|
||||||
|
dictCode: props.dictCode
|
||||||
|
})
|
||||||
|
.then((list) => {
|
||||||
|
data.value = list.map((d) => {
|
||||||
|
return {
|
||||||
|
value: d.dictDataCode,
|
||||||
|
label: d.dictDataName
|
||||||
|
};
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 失去焦点 */
|
||||||
|
const onBlur = () => {
|
||||||
|
emit('blur');
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -106,6 +106,10 @@
|
|||||||
title: '部位名称',
|
title: '部位名称',
|
||||||
dataIndex: 'name'
|
dataIndex: 'name'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '部位类型',
|
||||||
|
dataIndex: 'type'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
key: 'action',
|
key: 'action',
|
||||||
|
|||||||
@@ -397,7 +397,6 @@
|
|||||||
import { useThemeStore } from '@/store/modules/theme';
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import { UploadOutlined } from '@ant-design/icons-vue';
|
import { UploadOutlined } from '@ant-design/icons-vue';
|
||||||
import DictSelect from '@/views/search/components/dict-select.vue';
|
|
||||||
import { FormInstance } from 'ant-design-vue/es/form';
|
import { FormInstance } from 'ant-design-vue/es/form';
|
||||||
import { TOKEN_STORE_NAME } from '@/config/setting';
|
import { TOKEN_STORE_NAME } from '@/config/setting';
|
||||||
import { Warehouse } from '@/api/tower/warehouse/model';
|
import { Warehouse } from '@/api/tower/warehouse/model';
|
||||||
|
|||||||
@@ -382,7 +382,6 @@
|
|||||||
import { useThemeStore } from '@/store/modules/theme';
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import { UploadOutlined } from '@ant-design/icons-vue';
|
import { UploadOutlined } from '@ant-design/icons-vue';
|
||||||
import DictSelect from '@/views/search/components/dict-select.vue';
|
|
||||||
import { FormInstance } from 'ant-design-vue/es/form';
|
import { FormInstance } from 'ant-design-vue/es/form';
|
||||||
import { TOKEN_STORE_NAME } from '@/config/setting';
|
import { TOKEN_STORE_NAME } from '@/config/setting';
|
||||||
import { Warehouse } from '@/api/tower/warehouse/model';
|
import { Warehouse } from '@/api/tower/warehouse/model';
|
||||||
|
|||||||
@@ -114,6 +114,7 @@
|
|||||||
import type { ColumnsType } from 'ant-design-vue/es/table';
|
import type { ColumnsType } from 'ant-design-vue/es/table';
|
||||||
import { ProjectOrder } from '@/api/tower/project/order/model';
|
import { ProjectOrder } from '@/api/tower/project/order/model';
|
||||||
import { removeProjectOrder } from '@/api/tower/project/order';
|
import { removeProjectOrder } from '@/api/tower/project/order';
|
||||||
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
@@ -173,7 +174,7 @@
|
|||||||
key: 'startTime'
|
key: 'startTime'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '预计进场时间',
|
title: '预计退场时间',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
dataIndex: 'endTime',
|
dataIndex: 'endTime',
|
||||||
key: 'endTime'
|
key: 'endTime'
|
||||||
@@ -249,8 +250,9 @@
|
|||||||
|
|
||||||
/* 删除 */
|
/* 删除 */
|
||||||
const remove = (_row: any, index: number) => {
|
const remove = (_row: any, index: number) => {
|
||||||
console.log(_row);
|
removeProjectOrder(_row.projectOrderId).then((msg) => {
|
||||||
removeProjectOrder(_row.projectOrderId);
|
message.success(msg);
|
||||||
|
});
|
||||||
list.value.splice(index, 1);
|
list.value.splice(index, 1);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -260,6 +262,7 @@
|
|||||||
if (value) {
|
if (value) {
|
||||||
list.value = value;
|
list.value = value;
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="loading">
|
||||||
<a-space style="margin-bottom: 10px">
|
<a-space style="margin-bottom: 10px">
|
||||||
<TowerPlaceSelect
|
<TowerPlaceSelect :placeholder="`选择检查部位`" @done="choosePlace" />
|
||||||
:placeholder="`选择检查部位`"
|
|
||||||
@done="chooseEquipmentName"
|
|
||||||
/>
|
|
||||||
<span>设备名称</span>
|
<span>设备名称</span>
|
||||||
<div style="width: 200px">
|
<div style="width: 200px">
|
||||||
<TowerEquipmentType
|
<TowerEquipmentType
|
||||||
@@ -38,10 +35,7 @@
|
|||||||
import { ref, reactive, watch } from 'vue';
|
import { ref, reactive, watch } from 'vue';
|
||||||
import type { ColumnsType } from 'ant-design-vue/es/table';
|
import type { ColumnsType } from 'ant-design-vue/es/table';
|
||||||
import { ProjectPlace } from '@/api/tower/project/place/model';
|
import { ProjectPlace } from '@/api/tower/project/place/model';
|
||||||
import {
|
import { removeProjectPlace } from '@/api/tower/project/place';
|
||||||
addProjectPlace,
|
|
||||||
removeProjectPlace
|
|
||||||
} from '@/api/tower/project/place';
|
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
@@ -104,14 +98,9 @@
|
|||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const chooseEquipmentName = (data) => {
|
const choosePlace = (data) => {
|
||||||
addProjectPlace({
|
data.projectId = props.projectId;
|
||||||
projectId: props.projectId,
|
list.value.push(data);
|
||||||
placeId: data.placeId
|
|
||||||
}).then((msg) => {
|
|
||||||
message.success(msg);
|
|
||||||
emit('done');
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const onSearch = () => {
|
const onSearch = () => {
|
||||||
@@ -120,9 +109,10 @@
|
|||||||
|
|
||||||
/* 删除 */
|
/* 删除 */
|
||||||
const remove = (_row: any, index: number) => {
|
const remove = (_row: any, index: number) => {
|
||||||
removeProjectPlace(_row.id).then(() => {
|
removeProjectPlace(_row.id).then((msg) => {
|
||||||
list.value.splice(index, 1);
|
message.success(msg);
|
||||||
});
|
});
|
||||||
|
list.value.splice(index, 1);
|
||||||
};
|
};
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
@@ -131,6 +121,7 @@
|
|||||||
if (value) {
|
if (value) {
|
||||||
list.value = value;
|
list.value = value;
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="loading">
|
||||||
<a-space style="margin-bottom: 10px">
|
<a-space style="margin-bottom: 10px">
|
||||||
<TowerPlaceSelect
|
<TowerPlaceSelect :placeholder="`选择保养部位`" @done="choosePlace" />
|
||||||
:placeholder="`选择保养部位`"
|
|
||||||
@done="chooseEquipmentName"
|
|
||||||
/>
|
|
||||||
<span>设备名称</span>
|
<span>设备名称</span>
|
||||||
<div style="width: 200px">
|
<div style="width: 200px">
|
||||||
<TowerEquipmentType
|
<TowerEquipmentType
|
||||||
@@ -38,10 +35,7 @@
|
|||||||
import { ref, reactive, watch } from 'vue';
|
import { ref, reactive, watch } from 'vue';
|
||||||
import type { ColumnsType } from 'ant-design-vue/es/table';
|
import type { ColumnsType } from 'ant-design-vue/es/table';
|
||||||
import { ProjectOrder } from '@/api/tower/project/order/model';
|
import { ProjectOrder } from '@/api/tower/project/order/model';
|
||||||
import {
|
import { removeProjectPlace } from '@/api/tower/project/place';
|
||||||
addProjectPlace,
|
|
||||||
removeProjectPlace
|
|
||||||
} from '@/api/tower/project/place';
|
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
@@ -104,15 +98,9 @@
|
|||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const chooseEquipmentName = (data) => {
|
const choosePlace = (data) => {
|
||||||
console.log(data);
|
data.projectId = props.projectId;
|
||||||
addProjectPlace({
|
list.value.push(data);
|
||||||
projectId: props.projectId,
|
|
||||||
placeId: data.placeId
|
|
||||||
}).then((msg) => {
|
|
||||||
message.success(msg);
|
|
||||||
emit('done');
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const onSearch = () => {
|
const onSearch = () => {
|
||||||
@@ -121,9 +109,10 @@
|
|||||||
|
|
||||||
/* 删除 */
|
/* 删除 */
|
||||||
const remove = (_row: any, index: number) => {
|
const remove = (_row: any, index: number) => {
|
||||||
removeProjectPlace(_row.id).then(() => {
|
removeProjectPlace(_row.id).then((msg) => {
|
||||||
list.value.splice(index, 1);
|
message.success(msg);
|
||||||
});
|
});
|
||||||
|
list.value.splice(index, 1);
|
||||||
};
|
};
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
@@ -132,6 +121,7 @@
|
|||||||
if (value) {
|
if (value) {
|
||||||
list.value = value;
|
list.value = value;
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -150,9 +150,8 @@
|
|||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="汽吊规格" name="truckCraneSpecs">
|
<a-form-item label="汽吊规格" name="truckCraneSpecs">
|
||||||
<DictSelect
|
<DictSelectMultiple
|
||||||
dict-code="TruckCraneSpecs"
|
dict-code="TruckCraneSpecs"
|
||||||
multiple="multiple"
|
|
||||||
v-model:value="form.truckCraneSpecs"
|
v-model:value="form.truckCraneSpecs"
|
||||||
placeholder="选择汽吊规格"
|
placeholder="选择汽吊规格"
|
||||||
/>
|
/>
|
||||||
@@ -168,7 +167,7 @@
|
|||||||
v-bind="styleResponsive ? { md: 8, sm: 24, xs: 24 } : { span: 8 }"
|
v-bind="styleResponsive ? { md: 8, sm: 24, xs: 24 } : { span: 8 }"
|
||||||
>
|
>
|
||||||
<a-form-item label="项目负责人" name="director">
|
<a-form-item label="项目负责人" name="director">
|
||||||
<SelectUser
|
<SelectStaff
|
||||||
:placeholder="`请选择所属人员`"
|
:placeholder="`请选择所属人员`"
|
||||||
v-model:value="form.director"
|
v-model:value="form.director"
|
||||||
@done="chooseDirector"
|
@done="chooseDirector"
|
||||||
@@ -190,7 +189,7 @@
|
|||||||
v-bind="styleResponsive ? { md: 8, sm: 24, xs: 24 } : { span: 8 }"
|
v-bind="styleResponsive ? { md: 8, sm: 24, xs: 24 } : { span: 8 }"
|
||||||
>
|
>
|
||||||
<a-form-item label="业务负责人" name="salesman">
|
<a-form-item label="业务负责人" name="salesman">
|
||||||
<SelectUser
|
<SelectStaff
|
||||||
:placeholder="`请选择业务负责人`"
|
:placeholder="`请选择业务负责人`"
|
||||||
v-model:value="form.salesman"
|
v-model:value="form.salesman"
|
||||||
@done="chooseSalesman"
|
@done="chooseSalesman"
|
||||||
@@ -202,58 +201,7 @@
|
|||||||
|
|
||||||
<a-divider style="height: 8px" />
|
<a-divider style="height: 8px" />
|
||||||
<a-card title="项目成员" :bordered="false">
|
<a-card title="项目成员" :bordered="false">
|
||||||
<div class="content">
|
<UserList :project-id="form.projectId" v-model:value="form.users" />
|
||||||
<a-space style="margin-bottom: 15px" v-if="isUpdate">
|
|
||||||
<SelectStaff :placeholder="`添加可见成员`" @done="onViewUsers" />
|
|
||||||
<SelectStaff
|
|
||||||
:placeholder="`添加项目联系人`"
|
|
||||||
@done="onContactUsers"
|
|
||||||
/>
|
|
||||||
</a-space>
|
|
||||||
<table
|
|
||||||
class="ele-table ele-table-border ele-table-stripe ele-table-medium"
|
|
||||||
>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>类型</th>
|
|
||||||
<th>姓名</th>
|
|
||||||
<th>手机号码</th>
|
|
||||||
<th>加入时间</th>
|
|
||||||
<th>操作</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr v-for="user in projectUsers">
|
|
||||||
<td>
|
|
||||||
<a-tag color="green" v-if="user.role === 10"
|
|
||||||
>可见成员</a-tag
|
|
||||||
>
|
|
||||||
<a-tag color="orange" v-if="user.role === 20"
|
|
||||||
>项目联系人</a-tag
|
|
||||||
>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<a-avatar :src="user.avatar">
|
|
||||||
<template #icon>
|
|
||||||
<user-outlined />
|
|
||||||
</template>
|
|
||||||
</a-avatar>
|
|
||||||
<span style="padding-left: 5px">{{ user.nickname }}</span>
|
|
||||||
</td>
|
|
||||||
<td>{{ user.phone }}</td>
|
|
||||||
<td>{{ user.createTime }}</td>
|
|
||||||
<td>
|
|
||||||
<div v-if="user.role !== 30">
|
|
||||||
<a @click="removeUser(user)" v-if="user.status === 0">
|
|
||||||
移除
|
|
||||||
</a>
|
|
||||||
<a v-else>待确认</a>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
<a-divider style="height: 8px" />
|
<a-divider style="height: 8px" />
|
||||||
@@ -270,7 +218,7 @@
|
|||||||
<a-tab-pane key="1" tab="检查部位">
|
<a-tab-pane key="1" tab="检查部位">
|
||||||
<InspectList
|
<InspectList
|
||||||
:project-id="form.projectId"
|
:project-id="form.projectId"
|
||||||
v-model:value="form.places"
|
v-model:value="form.places1"
|
||||||
@done="reload"
|
@done="reload"
|
||||||
@search="onSearch"
|
@search="onSearch"
|
||||||
/>
|
/>
|
||||||
@@ -278,7 +226,7 @@
|
|||||||
<a-tab-pane key="2" tab="保养部位" force-render>
|
<a-tab-pane key="2" tab="保养部位" force-render>
|
||||||
<MaintenanceList
|
<MaintenanceList
|
||||||
:project-id="form.projectId"
|
:project-id="form.projectId"
|
||||||
v-model:value="form.places"
|
v-model:value="form.places2"
|
||||||
@done="reload"
|
@done="reload"
|
||||||
@search="onSearch"
|
@search="onSearch"
|
||||||
/>
|
/>
|
||||||
@@ -302,8 +250,7 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, reactive, watch } from 'vue';
|
import { ref, reactive, watch } from 'vue';
|
||||||
import { Form, message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
import { assignObject } from 'ele-admin-pro';
|
|
||||||
import { addProject, updateProject } from '@/api/tower/project';
|
import { addProject, updateProject } from '@/api/tower/project';
|
||||||
import type { Project } from '@/api/tower/project/model';
|
import type { Project } from '@/api/tower/project/model';
|
||||||
import { useThemeStore } from '@/store/modules/theme';
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
@@ -312,26 +259,21 @@
|
|||||||
import { FormInstance } from 'ant-design-vue/es/form';
|
import { FormInstance } from 'ant-design-vue/es/form';
|
||||||
import { Customer } from '@/api/oa/customer/model';
|
import { Customer } from '@/api/oa/customer/model';
|
||||||
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||||
import DictSelect from '@/views/search/components/dict-select.vue';
|
|
||||||
import { User } from '@/api/system/user/model';
|
import { User } from '@/api/system/user/model';
|
||||||
import { uploadFile } from '@/api/system/file';
|
import { uploadFile } from '@/api/system/file';
|
||||||
import { FILE_SERVER } from '@/config/setting';
|
import { FILE_SERVER } from '@/config/setting';
|
||||||
|
import UserList from './user-list.vue';
|
||||||
import EquipmentList from './equipment-list.vue';
|
import EquipmentList from './equipment-list.vue';
|
||||||
import InspectList from './inspect-list.vue';
|
import InspectList from './inspect-list.vue';
|
||||||
import MaintenanceList from './maintenance-list.vue';
|
import MaintenanceList from './maintenance-list.vue';
|
||||||
import { CenterPoint } from 'ele-admin-pro/es/ele-map-picker/types';
|
import { CenterPoint } from 'ele-admin-pro/es/ele-map-picker/types';
|
||||||
import {
|
import { listProjectUser } from '@/api/tower/project/user';
|
||||||
addProjectUser,
|
|
||||||
listProjectUser,
|
|
||||||
removeProjectUser
|
|
||||||
} from '@/api/tower/project/user';
|
|
||||||
import { ProjectUser } from '@/api/tower/project/user/model';
|
|
||||||
import { listProjectOrder } from '@/api/tower/project/order';
|
import { listProjectOrder } from '@/api/tower/project/order';
|
||||||
import { listProjectPlace } from '@/api/tower/project/place';
|
import { listProjectPlace } from '@/api/tower/project/place';
|
||||||
|
import useFormData from '@/utils/use-form-data';
|
||||||
|
|
||||||
// 是否是修改
|
// 是否是修改
|
||||||
const isUpdate = ref(false);
|
const isUpdate = ref(false);
|
||||||
const useForm = Form.useForm;
|
|
||||||
// 是否开启响应式布局
|
// 是否开启响应式布局
|
||||||
const themeStore = useThemeStore();
|
const themeStore = useThemeStore();
|
||||||
const { styleResponsive } = storeToRefs(themeStore);
|
const { styleResponsive } = storeToRefs(themeStore);
|
||||||
@@ -358,15 +300,13 @@
|
|||||||
const showMap = ref(false);
|
const showMap = ref(false);
|
||||||
const activeKey = ref<string>('1');
|
const activeKey = ref<string>('1');
|
||||||
const keywords = ref<string>();
|
const keywords = ref<string>();
|
||||||
// 项目成员
|
|
||||||
const projectUsers = ref<ProjectUser[]>([]);
|
|
||||||
// 省市区
|
// 省市区
|
||||||
const city = ref<string[]>([]);
|
const city = ref<string[]>([]);
|
||||||
const { darkMode } = storeToRefs(themeStore);
|
const { darkMode } = storeToRefs(themeStore);
|
||||||
const formRef = ref<FormInstance | null>(null);
|
const formRef = ref<FormInstance | null>(null);
|
||||||
|
|
||||||
// 用户信息
|
// 表单数据
|
||||||
const form = reactive<Project>({
|
const { form, resetFields, assignFields } = useFormData<Project>({
|
||||||
projectId: undefined,
|
projectId: undefined,
|
||||||
projectName: '',
|
projectName: '',
|
||||||
projectImage: '',
|
projectImage: '',
|
||||||
@@ -380,19 +320,22 @@
|
|||||||
superviseNo: '',
|
superviseNo: '',
|
||||||
licenceNo: '',
|
licenceNo: '',
|
||||||
securityStatus: undefined,
|
securityStatus: undefined,
|
||||||
competentDepartment: '',
|
competentDepartment: undefined,
|
||||||
dismantlingCompany: '',
|
dismantlingCompany: '',
|
||||||
truckCraneSpecs: '',
|
truckCraneSpecs: undefined,
|
||||||
contract: '',
|
contract: '',
|
||||||
director: '',
|
director: '',
|
||||||
projectDirector: '',
|
projectDirector: '',
|
||||||
projectStatus: '',
|
projectStatus: undefined,
|
||||||
salesman: '',
|
salesman: '',
|
||||||
status: 0,
|
status: 0,
|
||||||
userId: 0,
|
userId: 0,
|
||||||
comments: '',
|
comments: '',
|
||||||
sortNumber: 100,
|
sortNumber: 100,
|
||||||
orders: []
|
users: [],
|
||||||
|
orders: [],
|
||||||
|
places1: [],
|
||||||
|
places2: []
|
||||||
});
|
});
|
||||||
|
|
||||||
/* 更新visible */
|
/* 更新visible */
|
||||||
@@ -488,52 +431,6 @@
|
|||||||
form.salesman = data.nickname;
|
form.salesman = data.nickname;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 添加可见成员
|
|
||||||
const onViewUsers = (data: User) => {
|
|
||||||
console.log(data.userId);
|
|
||||||
addProjectUser({
|
|
||||||
userId: data.userId,
|
|
||||||
projectId: props.data?.projectId,
|
|
||||||
role: 10
|
|
||||||
})
|
|
||||||
.then((msg) => {
|
|
||||||
message.success(msg);
|
|
||||||
reload();
|
|
||||||
})
|
|
||||||
.catch((e) => {
|
|
||||||
message.error(e.message);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// 添加项目联系人
|
|
||||||
const onContactUsers = (data: User) => {
|
|
||||||
console.log(data.userId);
|
|
||||||
addProjectUser({
|
|
||||||
userId: data.userId,
|
|
||||||
projectId: props.data?.projectId,
|
|
||||||
role: 20
|
|
||||||
})
|
|
||||||
.then((msg) => {
|
|
||||||
message.success(msg);
|
|
||||||
reload();
|
|
||||||
})
|
|
||||||
.catch((e) => {
|
|
||||||
message.error(e.message);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// 移除成员
|
|
||||||
const removeUser = (data: ProjectUser) => {
|
|
||||||
removeProjectUser(data.id)
|
|
||||||
.then((msg) => {
|
|
||||||
message.success(msg);
|
|
||||||
reload();
|
|
||||||
})
|
|
||||||
.catch((e) => {
|
|
||||||
message.error(e.message);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/* 地图选择后回调 */
|
/* 地图选择后回调 */
|
||||||
const onDone = (location: CenterPoint) => {
|
const onDone = (location: CenterPoint) => {
|
||||||
console.log(location);
|
console.log(location);
|
||||||
@@ -543,9 +440,6 @@
|
|||||||
`${location.city?.district}`
|
`${location.city?.district}`
|
||||||
];
|
];
|
||||||
form.projectRegion = `${location.city?.city} ${location.city?.district}`;
|
form.projectRegion = `${location.city?.city} ${location.city?.district}`;
|
||||||
// form.province = `${location.city?.province}`;
|
|
||||||
// form.city = `${location.city?.city}`;
|
|
||||||
// form.region = `${location.city?.district}`;
|
|
||||||
form.projectAddress = `${location.address}`;
|
form.projectAddress = `${location.address}`;
|
||||||
form.latitude = `${location.lat}`;
|
form.latitude = `${location.lat}`;
|
||||||
form.longitude = `${location.lng}`;
|
form.longitude = `${location.lng}`;
|
||||||
@@ -596,8 +490,6 @@
|
|||||||
reload();
|
reload();
|
||||||
};
|
};
|
||||||
|
|
||||||
const { resetFields, validate, validateInfos } = useForm(form, rules);
|
|
||||||
|
|
||||||
/* 保存编辑 */
|
/* 保存编辑 */
|
||||||
const save = () => {
|
const save = () => {
|
||||||
if (!formRef.value) {
|
if (!formRef.value) {
|
||||||
@@ -635,42 +527,60 @@
|
|||||||
if (activeKey.value == '2') {
|
if (activeKey.value == '2') {
|
||||||
keywords.value = '保养';
|
keywords.value = '保养';
|
||||||
}
|
}
|
||||||
reload();
|
if (isUpdate.value) {
|
||||||
|
reload();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const reload = () => {
|
const reload = () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
// 加载项目成员
|
if (props.data?.projectId) {
|
||||||
listProjectUser({
|
// 加载项目成员
|
||||||
projectId: props.data?.projectId
|
listProjectUser({
|
||||||
}).then((data) => {
|
projectId: props.data?.projectId
|
||||||
projectUsers.value = data;
|
})
|
||||||
});
|
.then((data) => {
|
||||||
// 加载项目合同预定设备清单
|
form.users = data;
|
||||||
listProjectOrder({ projectId: props.data?.projectId })
|
})
|
||||||
.then((data) => {
|
.catch((e) => {
|
||||||
console.log(data);
|
message.error(e.message);
|
||||||
form.orders = data.map((d) => {
|
|
||||||
return {
|
|
||||||
...d,
|
|
||||||
isEdit: false
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
|
// 加载项目合同预定设备清单
|
||||||
|
listProjectOrder({ projectId: props.data?.projectId })
|
||||||
|
.then((data) => {
|
||||||
|
form.orders = data.map((d) => {
|
||||||
|
return {
|
||||||
|
...d,
|
||||||
|
isEdit: false
|
||||||
|
};
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
// 加载检查/保养部位配置
|
||||||
|
listProjectPlace({
|
||||||
|
projectId: props.data?.projectId,
|
||||||
|
keywords: '巡检'
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.then((data) => {
|
||||||
message.error(e.message);
|
form.places1 = data;
|
||||||
});
|
})
|
||||||
// 加载检查/保养部位配置
|
.catch((e) => {
|
||||||
listProjectPlace({
|
message.error(e.message);
|
||||||
projectId: props.data?.projectId,
|
});
|
||||||
keywords: keywords.value
|
// 加载检查/保养部位配置
|
||||||
})
|
listProjectPlace({
|
||||||
.then((data) => {
|
projectId: props.data?.projectId,
|
||||||
form.places = data;
|
keywords: '保养'
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.then((data) => {
|
||||||
message.error(e.message);
|
form.places2 = data;
|
||||||
});
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
reload();
|
reload();
|
||||||
|
|
||||||
@@ -679,8 +589,9 @@
|
|||||||
(visible) => {
|
(visible) => {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
if (props.data) {
|
if (props.data) {
|
||||||
assignObject(form, props.data);
|
assignFields({
|
||||||
|
...props.data
|
||||||
|
});
|
||||||
images.value = [];
|
images.value = [];
|
||||||
if (props.data.projectImage) {
|
if (props.data.projectImage) {
|
||||||
const arr = JSON.parse(props.data.projectImage);
|
const arr = JSON.parse(props.data.projectImage);
|
||||||
@@ -698,6 +609,11 @@
|
|||||||
reload();
|
reload();
|
||||||
isUpdate.value = true;
|
isUpdate.value = true;
|
||||||
} else {
|
} else {
|
||||||
|
images.value = [];
|
||||||
|
form.places1 = [];
|
||||||
|
form.places2 = [];
|
||||||
|
form.users = [];
|
||||||
|
form.orders = [];
|
||||||
isUpdate.value = false;
|
isUpdate.value = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
142
src/views/tower/project/components/user-list.vue
Normal file
142
src/views/tower/project/components/user-list.vue
Normal file
@@ -0,0 +1,142 @@
|
|||||||
|
<template>
|
||||||
|
<a-spin :spinning="loading">
|
||||||
|
<!-- <a-button type="primary" style="margin-bottom: 10px" @click="add">-->
|
||||||
|
<!-- <span>添加</span>-->
|
||||||
|
<!-- </a-button>-->
|
||||||
|
<a-space style="margin-bottom: 15px">
|
||||||
|
<SelectStaff :placeholder="`添加可见成员`" @done="addUsers10" />
|
||||||
|
<SelectStaff :placeholder="`添加项目联系人`" @done="addUsers20" />
|
||||||
|
</a-space>
|
||||||
|
<a-table
|
||||||
|
size="middle"
|
||||||
|
row-key="projectOrderId"
|
||||||
|
:pagination="false"
|
||||||
|
:data-source="list"
|
||||||
|
:columns="columns"
|
||||||
|
>
|
||||||
|
<template #bodyCell="{ column, record, index }">
|
||||||
|
<template v-if="column.key === 'role'">
|
||||||
|
<a-tag color="green" v-if="record.role === 10">可见成员</a-tag>
|
||||||
|
<a-tag color="orange" v-if="record.role === 20">项目联系人</a-tag>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'action'">
|
||||||
|
<a-space>
|
||||||
|
<a class="ele-text-danger" @click="remove(record, index)">移除</a>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</a-table>
|
||||||
|
</a-spin>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, reactive, watch } from 'vue';
|
||||||
|
import type { ColumnsType } from 'ant-design-vue/es/table';
|
||||||
|
import { ProjectUser } from '@/api/tower/project/user/model';
|
||||||
|
import { removeProjectUser } from '@/api/tower/project/user';
|
||||||
|
import { User } from '@/api/system/user/model';
|
||||||
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
|
const props = withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
value?: ProjectUser[];
|
||||||
|
projectId?: number;
|
||||||
|
placeholder?: string;
|
||||||
|
}>(),
|
||||||
|
{
|
||||||
|
placeholder: '请选择数据'
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// 已添加成员
|
||||||
|
const list = ref<ProjectUser[]>([]);
|
||||||
|
// 请求状态
|
||||||
|
const loading = ref(false);
|
||||||
|
|
||||||
|
// 列
|
||||||
|
const columns = reactive<ColumnsType>([
|
||||||
|
{
|
||||||
|
key: 'index',
|
||||||
|
align: 'center',
|
||||||
|
width: 48,
|
||||||
|
customRender: ({ index }) => index + 1,
|
||||||
|
fixed: 'left'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '类型',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'role',
|
||||||
|
key: 'role'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '所在部门',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'organizationName'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '姓名',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'nickname',
|
||||||
|
key: 'nickname'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '手机号码',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'phone',
|
||||||
|
key: 'phone'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '加入时间',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
key: 'createTime'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
key: 'action',
|
||||||
|
align: 'center',
|
||||||
|
width: 100
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
// 添加可见成员
|
||||||
|
const addUsers10 = (data: User) => {
|
||||||
|
list.value.push({
|
||||||
|
userId: data.userId,
|
||||||
|
nickname: data.nickname,
|
||||||
|
role: 10,
|
||||||
|
phone: data.phone,
|
||||||
|
projectId: props.projectId,
|
||||||
|
organizationName: data.organizationName
|
||||||
|
});
|
||||||
|
};
|
||||||
|
// 添加项目联系人
|
||||||
|
const addUsers20 = (data: User) => {
|
||||||
|
list.value.push({
|
||||||
|
userId: data.userId,
|
||||||
|
nickname: data.nickname,
|
||||||
|
role: 20,
|
||||||
|
phone: data.phone,
|
||||||
|
projectId: props.projectId,
|
||||||
|
organizationName: data.organizationName
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 删除 */
|
||||||
|
const remove = (_row: any, index: number) => {
|
||||||
|
removeProjectUser(_row.id).then((msg) => {
|
||||||
|
message.success(msg);
|
||||||
|
});
|
||||||
|
list.value.splice(index, 1);
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.value,
|
||||||
|
(value) => {
|
||||||
|
if (value) {
|
||||||
|
list.value = value;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
@@ -10,6 +10,8 @@
|
|||||||
:datasource="datasource"
|
:datasource="datasource"
|
||||||
v-model:selection="selection"
|
v-model:selection="selection"
|
||||||
:customRow="customRow"
|
:customRow="customRow"
|
||||||
|
:height="tableHeight"
|
||||||
|
:full-height="fixedHeight ? 'calc(100vh - 100px)' : void 0"
|
||||||
tool-class="ele-toolbar-form"
|
tool-class="ele-toolbar-form"
|
||||||
:scroll="{ x: 1200 }"
|
:scroll="{ x: 1200 }"
|
||||||
class="sys-org-table"
|
class="sys-org-table"
|
||||||
@@ -21,7 +23,6 @@
|
|||||||
:selection="selection"
|
:selection="selection"
|
||||||
@add="openEdit"
|
@add="openEdit"
|
||||||
@remove="removeBatch"
|
@remove="removeBatch"
|
||||||
@advanced="openAdvanced"
|
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
@@ -33,9 +34,9 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'action'">
|
<template v-if="column.key === 'action'">
|
||||||
<a-space>
|
<a-space>
|
||||||
<a @click="openEdit(record)">库存查看</a>
|
<a @click="openEdit(record)">修改</a>
|
||||||
<a-divider type="vertical" />
|
<a-divider type="vertical" />
|
||||||
<a @click="openEdit(record)">项目年报</a>
|
<a @click="openEdit(record)">库存查看</a>
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
@@ -50,7 +51,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { createVNode, ref } from 'vue';
|
import { createVNode, computed, ref } from 'vue';
|
||||||
import { message, Modal } from 'ant-design-vue';
|
import { message, Modal } from 'ant-design-vue';
|
||||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||||
import type { EleProTable } from 'ele-admin-pro';
|
import type { EleProTable } from 'ele-admin-pro';
|
||||||
@@ -129,7 +130,7 @@
|
|||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
key: 'action',
|
key: 'action',
|
||||||
width: 200,
|
width: 150,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
hideInSetting: true
|
hideInSetting: true
|
||||||
}
|
}
|
||||||
@@ -143,8 +144,12 @@
|
|||||||
const showInfo = ref(false);
|
const showInfo = ref(false);
|
||||||
// 是否显示编辑弹窗
|
// 是否显示编辑弹窗
|
||||||
const showEdit = ref(false);
|
const showEdit = ref(false);
|
||||||
// 是否显示高级搜索
|
// 表格固定高度
|
||||||
const showAdvancedSearch = ref(false);
|
const fixedHeight = ref(true);
|
||||||
|
// 表格高度
|
||||||
|
const tableHeight = computed(() => {
|
||||||
|
return fixedHeight.value ? 'calc(100vh - 308px)' : void 0;
|
||||||
|
});
|
||||||
|
|
||||||
// 表格数据源
|
// 表格数据源
|
||||||
const datasource: DatasourceFunction = ({
|
const datasource: DatasourceFunction = ({
|
||||||
@@ -195,11 +200,6 @@
|
|||||||
showInfo.value = true;
|
showInfo.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* 打开高级搜索 */
|
|
||||||
const openAdvanced = () => {
|
|
||||||
showAdvancedSearch.value = !showAdvancedSearch.value;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* 删除单个 */
|
/* 删除单个 */
|
||||||
const remove = (row: Project) => {
|
const remove = (row: Project) => {
|
||||||
const hide = message.loading('请求中..', 0);
|
const hide = message.loading('请求中..', 0);
|
||||||
|
|||||||
@@ -29,10 +29,9 @@
|
|||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="企业类型" name="companyTypeMultiple">
|
<a-form-item label="企业类型" name="companyTypeMultiple">
|
||||||
<DictSelect
|
<DictSelectMultiple
|
||||||
dict-code="CompanyType"
|
dict-code="CompanyType"
|
||||||
placeholder="请选择企业类型"
|
placeholder="请选择企业类型"
|
||||||
multiple="multiple"
|
|
||||||
v-model:value="form.companyTypeMultiple"
|
v-model:value="form.companyTypeMultiple"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -154,7 +153,6 @@ import {ref, reactive, watch, computed} from 'vue';
|
|||||||
import type { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
import type { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||||
import { FILE_SERVER, FILE_THUMBNAIL } from "@/config/setting";
|
import { FILE_SERVER, FILE_THUMBNAIL } from "@/config/setting";
|
||||||
import { useUserStore } from '@/store/modules/user';
|
import { useUserStore } from '@/store/modules/user';
|
||||||
import DictSelect from "@/views/search/components/dict-select.vue";
|
|
||||||
import {
|
import {
|
||||||
EnvironmentOutlined
|
EnvironmentOutlined
|
||||||
} from '@ant-design/icons-vue';
|
} from '@ant-design/icons-vue';
|
||||||
|
|||||||
Reference in New Issue
Block a user