张诺
8 天以前 19520d076777a22f76477c4b29e1a6e7a3891196
src/views/procureMent/index.vue
@@ -23,7 +23,7 @@
      <el-row :gutter="24" class="table-toolbar">
        <el-button type="primary" :icon="Plus" @click="handleAdd">新建</el-button>
        <el-button type="danger" :icon="Delete" @click="handleDelete">删除</el-button>
        <el-button type="info" :icon="Download" @click="handleExport">导出</el-button>
        <!-- <el-button type="info" :icon="Download" @click="handleExport">导出</el-button> -->
      </el-row>
      <!-- 表格组件 -->
      <data-table :loading="loading" :table-data="tableData" :columns="columns" @selection-change="handleSelectionChange"
@@ -44,6 +44,20 @@
import ProductionDialog from './components/ProductionDialog.vue';
import { purchaseRegistration } from "@/api/procureMent";
import useUserStore from '@/store/modules/user'
import useDictStore from "@/store/modules/dict";
// 引入字典数据
const useDictStores = useDictStore();
useDictStores.setDict({
  id: 1,
  name: "煤种类型",
  type: "coalType",
  items: [
    { label: "无烟煤", value: "anthracite" },
    { label: "烟煤", value: "bituminous" },
    { label: "褐煤", value: "lignite" }
  ]
})
console.log(useDictStores.dict);
const { proxy } = getCurrentInstance()
const dialogFormVisible = ref(false);
@@ -76,9 +90,11 @@
  getList();
};
const userStore = useUserStore();
// 获取用户信息
const userInfo = ref({});
onMounted(async() => {
  let res = await userStore.getInfo()
  form.value.registrantId = res.user.userName; // 设置登记人ID
  userInfo.value = res.user;
});
// 分页处理
const handlePagination = (val) => {
@@ -141,7 +157,7 @@
    priceIncludingTax: "",
    totalPriceIncludingTax: "",
    taxRate: "",
    registrantId: "",
    registrantId: userInfo.value.userName,
    registrationDate: new Date().toISOString().split('T')[0]
  };
  // 新建时也需要设置 copyForm 用于重置功能