spring
4 天以前 3639cc3129fe3433f110a18d53b1cae2c4f4ff8e
src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue
@@ -39,6 +39,59 @@
                  </el-form-item>
               </el-col>
            </el-row>
        <!-- 入库审批:展示入库信息 -->
        <!-- <el-row v-if="isInventoryApproval">
          <el-col :span="24">
            <el-form-item label="是否入库审核通过:">
              <el-tag :type="form.inventoryReview ? 'success' : 'danger'">
                {{ form.inventoryReview ? '是' : '否' }}
              </el-tag>
            </el-form-item>
          </el-col>
        </el-row> -->
        <el-row v-if="isInventoryApproval">
          <el-col :span="12">
            <el-form-item label="入库类型:">
              <el-tag type="info">
                {{ form.storageType || '-' }}
              </el-tag>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="入库数量:">
              <el-tag type="warning">
                {{ currentStockIn.stockInNum ?? '-' }}
              </el-tag>
            </el-form-item>
          </el-col>
        </el-row>
        <!-- 入库审批:展示入库台账明细(字段形式) -->
      <el-row v-if="isInventoryApproval" style="margin-top: 10px">
        <el-col :span="12">
          <el-form-item label="产品名称:">
            <el-tag type="info">
              {{ currentStockIn.productName || '-' }}
            </el-tag>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="规格型号:">
            <el-tag type="info">
              {{ currentStockIn.model || '-' }}
            </el-tag>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row v-if="isInventoryApproval">
        <el-col :span="24">
          <el-form-item label="生产订单号:">
            <el-tag type="info">
              {{ currentStockIn.npsNo || '-' }}
            </el-tag>
          </el-form-item>
        </el-col>
      </el-row>
            <!-- 审批人选择(动态节点) -->
            <el-row :gutter="30">
               <el-col :span="12">
@@ -168,6 +221,8 @@
        </el-skeleton>
      </div>
      <el-form :model="{ activities }" ref="formRef" label-position="top">
        <el-steps :active="getActiveStep()" finish-status="success" process-status="process" align-center direction="vertical">
          <el-step
@@ -196,10 +251,6 @@
              </div>
              <div v-if="!activity.isShen" class="node-reason">
                <span>审批意见:</span>{{ activity.approveNodeReason }}
              </div>
              <div v-if="!activity.isShen" class="node-reason">
                <span>签名:</span>
                        <img :src="activity.urlTem" class="signImg" alt="" v-if="activity.urlTem"/>
              </div>
              <div v-else-if="activity.isShen">
                <el-form-item
@@ -236,6 +287,7 @@
import { WarningFilled, Edit, Check, MoreFilled } from '@element-plus/icons-vue'
import { getQuotationList } from "@/api/salesManagement/salesQuotation.js";
import { getPurchaseByCode } from "@/api/procurementManagement/procurementLedger.js";
import { getStockInRecordById } from "@/api/inventoryManagement/stockInRecord.js";
const emit = defineEmits(['close'])
const { proxy } = getCurrentInstance()
@@ -257,8 +309,11 @@
const currentQuotation = ref({})
const purchaseLoading = ref(false)
const currentPurchase = ref({})
const stockInLoading = ref(false)
const currentStockIn = ref({})
const isQuotationApproval = computed(() => Number(props.approveType) === 6)
const isPurchaseApproval = computed(() => Number(props.approveType) === 5)
const isInventoryApproval = computed(() => Number(props.approveType) === 9)
const data = reactive({
   form: {
@@ -268,6 +323,10 @@
      approveDeptId: "",
      approveReason: "",
      checkResult: "",
    inventoryReview: false,
    storageType: "",
    stockInNum: null,
    recordId: null,
   },
});
const { form } = toRefs(data);
@@ -299,6 +358,7 @@
  dialogFormVisible.value = true;
  currentQuotation.value = {}
  currentPurchase.value = {}
  currentStockIn.value = {}
   userListNoPageByTenantId().then((res) => {
      userList.value = res.data;
   });
@@ -359,6 +419,28 @@
    }
  }
  // 入库审批:根据 recordId 查询入库台账详情
  if (isInventoryApproval.value) {
    const recordId = row?.recordId;
    form.value.recordId = recordId ?? form.value.recordId;
    form.value.inventoryReview = row?.inventoryReview ?? form.value.inventoryReview;
    form.value.storageType = row?.storageType ?? form.value.storageType;
    if (recordId) {
      stockInLoading.value = true;
      getStockInRecordById(recordId)
        .then((res) => {
          currentStockIn.value = res?.data || res || {};
        })
        .catch((err) => {
          console.error("查询入库记录失败:", err);
          proxy.$modal.msgError("查询入库记录失败");
        })
        .finally(() => {
          stockInLoading.value = false;
        });
    }
  }
  approveProcessDetails(row.approveId).then((res) => {
    activities.value = res.data
    // 增加isApproval字段
@@ -396,6 +478,14 @@
    return;
  }
  currentActivity.approveNodeStatus = status;
  // 始终带上当前审批类型(入库审批为 9)
  currentActivity.approveType = Number(props.approveType);
  // 入库审批:把入库相关字段写入当前节点
  if (isInventoryApproval.value) {
    currentActivity.recordId = form.value.recordId;
    currentActivity.storageType = form.value.storageType;
    currentActivity.inventoryReview = status === 1;
  }
  // 判断是否为最后一步
  const isLast = activities.value.findIndex(a => a.isShen) === activities.value.length-1;
  updateApproveNode({ ...currentActivity, isLast }).then(() => {
@@ -411,6 +501,8 @@
  currentQuotation.value = {}
  purchaseLoading.value = false
  currentPurchase.value = {}
  stockInLoading.value = false
  currentStockIn.value = {}
  emit('close')
};
defineExpose({