123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- <template>
- <div class="pageIndexClass">
- <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" :selectConfig="selectConfig"
- highlight-current-row @get-list="getList">
- <template #amount="{ item }">
- <div>
- <span style="padding-right: 4px">{{ item.currency }}</span>
- <span>{{ moneyFormat(item.amount, 2) }}</span>
- </div>
- </template>
- <template #contractCodes="{ item }">
- <div>
- <a style="color: #409eff; cursor: pointer; word-break: break-all" @click="clickPrint(item)">{{ item.contractCodes }}</a>
- </div>
- </template>
- </byTable>
- <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="840px">
- <FundsPDF v-if="rowData.type != '20'" :rowData="rowData"></FundsPDF>
- <PaymentPDF v-else :rowData="rowData"></PaymentPDF>
- <template #footer>
- <el-button @click="openPrint = false" size="default">取消</el-button>
- <el-button type="primary" @click="clickDownload()" size="default">下载PDF</el-button>
- </template>
- </el-dialog>
- </div>
- </template>
- <script setup>
- import byTable from "@/components/byTable/index";
- import FundsPDF from "@/components/PDF/fundsPDF.vue";
- import PaymentPDF from "@/components/PDF/paymentPDF.vue";
- const { proxy } = getCurrentInstance();
- const corporationList = ref([]);
- const fundsType = ref([]);
- const sourceList = ref({
- data: [],
- pagination: {
- total: 0,
- pageNum: 1,
- pageSize: 10,
- keyword: "",
- corporationId: "",
- type: "",
- },
- });
- const loading = ref(false);
- const selectConfig = computed(() => {
- return [
- {
- label: "归属公司",
- prop: "corporationId",
- data: corporationList.value,
- },
- {
- label: "数据来源",
- prop: "type",
- data: fundsType.value,
- },
- ];
- });
- const config = computed(() => {
- return [
- {
- attrs: {
- label: "归属公司",
- prop: "corporationName",
- "min-width": 220,
- },
- },
- {
- attrs: {
- label: "数据来源",
- prop: "type",
- "min-width": 130,
- },
- render(type) {
- if (type != 20) {
- return "请款: " + proxy.dictValueLabel(type, fundsType.value);
- } else {
- return "采购付款";
- }
- },
- },
- {
- attrs: {
- label: "关联单号",
- slot: "contractCodes",
- "min-width": 160,
- },
- },
- {
- attrs: {
- label: "申请时间",
- prop: "applicationTime",
- "min-width": 160,
- },
- },
- {
- attrs: {
- label: "申请金额",
- slot: "amount",
- align: "right",
- "min-width": 120,
- },
- },
- {
- attrs: {
- label: "打款时间",
- prop: "accountPaymentDate",
- "min-width": 160,
- },
- },
- {
- attrs: {
- label: "冲销人",
- prop: "writeOffUserName",
- "min-width": 160,
- },
- },
- {
- attrs: {
- label: "冲销时间",
- prop: "createTime",
- "min-width": 160,
- },
- },
- ];
- });
- const getDict = () => {
- proxy.getDictOne(["founds_type"]).then((res) => {
- fundsType.value = res["founds_type"]
- .map((x) => ({
- label: x.dictValue,
- value: x.dictKey,
- }))
- .concat({
- label: "采购付款",
- value: "20",
- });
- });
- proxy.post("/corporation/page", { pageNum: 1, pageSize: 999 }).then((res) => {
- if (res.rows && res.rows.length > 0) {
- corporationList.value = res.rows.map((item) => {
- return {
- label: item.name,
- value: item.id,
- };
- });
- }
- });
- };
- const getList = async (req) => {
- sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
- loading.value = true;
- proxy
- .post("/writeOffRecords/page", sourceList.value.pagination)
- .then((res) => {
- sourceList.value.data = res.rows;
- sourceList.value.pagination.total = res.total;
- setTimeout(() => {
- loading.value = false;
- }, 200);
- });
- };
- getDict();
- getList();
- const openPrint = ref(false);
- const rowData = ref({});
- const clickPrint = (row) => {
- rowData.value = {
- id: row.businessId,
- type: row.type,
- };
- openPrint.value = true;
- };
- const clickDownload = () => {
- if (rowData.value.type != "20") {
- proxy.getPdf("请款PDF文件");
- } else {
- proxy.getPdf("采购付款PDF文件");
- }
- };
- </script>
- <style lang="scss" scoped>
- .tenant {
- padding: 20px;
- }
- </style>
|