| | |
| | | <el-input v-model="searchForm.salesContractNo" placeholder="请输入" clearable prefix-icon="Search" |
| | | @change="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="项目名称:"> |
| | | <el-input v-model="searchForm.projectName" placeholder="请输入" clearable prefix-icon="Search" |
| | | @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" /> |
| | |
| | | :summary-method="summarizeMainTable" |
| | | @expand-change="expandChange" |
| | | height="calc(100vh - 19em)" |
| | | :row-class-name="tableRowClassName" |
| | | > |
| | | <el-table-column align="center" type="selection" width="55" /> |
| | | <el-table-column type="expand"> |
| | |
| | | prop="supplierName" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column label="订单状态" width="100" align="center"> |
| | | <template #default="scope"> |
| | | <el-tag v-if="scope.row.isInvalid" type="danger" size="small">失效</el-tag> |
| | | <el-tag v-else type="success" size="small">正常</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="项目名称" |
| | | prop="projectName" |
| | | width="420" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="审批状态" |
| | | prop="approvalStatus" |
| | | width="200" |
| | | show-overflow-tooltip |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag |
| | | size="small" |
| | | > |
| | | {{ approvalStatusText[scope.row.approvalStatus] || '未知状态' }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="签订日期" |
| | | prop="executionDate" |
| | |
| | | placeholder="请选择" |
| | | filterable |
| | | clearable |
| | | @change="salesLedgerChange" |
| | | > |
| | | <el-option |
| | | v-for="item in salesContractList" |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="付款方式"> |
| | | <el-input |
| | | v-model="form.paymentMethod" |
| | | placeholder="请输入" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="项目名称" prop="projectName"> |
| | | <el-input |
| | | v-model="form.projectName" |
| | | placeholder="请输入" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="付款方式"> |
| | | <el-input |
| | | v-model="form.paymentMethod" |
| | | placeholder="请输入" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="签订日期:" prop="executionDate"> |
| | | <el-date-picker |
| | |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="录入人:" prop="recorderId"> |
| | | <el-form-item label="审批人:" prop="approverId"> |
| | | <el-select |
| | | v-model="form.recorderId" |
| | | placeholder="请选择" |
| | | clearable |
| | | filterable |
| | | default-first-option |
| | | :reserve-keyword="false" |
| | | v-model="form.approverId" |
| | | placeholder="请选择审批人" |
| | | clearable |
| | | > |
| | | <el-option |
| | | v-for="item in userList" |
| | | :key="item.userId" |
| | | :label="item.nickName" |
| | | :value="item.userId" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="录入人:" prop="recorderId" v-show="false"> |
| | | <el-select |
| | | v-model="form.recorderId" |
| | | placeholder="请选择" |
| | | clearable |
| | | disabled |
| | | > |
| | | <el-option |
| | | v-for="item in userList" |
| | |
| | | >删除</el-button |
| | | > |
| | | </el-form-item> |
| | | <div class="select-button-group" style="width: 220px; margin: 20px 0;" v-if="operationType === 'add'"> |
| | | <el-select |
| | | filterable |
| | | allow-create |
| | | :reserve-keyword="true" |
| | | :default-first-option="false" |
| | | v-model="templateName" |
| | | :input-value="filterInputValue" |
| | | @filter-change="onTemplateFilterChange" |
| | | @change="onTemplateChange" |
| | | style="width: 180px; border-right: none; border-radius: 4px 0 0 4px;" |
| | | placeholder="请选择" |
| | | class="no-arrow-select" |
| | | > |
| | | <el-option |
| | | v-for="item in templateList" |
| | | :key="item.value" |
| | | :label="item.templateName" |
| | | :value="item.templateName" |
| | | ></el-option> |
| | | </el-select> |
| | | <!-- 按钮:与 Select 高度匹配,去掉左侧边框,无缝衔接 --> |
| | | <el-button |
| | | size="small" |
| | | style="height: 32px; border-radius: 0 4px 4px 0; margin-left: -1px;" |
| | | @click="handleButtonClick" |
| | | :disabled="!templateName || templateName.trim() === '' || isTemplateNameDuplicate" |
| | | > |
| | | 保存 |
| | | </el-button> |
| | | </div> |
| | | </el-row> |
| | | <el-table |
| | | :data="productData" |
| | |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="项目名称:" prop="projectName"> |
| | | <el-input |
| | | v-model="scanAddForm.projectName" |
| | | placeholder="请输入" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="合同金额(元):" prop="contractAmount"> |
| | | <el-input-number |
| | | v-model="scanAddForm.contractAmount" |
| | |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="项目名称:"> |
| | | <el-input v-model="scanForm.projectName" disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="扫码时间:"> |
| | | <el-input v-model="scanForm.scanTime" disabled /> |
| | | </el-form-item> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { getToken } from "@/utils/auth"; |
| | | import {getToken} from "@/utils/auth"; |
| | | import pagination from "@/components/PIMTable/Pagination.vue"; |
| | | import { ref, onMounted, reactive, toRefs, getCurrentInstance, nextTick } from "vue"; |
| | | import { Search } from "@element-plus/icons-vue"; |
| | | import { ElMessageBox } from "element-plus"; |
| | | import { ElMessageBox,ElMessage } from "element-plus"; |
| | | import { userListNoPage } from "@/api/system/user.js"; |
| | | import FileList from "./fileList.vue"; |
| | | import { |
| | |
| | | } from "@/api/salesManagement/salesLedger.js"; |
| | | import { |
| | | addOrEditPurchase, |
| | | addPurchaseTemplate, |
| | | createPurchaseNo, |
| | | delPurchase, |
| | | getSalesNo, |
| | | purchaseListPage, |
| | | productList, |
| | | getPurchaseById, |
| | | getOptions, |
| | | createPurchaseNo, |
| | | getPurchaseTemplateList |
| | | } from "@/api/procurementManagement/procurementLedger.js"; |
| | | import useFormData from "@/hooks/useFormData.js"; |
| | | import QRCode from "qrcode"; |
| | | |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | const tableData = ref([]); |
| | | const productData = ref([]); |
| | |
| | | const qrCodeDialogVisible = ref(false); |
| | | const qrCodeUrl = ref(""); |
| | | |
| | | // 订单审批状态显示文本 |
| | | const approvalStatusText = { |
| | | 0: '审批中', |
| | | 1: '审批通过', |
| | | 2: '审批失败' |
| | | }; |
| | | |
| | | |
| | | const templateName = ref(''); |
| | | const filterInputValue = ref(''); |
| | | const templateList = ref([]); |
| | | const isTemplateNameDuplicate = ref(false); // 标记模板名称是否重复 |
| | | |
| | | // 检查模板名称是否重复 |
| | | const checkTemplateNameDuplicate = (name) => { |
| | | if (!name || name.trim() === '') { |
| | | isTemplateNameDuplicate.value = false; |
| | | return false; |
| | | } |
| | | const isDuplicate = templateList.value.some(item => item.templateName === name.trim()); |
| | | isTemplateNameDuplicate.value = isDuplicate; |
| | | return isDuplicate; |
| | | }; |
| | | |
| | | // 防抖定时器 |
| | | let duplicateCheckTimer = null; |
| | | const onTemplateFilterChange = (val) => { |
| | | filterInputValue.value = val ?? ''; |
| | | // 清除之前的定时器 |
| | | if (duplicateCheckTimer) { |
| | | clearTimeout(duplicateCheckTimer); |
| | | } |
| | | // 实时检查模板名称是否重复(防抖处理,避免频繁提示) |
| | | if (val && val.trim()) { |
| | | duplicateCheckTimer = setTimeout(() => { |
| | | const isDuplicate = checkTemplateNameDuplicate(val); |
| | | if (isDuplicate) { |
| | | ElMessage({ |
| | | message: '模板名称已存在,请更换模板名称', |
| | | type: 'warning', |
| | | duration: 2000 |
| | | }); |
| | | } |
| | | }, 300); // 300ms 防抖 |
| | | } else { |
| | | isTemplateNameDuplicate.value = false; |
| | | } |
| | | }; |
| | | |
| | | // allow-create 时,输入不存在的内容会作为 string 值返回;这里同步回输入框以确保文字不丢 |
| | | const onTemplateChange = async (val) => { |
| | | if (typeof val === 'string') { |
| | | filterInputValue.value = val; |
| | | // 选择或输入时检查重复 |
| | | checkTemplateNameDuplicate(val); |
| | | } |
| | | |
| | | // 过滤数据,查找匹配的模板 |
| | | const matchedTemplate = templateList.value.find(item => item.templateName === val); |
| | | |
| | | if (matchedTemplate?.id) { |
| | | // 如果找到模板,加载模板数据 |
| | | form.value = { |
| | | ...form.value, |
| | | ...matchedTemplate, |
| | | }; |
| | | productData.value = matchedTemplate.productData || []; |
| | | // 生成新的采购合同号 |
| | | try { |
| | | const res = await createPurchaseNo(); |
| | | if (res?.data) { |
| | | form.value.purchaseContractNumber = res.data; |
| | | } |
| | | } catch (error) { |
| | | console.error('生成采购合同号失败:', error); |
| | | } |
| | | } else { |
| | | // 如果没有找到模板,重置表单(保持当前表单状态) |
| | | const currentFormData = { ...form.value }; |
| | | const currentProductData = [...productData.value]; |
| | | |
| | | // 如果对话框未打开,先打开 |
| | | if (!dialogFormVisible.value) { |
| | | operationType.value = 'add'; |
| | | dialogFormVisible.value = true; |
| | | } |
| | | |
| | | // 等待下一个 tick 后恢复数据 |
| | | await nextTick(); |
| | | form.value = { |
| | | ...form.value, |
| | | ...currentFormData, |
| | | }; |
| | | productData.value = currentProductData; |
| | | } |
| | | }; |
| | | |
| | | // 用户信息表单弹框数据 |
| | | const operationType = ref(""); |
| | | const dialogFormVisible = ref(false); |
| | |
| | | supplierName: "", // 供应商名称 |
| | | purchaseContractNumber: "", // 采购合同编号 |
| | | salesContractNo: "", // 销售合同编号 |
| | | projectName: "", // 项目名称 |
| | | entryDate: null, // 录入日期 |
| | | entryDateStart: undefined, |
| | | entryDateEnd: undefined, |
| | |
| | | form: { |
| | | purchaseContractNumber: "", |
| | | salesLedgerId: "", |
| | | projectName: "", |
| | | recorderId: "", |
| | | entryDate: "", |
| | | productData: [], |
| | |
| | | purchaseContractNumber: [ |
| | | { required: true, message: "请输入", trigger: "blur" }, |
| | | ], |
| | | approverId:[{ required: true, message: "请选择审批人", trigger: "change" }], |
| | | projectName:[{ required:true, message:"请输入项目名称", trigger:"blur"}], |
| | | supplierId: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | entryDate: [{ required: true, message: "请选择", trigger: "change" }], |
| | | executionDate: [{ required: true, message: "请选择", trigger: "change" }], |
| | |
| | | page.current = 1; |
| | | getList(); |
| | | }; |
| | | |
| | | // 保存模板 |
| | | const handleButtonClick = async () => { |
| | | // 检查模板名称是否为空 |
| | | if (!templateName.value || templateName.value.trim() === '') { |
| | | ElMessage({ |
| | | message: '请输入模板名称', |
| | | type: 'warning', |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | // 检查模板名称是否重复 |
| | | const isDuplicate = checkTemplateNameDuplicate(templateName.value); |
| | | if (isDuplicate) { |
| | | ElMessage({ |
| | | message: '模板名称已存在,请更换模板名称', |
| | | type: 'warning', |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | // 检查供应商是否选择 |
| | | if (!form.value.supplierId) { |
| | | ElMessage({ |
| | | message: '请先选择供应商', |
| | | type: 'warning', |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | // 检查是否有产品数据 |
| | | // if (!productData.value || productData.value.length === 0) { |
| | | // ElMessage({ |
| | | // message: '请先添加产品信息', |
| | | // type: 'warning', |
| | | // }); |
| | | // return; |
| | | // } |
| | | |
| | | try { |
| | | let params = { |
| | | productData: proxy.HaveJson(productData.value), |
| | | supplierId: form.value.supplierId, |
| | | paymentMethod: form.value.paymentMethod, |
| | | recorderId: form.value.recorderId, |
| | | approverId: form.value.approverId, |
| | | templateName: templateName.value.trim() |
| | | }; |
| | | console.log(params); |
| | | let res = await addPurchaseTemplate(params); |
| | | |
| | | if (res && res.code === 200) { |
| | | ElMessage({ |
| | | message: '模板保存成功', |
| | | type: 'success', |
| | | }); |
| | | // 保存成功后重新获取模板列表 |
| | | await getTemplateList(); |
| | | // 清空模板名称输入 |
| | | templateName.value = ''; |
| | | filterInputValue.value = ''; |
| | | isTemplateNameDuplicate.value = false; |
| | | } else { |
| | | ElMessage({ |
| | | message: res?.msg || '模板保存失败', |
| | | type: 'error', |
| | | }); |
| | | } |
| | | } catch (error) { |
| | | console.error('保存模板失败:', error); |
| | | ElMessage({ |
| | | message: '模板保存失败,请稍后重试', |
| | | type: 'error', |
| | | }); |
| | | } |
| | | }; |
| | | // 子表合计方法 |
| | | const summarizeChildrenTable = (param) => { |
| | | return proxy.summarizeTable( |
| | |
| | | purchaseListPage({ ...rest, ...page }) |
| | | .then((res) => { |
| | | tableLoading.value = false; |
| | | tableData.value = res.data.records; |
| | | tableData.value.map((item) => { |
| | | // tableData.value = res.data.records; |
| | | tableData.value = res.data.records.map(record => ({ |
| | | ...record, |
| | | isInvalid: record.isWhite === 1 |
| | | })); |
| | | // 初始化子数据数组 |
| | | tableData.value.forEach((item) => { |
| | | item.children = []; |
| | | }); |
| | | total.value = res.data.total; |
| | |
| | | }; |
| | | const expandedRowKeys = ref([]); |
| | | // 展开行 |
| | | const expandChange = (row, expandedRows) => { |
| | | const expandChange = async (row, expandedRows) => { |
| | | if (expandedRows.length > 0) { |
| | | expandedRowKeys.value = []; |
| | | try { |
| | | productList({ salesLedgerId: row.id, type: 2 }).then((res) => { |
| | | const index = tableData.value.findIndex((item) => item.id === row.id); |
| | | if (index > -1) { |
| | | tableData.value[index].children = res.data; |
| | | } |
| | | const res = await productList({ salesLedgerId: row.id, type: 2 }); |
| | | const index = tableData.value.findIndex((item) => item.id === row.id); |
| | | if (index > -1) { |
| | | tableData.value[index].children = res.data || []; |
| | | expandedRowKeys.value.push(row.id); |
| | | }); |
| | | } |
| | | } catch (error) { |
| | | console.log(error); |
| | | console.error('加载产品列表失败:', error); |
| | | proxy.$modal.msgError('加载产品列表失败'); |
| | | // 展开失败时,移除展开状态 |
| | | const index = expandedRows.findIndex(item => item.id === row.id); |
| | | if (index > -1) { |
| | | expandedRows.splice(index, 1); |
| | | } |
| | | } |
| | | } else { |
| | | expandedRowKeys.value = []; |
| | |
| | | ]); |
| | | }; |
| | | // 打开弹框 |
| | | const openForm = (type, row) => { |
| | | const openForm = async (type, row) => { |
| | | await getTemplateList() |
| | | operationType.value = type; |
| | | form.value = {}; |
| | | productData.value = []; |
| | | fileList.value = []; |
| | | if (operationType.value == "add") { |
| | | createPurchaseNo().then((res) => { |
| | | form.value.purchaseContractNumber = res.data; |
| | | }); |
| | | } |
| | | userListNoPage().then((res) => { |
| | | userList.value = res.data; |
| | | }); |
| | | getSalesNo().then((res) => { |
| | | salesContractList.value = res; |
| | | }); |
| | | getOptions().then((res) => { |
| | | supplierList.value = res.data; |
| | | }); |
| | | form.value.recorderId = userStore.id; |
| | | form.value.entryDate = getCurrentDate(); |
| | | if (type === "edit") { |
| | | currentId.value = row.id; |
| | | getPurchaseById({ id: row.id, type: 2 }).then((res) => { |
| | | form.value = { ...res }; |
| | | productData.value = form.value.productData; |
| | | if (form.value.salesLedgerFiles) { |
| | | fileList.value = form.value.salesLedgerFiles; |
| | | } else { |
| | | fileList.value = []; |
| | | templateName.value = ''; |
| | | filterInputValue.value = ''; |
| | | isTemplateNameDuplicate.value = false; |
| | | try { |
| | | // 并行加载基础数据 |
| | | const [userRes, salesRes, supplierRes] = await Promise.all([ |
| | | userListNoPage(), |
| | | getSalesNo(), |
| | | getOptions() |
| | | ]); |
| | | |
| | | userList.value = userRes.data || []; |
| | | salesContractList.value = salesRes || []; |
| | | // 供应商过滤出isWhite=0 的数据 |
| | | supplierList.value = (supplierRes.data || []).filter((item) => item.isWhite === 0); |
| | | |
| | | // 设置默认值 |
| | | form.value.recorderId = userStore.id; |
| | | form.value.entryDate = getCurrentDate(); |
| | | |
| | | if (type === "add") { |
| | | // 新增时生成采购合同号 |
| | | try { |
| | | const purchaseNoRes = await createPurchaseNo(); |
| | | if (purchaseNoRes?.data) { |
| | | form.value.purchaseContractNumber = purchaseNoRes.data; |
| | | } |
| | | } catch (error) { |
| | | console.error('生成采购合同号失败:', error); |
| | | proxy.$modal.msgWarning('生成采购合同号失败'); |
| | | } |
| | | }); |
| | | } else if (type === "edit" && row?.id) { |
| | | // 编辑时加载数据 |
| | | currentId.value = row.id; |
| | | try { |
| | | const purchaseRes = await getPurchaseById({ id: row.id, type: 2 }); |
| | | form.value = { ...purchaseRes }; |
| | | productData.value = purchaseRes.productData || []; |
| | | fileList.value = purchaseRes.salesLedgerFiles || []; |
| | | } catch (error) { |
| | | console.error('加载采购台账数据失败:', error); |
| | | proxy.$modal.msgError('加载数据失败'); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | dialogFormVisible.value = true; |
| | | } catch (error) { |
| | | console.error('打开表单失败:', error); |
| | | proxy.$modal.msgError('加载基础数据失败'); |
| | | } |
| | | dialogFormVisible.value = true; |
| | | }; |
| | | // 上传前校检 |
| | | function handleBeforeUpload(file) { |
| | |
| | | } |
| | | } |
| | | // 移除文件 |
| | | function handleRemove(file) { |
| | | async function handleRemove(file) { |
| | | if (!file?.id) { |
| | | return; |
| | | } |
| | | console.log("handleRemove", file.id); |
| | | if (file.size > 1024 * 1024 * 10) { |
| | | // 仅前端清理,不调用删除接口和提示 |
| | | return; |
| | | return; |
| | | } |
| | | if (operationType.value === "edit") { |
| | | let ids = []; |
| | | ids.push(file.id); |
| | | delLedgerFile(ids).then((res) => { |
| | | |
| | | if (operationType.value === "edit" && file.id) { |
| | | try { |
| | | await delLedgerFile([file.id]); |
| | | proxy.$modal.msgSuccess("删除成功"); |
| | | }); |
| | | } catch (error) { |
| | | console.error('删除文件失败:', error); |
| | | proxy.$modal.msgError("删除文件失败"); |
| | | } |
| | | } |
| | | } |
| | | // 提交表单 |
| | |
| | | scanContent: "", |
| | | purchaseContractNumber: "", |
| | | supplierName: "", |
| | | projectName: "", |
| | | contractAmount: "", |
| | | paymentMethod: "", |
| | | recorderName: "", |
| | |
| | | const scanAddRules = { |
| | | purchaseContractNumber: [{ required: true, message: "请输入采购合同号", trigger: "blur" }], |
| | | supplierName: [{ required: true, message: "请输入供应商名称", trigger: "blur" }], |
| | | projectName: [{ required: true, message: "请输入项目名称", trigger: "blur" }], |
| | | }; |
| | | |
| | | // 扫码登记对话框相关变量 |
| | |
| | | const scanForm = reactive({ |
| | | purchaseContractNumber: "", |
| | | supplierName: "", |
| | | projectName: "", |
| | | scanTime: "", |
| | | scannerName: "", |
| | | scanStatus: "未扫码", |
| | |
| | | scanAddForm.scanContent = ""; |
| | | scanAddForm.purchaseContractNumber = ""; |
| | | scanAddForm.supplierName = ""; |
| | | scanAddForm.projectName = ""; |
| | | scanAddForm.contractAmount = ""; |
| | | scanAddForm.paymentMethod = ""; |
| | | scanAddForm.recorderName = userStore.nickName; |
| | |
| | | scanAddForm.supplierName = parts[1] || ""; |
| | | scanAddForm.contractAmount = parts[2] || ""; |
| | | scanAddForm.paymentMethod = parts[3] || ""; |
| | | scanAddForm.projectName = parts[4] || ""; |
| | | // scanAddForm.contractAmount = parts[3] || ""; |
| | | // scanAddForm.paymentMethod = parts[4] || ""; |
| | | } |
| | | }; |
| | | |
| | |
| | | const newData = { |
| | | purchaseContractNumber: scanAddForm.purchaseContractNumber, |
| | | supplierName: scanAddForm.supplierName, |
| | | projectName: scanAddForm.projectName, |
| | | contractAmount: scanAddForm.contractAmount, |
| | | paymentMethod: scanAddForm.paymentMethod, |
| | | recorderName: scanAddForm.recorderName, |
| | |
| | | const openScanDialog = (row) => { |
| | | scanForm.purchaseContractNumber = row.purchaseContractNumber; |
| | | scanForm.supplierName = row.supplierName; |
| | | scanForm.projectName = row.projectName; |
| | | scanForm.scanTime = getCurrentDateTime(); |
| | | scanForm.scannerName = userStore.nickName; |
| | | scanForm.scanStatus = "未扫码"; |
| | |
| | | return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
| | | } |
| | | |
| | | // 添加行类名方法 |
| | | const tableRowClassName = ({ row }) => { |
| | | return row.isInvalid ? 'invalid-row' : ''; |
| | | }; |
| | | |
| | | // 获取模板信息 |
| | | const getTemplateList =async ()=>{ |
| | | let res = await getPurchaseTemplateList() |
| | | if(res && res.code===200 && Array.isArray(res.data)){ |
| | | templateList.value = res.data |
| | | } |
| | | } |
| | | |
| | | onMounted(() => { |
| | | getList(); |
| | | getTemplateList(); |
| | | |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"></style> |
| | | <style scoped lang="scss"> |
| | | .invalid-row { |
| | | opacity: 0.6; |
| | | background-color: #f5f7fa; |
| | | } |
| | | .el-row{ |
| | | justify-content: space-between; |
| | | align-items: center |
| | | } |
| | | .no-arrow-select { |
| | | --el-select-suffix-icon-color: transparent; /* 隐藏默认下拉箭头 */ |
| | | } |
| | | .select-button-group { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | </style> |