|
|
@@ -0,0 +1,397 @@
|
|
|
+<template>
|
|
|
+ <div class="demand-application-detail" v-loading="loading">
|
|
|
+ <div class="detail-overview">
|
|
|
+ <div class="overview-identity">
|
|
|
+ <div class="overview-icon">
|
|
|
+ <i class="el-icon-document"></i>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <div class="overview-label">申请单详情</div>
|
|
|
+ <div class="overview-code">{{ form.applyCode || '-' }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="overview-meta">
|
|
|
+ <div class="meta-item meta-item--unit">
|
|
|
+ <span class="meta-label">申请单位</span>
|
|
|
+ <span class="meta-value meta-value--unit">{{
|
|
|
+ form.applyUnitName || '-'
|
|
|
+ }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="meta-item">
|
|
|
+ <span class="meta-label">明细行数</span>
|
|
|
+ <span class="meta-value meta-value--number">{{ detailCount }}</span>
|
|
|
+ </div>
|
|
|
+ <el-tag :type="approvalStatusType(form.approvalStatus)">
|
|
|
+ {{ approvalStatusLabel(form.approvalStatus) }}
|
|
|
+ </el-tag>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <section class="detail-section">
|
|
|
+ <headerTitle title="基础信息"></headerTitle>
|
|
|
+ <el-form :model="form" label-width="140px" class="detail-form">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :lg="8" :md="12" :sm="12" :xs="24">
|
|
|
+ <el-form-item label="申请编号:">
|
|
|
+ {{ form.applyCode || '-' }}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :lg="8" :md="12" :sm="12" :xs="24">
|
|
|
+ <el-form-item label="申请时间:">
|
|
|
+ {{ normalizeDateTime(form.applyTime) || '-' }}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :lg="8" :md="12" :sm="12" :xs="24">
|
|
|
+ <el-form-item label="申请单位编码:">
|
|
|
+ {{ form.applyUnitCode || '-' }}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :lg="8" :md="12" :sm="12" :xs="24">
|
|
|
+ <el-form-item label="申请单位名称:">
|
|
|
+ {{ form.applyUnitName || '-' }}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <!-- <el-col :lg="8" :md="12" :sm="12" :xs="24">
|
|
|
+ <el-form-item label="申请用户编码:">
|
|
|
+ {{ form.applyUserCode || '-' }}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col> -->
|
|
|
+ <el-col :lg="8" :md="12" :sm="12" :xs="24">
|
|
|
+ <el-form-item label="审批状态:">
|
|
|
+ <el-tag :type="approvalStatusType(form.approvalStatus)">
|
|
|
+ {{ approvalStatusLabel(form.approvalStatus) }}
|
|
|
+ </el-tag>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="备注:">
|
|
|
+ {{ form.remark || '-' }}
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </section>
|
|
|
+
|
|
|
+ <section class="detail-section">
|
|
|
+ <headerTitle title="需求明细"></headerTitle>
|
|
|
+ <ele-pro-table
|
|
|
+ ref="detailTable"
|
|
|
+ :needPage="false"
|
|
|
+ :columns="columns"
|
|
|
+ :toolkit="[]"
|
|
|
+ :datasource="detailList"
|
|
|
+ row-key="id"
|
|
|
+ >
|
|
|
+ <template v-slot:quantity="{ row }">
|
|
|
+ {{ formatQuantity(row) }}
|
|
|
+ </template>
|
|
|
+ <template v-slot:requestDate="{ row }">
|
|
|
+ {{ normalizeDateTime(row.requestDate) || '-' }}
|
|
|
+ </template>
|
|
|
+ <template v-slot:type="{ row }">
|
|
|
+ {{ materialTypeLabel(row.type) }}
|
|
|
+ </template>
|
|
|
+ </ele-pro-table>
|
|
|
+ </section>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import { getDetail } from '@/api/bpm/components/demandApplication';
|
|
|
+
|
|
|
+ const APPROVAL_STATUS_OPTIONS = [
|
|
|
+ { label: '未提交', value: 0, type: 'info' },
|
|
|
+ { label: '审核中', value: 1, type: 'warning' },
|
|
|
+ { label: '审核通过', value: 2, type: 'success' },
|
|
|
+ { label: '审核不通过', value: 3, type: 'danger' }
|
|
|
+ ];
|
|
|
+
|
|
|
+ export default {
|
|
|
+ name: 'DemandApplicationDetail',
|
|
|
+ props: {
|
|
|
+ taskDefinitionKey: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
+ taskId: {
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
+ businessId: {
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
+ id: {
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
+ businessCode: {
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
+ processDefinitionId: {
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
+ businessType: {
|
|
|
+ default: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ loading: false,
|
|
|
+ form: {},
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ columnKey: 'index',
|
|
|
+ type: 'index',
|
|
|
+ label: '序号',
|
|
|
+ width: 55,
|
|
|
+ align: 'center',
|
|
|
+ fixed: 'left'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'categoryCode',
|
|
|
+ label: '物品编码',
|
|
|
+ minWidth: 150,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'categoryName',
|
|
|
+ label: '物品名称',
|
|
|
+ minWidth: 160,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'rootCategoryLevelId',
|
|
|
+ label: '根级分类ID',
|
|
|
+ minWidth: 135,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'specifications',
|
|
|
+ label: '规格',
|
|
|
+ minWidth: 130,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'modelType',
|
|
|
+ label: '型号',
|
|
|
+ minWidth: 130,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'quantity',
|
|
|
+ label: '申请数量',
|
|
|
+ width: 135,
|
|
|
+ align: 'center',
|
|
|
+ slot: 'quantity'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'unit',
|
|
|
+ label: '计量单位',
|
|
|
+ width: 110,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'requestDate',
|
|
|
+ label: '要求日期',
|
|
|
+ width: 165,
|
|
|
+ align: 'center',
|
|
|
+ slot: 'requestDate'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'type',
|
|
|
+ label: '物品类型',
|
|
|
+ width: 115,
|
|
|
+ align: 'center',
|
|
|
+ slot: 'type'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ detailList() {
|
|
|
+ return Array.isArray(this.form.detailList) ? this.form.detailList : [];
|
|
|
+ },
|
|
|
+ detailCount() {
|
|
|
+ return this.detailList.length;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getDetailData();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async getDetailData() {
|
|
|
+ if (!this.businessId) return;
|
|
|
+ this.loading = true;
|
|
|
+ try {
|
|
|
+ this.form = (await getDetail(this.businessId)) || {};
|
|
|
+ } catch (error) {
|
|
|
+ this.$message.error(error.message || '需求申请单详情加载失败');
|
|
|
+ } finally {
|
|
|
+ this.loading = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ approvalStatusLabel(status) {
|
|
|
+ const option = APPROVAL_STATUS_OPTIONS.find(
|
|
|
+ (item) => item.value === Number(status)
|
|
|
+ );
|
|
|
+ return option ? option.label : '未知状态';
|
|
|
+ },
|
|
|
+ approvalStatusType(status) {
|
|
|
+ const option = APPROVAL_STATUS_OPTIONS.find(
|
|
|
+ (item) => item.value === Number(status)
|
|
|
+ );
|
|
|
+ return option ? option.type : 'info';
|
|
|
+ },
|
|
|
+ normalizeDateTime(value) {
|
|
|
+ if (!value) return '';
|
|
|
+ return String(value)
|
|
|
+ .replace('T', ' ')
|
|
|
+ .replace(/\.\d{1,3}.*$/, '');
|
|
|
+ },
|
|
|
+ materialTypeLabel(type) {
|
|
|
+ return Number(type) === 1 ? '工装' : '默认';
|
|
|
+ },
|
|
|
+ formatQuantity(row) {
|
|
|
+ const quantity =
|
|
|
+ row.quantity || row.quantity === 0 ? row.quantity : '-';
|
|
|
+ return row.unit && quantity !== '-'
|
|
|
+ ? `${quantity} ${row.unit}`
|
|
|
+ : quantity;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+ .demand-application-detail {
|
|
|
+ min-height: 240px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .detail-overview {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ min-height: 68px;
|
|
|
+ margin-bottom: 12px;
|
|
|
+ padding: 11px 16px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ border: 1px solid #d9e8f5;
|
|
|
+ border-radius: 6px;
|
|
|
+ background: #f8fbff;
|
|
|
+ }
|
|
|
+
|
|
|
+ .overview-identity {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ min-width: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .overview-icon {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ flex: 0 0 40px;
|
|
|
+ width: 40px;
|
|
|
+ height: 40px;
|
|
|
+ margin-right: 11px;
|
|
|
+ border-radius: 6px;
|
|
|
+ background: #1684df;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 19px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .overview-label {
|
|
|
+ color: #708196;
|
|
|
+ font-size: 12px;
|
|
|
+ line-height: 18px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .overview-code {
|
|
|
+ overflow: hidden;
|
|
|
+ max-width: 360px;
|
|
|
+ color: #1d3449;
|
|
|
+ font-size: 17px;
|
|
|
+ font-weight: 700;
|
|
|
+ line-height: 24px;
|
|
|
+ white-space: nowrap;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ }
|
|
|
+
|
|
|
+ .overview-meta {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ gap: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .meta-item {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: flex-end;
|
|
|
+ min-width: 70px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .meta-item--unit {
|
|
|
+ min-width: 220px;
|
|
|
+ max-width: 420px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .meta-label {
|
|
|
+ color: #98a2b3;
|
|
|
+ font-size: 11px;
|
|
|
+ line-height: 18px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .meta-value {
|
|
|
+ overflow: hidden;
|
|
|
+ max-width: 180px;
|
|
|
+ color: #344054;
|
|
|
+ font-size: 13px;
|
|
|
+ font-weight: 600;
|
|
|
+ line-height: 20px;
|
|
|
+ white-space: nowrap;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ }
|
|
|
+
|
|
|
+ .meta-value--number {
|
|
|
+ color: #1478c9;
|
|
|
+ font-size: 17px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .meta-value--unit {
|
|
|
+ max-width: 420px;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+
|
|
|
+ .detail-section {
|
|
|
+ margin-bottom: 12px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .detail-form {
|
|
|
+ padding-top: 6px;
|
|
|
+ }
|
|
|
+
|
|
|
+ ::v-deep .detail-form .el-form-item {
|
|
|
+ margin-bottom: 8px;
|
|
|
+ }
|
|
|
+
|
|
|
+ ::v-deep .detail-form .el-form-item__label {
|
|
|
+ color: #53677a;
|
|
|
+ font-weight: 600;
|
|
|
+ }
|
|
|
+
|
|
|
+ @media (max-width: 1000px) {
|
|
|
+ .detail-overview {
|
|
|
+ align-items: flex-start;
|
|
|
+ flex-direction: column;
|
|
|
+ }
|
|
|
+
|
|
|
+ .overview-meta {
|
|
|
+ width: 100%;
|
|
|
+ margin-top: 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|