12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856 |
- <style scoped>
- ::v-deep .margin-small .ant-row {
- margin-bottom: 0;
- }
- ::v-deep .ant-steps-dot .ant-steps-item-content {
- width: auto;
- }
- ::v-deep
- .ant-steps-dot
- .ant-steps-item-active
- .ant-steps-item-icon
- > .ant-steps-icon
- .ant-steps-icon-dot {
- background: rgb(11, 190, 135);
- width: 15px;
- height: 15px;
- /* margin-top: 5px; */
- margin-left: 2px;
- }
- ::v-deep .endStatus .ant-steps-item-icon > .ant-steps-icon .ant-steps-icon-dot {
- background: #1890ff !important;
- width: 15px;
- height: 15px;
- /* margin-top: 5px; */
- /* margin-left: 2px; */
- }
- ::v-deep .ant-steps-dot .ant-steps-item-icon {
- width: 15px;
- height: 15px;
- margin-top: 5px;
- margin-left: -4px;
- }
- </style>
- <template>
- <div class="policy-management-content">
- <div class="control-con-title">
- <div>
- <span class="policy-export-btn">垫款池子</span>
- </div>
- <div>
- <!-- <span class="add-acount-policy-btn">
- <a-button>快递信息</a-button>
- </span> -->
- <span class="add-acount-policy-btn">
- <a-button @click="handleAdd" type="primary">新增</a-button>
- </span>
- <span class="add-acount-policy-btn">
- <a-button @click="handleAddPleace" type="primary">充值申请</a-button>
- </span>
- </div>
- </div>
- <div class="control-con-header">
- <a-form class="grid-form" layout="inline" :form="searchForm" hide-required-mark>
- <a-row class="grid-form-options">
- <a-form-item class="grid-form-item" label="客户名称:" :colon="false">
- <!-- <a-input v-model="configForm.companyName" placeholder="请输入公司名称" allow-clear/> -->
- <a-input
- v-model="configForm.advertiserName"
- placeholder="请输入客户名称"
- allow-clear
- />
- </a-form-item>
- <a-form-item class="grid-form-item" label="产品名称:" :colon="false">
- <a-input
- v-model="configForm.productName"
- placeholder="请输入产品名称"
- allow-clear
- />
- </a-form-item>
- <a-form-item class="grid-form-item" label="媒体:" :colon="false">
- <a-select
- v-model="configForm.paymentMedia"
- style="width: 200px; margin-left: 10px"
- :filterOption="filterOption"
- showSearch
- allowClear
- placeholder="请选择媒体"
- >
- <a-select-option value="1"> 头条 </a-select-option>
- <a-select-option value="2"> 快手 </a-select-option>
- <a-select-option value="9"> 广点通 </a-select-option>
- <a-select-option value="7"> 磁力金牛 </a-select-option>
- </a-select>
- </a-form-item>
- <a-form-item class="grid-form-item" label="返点类型:" :colon="false">
- <a-select
- v-model="configForm.rebateType"
- style="width: 200px; margin-left: 10px"
- :filterOption="filterOption"
- showSearch
- allowClear
- placeholder="请选择返点类别"
- >
- <a-select-option value="1"> 返货 </a-select-option>
- <a-select-option value="2"> 返现 </a-select-option>
- </a-select>
- </a-form-item>
- <a-form-item class="grid-form-item" label="申请时间:" :colon="false">
- <a-range-picker
- v-model="configForm.time"
- format="YYYY-MM-DD"
- style="width: 100%"
- />
- </a-form-item>
- <a-form-item class="form-handle-btn">
- <a-button type="default" class="reset-class" @click="handleResetList"
- >重置</a-button
- >
- <a-button type="primary" @click="handleQueryList">搜索</a-button>
- </a-form-item>
- </a-row>
- </a-form>
- </div>
- <div class="control-con-table">
- <a-table
- ref="table"
- size="middle"
- bordered
- :columns="columns"
- :dataSource="dataSource"
- :pagination="false"
- :loading="controlLoading"
- :scroll="{ x: 1000 }"
- >
- <span slot="action" slot-scope="text, record">
- <a @click="handleDetail(record)">申请充值</a>
- <a-divider type="vertical" />
- <!-- record.status == '1' || -->
- <a @click="handleToLog(record)">申请列表</a>
- </span>
- </a-table>
- <a-pagination
- class="pagin-table-class"
- :total="totalAll"
- :show-total="(total) => `共 ${totalAll} 条`"
- size="small"
- show-size-changer
- show-quick-jumper
- v-model="tablePag.page"
- @change="handleOnShowSizeChange"
- @showSizeChange="handleOnShowSizeChange"
- />
- </div>
- <!-- 新增、编辑政策 -->
- <a-modal
- v-if="policyOperationStatus"
- :title="addType === 'add' ? '垫款/到账申请' : '编辑垫款/到账申请'"
- :visible="policyOperationStatus"
- :confirmLoading="confirmLoading"
- @ok="handlePolicyOperationSure"
- @cancel="handlePolicyOperationCancel"
- :width="650"
- >
- <div>
- <a-form-model
- ref="policyOperationForm"
- :model="policyOperationForm"
- :rules="policyOperationRules"
- :label-col="labelCol"
- :wrapper-col="wrapperCol"
- >
- <a-form-model-item label="媒体" prop="paymentMedia">
- <a-select
- v-model="policyOperationForm.paymentMedia"
- placeholder="请选择投放媒体"
- allow-clear
- >
- <a-select-option :value="1">头条</a-select-option>
- <a-select-option :value="2">快手</a-select-option>
- <a-select-option :value="7">磁力金牛</a-select-option>
- <a-select-option :value="9">广点通</a-select-option>
- </a-select>
- </a-form-model-item>
- <a-form-model-item label="客户名称" prop="advertiserId">
- <a-select
- labelInValue
- v-model="policyOperationForm.advertiserId"
- placeholder="请选择客户名称"
- showSearch
- optionFilterProp="children"
- :filterOption="filterOption"
- allow-clear
- @change="getProductList"
- >
- <a-select-option
- :value="item.advertiserIds"
- v-for="(item, index) of list"
- :key="index"
- >
- {{ item.advertiserName }}
- </a-select-option>
- </a-select>
- </a-form-model-item>
- <a-form-model-item label="选择产品" prop="productId">
- <a-select
- labelInValue
- v-model="policyOperationForm.productId"
- placeholder="请选择产品"
- showSearch
- optionFilterProp="children"
- :filterOption="filterOption"
- allow-clear
- @change="getInfo"
- >
- <a-select-option
- :value="item.productId"
- v-for="(item, index) of productList"
- :key="index"
- >
- {{ item.productName }}
- </a-select-option>
- </a-select>
- <p v-if="showRebate" style="margin-bottom: 0">
- 返点类型:{{
- policyOperationForm.rebateType == 1 ? "返货" : "返现"
- }}
- 返点比例:{{
- policyOperationForm.rebateRate
- }}%
- </p>
- </a-form-model-item>
- <div v-if="writeRebate">
- <a-form-model-item label="返点类型" prop="rebateType">
- <a-select
- v-model="policyOperationForm.rebateType"
- placeholder="请选择类型"
- allow-clear
- >
- <a-select-option :value="1">返货</a-select-option>
- <a-select-option :value="2">返现</a-select-option>
- </a-select>
- </a-form-model-item>
- <a-form-model-item label="返点比例" prop="rebateRate">
- <a-input-number
- v-model="policyOperationForm.rebateRate"
- :step="0.01"
- :precision="2"
- />
- %
- </a-form-model-item>
- </div>
- <a-form-model-item label="类型" prop="paymentType">
- <a-select
- v-model="policyOperationForm.paymentType"
- placeholder="请选择类型"
- allow-clear
- style="width: 80%"
- :disabled="showRebate && policyOperationForm.paymentType == 2"
- >
- <a-select-option :value="1">预付款</a-select-option>
- <a-select-option :value="2">垫款</a-select-option>
- </a-select>
- </a-form-model-item>
- <a-form-model-item
- label="帐显金额"
- prop="displayAmount"
- v-if="policyOperationForm.paymentType == 2"
- >
- <a-input-number
- v-model="policyOperationForm.displayAmount"
- :step="0.01"
- :precision="2"
- :min="0"
- @change="editMoney($event, 1)"
- />
- </a-form-model-item>
- <a-form-model-item label="现金金额" prop="cashAmount">
- <a-input-number
- v-model="policyOperationForm.cashAmount"
- :step="0.01"
- :precision="2"
- :min="0"
- @change="editMoney($event, 2)"
- />
- </a-form-model-item>
- <a-form-model-item label="端口" prop="paymentPort">
- <a-select
- v-model="policyOperationForm.paymentPort"
- placeholder="请选择端口"
- allow-clear
- >
- <a-select-option :value="1">汇创</a-select-option>
- <a-select-option :value="2">骄阳</a-select-option>
- <a-select-option :value="3">江西五六七</a-select-option>
- <a-select-option :value="4">北京五六七</a-select-option>
- </a-select>
- </a-form-model-item>
- <a-form-model-item label="备注" prop="remarks">
- <a-textarea
- v-model="policyOperationForm.remarks"
- placeholder="请输入备注"
- allow-clear
- @change="handleRemarksChange"
- />
- </a-form-model-item>
- <a-form-model-item
- label="图片上传"
- prop="files"
- :rules="{
- required: writeRebate,
- message: '请上传图片',
- trigger: 'change',
- }"
- >
- <uploadFile
- :value.sync="policyOperationForm.files"
- :multiple="true"
- @overUpload="overUpload"
- :fileCount="10"
- :size="10240"
- uploadType="image"
- />
- </a-form-model-item>
- </a-form-model>
- </div>
- </a-modal>
- <!-- 查看详情 -->
- <a-modal
- v-if="auditPolicyStatus"
- title="充值申请"
- :visible="auditPolicyStatus"
- :footer="null"
- v-dialog-drag
- :width="650"
- @cancel="
- auditPolicyStatus = false;
- queryByIdList = { accountList: [] };
- "
- >
- <a-form-model
- ref="queryByIdList"
- :model="queryByIdList"
- :rules="policyOperationRules"
- :label-col="labelCol"
- :wrapper-col="wrapperCol"
- >
- <a-form-model-item label="客户名称" prop="advertiserId">
- <a-select
- v-model="queryByIdList.advertiserId"
- placeholder="请选择客户名称"
- showSearch
- optionFilterProp="children"
- :filterOption="filterOption"
- allow-clear
- @change="getNewProductList"
- >
- <a-select-option
- :value="item.id"
- v-for="(item, index) of advertiserList"
- :key="index"
- >
- {{ item.name }}
- </a-select-option>
- </a-select>
- </a-form-model-item>
- <a-form-model-item label="产品名称" prop="productId">
- <a-select
- v-model="queryByIdList.productId"
- placeholder="请选择产品名称"
- showSearch
- optionFilterProp="children"
- :filterOption="filterOption"
- allow-clear
- @change="getMediaList"
- >
- <a-select-option
- :value="item.id"
- v-for="(item, index) of productNewList"
- :key="index"
- >
- {{ item.name }}
- </a-select-option>
- </a-select>
- </a-form-model-item>
- <a-form-model-item label="媒体" prop="paymentMedia">
- <a-select
- v-model="queryByIdList.paymentMedia"
- placeholder="请选择媒体"
- showSearch
- optionFilterProp="children"
- :filterOption="filterOption"
- allow-clear
- @change="getProjectList"
- >
- <a-select-option
- :value="item.name"
- v-for="(item, index) of mediaList"
- :key="index"
- >
- {{ item.name | paymentMediaName }}
- </a-select-option>
- </a-select>
- <p v-if="rebateData" style="margin-bottom: 0">
- 返点类型:{{
- rebateData.rebateType == 1 ? "返货" : "返现"
- }}
- 返点比例:{{
- rebateData.rebateRate
- }}%
- </p>
- </a-form-model-item>
- <a-form-model-item label="可用金额" prop="totalAmount">
- {{ totalAmount ? allMoney(totalAmount) : "-" }}
- </a-form-model-item>
- <a-form-model-item label="类型" prop="rechargeType">
- <a-select
- v-model="queryByIdList.rechargeType"
- placeholder="请选择类型"
- allow-clear
- >
- <a-select-option :value="1">充值</a-select-option>
- <a-select-option :value="2">自运营充值</a-select-option>
- </a-select>
- </a-form-model-item>
- <a-form-model-item label="项目" prop="projectId">
- <a-select
- v-model="queryByIdList.projectId"
- placeholder="请选择项目"
- showSearch
- optionFilterProp="children"
- :filterOption="filterOption"
- allow-clear
- @change="getAccountList"
- >
- <a-select-option
- :value="item.id"
- v-for="(item, index) of projectList"
- :key="index"
- >
- {{ item.name }}
- </a-select-option>
- </a-select>
- <a @click="addAccount">添加账户</a>
- </a-form-model-item>
- <div
- v-for="(item, index) in queryByIdList.accountList"
- style="position: relative"
- >
- <a-form-model-item
- label="选择账户"
- :prop="'accountList.' + index + '.accountId'"
- :rules="[{ required: true, message: '请选择账户', trigger: 'change' }]"
- v-if="queryByIdList.rechargeType == 1"
- >
- <a-select
- v-model="item.accountId"
- placeholder="请选择账户"
- showSearch
- optionFilterProp="children"
- :filterOption="filterOption"
- allow-clear
- @change="getAccountInfo($event, item)"
- >
- <a-select-option
- :value="item.id"
- v-for="(item, index) of accountList"
- :key="index"
- >
- {{ item.name }}
- </a-select-option>
- </a-select>
- <p v-if="!!item.accountMoney">账户余额:{{ allMoney(item.accountMoney) }}</p>
- </a-form-model-item>
- <a-form-model-item
- label="账户"
- :prop="'accountList.' + index + '.accountId'"
- :rules="[{ required: true, message: '请填写账户', trigger: 'blur' }]"
- v-else-if="queryByIdList.rechargeType == 2"
- >
- <a-input placeholder="请输入账户" v-model.number="item.accountId"></a-input>
- </a-form-model-item>
- <a-form-model-item
- label="到账金额"
- prop="receivedAmount"
- :prop="'accountList.' + index + '.receivedAmount'"
- :rules="[{ required: true, message: '请输入到账金额', trigger: 'blur' }]"
- >
- <a-input-number
- v-model="item.receivedAmount"
- :step="0.01"
- :precision="2"
- :min="0"
- @change="editMoneyNew($event, 1, index)"
- />
- </a-form-model-item>
- <a-form-model-item
- label="到账金额"
- prop="receivedAmount"
- :prop="'accountList.' + index + '.receivedAmount'"
- :rules="[{ required: true, message: '请输入到账金额', trigger: 'blur' }]"
- >
- <a-input-number
- v-model="item.receivedAmount"
- :step="0.01"
- :precision="2"
- :min="0"
- @change="editMoneyNew($event, 1, index)"
- />
- </a-form-model-item>
- <a-form-model-item
- label="现金金额"
- prop="cashAmount"
- :prop="'accountList.' + index + '.cashAmount'"
- :rules="[{ required: true, message: '请输入现金金额', trigger: 'blur' }]"
- >
- <a-input-number
- v-model="item.cashAmount"
- :step="0.01"
- :precision="2"
- :min="0"
- @change="editMoneyNew($event, 2, index)"
- />
- </a-form-model-item>
- <a
- v-if="index > 0"
- style="position: absolute; right: 0; top: 0; z-index: 10"
- @click="removeAccount(index)"
- >删除</a
- >
- </div>
- </a-form-model>
- <div solt="footer" style="display: flex; justify-content: end">
- <div>
- <a-button
- type="primary"
- class="cancel-btn"
- @click="handleAuditSure"
- style="margin: 0 10px"
- >确定</a-button
- >
- </div>
- <div>
- <a-button type="default" class="cancel-btn" @click="handleAuditCancel"
- >取消</a-button
- >
- </div>
- </div>
- </a-modal>
- <!-- 操作记录 -->
- <a-modal
- v-if="logVisible"
- title="操作记录"
- :visible="logVisible"
- @cancel="logVisible = false"
- :footer="null"
- v-dialog-drag
- >
- <div style="height: 400px; overflow: auto; padding: 15px">
- <a-steps
- progress-dot
- direction="vertical"
- v-model="logActive"
- style="width: 100%"
- disbaled
- >
- <a-step
- :title="`${item.roleName}(${item.userName})${
- item.auditStatus == '0'
- ? '创建申请'
- : item.auditStatus == -1
- ? '退回修改'
- : item.auditStatus == '3'
- ? '审核通过'
- : item.auditStatus == '4'
- ? '临时通过'
- : item.auditStatus == '5'
- ? '审核拒绝'
- : item.auditStatus == '1'
- ? '待审核'
- : '-'
- }`"
- :description="`${item.time}`"
- v-for="(item, index) in logList"
- :key="index"
- disabled
- :class="{ endStatus: item.auditStatus == 3 }"
- />
- </a-steps>
- </div>
- </a-modal>
- </div>
- </template>
- <script>
- import moment from "moment";
- import Vue from "vue";
- import { ACCESS_TOKEN } from "@/store/mutation-types";
- import { getAction, postAction, downFile } from "@/api/manage";
- import { mapGetters } from "vuex";
- import { urlAcount } from "./policy-management-server.js";
- import uploadFile from "@/components/uploadFile.vue";
- const fileSuffix = ["xlsx", "xls"];
- import JTreeSelect from "@/components/jeecg/JTreeSelect";
- function allMoney(num, n) {
- n = n || 2;
- let symbol = ",";
- if (num === null) return num;
- if (typeof num !== "number") throw new TypeError("num参数应该是一个number类型");
- if (n < 0) throw new Error("参数n不应该小于0");
- let hasDot = parseInt(num) != num; //这里检测num是否为小数,true表示小数
- let m = n != undefined && n != null ? n : 1;
- num =
- m == 0 ? num.toFixed(m) + "." : hasDot ? (n ? num.toFixed(n) : num) : num.toFixed(m);
- symbol = symbol || ",";
- num = num.toString().replace(/(\d)(?=(\d{3})+\.)/g, function (match, p1, p2) {
- return p1 + symbol;
- });
- if (n == 0 || (!hasDot && !n)) {
- //如果n为0或者传入的num是整数并且没有指定整数的保留位数,则去掉前面操作中的小数位
- num = num.substring(0, num.indexOf("."));
- }
- return num;
- }
- export default {
- name: "policy-management",
- data() {
- let handleCharacterLen30 = (rule, value, callback) => {
- this.handleExportRules(value, 1, 30, callback);
- };
- let handleCharacterLen100 = (rule, value, callback) => {
- this.handleDescRules(value, 5, 100, callback);
- };
- return {
- list: [],
- productList: [],
- advertiserList: [],
- productNewList: [],
- projectList: [],
- mediaList: [],
- accountList: [],
- totalAmount: undefined,
- rebateData: undefined,
- paymentTypeDisable: true,
- writeRebate: false,
- showRebate: false,
- oldData: undefined,
- mode2: ["month", "month"],
- confirmLoading: false,
- controlLoading: false,
- logVisible: false,
- logStatus: 0,
- logActive: 2,
- logList: [],
- allSaleListOption: [],
- dataDimensionList: [],
- creativeMediaOptions: [
- {
- id: "",
- name: "不限",
- },
- {
- id: 1,
- name: "头条",
- },
- {
- id: 2,
- name: "快手",
- },
- {
- id: 7,
- name: "磁力金牛",
- },
- {
- id: 9,
- name: "广点通",
- },
- ],
- searchStatusOptions: [
- {
- id: 1,
- name: "待审核",
- },
- {
- id: 3,
- name: "审核通过",
- },
- {
- id: 4,
- name: "临时通过",
- },
- {
- id: 5,
- name: "审核拒绝",
- },
- ],
- subTitleMsgStatus: false,
- remarksStatus: false,
- changeRules: [
- { required: true, message: "请输入产品名称", trigger: "blur" },
- { validator: handleCharacterLen30, trigger: "blur" },
- ],
- addType: "add",
- labelCol: { span: 4 },
- wrapperCol: { span: 16 },
- rejectAuditStatus: false,
- rejectionReasonStatus: false,
- auditPolicyStatus: false,
- policyOperationStatus: false,
- voidOperationStatus: false,
- totalAll: 0,
- policyOperationForm: {},
- voidId: undefined,
- reasonForm: {
- desc: "",
- },
- // queryByIdListRules:{
- // },
- policyOperationRules: {
- advertiserId: [{ required: true, message: "请选择客户", trigger: "change" }],
- productId: [{ required: true, message: "请选择产品", trigger: "change" }],
- paymentMedia: [{ required: true, message: "请选择投放媒体", trigger: "change" }],
- paymentType: [{ required: true, message: "请选择类型", trigger: "change" }],
- rebateType: [{ required: true, message: "请选择返点类型", trigger: "change" }],
- rebateRate: [{ required: true, message: "请填写返点比例", trigger: "blur" }],
- displayAmount: [{ required: true, message: "请填写垫款金额", trigger: "blur" }],
- cashAmount: [{ required: true, message: "请填写现金金额", trigger: "blur" }],
- paymentPort: [{ required: true, message: "请选择端口", trigger: "change" }],
- rechargeType: [{ required: true, message: "请选择类型", trigger: "change" }],
- projectId: [{ required: true, message: "请选择项目", trigger: "change" }],
- },
- queryByIdList: {
- accountList: [],
- },
- dataSource: [],
- okType: 3,
- columns: [
- {
- title: "客户名称",
- align: "center",
- dataIndex: "advertiserName",
- width: 250,
- },
- {
- title: "产品名称",
- align: "center",
- dataIndex: "productName",
- width: 200,
- },
- {
- title: "预付款/垫款",
- align: "center",
- dataIndex: "paymentType",
- width: 100,
- customRender(t) {
- if (t == "1") {
- return "预付款";
- } else if (t == "2") {
- return "垫款";
- }
- },
- // scopedSlots: { customRender: "media" },
- },
- {
- title: "媒体",
- align: "center",
- dataIndex: "paymentMedia",
- width: 100,
- customRender(t) {
- if (t == "1") {
- return "头条";
- } else if (t == "2") {
- return "快手";
- } else if (t == "7") {
- return "磁力金牛";
- } else if (t == "9") {
- return "广点通";
- }
- },
- },
- {
- title: "端口",
- align: "center",
- dataIndex: "paymentPort",
- ellipsis: true,
- width: 100,
- customRender(t) {
- if (t == "1") {
- return "汇创";
- } else if (t == "2") {
- return "骄阳";
- } else if (t == "3") {
- return "江西五六七";
- } else if (t == "4") {
- return "北京五六七";
- }
- },
- },
- {
- title: "现金金额",
- dataIndex: "cashAmount",
- align: "center",
- width: 100,
- customRender(t) {
- if (t) {
- return allMoney(t);
- } else {
- return "-";
- }
- },
- },
- {
- title: "账显金额",
- dataIndex: "displayAmount",
- align: "center",
- width: 100,
- customRender(t) {
- if (!!t) {
- return allMoney(t);
- } else {
- return "-";
- }
- },
- },
- {
- title: "返点类型",
- dataIndex: "rebateType",
- align: "center",
- width: 100,
- customRender(t) {
- if (t == "1") {
- return "返货";
- } else if (t == "2") {
- return "返现";
- }
- },
- },
- {
- title: "返点",
- dataIndex: "rebateRate",
- align: "center",
- width: 100,
- },
- {
- title: "备注",
- align: "center",
- dataIndex: "remarks",
- customRender(t) {
- if (!!t) {
- return t;
- } else {
- return "-";
- }
- },
- width: 250,
- },
- {
- title: "操作",
- dataIndex: "action",
- align: "center",
- width: 250,
- fixed: "right",
- scopedSlots: { customRender: "action" },
- },
- ],
- configForm: {
- advertiserName: undefined,
- productName: undefined,
- paymentMedia: undefined,
- time: [],
- rebateType: undefined,
- },
- tablePag: {
- page: 1,
- size: 10,
- },
- addAreaList: [],
- saleShowOption: [],
- addSubjectList: [],
- rejectionReasonList: {},
- tableOnlyId: "",
- saleVisible: false,
- saleInfoList: [],
- salePersonList: [],
- saleLoading: false,
- toLeaderVisible: false,
- exportLoading: false,
- lookImageVisible: false,
- lookImageData: null,
- searchForm: this.$form.createForm(this),
- loadDisabled: false,
- };
- },
- components: {
- JTreeSelect,
- uploadFile,
- },
- created() {},
- mounted() {
- this.handleInitTable();
- // this.handleGetAllSaleList();
- // this.handleAddGetArea();
- },
- methods: {
- lookImageClick(item) {
- this.lookImageVisible = true;
- this.lookImageData = item;
- },
- getList() {
- var params = {};
- this.getAction("/financePayment/application/getAdvertisers", params)
- .then((res) => {
- if (res.success) {
- console.log(res);
- this.list = res.result;
- } else {
- this.$message.warning(res.message);
- }
- })
- .finally(() => {});
- },
- getProductList(ids) {
- this.$set(this.policyOperationForm, "productId", undefined);
- this.$set(this.policyOperationForm, "rebateType", undefined);
- this.$set(this.policyOperationForm, "rebateRate", undefined);
- this.$set(this.policyOperationForm, "paymentType", undefined);
- if (!!ids) {
- var params = {};
- params.ids = ids.key;
- this.getAction("/financePayment/application/getProductByAdvertiserIds", params)
- .then((res) => {
- if (res.success) {
- this.productList = res.result;
- } else {
- this.$message.warning(res.message);
- }
- })
- .finally(() => {});
- } else {
- this.productList = [];
- }
- },
- getInfo(type) {
- if (!!type) {
- var params = {};
- params.type = this.policyOperationForm.paymentMedia;
- params.advertiserName = this.policyOperationForm.advertiserId.label
- .replace(/[\r\n]/g, "")
- .replace(/(^\s*)|(\s*$)/g, "");
- params.productName = type.label
- .replace(/[\r\n]/g, "")
- .replace(/(^\s*)|(\s*$)/g, "");
- // advertiserName = 广州小迈网络科技有限公司 & productName = 吉祥来电秀 & type = 2;
- this.getAction("/financePayment/application/queryCwjsPolicyInfo", params)
- .then((res) => {
- if (res.success) {
- // this.productList = res.result;
- if (!!res.result) {
- var nowDate = new Date().getTime();
- var checkDate = new Date(res.result.policyEndDate).getTime();
- if (nowDate > checkDate) {
- this.writeRebate = true;
- this.showRebate = false;
- this.$set(this.policyOperationForm, "rebateType", undefined);
- this.$set(this.policyOperationForm, "rebateRate", undefined);
- this.$set(this.policyOperationForm, "paymentType", undefined);
- this.$set(this.policyOperationForm, "displayAmount", undefined);
- this.$set(this.policyOperationForm, "cashAmount", undefined);
- } else {
- this.writeRebate = false;
- this.showRebate = true;
- this.oldData = res.result.advancePay == 1 ? 1 : 2;
- this.$set(
- this.policyOperationForm,
- "rebateType",
- res.result.rebateType
- );
- this.$set(
- this.policyOperationForm,
- "rebateRate",
- res.result.rebateRate
- );
- this.$set(
- this.policyOperationForm,
- "paymentType",
- res.result.advancePay == 1 ? 1 : 2
- );
- this.$set(this.policyOperationForm, "displayAmount", undefined);
- this.$set(this.policyOperationForm, "cashAmount", undefined);
- }
- } else {
- this.writeRebate = true;
- this.showRebate = false;
- this.$set(this.policyOperationForm, "rebateType", undefined);
- this.$set(this.policyOperationForm, "rebateRate", undefined);
- this.$set(this.policyOperationForm, "paymentType", undefined);
- this.$set(this.policyOperationForm, "displayAmount", undefined);
- this.$set(this.policyOperationForm, "cashAmount", undefined);
- }
- } else {
- this.$message.warning(res.message);
- }
- })
- .finally(() => {});
- } else {
- this.showRebate = false;
- this.$set(this.policyOperationForm, "rebateType", undefined);
- this.$set(this.policyOperationForm, "rebateRate", undefined);
- this.$set(this.policyOperationForm, "paymentType", undefined);
- this.$set(this.policyOperationForm, "displayAmount", undefined);
- this.$set(this.policyOperationForm, "cashAmount", undefined);
- }
- },
- changEditStatus() {
- if (this.policyOperationForm.paymentType == 2) {
- this.paymentTypeDisable = true;
- } else {
- }
- },
- editMoney(value, type) {
- console.log(value);
- if (type == 1 && !!this.policyOperationForm.rebateRate) {
- this.$set(
- this.policyOperationForm,
- "cashAmount",
- this.policyOperationForm.rebateType == 1
- ? (value / (1 + this.policyOperationForm.rebateRate / 100)).toFixed(2)
- : (value * (1 - this.policyOperationForm.rebateRate / 100)).toFixed(2)
- );
- } else if (type == 2 && !!this.policyOperationForm.rebateRate) {
- this.$set(
- this.policyOperationForm,
- "displayAmount",
- this.policyOperationForm.rebateType == 1
- ? (value * (1 + this.policyOperationForm.rebateRate / 100)).toFixed(2)
- : (value / (1 - this.policyOperationForm.rebateRate / 100)).toFixed(2)
- );
- } else {
- this.$message.error("暂未填写返点比例");
- }
- },
- ...mapGetters(["userInfo"]),
- moment,
- handleAdd() {
- this.policyOperationStatus = true;
- this.getList();
- },
- getNewAdvertiserList() {
- var params = {
- table: "finance_payment_pool,advertiser_id,advertiser_name",
- groupBy: "advertiser_id",
- };
- this.postDataAction("/financePayment/pool/querySheetIdAndNameList", params)
- .then((res) => {
- if (res.success) {
- this.advertiserList = res.result;
- } else {
- this.$message.warning(res.message);
- }
- })
- .finally(() => {});
- },
- getNewProductList(value) {
- this.$set(this.queryByIdList, "productId", undefined);
- this.$set(this.queryByIdList, "paymentMedia", undefined);
- this.$set(this.queryByIdList, "projectId", undefined);
- this.queryByIdList.accountList = [];
- if (!!value) {
- var params = {
- table: "finance_payment_pool,product_id,product_name",
- groupBy: "product_id",
- paramters: [
- {
- paramter: "advertiser_id",
- value: value,
- },
- ],
- };
- this.postDataAction("/financePayment/pool/querySheetIdAndNameList", params)
- .then((res) => {
- if (res.success) {
- this.productNewList = res.result;
- } else {
- this.$message.warning(res.message);
- }
- })
- .finally(() => {});
- }
- },
- getMediaList(value) {
- this.$set(this.queryByIdList, "paymentMedia", undefined);
- this.$set(this.queryByIdList, "projectId", undefined);
- this.queryByIdList.accountList = [];
- var params = {
- table: "finance_payment_pool,product_id,payment_media",
- groupBy: "payment_media",
- paramters: [
- {
- paramter: "advertiser_id",
- value: this.queryByIdList.advertiserId,
- },
- {
- paramter: "product_id",
- value: value,
- },
- ],
- };
- this.postDataAction("/financePayment/pool/querySheetIdAndNameList", params)
- .then((res) => {
- if (res.success) {
- this.mediaList = res.result;
- } else {
- this.$message.warning(res.message);
- }
- })
- .finally(() => {});
- },
- getProjectList(value) {
- this.$set(this.queryByIdList, "projectId", undefined);
- this.queryByIdList.accountList = [];
- if (!!value) {
- var params = {
- advertiserId: this.queryByIdList.advertiserId,
- type: this.queryByIdList.paymentMedia,
- productId: this.queryByIdList.productId,
- };
- this.getMoney(params);
- this.getRebate(params);
- this.getAction("/financePayment/pool/queryPoolProjectList", params)
- .then((res) => {
- if (res.success) {
- this.projectList = res.result;
- } else {
- this.$message.warning(res.message);
- }
- })
- .finally(() => {});
- } else {
- }
- },
- getMoney(params) {
- // var params = {
- // advertiserId: this.queryByIdList.advertiserId,
- // type: this.queryByIdList.paymentMedia,
- // productId: this.queryByIdList.paymentMedia,
- // };
- this.getAction("/financePayment/pool/queryPool", params)
- .then((res) => {
- if (res.success) {
- this.totalAmount = res.result ? res.result.cashAmount : 0;
- } else {
- this.$message.warning(res.message);
- }
- })
- .finally(() => {});
- },
- getRebate(params) {
- // var params = {
- // advertiserId: this.queryByIdList.advertiserId,
- // type: this.queryByIdList.paymentMedia,
- // productId: this.queryByIdList.paymentMedia,
- // };
- this.getAction("/financePayment/application/queryInfo", params)
- .then((res) => {
- if (res.success) {
- this.rebateData = res.result;
- } else {
- this.$message.warning(res.message);
- }
- })
- .finally(() => {});
- },
- getAccountList() {
- this.queryByIdList.accountList = [];
- var params = {
- table: "ctop_user_allocation,account_id,auth_name",
- groupBy: "account_id",
- paramters: [
- {
- paramter: "media_id",
- value: this.queryByIdList.paymentMedia,
- },
- // {
- // paramter: "advertiser_id",
- // value: this.queryByIdList.advertiserId,
- // },
- {
- paramter: "project_id",
- value: this.queryByIdList.projectId,
- },
- // {
- // paramter: "product_id",
- // value: this.queryByIdList.productId,
- // },
- ],
- };
- this.postDataAction("/financePayment/pool/querySheetIdAndNameList", params)
- .then((res) => {
- if (res.success) {
- this.accountList = res.result;
- } else {
- this.$message.warning(res.message);
- }
- })
- .finally(() => {});
- },
- removeAccount(index) {
- this.queryByIdList.accountList.splice(index, 1);
- },
- addAccount() {
- this.queryByIdList.accountList.push({
- accountId: undefined,
- cashAmount: undefined,
- receivedAmount: undefined,
- rebateType: undefined,
- rebateRate: undefined,
- accountMoney: undefined,
- });
- },
- getAccountInfo(value, item) {
- if (!!value) {
- var params = {
- media: this.queryByIdList.paymentMedia,
- accountId: value,
- };
- this.getAction("/financePayment/pool/queryAccountBalance", params)
- .then((res) => {
- if (res.success) {
- item.accountMoney = res.result;
- } else {
- this.$message.warning(res.message);
- }
- })
- .finally(() => {});
- } else {
- }
- },
- handleAddPleace() {
- this.auditPolicyStatus = true;
- this.getNewAdvertiserList();
- },
- handleFilterOption(input, option) {
- return (
- option.componentOptions.children[0].text
- .toLowerCase()
- .indexOf(input.toLowerCase()) >= 0
- );
- },
- filterOption(input, option) {
- return (
- option.componentOptions.children[0].text
- .toLowerCase()
- .indexOf(input.toLowerCase()) >= 0
- );
- },
- handleAddTimesChange(date, dateString) {
- this.policyOperationForm.addTimes = dateString;
- },
- showAreaInfo(data) {
- if (data) {
- var dataShow = this.saleShowOption.filter((item) => {
- return item.saleId == data;
- });
- this.policyOperationForm.areaInfo = dataShow[0].nickName;
- } else {
- this.policyOperationForm.areaInfo = undefined;
- }
- },
- handleAddGetArea(data) {
- const paramsData = {
- userId: this.userInfo().id,
- };
- getAction(urlAcount + "/finance/cwjsPolicyInfo/queryAeraByUserId", paramsData)
- .then((result) => {
- if (result.code === 0) {
- const defaultList = result.result[0].UserCompany;
- this.saleShowOption = defaultList.map((item) => {
- return {
- saleId: item.userId,
- saleName: item.userName,
- };
- });
- this.addAreaList = defaultList[0].nickName.split(",");
- this.addSubjectList = result.result[0].companySubjects;
- getAction(
- urlAcount + "/finance/cwjsSaleAssistantInfo/getCwSaleAndAssistantList",
- paramsData
- )
- .then((result) => {
- if (result.code === 0) {
- for (let i = 0; i < result.result.length; i++) {
- if (this.saleShowOption[0].saleId == result.result[i].saleId) {
- } else {
- this.saleShowOption.push(result.result[i]);
- }
- }
- } else {
- this.$message.error(result.message);
- }
- })
- .catch((error) => {
- console.log(error, "eeee");
- });
- } else {
- this.$message.error(result.message);
- }
- })
- .catch((error) => {
- console.log(error, "eeee");
- });
- },
- handleExamineAll(data) {
- // const paramsData = {
- // id: data.id,
- // type: data.type,
- // userId: this.userInfo().id,
- // approvalContent: data.value,
- // };
- this.postDataAction("/financePayment/application/updateStatus", data)
- .then((result) => {
- if (result.code === 200) {
- this.rejectAuditStatus = false;
- this.auditPolicyStatus = false;
- this.handleInitTable();
- this.$message.success(result.message);
- } else {
- this.$message.error(result.message);
- }
- })
- .catch((error) => {
- console.log(error, "eeee");
- });
- },
- // 获取所有的媒体 枚举值
- handleGetAllSaleList() {
- const paramsData = {
- userId: this.userInfo().id,
- };
- getAction(
- urlAcount + "/finance/cwjsSaleAssistantInfo/getSaleListByUserDepart",
- paramsData
- )
- .then((result) => {
- if (result.success) {
- this.allSaleListOption = result.result || [];
- } else {
- this.$message.error(result.message);
- }
- })
- .catch((error) => {
- console.log(error, "eeee");
- });
- },
- showLog(item) {
- this.logVisible = true;
- getAction("/financePayment/application/queryAuditProcess", { id: item.id })
- .then((result) => {
- if (result.code === 200) {
- this.logList = result.result;
- this.logActive = this.logList.length - 1;
- } else {
- this.$message.error(result.message);
- }
- })
- .catch((error) => {
- console.log(error, "eeee");
- })
- .finally(() => {});
- },
- // 获取默认的列表数据
- handleInitTable() {
- this.controlLoading = true;
- const paramsData = {
- userId: this.userInfo().id,
- advertiserName: this.configForm.advertiserName,
- productName: this.configForm.productName,
- paymentMedia: this.configForm.paymentMedia,
- rebateType: this.configForm.rebateType,
- startDate:
- this.configForm.time && this.configForm.time.length == 2
- ? moment(this.configForm.time[0]).format("YYYY-MM-DD")
- : null,
- endDate:
- this.configForm.time && this.configForm.time.length == 2
- ? moment(this.configForm.time[1]).format("YYYY-MM-DD")
- : null,
- pageNo: this.tablePag.page,
- pageSize: this.tablePag.size,
- };
- getAction("/financePayment/pool/list", paramsData)
- .then((result) => {
- if (result.success == true) {
- let defaultList = result.result.records;
- this.dataSource = defaultList;
- this.totalAll = result.result.total;
- } else {
- this.dataSource = [];
- this.tablePag.page = 1;
- this.totalAll = 0;
- this.$message.error(result.message);
- }
- })
- .catch((error) => {
- console.log(error, "eeee");
- })
- .finally(() => {
- this.controlLoading = false;
- });
- },
- overUpload(urlAll) {
- console.log(urlAll);
- },
- handleRemarksChange(e) {
- const targetVal = e.target.value;
- let cnReg = /([\u4e00-\u9fa5]|[\u3000-\u303F]|[\uFF00-\uFF60])/;
- let length = 0;
- let strArr = targetVal.split("");
- strArr.forEach((item) => {
- if (cnReg.test(item)) {
- length += 2;
- } else {
- length += 1;
- }
- });
- if (1 <= length && length <= 500) {
- this.remarksStatus = false;
- } else {
- this.remarksStatus = true;
- }
- },
- handleGroupAbbreviationChange(e) {
- const targetVal = e.target.value;
- let cnReg = /([\u4e00-\u9fa5]|[\u3000-\u303F]|[\uFF00-\uFF60])/;
- let length = 0;
- let strArr = targetVal.split("");
- strArr.forEach((item) => {
- if (cnReg.test(item)) {
- length += 2;
- } else {
- length += 1;
- }
- });
- if (1 <= length && length <= 60) {
- this.subTitleMsgStatus = false;
- } else {
- this.subTitleMsgStatus = true;
- }
- },
- disabledDate(current) {
- return current > moment().subtract(1, "day");
- },
- handleAddOrigin() {
- const randomNum = new Date().getTime() + Math.ceil(Math.random() * 1000);
- this.policyOperationForm.defaultFormList.push({
- id: randomNum,
- value: "",
- });
- },
- handleDelOrigin(list) {
- if (this.policyOperationForm.defaultFormList.length === 1) {
- return;
- }
- let formData = this.policyOperationForm.defaultFormList;
- this.policyOperationForm.defaultFormList = formData.filter(
- (item) => list.id !== item.id
- );
- },
- handleIsDianPayChange(e) {
- if (e.target.value === 0) {
- this.policyOperationForm.dianPayCompanyName = "";
- this.policyOperationForm.dianPayCompanyRebateRate = 0;
- }
- },
- handlePrepaidNotChange(e) {
- if (e.target.value === 1) {
- this.policyOperationForm.accountingPeriod = "";
- this.policyOperationForm.dianPayCompanyName = "";
- this.policyOperationForm.dianPayCompanyRebateRate = 0;
- this.policyOperationForm.isDianPay = undefined;
- } else if (e.target.value === 0) {
- this.policyOperationForm.isDianPay = 0;
- }
- },
- handleExportRules(value, min, max, callback) {
- let cnReg = /([\u4e00-\u9fa5]|[\u3000-\u303F]|[\uFF00-\uFF60])/;
- let length = 0;
- let strArr = value.split("");
- strArr.forEach((item) => {
- if (cnReg.test(item)) {
- length += 2;
- } else {
- length += 1;
- }
- });
- if (min * 2 <= length && length <= max * 2) {
- callback();
- } else {
- callback(`只能输入${min}-${max}个汉字`);
- }
- },
- handleDescRules(value, min, max, callback) {
- let cnReg = /([\u4e00-\u9fa5]|[\u3000-\u303F]|[\uFF00-\uFF60])/;
- let length = 0;
- let strArr = value.split("");
- strArr.forEach((item) => {
- if (cnReg.test(item)) {
- length += 2;
- } else {
- length += 1;
- }
- });
- if (min <= length && length <= max) {
- callback();
- } else {
- callback(`只能输入${min}-${max}个字符`);
- }
- },
- // 分页操作按钮
- handleOnShowSizeChange(current, pageSize) {
- this.tablePag = {
- page: current,
- size: pageSize,
- };
- this.handleInitTable();
- },
- //作废操作
- handleVoid(list) {
- this.voidOperationStatus = true;
- this.voidId = list.id;
- },
- // 编辑按钮操作
- handleEditTable(list) {
- this.addType = "edit";
- this.policyOperationStatus = true;
- this.queryByIdList = list;
- this.policyOperationForm = {
- ...list,
- advertiserId: { key: list.advertiserId, label: list.advertiserName },
- productId: { key: list.productId, label: list.productName },
- files: list.files == "-" ? undefined : JSON.parse(list.files),
- };
- this.getList();
- this.getProductList({ key: list.advertiserId, label: list.advertiserName });
- this.getInfo({ key: list.productId, label: list.productName });
- setTimeout(() => {
- this.$set(this.policyOperationForm, "advertiserId", {
- key: list.advertiserId,
- label: list.advertiserName,
- });
- this.$set(this.policyOperationForm, "productId", {
- key: list.productId,
- label: list.productName,
- });
- this.$set(this.policyOperationForm, "paymentMedia", +list.paymentMedia);
- this.$set(this.policyOperationForm, "paymentPort", +list.paymentPort);
- this.$set(this.policyOperationForm, "cashAmount", list.cashAmount);
- this.$set(this.policyOperationForm, "displayAmount", list.displayAmount);
- this.$set(this.policyOperationForm, "rebateType", +list.rebateType);
- this.$set(this.policyOperationForm, "rebateRate", list.rebateRate);
- this.$set(
- this.policyOperationForm,
- "files",
- list.files == "-" ? undefined : JSON.parse(list.files)
- );
- this.$set(this.policyOperationForm, "remarks", list.remarks);
- this.$set(this.policyOperationForm, "paymentType", +list.paymentType);
- }, 500);
- // this.policyOperationForm = Object.assign({}, list);
- },
- // 新增政策按钮
- handleAddAccountPolicy() {
- this.$router.replace({
- path: "/policy-management/reimbursementAdd?type=add",
- });
- },
- // 新增政策确定按钮
- handlePolicyOperationSure() {
- this.$refs.policyOperationForm.validate((valid) => {
- if (valid) {
- const paramsData = {
- ...this.policyOperationForm,
- applicanterId: this.userInfo().id,
- userId: this.userInfo().id,
- productId: this.policyOperationForm.productId.key,
- advertiserId: this.policyOperationForm.advertiserId.key,
- displayAmount:
- this.policyOperationForm.paymentType == 2
- ? this.policyOperationForm.displayAmount
- : 0,
- temporaryAdvances: !!this.oldData
- ? this.oldData == 1 && this.policyOperationForm.paymentType == 2
- ? 1
- : 0
- : 0,
- };
- this.confirmLoading = true;
- if (this.addType === "add") {
- this.handleAddSureBtn(paramsData, "/financePayment/application/add");
- } else {
- this.handleAddSureBtn({ ...paramsData }, "/financePayment/application/edit");
- }
- } else {
- return false;
- }
- });
- },
- handleAddSureBtn(data, url) {
- postAction(url, data)
- .then((result) => {
- if (result.code === 200) {
- this.$message.success(result.message);
- this.oldData = undefined
- this.handlePolicyOperationCancel();
- this.handleAuditCancel();
- this.handleInitTable();
- } else {
- this.$message.error(result.message);
- }
- })
- .catch((error) => {
- console.log(error, "eeee");
- })
- .finally(() => {
- this.confirmLoading = false;
- });
- },
- // 新增政策取消按钮
- handlePolicyOperationCancel() {
- this.policyOperationForm = {};
- this.policyOperationStatus = false;
- this.confirmLoading = false;
- this.writeRebate = false;
- this.showRebate = false;
- },
- // 审核拒绝确定按钮
- handleRejectSure() {
- this.$refs.rejectRuleForm.validate((valid) => {
- console.log(valid);
- if (valid) {
- const params = {
- id: this.tableOnlyId || this.queryByIdList.id,
- type: this.okType,
- value: this.reasonForm.desc,
- };
- this.handleExamineAll(params);
- this.handleRejectCancel();
- } else {
- return false;
- }
- });
- },
- //领导审核理由
- handleVoidOk() {
- this.$refs.rejectRuleForm.validate((valid) => {
- if (valid) {
- const params = {
- policyId: this.voidId,
- delReason: this.reasonForm.desc,
- };
- getAction(urlAcount + "/finance/cwjsPolicyInfo/toVoidpolicy", params)
- .then((result) => {
- if (result.code === 0) {
- this.voidOperationStatus = false;
- this.reasonForm.desc = undefined;
- this.handleInitTable();
- } else {
- this.$message.error(result.message);
- }
- })
- .catch((error) => {
- console.log(error, "eeee");
- })
- .finally(() => {
- this.voidOperationStatus = false;
- });
- } else {
- return false;
- }
- });
- },
- //领导审核理由
- handleLeader() {
- this.$refs.rejectRuleForm.validate((valid) => {
- if (valid) {
- const params = {
- id: this.tableOnlyId || this.queryByIdList.id,
- type: 4,
- value: this.reasonForm.desc,
- };
- this.handleExamineAll(params);
- this.handleRejectCancel();
- } else {
- return false;
- }
- });
- },
- // 审核拒绝取消按钮
- handleRejectCancel() {
- this.okType = 3;
- this.reasonForm.desc = "";
- this.rejectAuditStatus = false;
- this.toLeaderVisible = false;
- },
- handleToLog(item){
- localStorage.setItem('applicationLog',item.advertiserName)
- this.$router.replace('/policy-management/appRecharge')
- },
- // 查看的按钮
- handleDetail(list, type) {
- console.log(list)
- this.auditPolicyStatus = true;
- this.queryByIdList = { ...list, newFiles: undefined, type: type,accountList:[] };
-
- this.getNewAdvertiserList();
- this.$set(this.queryByIdList, "advertiserId", list.advertiserId);
- this.getNewProductList(this.queryByIdList.advertiserId);
- this.$set(this.queryByIdList, "productId", list.productId);
- this.getMediaList(this.queryByIdList.productId);
- this.$set(this.queryByIdList, "paymentMedia", list.paymentMedia);
- this.getProjectList(this.queryByIdList.paymentMedia);
- this.rebateData = { rebateType: list.rebateType, rebateRate: list.rebateRate };
- },
- // 查看的取消按钮
- handleCloseAuditPolicy() {
- this.auditPolicyStatus = false;
- },
- editMoneyNew(value, type, index) {
- if (type == 1 && !!this.rebateData && !!this.rebateData.rebateRate) {
- this.$set(
- this.queryByIdList.accountList[index],
- "cashAmount",
- this.rebateData.rebateType == 1
- ? (value / (1 + this.rebateData.rebateRate / 100)).toFixed(2)
- : (value * (1 - this.rebateData.rebateRate / 100)).toFixed(2)
- );
- } else if (type == 2 && !!this.rebateData && !!this.rebateData.rebateRate) {
- this.$set(
- this.queryByIdList.accountList[index],
- "receivedAmount",
- this.rebateData.rebateType == 1
- ? (value * (1 + this.rebateData.rebateRate / 100)).toFixed(2)
- : (value / (1 - this.rebateData.rebateRate / 100)).toFixed(2)
- );
- } else {
- this.$message.error("暂未返点比例");
- }
- },
- // 查看-审核政策-审核通过-按钮
- handleAuditSure(list) {
- this.$refs.queryByIdList.validate((valid) => {
- if (valid) {
- var that = this;
- var total = this.queryByIdList.accountList
- .map((item) => {
- return item.cashAmount;
- })
- .reduce((o, n) => {
- return +o + +n;
- }, 0);
- const paramsData = {
- ...this.queryByIdList,
- applicanterId: this.userInfo().id,
- userId: this.userInfo().id,
- totalAmount: total,
- financialReview: total > +that.totalAmount ? 1 : 0,
- list: this.queryByIdList.accountList.map((item) => {
- return {
- ...item,
- rebateType: this.rebateData ? this.rebateData.rebateType : null,
- rebateRate: this.rebateData ? this.rebateData.rebateRate : null,
- };
- }),
- };
- console.log(paramsData, that.totalAmount);
- this.confirmLoading = true;
- if (this.addType === "add") {
- this.handleAddSureBtn(paramsData, "/financePayment/rechargeApplication/add");
- } else {
- this.handleAddSureBtn(
- { ...paramsData },
- "/financePayment/rechargeApplication/edit"
- );
- }
- } else {
- return false;
- }
- });
- },
- okFour(data) {
- this.postDataAction("/financePayment/application/updateTemporaryFiles", data).then(
- (result) => {
- if (result.code === 200) {
- this.rejectAuditStatus = false;
- this.auditPolicyStatus = false;
- this.handleInitTable();
- this.$message.success(result.message);
- } else {
- this.$message.error(result.message);
- }
- }
- );
- },
- // 查看-审核政策-审核拒绝-按钮
- handleAuditCancel(data) {
- this.queryByIdList = { accountList: [] };
- this.rebateData = undefined;
- this.totalAmount = undefined;
- this.auditPolicyStatus = false;
- },
- handleSubmitEdit(list) {},
- // 被拒理由的操作
- handleRejectionReason(val) {
- this.rejectionReasonList = val;
- this.rejectionReasonStatus = true;
- },
- // 被拒理由确定按钮
- handleModeSure() {
- this.rejectionReasonStatus = false;
- },
- // 被拒理由取消按钮
- handleModeCancel() {
- this.rejectionReasonStatus = false;
- },
- // 搜索按钮
- handleQueryList() {
- this.tablePag = {
- page: 1,
- size: 10,
- };
- this.handleInitTable();
- },
- // 重置搜索
- handleResetList() {
- this.configForm = {
- companyId: undefined,
- userName: undefined,
- media: undefined,
- departId: undefined,
- time: [],
- status: undefined,
- type: undefined,
- };
- this.tablePag = {
- page: 1,
- size: 10,
- };
- this.handleInitTable();
- },
- },
- };
- </script>
- <style lang="less" scoped>
- @import "policy-management";
- </style>
|