| | |
| | | /> |
| | | <span class="search_title ml10">项目名称:</span> |
| | | <el-input |
| | | v-model="searchForm.customerName" |
| | | v-model="searchForm.projectName" |
| | | style="width: 240px" |
| | | placeholder="请输入" |
| | | @change="handleQuery" |
| | |
| | | </div> |
| | | <div> |
| | | <el-button type="primary" @click="openForm('add')">生产派工</el-button> |
| | | <el-button @click="handleOut">导出</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table_list"> |
| | |
| | | <script setup> |
| | | import {onMounted, ref} from "vue"; |
| | | import FormDia from "@/views/productionManagement/productionDispatching/components/formDia.vue"; |
| | | import dayjs from "dayjs"; |
| | | import {schedulingListPage} from "@/api/productionManagement/productionOrder.js"; |
| | | import { ElMessageBox } from "element-plus"; |
| | | |
| | | const data = reactive({ |
| | | searchForm: { |
| | | staffName: "", |
| | | entryDate: [ |
| | | dayjs().format("YYYY-MM-DD"), |
| | | dayjs().add(1, "day").format("YYYY-MM-DD"), |
| | | ], // 录入日期 |
| | | entryDateStart: dayjs().format("YYYY-MM-DD"), |
| | | entryDateEnd: dayjs().add(1, "day").format("YYYY-MM-DD"), |
| | | customerName: "", |
| | | projectName: "", |
| | | entryDate: null, // 录入日期 |
| | | entryDateStart: undefined, |
| | | entryDateEnd: undefined, |
| | | }, |
| | | }); |
| | | const { searchForm } = toRefs(data); |
| | | const tableColumn = ref([ |
| | | { |
| | | label: "录入日期", |
| | | prop: "entryDate", |
| | | width: 120, |
| | | }, |
| | | { |
| | | label: "合同号", |
| | | prop: "salesContractNo", |
| | | width: 220, |
| | | }, |
| | | { |
| | | label: "客户合同号", |
| | | prop: "customerContractNo", |
| | | width: 250, |
| | | }, |
| | | { |
| | | label: "客户名称", |
| | | prop: "customerName", |
| | | width: 250, |
| | | }, |
| | | { |
| | | label: "项目名称", |
| | | prop: "projectName", |
| | | width:300 |
| | | }, |
| | | { |
| | | label: "产品大类", |
| | | prop: "productCategory", |
| | | width: 160, |
| | | }, |
| | | { |
| | | label: "规格型号", |
| | | prop: "specificationModel", |
| | | width: 220, |
| | | }, |
| | | { |
| | | label: "单位", |
| | | prop: "unit", |
| | | width:90 |
| | | }, |
| | | { |
| | | label: "录入日期", |
| | | prop: "registerDate", |
| | | }, |
| | | { |
| | | label: "数量", |
| | |
| | | { |
| | | label: "排产数量", |
| | | prop: "schedulingNum", |
| | | width: 100, |
| | | }, |
| | | { |
| | | label: "待排数量", |
| | | prop: "pendingQuantity", |
| | | width: 100, |
| | | }, |
| | | ]); |
| | | const tableData = ref([]); |
| | |
| | | schedulingListPage(params).then((res) => { |
| | | tableLoading.value = false; |
| | | // 处理每条数据,增加pendingQuantity字段 |
| | | tableData.value = res.data.records.map(item => ({ |
| | | tableData.value = res.data.data.records.map(item => ({ |
| | | ...item, |
| | | pendingQuantity: (Number(item.quantity) || 0) - (Number(item.schedulingNum) || 0) |
| | | })); |
| | | page.total = res.data.total; |
| | | page.total = res.data.data.total; |
| | | }).catch(() => { |
| | | tableLoading.value = false; |
| | | }) |
| | |
| | | }) |
| | | }; |
| | | |
| | | // 导出 |
| | | const handleOut = () => { |
| | | ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | proxy.download("/productionOrder/exportOne", {}, "生产派工.xlsx"); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已取消"); |
| | | }); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | searchForm.value.entryDate = [ |
| | | dayjs().format("YYYY-MM-DD"), |
| | | dayjs().add(1, "day").format("YYYY-MM-DD"), |
| | | ] |
| | | searchForm.value.entryDateStart = dayjs().format("YYYY-MM-DD") |
| | | searchForm.value.entryDateEnd = dayjs().add(1, "day").format("YYYY-MM-DD") |
| | | getList(); |
| | | }); |
| | | </script> |