forked from b2894lxlx/tuanwei-admin
调整
This commit is contained in:
@@ -0,0 +1,243 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="ele-body">
|
||||
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||
<ele-pro-table
|
||||
ref="tableRef"
|
||||
row-key="worksheetId"
|
||||
:columns="columns"
|
||||
:datasource="datasource"
|
||||
v-model:selection="selection"
|
||||
tool-class="ele-toolbar-form"
|
||||
:scroll="{ x: 800 }"
|
||||
class="sys-org-table"
|
||||
>
|
||||
<template #toolbar>
|
||||
<search
|
||||
@search="reload"
|
||||
:selection="selection"
|
||||
@add="openEdit"
|
||||
@remove="removeBatch"
|
||||
@batchMove="openMove"
|
||||
/>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'status'">
|
||||
<span>{{ WORKSHEET_STATUS_LIST[record.status] }}</span>
|
||||
</template>
|
||||
<template v-if="column.key === 'equipmentType'">
|
||||
<span>{{ WORKSHEET_EQUIPMENT_TYPE[record.equipmentType] }}</span>
|
||||
</template>
|
||||
<template v-if="column.key === 'workType'">
|
||||
<span>{{ WORKSHEET_WORK_TYPE[record.workType] }}</span>
|
||||
</template>
|
||||
<template v-if="column.key === 'startUser'">
|
||||
<span>{{ record.startUser ?.nickname }}</span>
|
||||
</template>
|
||||
<template v-if="column.key === 'productionMangerUser'">
|
||||
<span>{{ record.productionMangerUser ?.nickname }}</span>
|
||||
</template>
|
||||
<template v-if="column.key === 'documentUser'">
|
||||
<span>{{ record.documentUser ?.nickname }}</span>
|
||||
</template>
|
||||
<template v-if="column.key === 'classManagerUser'">
|
||||
<span>{{ record.classManagerUser?.nickname }}</span>
|
||||
</template>
|
||||
<template v-if="column.key === 'createTime'">
|
||||
<a-tooltip :title="`${toDateString(record.createTime)}`">
|
||||
{{ timeAgo(record.createTime) }}
|
||||
</a-tooltip>
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<a @click="openInfo(record, 0)">查看安装单派单详情</a>
|
||||
<a @click="openInfo(record, 1)">查看加高单派单详情</a>
|
||||
<a @click="openInfo(record, 2)">查看拆卸单派单详情</a>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
</ele-pro-table>
|
||||
</a-card>
|
||||
</div>
|
||||
<Info v-model:visible="showInfo" :data="current" :work-type="workType"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, createVNode, ref } from "vue";
|
||||
import { message, Modal } from "ant-design-vue";
|
||||
import {
|
||||
ExclamationCircleOutlined,
|
||||
UserOutlined
|
||||
} from "@ant-design/icons-vue";
|
||||
import type { EleProTable } from "ele-admin-pro";
|
||||
import type {
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
} from "ele-admin-pro/es/ele-pro-table/types";
|
||||
import { toDateString } from "ele-admin-pro";
|
||||
import Info from "./info.vue";
|
||||
import { timeAgo } from "ele-admin-pro";
|
||||
import { useUserStore } from "@/store/modules/user";
|
||||
import {
|
||||
Worksheet,
|
||||
WORKSHEET_EQUIPMENT_TYPE,
|
||||
WORKSHEET_STATUS_LIST, WORKSHEET_WORK_TYPE,
|
||||
WorksheetParam
|
||||
} from "@/api/tower/worksheet/model";
|
||||
import { pageWorksheet, removeBatchWorksheet, removeWorksheet } from "@/api/tower/worksheet";
|
||||
|
||||
const userStore = useUserStore();
|
||||
// 当前用户信息
|
||||
const loginUser = computed(() => userStore.info ?? {});
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
// 表格选中数据
|
||||
const selection = ref<Worksheet[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<Worksheet | null>(null);
|
||||
|
||||
// 是否显示资产详情
|
||||
const showInfo = ref(false);
|
||||
// 是否显示批量移动弹窗
|
||||
const showMove = ref(false);
|
||||
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders,
|
||||
filters
|
||||
}) => {
|
||||
if (filters) {
|
||||
where.status = filters.status;
|
||||
}
|
||||
return pageWorksheet({
|
||||
...where,
|
||||
...orders,
|
||||
page,
|
||||
limit
|
||||
});
|
||||
};
|
||||
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
key: "index",
|
||||
width: 48,
|
||||
align: "center",
|
||||
fixed: "left",
|
||||
hideInSetting: true,
|
||||
customRender: ({ index }) => index + (tableRef.value?.tableIndex ?? 0)
|
||||
},
|
||||
{
|
||||
title: "项目名称",
|
||||
dataIndex: "projectName"
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
width: 400,
|
||||
align: "center",
|
||||
hideInSetting: true
|
||||
}
|
||||
]);
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: WorksheetParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
};
|
||||
|
||||
const showSettle = ref<Boolean>(false);
|
||||
const openSettle = (row?: Worksheet) => {
|
||||
current.value = row ?? null;
|
||||
showSettle.value = true;
|
||||
};
|
||||
|
||||
/* 打开批量移动弹窗 */
|
||||
const openMove = () => {
|
||||
showMove.value = true;
|
||||
};
|
||||
|
||||
const workType = ref<number>(0)
|
||||
/* 打开用户详情弹窗 */
|
||||
const openInfo = (row: Worksheet, workTypeValue: number) => {
|
||||
current.value = row;
|
||||
workType.value = workTypeValue;
|
||||
showInfo.value = true;
|
||||
};
|
||||
|
||||
/* 删除单个 */
|
||||
const remove = (row: Worksheet) => {
|
||||
const hide = message.loading("请求中..", 0);
|
||||
removeWorksheet(row.worksheetId)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
|
||||
/* 批量转移 */
|
||||
const batchMove = (userId) => {
|
||||
console.log(userId, "批量转移0000");
|
||||
console.log(selection.value);
|
||||
};
|
||||
|
||||
/* 批量删除 */
|
||||
const removeBatch = () => {
|
||||
if (!selection.value.length) {
|
||||
message.error("请至少选择一条数据");
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定要删除选中的记录吗?",
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = message.loading("请求中..", 0);
|
||||
removeBatchWorksheet(
|
||||
selection.value.map((d) => {
|
||||
return d.worksheetId;
|
||||
})
|
||||
)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: "Accessory"
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.sys-org-table :deep(.ant-table-body) {
|
||||
overflow: auto !important;
|
||||
overflow: overlay !important;
|
||||
}
|
||||
|
||||
.sys-org-table :deep(.ant-table-pagination.ant-pagination) {
|
||||
padding: 0 4px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,259 @@
|
||||
<!-- 用户编辑弹窗 -->
|
||||
<template>
|
||||
<ele-modal
|
||||
:width="`80%`"
|
||||
:visible="visible"
|
||||
:confirm-loading="loading"
|
||||
:maxable="maxAble"
|
||||
title="派单详情"
|
||||
:body-style="{ paddingBottom: '8px', background: '#f3f3f3' }"
|
||||
@update:visible="updateVisible"
|
||||
:maskClosable="false"
|
||||
:footer="null"
|
||||
@ok="save"
|
||||
>
|
||||
<a-collapse v-model:activeKey="activeKey" accordion v-if="visible">
|
||||
<a-collapse-panel
|
||||
:header="`标地:${info.address}(审核状态:${WORKSHEET_AUDIT_STATUS_LIST[info.auditStatus]},当前状态:${WORKSHEET_STATUS_LIST[info.status]})`"
|
||||
v-for="(info, index) in list" :key="index.toString()">
|
||||
<a-card>
|
||||
<a-descriptions title="人员信息">
|
||||
<a-descriptions-item :label="`审核人${auditIndex + 1}`" v-for="(audit, auditIndex) in info.auditList"
|
||||
:key="auditIndex">{{ audit.nickname }}({{ audit.auditStatus === 1 ? "审核通过" : (audit.auditStatus === 2 ? "审核不通过" : "未审核")
|
||||
}})
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="资料员">{{ info.documentUser?.nickname }}({{ info.documentDoneTime ? `完成时间:${dayjs(info.documentDoneTime).format("YYYY-MM-DD HH:mm:ss")}` : "待完成"
|
||||
}})
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="资产管理员">{{ info.assetUser?.nickname }}({{ info.assetDoneTime ? `完成时间:${dayjs(info.assetDoneTime).format('YYYY-MM-DD HH:mm:ss')}` : '待完成' }})
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="维保人员">{{ info.fixUser?.nickname }}({{ info.fixDoneTime ? `完成时间:${dayjs(info.fixDoneTime).format('YYYY-MM-DD HH:mm:ss')}` : "待完成"
|
||||
}})
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="生产主管">{{ info.productionMangerUser?.nickname }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="班组组长">{{ info.classManagerUser?.nickname }}({{ info.status >= 4 ? '已到场' : '待完成' }})
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="车辆调度员">{{ info.carDispatchUser?.nickname }}
|
||||
</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
</a-card>
|
||||
<a-card>
|
||||
<a-descriptions title="项目信息">
|
||||
<a-descriptions-item label="派单类型">{{ WORKSHEET_WORK_TYPE[info.detail.workType] }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="项目名称">{{ info.projectName }}</a-descriptions-item>
|
||||
<!-- <a-descriptions-item label="项目地址">{{ info.projectRegion + info.projectAddress }}-->
|
||||
<!-- </a-descriptions-item>-->
|
||||
<a-descriptions-item label="计划进场时间">{{ info.planInDate }}</a-descriptions-item>
|
||||
<a-descriptions-item label="到货时间">{{ info.receiveDate }}</a-descriptions-item>
|
||||
<a-descriptions-item label="项目联系人电话"> {{ info.contactPhone }}</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
</a-card>
|
||||
<a-card>
|
||||
<a-descriptions title="设备信息">
|
||||
<a-descriptions-item label="设备名称">{{ info.detail?.equipmentName }}</a-descriptions-item>
|
||||
<a-descriptions-item label="作业类型">{{ WORKSHEET_TYPE[info.detail?.workType] }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="设备型号">{{ info.detail?.model }}</a-descriptions-item>
|
||||
<a-descriptions-item label="出厂编号">{{ info.detail?.factoryNo }}</a-descriptions-item>
|
||||
<a-descriptions-item label="设备厂家">{{ info.detail.equipment.manufactor }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="安装臂长">{{ info.detail?.setupLength }}</a-descriptions-item>
|
||||
<a-descriptions-item label="年份要求"> {{ info.detail?.yearRequest }}</a-descriptions-item>
|
||||
<a-descriptions-item label="初始安装高度">{{ info.detail?.setupHeight }}米</a-descriptions-item>
|
||||
<a-descriptions-item label="最终安装高度">{{ info.detail?.finalSetupHeight }}米
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="是否需要油漆">{{ TRUE_OR_FALSE[info.detail?.needPaint] }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="是否确认道路通畅">{{ TRUE_OR_FALSE[info.detail?.confirmRoad] }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="是否确认电箱到位">{{ TRUE_OR_FALSE[info.detail?.confirmElectric] }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="是否确认基础预埋时间满足">
|
||||
{{ TRUE_OR_FALSE[info.detail?.confirmHasTime] }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="是否确认安装资料完善"> {{ TRUE_OR_FALSE[info.detail?.confirmProfile]
|
||||
}}
|
||||
</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
</a-card>
|
||||
<a-card>
|
||||
<a-descriptions title="派单信息">
|
||||
<a-descriptions-item label="作业人员">{{ info.detail?.sysWorkerList }}</a-descriptions-item>
|
||||
<a-descriptions-item label="外调人员">{{ info.detail?.outComeWorkerList }}</a-descriptions-item>
|
||||
<a-descriptions-item label="人员类型">
|
||||
{{ (info.detail) ? WORKER_TYPE[info.detail?.workerType] : "" }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="班组负责人">{{ info.classManagerUser?.nickname }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="现场负责人">{{ info.detail?.localeManager }}</a-descriptions-item>
|
||||
<!-- <a-descriptions-item label="司机"> {{ info.detail?.driver }}</a-descriptions-item>-->
|
||||
<!-- <a-descriptions-item label="车牌">{{ info.detail?.carPlate }}</a-descriptions-item>-->
|
||||
<a-descriptions-item label="派单说明">{{ info.detail?.intro }}</a-descriptions-item>
|
||||
<a-descriptions-item label="备注信息">{{ info.detail?.remark }}</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
<a-descriptions title="资料图片" v-if="info.detail && info.detail?.photos">
|
||||
<a-descriptions-item>
|
||||
<a-image-preview-group>
|
||||
<a-image style="margin-right: 1rem"
|
||||
:width="45"
|
||||
v-for="(item, index) in info.detail?.photos.split(',')"
|
||||
:key="index"
|
||||
:src="item"
|
||||
/>
|
||||
</a-image-preview-group>
|
||||
</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
<!-- <a-card title="配件信息">-->
|
||||
<!-- <a-descriptions v-for="(item, index) in parts" :key="index" :title="item.title">-->
|
||||
<!-- <a-descriptions-item v-for="(part, partIndex) in item.children" :key="partIndex"-->
|
||||
<!-- :label="part.partsTitle">-->
|
||||
<!-- x{{ part.num }}-->
|
||||
<!-- </a-descriptions-item>-->
|
||||
<!-- </a-descriptions>-->
|
||||
<!-- </a-card>-->
|
||||
</a-card>
|
||||
<a-card>
|
||||
<a-descriptions title="安装信息">
|
||||
<a-descriptions-item label="最高安装高度">{{ info.setUp?.maxSetUpHeight }}米
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="安装高度">{{ info.setUp?.setUpHeight }}米</a-descriptions-item>
|
||||
<a-descriptions-item label="附着高度">{{ info.setUp?.clingHeight }}米</a-descriptions-item>
|
||||
<a-descriptions-item label="大臂长度">{{ info.setUp?.bigArmLength }}米</a-descriptions-item>
|
||||
<a-descriptions-item label="平衡长度">{{ info.setUp?.balanceLength }}米</a-descriptions-item>
|
||||
<a-descriptions-item label="计划安装附墙数"> {{ info.setUp?.planSetUpCling }}
|
||||
</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
</a-card>
|
||||
<a-card>
|
||||
<a-descriptions title="车辆信息">
|
||||
<a-descriptions-item :label="item.carPlate" v-for="(item, index) in info.carDispatchList"
|
||||
:key="index">{{ item.name }}({{ item.phone }})
|
||||
</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
</a-card>
|
||||
<a-card title="到场核验信息">
|
||||
<a-descriptions title="资料图片" v-if="info.check && info.check?.photos">
|
||||
<a-descriptions-item>
|
||||
<a-image-preview-group>
|
||||
<a-image style="margin-right: 1rem"
|
||||
:width="45"
|
||||
v-for="(item, index) in info.check?.photos.split(',')"
|
||||
:key="index"
|
||||
:src="item"
|
||||
/>
|
||||
</a-image-preview-group>
|
||||
</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
<a-descriptions title="核验信息">
|
||||
<a-descriptions-item label="现场定位">{{ info.check?.address }}</a-descriptions-item>
|
||||
<a-descriptions-item label="实际到场时间">{{ info.check?.checkTime }}</a-descriptions-item>
|
||||
<a-descriptions-item label="核验人">{{ info.check?.nickname }}</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
</a-card>
|
||||
</a-collapse-panel>
|
||||
</a-collapse>
|
||||
</ele-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, watch } from "vue";
|
||||
import { Form } from "ant-design-vue";
|
||||
import { useThemeStore } from "@/store/modules/theme";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { getWorksheet, getWorksheetByWordType } from "@/api/tower/worksheet";
|
||||
import {
|
||||
Worksheet,
|
||||
WORKSHEET_AUDIT_STATUS_LIST,
|
||||
WORKSHEET_STATUS_LIST,
|
||||
WORKSHEET_WORK_TYPE
|
||||
} from "@/api/tower/worksheet/model";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
const useForm = Form.useForm;
|
||||
// 是否开启响应式布局
|
||||
const themeStore = useThemeStore();
|
||||
const { styleResponsive } = storeToRefs(themeStore);
|
||||
|
||||
const props = defineProps<{
|
||||
// 弹窗是否打开
|
||||
visible: boolean;
|
||||
// 修改回显的数据
|
||||
data?: Worksheet | null;
|
||||
workType: number;
|
||||
}>();
|
||||
|
||||
// 是否显示最大化切换按钮
|
||||
const maxAble = ref(true);
|
||||
|
||||
const active = ref(2);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: "done"): void;
|
||||
(e: "update:visible", visible: boolean): void;
|
||||
}>();
|
||||
|
||||
// 请求状态
|
||||
const loading = ref(true);
|
||||
|
||||
const activeKey = ref<string[]>();
|
||||
|
||||
/* 更新visible */
|
||||
const updateVisible = (value: boolean) => {
|
||||
emit("update:visible", value);
|
||||
};
|
||||
|
||||
const WORKSHEET_TYPE = ["安装单", "加高单", "拆卸单"];
|
||||
const TRUE_OR_FALSE = ["否", "是"];
|
||||
const WORKER_TYPE = ["自有", "外派"];
|
||||
|
||||
const list = ref<Worksheet[]>([]);
|
||||
|
||||
const parts = ref<any>([]);
|
||||
|
||||
const getDetail = () => {
|
||||
const projectId = props.data?.projectId;
|
||||
list.value = [];
|
||||
getWorksheetByWordType(projectId, props.workType).then((data) => {
|
||||
list.value = data;
|
||||
// for (let key in data) info[key] = data[key];
|
||||
// parts.value = [];
|
||||
// if (info.parts) {
|
||||
// const parentIdIdList = [];
|
||||
// info.parts.forEach((item: any) => {
|
||||
// if (parentIdIdList.indexOf(item.parentId) === -1) {
|
||||
// parentIdIdList.push(item.parentId);
|
||||
// parts.value.push({
|
||||
// title: item.parentPartsTitle,
|
||||
// parentId: item.parentId,
|
||||
// children: []
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
// info.parts.forEach(item => {
|
||||
// parts.value.forEach((parent, index) => {
|
||||
// if (item.parentId === parent.parentId) parts.value[index].children.push(item);
|
||||
// });
|
||||
// });
|
||||
// }
|
||||
});
|
||||
};
|
||||
|
||||
/* 保存编辑 */
|
||||
const save = () => {
|
||||
};
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
if (props.data) {
|
||||
loading.value = false;
|
||||
getDetail();
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user