| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="公告类型" prop="type"> |
| | | <el-input v-model="form.type" placeholder="请输入公告标题"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="状态"> |
| | | <el-radio-group v-model="form.status"> |
| | | <el-radio :value="0">草稿</el-radio> |
| | |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="优先级"> |
| | | <el-select v-model="form.priority" placeholder="请选择优先级" style="width: 100%"> |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="过期时间" prop="expirationDate"> |
| | | <el-date-picker v-model="form.expirationDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="date" |
| | | placeholder="请选择" clearable /> |
| | | placeholder="请选择" clearable style="width: 100%"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | form: { |
| | | id: undefined, |
| | | title: "", |
| | | type: null, |
| | | content: "", |
| | | status: 0, |
| | | priority: 1, |
| | |
| | | rules: { |
| | | title: [ |
| | | {required: true, message: "公告标题不能为空", trigger: "blur"} |
| | | ], |
| | | type: [ |
| | | {required: true, message: "请选择公告类型", trigger: "change"} |
| | | ], |
| | | content: [ |
| | | {required: true, message: "公告内容不能为空", trigger: "blur"} |
| | |
| | | form.value = { |
| | | id: undefined, |
| | | title: "", |
| | | type: undefined, |
| | | content: "", |
| | | status: 0, |
| | | priority: 1, |
| | |
| | | } else { |
| | | // 新增时设置默认值 |
| | | form.value.unit = "箱"; // 单位默认为箱 |
| | | form.value.quantity = 40; // 数量默认为40 |
| | | form.value.checkResult = "合格"; // 检验结果默认为合格 |
| | | } |
| | | await getProductOptions(); |
| | | // 默认检验员为当前登录人,检测日期默认为当天(空时填充) |
| | | if (currentUserName.value && !form.value.checkName) { |
| | | form.value.checkName = currentUserName.value; |
| | | // 默认检验员为刘婷婷,检测日期默认为当天(空时填充) |
| | | if (!form.value.checkName) { |
| | | form.value.checkName = "刘婷婷"; |
| | | } |
| | | if (!form.value.checkTime) { |
| | | form.value.checkTime = getToday(); |
| | |
| | | form.value.unit = "包"; // 单位默认为包 |
| | | form.value.quantity = 3; // 数量默认为3 |
| | | form.value.checkResult = "合格"; // 检验结果默认为合格 |
| | | // 产品名称默认傻老大原味瓜子(质检试压) |
| | | productTreeList({productName: '质量'}).then((res) => { |
| | | productOptions.value = convertIdToValue(res); |
| | | // 递归查找目标节点 |
| | | const findTarget = (nodes) => { |
| | | for (const node of nodes) { |
| | | if (node.label === "傻老大原味瓜子(质检试压)") { |
| | | return node; |
| | | } |
| | | if (node.children && node.children.length > 0) { |
| | | const found = findTarget(node.children); |
| | | if (found) return found; |
| | | } |
| | | } |
| | | return null; |
| | | }; |
| | | const target = findTarget(res); |
| | | if (target) { |
| | | form.value.productId = target.id; |
| | | form.value.productName = target.label; |
| | | currentProductId.value = target.id; |
| | | // 加载规格列表 |
| | | modelList({ id: target.id }).then((modelRes) => { |
| | | modelOptions.value = modelRes; |
| | | }); |
| | | // 加载检验参数 |
| | | qualityInspectDetailByProductId(target.id).then((paramRes) => { |
| | | tableData.value = paramRes.data; |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | // 默认检验员为当前登录人,检测日期默认为当天(空时填充) |
| | | if (currentUserName.value && !form.value.checkName) { |
| | | form.value.checkName = currentUserName.value; |
| | | if (!form.value.checkName) { |
| | | form.value.checkName = "侯盛杰"; |
| | | } |
| | | if (!form.value.checkTime) { |
| | | form.value.checkTime = getToday(); |
| | |
| | | return; |
| | | } |
| | | form.value.registrant = userStore.nickName; |
| | | // 从字典中获取"电汇"对应的value |
| | | const dianhuiItem = receipt_payment_type.value?.find(item => item.label === "电汇"); |
| | | const defaultPaymentType = dianhuiItem?.value || ""; |
| | | form.value.paymentList = selectedRows.value.map(row => ({ |
| | | invoiceLedgerId: row.id, |
| | | salesContractNo: row.salesContractNo, |
| | |
| | | noReceiptAmount: row.noReceiptAmount, |
| | | taxRate: row.taxRate, |
| | | receiptPaymentAmount: row.noReceiptAmount, |
| | | receiptPaymentType: "", |
| | | receiptPaymentType: defaultPaymentType, |
| | | receiptPaymentDate: new Date().toISOString().split('T')[0], |
| | | })); |
| | | dialogFormVisible.value = true; |