| | |
| | | // 临期售后管理-分页查询 |
| | | 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, |
| | | }) |
| | |
| | | export function getProductRecordById(params) { |
| | | return request({ |
| | | url: "/purchase/registration/getProductRecordById", |
| | | method: "get", |
| | | params: params, |
| | | method: "post", |
| | | data: params, |
| | | }); |
| | | } |
| | | |
| | |
| | | <el-form-item label="申请部门:" prop="approveDeptName"> |
| | | <!-- <el-input v-model="form.approveDeptName" placeholder="请输入" clearable/>--> |
| | | <el-select |
| | | v-model="form.approveDeptId" |
| | | v-model="form.approveDeptIdArray" |
| | | placeholder="选择部门" |
| | | multiple |
| | | collapse-tags |
| | | @change="handleDeptChange" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="user in productOptions" |
| | |
| | | approveTime: "", |
| | | approveId: "", |
| | | approveUser: "", |
| | | approveDeptId: "", |
| | | approveDeptIdArray: [], |
| | | approveDeptName: "", |
| | | approveReason: "", |
| | | checkResult: "", |
| | |
| | | approveTime: [{ required: false, message: "请输入", trigger: "change" },], |
| | | approveId: [{ required: false, message: "请输入", trigger: "blur" }], |
| | | approveUser: [{ required: false, message: "请输入", trigger: "blur" }], |
| | | approveDeptName: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | approveDeptName: [{ required: true, message: "请选择申请部门", trigger: "change" }], |
| | | approveReason: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | checkResult: [{ required: false, message: "请输入", trigger: "blur" }], |
| | | startDate: [{ required: true, message: "请选择请假开始时间", trigger: "change" }], |
| | |
| | | approverNodes.value.splice(index, 1) |
| | | } |
| | | // 处理部门选择变化 |
| | | const handleDeptChange = (deptId) => { |
| | | if (deptId) { |
| | | const selectedDept = productOptions.value.find(dept => dept.deptId === deptId); |
| | | if (selectedDept) { |
| | | form.value.approveDeptName = selectedDept.deptName; |
| | | } |
| | | const handleDeptChange = (deptIds) => { |
| | | if (deptIds && deptIds.length > 0) { |
| | | const selectedNames = productOptions.value |
| | | .filter(dept => deptIds.includes(dept.deptId)) |
| | | .map(dept => dept.deptName); |
| | | form.value.approveDeptName = selectedNames.join(','); |
| | | } else { |
| | | form.value.approveDeptName = ''; |
| | | } |
| | |
| | | form.value.approveTime = getCurrentDate(); |
| | | |
| | | // 获取当前用户信息并设置部门ID |
| | | form.value.approveDeptId = userStore.currentDeptId |
| | | form.value.approveDeptIdArray = [] |
| | | if (operationType.value === 'edit') { |
| | | fileList.value = row.commonFileList |
| | | form.value.tempFileIds = fileList.value.map(file => file.id) |
| | | currentApproveStatus.value = row.approveStatus |
| | | approveProcessGetInfo({id: row.approveId,approveReason: '1'}).then(res => { |
| | | form.value = {...res.data} |
| | | // 处理部门反显(根据后端返回的 approveDeptId 处理为数组) |
| | | const deptId = res.data.approveDeptId; |
| | | if (deptId !== undefined && deptId !== null) { |
| | | if (Array.isArray(deptId)) { |
| | | form.value.approveDeptIdArray = deptId; |
| | | } else if (typeof deptId === 'string' && deptId.includes(',')) { |
| | | form.value.approveDeptIdArray = deptId.split(',').map(id => parseInt(id.trim())).filter(id => !isNaN(id)); |
| | | } else if (typeof deptId === 'string' || typeof deptId === 'number') { |
| | | form.value.approveDeptIdArray = [parseInt(deptId)]; |
| | | } |
| | | } else { |
| | | form.value.approveDeptIdArray = []; |
| | | } |
| | | // 反显审批人 |
| | | if (res.data && res.data.approveUserIds) { |
| | | const userIds = res.data.approveUserIds.split(',') |
| | |
| | | } |
| | | proxy.$refs.formRef.validate(valid => { |
| | | if (valid) { |
| | | const submitData = { ...form.value }; |
| | | submitData.approveDeptId = submitData.approveDeptIdArray; |
| | | if (operationType.value === "add" || currentApproveStatus.value == 3) { |
| | | approveProcessAdd(form.value).then(res => { |
| | | approveProcessAdd(submitData).then(res => { |
| | | proxy.$modal.msgSuccess("提交成功"); |
| | | closeDia(); |
| | | }) |
| | | } else { |
| | | approveProcessUpdate(form.value).then(res => { |
| | | approveProcessUpdate(submitData).then(res => { |
| | | proxy.$modal.msgSuccess("提交成功"); |
| | | closeDia(); |
| | | }) |
| | |
| | | <el-option |
| | | v-for="person in employees" |
| | | :key="person.id" |
| | | :label="`${person.staffName} (${person.postName})`" |
| | | :label="person.postName ? `${person.staffName} (${person.postName})` : person.staffName" |
| | | :value="person.id" |
| | | /> |
| | | </el-select> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {ref, reactive, onMounted} from 'vue' |
| | | import {ref, reactive, onMounted, markRaw} from 'vue' |
| | | import {ElMessage} from 'element-plus' |
| | | import {Plus, Document, Promotion, Bell} from '@element-plus/icons-vue' |
| | | import {Document, Promotion, Bell} from '@element-plus/icons-vue' |
| | | import {getRoomEnum, saveMeetingApplication} from '@/api/collaborativeApproval/meeting.js' |
| | | import {staffOnJobListPage} from "@/api/personnelManagement/staffOnJob.js"; |
| | | |
| | |
| | | value: 'approval', |
| | | name: '审批流程会议', |
| | | desc: '需要经过多级审批的会议申请', |
| | | icon: Document |
| | | icon: markRaw(Document) |
| | | }, |
| | | { |
| | | value: 'department', |
| | | name: '部门级会议', |
| | | desc: '部门内部会议申请流程', |
| | | icon: Promotion |
| | | icon: markRaw(Promotion) |
| | | }, |
| | | { |
| | | value: 'notification', |
| | | name: '会议通知', |
| | | desc: '无需审批直接发布的会议通知', |
| | | icon: Bell |
| | | icon: markRaw(Bell) |
| | | } |
| | | ]) |
| | | |
| | |
| | | size: -1, |
| | | staffState: 1 |
| | | }).then(res => { |
| | | employees.value = res.data.records.sort((a, b) => a.postName.localeCompare(b.postName)) |
| | | console.log(res.data.records,"这个是返回的数据地址") |
| | | employees.value = res.data.records.sort((a, b) => { |
| | | const nameA = a.postName || '' |
| | | const nameB = b.postName?.trim() || '' |
| | | return nameA.localeCompare(nameB) |
| | | }) |
| | | }) |
| | | }) |
| | | </script> |
| | |
| | | <script setup> |
| | | import {ref, computed} from "vue"; |
| | | import useUserStore from "@/store/modules/user.js"; |
| | | // import {userListNoPageByTenantId} from "@/api/system/user.js"; // 暂时注释掉,使用假数据 |
| | | // import {expiryAfterSalesAdd, expiryAfterSalesUpdate} from "@/api/customerService/index.js"; // 暂时注释掉,使用假数据 |
| | | import { getCurrentDate } from "@/utils/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('提交数据失败,请稍后重试'); |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | |
| | | dialogFormVisible.value = false; |
| | | emit('close') |
| | | }; |
| | | |
| | | // 获取当前日期并格式化为 YYYY-MM-DD |
| | | function getCurrentDate() { |
| | | const today = new Date(); |
| | | const year = today.getFullYear(); |
| | | const month = String(today.getMonth() + 1).padStart(2, "0"); |
| | | const day = String(today.getDate()).padStart(2, "0"); |
| | | return `${year}-${month}-${day}`; |
| | | } |
| | | |
| | | defineExpose({ |
| | | openDialog, |
| | |
| | | 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; |
| | | tableLoading.value = false; |
| | | 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; |
| | | proxy.$modal.msgSuccess("删除成功"); |
| | | getList(); |
| | | expiryAfterSalesDelete(ids).then(() => { |
| | | proxy.$modal.msgSuccess("删除成功"); |
| | | getList(); |
| | | }).finally(() => { |
| | | tableLoading.value = false; |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | proxy.$modal.msg("已取消"); |
| | |
| | | |
| | | const getPaymenRecordtList = (supplierId) => { |
| | | tableLoadingSon.value = true; |
| | | paymentRecordList({supplierId: supplierId}) |
| | | paymentRecordList(supplierId) |
| | | .then((res) => { |
| | | tableLoadingSon.value = false; |
| | | tableDataSon.value = res.data; |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="规格型号:" prop="model"> |
| | | <el-input v-model="form.model" placeholder="请输入" clearable/> |
| | | <el-form-item label="规格型号:" prop="productModelId"> |
| | | <el-select |
| | | v-model="form.productModelId" |
| | | placeholder="请选择" |
| | | clearable |
| | | @change="getProductModel" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="item in modelOptions" |
| | | :key="item.id" |
| | | :label="item.model" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | <script setup> |
| | | import {ref, reactive, toRefs, getCurrentInstance, nextTick} from "vue"; |
| | | import {getOptions} from "@/api/procurementManagement/procurementLedger.js"; |
| | | import {productTreeList} from "@/api/basicData/product.js"; |
| | | import {modelList, productTreeList} from "@/api/basicData/product.js"; |
| | | import {qualityInspectAdd, qualityInspectUpdate} from "@/api/qualityManagement/rawMaterialInspection.js"; |
| | | import {userListNoPage} from "@/api/system/user.js"; |
| | | import {qualityInspectDetailByProductId, getQualityTestStandardParamByTestStandardId} from "@/api/qualityManagement/metricMaintenance.js"; |
| | |
| | | checkName: "", |
| | | productName: "", |
| | | productId: "", |
| | | productModelId: "", |
| | | model: "", |
| | | testStandardId: "", |
| | | unit: "", |
| | |
| | | process: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | checkName: [{ required: false, message: "请输入", trigger: "blur" }], |
| | | productId: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | productModelId: [{required: true, message: "请选择规格型号", trigger: "change"}], |
| | | model: [{ required: false, message: "请输入", trigger: "blur" }], |
| | | testStandardId: [{required: true, message: "请选择指标", trigger: "change"}], |
| | | unit: [{ required: false, message: "请输入", trigger: "blur" }], |
| | |
| | | const tableData = ref([]); |
| | | const tableLoading = ref(false); |
| | | const userList = ref([]); |
| | | const modelOptions = ref([]); // 规格型号下拉框数据 |
| | | const currentProductId = ref(0); |
| | | const testStandardOptions = ref([]); // 指标选择下拉框数据 |
| | | |
| | |
| | | form.value = {} |
| | | testStandardOptions.value = []; |
| | | tableData.value = []; |
| | | modelOptions.value = []; |
| | | getProductOptions(); |
| | | if (operationType.value === 'edit') { |
| | | // 先保存 testStandardId,避免被清空 |
| | |
| | | currentProductId.value = row.productId || 0 |
| | | // 编辑模式下,先加载指标选项,然后加载参数列表 |
| | | if (currentProductId.value) { |
| | | // 加载规格型号选项 |
| | | modelList({ id: currentProductId.value }).then((res) => { |
| | | modelOptions.value = res; |
| | | }); |
| | | // 先加载指标选项 |
| | | let params = { |
| | | productId: currentProductId.value, |
| | |
| | | const getModels = (value) => { |
| | | currentProductId.value = value |
| | | form.value.productName = findNodeById(productOptions.value, value); |
| | | modelOptions.value = []; |
| | | form.value.productModelId = ""; |
| | | form.value.model = ""; |
| | | if (currentProductId.value) { |
| | | modelList({ id: value }).then((res) => { |
| | | modelOptions.value = res; |
| | | }); |
| | | getList(); |
| | | } |
| | | }; |
| | | const getProductModel = (value) => { |
| | | const index = modelOptions.value.findIndex((item) => item.id === value); |
| | | if (index !== -1) { |
| | | form.value.model = modelOptions.value[index].model; |
| | | form.value.unit = modelOptions.value[index].unit; |
| | | } else { |
| | | form.value.model = ""; |
| | | form.value.unit = ""; |
| | | } |
| | | }; |
| | | const findNodeById = (nodes, productId) => { |
| | | for (let i = 0; i < nodes.length; i++) { |
| | | if (nodes[i].value === productId) { |
| | |
| | | } |
| | | |
| | | const handleUnbind = async (row) => { |
| | | if (!row?.id) return |
| | | if (!row?.processId) return |
| | | try { |
| | | await ElMessageBox.confirm('确认删除该绑定?', '提示', { type: 'warning' }) |
| | | } catch { |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="规格型号:" prop="model"> |
| | | <el-input v-model="form.model" placeholder="请输入" clearable/> |
| | | <el-form-item label="规格型号:" prop="productModelId"> |
| | | <el-select |
| | | v-model="form.productModelId" |
| | | placeholder="请选择" |
| | | clearable |
| | | @change="getProductModel" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="item in modelOptions" |
| | | :key="item.id" |
| | | :label="item.model" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {ref} from "vue"; |
| | | import {productTreeList} from "@/api/basicData/product.js"; |
| | | import {ref, reactive, toRefs, getCurrentInstance} from "vue"; |
| | | import {modelList, productTreeList} from "@/api/basicData/product.js"; |
| | | import { |
| | | getQualityUnqualifiedInfo, |
| | | qualityUnqualifiedAdd, |
| | |
| | | checkName: "", |
| | | productName: "", |
| | | productId: "", |
| | | productModelId: "", |
| | | model: "", |
| | | unit: "", |
| | | quantity: "", |
| | |
| | | process: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | checkName: [{ required: false, message: "请输入", trigger: "blur" }], |
| | | productId: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | productModelId: [{required: true, message: "请选择规格型号", trigger: "change"}], |
| | | model: [{ required: false, message: "请输入", trigger: "blur" }], |
| | | unit: [{ required: false, message: "请输入", trigger: "blur" }], |
| | | quantity: [{ required: true, message: "请输入", trigger: "blur" }], |
| | |
| | | }); |
| | | const { form, rules } = toRefs(data); |
| | | const productOptions = ref([]); |
| | | const modelOptions = ref([]); |
| | | |
| | | // 打开弹框 |
| | | const openDialog = (type, row) => { |
| | | operationType.value = type; |
| | | dialogFormVisible.value = true; |
| | | form.value = {} |
| | | modelOptions.value = []; |
| | | getProductOptions(); |
| | | if (operationType.value === 'edit') { |
| | | getQualityUnqualifiedInfo(row.id).then(res => { |
| | | form.value = {...res.data} |
| | | if (form.value.productId) { |
| | | modelList({ id: form.value.productId }).then((res) => { |
| | | modelOptions.value = res; |
| | | }); |
| | | } |
| | | }) |
| | | } |
| | | } |
| | |
| | | }; |
| | | const getModels = (value) => { |
| | | form.value.productName = findNodeById(productOptions.value, value); |
| | | modelOptions.value = []; |
| | | form.value.productModelId = ""; |
| | | form.value.model = ""; |
| | | if (value) { |
| | | modelList({ id: value }).then((res) => { |
| | | modelOptions.value = res; |
| | | }); |
| | | } |
| | | }; |
| | | const getProductModel = (value) => { |
| | | const index = modelOptions.value.findIndex((item) => item.id === value); |
| | | if (index !== -1) { |
| | | form.value.model = modelOptions.value[index].model; |
| | | form.value.unit = modelOptions.value[index].unit; |
| | | } else { |
| | | form.value.model = ""; |
| | | form.value.unit = ""; |
| | | } |
| | | }; |
| | | const findNodeById = (nodes, productId) => { |
| | | for (let i = 0; i < nodes.length; i++) { |
| | |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="规格型号:" prop="model"> |
| | | <el-input v-model="form.model" placeholder="请输入" clearable/> |
| | | <el-form-item label="规格型号:" prop="productModelId"> |
| | | <el-select |
| | | v-model="form.productModelId" |
| | | placeholder="请选择" |
| | | clearable |
| | | @change="getProductModel" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="item in modelOptions" |
| | | :key="item.id" |
| | | :label="item.model" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | <script setup> |
| | | import {ref, reactive, toRefs, getCurrentInstance, nextTick} from "vue"; |
| | | import {getOptions} from "@/api/procurementManagement/procurementLedger.js"; |
| | | import {productTreeList} from "@/api/basicData/product.js"; |
| | | import {modelList, productTreeList} from "@/api/basicData/product.js"; |
| | | import {productProcessListPage} from "@/api/basicData/productProcess.js"; |
| | | import {qualityInspectAdd, qualityInspectUpdate} from "@/api/qualityManagement/rawMaterialInspection.js"; |
| | | import {qualityInspectDetailByProductId, getQualityTestStandardParamByTestStandardId} from "@/api/qualityManagement/metricMaintenance.js"; |
| | |
| | | checkName: "", |
| | | productName: "", |
| | | productId: "", |
| | | productModelId: "", |
| | | model: "", |
| | | testStandardId: "", |
| | | unit: "", |
| | |
| | | processId: [{ required: true, message: "请选择工序", trigger: "change" }], |
| | | checkName: [{ required: false, message: "请输入", trigger: "blur" }], |
| | | productId: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | productModelId: [{required: true, message: "请选择规格型号", trigger: "change"}], |
| | | model: [{ required: false, message: "请输入", trigger: "blur" }], |
| | | testStandardId: [{required: true, message: "请选择指标", trigger: "change"}], |
| | | unit: [{ required: false, message: "请输入", trigger: "blur" }], |
| | |
| | | const tableLoading = ref(false); |
| | | const currentProductId = ref(0); |
| | | const processOptions = ref([]); // 工序下拉框数据 |
| | | const modelOptions = ref([]); // 规格型号下拉框数据 |
| | | const testStandardOptions = ref([]); // 指标选择下拉框数据 |
| | | |
| | | // 获取工序列表 |
| | |
| | | form.value = {} |
| | | testStandardOptions.value = []; |
| | | tableData.value = []; |
| | | modelOptions.value = []; |
| | | getProductOptions(); |
| | | // 先加载工序列表 |
| | | await getProcessList(); |
| | |
| | | currentProductId.value = row.productId || 0 |
| | | // 编辑模式下,先加载指标选项,然后加载参数列表 |
| | | if (currentProductId.value) { |
| | | // 加载规格型号选项 |
| | | modelList({ id: currentProductId.value }).then((res) => { |
| | | modelOptions.value = res; |
| | | }); |
| | | // 先加载指标选项 |
| | | let params = { |
| | | productId: currentProductId.value, |
| | |
| | | const getModels = (value) => { |
| | | currentProductId.value = value |
| | | form.value.productName = findNodeById(productOptions.value, value); |
| | | modelOptions.value = []; |
| | | form.value.productModelId = ""; |
| | | form.value.model = ""; |
| | | if (currentProductId.value) { |
| | | modelList({ id: value }).then((res) => { |
| | | modelOptions.value = res; |
| | | }); |
| | | getList(); |
| | | } |
| | | }; |
| | | const getProductModel = (value) => { |
| | | const index = modelOptions.value.findIndex((item) => item.id === value); |
| | | if (index !== -1) { |
| | | form.value.model = modelOptions.value[index].model; |
| | | form.value.unit = modelOptions.value[index].unit; |
| | | } else { |
| | | form.value.model = ""; |
| | | form.value.unit = ""; |
| | | } |
| | | }; |
| | | const findNodeById = (nodes, productId) => { |
| | | for (let i = 0; i < nodes.length; i++) { |
| | | if (nodes[i].value === productId) { |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="产品名称:" prop="productId"> |
| | | <el-tree-select |
| | | v-model="form.productId" |
| | | placeholder="请选择" |
| | | clearable |
| | | check-strictly |
| | | @change="getModels" |
| | | :data="productOptions" |
| | | :render-after-expand="false" |
| | | style="width: 100%" |
| | | /> |
| | | <el-tree-select v-model="form.productId" placeholder="请选择" clearable check-strictly |
| | | @change="getModels" :data="productOptions" :render-after-expand="false" style="width: 100%" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="规格型号:" prop="model"> |
| | | <el-input v-model="form.model" placeholder="请输入" clearable/> |
| | | <el-form-item label="规格型号:" prop="productModelId"> |
| | | <el-select v-model="form.productModelId" placeholder="请选择" clearable @change="getProductModel" style="width: 100%"> |
| | | <el-option v-for="item in modelOptions" :key="item.id" :label="item.model" :value="item.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | <script setup> |
| | | import {ref, reactive, toRefs, getCurrentInstance, nextTick} from "vue"; |
| | | import {getOptions} from "@/api/procurementManagement/procurementLedger.js"; |
| | | import {productTreeList} from "@/api/basicData/product.js"; |
| | | import {modelList, productTreeList} from "@/api/basicData/product.js"; |
| | | import {qualityInspectAdd, qualityInspectUpdate} from "@/api/qualityManagement/rawMaterialInspection.js"; |
| | | import {ElMessageBox} from "element-plus"; |
| | | import {qualityInspectParamDel, qualityInspectParamInfo} from "@/api/qualityManagement/qualityInspectParam.js"; |
| | |
| | | checkName: "", |
| | | productName: "", |
| | | productId: "", |
| | | productModelId: "", |
| | | model: "", |
| | | testStandardId: "", |
| | | unit: "", |
| | |
| | | supplier: [{required: true, message: "请输入", trigger: "blur"}], |
| | | checkName: [{required: false, message: "请输入", trigger: "blur"}], |
| | | productId: [{required: true, message: "请输入", trigger: "blur"}], |
| | | productModelId: [{required: true, message: "请选择规格型号", trigger: "change"}], |
| | | model: [{required: false, message: "请输入", trigger: "blur"}], |
| | | testStandardId: [{required: true, message: "请选择指标", trigger: "change"}], |
| | | unit: [{required: false, message: "请输入", trigger: "blur"}], |
| | |
| | | const {form, rules} = toRefs(data); |
| | | const supplierList = ref([]); |
| | | const productOptions = ref([]); |
| | | const modelOptions = ref([]); |
| | | const currentProductId = ref(0); |
| | | const testStandardOptions = ref([]); // 指标选择下拉框数据 |
| | | |
| | |
| | | form.value = {} |
| | | testStandardOptions.value = []; |
| | | tableData.value = []; |
| | | modelOptions.value = []; |
| | | getProductOptions(); |
| | | if (operationType.value === 'edit') { |
| | | // 先保存 testStandardId,避免被清空 |
| | |
| | | currentProductId.value = row.productId || 0 |
| | | // 编辑模式下,先加载指标选项,然后加载参数列表 |
| | | if (currentProductId.value) { |
| | | // 加载规格型号选项 |
| | | modelList({ id: currentProductId.value }).then((res) => { |
| | | modelOptions.value = res; |
| | | }); |
| | | // 先加载指标选项 |
| | | let params = { |
| | | productId: currentProductId.value, |
| | |
| | | const getModels = (value) => { |
| | | currentProductId.value = value |
| | | form.value.productName = findNodeById(productOptions.value, value); |
| | | modelOptions.value = []; |
| | | form.value.productModelId = ""; |
| | | form.value.model = ""; |
| | | if (currentProductId.value) { |
| | | modelList({ id: value }).then((res) => { |
| | | modelOptions.value = res; |
| | | }); |
| | | getList(); |
| | | } |
| | | }; |
| | | const getProductModel = (value) => { |
| | | const index = modelOptions.value.findIndex((item) => item.id === value); |
| | | if (index !== -1) { |
| | | form.value.model = modelOptions.value[index].model; |
| | | form.value.unit = modelOptions.value[index].unit; |
| | | } else { |
| | | form.value.model = ""; |
| | | form.value.unit = ""; |
| | | } |
| | | }; |
| | | const findNodeById = (nodes, productId) => { |
| | | for (let i = 0; i < nodes.length; i++) { |
| | | if (nodes[i].value === productId) { |