| | |
| | | style="width: 200px;" |
| | | @change="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="项目名称:"> |
| | | <el-input v-model="searchForm.projectName" placeholder="请输入" clearable prefix-icon="Search" |
| | | <el-form-item label="合同号:"> |
| | | <el-input v-model="searchForm.salesContractNo" placeholder="请输入" clearable prefix-icon="Search" |
| | | style="width: 200px;" |
| | | @change="handleQuery" /> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="项目名称:">--> |
| | | <!-- <el-input v-model="searchForm.projectName" placeholder="请输入" clearable prefix-icon="Search"--> |
| | | <!-- style="width: 200px;"--> |
| | | <!-- @change="handleQuery" />--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item label="排产日期:"> |
| | | <el-date-picker v-model="searchForm.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange" |
| | | placeholder="请选择" clearable @change="changeDaterange" /> |
| | | </el-form-item> |
| | | <el-form-item label="状态:"> |
| | | <el-select v-model="searchForm.status" placeholder="请选择状态" style="width: 140px" clearable> |
| | | <el-option label="待生产" :value="1"></el-option> |
| | | <el-option label="待报工" :value="1"></el-option> |
| | | <el-option label="已报工" :value="3"></el-option> |
| | | <el-option label="生产中" :value="2"></el-option> |
| | | <!-- <el-option label="生产中" :value="2"></el-option> --> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {onMounted, ref} from "vue"; |
| | | import {onMounted, ref, reactive, toRefs, getCurrentInstance, nextTick} from "vue"; |
| | | import FormDia from "@/views/productionManagement/productionReporting/components/formDia.vue"; |
| | | import {staffJoinDel, staffJoinListPage} from "@/api/personnelManagement/onboarding.js"; |
| | | import {ElMessageBox} from "element-plus"; |
| | |
| | | |
| | | const data = reactive({ |
| | | searchForm: { |
| | | staffName: "", |
| | | entryDate: null, // 录入日期 |
| | | entryDateStart: undefined, |
| | | entryDateEnd: undefined, |
| | | customerName: "", |
| | | salesContractNo: "", |
| | | projectName: "", |
| | | status: "", |
| | | entryDate: [dayjs().format("YYYY-MM-DD"), dayjs().format("YYYY-MM-DD")], // 录入日期,默认当天 |
| | | entryDateStart: dayjs().format("YYYY-MM-DD"), |
| | | entryDateEnd: dayjs().format("YYYY-MM-DD"), |
| | | }, |
| | | }); |
| | | const { searchForm } = toRefs(data); |
| | |
| | | if (params == 3) { |
| | | return "已报工"; |
| | | } else if (params == 1) { |
| | | return "待生产"; |
| | | return "待报工"; |
| | | } else { |
| | | return '生产中'; |
| | | } |
| | |
| | | prop: "schedulingUserName", |
| | | }, |
| | | { |
| | | label: "产线", |
| | | prop: "productionLine", |
| | | }, |
| | | { |
| | | label: "合同号", |
| | | prop: "salesContractNo", |
| | | width: 200, |
| | | }, |
| | | { |
| | | label: "客户合同号", |
| | | prop: "customerContractNo", |
| | | width: 200, |
| | | }, |
| | | // { |
| | | // label: "客户合同号", |
| | | // prop: "customerContractNo", |
| | | // width: 200, |
| | | // }, |
| | | { |
| | | label: "客户名称", |
| | | prop: "customerName", |
| | | width: 200, |
| | | }, |
| | | { |
| | | label: "项目名称", |
| | | prop: "projectName", |
| | | width:300 |
| | | }, |
| | | // { |
| | | // label: "项目名称", |
| | | // prop: "projectName", |
| | | // width:300 |
| | | // }, |
| | | { |
| | | label: "产品大类", |
| | | prop: "productCategory", |
| | |
| | | label: "工序", |
| | | prop: "process", |
| | | }, |
| | | { |
| | | label: "口味分类", |
| | | prop: "type", |
| | | width: 150, |
| | | }, |
| | | // { |
| | | // label: "口味分类", |
| | | // prop: "type", |
| | | // width: 150, |
| | | // }, |
| | | { |
| | | label: "损耗", |
| | | prop: "loss", |
| | |
| | | width: 100, |
| | | }, |
| | | { |
| | | label: "待生产数量", |
| | | label: "待报工数量", |
| | | prop: "pendingFinishNum", |
| | | width: 100, |
| | | }, |
| | |
| | | }; |
| | | // 打开弹框 |
| | | const openForm = (type, row) => { |
| | | if (selectedRows.value.length !== 1) { |
| | | proxy.$message.error("请选择一条数据"); |
| | | if (selectedRows.value.length === 0) { |
| | | proxy.$message.error("请至少选择一条数据"); |
| | | return; |
| | | } |
| | | if (selectedRows.value[0].pendingFinishNum == 0) { |
| | | proxy.$message.warning("无需再报工"); |
| | | // 过滤掉待报工数量为0的数据 |
| | | const validRows = selectedRows.value.filter(item => item.pendingFinishNum > 0); |
| | | if (validRows.length === 0) { |
| | | proxy.$message.warning("所选数据均无需再报工"); |
| | | return; |
| | | } |
| | | if (validRows.length < selectedRows.value.length) { |
| | | proxy.$message.warning(`已过滤 ${selectedRows.value.length - validRows.length} 条无需报工的数据`); |
| | | } |
| | | nextTick(() => { |
| | | const rowInfo = type === 'add' ? selectedRows.value[0] : row |
| | | const rowInfo = type === 'add' ? validRows : (row ? [row] : []) |
| | | formDia.value?.openDialog(type, rowInfo) |
| | | }) |
| | | }; |