maven
2025-12-03 067a7119d3175c9ea9b7c0d46b59df6e8ccb994c
src/views/procurementManagement/procurementLedger/index.vue
@@ -53,7 +53,7 @@
        show-summary
        :summary-method="summarizeMainTable"
        @expand-change="expandChange"
        height="calc(100vh - 18.5em)"
        height="calc(100vh - 19em)"
      >
        <el-table-column align="center" type="selection" width="55" />
        <el-table-column type="expand">
@@ -155,7 +155,6 @@
              type="primary"
              size="small"
              @click="openForm('edit', scope.row)"
                     :disabled="scope.row.receiptPaymentAmount>0 || scope.row.recorderName !== userStore.nickName"
              >编辑</el-button
            >
            <el-button
@@ -277,7 +276,9 @@
                v-model="form.recorderId"
                placeholder="请选择"
                clearable
                disabled
                filterable
                default-first-option
                :reserve-keyword="false"
              >
                <el-option
                  v-for="item in userList"
@@ -879,7 +880,13 @@
  },
});
const {  form, rules } = toRefs(data);
const { form: searchForm } = useFormData(data.searchForm);
const { form: searchForm } = useFormData({
  ...data.searchForm,
  // 设置录入日期范围为当天
  entryDate: [dayjs().startOf('day').format('YYYY-MM-DD'), dayjs().endOf('day').format('YYYY-MM-DD')],
  entryDateStart: dayjs().startOf('day').format('YYYY-MM-DD'),
  entryDateEnd: dayjs().endOf('day').format('YYYY-MM-DD')
});
// 产品表单弹框数据
const productFormVisible = ref(false);
@@ -1152,10 +1159,15 @@
  });
};
const getModels = (value) => {
  productForm.value.productCategory = findNodeById(productOptions.value, value);
  modelList({ id: value }).then((res) => {
    modelOptions.value = res;
  });
  if (value) {
    productForm.value.productCategory = findNodeById(productOptions.value, value) || "";
    modelList({ id: value }).then((res) => {
      modelOptions.value = res;
    });
  } else {
    productForm.value.productCategory = "";
    modelOptions.value = [];
  }
};
const getProductModel = (value) => {
  const index = modelOptions.value.findIndex((item) => item.id === value);
@@ -1170,12 +1182,12 @@
const findNodeById = (nodes, productId) => {
  for (let i = 0; i < nodes.length; i++) {
    if (nodes[i].value === productId) {
      return nodes[i].label; // 找到节点,返回该节点
      return nodes[i].label; // 找到节点,返回该节点的label
    }
    if (nodes[i].children && nodes[i].children.length > 0) {
      const foundNode = findNodeById(nodes[i].children, productId);
      if (foundNode) {
        return foundNode.label; // 在子节点中找到,返回该节点
        return foundNode; // 在子节点中找到,直接返回(已经是label字符串)
      }
    }
  }