| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <PageHeader content="报工台账" /> |
| | | <div class="search_form"> |
| | | <el-form :model="searchForm" |
| | | :inline="true"> |
| | |
| | | style="width: 200px;" |
| | | @change="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="报工类型:"> |
| | | <el-select v-model="searchForm.reportType" |
| | | placeholder="请选择" |
| | | clearable |
| | | style="width: 200px;" |
| | | @change="handleQuery"> |
| | | <el-option label="合格" :value="0" /> |
| | | <el-option label="轻微返工" :value="1" /> |
| | | <el-option label="严重返工" :value="2" /> |
| | | <el-option label="报废" :value="3" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" |
| | | @click="handleQuery">搜索</el-button> |
| | |
| | | <div class="table_list"> |
| | | <div style="text-align: right" |
| | | class="mb10"> |
| | | <!-- <el-button type="primary" |
| | | @click="openForm('add')">生产报工</el-button> --> |
| | | <el-button @click="handleOut">导出</el-button> |
| | | </div> |
| | | <PIMTable rowKey="id" |
| | |
| | | nickName: "", |
| | | workOrderNo: "", |
| | | workOrderStatus: "", |
| | | reportType: "", |
| | | }, |
| | | }); |
| | | const { searchForm } = toRefs(data); |
| | |
| | | label: "报工人员", |
| | | prop: "nickName", |
| | | width: 120, |
| | | }, |
| | | { |
| | | label: "报工类型", |
| | | prop: "reportTypeName", |
| | | width: 100, |
| | | }, |
| | | { |
| | | label: "审核状态", |
| | | prop: "auditStatusName", |
| | | width: 100, |
| | | }, |
| | | { |
| | | label: "工时(h)", |
| | | width: 100, |
| | | prop: "workHour", |
| | | }, |
| | | { |
| | | label: "工序", |
| | |
| | | }); |
| | | }); |
| | | }; |
| | | const showInput = row => { |
| | | isShowInput.value = true; |
| | | isShowingId.value = row.id; |
| | | }; |
| | | const pagination = obj => { |
| | | page.current = obj.page; |
| | | page.size = obj.limit; |
| | |
| | | tableLoading.value = false; |
| | | tableData.value = res.data.records.map(item => ({ |
| | | ...item, |
| | | reportTypeName: item.reportTypeName || resolveReportTypeName(item.reportType), |
| | | auditStatusName: item.auditStatusName || resolveAuditStatusName(item.auditStatus), |
| | | pendingFinishNum: |
| | | (Number(item.schedulingNum) || 0) - (Number(item.finishedNum) || 0), |
| | | })); |
| | |
| | | const summarizeMainTable = param => { |
| | | return proxy.summarizeTable(param, ["finishedNum"]); |
| | | }; |
| | | const resolveReportTypeName = value => { |
| | | const map = { |
| | | 0: "合格", |
| | | 1: "轻微返工", |
| | | 2: "严重返工", |
| | | 3: "报废", |
| | | }; |
| | | return map[Number(value)] || "—"; |
| | | }; |
| | | const resolveAuditStatusName = value => { |
| | | const map = { |
| | | 0: "待审核", |
| | | 1: "审核通过", |
| | | 2: "审核不通过", |
| | | }; |
| | | return map[Number(value)] || "—"; |
| | | }; |
| | | // 打开弹框 |
| | | const openForm = (type, row) => { |
| | | if (selectedRows.value.length !== 1) { |
| | |
| | | // 打开投入模态框 |
| | | const isShowInput = ref(false); |
| | | const isShowingId = ref(0); |
| | | const showInput = row => { |
| | | isShowInput.value = true; |
| | | isShowingId.value = row.id; |
| | | }; |
| | | |
| | | // 导出 |
| | | const handleOut = () => { |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | proxy.download("/productionProductMain/export", {}, "生产报工.xlsx"); |
| | | const params = { ...searchForm.value }; |
| | | params.entryDate = undefined; |
| | | proxy.download("/productionProductMain/export", params, "生产报工.xlsx"); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已取消"); |