Merge branch 'dev_New' of http://114.132.189.42:9002/r/product-inventory-management into dev_New
| | |
| | | }) |
| | | } |
| | | // 售后处理-附件删除 |
| | | export function afterSalesServiceFileDel(ids) { |
| | | export function afterSalesServiceFileDel(id) { |
| | | return request({ |
| | | url: '/afterSalesService/file/del', |
| | | url: `/afterSalesService/file/del/${id}`, |
| | | method: 'delete', |
| | | data: ids, |
| | | }) |
| | | } |
| | | |
| | | // 售后处理-维修记录列表 |
| | | export function afterSalesServiceRepairListPage(query) { |
| | | return request({ |
| | | url: '/afterSalesService/repair/listPage', |
| | | method: 'get', |
| | | params: query, |
| | | }) |
| | | } |
| | | |
| | | // 临期售后管理-分页查询 |
| | | export function expiryAfterSalesListPage(query) { |
| | | return request({ |
| | | url: '/expiryAfterSales/listPage', |
| | | url: '/afterSalesNearExpiryService/listPage', |
| | | method: 'get', |
| | | params: query, |
| | | }) |
| | |
| | | // 临期售后管理-新增 |
| | | export function expiryAfterSalesAdd(query) { |
| | | return request({ |
| | | url: '/expiryAfterSales/add', |
| | | url: '/afterSalesNearExpiryService/add', |
| | | method: 'post', |
| | | data: query, |
| | | }) |
| | |
| | | // 临期售后管理-更新 |
| | | export function expiryAfterSalesUpdate(query) { |
| | | return request({ |
| | | url: '/expiryAfterSales/update', |
| | | url: '/afterSalesNearExpiryService/update', |
| | | method: 'post', |
| | | data: query, |
| | | }) |
| | | } |
| | | |
| | | // 临期售后管理-删除 |
| | | export function expiryAfterSalesDelete(query) { |
| | | export function expiryAfterSalesDelete(ids) { |
| | | return request({ |
| | | url: '/expiryAfterSales/delete', |
| | | url: '/afterSalesNearExpiryService/delete?ids=' + ids, |
| | | method: 'delete', |
| | | data: query, |
| | | }) |
| | | } |
| | |
| | | userList.value = res.data; |
| | | }); |
| | | form.value = {...row} |
| | | if (type === 'approve') { |
| | | if (!form.value.disposeUserId) { |
| | | form.value.disposeUserId = userStore.id; |
| | | } |
| | | if (!form.value.disDate) { |
| | | form.value.disDate = getCurrentDate(); |
| | | } |
| | | } |
| | | } |
| | | // const setName = (code) => { |
| | | // const index = userList.value.findIndex(item => item.deviceModel === code); |
| | | // if (index > -1) { |
| | |
| | | :upload-method="handleFileUpload" |
| | | :delete-method="handleFileDelete" |
| | | /> |
| | | <el-dialog |
| | | v-model="repairDialogVisible" |
| | | title="维修记录" |
| | | width="700px" |
| | | destroy-on-close |
| | | @close="repairRecordList = []" |
| | | > |
| | | <el-table |
| | | :data="repairRecordList" |
| | | border |
| | | v-loading="repairRecordLoading" |
| | | max-height="400" |
| | | > |
| | | <el-table-column type="index" label="序号" width="55" align="center" /> |
| | | <el-table-column label="维修日期" prop="maintenanceTime" min-width="120" show-overflow-tooltip> |
| | | <template #default="{ row }"> |
| | | {{ row.maintenanceTime || row.repairTime || '-' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="维修人" prop="maintenanceName" min-width="100" show-overflow-tooltip> |
| | | <template #default="{ row }"> |
| | | {{ row.maintenanceName || row.repairName || '-' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="维修结果" prop="maintenanceResult" min-width="180" show-overflow-tooltip /> |
| | | </el-table> |
| | | <template #footer> |
| | | <el-button @click="repairDialogVisible = false">关闭</el-button> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import { onMounted, ref, reactive, toRefs, getCurrentInstance, nextTick } from "vue"; |
| | | import FormDia from "@/views/customerService/afterSalesHandling/components/formDia.vue"; |
| | | import FileListDialog from "@/components/Dialog/FileListDialog.vue"; |
| | |
| | | import request from "@/utils/request"; |
| | | import { getToken } from "@/utils/auth"; |
| | | import { |
| | | afterSalesServiceDelete, |
| | | afterSalesServiceListPage, |
| | | afterSalesServiceFileListPage, |
| | | afterSalesServiceFileAdd, |
| | | afterSalesServiceFileDel, |
| | | afterSalesServiceRepairListPage, |
| | | } from "@/api/customerService/index.js"; |
| | | import useUserStore from "@/store/modules/user.js"; |
| | | const { proxy } = getCurrentInstance(); |
| | |
| | | openFilesFormDia(row); |
| | | }, |
| | | }, |
| | | // TODO 为写报告添加的 |
| | | { |
| | | name: "维修记录", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | openRepairDialog(row); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | ]); |
| | |
| | | const fileListRef = ref(null) |
| | | const fileListDialogVisible = ref(false) |
| | | const currentFileRow = ref(null) |
| | | const repairDialogVisible = ref(false) |
| | | const repairRecordList = ref([]) |
| | | const repairRecordLoading = ref(false) |
| | | |
| | | // 打开维修记录弹框 |
| | | const openRepairDialog = async (row) => { |
| | | repairDialogVisible.value = true |
| | | repairRecordLoading.value = true |
| | | repairRecordList.value = [] |
| | | try { |
| | | const res = await afterSalesServiceRepairListPage({ |
| | | afterSalesServiceId: row.id, |
| | | current: 1, |
| | | size: 100, |
| | | }) |
| | | if (res.code === 200 && res.data?.records) { |
| | | repairRecordList.value = res.data.records |
| | | } |
| | | } catch (error) { |
| | | proxy.$modal.msgError("获取维修记录失败") |
| | | } finally { |
| | | repairRecordLoading.value = false |
| | | } |
| | | } |
| | | |
| | | // 打开附件弹框----- TODO:接口是没有对接的,需要新增接口,为写报告添加的 |
| | | // 打开附件弹框 |
| | | const openFilesFormDia = async (row) => { |
| | | currentFileRow.value = row |
| | | try { |
| | |
| | | try { |
| | | const formData = new FormData() |
| | | formData.append("file", file) |
| | | formData.append("id", currentFileRow.value.id) |
| | | const uploadRes = await request({ |
| | | url: "/file/upload", |
| | | url: "/afterSalesService/file/upload", |
| | | method: "post", |
| | | data: formData, |
| | | headers: { |
| | |
| | | }, |
| | | }) |
| | | if (uploadRes.code === 200) { |
| | | const fileData = { |
| | | afterSalesServiceId: currentFileRow.value.id, |
| | | name: uploadRes.data?.originalName || file.name, |
| | | url: uploadRes.data?.tempPath || uploadRes.data?.url, |
| | | } |
| | | const saveRes = await afterSalesServiceFileAdd(fileData) |
| | | if (saveRes.code === 200) { |
| | | proxy.$modal.msgSuccess("文件上传成功") |
| | | // 重新获取文件列表 |
| | | const listRes = await afterSalesServiceFileListPage({ |
| | | afterSalesServiceId: currentFileRow.value.id, |
| | | current: 1, |
| | |
| | | }) |
| | | if (listRes.code === 200 && fileListRef.value) { |
| | | const fileList = (listRes.data?.records || []).map((item) => ({ |
| | | name: item.name || item.fileName, |
| | | url: item.url || item.fileUrl, |
| | | name: item.fileName, |
| | | url: item.fileUrl, |
| | | id: item.id, |
| | | ...item, |
| | | })) |
| | | fileListRef.value.setList(fileList) |
| | | } |
| | | resolve({ name: fileData.name, url: fileData.url, id: saveRes.data?.id }) |
| | | } else { |
| | | proxy.$modal.msgError(saveRes.msg || "文件保存失败") |
| | | resolve(null) |
| | | } |
| | | resolve({ name: file.name, url: "", id: null }) |
| | | } else { |
| | | proxy.$modal.msgError(uploadRes.msg || "文件上传失败") |
| | | resolve(null) |
| | |
| | | // 删除附件 |
| | | const handleFileDelete = async (row) => { |
| | | try { |
| | | const res = await afterSalesServiceFileDel([row.id]) |
| | | // 添加确认对话框 |
| | | const confirmResult = await ElMessageBox.confirm( |
| | | '确定要删除这个附件吗?', |
| | | '删除确认', |
| | | { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | } |
| | | ) |
| | | |
| | | if (confirmResult === 'confirm') { |
| | | const res = await afterSalesServiceFileDel(row.id) |
| | | if (res.code === 200) { |
| | | proxy.$modal.msgSuccess("删除成功") |
| | | if (currentFileRow.value && fileListRef.value) { |
| | |
| | | }) |
| | | if (listRes.code === 200) { |
| | | const fileList = (listRes.data?.records || []).map((item) => ({ |
| | | name: item.name || item.fileName, |
| | | url: item.url || item.fileUrl, |
| | | name: item.fileName, |
| | | url: item.fileUrl, |
| | | id: item.id, |
| | | ...item, |
| | | })) |
| | |
| | | proxy.$modal.msgError(res.msg || "删除失败") |
| | | return false |
| | | } |
| | | } |
| | | } catch (error) { |
| | | // 如果用户取消删除,不显示错误信息 |
| | | if (error !== 'cancel') { |
| | | proxy.$modal.msgError("删除失败") |
| | | } |
| | | return false |
| | | } |
| | | } |
| | |
| | | nextTick(() => { |
| | | formDia.value?.openDialog(type, row) |
| | | }) |
| | | }; |
| | | |
| | | const handleDelete = () => { |
| | | let ids = []; |
| | | if (selectedRows.value.length > 0) { |
| | | ids = selectedRows.value.map((item) => item.id); |
| | | } else { |
| | | proxy.$modal.msgWarning("请选择数据"); |
| | | return; |
| | | } |
| | | ElMessageBox.confirm("选中的内容将被删除,是否确认删除?", "删除提示", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | tableLoading.value = true; |
| | | afterSalesServiceDelete(ids) |
| | | .then((res) => { |
| | | proxy.$modal.msgSuccess("删除成功"); |
| | | getList(); |
| | | }) |
| | | .finally(() => { |
| | | tableLoading.value = false; |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已取消"); |
| | | }); |
| | | }; |
| | | |
| | | // 导出 |
| | |
| | | import {ref, computed} from "vue"; |
| | | import useUserStore from "@/store/modules/user.js"; |
| | | import { getCurrentDate } from "@/utils/index.js"; |
| | | // import {userListNoPageByTenantId} from "@/api/system/user.js"; // 暂时注释掉,使用假数据 |
| | | // import {expiryAfterSalesAdd, expiryAfterSalesUpdate} from "@/api/customerService/index.js"; // 暂时注释掉,使用假数据 |
| | | import {userListNoPageByTenantId} from "@/api/system/user.js"; |
| | | import {expiryAfterSalesAdd, expiryAfterSalesUpdate} from "@/api/customerService/index.js"; |
| | | const { proxy } = getCurrentInstance() |
| | | const emit = defineEmits(['close']) |
| | | const dialogFormVisible = ref(false); |
| | |
| | | operationType.value = type; |
| | | dialogFormVisible.value = true; |
| | | |
| | | // 模拟获取用户列表 |
| | | userList.value = [ |
| | | { userId: 1, nickName: "张三" }, |
| | | { userId: 2, nickName: "李四" }, |
| | | { userId: 3, nickName: "王五" }, |
| | | { userId: 4, nickName: "赵六" }, |
| | | { userId: 5, nickName: "孙八" } |
| | | ]; |
| | | // 获取用户列表 |
| | | userListNoPageByTenantId().then(res => { |
| | | userList.value = res.data; |
| | | }); |
| | | |
| | | if (type === 'add') { |
| | | // 新增时重置表单 |
| | |
| | | const submitForm = () => { |
| | | proxy.$refs["formRef"].validate(valid => { |
| | | if (valid) { |
| | | // 模拟提交操作 |
| | | setTimeout(() => { |
| | | console.log("模拟提交的数据:", form.value); |
| | | const submitData = { |
| | | id: form.value.id, |
| | | productName: form.value.productName, |
| | | batchNumber: form.value.batchNumber, |
| | | expireDate: form.value.expiryDate, |
| | | stockQuantity: form.value.stockQuantity, |
| | | customerName: form.value.customerName, |
| | | contactPhone: form.value.contactPhone, |
| | | disRes: form.value.problemDesc, |
| | | status: form.value.status, |
| | | disposeUserId: form.value.handlerId, |
| | | disposeNickName: userList.value.find(item => item.userId === form.value.handlerId)?.nickName, |
| | | disposeResult: form.value.handleResult, |
| | | disDate: form.value.handleDate |
| | | }; |
| | | |
| | | const apiCall = operationType.value === 'add' ? expiryAfterSalesAdd : expiryAfterSalesUpdate; |
| | | apiCall(submitData).then(() => { |
| | | proxy.$modal.msgSuccess(operationType.value === 'add' ? "新增成功" : "更新成功"); |
| | | closeDia(); |
| | | }, 300); |
| | | }).catch(error => { |
| | | console.error('提交数据失败:', error); |
| | | proxy.$modal.msgError('提交数据失败,请稍后重试'); |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | |
| | | import {onMounted, ref} from "vue"; |
| | | import FormDia from "@/views/customerService/expiryAfterSales/components/formDia.vue"; |
| | | import {ElMessageBox} from "element-plus"; |
| | | // import {expiryAfterSalesDelete, expiryAfterSalesListPage} from "@/api/customerService/index.js"; // 暂时注释掉,使用假数据 |
| | | import {expiryAfterSalesDelete, expiryAfterSalesListPage} from "@/api/customerService/index.js"; |
| | | import useUserStore from "@/store/modules/user.js"; |
| | | const { proxy } = getCurrentInstance(); |
| | | const userStore = useUserStore() |
| | |
| | | label: "处理状态", |
| | | prop: "status", |
| | | width: "", |
| | | slot: true, |
| | | dataType: "slot", |
| | | slot: "status", |
| | | }, |
| | | { |
| | | label: "处理人", |
| | |
| | | { |
| | | label: "操作", |
| | | prop: "operation", |
| | | slot: true, |
| | | dataType: "slot", |
| | | slot: "operation", |
| | | width: "200", |
| | | }, |
| | | ], |
| | |
| | | // 获取列表数据 |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | // 取消注释并使用真实API |
| | | // expiryAfterSalesListPage({ |
| | | // ...searchForm.value, |
| | | // current: page.value.current, |
| | | // size: page.value.size |
| | | // }).then(res => { |
| | | // tableData.value = res.data.records; |
| | | // page.value.total = res.data.total; |
| | | // tableLoading.value = false; |
| | | // }); |
| | | // 构造查询参数,映射前端字段到后端字段 |
| | | const queryParams = { |
| | | expireDate: searchForm.value.expiryDate, |
| | | disDate: searchForm.value.handleDate, |
| | | status: searchForm.value.status, |
| | | current: page.value.current, |
| | | size: page.value.size |
| | | }; |
| | | |
| | | // 暂时返回空数据 |
| | | tableData.value = []; |
| | | page.value.total = 0; |
| | | expiryAfterSalesListPage(queryParams).then(res => { |
| | | // 映射后端返回数据到前端表格 |
| | | tableData.value = res.data.records.map(item => ({ |
| | | id: item.id, |
| | | productName: item.productName, |
| | | batchNumber: item.batchNumber, |
| | | expiryDate: item.expireDate, |
| | | stockQuantity: item.stockQuantity, |
| | | customerName: item.customerName, |
| | | contactPhone: item.contactPhone, |
| | | problemDesc: item.disRes, |
| | | status: item.status, |
| | | handlerId: item.disposeUserId, |
| | | handlerName: item.disposeNickName, |
| | | handleResult: item.disposeResult, |
| | | handleDate: item.disDate |
| | | })); |
| | | page.value.total = res.data.total; |
| | | tableLoading.value = false; |
| | | }).catch(error => { |
| | | console.error('获取列表数据失败:', error); |
| | | tableLoading.value = false; |
| | | proxy.$modal.msgError('获取数据失败,请稍后重试'); |
| | | }); |
| | | }; |
| | | |
| | | // 打开弹框 |
| | |
| | | }) |
| | | .then(() => { |
| | | tableLoading.value = true; |
| | | // 取消注释并使用真实API |
| | | // expiryAfterSalesDelete(ids).then(() => { |
| | | // proxy.$modal.msgSuccess("删除成功"); |
| | | // getList(); |
| | | // }).finally(() => { |
| | | // tableLoading.value = false; |
| | | // }); |
| | | |
| | | // 暂时模拟删除成功 |
| | | tableLoading.value = false; |
| | | expiryAfterSalesDelete(ids).then(() => { |
| | | proxy.$modal.msgSuccess("删除成功"); |
| | | getList(); |
| | | }).finally(() => { |
| | | tableLoading.value = false; |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已取消"); |
| | |
| | | <el-input v-model="formState.no" /> |
| | | </el-form-item> |
| | | <el-form-item label="工资定额" prop="salaryQuota"> |
| | | <el-input v-model="formState.salaryQuota" type="number" :step="0.001" /> |
| | | <el-input v-model="formState.salaryQuota" type="number" :step="0.001"> |
| | | <template #append>元</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="是否质检" prop="isQuality"> |
| | | <el-switch v-model="formState.isQuality" :active-value="true" inactive-value="false"/> |
| | |
| | | :tableLoading="tableLoading" |
| | | @pagination="pagination"> |
| | | <template #completionStatus="{ row }"> |
| | | <el-progress :percentage="toProgressPercentage(row?.completionStatus)" :color="progressColor(toProgressPercentage(row?.completionStatus))" :status="toProgressPercentage(row?.completionStatus) >= 100 ? 'success' : ''" /> |
| | | <el-progress :percentage="toProgressPercentage(row?.completionStatus)" |
| | | :color="progressColor(toProgressPercentage(row?.completionStatus))" |
| | | :status="toProgressPercentage(row?.completionStatus) >= 100 ? 'success' : ''" /> |
| | | </template> |
| | | </PIMTable> |
| | | </div> |
| | |
| | | transferCardRowData.status |
| | | }}</span> |
| | | </div> --> |
| | | |
| | | <div class="info-item"> |
| | | <span class="info-label">计划开始时间</span> |
| | | <span class="info-value">{{ transferCardRowData.planStartTime }}</span> |
| | |
| | | readonly |
| | | style="width: 300px" /> |
| | | </el-form-item> |
| | | <el-form-item label="本次生产数量" prop="quantity"> |
| | | <el-form-item label="本次生产数量" |
| | | prop="quantity"> |
| | | <el-input v-model.number="reportForm.quantity" |
| | | type="number" |
| | | min="1" |
| | |
| | | placeholder="请输入本次生产数量" |
| | | @input="handleQuantityInput" /> |
| | | </el-form-item> |
| | | <el-form-item label="报废数量" prop="scrapQty"> |
| | | <el-form-item label="报废数量" |
| | | prop="scrapQty"> |
| | | <el-input v-model.number="reportForm.scrapQty" |
| | | type="number" |
| | | min="0" |
| | |
| | | @change="handleUserChange"> |
| | | <el-option v-for="user in userOptions" |
| | | :key="user.userId" |
| | | :label="user.userName" |
| | | :label="user.nickName" |
| | | :value="user.userId" /> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | |
| | | // 本次生产数量验证规则 |
| | | const validateQuantity = (rule, value, callback) => { |
| | | if (value === null || value === undefined || value === '') { |
| | | callback(new Error('请输入本次生产数量')); |
| | | if (value === null || value === undefined || value === "") { |
| | | callback(new Error("请输入本次生产数量")); |
| | | return; |
| | | } |
| | | const num = Number(value); |
| | | // 整数且大于等于1 |
| | | if (isNaN(num) || !Number.isInteger(num) || num < 1) { |
| | | callback(new Error('本次生产数量必须大于等于1')); |
| | | callback(new Error("本次生产数量必须大于等于1")); |
| | | return; |
| | | } |
| | | callback(); |
| | |
| | | |
| | | // 报废数量验证规则 |
| | | const validateScrapQty = (rule, value, callback) => { |
| | | if (value === null || value === undefined || value === '') { |
| | | if (value === null || value === undefined || value === "") { |
| | | callback(); |
| | | return; |
| | | } |
| | | const num = Number(value); |
| | | // 整数且大于等于0 |
| | | if (isNaN(num) || !Number.isInteger(num) || num < 0) { |
| | | callback(new Error('报废数量必须大于等于0')); |
| | | callback(new Error("报废数量必须大于等于0")); |
| | | return; |
| | | } |
| | | callback(); |
| | |
| | | |
| | | // 验证规则 |
| | | const reportFormRules = { |
| | | quantity: [ |
| | | { required: true, validator: validateQuantity, trigger: 'blur' } |
| | | ], |
| | | scrapQty: [ |
| | | { validator: validateScrapQty, trigger: 'blur' } |
| | | ] |
| | | quantity: [{ required: true, validator: validateQuantity, trigger: "blur" }], |
| | | scrapQty: [{ validator: validateScrapQty, trigger: "blur" }], |
| | | }; |
| | | |
| | | // 处理本次生产数量输入,限制必须大于等于1 |
| | | const handleQuantityInput = (value) => { |
| | | if (value === '' || value === null || value === undefined) { |
| | | const handleQuantityInput = value => { |
| | | if (value === "" || value === null || value === undefined) { |
| | | reportForm.quantity = null; |
| | | return; |
| | | } |
| | |
| | | }; |
| | | |
| | | // 处理报废数量 |
| | | const handleScrapQtyInput = (value) => { |
| | | if (value === '' || value === null || value === undefined) { |
| | | const handleScrapQtyInput = value => { |
| | | if (value === "" || value === null || value === undefined) { |
| | | reportForm.scrapQty = null; |
| | | return; |
| | | } |
| | |
| | | |
| | | // 创建 Blob URL |
| | | const fileBlob = |
| | | blob instanceof Blob ? blob : new Blob([blob], { type: blob.type || "application/octet-stream" }); |
| | | blob instanceof Blob |
| | | ? blob |
| | | : new Blob([blob], { type: blob.type || "application/octet-stream" }); |
| | | const url = window.URL.createObjectURL(fileBlob); |
| | | |
| | | // 创建隐藏 iframe,用于触发浏览器打印 |
| | |
| | | const showReportDialog = row => { |
| | | currentReportRowData.value = row; |
| | | reportForm.planQuantity = row.planQuantity; |
| | | reportForm.quantity = row.quantity !== undefined && row.quantity !== null ? row.quantity : null; |
| | | reportForm.quantity = |
| | | row.quantity !== undefined && row.quantity !== null ? row.quantity : null; |
| | | reportForm.productProcessRouteItemId = row.productProcessRouteItemId; |
| | | reportForm.workOrderId = row.id; |
| | | reportForm.reportWork = row.reportWork; |
| | | reportForm.productMainId = row.productMainId; |
| | | reportForm.scrapQty = row.scrapQty !== undefined && row.scrapQty !== null ? row.scrapQty : null; |
| | | reportForm.scrapQty = |
| | | row.scrapQty !== undefined && row.scrapQty !== null ? row.scrapQty : null; |
| | | nextTick(() => { |
| | | reportFormRef.value?.clearValidate(); |
| | | }); |
| | |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | reportForm.userId = res.data.userId; |
| | | reportForm.userName = res.data.userName; |
| | | reportForm.userName = res.data.nickName; |
| | | } |
| | | }) |
| | | .catch(err => { |
| | |
| | | }; |
| | | |
| | | const handleReport = () => { |
| | | reportFormRef.value?.validate((valid) => { |
| | | reportFormRef.value?.validate(valid => { |
| | | if (!valid) { |
| | | return false; |
| | | } |
| | |
| | | } |
| | | |
| | | // 验证本次生产数量 |
| | | if (reportForm.quantity === null || reportForm.quantity === undefined || reportForm.quantity === '') { |
| | | if ( |
| | | reportForm.quantity === null || |
| | | reportForm.quantity === undefined || |
| | | reportForm.quantity === "" |
| | | ) { |
| | | ElMessageBox.alert("请输入本次生产数量", "提示", { |
| | | confirmButtonText: "确定", |
| | | }); |
| | |
| | | } |
| | | |
| | | const quantity = Number(reportForm.quantity); |
| | | const scrapQty = reportForm.scrapQty === null || reportForm.scrapQty === undefined || reportForm.scrapQty === '' |
| | | const scrapQty = |
| | | reportForm.scrapQty === null || |
| | | reportForm.scrapQty === undefined || |
| | | reportForm.scrapQty === "" |
| | | ? 0 |
| | | : Number(reportForm.scrapQty); |
| | | |
| | |
| | | const submitData = { |
| | | ...reportForm, |
| | | quantity: quantity, |
| | | scrapQty: scrapQty |
| | | scrapQty: scrapQty, |
| | | }; |
| | | |
| | | // console.log(submitData); |
| | |
| | | }; |
| | | |
| | | // 用户选择变化时更新 userName |
| | | const handleUserChange = (userId) => { |
| | | const handleUserChange = userId => { |
| | | if (userId) { |
| | | const selectedUser = userOptions.value.find(user => user.userId === userId); |
| | | if (selectedUser) { |
| | | reportForm.userName = selectedUser.userName; |
| | | reportForm.userName = selectedUser.nickName; |
| | | } |
| | | } else { |
| | | reportForm.userName = ""; |