123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314 |
- <template>
- <div class="pageIndexClass">
- <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" :selectConfig="selectConfig"
- highlight-current-row :action-list="[
- {
- text: '发起申请',
- action: () => purchasePayment(),
- },
- ]" @get-list="getList">
- <template #amount="{ item }">
- <div>
- <span>{{ moneyFormat(item.amount, 2) }}</span>
- </div>
- </template>
- </byTable>
- <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="840px">
- <PaymentPDF :rowData="rowData"></PaymentPDF>
- <template #footer>
- <el-button @click="openPrint = false" size="default">取消</el-button>
- <el-button type="primary" v-print="printObj" size="default">打印</el-button>
- <el-button type="primary" @click="clickDownload()" size="default">下载PDF</el-button>
- </template>
- </el-dialog>
- </div>
- </template>
- <script setup>
- import { computed, ref } from "vue";
- import byTable from "@/components/byTable/index";
- import useUserStore from "@/store/modules/user";
- import PaymentPDF from "@/components/PDF/paymentPDF.vue";
- const { proxy } = getCurrentInstance();
- const payStatus = ref([]);
- const fundsPaymentMethod = ref([]);
- const accountList = ref([]);
- const userList = ref([]);
- const status = ref([
- {
- label: "草稿",
- value: 0,
- },
- {
- label: "审批中",
- value: 10,
- },
- {
- label: "驳回",
- value: 20,
- },
- {
- label: "审批通过",
- value: 30,
- },
- {
- label: "终止",
- value: 99,
- },
- ]);
- const sourceList = ref({
- data: [],
- pagination: {
- total: 0,
- pageNum: 1,
- pageSize: 10,
- keyword: "",
- status: "",
- payStatus: "",
- },
- });
- const loading = ref(false);
- const selectConfig = computed(() => {
- return [
- {
- label: "业务公司",
- prop: "companyId",
- data: proxy.useUserStore().allDict["list_company_data"],
- },
- {
- label: "审批状态",
- prop: "status",
- data: status.value,
- },
- {
- label: "付款状态",
- prop: "payStatus",
- data: payStatus.value,
- },
- ];
- });
- const config = computed(() => {
- return [
- {
- attrs: {
- label: "业务公司",
- prop: "companyName",
- width: 110,
- },
- },
- {
- attrs: {
- label: "供应商",
- prop: "supplyName",
- width: 200,
- },
- },
- {
- attrs: {
- label: "申请金额",
- slot: "amount",
- width: 140,
- },
- },
- {
- attrs: {
- label: "付款说明",
- prop: "remark",
- },
- },
- {
- attrs: {
- label: "付款方式",
- prop: "payType",
- width: 160,
- },
- render(type) {
- return proxy.dictValueLabel(type, fundsPaymentMethod.value);
- },
- },
- {
- attrs: {
- label: "付款账户",
- prop: "accountManagementId",
- width: 200,
- },
- render(type) {
- return proxy.dictValueLabel(type, accountList.value);
- },
- },
- {
- attrs: {
- label: "申请人",
- prop: "createUser",
- width: 140,
- },
- render(type) {
- return proxy.dictValueLabel(type, userList.value);
- },
- },
- {
- attrs: {
- label: "申请时间",
- prop: "createTime",
- width: 160,
- },
- },
- {
- attrs: {
- label: "审批状态",
- prop: "status",
- width: 140,
- },
- render(type) {
- return proxy.dictValueLabel(type, status.value);
- },
- },
- {
- attrs: {
- label: "付款状态",
- prop: "payStatus",
- width: 140,
- },
- render(type) {
- return proxy.dictValueLabel(type, payStatus.value);
- },
- },
- {
- attrs: {
- label: "操作",
- width: "120",
- align: "center",
- },
- renderHTML(row) {
- return [
- {
- attrs: {
- label: "打印",
- type: "primary",
- text: true,
- },
- el: "button",
- click() {
- clickPrint(row);
- },
- },
- ];
- },
- },
- ];
- });
- const getDict = () => {
- proxy
- .post("/dictTenantData/page", {
- pageNum: 1,
- pageSize: 999,
- dictCode: "pay_status",
- tenantId: useUserStore().user.tenantId,
- })
- .then((res) => {
- if (res.rows && res.rows.length > 0) {
- payStatus.value = res.rows.map((item) => {
- return {
- label: item.dictValue,
- value: item.dictKey,
- };
- });
- }
- });
- proxy
- .post("/dictTenantData/page", {
- pageNum: 1,
- pageSize: 999,
- dictCode: "funds_payment_method",
- tenantId: useUserStore().user.tenantId,
- })
- .then((res) => {
- if (res.rows && res.rows.length > 0) {
- fundsPaymentMethod.value = res.rows.map((item) => {
- return {
- label: item.dictValue,
- value: item.dictKey,
- };
- });
- }
- });
- proxy
- .post("/accountManagement/page", { pageNum: 1, pageSize: 999 })
- .then((res) => {
- accountList.value = res.rows.map((item) => {
- return {
- label: item.alias,
- value: item.id,
- };
- });
- });
- proxy
- .get("/tenantUser/list", {
- pageNum: 1,
- pageSize: 10000,
- tenantId: useUserStore().user.tenantId,
- })
- .then((res) => {
- if (res.rows && res.rows.length > 0) {
- userList.value = res.rows.map((item) => {
- return {
- deptId: item.deptId,
- label: item.nickName,
- value: item.userId,
- };
- });
- }
- });
- };
- const getList = async (req) => {
- sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
- loading.value = true;
- proxy.post("/pay/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 purchasePayment = () => {
- proxy.$router.replace({
- path: "/platform_manage/process/processApproval",
- query: {
- flowKey: "pay_flow",
- flowName: "采购付款申请",
- random: proxy.random(),
- },
- });
- };
- const openPrint = ref(false);
- const rowData = ref({});
- const clickPrint = (row) => {
- rowData.value = row;
- openPrint.value = true;
- };
- const clickDownload = () => {
- proxy.getPdf("采购付款PDF文件");
- };
- const printObj = ref({
- id: "pdfDom",
- popTitle: "",
- extraCss:
- "https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.compat.css, https://cdn.bootcdn.net/ajax/libs/hover.css/2.3.1/css/hover-min.css",
- extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
- });
- </script>
- <style lang="scss" scoped>
- .tenant {
- padding: 20px;
- }
- ::v-deep(.el-input-number .el-input__inner) {
- text-align: left;
- }
- </style>
|