12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340 |
- <template>
- <div class="tenant">
- <div class="content">
- <byTable
- :source="sourceList.data"
- :pagination="sourceList.pagination"
- :config="config"
- :loading="loading"
- highlight-current-row
- :selectConfig="selectConfig"
- :action-list="[
- {
- text: '发起请款',
- action: () => openModal(),
- },
- ]"
- @moreSearch="moreSearch"
- @get-list="getList"
- >
- <template #total="{ item }">
- <div style="width: 100%">
- <a
- style="color: #409eff; cursor: pointer"
- @click="pushProcessApproval(item)"
- >{{ item.currency }}{{ item.total }}</a
- >
- </div>
- </template>
- <template #type="{ item }">
- <div style="width: 100%">
- <span>
- {{ dictValueLabel(item.type, fundsType) }}
- </span>
- <span v-if="item.type == 1"
- >(<span v-if="item.writeOffStatus == 0">未核销</span
- ><span v-if="item.writeOffStatus == 1">已核销</span>)</span
- >
- </div>
- </template>
- </byTable>
- </div>
- <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="840px">
- <div id="pdfDom" style="width: 776px">
- <div
- style="padding: 60px 30px; font-size: 12px !important; color: black"
- >
- <div style="font-size: 16px; text-align: center; padding: 8px">
- <span
- >{{ dictValueLabel(printDetails.type, fundsType) }}审批单</span
- >
- </div>
- <div style="padding: 8px 0">
- <span>{{ printDetails.corporationName }}</span>
- <span style="padding-left: 32px"
- >创建时间: {{ printDetails.createTime }}</span
- >
- </div>
- <div style="border: 1px solid black">
- <div style="display: flex; border-bottom: 1px solid black">
- <div
- style="
- width: 126px;
- border-right: 1px solid black;
- padding: 8px;
- "
- >
- 创建人
- </div>
- <div style="width: calc(100% - 126px); padding: 8px">
- {{ dictValueLabel(printDetails.createUser, userList) }}
- </div>
- </div>
- <div style="display: flex; border-bottom: 1px solid black">
- <div
- style="
- width: 126px;
- border-right: 1px solid black;
- padding: 8px;
- "
- >
- 创建人部门
- </div>
- <div style="width: calc(100% - 126px); padding: 8px">
- {{ printDetails.deptName }}
- </div>
- </div>
- <div
- style="display: flex; border-bottom: 1px solid black"
- v-if="printDetails.type !== '3'"
- >
- <div
- style="
- width: 126px;
- border-right: 1px solid black;
- padding: 4px 8px;
- display: flex;
- align-items: center;
- "
- >
- 费用明细
- </div>
- <div style="width: calc(100% - 126px)">
- <div style="border-bottom: 1px solid black; display: flex">
- <div
- style="
- width: 80px;
- padding: 4px 8px;
- border-right: 1px solid black;
- text-align: center;
- "
- >
- 费用类型
- </div>
- <div
- style="
- width: 120px;
- padding: 4px 8px;
- border-right: 1px solid black;
- text-align: center;
- "
- >
- 关联合同
- </div>
- <div
- style="
- width: calc(100% - 360px);
- padding: 4px 8px;
- border-right: 1px solid black;
- text-align: center;
- "
- >
- 款项说明
- </div>
- <div
- style="
- width: 60px;
- padding: 4px 8px;
- border-right: 1px solid black;
- text-align: center;
- "
- >
- 货币
- </div>
- <div
- style="width: 100px; padding: 4px 8px; text-align: center"
- >
- 付款金额
- </div>
- </div>
- <template
- v-if="
- printDetails.accountRequestFundsDetailList &&
- printDetails.accountRequestFundsDetailList.length > 0
- "
- >
- <div
- v-for="(
- item, index
- ) in printDetails.accountRequestFundsDetailList"
- :key="index"
- >
- <div
- :style="
- index + 1 !==
- printDetails.accountRequestFundsDetailList.length
- ? 'border-bottom: 1px solid black; display: flex'
- : ' display: flex'
- "
- >
- <div
- style="
- width: 80px;
- padding: 4px 8px;
- border-right: 1px solid black;
- text-align: center;
- "
- >
- {{ dictValueLabel(item.costType, fundsCostType) }}
- </div>
- <div
- style="
- width: 120px;
- padding: 4px 8px;
- border-right: 1px solid black;
- display: flex;
- align-items: center;
- "
- >
- {{ item.contractCode }}
- </div>
- <div
- style="
- width: calc(100% - 360px);
- padding: 4px 8px;
- border-right: 1px solid black;
- display: flex;
- align-items: center;
- "
- >
- {{ item.remarks }}
- </div>
- <div
- style="
- width: 60px;
- padding: 4px 8px;
- border-right: 1px solid black;
- display: flex;
- align-items: center;
- "
- >
- {{
- dictValueLabel(printDetails.currency, accountCurrency)
- }}
- </div>
- <div
- style="
- width: 100px;
- padding: 4px 8px;
- display: flex;
- align-items: center;
- "
- >
- {{ item.amount }}
- </div>
- </div>
- </div>
- </template>
- </div>
- </div>
- <div style="display: flex; border-bottom: 1px solid black" v-else>
- <div
- style="
- width: 126px;
- border-right: 1px solid black;
- padding: 4px 8px;
- display: flex;
- align-items: center;
- "
- >
- 费用明细
- </div>
- <div style="width: calc(100% - 126px)">
- <div style="border-bottom: 1px solid black; display: flex">
- <div
- style="
- width: 80px;
- padding: 4px 8px;
- border-right: 1px solid black;
- text-align: center;
- "
- >
- 费用类型
- </div>
- <div
- style="
- width: 120px;
- padding: 4px 8px;
- border-right: 1px solid black;
- text-align: center;
- "
- >
- 关联合同
- </div>
- <div
- style="
- width: calc(100% - 420px);
- padding: 4px 8px;
- border-right: 1px solid black;
- text-align: center;
- "
- >
- 款项说明
- </div>
- <div
- style="
- width: 60px;
- padding: 4px 8px;
- border-right: 1px solid black;
- text-align: center;
- "
- >
- 货币
- </div>
- <div
- style="
- width: 80px;
- padding: 4px 8px;
- border-right: 1px solid black;
- text-align: center;
- "
- >
- 预支金额
- </div>
- <div
- style="width: 80px; padding: 4px 8px; text-align: center"
- >
- 付款金额
- </div>
- </div>
- <template
- v-if="
- printDetails.accountRequestFundsDetailList &&
- printDetails.accountRequestFundsDetailList.length > 0
- "
- >
- <div
- v-for="(
- item, index
- ) in printDetails.accountRequestFundsDetailList"
- :key="index"
- >
- <div
- :style="
- index + 1 !==
- printDetails.accountRequestFundsDetailList.length
- ? 'border-bottom: 1px solid black; display: flex'
- : ' display: flex'
- "
- >
- <div
- style="
- width: 80px;
- padding: 4px 8px;
- border-right: 1px solid black;
- text-align: center;
- "
- >
- {{ dictValueLabel(item.costType, fundsCostType) }}
- </div>
- <div
- style="
- width: 120px;
- padding: 4px 8px;
- border-right: 1px solid black;
- display: flex;
- align-items: center;
- "
- >
- {{ item.contractCode }}
- </div>
- <div
- style="
- width: calc(100% - 420px);
- padding: 4px 8px;
- border-right: 1px solid black;
- display: flex;
- align-items: center;
- "
- >
- {{ item.remarks }}
- </div>
- <div
- style="
- width: 60px;
- padding: 4px 8px;
- border-right: 1px solid black;
- display: flex;
- align-items: center;
- "
- >
- {{
- dictValueLabel(printDetails.currency, accountCurrency)
- }}
- </div>
- <div
- style="
- width: 80px;
- padding: 4px 8px;
- border-right: 1px solid black;
- display: flex;
- align-items: center;
- "
- >
- {{ item.advanceAmount }}
- </div>
- <div
- style="
- width: 80px;
- padding: 4px 8px;
- display: flex;
- align-items: center;
- "
- >
- {{ item.amount }}
- </div>
- </div>
- </div>
- </template>
- </div>
- </div>
- <div
- style="display: flex; border-bottom: 1px solid black"
- v-if="printDetails.type !== '3'"
- >
- <div
- style="
- width: 126px;
- border-right: 1px solid black;
- padding: 8px;
- "
- >
- 总报销金额
- </div>
- <div style="width: calc(100% - 126px); display: flex">
- <div
- style="
- width: calc(100% - 100px);
- padding: 8px;
- border-right: 1px solid black;
- "
- >
- {{ NumberToChinese(computeMoney("amount")) }}
- </div>
- <div style="width: 100px; padding: 8px">
- {{ computeMoney("amount") }}
- </div>
- </div>
- </div>
- <div v-else>
- <div style="display: flex; border-bottom: 1px solid black">
- <div
- style="
- width: 126px;
- border-right: 1px solid black;
- padding: 8px;
- "
- >
- 核销总金额
- </div>
- <div style="width: calc(100% - 126px); display: flex">
- <div
- style="
- width: calc(100% - 80px);
- padding: 8px;
- border-right: 1px solid black;
- "
- >
- {{ NumberToChinese(computeMoney("amount")) }}
- </div>
- <div style="width: 80px; padding: 8px">
- {{ computeMoney("amount") }}
- </div>
- </div>
- </div>
- <div style="display: flex; border-bottom: 1px solid black">
- <div
- style="
- width: 126px;
- border-right: 1px solid black;
- padding: 8px;
- "
- >
- 预支总金额
- </div>
- <div style="width: calc(100% - 126px); display: flex">
- <div
- style="
- width: calc(100% - 80px);
- padding: 8px;
- border-right: 1px solid black;
- "
- >
- {{ NumberToChinese(computeMoney("advanceAmount")) }}
- </div>
- <div style="width: 80px; padding: 8px">
- {{ computeMoney("advanceAmount") }}
- </div>
- </div>
- </div>
- <div style="display: flex; border-bottom: 1px solid black">
- <div
- style="
- width: 126px;
- border-right: 1px solid black;
- padding: 8px;
- "
- >
- 差额 (核销 - 预支)
- </div>
- <div style="width: calc(100% - 126px); display: flex">
- <div
- style="
- width: calc(100% - 80px);
- padding: 8px;
- border-right: 1px solid black;
- "
- >
- {{ NumberToChinese(computeBalance()) }}
- </div>
- <div style="width: 80px; padding: 8px">
- {{ computeBalance() }}
- </div>
- </div>
- </div>
- </div>
- <div style="display: flex; border-bottom: 1px solid black">
- <div
- style="
- width: 126px;
- border-right: 1px solid black;
- padding: 8px;
- "
- >
- 单据数量
- </div>
- <div style="width: calc(100% - 126px); padding: 8px">
- {{ printDetails.quantity }}
- </div>
- </div>
- <div style="display: flex; border-bottom: 1px solid black">
- <div
- style="
- width: 126px;
- border-right: 1px solid black;
- padding: 0 8px;
- display: flex;
- align-items: center;
- "
- >
- 收款信息
- </div>
- <div style="width: calc(100% - 126px)">
- <div style="border-bottom: 1px solid black; display: flex">
- <div
- style="
- width: 19%;
- padding: 0 8px;
- border-right: 1px solid black;
- text-align: center;
- "
- >
- 支付方式
- </div>
- <div
- style="
- width: 27%;
- padding: 0 8px;
- border-right: 1px solid black;
- text-align: center;
- "
- >
- 收款方户名
- </div>
- <div
- style="
- width: 27%;
- padding: 0 8px;
- border-right: 1px solid black;
- text-align: center;
- "
- >
- 开户行
- </div>
- <div style="width: 27%; padding: 0 8px; text-align: center">
- 收款方账号
- </div>
- </div>
- <div style="display: flex">
- <div
- style="
- width: 19%;
- padding: 0 8px;
- border-right: 1px solid black;
- display: flex;
- align-items: center;
- "
- >
- {{
- dictValueLabel(
- printDetails.paymentMethod,
- fundsPaymentMethod
- )
- }}
- </div>
- <div
- style="
- width: 27%;
- padding: 0 8px;
- border-right: 1px solid black;
- display: flex;
- align-items: center;
- "
- >
- {{ printDetails.name }}
- </div>
- <div
- style="
- width: 27%;
- padding: 0 8px;
- border-right: 1px solid black;
- display: flex;
- align-items: center;
- "
- >
- {{ printDetails.openingBank }}
- </div>
- <div
- style="
- width: 27%;
- padding: 0 8px;
- display: flex;
- align-items: center;
- "
- >
- {{ printDetails.accountOpening }}
- </div>
- </div>
- </div>
- </div>
- <div style="display: flex; border-bottom: 1px solid black">
- <div
- style="
- width: 126px;
- border-right: 1px solid black;
- padding: 8px;
- "
- >
- 电子发票(PDF/JPG)
- </div>
- <div style="width: calc(100% - 126px); padding: 8px">
- {{ printDetails.electronicInvoiceText }}
- </div>
- </div>
- <div style="display: flex">
- <div
- style="
- width: 126px;
- border-right: 1px solid black;
- padding: 4px 8px;
- display: flex;
- align-items: center;
- "
- >
- 审批流程
- </div>
- <div style="width: calc(100% - 126px)">
- <template
- v-if="
- printDetails.recordList &&
- printDetails.recordList.length > 0
- "
- >
- <div
- v-for="(item, index) in printDetails.recordList"
- :key="index"
- >
- <div
- :style="
- index + 1 !== printDetails.recordList.length
- ? 'border-bottom: 1px solid black; padding: 4px 8px; display: flex'
- : 'padding: 4px 8px; display: flex'
- "
- >
- <div
- style="width: calc(100% - 120px); word-wrap: break-word"
- >
- <span>{{ item.nodeName }}: </span>
- <span style="padding-left: 4px">{{
- item.processedUser
- }}</span>
- <span style="padding-left: 4px">{{ item.remark }}</span>
- </div>
- <div style="width: 120px">{{ item.processedDate }}</div>
- </div>
- </div>
- </template>
- </div>
- </div>
- </div>
- <div style="padding-top: 16px">
- <span>打印时间: {{ presentTime }}</span>
- <span style="padding-left: 32px"
- >打印人: {{ useUserStore().user.nickName }}</span
- >
- </div>
- </div>
- </div>
- <template #footer>
- <el-button @click="openPrint = false" size="large">取消</el-button>
- <el-button type="primary" @click="clickDownload()" size="large"
- >下载PDF</el-button
- >
- </template>
- </el-dialog>
- <el-dialog
- title="高级检索"
- v-if="openSearch"
- v-model="openSearch"
- width="600"
- :before-close="cancelSearch"
- >
- <byForm
- :formConfig="formSearchConfig"
- :formOption="formOption"
- 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.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.minAdvanceAmounts"
- 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.maxAdvanceAmounts"
- 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>
- </div>
- </template>
- <script setup>
- import byTable from "@/components/byTable/index";
- import useUserStore from "@/store/modules/user";
- import { ref } from "vue";
- import moment from "moment";
- import byForm from "@/components/byForm/index";
- import { NumberToChinese } from "@/utils/util.js";
- const loading = ref(false);
- const sourceList = ref({
- data: [],
- pagination: {
- total: 0,
- pageNum: 1,
- pageSize: 10,
- type: "",
- keyword: "",
- writeOffStatus: "",
- corporationId: "",
- departmentId: "",
- createUser: "",
- currency: "",
- beginTime: "",
- endTime: "",
- minAdvanceAmounts: undefined,
- maxAdvanceAmounts: undefined,
- paymentRemarks: "",
- paymentMethod: "",
- status: "",
- paymentStatus: "",
- },
- });
- const { proxy } = getCurrentInstance();
- const fundsType = ref([]);
- const accountData = ref([]);
- const userList = ref([]);
- const companyData = ref([]);
- const accountCurrency = ref([]);
- const fundsCostType = ref([]);
- const fundsPaymentMethod = ref([]);
- const deptTreeData = ref([]);
- const status = ref([
- {
- label: "审批中",
- value: "10",
- },
- {
- label: "驳回",
- value: "20",
- },
- {
- label: "审批通过",
- value: "30",
- },
- ]);
- const paymentStatus = ref([
- {
- label: "已打款",
- value: "10",
- },
- {
- label: "未打款",
- value: "20",
- },
- ]);
- const selectConfig = computed(() => {
- return [
- {
- label: "类型",
- prop: "type",
- data: fundsType.value,
- },
- {
- label: "审批状态",
- prop: "status",
- data: status.value,
- },
- {
- label: "放款状态",
- prop: "paymentStatus",
- data: paymentStatus.value,
- },
- ];
- });
- const config = computed(() => {
- return [
- {
- attrs: {
- label: "归属公司",
- prop: "corporationName",
- width: 180,
- },
- },
- {
- attrs: {
- label: "归属部门",
- prop: "deptName",
- width: 140,
- },
- },
- {
- attrs: {
- label: "请款类型",
- prop: "type",
- width: 130,
- slot: "type",
- },
- // render(type) {
- // return proxy.dictValueLabel(type, fundsType.value);
- // },
- },
- {
- attrs: {
- label: "请款人",
- prop: "userName",
- width: 120,
- },
- },
- {
- attrs: {
- label: "请款时间",
- prop: "createTime",
- width: 160,
- },
- },
- {
- attrs: {
- label: "请款金额",
- slot: "total",
- width: 120,
- },
- },
- {
- attrs: {
- label: "用款说明",
- prop: "paymentRemarks",
- 'min-width': 180
- },
- },
- {
- attrs: {
- label: "付款方式",
- prop: "paymentMethod",
- width: 120,
- },
- render(paymentMethod) {
- return proxy.dictValueLabel(paymentMethod, fundsPaymentMethod.value);
- },
- },
- {
- attrs: {
- label: "付款账户",
- prop: "accountManagementName",
- width: 160,
- },
- },
- {
- attrs: {
- label: "审批状态",
- prop: "status",
- width: 120,
- },
- render(status) {
- return status == 10
- ? "审批中"
- : status == 20
- ? "驳回"
- : status == 30
- ? "审批通过"
- : "";
- },
- },
- {
- attrs: {
- label: "放款状态",
- prop: "accountPaymentStatus",
- width: 120,
- },
- render(status) {
- return proxy.dictValueLabel(status, paymentStatus.value);
- },
- },
- {
- attrs: {
- label: "操作",
- width: "120",
- align: "center",
- fixed: "right",
- },
- renderHTML(row) {
- return [
- row.type == 1 && row.writeOffStatus == 0 && row.status == '30'
- ? {
- attrs: {
- label: "核销",
- type: "primary",
- text: true,
- },
- el: "button",
- click() {
- openModal(row);
- },
- }
- : {},
- {
- attrs: {
- label: "打印",
- type: "primary",
- text: true,
- },
- el: "button",
- click() {
- clickPrint(row);
- },
- },
- ];
- },
- },
- ];
- });
- const getList = async (req) => {
- sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
- loading.value = true;
- proxy
- .post("/accountRequestFunds/page", sourceList.value.pagination)
- .then((message) => {
- sourceList.value.data = message.rows;
- sourceList.value.pagination.total = message.total;
- setTimeout(() => {
- loading.value = false;
- }, 200);
- });
- };
- const openModal = (row = {}) => {
- const flowName = `${userInfo.nickName}的请款申请(发起)`;
- let query = {
- flowKey: "account_request_funds_flow",
- random: proxy.random(),
- flowName,
- };
- if (row.id) {
- query.advanceId = row.id;
- query.corporationId = row.corporationId;
- }
- proxy.$router.replace({
- path: "/platform_manage/process/processApproval",
- query,
- });
- };
- const userInfo = useUserStore().user;
- const recursive = (data) => {
- data.map((item) => {
- item.label = item.deptName;
- item.id = item.corporationId;
- if (item.children) {
- recursive(item.children);
- } else {
- item.children = [];
- }
- });
- };
- const getDictData = () => {
- proxy
- .getDictOne([
- "founds_type",
- "funds_payment_method",
- "account_currency",
- "funds_cost_type",
- ])
- .then((res) => {
- fundsType.value = res["founds_type"].map((x) => ({
- label: x.dictValue,
- value: x.dictKey,
- }));
- fundsPaymentMethod.value = res["funds_payment_method"].map((x) => ({
- label: x.dictValue,
- value: x.dictKey,
- }));
- accountCurrency.value = res["account_currency"].map((x) => ({
- label: x.dictValue,
- value: x.dictKey,
- }));
- fundsCostType.value = res["funds_cost_type"].map((x) => ({
- label: x.dictValue,
- value: x.dictKey,
- }));
- });
- proxy
- .post("/accountManagement/page", { pageNum: 1, pageSize: 9999 })
- .then((res) => {
- accountData.value = res.rows.map((item) => {
- return {
- ...item,
- 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,
- };
- });
- }
- });
- 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: userInfo.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);
- }
- }
- }
- });
- };
- getDictData();
- getList();
- const openPrint = ref(false);
- const printDetails = ref({});
- const presentTime = ref("");
- const clickPrint = (row) => {
- presentTime.value = moment().format("yyyy-MM-DD HH:mm:ss");
- openPrint.value = true;
- proxy.post("/accountRequestFunds/detail", { id: row.id }).then((res) => {
- printDetails.value = res;
- proxy
- .post("/fileInfo/getList", { businessIdList: [row.id] })
- .then((resFile) => {
- let electronicInvoiceText = "";
- if (resFile[row.id] && resFile[row.id].length > 0) {
- for (let i = 0; i < resFile[row.id].length; i++) {
- if (i === 0) {
- electronicInvoiceText = resFile[row.id][0].fileName;
- } else {
- electronicInvoiceText =
- electronicInvoiceText + ", " + resFile[row.id][i].fileName;
- }
- }
- }
- printDetails.value.electronicInvoiceText = electronicInvoiceText;
- });
- if (row.flowInfoId) {
- proxy
- .post("/flowExample/getApprovalRecord", { id: row.flowInfoId })
- .then((record) => {
- printDetails.value.recordList = record.recordList;
- });
- }
- });
- };
- const clickDownload = () => {
- proxy.getPdf("请款PDF文件");
- };
- const computeMoney = (label) => {
- let amount = 0;
- if (
- printDetails.value.accountRequestFundsDetailList &&
- printDetails.value.accountRequestFundsDetailList.length > 0
- ) {
- for (
- let i = 0;
- i < printDetails.value.accountRequestFundsDetailList.length;
- i++
- ) {
- if (printDetails.value.accountRequestFundsDetailList[i][label]) {
- amount = Number(
- parseFloat(
- Number(amount) +
- Number(printDetails.value.accountRequestFundsDetailList[i][label])
- ).toFixed(2)
- );
- }
- }
- }
- return amount;
- };
- const computeBalance = () => {
- let balance = 0;
- let advanceAmount = computeMoney("advanceAmount");
- let amount = computeMoney("amount");
- if (amount) {
- balance = Number(amount);
- }
- if (advanceAmount) {
- balance = Number(
- parseFloat(Number(balance) - Number(advanceAmount)).toFixed(2)
- );
- }
- return balance;
- };
- const formOption = reactive({
- inline: true,
- labelWidth: 100,
- itemWidth: 100,
- rules: [],
- });
- const defaultProps = {
- children: "children",
- label: "deptName",
- };
- const openSearch = ref(false);
- const formSearchConfig = computed(() => {
- return [
- {
- type: "select",
- prop: "corporationId",
- label: "归属公司",
- data: companyData.value,
- clearable: true,
- },
- {
- type: "slot",
- slotName: "departmentId",
- label: "归属部门",
- itemWidth: 50,
- },
- {
- type: "select",
- prop: "createUser",
- label: "请款人",
- data: userList.value,
- itemWidth: 50,
- clearable: true,
- },
- {
- type: "select",
- prop: "type",
- label: "请款类型",
- data: fundsType.value,
- clearable: true,
- },
- {
- type: "select",
- prop: "currency",
- label: "币种",
- data: accountCurrency.value,
- clearable: true,
- },
- {
- type: "slot",
- slotName: "time",
- label: "请款时间",
- },
- {
- type: "slot",
- slotName: "money",
- label: "请款金额",
- },
- {
- type: "input",
- itemType: "textarea",
- prop: "paymentRemarks",
- label: "用款说明",
- },
- {
- type: "select",
- prop: "paymentMethod",
- label: "付款方式",
- data: fundsPaymentMethod.value,
- clearable: true,
- },
- {
- type: "select",
- prop: "status",
- label: "流程状态",
- data: status.value,
- itemWidth: 50,
- clearable: true,
- },
- {
- type: "select",
- prop: "paymentStatus",
- label: "打款状态",
- data: paymentStatus.value,
- itemWidth: 50,
- clearable: true,
- },
- ];
- });
- 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.minAdvanceAmounts &&
- sourceList.value.pagination.maxAdvanceAmounts &&
- Number(sourceList.value.pagination.minAdvanceAmounts) >
- Number(sourceList.value.pagination.maxAdvanceAmounts)
- ) {
- 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.pageNum = 1;
- getList();
- };
- const pushProcessApproval = (row) => {
- proxy.$router.push({
- path: "/platform_manage/process/processApproval",
- query: {
- flowKey: "account_request_funds_flow",
- id: row.flowInfoId,
- processType: 20,
- random: proxy.random(),
- flowName: "请款详情",
- },
- });
- return;
- };
- </script>
- <style lang="scss" scoped>
- .tenant {
- padding: 20px;
- }
- ::v-deep(.el-input-number .el-input__inner) {
- text-align: left;
- }
- </style>
|