| | |
| | | style="width: 200px;" |
| | | @change="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="工单状态:"> |
| | | <el-select v-model="searchForm.workOrderStatus" |
| | | placeholder="请选择工单状态" |
| | | style="width: 140px" |
| | | clearable> |
| | | <el-option label="待确认" |
| | | :value="1"></el-option> |
| | | <el-option label="待生产" |
| | | :value="2"></el-option> |
| | | <el-option label="生产中" |
| | | :value="3"></el-option> |
| | | <el-option label="已生产" |
| | | :value="4"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" |
| | | @click="handleQuery">搜索</el-button> |
| | |
| | | style="width: 100%" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" |
| | | width="60"> |
| | | <el-table-column label="操作"> |
| | | <template #default="scope"> |
| | | <el-button link |
| | | type="primary" |
| | |
| | | <input-modal v-if="isShowInput" |
| | | v-model:visible="isShowInput" |
| | | :production-product-main-id="isShowingId" /> |
| | | <output-modal v-if="isShowOutput" |
| | | v-model:visible="isShowOutput" |
| | | :production-product-main-id="isShowingId" /> |
| | | <!-- 参数详情弹窗 --> |
| | | <el-dialog v-model="paramDetailVisible" |
| | | title="参数详情" |
| | | width="600px"> |
| | | <div v-if="currentParams && currentParams.length > 0" |
| | | class="param-detail-list"> |
| | | <el-descriptions :column="1" |
| | | border> |
| | | <el-descriptions-item v-for="param in currentParams" |
| | | :key="param.id" |
| | | :label="param.paramName"> |
| | | {{ param.inputValue }} |
| | | <span v-if="param.unit && param.unit !== '/'" |
| | | class="unit-text">({{ param.unit }})</span> |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | </div> |
| | | <el-empty v-else |
| | | description="暂无参数数据" /> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="paramDetailVisible = false">关闭</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { onMounted, ref } from "vue"; |
| | | import { onMounted, ref, reactive, toRefs, getCurrentInstance } from "vue"; |
| | | import FormDia from "@/views/productionManagement/productionReporting/components/formDia.vue"; |
| | | import { ElMessageBox } from "element-plus"; |
| | | import { |
| | |
| | | import { productionProductMainListPage } from "@/api/productionManagement/productionProductMain.js"; |
| | | import { userListNoPageByTenantId } from "@/api/system/user.js"; |
| | | import InputModal from "@/views/productionManagement/productionReporting/Input.vue"; |
| | | import OutputModal from "@/views/productionManagement/productionReporting/Output.vue"; |
| | | |
| | | const data = reactive({ |
| | | searchForm: { |
| | |
| | | width: 120, |
| | | }, |
| | | { |
| | | label: "工时(h)", |
| | | width: 100, |
| | | prop: "workHour", |
| | | }, |
| | | { |
| | | label: "工序", |
| | | prop: "process", |
| | | width: 120, |
| | | }, |
| | | { |
| | | label: "工单编号", |
| | | prop: "workOrderNo", |
| | | width: 120, |
| | | }, |
| | | { |
| | | label: "报工状态", |
| | | prop: "status", |
| | | dataType: "tag", |
| | | formatData: params => { |
| | | if (params == 3) { |
| | | return "已报工"; |
| | | } else if (params == 1) { |
| | | return "待生产"; |
| | | } else { |
| | | return "生产中"; |
| | | } |
| | | }, |
| | | formatType: params => { |
| | | if (params == 3) { |
| | | return "success"; |
| | | } else if (params == 1) { |
| | | return "primary"; |
| | | } else { |
| | | return "warning"; |
| | | } |
| | | }, |
| | | label: "销售合同号", |
| | | prop: "salesContractNo", |
| | | width: 120, |
| | | }, |
| | | { |
| | | label: "工单状态", |
| | | prop: "workOrderStatus", |
| | | dataType: "tag", |
| | | formatData: params => { |
| | | switch (params) { |
| | | case "1": |
| | | return "待确认"; |
| | | case "2": |
| | | return "待生产"; |
| | | case "3": |
| | | return "生产中"; |
| | | case "4": |
| | | return "已生产"; |
| | | default: |
| | | return ""; |
| | | } |
| | | }, |
| | | formatType: params => { |
| | | switch (params) { |
| | | case "1": |
| | | return "primary"; |
| | | case "2": |
| | | return "info"; |
| | | case "3": |
| | | return "warning"; |
| | | case "4": |
| | | return "success"; |
| | | default: |
| | | return ""; |
| | | } |
| | | }, |
| | | label: "产品名称", |
| | | prop: "productName", |
| | | width: 120, |
| | | }, |
| | | { |
| | | label: "生产时间", |
| | | label: "产品规格型号", |
| | | prop: "productModelName", |
| | | width: 120, |
| | | }, |
| | | { |
| | | label: "产出数量", |
| | | prop: "quantity", |
| | | width: 120, |
| | | }, |
| | | { |
| | | label: "报废数量", |
| | | prop: "scrapQty", |
| | | width: 120, |
| | | }, |
| | | { |
| | | label: "单位", |
| | | prop: "unit", |
| | | width: 120, |
| | | }, |
| | | |
| | | { |
| | | label: "创建时间", |
| | | prop: "createTime", |
| | | width: 120, |
| | | formatData: params => { |
| | | const date = new Date(params); |
| | | return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart( |
| | | 2, |
| | | "0" |
| | | )}-${String(date.getDate()).padStart(2, "0")}`; |
| | | }, |
| | | }, |
| | | { |
| | | dataType: "action", |
| | | label: "操作", |
| | | align: "center", |
| | | fixed: "right", |
| | | width: 230, |
| | | width: 250, |
| | | operation: [ |
| | | { |
| | | name: "查看投入", |
| | |
| | | }, |
| | | }, |
| | | { |
| | | name: "查看产出", |
| | | name: "参数详情", |
| | | type: "text", |
| | | clickFun: row => { |
| | | showOutput(row); |
| | | showParamDetail(row); |
| | | }, |
| | | }, |
| | | { |
| | |
| | | }, |
| | | ]); |
| | | const tableData = ref([]); |
| | | const paramDetailVisible = ref(false); |
| | | const currentParams = ref([]); |
| | | |
| | | const showParamDetail = row => { |
| | | currentParams.value = row.productionOperationParamList || []; |
| | | paramDetailVisible.value = true; |
| | | }; |
| | | const selectedRows = ref([]); |
| | | const tableLoading = ref(false); |
| | | const childrenLoading = ref(false); |
| | |
| | | isShowingId.value = row.id; |
| | | }; |
| | | |
| | | // 打开产出模态框 |
| | | const isShowOutput = ref(false); |
| | | const showOutput = row => { |
| | | isShowOutput.value = true; |
| | | isShowingId.value = row.id; |
| | | }; |
| | | |
| | | // 导出 |
| | | const handleOut = () => { |
| | | ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", { |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | proxy.download("/salesLedger/work/export", {}, "生产报工.xlsx"); |
| | | proxy.download("/productionProductMain/export", {}, "生产报工.xlsx"); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已取消"); |
| | |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped></style> |
| | | <style scoped> |
| | | .unit-text { |
| | | margin-left: 5px; |
| | | color: #909399; |
| | | font-size: 12px; |
| | | } |
| | | .param-detail-list { |
| | | padding: 10px; |
| | | } |
| | | .table_list { |
| | | margin-top: unset; |
| | | } |
| | | </style> |