gaoluyang
2 天以前 c25a27347be2c46177b615426297836b30915608
src/views/procureMent/components/ProductionDialog.vue
@@ -133,7 +133,7 @@
import { ref, defineProps, watch, onMounted, nextTick, computed } from "vue";
import { ElMessage } from "element-plus";
import useUserStore from "@/store/modules/user";
import { addOrEditPR } from "@/api/procureMent";
import { addOrEditPR,getSupplyList, getCoalInfoList } from "@/api/procureMent";
import { getSupply } from "@/api/basicInformation/supplier";
import { getCoalInfo } from "@/api/basicInformation/coal";
const props = defineProps({
@@ -161,11 +161,12 @@
const getDropdownData = async () => {
  try {
    const [supplyRes, coalRes] = await Promise.all([
      getSupply(),
      getCoalInfo(),
      getSupplyList(),
      getCoalInfoList(),
    ]);
    let supplyData = supplyRes.data.records;
    let coalData = coalRes.data.records;
    console.log(supplyRes, coalRes);
    let supplyData = supplyRes.data;
    let coalData = coalRes.data;
    supplyList.value = supplyData.map((item) => ({
      value: item.id,
      label: item.supplierName,
@@ -174,9 +175,8 @@
      value: item.id,
      label: item.coal,
    }));
    console.log(supplyList.value, coalList.value);
  } catch (error) {
    console.error("获取下拉数据失败:", error);
    ElMessage.error("获取下拉数据失败,请稍后重试");
  }
};
@@ -289,6 +289,7 @@
onMounted(async () => {
  let res = await userStore.getInfo();
  userInfo.value = res;
  getDropdownData()
});
const rules = {
  supplierName: [
@@ -334,7 +335,6 @@
const formRef = ref(null);
// 提交表单
const handleSubmit = async () => {
  console.log("提交表单", form.value);
  if (!formRef.value) return;
  await formRef.value.validate(async (valid) => {
    if (valid) {