| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row v-if="!isPurchaseApproval"> |
| | | <el-row v-if="!isPurchaseApproval && !isSalesApproval"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="审批事由:" prop="approveReason"> |
| | | <el-input v-model="form.approveReason" placeholder="请输入" clearable type="textarea" disabled/> |
| | |
| | | <div style="margin-top: 20px;"> |
| | | <h4>产品明细</h4> |
| | | <el-table :data="purchaseProducts" border style="width: 100%"> |
| | | <el-table-column prop="productCategory" label="产品名称" /> |
| | | <el-table-column prop="specificationModel" label="规格型号" /> |
| | | <el-table-column prop="unit" label="单位" /> |
| | | <el-table-column prop="quantity" label="数量" /> |
| | | <el-table-column prop="taxInclusiveUnitPrice" label="含税单价"> |
| | | <template #default="scope">¥{{ Number(scope.row.taxInclusiveUnitPrice ?? 0).toFixed(2) }}</template> |
| | | </el-table-column> |
| | | <el-table-column prop="taxInclusiveTotalPrice" label="含税总价"> |
| | | <template #default="scope">¥{{ Number(scope.row.taxInclusiveTotalPrice ?? 0).toFixed(2) }}</template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </template> |
| | | </template> |
| | | </el-skeleton> |
| | | </div> |
| | | <div v-if="isSalesApproval" style="margin: 10px 0 18px;"> |
| | | <el-divider content-position="left">销售详情</el-divider> |
| | | <el-skeleton :loading="salesLoading" animated> |
| | | <template #template> |
| | | <el-skeleton-item variant="h3" style="width: 30%" /> |
| | | <el-skeleton-item variant="text" style="width: 100%" /> |
| | | <el-skeleton-item variant="text" style="width: 100%" /> |
| | | </template> |
| | | <template #default> |
| | | <el-empty v-if="!salesDetail || !salesDetail.salesContractNo" description="未查询到对应销售详情" /> |
| | | <template v-else> |
| | | <el-descriptions :column="2" border> |
| | | <el-descriptions-item label="销售合同号">{{ salesDetail.salesContractNo }}</el-descriptions-item> |
| | | <el-descriptions-item label="客户合同号">{{ salesDetail.customerContractNo }}</el-descriptions-item> |
| | | <el-descriptions-item label="客户名称">{{ salesDetail.customerName }}</el-descriptions-item> |
| | | <el-descriptions-item label="业务员">{{ salesDetail.salesman }}</el-descriptions-item> |
| | | <el-descriptions-item label="项目名称">{{ salesDetail.projectName }}</el-descriptions-item> |
| | | <el-descriptions-item label="付款方式">{{ salesDetail.paymentMethod }}</el-descriptions-item> |
| | | <el-descriptions-item label="录入人">{{ salesEntryPersonDisplay }}</el-descriptions-item> |
| | | <el-descriptions-item label="录入日期">{{ salesDetail.entryDate }}</el-descriptions-item> |
| | | <el-descriptions-item label="签订日期">{{ salesDetail.executionDate }}</el-descriptions-item> |
| | | <el-descriptions-item label="合同金额" :span="2"> |
| | | <span style="font-size: 18px; color: #e6a23c; font-weight: bold;"> |
| | | ¥{{ Number(salesDetail.contractAmount ?? 0).toFixed(2) }} |
| | | </span> |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | |
| | | <div style="margin-top: 20px;"> |
| | | <h4>产品明细</h4> |
| | | <el-table :data="salesProducts" border style="width: 100%"> |
| | | <el-table-column prop="productCategory" label="产品名称" /> |
| | | <el-table-column prop="specificationModel" label="规格型号" /> |
| | | <el-table-column prop="unit" label="单位" /> |
| | |
| | | updateApproveNode |
| | | } from "@/api/collaborativeApproval/approvalProcess.js"; |
| | | import { getPurchaseByCode } from "@/api/procurementManagement/procurementLedger.js"; |
| | | import { getSalesByCode } from "@/api/salesManagement/salesLedger.js"; |
| | | import useUserStore from "@/store/modules/user.js"; |
| | | import {userListNoPageByTenantId} from "@/api/system/user.js"; |
| | | import { WarningFilled, Edit, Check, MoreFilled } from '@element-plus/icons-vue' |
| | |
| | | const purchaseLoading = ref(false) |
| | | const currentPurchase = ref({}) |
| | | const isPurchaseApproval = computed(() => Number(props.approveType) === 5) |
| | | const salesLoading = ref(false) |
| | | const currentSales = ref({}) |
| | | const isSalesApproval = computed(() => Number(props.approveType) === 6) |
| | | const purchaseDetail = computed(() => currentPurchase.value?.data || currentPurchase.value || {}) |
| | | const purchaseProducts = computed(() => { |
| | | const detail = purchaseDetail.value || {} |
| | | return detail.productData || detail.products || detail.children || [] |
| | | }) |
| | | const salesDetail = computed(() => currentSales.value?.data || currentSales.value || {}) |
| | | const salesProducts = computed(() => { |
| | | const detail = salesDetail.value || {} |
| | | return detail.productData || detail.products || detail.children || [] |
| | | }) |
| | | /** 销售详情:录入人(接口可能只返 entryPerson 用户ID,需用 userList 反查昵称) */ |
| | | const salesEntryPersonDisplay = computed(() => { |
| | | const d = salesDetail.value || {} |
| | | if (d.entryPersonName) return d.entryPersonName |
| | | if (d.recorderName) return d.recorderName |
| | | if (d.createByName) return d.createByName |
| | | if (d.createUserName) return d.createUserName |
| | | const id = d.entryPerson |
| | | if (id != null && id !== "" && userList.value?.length) { |
| | | const u = userList.value.find( |
| | | (x) => x.userId == id || String(x.userId) === String(id) |
| | | ) |
| | | if (u) return u.nickName |
| | | } |
| | | return id != null && id !== "" ? String(id) : "-" |
| | | }) |
| | | const data = reactive({ |
| | | form: { |
| | |
| | | operationType.value = type; |
| | | dialogFormVisible.value = true; |
| | | currentPurchase.value = {} |
| | | currentSales.value = {} |
| | | userListNoPageByTenantId().then((res) => { |
| | | userList.value = res.data; |
| | | }); |
| | |
| | | proxy.$modal.msgError("查询采购详情失败") |
| | | }).finally(() => { |
| | | purchaseLoading.value = false |
| | | }) |
| | | } |
| | | } |
| | | if (isSalesApproval.value) { |
| | | const salesContractNo = row?.approveReason |
| | | if (salesContractNo) { |
| | | salesLoading.value = true |
| | | getSalesByCode({ salesContractNo }).then((res) => { |
| | | currentSales.value = res || {} |
| | | }).catch(() => { |
| | | proxy.$modal.msgError("查询销售详情失败") |
| | | }).finally(() => { |
| | | salesLoading.value = false |
| | | }) |
| | | } |
| | | } |
| | |
| | | dialogFormVisible.value = false; |
| | | purchaseLoading.value = false |
| | | currentPurchase.value = {} |
| | | salesLoading.value = false |
| | | currentSales.value = {} |
| | | emit('close') |
| | | }; |
| | | defineExpose({ |