gaoluyang
2025-12-09 012aa7fd84c4de6216f5be6e8a05ed52f7fdf429
src/views/equipmentManagement/measurementEquipment/index.vue
@@ -44,6 +44,7 @@
      </div>
      <form-dia ref="formDia" @close="handleQuery"></form-dia>
      <calibration-dia ref="calibrationDia" @close="handleQuery"></calibration-dia>
    <files-dia ref="filesDia"></files-dia>
   </div>
</template>
@@ -57,6 +58,7 @@
   measuringInstrumentDelete,
   measuringInstrumentListPage
} from "@/api/equipmentManagement/measurementEquipment.js";
import FilesDia from "./filesDia.vue";
const { proxy } = getCurrentInstance();
const userStore = useUserStore()
@@ -136,6 +138,7 @@
      dataType: "action",
      label: "操作",
      align: "center",
      width: '130',
      fixed: 'right',
      operation: [
         {
@@ -145,24 +148,33 @@
               openCalibrationDia("verifying", row);
            },
         },
         {
            name: "附件",
            type: "text",
            clickFun: (row) => {
               openCalibrationDia("add", row);
            },
         },
         // {
         //    name: "附件",
         //    type: "text",
         //    clickFun: (row) => {
      //     openFilesFormDia(row);
         //    },
         // },
      ],
   },
]);
const tableData = ref([]);
const tableLoading = ref(false);
const filesDia = ref()
const page = reactive({
   current: 1,
   size: 100,
   total: 0,
});
const selectedRows = ref([]);
// 打开附件弹框
const openFilesFormDia = (row) => {
  console.log(row)
  nextTick(() => {
    filesDia.value?.openDialog( row,'计量器具台账')
  })
};
// 表格选择数据
const handleSelectionChange = (selection) => {
@@ -209,12 +221,6 @@
const handleDelete = () => {
   let ids = [];
   if (selectedRows.value.length > 0) {
      // 检查是否有他人维护的数据
      const unauthorizedData = selectedRows.value.filter(item => item.userId !== userStore.id);
      if (unauthorizedData.length > 0) {
         proxy.$modal.msgWarning("不可删除他人维护的数据");
         return;
      }
      ids = selectedRows.value.map((item) => item.id);
   } else {
      proxy.$modal.msgWarning("请选择数据");