| | |
| | | title="指定报工人" |
| | | width="800px"> |
| | | <div class="assign-reporter-content"> |
| | | <div class="search-box"> |
| | | <el-input |
| | | v-model="employeeSearchKeyword" |
| | | placeholder="搜索人员姓名" |
| | | clearable |
| | | @input="handleEmployeeSearch" |
| | | style="width: 350px"> |
| | | <template #prefix> |
| | | <i class="el-icon-search"></i> |
| | | </template> |
| | | </el-input> |
| | | </div> |
| | | <div class="selected-tags-box" |
| | | v-if="selectedEmployeeIds.length > 0"> |
| | | <div class="tags-label">已选择:</div> |
| | |
| | | v-loading="employeeTableLoading"> |
| | | <el-checkbox-group v-model="selectedEmployeeIds"> |
| | | <div class="employee-grid"> |
| | | <div v-for="item in employeeTableData" |
| | | <div v-for="item in filteredEmployeeList" |
| | | :key="item.userId" |
| | | class="employee-item"> |
| | | <el-checkbox :label="item.userId" |
| | |
| | | </div> |
| | | </div> |
| | | </el-checkbox-group> |
| | | <div v-if="employeeTableData.length === 0" |
| | | <div v-if="filteredEmployeeList.length === 0" |
| | | class="empty-text"> |
| | | 暂无匹配人员 |
| | | {{ employeeSearchKeyword ? '无匹配人员' : '暂无人员数据' }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { getCurrentInstance, onMounted, reactive, ref, toRefs } from "vue"; |
| | | import { getCurrentInstance, onMounted, reactive, ref, toRefs, computed } from "vue"; |
| | | import { ElMessageBox } from "element-plus"; |
| | | import { |
| | | productWorkOrderPage, |
| | |
| | | label: "计划开始时间", |
| | | prop: "planStartTime", |
| | | width: "140", |
| | | dataType: "date", |
| | | }, |
| | | { |
| | | label: "计划结束时间", |
| | | prop: "planEndTime", |
| | | width: "140", |
| | | dataType: "date", |
| | | }, |
| | | { |
| | | label: "实际开始时间", |
| | | prop: "actualStartTime", |
| | | width: "140", |
| | | dataType: "date", |
| | | }, |
| | | { |
| | | label: "实际结束时间", |
| | | prop: "actualEndTime", |
| | | width: "140", |
| | | dataType: "date", |
| | | }, |
| | | { |
| | | label: "指定报工人", |
| | |
| | | const employeeSearchForm = reactive({ |
| | | staffName: "", |
| | | }); |
| | | const employeeSearchKeyword = ref(""); |
| | | const selectedEmployeeIds = ref([]); |
| | | const currentWorkOrder = ref(null); |
| | | |
| | | const filteredEmployeeList = computed(() => { |
| | | const keyword = employeeSearchKeyword.value.trim().toLowerCase(); |
| | | if (!keyword) { |
| | | return employeeTableData.value; |
| | | } |
| | | return employeeTableData.value.filter(item => { |
| | | const name = (item.nickName || "").toLowerCase(); |
| | | const dept = (item.dept?.deptName || "").toLowerCase(); |
| | | return name.includes(keyword) || dept.includes(keyword); |
| | | }); |
| | | }); |
| | | |
| | | const handleEmployeeSearch = () => { |
| | | }; |
| | | |
| | | const data = reactive({ |
| | | searchForm: { |
| | |
| | | if (!Number.isFinite(n)) return 0; |
| | | if (n <= 0) return 0; |
| | | if (n >= 100) return 100; |
| | | return Math.round(n); |
| | | return parseFloat(n.toFixed(2)); |
| | | }; |
| | | |
| | | const progressColor = percentage => { |
| | |
| | | |
| | | const handleEdit = row => { |
| | | editrow.value = JSON.parse(JSON.stringify(row)); |
| | | // 去掉时分秒,只保留日期用于选择器回显 |
| | | if (editrow.value.planStartTime) { |
| | | editrow.value.planStartTime = editrow.value.planStartTime.split(" ")[0]; |
| | | } |
| | | if (editrow.value.planEndTime) { |
| | | editrow.value.planEndTime = editrow.value.planEndTime.split(" ")[0]; |
| | | } |
| | | editDialogVisible.value = true; |
| | | }; |
| | | |
| | | const handleUpdate = () => { |
| | | updateProductWorkOrder(editrow.value) |
| | | const updateData = { ...editrow.value }; |
| | | // 后端接口需要时分秒格式,隐式拼接:开始时间补 00:00:00,结束时间补 23:59:59 |
| | | if (updateData.planStartTime) { |
| | | updateData.planStartTime = `${updateData.planStartTime} 00:00:00`; |
| | | } |
| | | if (updateData.planEndTime) { |
| | | updateData.planEndTime = `${updateData.planEndTime} 23:59:59`; |
| | | } |
| | | updateProductWorkOrder(updateData) |
| | | .then(() => { |
| | | proxy.$modal.msgSuccess("提交成功"); |
| | | editDialogVisible.value = false; |
| | |
| | | } |
| | | |
| | | .assign-reporter-content { |
| | | .search-box { |
| | | margin-bottom: 16px; |
| | | display: flex; |
| | | justify-content: center; |
| | | } |
| | | |
| | | .selected-tags-box { |
| | | margin-bottom: 16px; |
| | | padding: 12px; |