|
|
|
|
@ -61,7 +61,22 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="工序" prop="orgType">
|
|
|
|
|
<el-radio-group v-model="queryParams.orgType">
|
|
|
|
|
<el-radio
|
|
|
|
|
v-for="dict in getStrDictOptions(DICT_TYPE.MES_ORG_TYPE)"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.value"
|
|
|
|
|
@change="changeDate"
|
|
|
|
|
>
|
|
|
|
|
{{ dict.label }}
|
|
|
|
|
</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
|
|
|
|
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
|
|
|
|
@ -76,24 +91,12 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
</ContentWrap>
|
|
|
|
|
|
|
|
|
|
<!-- 列表 -->
|
|
|
|
|
<ContentWrap>
|
|
|
|
|
<el-tabs v-model="activeName" @tab-click="handleTabClick">
|
|
|
|
|
<el-tab-pane label="成型" name="chengxing" />
|
|
|
|
|
<el-tab-pane label="烘干" name="honggan" />
|
|
|
|
|
<el-tab-pane label="转移" name="zhuanyi" />
|
|
|
|
|
<el-tab-pane label="加湿" name="jiashi" />
|
|
|
|
|
<el-tab-pane label="热压" name="reya" />
|
|
|
|
|
<el-tab-pane label="切边" name="qiebian" />
|
|
|
|
|
<el-tab-pane label="品检" name="pinjian" />
|
|
|
|
|
<el-tab-pane label="打包" name="dabao" />
|
|
|
|
|
<el-tab-pane label="贴标" name="tiebiao" />
|
|
|
|
|
<el-tab-pane label="品印" name="pinjian" />
|
|
|
|
|
<el-tab-pane label="塑封" name="sufeng" />
|
|
|
|
|
</el-tabs>
|
|
|
|
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
|
|
|
|
|
|
|
|
|
<el-tabs v-model="typeName" @tab-click="handleTabClick2">
|
|
|
|
|
<el-tab-pane label="计件报表" name="jijian" />
|
|
|
|
|
<el-tab-pane label="计时报表" name="jishi" />
|
|
|
|
|
</el-tabs>
|
|
|
|
|
<ContentWrap v-if="typeName==='jijian'">
|
|
|
|
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="报工日期"
|
|
|
|
|
align="center"
|
|
|
|
|
@ -114,9 +117,6 @@
|
|
|
|
|
<el-table-column label="总数量" align="center" prop="totalNumber" />
|
|
|
|
|
<el-table-column label="成品率%" align="center" prop="qualityRate" :formatter="erpCountTableColumnFormatter"/>
|
|
|
|
|
<el-table-column label="打包数量" align="center" prop="packageNumber" />
|
|
|
|
|
|
|
|
|
|
<el-table-column label="总时长" align="center" prop="totalTime" />
|
|
|
|
|
<el-table-column label="计件时长" align="center" prop="reportTime" />
|
|
|
|
|
<el-table-column label="废品原因" align="center" prop="wasteReason" />
|
|
|
|
|
<el-table-column label="备注" align="center" prop="remark" />
|
|
|
|
|
<el-table-column label="类型" align="center" prop="reportType" width="90px">
|
|
|
|
|
@ -129,43 +129,74 @@
|
|
|
|
|
<dict-tag :type="DICT_TYPE.MES_RECORD_STATUS" :value="scope.row.reportStatus" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
</el-table>
|
|
|
|
|
<!-- 分页 -->
|
|
|
|
|
<Pagination
|
|
|
|
|
:total="total"
|
|
|
|
|
v-model:page="queryParams.pageNo"
|
|
|
|
|
v-model:limit="queryParams.pageSize"
|
|
|
|
|
@pagination="getList"
|
|
|
|
|
/>
|
|
|
|
|
</ContentWrap>
|
|
|
|
|
<!-- 列表 -->
|
|
|
|
|
<ContentWrap v-if="typeName==='jishi'">
|
|
|
|
|
<el-table v-loading="loading" :data="listJiShi" :stripe="true" :show-overflow-tooltip="true">
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="创建时间"
|
|
|
|
|
label="报工日期"
|
|
|
|
|
align="center"
|
|
|
|
|
prop="createTime"
|
|
|
|
|
:formatter="dateFormatter"
|
|
|
|
|
prop="reportDate"
|
|
|
|
|
:formatter="dateFormatter2"
|
|
|
|
|
width="180px"
|
|
|
|
|
/>
|
|
|
|
|
<el-table-column label="操作" align="center" fixed="right" width="80px">
|
|
|
|
|
<el-table-column label="用户" align="center" prop="userName" />
|
|
|
|
|
<el-table-column label="工序" align="center" prop="orgType">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-button
|
|
|
|
|
link
|
|
|
|
|
type="danger"
|
|
|
|
|
@click="handleDelete(scope.row.id)"
|
|
|
|
|
v-hasPermi="['mes:produce-report-detail:delete']"
|
|
|
|
|
>
|
|
|
|
|
删除
|
|
|
|
|
</el-button>
|
|
|
|
|
<dict-tag :type="DICT_TYPE.MES_ORG_TYPE" :value="scope.row.orgType" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="工位" align="center" prop="orgName" />
|
|
|
|
|
<el-table-column label="计件时段" align="center" prop="reportTime" />
|
|
|
|
|
<el-table-column label="计件时长" align="center" prop="totalTime" />
|
|
|
|
|
<el-table-column label="状态" align="center" prop="reportStatus">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.MES_RECORD_STATUS" :value="scope.row.reportStatus" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<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="reportType">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<dict-tag :type="DICT_TYPE.MES_PRODUCE_REPORT_TYPE" :value="scope.row.reportType" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="备注" align="center" prop="remark" />
|
|
|
|
|
|
|
|
|
|
</el-table>
|
|
|
|
|
<!-- 分页 -->
|
|
|
|
|
<Pagination
|
|
|
|
|
:total="total"
|
|
|
|
|
:total="totalJiShi"
|
|
|
|
|
v-model:page="queryParams.pageNo"
|
|
|
|
|
v-model:limit="queryParams.pageSize"
|
|
|
|
|
@pagination="getList"
|
|
|
|
|
/>
|
|
|
|
|
</ContentWrap>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
|
|
|
|
import {getIntDictOptions, DICT_TYPE, getStrDictOptions} from '@/utils/dict'
|
|
|
|
|
import {dateFormatter, dateFormatter2} from '@/utils/formatTime'
|
|
|
|
|
import download from '@/utils/download'
|
|
|
|
|
import { ProduceReportDetailApi, ProduceReportDetailVO } from '@/api/mes/producereport'
|
|
|
|
|
import {
|
|
|
|
|
ProduceReportApi,
|
|
|
|
|
ProduceReportDetailApi,
|
|
|
|
|
ProduceReportDetailVO,
|
|
|
|
|
ProduceReportVO
|
|
|
|
|
} from '@/api/mes/producereport'
|
|
|
|
|
import ProduceReportDetailForm from './ProduceReportDetailForm.vue'
|
|
|
|
|
import ReplaceForm from './components/ReplaceForm.vue'
|
|
|
|
|
import {defaultProps, handleTree} from "@/utils/tree";
|
|
|
|
|
@ -175,6 +206,8 @@ import {ProductApi, ProductVO} from "@/api/erp/product/product";
|
|
|
|
|
import {erpCountTableColumnFormatter} from "@/utils";
|
|
|
|
|
import {useUserStore} from "@/store/modules/user";
|
|
|
|
|
import {checkPermi} from "@/utils/permission";
|
|
|
|
|
import ProduceReportDetailList
|
|
|
|
|
from "@/views/mes/producereport/components/ProduceReportDetailList.vue";
|
|
|
|
|
|
|
|
|
|
/** 生产报工明细 列表 */
|
|
|
|
|
defineOptions({ name: 'DailyReportIndex' })
|
|
|
|
|
@ -189,6 +222,10 @@ const productList = ref<ProductVO[]>([]) // 产品列表
|
|
|
|
|
const loading = ref(true) // 列表的加载中
|
|
|
|
|
const list = ref<ProduceReportDetailVO[]>([]) // 列表的数据
|
|
|
|
|
const total = ref(0) // 列表的总页数
|
|
|
|
|
|
|
|
|
|
const listJiShi = ref<ProduceReportVO[]>([]) // 列表的数据
|
|
|
|
|
const totalJiShi = ref(0) // 列表的总页数
|
|
|
|
|
|
|
|
|
|
const queryParams = reactive({
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
@ -215,9 +252,19 @@ const getList = async () => {
|
|
|
|
|
try {
|
|
|
|
|
//只v查通过了的
|
|
|
|
|
queryParams.reportStatus = 2
|
|
|
|
|
const data = await ProduceReportDetailApi.getProduceReportDetailPage(queryParams)
|
|
|
|
|
list.value = data.list
|
|
|
|
|
total.value = data.total
|
|
|
|
|
//计时报表
|
|
|
|
|
if(typeName.value ==='jishi'){
|
|
|
|
|
const data = await ProduceReportApi.getProduceReportPage(queryParams)
|
|
|
|
|
listJiShi.value = data.list
|
|
|
|
|
totalJiShi.value = data.total
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//计件报表
|
|
|
|
|
else{
|
|
|
|
|
const data = await ProduceReportDetailApi.getProduceReportDetailPage(queryParams)
|
|
|
|
|
list.value = data.list
|
|
|
|
|
total.value = data.total
|
|
|
|
|
}
|
|
|
|
|
} finally {
|
|
|
|
|
loading.value = false
|
|
|
|
|
}
|
|
|
|
|
@ -235,19 +282,6 @@ const resetQuery = () => {
|
|
|
|
|
handleQuery()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
|
const handleDelete = async (id: number) => {
|
|
|
|
|
try {
|
|
|
|
|
// 删除的二次确认
|
|
|
|
|
await message.delConfirm()
|
|
|
|
|
// 发起删除
|
|
|
|
|
await ProduceReportDetailApi.deleteProduceReportDetail(id)
|
|
|
|
|
message.success(t('common.delSuccess'))
|
|
|
|
|
// 刷新列表
|
|
|
|
|
await getList()
|
|
|
|
|
} catch {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
|
const handleExport = async () => {
|
|
|
|
|
try {
|
|
|
|
|
@ -255,8 +289,18 @@ const handleExport = async () => {
|
|
|
|
|
await message.exportConfirm()
|
|
|
|
|
// 发起导出
|
|
|
|
|
exportLoading.value = true
|
|
|
|
|
const data = await ProduceReportDetailApi.exportProduceReportDetail(queryParams)
|
|
|
|
|
download.excel(data, '生产报工明细.xls')
|
|
|
|
|
//只v查通过了的
|
|
|
|
|
queryParams.reportStatus = 2
|
|
|
|
|
//计时报表
|
|
|
|
|
if(typeName.value ==='jishi'){
|
|
|
|
|
const data = await ProduceReportApi.exportProduceReport(queryParams)
|
|
|
|
|
download.excel(data, '生产计时报表.xls')
|
|
|
|
|
}
|
|
|
|
|
//计件报表
|
|
|
|
|
else{
|
|
|
|
|
const data = await ProduceReportDetailApi.exportProduceReportDetail(queryParams)
|
|
|
|
|
download.excel(data, '生产计件报表.xls')
|
|
|
|
|
}
|
|
|
|
|
} catch {
|
|
|
|
|
} finally {
|
|
|
|
|
exportLoading.value = false
|
|
|
|
|
@ -280,13 +324,12 @@ onMounted(async () => {
|
|
|
|
|
userList.value = await UserApi.getSimpleUserList()
|
|
|
|
|
// 加载产品、
|
|
|
|
|
productList.value = await ProductApi.getMesProductSimpleList()
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
/** tab 切换 */
|
|
|
|
|
let activeName = 'chengxing'
|
|
|
|
|
const handleTabClick = (tab: TabsPaneContext) => {
|
|
|
|
|
queryParams.orgType = tab.paneName
|
|
|
|
|
const typeName = ref('jijian')
|
|
|
|
|
const handleTabClick2 = (tab: TabsPaneContext) => {
|
|
|
|
|
typeName.value = tab.paneName
|
|
|
|
|
handleQuery()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|