zhang_12370
3 天以前 aaf943ada13005f2b22d01e3d7080b8740d9aa96
src/views/procureMent/index.vue
@@ -20,9 +20,9 @@
        <el-button type="primary" :icon="Plus" @click="handleAdd"
          >新建
        </el-button>
        <el-button type="danger" :icon="Delete" @click="handleDelete"
        <!-- <el-button type="danger" :icon="Delete" @click="handleDelete"
          >删除
        </el-button>
        </el-button> -->
      </el-row>
      <!-- 表格组件 -->
      <data-table
@@ -76,8 +76,12 @@
  delPR
} from "@/api/procureMent";
import { useDelete } from "@/hooks/useDelete";
const userStore = useUserStore();
import useUserStore from "@/store/modules/user";
let userList = ref([]);
userStore.getUserList().then((res) => {
  userList.value = res;
});
// 引入字典数据
const { proxy } = getCurrentInstance();
const dialogFormVisible = ref(false);
@@ -109,7 +113,7 @@
  // 这里添加实际的查询逻辑
  getList();
};
const userStore = useUserStore();
// 获取用户信息
const userInfo = ref({});
onMounted(async () => {
@@ -148,7 +152,13 @@
  { prop: "totalPriceIncludingTax", label: "总价(含税)", minWidth: 100 },
  { prop: "taxRate", label: "税率", minWidth: 100 },
  { prop: "priceExcludingTax", label: "不含税单价", minWidth: 100 },
  { prop: "registrantId", label: "登记人", minWidth: 100 },
  { prop: "registrantId", label: "登记人", minWidth: 100,
    formatter: (row) => {
      // 匹配用户信息
      const user = userList.value.find((user) => user.userId === row.registrantId);
      return user ? user.nickName : "未知用户";
    },
  },
  { prop: "registrationDate", label: "登记日期", minWidth: 100 },
]);
@@ -201,12 +211,13 @@
  form.value = {
    supplierName: "",
    coal: "",
    unit: "吨",
    purchaseQuantity: "",
    priceExcludingTax: "",
    totalPriceExcludingTax: "",
    priceIncludingTax: "",
    totalPriceIncludingTax: "",
    taxRate: "",
    taxRate: "13",
    registrantId: userInfo.value.userId,
    registrationDate: new Date().toISOString().split("T")[0],
  };