gaoluyang
7 天以前 cddbeb27d1cc223736a149584a6d73520fe82d5d
src/views/procurementManagement/procurementLedger/index.vue
@@ -151,7 +151,7 @@
        <el-table-column
          fixed="right"
          label="操作"
          min-width="150"
          min-width="200"
          align="center"
        >
          <template #default="scope">
@@ -160,17 +160,26 @@
              type="primary"
              size="small"
              @click="openForm('edit', scope.row)"
                     :disabled="scope.row.recorderName !== userStore.nickName"
              >编辑</el-button
              :disabled="scope.row.recorderName !== userStore.nickName"
            >
              编辑
            </el-button>
            <el-button
              link
              type="primary"
              size="small"
              @click="openAttachmentDialog(scope.row)"
            >
              附件
            </el-button>
            <el-button
              link
              type="success"
              size="small"
              @click="showQRCode(scope.row)"
              >生成二维码</el-button
            >
              生成二维码
            </el-button>
          </template>
        </el-table-column>
      </el-table>
@@ -769,6 +778,7 @@
        </div>
      </template>
    </el-dialog>
    <FileList ref="fileListRef" />
  </div>
</template>
@@ -798,6 +808,7 @@
} from "@/api/procurementManagement/procurementLedger.js";
import useFormData from "@/hooks/useFormData.js";
import QRCode from "qrcode";
import FileList from "@/views/salesManagement/salesLedger/fileList.vue";
const { proxy } = getCurrentInstance();
const tableData = ref([]);
const productData = ref([]);
@@ -815,6 +826,7 @@
});
const total = ref(0);
const fileList = ref([]);
const fileListRef = ref(null);
import useUserStore from "@/store/modules/user";
import { modelList, productTreeList } from "@/api/basicData/product.js";
import dayjs from "dayjs";
@@ -1247,6 +1259,24 @@
      });
  }
};
// 打开附件列表对话框
const openAttachmentDialog = (row) => {
  if (!row?.id) {
    proxy.$modal.msgWarning("无法获取该行数据的ID");
    return;
  }
  getPurchaseById({ id: row.id, type: 2 }).then((res) => {
    const files = res.salesLedgerFiles || [];
    if (!files.length) {
      proxy.$modal.msgWarning("暂无附件");
      return;
    }
    if (fileListRef.value && typeof fileListRef.value.open === "function") {
      fileListRef.value.open(files);
    }
  });
};
// 关闭产品弹框
const closeProductDia = () => {
  proxy.resetForm("productFormRef");