1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033 |
- <template>
- <div class="user">
- <div class="content">
- <byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
- :selectConfig="selectConfig" :table-events="{
- select: select,
- }" :action-list="[]" @moreSearch="moreSearch" @get-list="getList">
- <template #amount="{ item }">
- <div style="width: 100%">
- <span>{{ item.currency }} {{ item.incomeAmount }}</span>
- </div>
- </template>
- <template #file="{ item }">
- <div style="width: 100%">
- <el-button type="primary" text @click="handleOpenFile(item)">查看</el-button>
- </div>
- </template>
- </byTable>
- </div>
- <el-dialog title="打款" v-if="dialogVisible" v-model="dialogVisible" width="500" v-loading="loading">
- <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="byform">
- <template #fileSlot>
- <div style="width: 100%">
- <el-upload v-model:fileList="fileList" :action="uploadUrl" :data="uploadData" multiple :before-upload="uploadFile"
- :on-preview="onPreviewFile">
- <el-button type="primary">文件上传</el-button>
- </el-upload>
- </div>
- </template>
- </byForm>
- <template #footer>
- <el-button @click="dialogVisible = false" size="large">取 消</el-button>
- <el-button type="primary" @click="submitForm()" size="large" :loading="submitLoading" v-show="submitType === 'add'">
- 确 定
- </el-button>
- </template>
- </el-dialog>
- <el-dialog title="高级检索" v-if="openSearch" v-model="openSearch" width="600" :before-close="cancelSearch">
- <byForm :formConfig="formSearchConfig" :formOption="formOptionTwo" v-model="sourceList.pagination">
- <template #departmentId>
- <div>
- <el-tree-select v-model="sourceList.pagination.departmentId" :data="deptTreeData" check-strictly :render-after-expand="false"
- node-key="deptId" style="width: 100%" :props="defaultProps" clearable />
- </div>
- </template>
- <template #time>
- <div style="width: 100%">
- <el-row :gutter="10">
- <el-col :span="11">
- <el-date-picker v-model="sourceList.pagination.beginCreateTime" type="datetime" placeholder="请选择" style="width: 100%"
- value-format="YYYY-MM-DD HH:mm:ss" />
- </el-col>
- <el-col :span="2" style="text-align: center">到</el-col>
- <el-col :span="11">
- <el-date-picker v-model="sourceList.pagination.endCreateTime" type="datetime" placeholder="请选择" style="width: 100%"
- value-format="YYYY-MM-DD HH:mm:ss" />
- </el-col>
- </el-row>
- </div>
- </template>
- <template #timeTwo>
- <div style="width: 100%">
- <el-row :gutter="10">
- <el-col :span="11">
- <el-date-picker v-model="sourceList.pagination.beginTime" type="datetime" placeholder="请选择" style="width: 100%"
- value-format="YYYY-MM-DD HH:mm:ss" />
- </el-col>
- <el-col :span="2" style="text-align: center">到</el-col>
- <el-col :span="11">
- <el-date-picker v-model="sourceList.pagination.endTime" type="datetime" placeholder="请选择" style="width: 100%"
- value-format="YYYY-MM-DD HH:mm:ss" />
- </el-col>
- </el-row>
- </div>
- </template>
- <template #money>
- <div style="width: 100%">
- <el-row :gutter="10">
- <el-col :span="11">
- <el-input-number onmousewheel="return false;" v-model="sourceList.pagination.startAmount" placeholder="请输入" style="width: 100%"
- :precision="2" :controls="false" :min="0" />
- </el-col>
- <el-col :span="2" style="text-align: center">到</el-col>
- <el-col :span="11">
- <el-input-number onmousewheel="return false;" v-model="sourceList.pagination.endAmount" placeholder="请输入" style="width: 100%"
- :precision="2" :controls="false" :min="0" />
- </el-col>
- </el-row>
- </div>
- </template>
- </byForm>
- <template #footer>
- <el-button @click="cancelSearch()" size="large">取 消</el-button>
- <el-button type="primary" @click="submitSearch()" size="large">确 定</el-button>
- </template>
- </el-dialog>
- <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="large">取消</el-button>
- <el-button type="primary" v-print="printObj" size="large">打印</el-button>
- <el-button type="primary" @click="clickDownload()" size="large">下载PDF</el-button>
- </template>
- </el-dialog>
- <el-dialog title="冲销" v-if="openCancelledOut" v-model="openCancelledOut" width="500">
- <byForm :formConfig="formCancelledOutConfig" :formOption="formOptionTwo" v-model="formCancelledOutData.data" :rules="rulesCancelledOut"
- ref="cancelledOut">
- <template #detail>
- <div style="width: 100%">
- <el-button type="primary" style="margin-left: -15px" @click="clickDetail" text>查看详情</el-button>
- </div>
- </template>
- </byForm>
- <template #footer>
- <el-button @click="openCancelledOut = false" size="large">取 消</el-button>
- <el-button type="danger" @click="submitCancelledOutForm()" size="large" :loading="submitCancelledOutLoading">冲 销</el-button>
- </template>
- </el-dialog>
- <el-dialog title="关联附件" v-if="openFileDialog" v-model="openFileDialog" width="500">
- <byForm :formConfig="fileConfig" :formOption="formOption" v-model="fileData.data">
- <template #businessFile>
- <div style="width: 100%" v-if="fileData.data && fileData.data.fileList.length > 0">
- <div v-for="(item, index) in fileData.data.fileList" :key="index">
- <div style="cursor: pointer; color: #409eff" @click="openFile(item)">
- {{ item.fileName }}
- </div>
- </div>
- </div>
- <div v-else>暂无关联</div>
- </template>
- <template #fundsFile>
- <div style="width: 100%" v-if="fileData.data && fileData.data.fileListOne.length > 0">
- <div v-for="(item, index) in fileData.data.fileListOne" :key="index">
- <div style="cursor: pointer; color: #409eff" @click="openFile(item)">
- {{ item.fileName }}
- </div>
- </div>
- </div>
- <div v-else>暂无关联</div>
- </template>
- </byForm>
- <template #footer>
- <el-button @click="openFileDialog = false" size="large">取 消</el-button>
- </template>
- </el-dialog>
- </div>
- </template>
- <script setup>
- import { ElMessage, ElMessageBox } from "element-plus";
- import byTable from "@/components/byTable/index";
- import byForm from "@/components/byForm/index";
- import { computed, reactive, ref } from "vue";
- import moment from "moment";
- import useUserStore from "@/store/modules/user";
- import FundsPDF from "@/components/PDF/fundsPDF.vue";
- import PaymentPDF from "@/components/PDF/paymentPDF.vue";
- const loading = ref(false);
- const submitLoading = ref(false);
- const sourceList = ref({
- data: [],
- pagination: {
- total: 0,
- pageNum: 1,
- pageSize: 10,
- keyword: "",
- corporationId: "",
- departmentId: "",
- createUser: "",
- beginCreateTime: "",
- endCreateTime: "",
- beginTime: "",
- endTime: "",
- currency: "",
- startAmount: undefined,
- endAmount: undefined,
- paymentStatus: "",
- paymentRemark: "",
- type: "",
- },
- });
- let dialogVisible = ref(false);
- let rules = ref({
- amount: [{ required: true, message: "请输入付款金额", trigger: "blur" }],
- });
- const submitType = ref("add");
- const accountCurrency = ref([]);
- const accountList = ref([]);
- const companyData = ref([]);
- const deptTreeData = ref([]);
- const userList = ref([]);
- const fundsType = ref([]);
- const fundsPaymentMethod = ref([]);
- const { proxy } = getCurrentInstance();
- const selectConfig = computed(() => {
- return [
- {
- label: "打款状态",
- prop: "paymentStatus",
- data: paymentType.value,
- },
- {
- label: "付款类型",
- prop: "type",
- data: paymentTypeOne.value,
- },
- ];
- });
- const config = computed(() => {
- return [
- {
- attrs: {
- label: "归属公司",
- prop: "corporationName",
- width: 160,
- },
- },
- {
- attrs: {
- label: "归属部门",
- prop: "deptName",
- width: 160,
- },
- },
- {
- attrs: {
- label: "付款类型",
- prop: "type",
- width: 130,
- },
- render(type) {
- if (type == "40") {
- return "售后";
- } else if (type != "20") {
- return "请款: " + proxy.dictValueLabel(type, fundsType.value);
- } else {
- return "采购付款 - 申请";
- }
- },
- },
- {
- attrs: {
- label: "申请人",
- prop: "userName",
- width: 140,
- },
- },
- {
- attrs: {
- label: "申请时间",
- prop: "createTime",
- width: 160,
- },
- },
- {
- attrs: {
- label: "用款时间",
- prop: "paymentTime",
- width: 160,
- },
- },
- {
- attrs: {
- label: "金额",
- slot: "amount",
- width: 120,
- align: "right",
- },
- },
- {
- attrs: {
- label: "款项说明",
- prop: "paymentRemark",
- "min-width": 200,
- },
- },
- {
- attrs: {
- label: "关联附件",
- slot: "file",
- width: 80,
- align: "left",
- },
- },
- {
- attrs: {
- label: "打款状态",
- prop: "status",
- width: 120,
- },
- render(status) {
- return proxy.dictValueLabel(status, paymentType.value);
- },
- },
- {
- attrs: {
- label: "操作",
- width: "180",
- align: "center",
- fixed: "right",
- },
- renderHTML(row) {
- return [
- row.status != "10"
- ? {
- attrs: {
- label: "打款",
- type: "primary",
- text: true,
- },
- el: "button",
- click() {
- formOption.disabled = false;
- submitType.value = "add";
- getDtl(row);
- },
- }
- : {
- attrs: {
- label: "冲销",
- type: "danger",
- text: true,
- },
- el: "button",
- click(item) {
- ElMessageBox.confirm(
- "冲销后,已生成的资金流水数据会被删除,且关联的数据状态会由“已打款”退回至“未打款”,并支持重新打款。是否继续?",
- "提示",
- {
- confirmButtonText: "继续",
- cancelButtonText: "取消",
- type: "warning",
- }
- )
- .then(() => {
- rowData.value = item;
- formCancelledOutData.data = {
- accountPaymentId: item.id,
- remark: "",
- };
- openCancelledOut.value = true;
- })
- .catch(() => {});
- },
- },
- {
- attrs: {
- label: "打印",
- type: "primary",
- text: true,
- },
- el: "button",
- click() {
- clickPrint(row);
- },
- },
- {
- attrs: {
- label: "查看",
- type: "primary",
- text: true,
- },
- el: "button",
- click() {
- formOption.disabled = true;
- submitType.value = "edit";
- getDtl(row);
- },
- },
- ];
- },
- },
- ];
- });
- let formData = reactive({
- data: {
- fileList: [],
- },
- });
- const formOption = reactive({
- inline: true,
- labelWidth: 100,
- itemWidth: 100,
- rules: [],
- disabled: false,
- });
- const formOptionTwo = reactive({
- inline: true,
- labelWidth: 100,
- itemWidth: 100,
- rules: [],
- disabled: false,
- });
- const byform = ref(null);
- const formConfig = computed(() => {
- return [
- {
- type: "title",
- label: "请款信息",
- },
- {
- type: "input",
- prop: "businessManagementName",
- label: "付款账户",
- disabled: true,
- },
- {
- type: "input",
- prop: "incomeAmount",
- label: "请款金额",
- disabled: true,
- },
- {
- type: "select",
- prop: "paymentMethod",
- label: "付款方式",
- disabled: true,
- data: fundsPaymentMethod.value,
- },
- {
- type: "input",
- prop: "name",
- label: "户名",
- disabled: true,
- },
- {
- type: "input",
- prop: "accountOpening",
- label: "银行账号",
- disabled: true,
- },
- {
- type: "input",
- prop: "openingBank",
- label: "开户银行",
- disabled: true,
- },
- {
- type: "input",
- prop: "interbankNumber",
- label: "联行号 / SWIFT Code",
- disabled: true,
- },
- {
- type: "input",
- prop: "paymentRemark",
- label: "摘要",
- disabled: true,
- itemType: "textarea",
- },
- {
- type: "title",
- title: "付款信息",
- },
- {
- type: "select",
- prop: "accountManagementId",
- label: "付款账户",
- required: true,
- data: accountList.value,
- itemWidth: 50.1,
- style: {
- width: "100%",
- },
- },
- {
- type: "select",
- label: "付款金额",
- prop: "currency",
- data: accountCurrency.value,
- itemWidth: 50,
- disabled: true,
- },
- {
- type: "number",
- prop: "amount",
- label: " ",
- itemWidth: 50,
- precision: 2,
- min: 0,
- controls: false,
- style: {
- width: "100%",
- },
- },
- {
- type: "date",
- itemType: "datetime",
- prop: "expensesTime",
- label: "打款时间",
- format: "YYYY-MM-DD HH:mm:ss",
- itemWidth: 50,
- style: {
- width: "100%",
- },
- },
- {
- type: "input",
- prop: "remark",
- label: "摘要",
- itemType: "textarea",
- },
- {
- type: "slot",
- label: "上传附件",
- prop: "fileList",
- slotName: "fileSlot",
- },
- ];
- });
- const fileList = ref([]);
- const uploadData = ref({});
- const uploadFile = async (file) => {
- const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
- uploadData.value = res.uploadBody;
- file.id = res.id;
- file.fileName = res.fileName;
- file.fileUrl = res.fileUrl;
- return true;
- };
- const onPreviewFile = (file) => {
- window.open(file.raw.fileUrl, "_blank");
- };
- const recursive = (data) => {
- data.map((item) => {
- item.label = item.deptName;
- item.id = item.corporationId;
- if (item.children) {
- recursive(item.children);
- } else {
- item.children = [];
- }
- });
- };
- const getDict = () => {
- proxy
- .getDict(["account_currency", "founds_type", "funds_payment_method"])
- .then((res) => {
- accountCurrency.value = res.account_currency.map((item) => {
- return {
- label: item.dictValue,
- value: item.dictKey,
- };
- });
- fundsType.value = res.founds_type.map((item) => {
- return {
- label: item.dictValue,
- value: item.dictKey,
- };
- });
- fundsPaymentMethod.value = res.funds_payment_method.map((item) => {
- return {
- label: item.dictValue,
- value: item.dictKey,
- };
- });
- });
- proxy
- .post("/accountManagement/page", { pageNum: 1, pageSize: 9999 })
- .then((res) => {
- if (res.rows && res.rows.length > 0) {
- accountList.value = res.rows.map((item) => {
- return {
- label: item.alias + " (" + item.name + ")",
- value: item.id,
- };
- });
- }
- });
- proxy
- .post("/corporation/page", { pageNum: 1, pageSize: 9999 })
- .then((res) => {
- if (res.rows && res.rows.length > 0) {
- companyData.value = res.rows.map((item) => {
- return {
- label: item.name,
- value: item.id,
- };
- });
- }
- });
- proxy
- .get("/tenantDept/list", {
- pageNum: 1,
- pageSize: 9999,
- tenantId: useUserStore().user.tenantId,
- })
- .then((message) => {
- recursive(message.data);
- deptTreeData.value = [];
- let data = proxy.handleTree(message.data, "deptId");
- if (data && data.length > 0) {
- for (let i = 0; i < data.length; i++) {
- if (data[i].children && data[i].children.length > 0) {
- deptTreeData.value = deptTreeData.value.concat(data[i].children);
- }
- }
- }
- });
- 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,
- };
- });
- }
- });
- };
- getDict();
- const getList = async (req) => {
- sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
- loading.value = true;
- proxy
- .post("/accountPayment/page", sourceList.value.pagination)
- .then((message) => {
- sourceList.value.data = message.rows;
- sourceList.value.pagination.total = message.total;
- setTimeout(() => {
- loading.value = false;
- }, 200);
- });
- };
- const paymentType = ref([
- {
- label: "已打款",
- value: 10,
- },
- {
- label: "部分打款",
- value: 15,
- },
- {
- label: "未打款",
- value: 20,
- },
- ]);
- const foundsType = computed(() => proxy.useUserStore().allDict["founds_type"]);
- const paymentTypeOne = computed(() => {
- if (foundsType.value && foundsType.value.length > 0) {
- return [
- ...foundsType.value.map((x) => ({
- ...x,
- label: "请款: " + x.dictValue,
- value: x.dictKey,
- })),
- {
- label: "采购付款",
- value: 20,
- },
- {
- label: "售后",
- value: 40,
- },
- ];
- } else {
- return [
- {
- label: "采购付款",
- value: 20,
- },
- {
- label: "售后",
- value: 40,
- },
- ];
- }
- });
- const selection = ref({
- data: [],
- });
- const select = (_selection, row) => {
- selection.value.data = _selection;
- };
- const submitForm = () => {
- byform.value.handleSubmit(() => {
- if (fileList.value && fileList.value.length > 0) {
- formData.data.fileList = fileList.value.map((item) => {
- return {
- id: item.raw.id,
- fileName: item.raw.fileName,
- fileUrl: item.raw.fileUrl,
- };
- });
- } else {
- formData.data.fileList = [];
- }
- submitLoading.value = true;
- proxy.post("/accountPayment/add", formData.data).then(
- () => {
- ElMessage({
- message: "打款成功",
- type: "success",
- });
- dialogVisible.value = false;
- submitLoading.value = false;
- getList();
- },
- () => {
- submitLoading.value = false;
- }
- );
- });
- };
- const getDtl = (row) => {
- proxy.post("/accountPayment/detail", { id: row.id }).then((res) => {
- formData.data.fileList = [];
- fileList.value = [];
- formData.data = res;
- if (submitType.value === "add") {
- formData.data.expensesTime = moment().format("yyyy-MM-DD HH:mm:ss");
- formData.data.currency = row.currency;
- formData.data.amount = Number(
- parseFloat(res.incomeAmount - res.amount).toFixed(2)
- );
- } else {
- formData.data.expensesTime = formData.data.updateTime;
- }
- if (submitType.value !== "add") {
- let ids = [];
- if (
- res.accountPaymentRecordsList &&
- res.accountPaymentRecordsList.length > 0
- ) {
- ids = res.accountPaymentRecordsList.map((x) => x.id);
- }
- proxy
- .post("/fileInfo/getList", { businessIdList: [row.id, ...ids] })
- .then((fileObj) => {
- if (fileObj) {
- let arr = [];
- for (const key in fileObj) {
- if (fileObj[key]) {
- arr = [...arr, ...fileObj[key]];
- }
- }
- formData.data.fileList = arr;
- if (formData.data.fileList && formData.data.fileList.length > 0) {
- fileList.value = formData.data.fileList.map((item) => {
- return {
- raw: item,
- name: item.fileName,
- url: item.fileUrl,
- };
- });
- } else {
- fileList.value = [];
- }
- }
- });
- }
- dialogVisible.value = true;
- });
- };
- getList();
- const openSearch = ref(false);
- const formSearchConfig = computed(() => {
- return [
- {
- type: "select",
- prop: "corporationId",
- label: "归属公司",
- data: companyData.value,
- clearable: true,
- },
- {
- type: "slot",
- slotName: "departmentId",
- label: "归属部门",
- },
- {
- type: "select",
- prop: "createUser",
- label: "请款人",
- data: userList.value,
- clearable: true,
- },
- {
- type: "select",
- prop: "type",
- label: "付款类型",
- data: fundsType.value,
- clearable: true,
- },
- {
- type: "slot",
- slotName: "time",
- label: "请款时间",
- },
- {
- type: "slot",
- slotName: "timeTwo",
- label: "用款时间",
- },
- {
- type: "select",
- prop: "currency",
- label: "币种",
- data: accountCurrency.value,
- clearable: true,
- itemWidth: 50,
- },
- {
- type: "input",
- prop: "oppositeAccountName",
- label: "对方账户",
- itemWidth: 50,
- },
- {
- type: "slot",
- slotName: "money",
- label: "交易金额",
- },
- {
- type: "select",
- prop: "paymentStatus",
- label: "打款状态",
- data: paymentType.value,
- clearable: true,
- },
- {
- type: "input",
- itemType: "textarea",
- prop: "paymentRemark",
- label: "款项说明",
- },
- ];
- });
- let copySearch = ref({});
- const moreSearch = () => {
- copySearch.value = proxy.deepClone(sourceList.value.pagination);
- openSearch.value = true;
- };
- const cancelSearch = () => {
- sourceList.value.pagination = copySearch.value;
- openSearch.value = false;
- };
- const submitSearch = () => {
- if (
- sourceList.value.pagination.startAmount &&
- sourceList.value.pagination.endAmount &&
- Number(sourceList.value.pagination.startAmount) >
- Number(sourceList.value.pagination.endAmount)
- ) {
- return ElMessage("交易金额输入错误");
- }
- if (
- sourceList.value.pagination.beginCreateTime &&
- sourceList.value.pagination.endCreateTime &&
- sourceList.value.pagination.beginCreateTime >
- sourceList.value.pagination.endCreateTime
- ) {
- return ElMessage("开始时间不能大于结束时间");
- }
- if (
- sourceList.value.pagination.beginTime &&
- sourceList.value.pagination.endTime &&
- sourceList.value.pagination.beginTime > sourceList.value.pagination.endTime
- ) {
- return ElMessage("开始时间不能大于结束时间");
- }
- openSearch.value = false;
- sourceList.value.pagination.keyword = "";
- sourceList.value.pagination.pageNum = 1;
- 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文件");
- }
- };
- let formCancelledOutData = reactive({
- data: {},
- });
- const cancelledOut = ref(null);
- const formCancelledOutConfig = computed(() => {
- return [
- {
- type: "slot",
- label: "打款明细",
- slotName: "detail",
- },
- {
- type: "input",
- itemType: "textarea",
- prop: "remark",
- label: "冲销原因",
- },
- ];
- });
- let rulesCancelledOut = ref({
- remark: [{ required: true, message: "请输入冲销原因", trigger: "blur" }],
- });
- const openCancelledOut = ref(false);
- const submitCancelledOutLoading = ref(false);
- const submitCancelledOutForm = () => {
- cancelledOut.value.handleSubmit(() => {
- submitCancelledOutLoading.value = true;
- proxy.post("/writeOffRecords/add", formCancelledOutData.data).then(
- () => {
- ElMessage({
- message: "冲销完成",
- type: "success",
- });
- openCancelledOut.value = false;
- submitCancelledOutLoading.value = false;
- getList();
- },
- () => {
- submitCancelledOutLoading.value = false;
- }
- );
- });
- };
- const clickDetail = () => {
- formOption.disabled = true;
- submitType.value = "edit";
- getDtl(rowData.value);
- };
- const fileData = reactive({
- data: {},
- });
- const fileConfig = computed(() => [
- {
- type: "title",
- title: "业务附件",
- },
- {
- type: "slot",
- slotName: "businessFile",
- // label: "业务附件",
- },
- {
- type: "title",
- title: "打款附件",
- },
- {
- type: "slot",
- slotName: "fundsFile",
- // label: "打款附件",
- },
- ]);
- const openFileDialog = ref(false);
- const handleOpenFile = (row) => {
- fileData.data = {
- fileList: [],
- fileListOne: [],
- };
- proxy.post("/accountPayment/detail", { id: row.id }).then((res) => {
- let ids = [];
- if (
- res.accountPaymentRecordsList &&
- res.accountPaymentRecordsList.length > 0
- ) {
- ids = res.accountPaymentRecordsList.map((x) => x.id);
- }
- proxy
- .post("/fileInfo/getList", { businessIdList: [row.id, ...ids] })
- .then((fileObj) => {
- if (fileObj) {
- let arr = [];
- for (const key in fileObj) {
- if (fileObj[key]) {
- arr = [...arr, ...fileObj[key]];
- }
- }
- fileData.data.fileListOne = arr;
- }
- });
- });
- proxy
- .post("/fileInfo/getList", { businessIdList: [row.businessId] })
- .then((fileObj) => {
- if (fileObj[row.businessId] && fileObj[row.businessId].length > 0) {
- fileData.data.fileList = fileObj[row.businessId];
- }
- });
- openFileDialog.value = true;
- };
- const openFile = (item) => {
- window.open(item.fileUrl, "_blank");
- };
- 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>
- .user {
- padding: 20px;
- }
- ::v-deep(.el-input-number .el-input__inner) {
- text-align: left;
- }
- </style>
|