|
|
|
@ -8,46 +8,73 @@
|
|
|
|
class="-mb-15px"
|
|
|
|
class="-mb-15px"
|
|
|
|
label-width="68px"
|
|
|
|
label-width="68px"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<el-form-item label="组织名称" prop="name">
|
|
|
|
<el-row>
|
|
|
|
<el-input
|
|
|
|
<el-col :span="6">
|
|
|
|
v-model="queryParams.name"
|
|
|
|
<el-form-item label="组织名称" prop="name">
|
|
|
|
class="!w-240px"
|
|
|
|
<el-input
|
|
|
|
clearable
|
|
|
|
v-model="queryParams.name"
|
|
|
|
placeholder="请输入组织名称"
|
|
|
|
class="!w-150px"
|
|
|
|
@keyup.enter="handleQuery"
|
|
|
|
clearable
|
|
|
|
/>
|
|
|
|
placeholder="请输入组织名称"
|
|
|
|
</el-form-item>
|
|
|
|
@keyup.enter="handleQuery"
|
|
|
|
|
|
|
|
/>
|
|
|
|
<el-form-item label="关联机台" prop="machineId">
|
|
|
|
</el-form-item>
|
|
|
|
<el-input
|
|
|
|
</el-col>
|
|
|
|
v-model="queryParams.machineId"
|
|
|
|
<el-col :span="6">
|
|
|
|
class="!w-240px"
|
|
|
|
<el-form-item label="关联机台" prop="machineId">
|
|
|
|
clearable
|
|
|
|
<el-input
|
|
|
|
placeholder="请输入关联机台"
|
|
|
|
v-model="queryParams.machineId"
|
|
|
|
@keyup.enter="handleQuery"
|
|
|
|
class="!w-150px"
|
|
|
|
/>
|
|
|
|
clearable
|
|
|
|
</el-form-item>
|
|
|
|
placeholder="请输入关联机台"
|
|
|
|
|
|
|
|
@keyup.enter="handleQuery"
|
|
|
|
<el-form-item label="组织状态" prop="status">
|
|
|
|
/>
|
|
|
|
<el-select
|
|
|
|
</el-form-item>
|
|
|
|
v-model="queryParams.status"
|
|
|
|
</el-col>
|
|
|
|
class="!w-240px"
|
|
|
|
<el-col :span="6">
|
|
|
|
clearable
|
|
|
|
<el-form-item label="组织状态" prop="status">
|
|
|
|
placeholder="请选择组织状态"
|
|
|
|
<el-select
|
|
|
|
>
|
|
|
|
v-model="queryParams.status"
|
|
|
|
<el-option
|
|
|
|
class="!w-150px"
|
|
|
|
v-for="dict in getStrDictOptions(DICT_TYPE.MES_ORG_STATUS)"
|
|
|
|
clearable
|
|
|
|
:key="dict.value"
|
|
|
|
placeholder="请选择组织状态"
|
|
|
|
:label="dict.label"
|
|
|
|
>
|
|
|
|
:value="dict.value"
|
|
|
|
<el-option
|
|
|
|
/>
|
|
|
|
v-for="dict in getStrDictOptions(DICT_TYPE.MES_ORG_STATUS)"
|
|
|
|
</el-select>
|
|
|
|
:key="dict.value"
|
|
|
|
</el-form-item>
|
|
|
|
:label="dict.label"
|
|
|
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
<el-col :span="6">
|
|
|
|
|
|
|
|
<el-form-item label="工作日期" prop="workDate">
|
|
|
|
|
|
|
|
<el-date-picker
|
|
|
|
|
|
|
|
v-model="queryParams.workDate"
|
|
|
|
|
|
|
|
@change="handleQuery"
|
|
|
|
|
|
|
|
type="date"
|
|
|
|
|
|
|
|
value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
|
|
|
|
|
placeholder="选择工作日期"
|
|
|
|
|
|
|
|
class="!w-200px"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<!-- <el-date-picker-->
|
|
|
|
|
|
|
|
<!-- v-model="queryParams.workDate"-->
|
|
|
|
|
|
|
|
<!-- @change="handleQuery"-->
|
|
|
|
|
|
|
|
<!-- value-format="YYYY-MM-DD HH:mm:ss"-->
|
|
|
|
|
|
|
|
<!-- type="daterange"-->
|
|
|
|
|
|
|
|
<!-- start-placeholder="开始日期"-->
|
|
|
|
|
|
|
|
<!-- end-placeholder="结束日期"-->
|
|
|
|
|
|
|
|
<!-- :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"-->
|
|
|
|
|
|
|
|
<!-- class="!w-200px"-->
|
|
|
|
|
|
|
|
<!-- />-->
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item>
|
|
|
|
<el-form-item>
|
|
|
|
<el-button @click="handleQuery"><Icon class="mr-5px" icon="ep:search" /> 搜索</el-button>
|
|
|
|
<el-button @click="handleQuery"><Icon class="mr-5px" icon="ep:search" /> 搜索</el-button>
|
|
|
|
<el-button @click="resetQuery"><Icon class="mr-5px" icon="ep:refresh" /> 重置</el-button>
|
|
|
|
<el-button @click="resetQuery"><Icon class="mr-5px" icon="ep:refresh" /> 重置</el-button>
|
|
|
|
|
|
|
|
|
|
|
|
<el-button
|
|
|
|
<el-button
|
|
|
|
v-hasPermi="['mes:organization:export']"
|
|
|
|
v-hasPermi="['mes:organization:export']"
|
|
|
|
:loading="exportLoading"
|
|
|
|
:loading="exportLoading"
|
|
|
|
@ -81,7 +108,7 @@
|
|
|
|
</el-tabs>
|
|
|
|
</el-tabs>
|
|
|
|
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-col :span="14">
|
|
|
|
<el-col :span="12">
|
|
|
|
<ContentWrap>
|
|
|
|
<ContentWrap>
|
|
|
|
<el-table
|
|
|
|
<el-table
|
|
|
|
v-if="refreshTable"
|
|
|
|
v-if="refreshTable"
|
|
|
|
@ -91,89 +118,48 @@
|
|
|
|
:show-overflow-tooltip="true"
|
|
|
|
:show-overflow-tooltip="true"
|
|
|
|
:stripe="true"
|
|
|
|
:stripe="true"
|
|
|
|
row-key="id"
|
|
|
|
row-key="id"
|
|
|
|
|
|
|
|
highlight-current-row
|
|
|
|
|
|
|
|
@current-change="handleCurrentChange"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<el-table-column align="center" label="组织名称" prop="name" width="180px"/>
|
|
|
|
<el-table-column align="center" label="组织名称" prop="name" width="180px"/>
|
|
|
|
<el-table-column align="center" label="关联机台" prop="machineName" />
|
|
|
|
<el-table-column align="center" label="关联机台" prop="machineName" />
|
|
|
|
|
|
|
|
<el-table-column align="center" label="组织等级" prop="orgClass">
|
|
|
|
<el-table-column align="center" label="组织状态" prop="status">
|
|
|
|
|
|
|
|
<template #default="scope">
|
|
|
|
<template #default="scope">
|
|
|
|
<dict-tag :type="DICT_TYPE.MES_ORG_STATUS" :value="scope.row.status" />
|
|
|
|
<dict-tag v-if="notEmpty(scope.row.orgClass)" :type="DICT_TYPE.MES_ORG_CLASS" :value="scope.row.orgClass" />
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column align="center" label="组织等级" prop="orgClass">
|
|
|
|
<el-table-column align="center" label="类型" >
|
|
|
|
<template #default="scope">
|
|
|
|
<template #default="scope">
|
|
|
|
<dict-tag :type="DICT_TYPE.MES_ORG_CLASS" :value="scope.row.orgClass" />
|
|
|
|
<dict-tag v-if="notEmpty(scope.row.orgType)" :type="DICT_TYPE.MES_ORG_TYPE" :value="scope.row.orgType" />
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column align="center" label="类型" prop="orgType">
|
|
|
|
<el-table-column align="center" label="组织状态" >
|
|
|
|
<template #default="scope">
|
|
|
|
<template #default="scope">
|
|
|
|
<dict-tag :type="DICT_TYPE.MES_ORG_TYPE" :value="scope.row.orgType" />
|
|
|
|
<dict-tag v-if="notEmpty(scope.row.status) && scope.row.orgClass=='workplace'" :type="DICT_TYPE.MES_ORG_STATUS" :value="scope.row.status" />
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
|
|
<el-table-column align="center" fixed="right" label="操作" width="150">
|
|
|
|
|
|
|
|
|
|
|
|
<el-table-column align="center" fixed="right" label="操作" width="80">
|
|
|
|
<template #default="scope">
|
|
|
|
<template #default="scope">
|
|
|
|
<el-button
|
|
|
|
<el-button
|
|
|
|
|
|
|
|
v-if="scope.row.orgClass=='workplace' && scope.row.status=='free'"
|
|
|
|
v-hasPermi="['mes:organization:update']"
|
|
|
|
v-hasPermi="['mes:organization:update']"
|
|
|
|
link
|
|
|
|
link
|
|
|
|
type="primary"
|
|
|
|
type="warning"
|
|
|
|
@click="openForm('update', scope.row.id)"
|
|
|
|
@click="openForm('update', scope.row.id)"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
编辑
|
|
|
|
派工
|
|
|
|
</el-button>
|
|
|
|
</el-button>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table>
|
|
|
|
</el-table>
|
|
|
|
<!-- 分页 -->
|
|
|
|
|
|
|
|
<Pagination
|
|
|
|
|
|
|
|
v-model:limit="queryParams.pageSize"
|
|
|
|
|
|
|
|
v-model:page="queryParams.pageNo"
|
|
|
|
|
|
|
|
:total="total"
|
|
|
|
|
|
|
|
@pagination="getList"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</ContentWrap>
|
|
|
|
</ContentWrap>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="10">
|
|
|
|
<el-col :span="12">
|
|
|
|
<!-- 列表 -->
|
|
|
|
<!-- 列表 -->
|
|
|
|
<ContentWrap>
|
|
|
|
<WorkerRight :org-id="orgId" :work-date="queryParams.workDate" :org-type="queryParams.orgType"/>
|
|
|
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
|
|
label="工作日期"
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
prop="workDate"
|
|
|
|
|
|
|
|
:formatter="dateFormatter"
|
|
|
|
|
|
|
|
width="180px"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<el-table-column label="工位" align="center" prop="orgId" />
|
|
|
|
|
|
|
|
<el-table-column label="班别" align="center" prop="groupType">
|
|
|
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
|
|
|
<dict-tag :type="DICT_TYPE.MES_GROUP_TYPE" :value="scope.row.groupType" />
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
<el-table-column label="工人" align="center" prop="workerId" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-table-column label="操作" align="center">
|
|
|
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
|
|
|
<el-button
|
|
|
|
|
|
|
|
link
|
|
|
|
|
|
|
|
type="danger"
|
|
|
|
|
|
|
|
@click="handleDelete(scope.row.id)"
|
|
|
|
|
|
|
|
v-hasPermi="['mes:org-worker:delete']"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
删除
|
|
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
<!-- 分页 -->
|
|
|
|
|
|
|
|
<Pagination
|
|
|
|
|
|
|
|
:total="total"
|
|
|
|
|
|
|
|
v-model:page="queryParams.pageNo"
|
|
|
|
|
|
|
|
v-model:limit="queryParams.pageSize"
|
|
|
|
|
|
|
|
@pagination="getList"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</ContentWrap>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
|
|
@ -183,20 +169,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
<script lang="ts" setup>
|
|
|
|
import {getIntDictOptions, getBoolDictOptions, DICT_TYPE, getStrDictOptions} from '@/utils/dict'
|
|
|
|
import {getIntDictOptions, getBoolDictOptions, DICT_TYPE, getStrDictOptions} from '@/utils/dict'
|
|
|
|
import { dateFormatter } from '@/utils/formatTime'
|
|
|
|
|
|
|
|
import {defaultProps, handleTree} from '@/utils/tree'
|
|
|
|
import {defaultProps, handleTree} from '@/utils/tree'
|
|
|
|
import download from '@/utils/download'
|
|
|
|
import download from '@/utils/download'
|
|
|
|
import { OrganizationApi, OrganizationVO } from '@/api/mes/organization'
|
|
|
|
import { OrganizationApi, OrganizationVO } from '@/api/mes/organization'
|
|
|
|
import OrganizationForm from './OrganizationForm.vue'
|
|
|
|
import OrganizationForm from './OrganizationForm.vue'
|
|
|
|
|
|
|
|
import {OrgWorkerApi, OrgWorkerVO} from "@/api/mes/orgworker";
|
|
|
|
|
|
|
|
|
|
|
|
/** 产线工位 列表 */
|
|
|
|
/** 产线工位 列表 */
|
|
|
|
defineOptions({ name: 'Organization' })
|
|
|
|
defineOptions({ name: 'WorkerIndex' })
|
|
|
|
|
|
|
|
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
|
|
|
|
const orgId = ref()
|
|
|
|
const loading = ref(true) // 列表的加载中
|
|
|
|
const loading = ref(true) // 列表的加载中
|
|
|
|
const list = ref<OrganizationVO[]>([]) // 列表的数据
|
|
|
|
const list = ref<OrganizationVO[]>([]) // 列表的数据
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const queryParams = reactive({
|
|
|
|
const queryParams = reactive({
|
|
|
|
name: undefined,
|
|
|
|
name: undefined,
|
|
|
|
parentId: undefined,
|
|
|
|
parentId: undefined,
|
|
|
|
@ -209,7 +197,8 @@ const queryParams = reactive({
|
|
|
|
status: undefined,
|
|
|
|
status: undefined,
|
|
|
|
orgClass: undefined,
|
|
|
|
orgClass: undefined,
|
|
|
|
orgType: undefined,
|
|
|
|
orgType: undefined,
|
|
|
|
createTime: []
|
|
|
|
createTime: [],
|
|
|
|
|
|
|
|
workDate: undefined
|
|
|
|
})
|
|
|
|
})
|
|
|
|
const queryFormRef = ref() // 搜索的表单
|
|
|
|
const queryFormRef = ref() // 搜索的表单
|
|
|
|
const exportLoading = ref(false) // 导出的加载中
|
|
|
|
const exportLoading = ref(false) // 导出的加载中
|
|
|
|
@ -243,18 +232,6 @@ const openForm = (type: string, id?: number) => {
|
|
|
|
formRef.value.open(type, id)
|
|
|
|
formRef.value.open(type, id)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
|
|
|
|
const handleDelete = async (id: number) => {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
// 删除的二次确认
|
|
|
|
|
|
|
|
await message.delConfirm()
|
|
|
|
|
|
|
|
// 发起删除
|
|
|
|
|
|
|
|
await OrganizationApi.deleteOrganization(id)
|
|
|
|
|
|
|
|
message.success(t('common.delSuccess'))
|
|
|
|
|
|
|
|
// 刷新列表
|
|
|
|
|
|
|
|
await getList()
|
|
|
|
|
|
|
|
} catch {}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
const handleExport = async () => {
|
|
|
|
const handleExport = async () => {
|
|
|
|
@ -281,9 +258,18 @@ const toggleExpandAll = async () => {
|
|
|
|
refreshTable.value = true
|
|
|
|
refreshTable.value = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const organizationTree = ref() // 树形结构
|
|
|
|
const organizationTree = ref() // 树形结构
|
|
|
|
|
|
|
|
const getCurrentDate = () =>{
|
|
|
|
|
|
|
|
let now = new Date();
|
|
|
|
|
|
|
|
let year = now.getFullYear();
|
|
|
|
|
|
|
|
let month = now.getMonth() + 1;
|
|
|
|
|
|
|
|
if(month<10){month = '0'+month}
|
|
|
|
|
|
|
|
let day = now.getDate();
|
|
|
|
|
|
|
|
if(day<10)day = '0'+day;
|
|
|
|
|
|
|
|
return year + "-" + month + "-" + day +" 00:00:01";
|
|
|
|
|
|
|
|
}
|
|
|
|
/** 初始化 **/
|
|
|
|
/** 初始化 **/
|
|
|
|
onMounted(async () => {
|
|
|
|
onMounted(async () => {
|
|
|
|
|
|
|
|
queryParams.workDate = getCurrentDate()
|
|
|
|
await getList()
|
|
|
|
await getList()
|
|
|
|
/** 获得产线工位树 */
|
|
|
|
/** 获得产线工位树 */
|
|
|
|
organizationTree.value = []
|
|
|
|
organizationTree.value = []
|
|
|
|
@ -299,4 +285,15 @@ const handleTabClick = (tab: TabsPaneContext) => {
|
|
|
|
handleQuery()
|
|
|
|
handleQuery()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 选中行操作 */
|
|
|
|
|
|
|
|
const currentRow = ref({}) // 选中行
|
|
|
|
|
|
|
|
const handleCurrentChange = (row) => {
|
|
|
|
|
|
|
|
currentRow.value = row
|
|
|
|
|
|
|
|
orgId.value = row.id
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const notEmpty = (str:string) => {
|
|
|
|
|
|
|
|
return str != "" && str != null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|