appPoolList.vue 59 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856
  1. <style scoped>
  2. ::v-deep .margin-small .ant-row {
  3. margin-bottom: 0;
  4. }
  5. ::v-deep .ant-steps-dot .ant-steps-item-content {
  6. width: auto;
  7. }
  8. ::v-deep
  9. .ant-steps-dot
  10. .ant-steps-item-active
  11. .ant-steps-item-icon
  12. > .ant-steps-icon
  13. .ant-steps-icon-dot {
  14. background: rgb(11, 190, 135);
  15. width: 15px;
  16. height: 15px;
  17. /* margin-top: 5px; */
  18. margin-left: 2px;
  19. }
  20. ::v-deep .endStatus .ant-steps-item-icon > .ant-steps-icon .ant-steps-icon-dot {
  21. background: #1890ff !important;
  22. width: 15px;
  23. height: 15px;
  24. /* margin-top: 5px; */
  25. /* margin-left: 2px; */
  26. }
  27. ::v-deep .ant-steps-dot .ant-steps-item-icon {
  28. width: 15px;
  29. height: 15px;
  30. margin-top: 5px;
  31. margin-left: -4px;
  32. }
  33. </style>
  34. <template>
  35. <div class="policy-management-content">
  36. <div class="control-con-title">
  37. <div>
  38. <span class="policy-export-btn">垫款池子</span>
  39. </div>
  40. <div>
  41. <!-- <span class="add-acount-policy-btn">
  42. <a-button>快递信息</a-button>
  43. </span> -->
  44. <span class="add-acount-policy-btn">
  45. <a-button @click="handleAdd" type="primary">新增</a-button>
  46. </span>
  47. <span class="add-acount-policy-btn">
  48. <a-button @click="handleAddPleace" type="primary">充值申请</a-button>
  49. </span>
  50. </div>
  51. </div>
  52. <div class="control-con-header">
  53. <a-form class="grid-form" layout="inline" :form="searchForm" hide-required-mark>
  54. <a-row class="grid-form-options">
  55. <a-form-item class="grid-form-item" label="客户名称:" :colon="false">
  56. <!-- <a-input v-model="configForm.companyName" placeholder="请输入公司名称" allow-clear/> -->
  57. <a-input
  58. v-model="configForm.advertiserName"
  59. placeholder="请输入客户名称"
  60. allow-clear
  61. />
  62. </a-form-item>
  63. <a-form-item class="grid-form-item" label="产品名称:" :colon="false">
  64. <a-input
  65. v-model="configForm.productName"
  66. placeholder="请输入产品名称"
  67. allow-clear
  68. />
  69. </a-form-item>
  70. <a-form-item class="grid-form-item" label="媒体:" :colon="false">
  71. <a-select
  72. v-model="configForm.paymentMedia"
  73. style="width: 200px; margin-left: 10px"
  74. :filterOption="filterOption"
  75. showSearch
  76. allowClear
  77. placeholder="请选择媒体"
  78. >
  79. <a-select-option value="1"> 头条 </a-select-option>
  80. <a-select-option value="2"> 快手 </a-select-option>
  81. <a-select-option value="9"> 广点通 </a-select-option>
  82. <a-select-option value="7"> 磁力金牛 </a-select-option>
  83. </a-select>
  84. </a-form-item>
  85. <a-form-item class="grid-form-item" label="返点类型:" :colon="false">
  86. <a-select
  87. v-model="configForm.rebateType"
  88. style="width: 200px; margin-left: 10px"
  89. :filterOption="filterOption"
  90. showSearch
  91. allowClear
  92. placeholder="请选择返点类别"
  93. >
  94. <a-select-option value="1"> 返货 </a-select-option>
  95. <a-select-option value="2"> 返现 </a-select-option>
  96. </a-select>
  97. </a-form-item>
  98. <a-form-item class="grid-form-item" label="申请时间:" :colon="false">
  99. <a-range-picker
  100. v-model="configForm.time"
  101. format="YYYY-MM-DD"
  102. style="width: 100%"
  103. />
  104. </a-form-item>
  105. <a-form-item class="form-handle-btn">
  106. <a-button type="default" class="reset-class" @click="handleResetList"
  107. >重置</a-button
  108. >
  109. <a-button type="primary" @click="handleQueryList">搜索</a-button>
  110. </a-form-item>
  111. </a-row>
  112. </a-form>
  113. </div>
  114. <div class="control-con-table">
  115. <a-table
  116. ref="table"
  117. size="middle"
  118. bordered
  119. :columns="columns"
  120. :dataSource="dataSource"
  121. :pagination="false"
  122. :loading="controlLoading"
  123. :scroll="{ x: 1000 }"
  124. >
  125. <span slot="action" slot-scope="text, record">
  126. <a @click="handleDetail(record)">申请充值</a>
  127. <a-divider type="vertical" />
  128. <!-- record.status == '1' || -->
  129. <a @click="handleToLog(record)">申请列表</a>
  130. </span>
  131. </a-table>
  132. <a-pagination
  133. class="pagin-table-class"
  134. :total="totalAll"
  135. :show-total="(total) => `共 ${totalAll} 条`"
  136. size="small"
  137. show-size-changer
  138. show-quick-jumper
  139. v-model="tablePag.page"
  140. @change="handleOnShowSizeChange"
  141. @showSizeChange="handleOnShowSizeChange"
  142. />
  143. </div>
  144. <!-- 新增、编辑政策 -->
  145. <a-modal
  146. v-if="policyOperationStatus"
  147. :title="addType === 'add' ? '垫款/到账申请' : '编辑垫款/到账申请'"
  148. :visible="policyOperationStatus"
  149. :confirmLoading="confirmLoading"
  150. @ok="handlePolicyOperationSure"
  151. @cancel="handlePolicyOperationCancel"
  152. :width="650"
  153. >
  154. <div>
  155. <a-form-model
  156. ref="policyOperationForm"
  157. :model="policyOperationForm"
  158. :rules="policyOperationRules"
  159. :label-col="labelCol"
  160. :wrapper-col="wrapperCol"
  161. >
  162. <a-form-model-item label="媒体" prop="paymentMedia">
  163. <a-select
  164. v-model="policyOperationForm.paymentMedia"
  165. placeholder="请选择投放媒体"
  166. allow-clear
  167. >
  168. <a-select-option :value="1">头条</a-select-option>
  169. <a-select-option :value="2">快手</a-select-option>
  170. <a-select-option :value="7">磁力金牛</a-select-option>
  171. <a-select-option :value="9">广点通</a-select-option>
  172. </a-select>
  173. </a-form-model-item>
  174. <a-form-model-item label="客户名称" prop="advertiserId">
  175. <a-select
  176. labelInValue
  177. v-model="policyOperationForm.advertiserId"
  178. placeholder="请选择客户名称"
  179. showSearch
  180. optionFilterProp="children"
  181. :filterOption="filterOption"
  182. allow-clear
  183. @change="getProductList"
  184. >
  185. <a-select-option
  186. :value="item.advertiserIds"
  187. v-for="(item, index) of list"
  188. :key="index"
  189. >
  190. {{ item.advertiserName }}
  191. </a-select-option>
  192. </a-select>
  193. </a-form-model-item>
  194. <a-form-model-item label="选择产品" prop="productId">
  195. <a-select
  196. labelInValue
  197. v-model="policyOperationForm.productId"
  198. placeholder="请选择产品"
  199. showSearch
  200. optionFilterProp="children"
  201. :filterOption="filterOption"
  202. allow-clear
  203. @change="getInfo"
  204. >
  205. <a-select-option
  206. :value="item.productId"
  207. v-for="(item, index) of productList"
  208. :key="index"
  209. >
  210. {{ item.productName }}
  211. </a-select-option>
  212. </a-select>
  213. <p v-if="showRebate" style="margin-bottom: 0">
  214. 返点类型:{{
  215. policyOperationForm.rebateType == 1 ? "返货" : "返现"
  216. }}
  217. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 返点比例:{{
  218. policyOperationForm.rebateRate
  219. }}%
  220. </p>
  221. </a-form-model-item>
  222. <div v-if="writeRebate">
  223. <a-form-model-item label="返点类型" prop="rebateType">
  224. <a-select
  225. v-model="policyOperationForm.rebateType"
  226. placeholder="请选择类型"
  227. allow-clear
  228. >
  229. <a-select-option :value="1">返货</a-select-option>
  230. <a-select-option :value="2">返现</a-select-option>
  231. </a-select>
  232. </a-form-model-item>
  233. <a-form-model-item label="返点比例" prop="rebateRate">
  234. <a-input-number
  235. v-model="policyOperationForm.rebateRate"
  236. :step="0.01"
  237. :precision="2"
  238. />
  239. %
  240. </a-form-model-item>
  241. </div>
  242. <a-form-model-item label="类型" prop="paymentType">
  243. <a-select
  244. v-model="policyOperationForm.paymentType"
  245. placeholder="请选择类型"
  246. allow-clear
  247. style="width: 80%"
  248. :disabled="showRebate && policyOperationForm.paymentType == 2"
  249. >
  250. <a-select-option :value="1">预付款</a-select-option>
  251. <a-select-option :value="2">垫款</a-select-option>
  252. </a-select>
  253. </a-form-model-item>
  254. <a-form-model-item
  255. label="帐显金额"
  256. prop="displayAmount"
  257. v-if="policyOperationForm.paymentType == 2"
  258. >
  259. <a-input-number
  260. v-model="policyOperationForm.displayAmount"
  261. :step="0.01"
  262. :precision="2"
  263. :min="0"
  264. @change="editMoney($event, 1)"
  265. />
  266. </a-form-model-item>
  267. <a-form-model-item label="现金金额" prop="cashAmount">
  268. <a-input-number
  269. v-model="policyOperationForm.cashAmount"
  270. :step="0.01"
  271. :precision="2"
  272. :min="0"
  273. @change="editMoney($event, 2)"
  274. />
  275. </a-form-model-item>
  276. <a-form-model-item label="端口" prop="paymentPort">
  277. <a-select
  278. v-model="policyOperationForm.paymentPort"
  279. placeholder="请选择端口"
  280. allow-clear
  281. >
  282. <a-select-option :value="1">汇创</a-select-option>
  283. <a-select-option :value="2">骄阳</a-select-option>
  284. <a-select-option :value="3">江西五六七</a-select-option>
  285. <a-select-option :value="4">北京五六七</a-select-option>
  286. </a-select>
  287. </a-form-model-item>
  288. <a-form-model-item label="备注" prop="remarks">
  289. <a-textarea
  290. v-model="policyOperationForm.remarks"
  291. placeholder="请输入备注"
  292. allow-clear
  293. @change="handleRemarksChange"
  294. />
  295. </a-form-model-item>
  296. <a-form-model-item
  297. label="图片上传"
  298. prop="files"
  299. :rules="{
  300. required: writeRebate,
  301. message: '请上传图片',
  302. trigger: 'change',
  303. }"
  304. >
  305. <uploadFile
  306. :value.sync="policyOperationForm.files"
  307. :multiple="true"
  308. @overUpload="overUpload"
  309. :fileCount="10"
  310. :size="10240"
  311. uploadType="image"
  312. />
  313. </a-form-model-item>
  314. </a-form-model>
  315. </div>
  316. </a-modal>
  317. <!-- 查看详情 -->
  318. <a-modal
  319. v-if="auditPolicyStatus"
  320. title="充值申请"
  321. :visible="auditPolicyStatus"
  322. :footer="null"
  323. v-dialog-drag
  324. :width="650"
  325. @cancel="
  326. auditPolicyStatus = false;
  327. queryByIdList = { accountList: [] };
  328. "
  329. >
  330. <a-form-model
  331. ref="queryByIdList"
  332. :model="queryByIdList"
  333. :rules="policyOperationRules"
  334. :label-col="labelCol"
  335. :wrapper-col="wrapperCol"
  336. >
  337. <a-form-model-item label="客户名称" prop="advertiserId">
  338. <a-select
  339. v-model="queryByIdList.advertiserId"
  340. placeholder="请选择客户名称"
  341. showSearch
  342. optionFilterProp="children"
  343. :filterOption="filterOption"
  344. allow-clear
  345. @change="getNewProductList"
  346. >
  347. <a-select-option
  348. :value="item.id"
  349. v-for="(item, index) of advertiserList"
  350. :key="index"
  351. >
  352. {{ item.name }}
  353. </a-select-option>
  354. </a-select>
  355. </a-form-model-item>
  356. <a-form-model-item label="产品名称" prop="productId">
  357. <a-select
  358. v-model="queryByIdList.productId"
  359. placeholder="请选择产品名称"
  360. showSearch
  361. optionFilterProp="children"
  362. :filterOption="filterOption"
  363. allow-clear
  364. @change="getMediaList"
  365. >
  366. <a-select-option
  367. :value="item.id"
  368. v-for="(item, index) of productNewList"
  369. :key="index"
  370. >
  371. {{ item.name }}
  372. </a-select-option>
  373. </a-select>
  374. </a-form-model-item>
  375. <a-form-model-item label="媒体" prop="paymentMedia">
  376. <a-select
  377. v-model="queryByIdList.paymentMedia"
  378. placeholder="请选择媒体"
  379. showSearch
  380. optionFilterProp="children"
  381. :filterOption="filterOption"
  382. allow-clear
  383. @change="getProjectList"
  384. >
  385. <a-select-option
  386. :value="item.name"
  387. v-for="(item, index) of mediaList"
  388. :key="index"
  389. >
  390. {{ item.name | paymentMediaName }}
  391. </a-select-option>
  392. </a-select>
  393. <p v-if="rebateData" style="margin-bottom: 0">
  394. 返点类型:{{
  395. rebateData.rebateType == 1 ? "返货" : "返现"
  396. }}
  397. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 返点比例:{{
  398. rebateData.rebateRate
  399. }}%
  400. </p>
  401. </a-form-model-item>
  402. <a-form-model-item label="可用金额" prop="totalAmount">
  403. {{ totalAmount ? allMoney(totalAmount) : "-" }}
  404. </a-form-model-item>
  405. <a-form-model-item label="类型" prop="rechargeType">
  406. <a-select
  407. v-model="queryByIdList.rechargeType"
  408. placeholder="请选择类型"
  409. allow-clear
  410. >
  411. <a-select-option :value="1">充值</a-select-option>
  412. <a-select-option :value="2">自运营充值</a-select-option>
  413. </a-select>
  414. </a-form-model-item>
  415. <a-form-model-item label="项目" prop="projectId">
  416. <a-select
  417. v-model="queryByIdList.projectId"
  418. placeholder="请选择项目"
  419. showSearch
  420. optionFilterProp="children"
  421. :filterOption="filterOption"
  422. allow-clear
  423. @change="getAccountList"
  424. >
  425. <a-select-option
  426. :value="item.id"
  427. v-for="(item, index) of projectList"
  428. :key="index"
  429. >
  430. {{ item.name }}
  431. </a-select-option>
  432. </a-select>
  433. <a @click="addAccount">添加账户</a>
  434. </a-form-model-item>
  435. <div
  436. v-for="(item, index) in queryByIdList.accountList"
  437. style="position: relative"
  438. >
  439. <a-form-model-item
  440. label="选择账户"
  441. :prop="'accountList.' + index + '.accountId'"
  442. :rules="[{ required: true, message: '请选择账户', trigger: 'change' }]"
  443. v-if="queryByIdList.rechargeType == 1"
  444. >
  445. <a-select
  446. v-model="item.accountId"
  447. placeholder="请选择账户"
  448. showSearch
  449. optionFilterProp="children"
  450. :filterOption="filterOption"
  451. allow-clear
  452. @change="getAccountInfo($event, item)"
  453. >
  454. <a-select-option
  455. :value="item.id"
  456. v-for="(item, index) of accountList"
  457. :key="index"
  458. >
  459. {{ item.name }}
  460. </a-select-option>
  461. </a-select>
  462. <p v-if="!!item.accountMoney">账户余额:{{ allMoney(item.accountMoney) }}</p>
  463. </a-form-model-item>
  464. <a-form-model-item
  465. label="账户"
  466. :prop="'accountList.' + index + '.accountId'"
  467. :rules="[{ required: true, message: '请填写账户', trigger: 'blur' }]"
  468. v-else-if="queryByIdList.rechargeType == 2"
  469. >
  470. <a-input placeholder="请输入账户" v-model.number="item.accountId"></a-input>
  471. </a-form-model-item>
  472. <a-form-model-item
  473. label="到账金额"
  474. prop="receivedAmount"
  475. :prop="'accountList.' + index + '.receivedAmount'"
  476. :rules="[{ required: true, message: '请输入到账金额', trigger: 'blur' }]"
  477. >
  478. <a-input-number
  479. v-model="item.receivedAmount"
  480. :step="0.01"
  481. :precision="2"
  482. :min="0"
  483. @change="editMoneyNew($event, 1, index)"
  484. />
  485. </a-form-model-item>
  486. <a-form-model-item
  487. label="到账金额"
  488. prop="receivedAmount"
  489. :prop="'accountList.' + index + '.receivedAmount'"
  490. :rules="[{ required: true, message: '请输入到账金额', trigger: 'blur' }]"
  491. >
  492. <a-input-number
  493. v-model="item.receivedAmount"
  494. :step="0.01"
  495. :precision="2"
  496. :min="0"
  497. @change="editMoneyNew($event, 1, index)"
  498. />
  499. </a-form-model-item>
  500. <a-form-model-item
  501. label="现金金额"
  502. prop="cashAmount"
  503. :prop="'accountList.' + index + '.cashAmount'"
  504. :rules="[{ required: true, message: '请输入现金金额', trigger: 'blur' }]"
  505. >
  506. <a-input-number
  507. v-model="item.cashAmount"
  508. :step="0.01"
  509. :precision="2"
  510. :min="0"
  511. @change="editMoneyNew($event, 2, index)"
  512. />
  513. </a-form-model-item>
  514. <a
  515. v-if="index > 0"
  516. style="position: absolute; right: 0; top: 0; z-index: 10"
  517. @click="removeAccount(index)"
  518. >删除</a
  519. >
  520. </div>
  521. </a-form-model>
  522. <div solt="footer" style="display: flex; justify-content: end">
  523. <div>
  524. <a-button
  525. type="primary"
  526. class="cancel-btn"
  527. @click="handleAuditSure"
  528. style="margin: 0 10px"
  529. >确定</a-button
  530. >
  531. </div>
  532. <div>
  533. <a-button type="default" class="cancel-btn" @click="handleAuditCancel"
  534. >取消</a-button
  535. >
  536. </div>
  537. </div>
  538. </a-modal>
  539. <!-- 操作记录 -->
  540. <a-modal
  541. v-if="logVisible"
  542. title="操作记录"
  543. :visible="logVisible"
  544. @cancel="logVisible = false"
  545. :footer="null"
  546. v-dialog-drag
  547. >
  548. <div style="height: 400px; overflow: auto; padding: 15px">
  549. <a-steps
  550. progress-dot
  551. direction="vertical"
  552. v-model="logActive"
  553. style="width: 100%"
  554. disbaled
  555. >
  556. <a-step
  557. :title="`${item.roleName}(${item.userName})${
  558. item.auditStatus == '0'
  559. ? '创建申请'
  560. : item.auditStatus == -1
  561. ? '退回修改'
  562. : item.auditStatus == '3'
  563. ? '审核通过'
  564. : item.auditStatus == '4'
  565. ? '临时通过'
  566. : item.auditStatus == '5'
  567. ? '审核拒绝'
  568. : item.auditStatus == '1'
  569. ? '待审核'
  570. : '-'
  571. }`"
  572. :description="`${item.time}`"
  573. v-for="(item, index) in logList"
  574. :key="index"
  575. disabled
  576. :class="{ endStatus: item.auditStatus == 3 }"
  577. />
  578. </a-steps>
  579. </div>
  580. </a-modal>
  581. </div>
  582. </template>
  583. <script>
  584. import moment from "moment";
  585. import Vue from "vue";
  586. import { ACCESS_TOKEN } from "@/store/mutation-types";
  587. import { getAction, postAction, downFile } from "@/api/manage";
  588. import { mapGetters } from "vuex";
  589. import { urlAcount } from "./policy-management-server.js";
  590. import uploadFile from "@/components/uploadFile.vue";
  591. const fileSuffix = ["xlsx", "xls"];
  592. import JTreeSelect from "@/components/jeecg/JTreeSelect";
  593. function allMoney(num, n) {
  594. n = n || 2;
  595. let symbol = ",";
  596. if (num === null) return num;
  597. if (typeof num !== "number") throw new TypeError("num参数应该是一个number类型");
  598. if (n < 0) throw new Error("参数n不应该小于0");
  599. let hasDot = parseInt(num) != num; //这里检测num是否为小数,true表示小数
  600. let m = n != undefined && n != null ? n : 1;
  601. num =
  602. m == 0 ? num.toFixed(m) + "." : hasDot ? (n ? num.toFixed(n) : num) : num.toFixed(m);
  603. symbol = symbol || ",";
  604. num = num.toString().replace(/(\d)(?=(\d{3})+\.)/g, function (match, p1, p2) {
  605. return p1 + symbol;
  606. });
  607. if (n == 0 || (!hasDot && !n)) {
  608. //如果n为0或者传入的num是整数并且没有指定整数的保留位数,则去掉前面操作中的小数位
  609. num = num.substring(0, num.indexOf("."));
  610. }
  611. return num;
  612. }
  613. export default {
  614. name: "policy-management",
  615. data() {
  616. let handleCharacterLen30 = (rule, value, callback) => {
  617. this.handleExportRules(value, 1, 30, callback);
  618. };
  619. let handleCharacterLen100 = (rule, value, callback) => {
  620. this.handleDescRules(value, 5, 100, callback);
  621. };
  622. return {
  623. list: [],
  624. productList: [],
  625. advertiserList: [],
  626. productNewList: [],
  627. projectList: [],
  628. mediaList: [],
  629. accountList: [],
  630. totalAmount: undefined,
  631. rebateData: undefined,
  632. paymentTypeDisable: true,
  633. writeRebate: false,
  634. showRebate: false,
  635. oldData: undefined,
  636. mode2: ["month", "month"],
  637. confirmLoading: false,
  638. controlLoading: false,
  639. logVisible: false,
  640. logStatus: 0,
  641. logActive: 2,
  642. logList: [],
  643. allSaleListOption: [],
  644. dataDimensionList: [],
  645. creativeMediaOptions: [
  646. {
  647. id: "",
  648. name: "不限",
  649. },
  650. {
  651. id: 1,
  652. name: "头条",
  653. },
  654. {
  655. id: 2,
  656. name: "快手",
  657. },
  658. {
  659. id: 7,
  660. name: "磁力金牛",
  661. },
  662. {
  663. id: 9,
  664. name: "广点通",
  665. },
  666. ],
  667. searchStatusOptions: [
  668. {
  669. id: 1,
  670. name: "待审核",
  671. },
  672. {
  673. id: 3,
  674. name: "审核通过",
  675. },
  676. {
  677. id: 4,
  678. name: "临时通过",
  679. },
  680. {
  681. id: 5,
  682. name: "审核拒绝",
  683. },
  684. ],
  685. subTitleMsgStatus: false,
  686. remarksStatus: false,
  687. changeRules: [
  688. { required: true, message: "请输入产品名称", trigger: "blur" },
  689. { validator: handleCharacterLen30, trigger: "blur" },
  690. ],
  691. addType: "add",
  692. labelCol: { span: 4 },
  693. wrapperCol: { span: 16 },
  694. rejectAuditStatus: false,
  695. rejectionReasonStatus: false,
  696. auditPolicyStatus: false,
  697. policyOperationStatus: false,
  698. voidOperationStatus: false,
  699. totalAll: 0,
  700. policyOperationForm: {},
  701. voidId: undefined,
  702. reasonForm: {
  703. desc: "",
  704. },
  705. // queryByIdListRules:{
  706. // },
  707. policyOperationRules: {
  708. advertiserId: [{ required: true, message: "请选择客户", trigger: "change" }],
  709. productId: [{ required: true, message: "请选择产品", trigger: "change" }],
  710. paymentMedia: [{ required: true, message: "请选择投放媒体", trigger: "change" }],
  711. paymentType: [{ required: true, message: "请选择类型", trigger: "change" }],
  712. rebateType: [{ required: true, message: "请选择返点类型", trigger: "change" }],
  713. rebateRate: [{ required: true, message: "请填写返点比例", trigger: "blur" }],
  714. displayAmount: [{ required: true, message: "请填写垫款金额", trigger: "blur" }],
  715. cashAmount: [{ required: true, message: "请填写现金金额", trigger: "blur" }],
  716. paymentPort: [{ required: true, message: "请选择端口", trigger: "change" }],
  717. rechargeType: [{ required: true, message: "请选择类型", trigger: "change" }],
  718. projectId: [{ required: true, message: "请选择项目", trigger: "change" }],
  719. },
  720. queryByIdList: {
  721. accountList: [],
  722. },
  723. dataSource: [],
  724. okType: 3,
  725. columns: [
  726. {
  727. title: "客户名称",
  728. align: "center",
  729. dataIndex: "advertiserName",
  730. width: 250,
  731. },
  732. {
  733. title: "产品名称",
  734. align: "center",
  735. dataIndex: "productName",
  736. width: 200,
  737. },
  738. {
  739. title: "预付款/垫款",
  740. align: "center",
  741. dataIndex: "paymentType",
  742. width: 100,
  743. customRender(t) {
  744. if (t == "1") {
  745. return "预付款";
  746. } else if (t == "2") {
  747. return "垫款";
  748. }
  749. },
  750. // scopedSlots: { customRender: "media" },
  751. },
  752. {
  753. title: "媒体",
  754. align: "center",
  755. dataIndex: "paymentMedia",
  756. width: 100,
  757. customRender(t) {
  758. if (t == "1") {
  759. return "头条";
  760. } else if (t == "2") {
  761. return "快手";
  762. } else if (t == "7") {
  763. return "磁力金牛";
  764. } else if (t == "9") {
  765. return "广点通";
  766. }
  767. },
  768. },
  769. {
  770. title: "端口",
  771. align: "center",
  772. dataIndex: "paymentPort",
  773. ellipsis: true,
  774. width: 100,
  775. customRender(t) {
  776. if (t == "1") {
  777. return "汇创";
  778. } else if (t == "2") {
  779. return "骄阳";
  780. } else if (t == "3") {
  781. return "江西五六七";
  782. } else if (t == "4") {
  783. return "北京五六七";
  784. }
  785. },
  786. },
  787. {
  788. title: "现金金额",
  789. dataIndex: "cashAmount",
  790. align: "center",
  791. width: 100,
  792. customRender(t) {
  793. if (t) {
  794. return allMoney(t);
  795. } else {
  796. return "-";
  797. }
  798. },
  799. },
  800. {
  801. title: "账显金额",
  802. dataIndex: "displayAmount",
  803. align: "center",
  804. width: 100,
  805. customRender(t) {
  806. if (!!t) {
  807. return allMoney(t);
  808. } else {
  809. return "-";
  810. }
  811. },
  812. },
  813. {
  814. title: "返点类型",
  815. dataIndex: "rebateType",
  816. align: "center",
  817. width: 100,
  818. customRender(t) {
  819. if (t == "1") {
  820. return "返货";
  821. } else if (t == "2") {
  822. return "返现";
  823. }
  824. },
  825. },
  826. {
  827. title: "返点",
  828. dataIndex: "rebateRate",
  829. align: "center",
  830. width: 100,
  831. },
  832. {
  833. title: "备注",
  834. align: "center",
  835. dataIndex: "remarks",
  836. customRender(t) {
  837. if (!!t) {
  838. return t;
  839. } else {
  840. return "-";
  841. }
  842. },
  843. width: 250,
  844. },
  845. {
  846. title: "操作",
  847. dataIndex: "action",
  848. align: "center",
  849. width: 250,
  850. fixed: "right",
  851. scopedSlots: { customRender: "action" },
  852. },
  853. ],
  854. configForm: {
  855. advertiserName: undefined,
  856. productName: undefined,
  857. paymentMedia: undefined,
  858. time: [],
  859. rebateType: undefined,
  860. },
  861. tablePag: {
  862. page: 1,
  863. size: 10,
  864. },
  865. addAreaList: [],
  866. saleShowOption: [],
  867. addSubjectList: [],
  868. rejectionReasonList: {},
  869. tableOnlyId: "",
  870. saleVisible: false,
  871. saleInfoList: [],
  872. salePersonList: [],
  873. saleLoading: false,
  874. toLeaderVisible: false,
  875. exportLoading: false,
  876. lookImageVisible: false,
  877. lookImageData: null,
  878. searchForm: this.$form.createForm(this),
  879. loadDisabled: false,
  880. };
  881. },
  882. components: {
  883. JTreeSelect,
  884. uploadFile,
  885. },
  886. created() {},
  887. mounted() {
  888. this.handleInitTable();
  889. // this.handleGetAllSaleList();
  890. // this.handleAddGetArea();
  891. },
  892. methods: {
  893. lookImageClick(item) {
  894. this.lookImageVisible = true;
  895. this.lookImageData = item;
  896. },
  897. getList() {
  898. var params = {};
  899. this.getAction("/financePayment/application/getAdvertisers", params)
  900. .then((res) => {
  901. if (res.success) {
  902. console.log(res);
  903. this.list = res.result;
  904. } else {
  905. this.$message.warning(res.message);
  906. }
  907. })
  908. .finally(() => {});
  909. },
  910. getProductList(ids) {
  911. this.$set(this.policyOperationForm, "productId", undefined);
  912. this.$set(this.policyOperationForm, "rebateType", undefined);
  913. this.$set(this.policyOperationForm, "rebateRate", undefined);
  914. this.$set(this.policyOperationForm, "paymentType", undefined);
  915. if (!!ids) {
  916. var params = {};
  917. params.ids = ids.key;
  918. this.getAction("/financePayment/application/getProductByAdvertiserIds", params)
  919. .then((res) => {
  920. if (res.success) {
  921. this.productList = res.result;
  922. } else {
  923. this.$message.warning(res.message);
  924. }
  925. })
  926. .finally(() => {});
  927. } else {
  928. this.productList = [];
  929. }
  930. },
  931. getInfo(type) {
  932. if (!!type) {
  933. var params = {};
  934. params.type = this.policyOperationForm.paymentMedia;
  935. params.advertiserName = this.policyOperationForm.advertiserId.label
  936. .replace(/[\r\n]/g, "")
  937. .replace(/(^\s*)|(\s*$)/g, "");
  938. params.productName = type.label
  939. .replace(/[\r\n]/g, "")
  940. .replace(/(^\s*)|(\s*$)/g, "");
  941. // advertiserName = 广州小迈网络科技有限公司 & productName = 吉祥来电秀 & type = 2;
  942. this.getAction("/financePayment/application/queryCwjsPolicyInfo", params)
  943. .then((res) => {
  944. if (res.success) {
  945. // this.productList = res.result;
  946. if (!!res.result) {
  947. var nowDate = new Date().getTime();
  948. var checkDate = new Date(res.result.policyEndDate).getTime();
  949. if (nowDate > checkDate) {
  950. this.writeRebate = true;
  951. this.showRebate = false;
  952. this.$set(this.policyOperationForm, "rebateType", undefined);
  953. this.$set(this.policyOperationForm, "rebateRate", undefined);
  954. this.$set(this.policyOperationForm, "paymentType", undefined);
  955. this.$set(this.policyOperationForm, "displayAmount", undefined);
  956. this.$set(this.policyOperationForm, "cashAmount", undefined);
  957. } else {
  958. this.writeRebate = false;
  959. this.showRebate = true;
  960. this.oldData = res.result.advancePay == 1 ? 1 : 2;
  961. this.$set(
  962. this.policyOperationForm,
  963. "rebateType",
  964. res.result.rebateType
  965. );
  966. this.$set(
  967. this.policyOperationForm,
  968. "rebateRate",
  969. res.result.rebateRate
  970. );
  971. this.$set(
  972. this.policyOperationForm,
  973. "paymentType",
  974. res.result.advancePay == 1 ? 1 : 2
  975. );
  976. this.$set(this.policyOperationForm, "displayAmount", undefined);
  977. this.$set(this.policyOperationForm, "cashAmount", undefined);
  978. }
  979. } else {
  980. this.writeRebate = true;
  981. this.showRebate = false;
  982. this.$set(this.policyOperationForm, "rebateType", undefined);
  983. this.$set(this.policyOperationForm, "rebateRate", undefined);
  984. this.$set(this.policyOperationForm, "paymentType", undefined);
  985. this.$set(this.policyOperationForm, "displayAmount", undefined);
  986. this.$set(this.policyOperationForm, "cashAmount", undefined);
  987. }
  988. } else {
  989. this.$message.warning(res.message);
  990. }
  991. })
  992. .finally(() => {});
  993. } else {
  994. this.showRebate = false;
  995. this.$set(this.policyOperationForm, "rebateType", undefined);
  996. this.$set(this.policyOperationForm, "rebateRate", undefined);
  997. this.$set(this.policyOperationForm, "paymentType", undefined);
  998. this.$set(this.policyOperationForm, "displayAmount", undefined);
  999. this.$set(this.policyOperationForm, "cashAmount", undefined);
  1000. }
  1001. },
  1002. changEditStatus() {
  1003. if (this.policyOperationForm.paymentType == 2) {
  1004. this.paymentTypeDisable = true;
  1005. } else {
  1006. }
  1007. },
  1008. editMoney(value, type) {
  1009. console.log(value);
  1010. if (type == 1 && !!this.policyOperationForm.rebateRate) {
  1011. this.$set(
  1012. this.policyOperationForm,
  1013. "cashAmount",
  1014. this.policyOperationForm.rebateType == 1
  1015. ? (value / (1 + this.policyOperationForm.rebateRate / 100)).toFixed(2)
  1016. : (value * (1 - this.policyOperationForm.rebateRate / 100)).toFixed(2)
  1017. );
  1018. } else if (type == 2 && !!this.policyOperationForm.rebateRate) {
  1019. this.$set(
  1020. this.policyOperationForm,
  1021. "displayAmount",
  1022. this.policyOperationForm.rebateType == 1
  1023. ? (value * (1 + this.policyOperationForm.rebateRate / 100)).toFixed(2)
  1024. : (value / (1 - this.policyOperationForm.rebateRate / 100)).toFixed(2)
  1025. );
  1026. } else {
  1027. this.$message.error("暂未填写返点比例");
  1028. }
  1029. },
  1030. ...mapGetters(["userInfo"]),
  1031. moment,
  1032. handleAdd() {
  1033. this.policyOperationStatus = true;
  1034. this.getList();
  1035. },
  1036. getNewAdvertiserList() {
  1037. var params = {
  1038. table: "finance_payment_pool,advertiser_id,advertiser_name",
  1039. groupBy: "advertiser_id",
  1040. };
  1041. this.postDataAction("/financePayment/pool/querySheetIdAndNameList", params)
  1042. .then((res) => {
  1043. if (res.success) {
  1044. this.advertiserList = res.result;
  1045. } else {
  1046. this.$message.warning(res.message);
  1047. }
  1048. })
  1049. .finally(() => {});
  1050. },
  1051. getNewProductList(value) {
  1052. this.$set(this.queryByIdList, "productId", undefined);
  1053. this.$set(this.queryByIdList, "paymentMedia", undefined);
  1054. this.$set(this.queryByIdList, "projectId", undefined);
  1055. this.queryByIdList.accountList = [];
  1056. if (!!value) {
  1057. var params = {
  1058. table: "finance_payment_pool,product_id,product_name",
  1059. groupBy: "product_id",
  1060. paramters: [
  1061. {
  1062. paramter: "advertiser_id",
  1063. value: value,
  1064. },
  1065. ],
  1066. };
  1067. this.postDataAction("/financePayment/pool/querySheetIdAndNameList", params)
  1068. .then((res) => {
  1069. if (res.success) {
  1070. this.productNewList = res.result;
  1071. } else {
  1072. this.$message.warning(res.message);
  1073. }
  1074. })
  1075. .finally(() => {});
  1076. }
  1077. },
  1078. getMediaList(value) {
  1079. this.$set(this.queryByIdList, "paymentMedia", undefined);
  1080. this.$set(this.queryByIdList, "projectId", undefined);
  1081. this.queryByIdList.accountList = [];
  1082. var params = {
  1083. table: "finance_payment_pool,product_id,payment_media",
  1084. groupBy: "payment_media",
  1085. paramters: [
  1086. {
  1087. paramter: "advertiser_id",
  1088. value: this.queryByIdList.advertiserId,
  1089. },
  1090. {
  1091. paramter: "product_id",
  1092. value: value,
  1093. },
  1094. ],
  1095. };
  1096. this.postDataAction("/financePayment/pool/querySheetIdAndNameList", params)
  1097. .then((res) => {
  1098. if (res.success) {
  1099. this.mediaList = res.result;
  1100. } else {
  1101. this.$message.warning(res.message);
  1102. }
  1103. })
  1104. .finally(() => {});
  1105. },
  1106. getProjectList(value) {
  1107. this.$set(this.queryByIdList, "projectId", undefined);
  1108. this.queryByIdList.accountList = [];
  1109. if (!!value) {
  1110. var params = {
  1111. advertiserId: this.queryByIdList.advertiserId,
  1112. type: this.queryByIdList.paymentMedia,
  1113. productId: this.queryByIdList.productId,
  1114. };
  1115. this.getMoney(params);
  1116. this.getRebate(params);
  1117. this.getAction("/financePayment/pool/queryPoolProjectList", params)
  1118. .then((res) => {
  1119. if (res.success) {
  1120. this.projectList = res.result;
  1121. } else {
  1122. this.$message.warning(res.message);
  1123. }
  1124. })
  1125. .finally(() => {});
  1126. } else {
  1127. }
  1128. },
  1129. getMoney(params) {
  1130. // var params = {
  1131. // advertiserId: this.queryByIdList.advertiserId,
  1132. // type: this.queryByIdList.paymentMedia,
  1133. // productId: this.queryByIdList.paymentMedia,
  1134. // };
  1135. this.getAction("/financePayment/pool/queryPool", params)
  1136. .then((res) => {
  1137. if (res.success) {
  1138. this.totalAmount = res.result ? res.result.cashAmount : 0;
  1139. } else {
  1140. this.$message.warning(res.message);
  1141. }
  1142. })
  1143. .finally(() => {});
  1144. },
  1145. getRebate(params) {
  1146. // var params = {
  1147. // advertiserId: this.queryByIdList.advertiserId,
  1148. // type: this.queryByIdList.paymentMedia,
  1149. // productId: this.queryByIdList.paymentMedia,
  1150. // };
  1151. this.getAction("/financePayment/application/queryInfo", params)
  1152. .then((res) => {
  1153. if (res.success) {
  1154. this.rebateData = res.result;
  1155. } else {
  1156. this.$message.warning(res.message);
  1157. }
  1158. })
  1159. .finally(() => {});
  1160. },
  1161. getAccountList() {
  1162. this.queryByIdList.accountList = [];
  1163. var params = {
  1164. table: "ctop_user_allocation,account_id,auth_name",
  1165. groupBy: "account_id",
  1166. paramters: [
  1167. {
  1168. paramter: "media_id",
  1169. value: this.queryByIdList.paymentMedia,
  1170. },
  1171. // {
  1172. // paramter: "advertiser_id",
  1173. // value: this.queryByIdList.advertiserId,
  1174. // },
  1175. {
  1176. paramter: "project_id",
  1177. value: this.queryByIdList.projectId,
  1178. },
  1179. // {
  1180. // paramter: "product_id",
  1181. // value: this.queryByIdList.productId,
  1182. // },
  1183. ],
  1184. };
  1185. this.postDataAction("/financePayment/pool/querySheetIdAndNameList", params)
  1186. .then((res) => {
  1187. if (res.success) {
  1188. this.accountList = res.result;
  1189. } else {
  1190. this.$message.warning(res.message);
  1191. }
  1192. })
  1193. .finally(() => {});
  1194. },
  1195. removeAccount(index) {
  1196. this.queryByIdList.accountList.splice(index, 1);
  1197. },
  1198. addAccount() {
  1199. this.queryByIdList.accountList.push({
  1200. accountId: undefined,
  1201. cashAmount: undefined,
  1202. receivedAmount: undefined,
  1203. rebateType: undefined,
  1204. rebateRate: undefined,
  1205. accountMoney: undefined,
  1206. });
  1207. },
  1208. getAccountInfo(value, item) {
  1209. if (!!value) {
  1210. var params = {
  1211. media: this.queryByIdList.paymentMedia,
  1212. accountId: value,
  1213. };
  1214. this.getAction("/financePayment/pool/queryAccountBalance", params)
  1215. .then((res) => {
  1216. if (res.success) {
  1217. item.accountMoney = res.result;
  1218. } else {
  1219. this.$message.warning(res.message);
  1220. }
  1221. })
  1222. .finally(() => {});
  1223. } else {
  1224. }
  1225. },
  1226. handleAddPleace() {
  1227. this.auditPolicyStatus = true;
  1228. this.getNewAdvertiserList();
  1229. },
  1230. handleFilterOption(input, option) {
  1231. return (
  1232. option.componentOptions.children[0].text
  1233. .toLowerCase()
  1234. .indexOf(input.toLowerCase()) >= 0
  1235. );
  1236. },
  1237. filterOption(input, option) {
  1238. return (
  1239. option.componentOptions.children[0].text
  1240. .toLowerCase()
  1241. .indexOf(input.toLowerCase()) >= 0
  1242. );
  1243. },
  1244. handleAddTimesChange(date, dateString) {
  1245. this.policyOperationForm.addTimes = dateString;
  1246. },
  1247. showAreaInfo(data) {
  1248. if (data) {
  1249. var dataShow = this.saleShowOption.filter((item) => {
  1250. return item.saleId == data;
  1251. });
  1252. this.policyOperationForm.areaInfo = dataShow[0].nickName;
  1253. } else {
  1254. this.policyOperationForm.areaInfo = undefined;
  1255. }
  1256. },
  1257. handleAddGetArea(data) {
  1258. const paramsData = {
  1259. userId: this.userInfo().id,
  1260. };
  1261. getAction(urlAcount + "/finance/cwjsPolicyInfo/queryAeraByUserId", paramsData)
  1262. .then((result) => {
  1263. if (result.code === 0) {
  1264. const defaultList = result.result[0].UserCompany;
  1265. this.saleShowOption = defaultList.map((item) => {
  1266. return {
  1267. saleId: item.userId,
  1268. saleName: item.userName,
  1269. };
  1270. });
  1271. this.addAreaList = defaultList[0].nickName.split(",");
  1272. this.addSubjectList = result.result[0].companySubjects;
  1273. getAction(
  1274. urlAcount + "/finance/cwjsSaleAssistantInfo/getCwSaleAndAssistantList",
  1275. paramsData
  1276. )
  1277. .then((result) => {
  1278. if (result.code === 0) {
  1279. for (let i = 0; i < result.result.length; i++) {
  1280. if (this.saleShowOption[0].saleId == result.result[i].saleId) {
  1281. } else {
  1282. this.saleShowOption.push(result.result[i]);
  1283. }
  1284. }
  1285. } else {
  1286. this.$message.error(result.message);
  1287. }
  1288. })
  1289. .catch((error) => {
  1290. console.log(error, "eeee");
  1291. });
  1292. } else {
  1293. this.$message.error(result.message);
  1294. }
  1295. })
  1296. .catch((error) => {
  1297. console.log(error, "eeee");
  1298. });
  1299. },
  1300. handleExamineAll(data) {
  1301. // const paramsData = {
  1302. // id: data.id,
  1303. // type: data.type,
  1304. // userId: this.userInfo().id,
  1305. // approvalContent: data.value,
  1306. // };
  1307. this.postDataAction("/financePayment/application/updateStatus", data)
  1308. .then((result) => {
  1309. if (result.code === 200) {
  1310. this.rejectAuditStatus = false;
  1311. this.auditPolicyStatus = false;
  1312. this.handleInitTable();
  1313. this.$message.success(result.message);
  1314. } else {
  1315. this.$message.error(result.message);
  1316. }
  1317. })
  1318. .catch((error) => {
  1319. console.log(error, "eeee");
  1320. });
  1321. },
  1322. // 获取所有的媒体 枚举值
  1323. handleGetAllSaleList() {
  1324. const paramsData = {
  1325. userId: this.userInfo().id,
  1326. };
  1327. getAction(
  1328. urlAcount + "/finance/cwjsSaleAssistantInfo/getSaleListByUserDepart",
  1329. paramsData
  1330. )
  1331. .then((result) => {
  1332. if (result.success) {
  1333. this.allSaleListOption = result.result || [];
  1334. } else {
  1335. this.$message.error(result.message);
  1336. }
  1337. })
  1338. .catch((error) => {
  1339. console.log(error, "eeee");
  1340. });
  1341. },
  1342. showLog(item) {
  1343. this.logVisible = true;
  1344. getAction("/financePayment/application/queryAuditProcess", { id: item.id })
  1345. .then((result) => {
  1346. if (result.code === 200) {
  1347. this.logList = result.result;
  1348. this.logActive = this.logList.length - 1;
  1349. } else {
  1350. this.$message.error(result.message);
  1351. }
  1352. })
  1353. .catch((error) => {
  1354. console.log(error, "eeee");
  1355. })
  1356. .finally(() => {});
  1357. },
  1358. // 获取默认的列表数据
  1359. handleInitTable() {
  1360. this.controlLoading = true;
  1361. const paramsData = {
  1362. userId: this.userInfo().id,
  1363. advertiserName: this.configForm.advertiserName,
  1364. productName: this.configForm.productName,
  1365. paymentMedia: this.configForm.paymentMedia,
  1366. rebateType: this.configForm.rebateType,
  1367. startDate:
  1368. this.configForm.time && this.configForm.time.length == 2
  1369. ? moment(this.configForm.time[0]).format("YYYY-MM-DD")
  1370. : null,
  1371. endDate:
  1372. this.configForm.time && this.configForm.time.length == 2
  1373. ? moment(this.configForm.time[1]).format("YYYY-MM-DD")
  1374. : null,
  1375. pageNo: this.tablePag.page,
  1376. pageSize: this.tablePag.size,
  1377. };
  1378. getAction("/financePayment/pool/list", paramsData)
  1379. .then((result) => {
  1380. if (result.success == true) {
  1381. let defaultList = result.result.records;
  1382. this.dataSource = defaultList;
  1383. this.totalAll = result.result.total;
  1384. } else {
  1385. this.dataSource = [];
  1386. this.tablePag.page = 1;
  1387. this.totalAll = 0;
  1388. this.$message.error(result.message);
  1389. }
  1390. })
  1391. .catch((error) => {
  1392. console.log(error, "eeee");
  1393. })
  1394. .finally(() => {
  1395. this.controlLoading = false;
  1396. });
  1397. },
  1398. overUpload(urlAll) {
  1399. console.log(urlAll);
  1400. },
  1401. handleRemarksChange(e) {
  1402. const targetVal = e.target.value;
  1403. let cnReg = /([\u4e00-\u9fa5]|[\u3000-\u303F]|[\uFF00-\uFF60])/;
  1404. let length = 0;
  1405. let strArr = targetVal.split("");
  1406. strArr.forEach((item) => {
  1407. if (cnReg.test(item)) {
  1408. length += 2;
  1409. } else {
  1410. length += 1;
  1411. }
  1412. });
  1413. if (1 <= length && length <= 500) {
  1414. this.remarksStatus = false;
  1415. } else {
  1416. this.remarksStatus = true;
  1417. }
  1418. },
  1419. handleGroupAbbreviationChange(e) {
  1420. const targetVal = e.target.value;
  1421. let cnReg = /([\u4e00-\u9fa5]|[\u3000-\u303F]|[\uFF00-\uFF60])/;
  1422. let length = 0;
  1423. let strArr = targetVal.split("");
  1424. strArr.forEach((item) => {
  1425. if (cnReg.test(item)) {
  1426. length += 2;
  1427. } else {
  1428. length += 1;
  1429. }
  1430. });
  1431. if (1 <= length && length <= 60) {
  1432. this.subTitleMsgStatus = false;
  1433. } else {
  1434. this.subTitleMsgStatus = true;
  1435. }
  1436. },
  1437. disabledDate(current) {
  1438. return current > moment().subtract(1, "day");
  1439. },
  1440. handleAddOrigin() {
  1441. const randomNum = new Date().getTime() + Math.ceil(Math.random() * 1000);
  1442. this.policyOperationForm.defaultFormList.push({
  1443. id: randomNum,
  1444. value: "",
  1445. });
  1446. },
  1447. handleDelOrigin(list) {
  1448. if (this.policyOperationForm.defaultFormList.length === 1) {
  1449. return;
  1450. }
  1451. let formData = this.policyOperationForm.defaultFormList;
  1452. this.policyOperationForm.defaultFormList = formData.filter(
  1453. (item) => list.id !== item.id
  1454. );
  1455. },
  1456. handleIsDianPayChange(e) {
  1457. if (e.target.value === 0) {
  1458. this.policyOperationForm.dianPayCompanyName = "";
  1459. this.policyOperationForm.dianPayCompanyRebateRate = 0;
  1460. }
  1461. },
  1462. handlePrepaidNotChange(e) {
  1463. if (e.target.value === 1) {
  1464. this.policyOperationForm.accountingPeriod = "";
  1465. this.policyOperationForm.dianPayCompanyName = "";
  1466. this.policyOperationForm.dianPayCompanyRebateRate = 0;
  1467. this.policyOperationForm.isDianPay = undefined;
  1468. } else if (e.target.value === 0) {
  1469. this.policyOperationForm.isDianPay = 0;
  1470. }
  1471. },
  1472. handleExportRules(value, min, max, callback) {
  1473. let cnReg = /([\u4e00-\u9fa5]|[\u3000-\u303F]|[\uFF00-\uFF60])/;
  1474. let length = 0;
  1475. let strArr = value.split("");
  1476. strArr.forEach((item) => {
  1477. if (cnReg.test(item)) {
  1478. length += 2;
  1479. } else {
  1480. length += 1;
  1481. }
  1482. });
  1483. if (min * 2 <= length && length <= max * 2) {
  1484. callback();
  1485. } else {
  1486. callback(`只能输入${min}-${max}个汉字`);
  1487. }
  1488. },
  1489. handleDescRules(value, min, max, callback) {
  1490. let cnReg = /([\u4e00-\u9fa5]|[\u3000-\u303F]|[\uFF00-\uFF60])/;
  1491. let length = 0;
  1492. let strArr = value.split("");
  1493. strArr.forEach((item) => {
  1494. if (cnReg.test(item)) {
  1495. length += 2;
  1496. } else {
  1497. length += 1;
  1498. }
  1499. });
  1500. if (min <= length && length <= max) {
  1501. callback();
  1502. } else {
  1503. callback(`只能输入${min}-${max}个字符`);
  1504. }
  1505. },
  1506. // 分页操作按钮
  1507. handleOnShowSizeChange(current, pageSize) {
  1508. this.tablePag = {
  1509. page: current,
  1510. size: pageSize,
  1511. };
  1512. this.handleInitTable();
  1513. },
  1514. //作废操作
  1515. handleVoid(list) {
  1516. this.voidOperationStatus = true;
  1517. this.voidId = list.id;
  1518. },
  1519. // 编辑按钮操作
  1520. handleEditTable(list) {
  1521. this.addType = "edit";
  1522. this.policyOperationStatus = true;
  1523. this.queryByIdList = list;
  1524. this.policyOperationForm = {
  1525. ...list,
  1526. advertiserId: { key: list.advertiserId, label: list.advertiserName },
  1527. productId: { key: list.productId, label: list.productName },
  1528. files: list.files == "-" ? undefined : JSON.parse(list.files),
  1529. };
  1530. this.getList();
  1531. this.getProductList({ key: list.advertiserId, label: list.advertiserName });
  1532. this.getInfo({ key: list.productId, label: list.productName });
  1533. setTimeout(() => {
  1534. this.$set(this.policyOperationForm, "advertiserId", {
  1535. key: list.advertiserId,
  1536. label: list.advertiserName,
  1537. });
  1538. this.$set(this.policyOperationForm, "productId", {
  1539. key: list.productId,
  1540. label: list.productName,
  1541. });
  1542. this.$set(this.policyOperationForm, "paymentMedia", +list.paymentMedia);
  1543. this.$set(this.policyOperationForm, "paymentPort", +list.paymentPort);
  1544. this.$set(this.policyOperationForm, "cashAmount", list.cashAmount);
  1545. this.$set(this.policyOperationForm, "displayAmount", list.displayAmount);
  1546. this.$set(this.policyOperationForm, "rebateType", +list.rebateType);
  1547. this.$set(this.policyOperationForm, "rebateRate", list.rebateRate);
  1548. this.$set(
  1549. this.policyOperationForm,
  1550. "files",
  1551. list.files == "-" ? undefined : JSON.parse(list.files)
  1552. );
  1553. this.$set(this.policyOperationForm, "remarks", list.remarks);
  1554. this.$set(this.policyOperationForm, "paymentType", +list.paymentType);
  1555. }, 500);
  1556. // this.policyOperationForm = Object.assign({}, list);
  1557. },
  1558. // 新增政策按钮
  1559. handleAddAccountPolicy() {
  1560. this.$router.replace({
  1561. path: "/policy-management/reimbursementAdd?type=add",
  1562. });
  1563. },
  1564. // 新增政策确定按钮
  1565. handlePolicyOperationSure() {
  1566. this.$refs.policyOperationForm.validate((valid) => {
  1567. if (valid) {
  1568. const paramsData = {
  1569. ...this.policyOperationForm,
  1570. applicanterId: this.userInfo().id,
  1571. userId: this.userInfo().id,
  1572. productId: this.policyOperationForm.productId.key,
  1573. advertiserId: this.policyOperationForm.advertiserId.key,
  1574. displayAmount:
  1575. this.policyOperationForm.paymentType == 2
  1576. ? this.policyOperationForm.displayAmount
  1577. : 0,
  1578. temporaryAdvances: !!this.oldData
  1579. ? this.oldData == 1 && this.policyOperationForm.paymentType == 2
  1580. ? 1
  1581. : 0
  1582. : 0,
  1583. };
  1584. this.confirmLoading = true;
  1585. if (this.addType === "add") {
  1586. this.handleAddSureBtn(paramsData, "/financePayment/application/add");
  1587. } else {
  1588. this.handleAddSureBtn({ ...paramsData }, "/financePayment/application/edit");
  1589. }
  1590. } else {
  1591. return false;
  1592. }
  1593. });
  1594. },
  1595. handleAddSureBtn(data, url) {
  1596. postAction(url, data)
  1597. .then((result) => {
  1598. if (result.code === 200) {
  1599. this.$message.success(result.message);
  1600. this.oldData = undefined
  1601. this.handlePolicyOperationCancel();
  1602. this.handleAuditCancel();
  1603. this.handleInitTable();
  1604. } else {
  1605. this.$message.error(result.message);
  1606. }
  1607. })
  1608. .catch((error) => {
  1609. console.log(error, "eeee");
  1610. })
  1611. .finally(() => {
  1612. this.confirmLoading = false;
  1613. });
  1614. },
  1615. // 新增政策取消按钮
  1616. handlePolicyOperationCancel() {
  1617. this.policyOperationForm = {};
  1618. this.policyOperationStatus = false;
  1619. this.confirmLoading = false;
  1620. this.writeRebate = false;
  1621. this.showRebate = false;
  1622. },
  1623. // 审核拒绝确定按钮
  1624. handleRejectSure() {
  1625. this.$refs.rejectRuleForm.validate((valid) => {
  1626. console.log(valid);
  1627. if (valid) {
  1628. const params = {
  1629. id: this.tableOnlyId || this.queryByIdList.id,
  1630. type: this.okType,
  1631. value: this.reasonForm.desc,
  1632. };
  1633. this.handleExamineAll(params);
  1634. this.handleRejectCancel();
  1635. } else {
  1636. return false;
  1637. }
  1638. });
  1639. },
  1640. //领导审核理由
  1641. handleVoidOk() {
  1642. this.$refs.rejectRuleForm.validate((valid) => {
  1643. if (valid) {
  1644. const params = {
  1645. policyId: this.voidId,
  1646. delReason: this.reasonForm.desc,
  1647. };
  1648. getAction(urlAcount + "/finance/cwjsPolicyInfo/toVoidpolicy", params)
  1649. .then((result) => {
  1650. if (result.code === 0) {
  1651. this.voidOperationStatus = false;
  1652. this.reasonForm.desc = undefined;
  1653. this.handleInitTable();
  1654. } else {
  1655. this.$message.error(result.message);
  1656. }
  1657. })
  1658. .catch((error) => {
  1659. console.log(error, "eeee");
  1660. })
  1661. .finally(() => {
  1662. this.voidOperationStatus = false;
  1663. });
  1664. } else {
  1665. return false;
  1666. }
  1667. });
  1668. },
  1669. //领导审核理由
  1670. handleLeader() {
  1671. this.$refs.rejectRuleForm.validate((valid) => {
  1672. if (valid) {
  1673. const params = {
  1674. id: this.tableOnlyId || this.queryByIdList.id,
  1675. type: 4,
  1676. value: this.reasonForm.desc,
  1677. };
  1678. this.handleExamineAll(params);
  1679. this.handleRejectCancel();
  1680. } else {
  1681. return false;
  1682. }
  1683. });
  1684. },
  1685. // 审核拒绝取消按钮
  1686. handleRejectCancel() {
  1687. this.okType = 3;
  1688. this.reasonForm.desc = "";
  1689. this.rejectAuditStatus = false;
  1690. this.toLeaderVisible = false;
  1691. },
  1692. handleToLog(item){
  1693. localStorage.setItem('applicationLog',item.advertiserName)
  1694. this.$router.replace('/policy-management/appRecharge')
  1695. },
  1696. // 查看的按钮
  1697. handleDetail(list, type) {
  1698. console.log(list)
  1699. this.auditPolicyStatus = true;
  1700. this.queryByIdList = { ...list, newFiles: undefined, type: type,accountList:[] };
  1701. this.getNewAdvertiserList();
  1702. this.$set(this.queryByIdList, "advertiserId", list.advertiserId);
  1703. this.getNewProductList(this.queryByIdList.advertiserId);
  1704. this.$set(this.queryByIdList, "productId", list.productId);
  1705. this.getMediaList(this.queryByIdList.productId);
  1706. this.$set(this.queryByIdList, "paymentMedia", list.paymentMedia);
  1707. this.getProjectList(this.queryByIdList.paymentMedia);
  1708. this.rebateData = { rebateType: list.rebateType, rebateRate: list.rebateRate };
  1709. },
  1710. // 查看的取消按钮
  1711. handleCloseAuditPolicy() {
  1712. this.auditPolicyStatus = false;
  1713. },
  1714. editMoneyNew(value, type, index) {
  1715. if (type == 1 && !!this.rebateData && !!this.rebateData.rebateRate) {
  1716. this.$set(
  1717. this.queryByIdList.accountList[index],
  1718. "cashAmount",
  1719. this.rebateData.rebateType == 1
  1720. ? (value / (1 + this.rebateData.rebateRate / 100)).toFixed(2)
  1721. : (value * (1 - this.rebateData.rebateRate / 100)).toFixed(2)
  1722. );
  1723. } else if (type == 2 && !!this.rebateData && !!this.rebateData.rebateRate) {
  1724. this.$set(
  1725. this.queryByIdList.accountList[index],
  1726. "receivedAmount",
  1727. this.rebateData.rebateType == 1
  1728. ? (value * (1 + this.rebateData.rebateRate / 100)).toFixed(2)
  1729. : (value / (1 - this.rebateData.rebateRate / 100)).toFixed(2)
  1730. );
  1731. } else {
  1732. this.$message.error("暂未返点比例");
  1733. }
  1734. },
  1735. // 查看-审核政策-审核通过-按钮
  1736. handleAuditSure(list) {
  1737. this.$refs.queryByIdList.validate((valid) => {
  1738. if (valid) {
  1739. var that = this;
  1740. var total = this.queryByIdList.accountList
  1741. .map((item) => {
  1742. return item.cashAmount;
  1743. })
  1744. .reduce((o, n) => {
  1745. return +o + +n;
  1746. }, 0);
  1747. const paramsData = {
  1748. ...this.queryByIdList,
  1749. applicanterId: this.userInfo().id,
  1750. userId: this.userInfo().id,
  1751. totalAmount: total,
  1752. financialReview: total > +that.totalAmount ? 1 : 0,
  1753. list: this.queryByIdList.accountList.map((item) => {
  1754. return {
  1755. ...item,
  1756. rebateType: this.rebateData ? this.rebateData.rebateType : null,
  1757. rebateRate: this.rebateData ? this.rebateData.rebateRate : null,
  1758. };
  1759. }),
  1760. };
  1761. console.log(paramsData, that.totalAmount);
  1762. this.confirmLoading = true;
  1763. if (this.addType === "add") {
  1764. this.handleAddSureBtn(paramsData, "/financePayment/rechargeApplication/add");
  1765. } else {
  1766. this.handleAddSureBtn(
  1767. { ...paramsData },
  1768. "/financePayment/rechargeApplication/edit"
  1769. );
  1770. }
  1771. } else {
  1772. return false;
  1773. }
  1774. });
  1775. },
  1776. okFour(data) {
  1777. this.postDataAction("/financePayment/application/updateTemporaryFiles", data).then(
  1778. (result) => {
  1779. if (result.code === 200) {
  1780. this.rejectAuditStatus = false;
  1781. this.auditPolicyStatus = false;
  1782. this.handleInitTable();
  1783. this.$message.success(result.message);
  1784. } else {
  1785. this.$message.error(result.message);
  1786. }
  1787. }
  1788. );
  1789. },
  1790. // 查看-审核政策-审核拒绝-按钮
  1791. handleAuditCancel(data) {
  1792. this.queryByIdList = { accountList: [] };
  1793. this.rebateData = undefined;
  1794. this.totalAmount = undefined;
  1795. this.auditPolicyStatus = false;
  1796. },
  1797. handleSubmitEdit(list) {},
  1798. // 被拒理由的操作
  1799. handleRejectionReason(val) {
  1800. this.rejectionReasonList = val;
  1801. this.rejectionReasonStatus = true;
  1802. },
  1803. // 被拒理由确定按钮
  1804. handleModeSure() {
  1805. this.rejectionReasonStatus = false;
  1806. },
  1807. // 被拒理由取消按钮
  1808. handleModeCancel() {
  1809. this.rejectionReasonStatus = false;
  1810. },
  1811. // 搜索按钮
  1812. handleQueryList() {
  1813. this.tablePag = {
  1814. page: 1,
  1815. size: 10,
  1816. };
  1817. this.handleInitTable();
  1818. },
  1819. // 重置搜索
  1820. handleResetList() {
  1821. this.configForm = {
  1822. companyId: undefined,
  1823. userName: undefined,
  1824. media: undefined,
  1825. departId: undefined,
  1826. time: [],
  1827. status: undefined,
  1828. type: undefined,
  1829. };
  1830. this.tablePag = {
  1831. page: 1,
  1832. size: 10,
  1833. };
  1834. this.handleInitTable();
  1835. },
  1836. },
  1837. };
  1838. </script>
  1839. <style lang="less" scoped>
  1840. @import "policy-management";
  1841. </style>