appRecharge.vue 72 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247
  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="handleAddPleace" type="primary">充值申请</a-button>
  46. </span>
  47. </div>
  48. </div>
  49. <div class="control-con-header">
  50. <a-form class="grid-form" layout="inline" :form="searchForm" hide-required-mark>
  51. <a-row class="grid-form-options">
  52. <a-form-item class="grid-form-item" label="客户名称:" :colon="false">
  53. <!-- <a-input v-model="configForm.companyName" placeholder="请输入公司名称" allow-clear/> -->
  54. <a-input
  55. v-model="configForm.advertiserName"
  56. placeholder="请输入客户名称"
  57. allow-clear
  58. />
  59. </a-form-item>
  60. <a-form-item class="grid-form-item" label="产品名称:" :colon="false">
  61. <a-input
  62. v-model="configForm.productName"
  63. placeholder="请输入产品名称"
  64. allow-clear
  65. />
  66. </a-form-item>
  67. <a-form-item class="grid-form-item" label="媒体:" :colon="false">
  68. <a-select
  69. v-model="configForm.paymentMedia"
  70. style="width: 200px; margin-left: 10px"
  71. :filterOption="filterOption"
  72. showSearch
  73. allowClear
  74. placeholder="请选择媒体"
  75. >
  76. <a-select-option value="1"> 头条</a-select-option>
  77. <a-select-option value="2"> 快手</a-select-option>
  78. <a-select-option value="9"> 广点通</a-select-option>
  79. <a-select-option value="7"> 磁力金牛</a-select-option>
  80. <a-select-option value="11"> 头条&快手</a-select-option>
  81. </a-select>
  82. </a-form-item>
  83. <a-form-item class="grid-form-item" label="状态:" :colon="false">
  84. <a-select
  85. v-model="configForm.auditStatus"
  86. style="width: 200px; margin-left: 10px"
  87. :filterOption="filterOption"
  88. showSearch
  89. allowClear
  90. placeholder="请选择状态"
  91. >
  92. <a-select-option value="1">待审核</a-select-option>
  93. <a-select-option value="2">待充值</a-select-option>
  94. <a-select-option value="3">充值完成</a-select-option>
  95. <a-select-option value="4">临时充值</a-select-option>
  96. <a-select-option value="5">审核拒绝</a-select-option>
  97. </a-select>
  98. </a-form-item>
  99. <a-form-item class="grid-form-item" label="返点类型:" :colon="false">
  100. <a-select
  101. v-model="configForm.rebateType"
  102. style="width: 200px; margin-left: 10px"
  103. :filterOption="filterOption"
  104. showSearch
  105. allowClear
  106. placeholder="请选择返点类别"
  107. >
  108. <a-select-option value="1"> 返货</a-select-option>
  109. <a-select-option value="2"> 返现</a-select-option>
  110. </a-select>
  111. </a-form-item>
  112. <a-form-item class="grid-form-item" label="账户ID:" :colon="false">
  113. <a-input
  114. v-model="configForm.accountId"
  115. placeholder="请输入账户ID"
  116. allow-clear
  117. />
  118. </a-form-item>
  119. <a-form-item class="grid-form-item" label="是否后补:" :colon="false">
  120. <a-select
  121. v-model="configForm.amends"
  122. style="width: 200px; margin-left: 10px"
  123. :filterOption="filterOption"
  124. showSearch
  125. allowClear
  126. placeholder="请选择是否后补"
  127. >
  128. <a-select-option value="1">是</a-select-option>
  129. <a-select-option value="2">否</a-select-option>
  130. </a-select>
  131. </a-form-item>
  132. <a-form-item class="grid-form-item" label="申请时间:" :colon="false">
  133. <a-range-picker
  134. v-model="configForm.time"
  135. format="YYYY-MM-DD"
  136. style="width: 100%"
  137. />
  138. </a-form-item>
  139. <a-form-item class="form-handle-btn">
  140. <a-button type="default" class="reset-class" @click="handleResetList"
  141. >重置
  142. </a-button>
  143. <a-button type="primary" @click="handleQueryList">搜索</a-button>
  144. <a-button @click="exportData" :loading="exportLoading">导出</a-button>
  145. </a-form-item>
  146. </a-row>
  147. </a-form>
  148. </div>
  149. <div class="control-con-table">
  150. <a-table
  151. ref="table"
  152. size="middle"
  153. bordered
  154. :columns="columns"
  155. :dataSource="dataSource"
  156. :pagination="false"
  157. :loading="controlLoading"
  158. :scroll="{ x: 1000 }"
  159. >
  160. <span slot="auditStatus" slot-scope="text, record">
  161. <a @click="showLog(record)">{{ text | auditRechargeName }}</a>
  162. </span>
  163. <span slot="action" slot-scope="text, record">
  164. <a @click="handleLook(record)">查看</a>
  165. <a-divider
  166. type="vertical"
  167. v-if="record.applicanterId == userInfo().id && record.auditStatus == '5'"
  168. />
  169. <!-- record.status == '1' || -->
  170. <a
  171. @click="handleDetail(record, 'edit')"
  172. v-if="record.applicanterId == userInfo().id && record.auditStatus == '5'"
  173. >编辑</a
  174. ><a-divider type="vertical" v-if="record.auditStatus == '4'" />
  175. <!-- record.status == '1' || -->
  176. <a
  177. @click="handleLook(record, 'upload')"
  178. v-if="record.auditStatus == '4' && roleCode == 'meidaManager'"
  179. >附件上传</a
  180. ><a-divider type="vertical" v-if="record.auditStatus == '2'" />
  181. <!-- record.status == '1' || -->
  182. <a @click="handleCopy(record)" v-if="record.auditStatus == '2'">复制</a>
  183. <a-divider type="vertical" v-if="record.auditStatus == '3'" />
  184. <!-- record.status == '1' || -->
  185. <a
  186. @click="
  187. editFileVisible = true;
  188. editFilesData = [];
  189. editFilesId = record.id;
  190. "
  191. v-if="
  192. record.auditStatus == '3' &&
  193. (roleCode == 'meidaManager' || roleCode == 'admin')
  194. "
  195. >修改附件</a
  196. >
  197. <a-divider
  198. type="vertical"
  199. v-if="
  200. (record.auditStatus == '1' || record.auditStatus == '2') &&
  201. userInfo().id == record.applicanterId
  202. "
  203. />
  204. <!-- record.status == '1' || -->
  205. <a-popconfirm title="确定撤销此记录吗?" @confirm="() => remove(record.id)">
  206. <a
  207. v-if="
  208. (record.auditStatus == '1' || record.auditStatus == '2') &&
  209. userInfo().id == record.applicanterId
  210. "
  211. >撤销</a
  212. >
  213. </a-popconfirm>
  214. </span>
  215. </a-table>
  216. <a-pagination
  217. class="pagin-table-class"
  218. :total="totalAll"
  219. :show-total="(total) => `共 ${totalAll} 条`"
  220. size="small"
  221. show-size-changer
  222. show-quick-jumper
  223. v-model="tablePag.page"
  224. @change="handleOnShowSizeChange"
  225. @showSizeChange="handleOnShowSizeChange"
  226. />
  227. </div>
  228. <!-- 充值申请 -->
  229. <a-modal
  230. v-if="auditPolicyStatus"
  231. title="充值申请"
  232. :visible="auditPolicyStatus"
  233. :footer="null"
  234. v-dialog-drag
  235. :width="650"
  236. @cancel="
  237. auditPolicyStatus = false;
  238. queryByIdList = { accountList: [] };
  239. totalAmount = undefined;
  240. rebateData = undefined;
  241. "
  242. >
  243. <a-form-model
  244. ref="queryByIdList"
  245. :model="queryByIdList"
  246. :rules="policyOperationRules"
  247. :label-col="labelCol"
  248. :wrapper-col="wrapperCol"
  249. >
  250. <a-form-model-item label="客户名称" prop="advertiserId">
  251. <a-select
  252. v-model="queryByIdList.advertiserId"
  253. placeholder="请选择客户名称"
  254. showSearch
  255. optionFilterProp="children"
  256. :filterOption="filterOption"
  257. allow-clear
  258. @change="getNewProductList"
  259. >
  260. <a-select-option
  261. :value="item.id"
  262. v-for="(item, index) of advertiserList"
  263. :key="index"
  264. >
  265. {{ item.name }}
  266. </a-select-option>
  267. </a-select>
  268. </a-form-model-item>
  269. <a-form-model-item label="产品名称" prop="productId">
  270. <a-select
  271. v-model="queryByIdList.productId"
  272. placeholder="请选择产品名称"
  273. showSearch
  274. optionFilterProp="children"
  275. :filterOption="filterOption"
  276. allow-clear
  277. @change="getMediaList"
  278. >
  279. <a-select-option
  280. :value="item.id"
  281. v-for="(item, index) of productNewList"
  282. :key="index"
  283. >
  284. {{ item.name }}
  285. </a-select-option>
  286. </a-select>
  287. </a-form-model-item>
  288. <a-form-model-item label="媒体" prop="paymentMedia">
  289. <a-select
  290. v-model="queryByIdList.paymentMedia"
  291. placeholder="请选择媒体"
  292. showSearch
  293. optionFilterProp="children"
  294. :filterOption="filterOption"
  295. allow-clear
  296. @change="getProjectList"
  297. >
  298. <a-select-option
  299. :value="item.name"
  300. v-for="(item, index) of mediaList"
  301. :key="index"
  302. >
  303. {{ item.name | paymentMediaName }}
  304. </a-select-option>
  305. </a-select>
  306. </a-form-model-item>
  307. <a-form-model-item label="选择端口" prop="paymentPort">
  308. <a-select
  309. v-model="queryByIdList.paymentPort"
  310. placeholder="请选择端口"
  311. showSearch
  312. optionFilterProp="children"
  313. :filterOption="filterOption"
  314. allow-clear
  315. @change="getMoney"
  316. >
  317. <a-select-option
  318. :value="item.paymentPort"
  319. v-for="(item, index) of paymentPortList"
  320. :key="index"
  321. >
  322. {{ item.portName }}
  323. </a-select-option>
  324. </a-select>
  325. <p v-if="rebateData" style="margin-bottom: 0">
  326. 返点类型:{{
  327. rebateData.rebateType == 1 ? "返货" : "返现"
  328. }}
  329. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 返点比例:{{
  330. rebateData.rebateRate
  331. }}%
  332. </p>
  333. </a-form-model-item>
  334. <a-form-model-item label="可用金额" prop="totalAmount">
  335. {{ totalAmount ? allMoney(totalAmount) : "-" }}
  336. </a-form-model-item>
  337. <a-form-item
  338. :labelCol="labelCol"
  339. :wrapperCol="wrapperCol"
  340. label="是否后补"
  341. prop="amends"
  342. >
  343. <a-radio-group v-model="amends">
  344. <a-radio-button value="2">否</a-radio-button>
  345. <a-radio-button value="1">是</a-radio-button>
  346. </a-radio-group>
  347. </a-form-item>
  348. <a-form-model-item label="备注" prop="remarks">
  349. <a-textarea
  350. v-model="queryByIdList.remarks"
  351. placeholder="请输入备注"
  352. allow-clear
  353. @change="handleRemarksChange"
  354. />
  355. </a-form-model-item>
  356. <a-form-model-item label="类型" prop="rechargeType">
  357. <a-select
  358. v-model="queryByIdList.rechargeType"
  359. placeholder="请选择类型"
  360. allow-clear
  361. >
  362. <a-select-option :value="1">自运营充值</a-select-option>
  363. <a-select-option :value="2">客运营充值</a-select-option>
  364. </a-select>
  365. </a-form-model-item>
  366. <a-form-model-item label="项目" prop="projectId">
  367. <!-- :rules="[-->
  368. <!-- {-->
  369. <!-- required: queryByIdList.rechargeType == 1,-->
  370. <!-- message: '请选择项目',-->
  371. <!-- trigger: 'change',-->
  372. <!-- },-->
  373. <!-- ]"-->
  374. <a-select
  375. v-model="queryByIdList.projectId"
  376. placeholder="请选择项目"
  377. showSearch
  378. optionFilterProp="children"
  379. :filterOption="filterOption"
  380. allow-clear
  381. @change="getAccountList"
  382. >
  383. <a-select-option
  384. :value="item.id"
  385. v-for="(item, index) of projectList"
  386. :key="index"
  387. >
  388. {{ item.name }}({{ item.media }})
  389. </a-select-option>
  390. </a-select>
  391. <a @click="addAccount">添加账户</a>
  392. </a-form-model-item>
  393. <div
  394. v-for="(item, index) in queryByIdList.accountList"
  395. style="position: relative"
  396. >
  397. <a-form-model-item
  398. label="选择账户"
  399. :prop="'accountList.' + index + '.accountId'"
  400. :rules="[{ required: true, message: '请选择账户', trigger: 'change' }]"
  401. v-if="queryByIdList.rechargeType == 1"
  402. >
  403. <a-select
  404. v-model="item.accountId"
  405. placeholder="请选择账户"
  406. showSearch
  407. optionFilterProp="children"
  408. :filterOption="filterOption"
  409. allow-clear
  410. @change="getAccountInfo($event, item)"
  411. >
  412. <a-select-option
  413. :value="item.id"
  414. v-for="(item, index) of accountList"
  415. :key="index"
  416. :disabled="
  417. queryByIdList.accountList.findIndex((c) => {
  418. return c.accountId == item.id;
  419. }) > -1
  420. "
  421. >
  422. {{ item.id }}({{ item.name }})
  423. </a-select-option>
  424. </a-select>
  425. <p v-if="!!item.accountMoney">账户余额:{{ allMoney(item.accountMoney) }}</p>
  426. </a-form-model-item>
  427. <a-form-model-item
  428. label="账户"
  429. :prop="'accountList.' + index + '.accountId'"
  430. :rules="[{ required: true, message: '请填写账户', trigger: 'blur' }]"
  431. v-else-if="queryByIdList.rechargeType == 2"
  432. >
  433. <a-input placeholder="请输入账户" v-model.number="item.accountId"></a-input>
  434. </a-form-model-item>
  435. <a-form-model-item
  436. label="到账金额"
  437. prop="receivedAmount"
  438. :prop="'accountList.' + index + '.receivedAmount'"
  439. :rules="[{ required: true, message: '请输入到账金额', trigger: 'blur' }]"
  440. >
  441. <a-input-number
  442. v-model="item.receivedAmount"
  443. :step="0.01"
  444. :precision="2"
  445. :min="0"
  446. @change="editMoneyNew($event, 1, index)"
  447. />
  448. </a-form-model-item>
  449. <a-form-model-item
  450. label="现金金额"
  451. prop="cashAmount"
  452. :prop="'accountList.' + index + '.cashAmount'"
  453. :rules="[{ required: true, message: '请输入现金金额', trigger: 'blur' }]"
  454. >
  455. <a-input-number
  456. v-model="item.cashAmount"
  457. :step="0.01"
  458. :precision="2"
  459. :min="0"
  460. @change="editMoneyNew($event, 2, index)"
  461. />
  462. </a-form-model-item>
  463. <a
  464. v-if="index > 0"
  465. style="position: absolute; right: 0; top: 0; z-index: 10"
  466. @click="removeAccount(index)"
  467. >删除</a
  468. >
  469. </div>
  470. </a-form-model>
  471. <div solt="footer" style="display: flex; justify-content: end">
  472. <div>
  473. <a-button
  474. type="primary"
  475. class="cancel-btn"
  476. @click="handleAuditSure"
  477. :loading="confirmLoading"
  478. style="margin: 0 10px"
  479. >确定
  480. </a-button>
  481. </div>
  482. <div>
  483. <a-button type="default" class="cancel-btn" @click="handleAuditCancel"
  484. >取消
  485. </a-button>
  486. </div>
  487. </div>
  488. </a-modal>
  489. <!-- 操作记录 -->
  490. <a-modal
  491. v-if="logVisible"
  492. title="操作记录"
  493. :visible="logVisible"
  494. @cancel="logVisible = false"
  495. :footer="null"
  496. v-dialog-drag
  497. >
  498. <div style="height: 400px; overflow: auto; padding: 15px">
  499. <a-steps
  500. progress-dot
  501. direction="vertical"
  502. v-model="logActive"
  503. style="width: 100%"
  504. disbaled
  505. >
  506. <a-step
  507. :title="`${item.roleName}(${item.userName})${
  508. item.auditStatus == '0'
  509. ? '创建申请'
  510. : item.auditStatus == -1
  511. ? '退回修改'
  512. : item.auditStatus == '3'
  513. ? '充值完成'
  514. : item.auditStatus == '4'
  515. ? '临时充值'
  516. : item.auditStatus == '5'
  517. ? '审核拒绝'
  518. : item.auditStatus == '6'
  519. ? '财务审核通过'
  520. : item.auditStatus == '2'
  521. ? '待充值'
  522. : item.auditStatus == '1'
  523. ? '待审核'
  524. : '-'
  525. }`"
  526. :description="`${item.time}`"
  527. v-for="(item, index) in logList"
  528. :key="index"
  529. disabled
  530. :class="{ endStatus: item.auditStatus == 3 }"
  531. />
  532. </a-steps>
  533. </div>
  534. </a-modal>
  535. <!-- 查看详情 -->
  536. <a-modal
  537. v-if="paymentTypeDisable"
  538. title="审核"
  539. :visible="paymentTypeDisable"
  540. :footer="null"
  541. v-dialog-drag
  542. :width="650"
  543. @cancel="
  544. paymentTypeDisable = false;
  545. queryByIdList = { accountList: [] };
  546. files = undefined;
  547. "
  548. >
  549. <a-form-model
  550. ref="showForm"
  551. :model="queryByIdList"
  552. :label-col="labelCol"
  553. :wrapper-col="wrapperCol"
  554. class="margin-small"
  555. >
  556. <div v-if="this.queryByIdList.type != 'upload'">
  557. <a-form-model-item label="客户名称" prop="advertiserName">
  558. {{ queryByIdList.advertiserName }}
  559. </a-form-model-item>
  560. <!-- <a-form-model-item label="产品名称" prop="productName">-->
  561. <!-- {{ queryByIdList.productName }}-->
  562. <!-- </a-form-model-item>-->
  563. <!-- <a-form-model-item label="项目名称" prop="projectName">-->
  564. <!-- {{ queryByIdList.projectName }}-->
  565. <!-- </a-form-model-item>-->
  566. <a-form-model-item label="媒体" prop="paymentMedia">
  567. {{ queryByIdList.paymentMedia | paymentMediaName }}
  568. </a-form-model-item>
  569. <a-form-model-item
  570. label="端口"
  571. prop="portName"
  572. v-if="queryByIdList.paymentMedia != '2'"
  573. >
  574. {{ queryByIdList.portName }}
  575. </a-form-model-item>
  576. <a-form-model-item label="类型" prop="rechargeType">
  577. {{
  578. queryByIdList.rechargeType
  579. ? queryByIdList.rechargeType == "1"
  580. ? "自运营充值"
  581. : "客运营充值"
  582. : "-"
  583. }}
  584. </a-form-model-item>
  585. <a-form-model-item
  586. label="备注"
  587. prop="portName"
  588. v-if="queryByIdList.remarks != '' && queryByIdList.remarks != null"
  589. >
  590. {{ queryByIdList.remarks }}
  591. </a-form-model-item>
  592. <div
  593. style="
  594. max-height: 350px;
  595. overflow: auto;
  596. border-top: 3px solid #f2f2f2;
  597. border-bottom: 3px solid #f2f2f2;
  598. margin-bottom: 15px;
  599. "
  600. >
  601. <div v-for="(item, index) in queryByIdList.accountList" :key="index">
  602. <a-form-model-item label="序号" prop="index" style="color: red">
  603. {{ index + 1 }}
  604. </a-form-model-item>
  605. <a-form-model-item
  606. label="端口"
  607. prop="agentName"
  608. v-if="item.agentName != '' && item.agentName != null"
  609. >
  610. {{ item.agentName }}
  611. </a-form-model-item>
  612. <a-form-model-item label="产品" prop="productName">
  613. {{ item.productName }}
  614. </a-form-model-item>
  615. <a-form-model-item label="账户" prop="accountName">
  616. {{
  617. item.accountName
  618. ? item.accountId + "(" + item.accountName + ")"
  619. : item.accountId
  620. }}
  621. </a-form-model-item>
  622. <a-form-model-item label="政策" prop="rebateRate">
  623. 返点类型:{{
  624. item.rebateType == 1 ? "返货" : "返现"
  625. }}
  626. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 返点比例:{{
  627. item.rebateRate
  628. }}%
  629. </a-form-model-item>
  630. <a-form-model-item label="现金金额" prop="cashAmount">
  631. {{ item.cashAmount }}
  632. </a-form-model-item>
  633. <a-form-model-item label="到账金额" prop="receivedAmount">
  634. {{ item.receivedAmount }}
  635. </a-form-model-item>
  636. </div>
  637. </div>
  638. </div>
  639. <a-form-model-item
  640. v-if="queryByIdList.auditStatus != 3"
  641. label="图片上传"
  642. prop="files"
  643. :rules="{
  644. required: false,
  645. message: '请上传图片',
  646. trigger: 'change',
  647. }"
  648. >
  649. <uploadFile
  650. :value.sync="files"
  651. :multiple="true"
  652. @overUpload="overUpload"
  653. :fileCount="10"
  654. :size="10240"
  655. uploadType="image"
  656. />
  657. </a-form-model-item>
  658. <a-form-model-item
  659. label="查看图片"
  660. prop="files"
  661. v-if="queryByIdList.auditStatus == 3"
  662. >
  663. <!-- <a @click="lookImageClick(queryByIdList.files)">查看图片</a> -->
  664. <div>
  665. <img
  666. :src="item"
  667. alt=""
  668. v-for="(item, index) in JSON.parse(queryByIdList.files)"
  669. :key="index"
  670. style="width: 100px; height: auto; max-height: 100px"
  671. @click="lookImageClick(queryByIdList.files)"
  672. />
  673. </div>
  674. </a-form-model-item>
  675. </a-form-model>
  676. <a-modal
  677. v-if="lookImageVisible"
  678. title="查看图片"
  679. :visible="lookImageVisible"
  680. :footer="null"
  681. @cancel="lookImageVisible = false"
  682. :width="1200"
  683. >
  684. <a-carousel arrows v-if="lookImageData && lookImageData != '-'">
  685. <div
  686. v-for="(item, index) in JSON.parse(lookImageData)"
  687. :key="index"
  688. class="content"
  689. >
  690. <div style="display: flex !important; justify-content: space-around">
  691. <div
  692. style="
  693. display: flex;
  694. flex-direction: column;
  695. align-items: center;
  696. width: 1200px;
  697. "
  698. >
  699. <img :src="item" style="width: 100%; max-height: 720px" />
  700. </div>
  701. </div>
  702. </div>
  703. <a-icon
  704. type="left-circle"
  705. slot="prevArrow"
  706. slot-scope
  707. style="left: 10px; z-index: 100; font-size: 30px; color: black"
  708. />
  709. <a-icon
  710. type="right-circle"
  711. slot="nextArrow"
  712. slot-scope
  713. style="right: 10px; z-index: 100; font-size: 30px; color: black"
  714. />
  715. </a-carousel>
  716. </a-modal>
  717. <div
  718. solt="footer"
  719. style="display: flex; justify-content: end"
  720. v-if="queryByIdList.auditStatus != 3 && queryByIdList.auditStatus != 5"
  721. >
  722. <div v-if="queryByIdList.auditStatus == 2 && roleCode == 'meidaManager'">
  723. <a-button type="primary" @click="toLeader" class="cancel-btn"
  724. >临时通过审核
  725. </a-button>
  726. </div>
  727. <div>
  728. <a-button
  729. type="primary"
  730. class="cancel-btn"
  731. @click="handleOk"
  732. :disabled="roleCode == 'financialReview' ? false : !files"
  733. v-if="
  734. queryByIdList.auditStatus == 1
  735. ? roleCode == 'financialReview'
  736. ? true
  737. : false
  738. : queryByIdList.auditStatus == 2 || queryByIdList.auditStatus == 4
  739. ? roleCode == 'meidaManager'
  740. ? true
  741. : false
  742. : false
  743. "
  744. style="margin: 0 10px"
  745. >通过审核
  746. </a-button>
  747. </div>
  748. <div>
  749. <a-popconfirm
  750. @confirm="handleNo('2')"
  751. v-if="
  752. queryByIdList.auditStatus == 1
  753. ? roleCode == 'financialReview'
  754. ? true
  755. : false
  756. : queryByIdList.auditStatus == 2 || queryByIdList.auditStatus == 4
  757. ? roleCode == 'meidaManager'
  758. ? true
  759. : false
  760. : false
  761. "
  762. >
  763. <div slot="title">
  764. <div>
  765. 拒绝原因:
  766. <a-textarea
  767. placeholder="请输入原因"
  768. v-model="approvalContent"
  769. :autosize="{ minRows: 3, maxRows: 10 }"
  770. />
  771. </div>
  772. </div>
  773. <a-button type="default" class="cancel-btn">审核拒绝</a-button>
  774. </a-popconfirm>
  775. </div>
  776. </div>
  777. </a-modal>
  778. <a-modal
  779. v-if="editFileVisible"
  780. title="修改附件"
  781. :visible="editFileVisible"
  782. :footer="null"
  783. v-dialog-drag
  784. :width="650"
  785. @cancel="
  786. editFileVisible = false;
  787. editFilesData = [];
  788. editFilesId = null;
  789. "
  790. >
  791. <uploadFile
  792. :value.sync="editFilesData"
  793. :multiple="true"
  794. @overUpload="overUpload"
  795. :fileCount="10"
  796. :size="10240"
  797. uploadType="image"
  798. />
  799. <div solt="footer" style="display: flex; justify-content: end">
  800. <div>
  801. <a-button
  802. type="primary"
  803. class="cancel-btn"
  804. @click="handleEditFiles"
  805. style="margin: 0 10px"
  806. :disabled="editFilesData.length == 0"
  807. :loading="editFileLoading"
  808. >确定
  809. </a-button>
  810. </div>
  811. <div>
  812. <a-button
  813. type="default"
  814. class="cancel-btn"
  815. @click="
  816. editFileVisible = false;
  817. editFilesData = [];
  818. editFilesId = null;
  819. "
  820. >取消</a-button
  821. >
  822. </div>
  823. </div>
  824. </a-modal>
  825. </div>
  826. </template>
  827. <script>
  828. import moment from "moment";
  829. import Vue from "vue";
  830. import { ACCESS_TOKEN } from "@/store/mutation-types";
  831. import { getAction, postAction, downFile } from "@/api/manage";
  832. import { mapGetters } from "vuex";
  833. import { urlAcount } from "./policy-management-server.js";
  834. import uploadFile from "@/components/uploadFile.vue";
  835. const fileSuffix = ["xlsx", "xls"];
  836. import JTreeSelect from "@/components/jeecg/JTreeSelect";
  837. function allMoney(num, n) {
  838. n = n || 2;
  839. let symbol = ",";
  840. if (num === null) return num;
  841. if (typeof num !== "number") throw new TypeError("num参数应该是一个number类型");
  842. if (n < 0) throw new Error("参数n不应该小于0");
  843. let hasDot = parseInt(num) != num; //这里检测num是否为小数,true表示小数
  844. let m = n != undefined && n != null ? n : 1;
  845. num =
  846. m == 0 ? num.toFixed(m) + "." : hasDot ? (n ? num.toFixed(n) : num) : num.toFixed(m);
  847. symbol = symbol || ",";
  848. num = num.toString().replace(/(\d)(?=(\d{3})+\.)/g, function (match, p1, p2) {
  849. return p1 + symbol;
  850. });
  851. if (n == 0 || (!hasDot && !n)) {
  852. //如果n为0或者传入的num是整数并且没有指定整数的保留位数,则去掉前面操作中的小数位
  853. num = num.substring(0, num.indexOf("."));
  854. }
  855. return num;
  856. }
  857. export default {
  858. name: "policy-management",
  859. data() {
  860. let handleCharacterLen30 = (rule, value, callback) => {
  861. this.handleExportRules(value, 1, 30, callback);
  862. };
  863. let handleCharacterLen100 = (rule, value, callback) => {
  864. this.handleDescRules(value, 5, 100, callback);
  865. };
  866. return {
  867. editFileVisible: false,
  868. editFilesData: [],
  869. editFilesId: null,
  870. editFileLoading: false,
  871. amends: "2",
  872. roleCode: localStorage.getItem("roleCode"),
  873. approvalContent: undefined,
  874. showAction: true,
  875. list: [],
  876. productList: [],
  877. advertiserList: [],
  878. productNewList: [],
  879. paymentPortList: [],
  880. projectList: [],
  881. mediaList: [],
  882. accountList: [],
  883. totalAmount: undefined,
  884. rebateData: undefined,
  885. paymentTypeDisable: false,
  886. writeRebate: false,
  887. showRebate: false,
  888. oldData: undefined,
  889. mode2: ["month", "month"],
  890. confirmLoading: false,
  891. controlLoading: false,
  892. logVisible: false,
  893. logStatus: 0,
  894. logActive: 2,
  895. logList: [],
  896. allSaleListOption: [],
  897. dataDimensionList: [],
  898. creativeMediaOptions: [
  899. {
  900. id: "",
  901. name: "不限",
  902. },
  903. {
  904. id: 1,
  905. name: "头条",
  906. },
  907. {
  908. id: 2,
  909. name: "快手",
  910. },
  911. {
  912. id: 7,
  913. name: "磁力金牛",
  914. },
  915. {
  916. id: 9,
  917. name: "广点通",
  918. },
  919. {
  920. id: 11,
  921. name: "头条&快手",
  922. },
  923. ],
  924. searchStatusOptions: [
  925. {
  926. id: 1,
  927. name: "待审核",
  928. },
  929. {
  930. id: 3,
  931. name: "审核通过",
  932. },
  933. {
  934. id: 4,
  935. name: "临时通过",
  936. },
  937. {
  938. id: 5,
  939. name: "审核拒绝",
  940. },
  941. ],
  942. subTitleMsgStatus: false,
  943. remarksStatus: false,
  944. changeRules: [
  945. { required: true, message: "请输入产品名称", trigger: "blur" },
  946. { validator: handleCharacterLen30, trigger: "blur" },
  947. ],
  948. addType: "add",
  949. labelCol: { span: 4 },
  950. wrapperCol: { span: 16 },
  951. rejectAuditStatus: false,
  952. rejectionReasonStatus: false,
  953. auditPolicyStatus: false,
  954. policyOperationStatus: false,
  955. voidOperationStatus: false,
  956. totalAll: 0,
  957. policyOperationForm: {},
  958. voidId: undefined,
  959. reasonForm: {
  960. desc: "",
  961. },
  962. // queryByIdListRules:{
  963. // },
  964. policyOperationRules: {
  965. advertiserId: [{ required: true, message: "请选择客户", trigger: "change" }],
  966. productId: [{ required: true, message: "请选择产品", trigger: "change" }],
  967. paymentMedia: [{ required: true, message: "请选择投放媒体", trigger: "change" }],
  968. paymentType: [{ required: true, message: "请选择类型", trigger: "change" }],
  969. rebateType: [{ required: true, message: "请选择返点类型", trigger: "change" }],
  970. rebateRate: [{ required: true, message: "请填写返点比例", trigger: "blur" }],
  971. displayAmount: [{ required: true, message: "请填写垫款金额", trigger: "blur" }],
  972. cashAmount: [{ required: true, message: "请填写现金金额", trigger: "blur" }],
  973. paymentPort: [{ required: true, message: "请选择端口", trigger: "change" }],
  974. rechargeType: [{ required: true, message: "请选择类型", trigger: "change" }],
  975. // projectId: [{ required: true, message: "请选择项目", trigger: "change" }],
  976. },
  977. queryByIdList: {
  978. accountList: [],
  979. },
  980. dataSource: [],
  981. okType: 3,
  982. columns: [
  983. {
  984. title: "客户名称",
  985. align: "center",
  986. dataIndex: "advertiserName",
  987. width: 250,
  988. },
  989. {
  990. title: "媒体",
  991. dataIndex: "paymentMedia",
  992. align: "center",
  993. width: 100,
  994. customRender(t) {
  995. if (t == "1") {
  996. return "头条";
  997. } else if (t == "2") {
  998. return "快手";
  999. } else if (t == "7") {
  1000. return "磁力金牛";
  1001. } else if (t == "9") {
  1002. return "广点通";
  1003. }
  1004. },
  1005. },
  1006. {
  1007. title: "端口",
  1008. align: "center",
  1009. dataIndex: "portName",
  1010. width: 100,
  1011. },
  1012. {
  1013. title: "是否后补",
  1014. dataIndex: "amends",
  1015. align: "center",
  1016. width: 100,
  1017. customRender(t) {
  1018. if (t == "1") {
  1019. return "是";
  1020. } else if (t == "2") {
  1021. return "否";
  1022. }
  1023. },
  1024. },
  1025. {
  1026. title: "产品名称",
  1027. align: "center",
  1028. dataIndex: "productName",
  1029. width: 200,
  1030. },
  1031. {
  1032. title: "账户ID",
  1033. align: "center",
  1034. dataIndex: "accountIds",
  1035. width: 200,
  1036. },
  1037. {
  1038. title: "现金金额",
  1039. dataIndex: "cashAmounts",
  1040. align: "center",
  1041. width: 100,
  1042. customRender(t) {
  1043. if (t) {
  1044. return allMoney(t);
  1045. } else {
  1046. return "-";
  1047. }
  1048. },
  1049. },
  1050. {
  1051. title: "账显金额",
  1052. dataIndex: "receivedAmounts",
  1053. align: "center",
  1054. width: 100,
  1055. customRender(t) {
  1056. if (!!t) {
  1057. return allMoney(t);
  1058. } else {
  1059. return "-";
  1060. }
  1061. },
  1062. },
  1063. // {
  1064. // title: "返点类型",
  1065. // dataIndex: "rebateType",
  1066. // align: "center",
  1067. // width: 100,
  1068. // customRender(t) {
  1069. // if (t == "1") {
  1070. // return "返货";
  1071. // } else if (t == "2") {
  1072. // return "返现";
  1073. // }
  1074. // },
  1075. // },
  1076. {
  1077. title: "充值备注",
  1078. dataIndex: "remarks",
  1079. align: "center",
  1080. width: 100,
  1081. },
  1082. {
  1083. title: "返点",
  1084. dataIndex: "rebateRate",
  1085. align: "center",
  1086. width: 100,
  1087. },
  1088. {
  1089. title: "申请人",
  1090. dataIndex: "applicanter",
  1091. align: "center",
  1092. width: 100,
  1093. },
  1094. {
  1095. title: "申请时间",
  1096. dataIndex: "createTime",
  1097. align: "center",
  1098. scopedSlots: { customRender: "createTime" },
  1099. width: 100,
  1100. },
  1101. {
  1102. title: "状态",
  1103. dataIndex: "auditStatus",
  1104. align: "center",
  1105. scopedSlots: { customRender: "auditStatus" },
  1106. width: 100,
  1107. },
  1108. {
  1109. title: "拒绝原因",
  1110. align: "center",
  1111. dataIndex: "approvalContent",
  1112. customRender(t) {
  1113. if (!!t) {
  1114. return t;
  1115. } else {
  1116. return "-";
  1117. }
  1118. },
  1119. width: 150,
  1120. },
  1121. {
  1122. title: "操作",
  1123. dataIndex: "action",
  1124. align: "center",
  1125. width: 250,
  1126. fixed: "right",
  1127. scopedSlots: { customRender: "action" },
  1128. },
  1129. ],
  1130. configForm: {
  1131. advertiserName: undefined,
  1132. productName: undefined,
  1133. paymentMedia: undefined,
  1134. time: [],
  1135. rebateType: undefined,
  1136. auditStatus: undefined,
  1137. },
  1138. tablePag: {
  1139. page: 1,
  1140. size: 10,
  1141. },
  1142. addAreaList: [],
  1143. saleShowOption: [],
  1144. addSubjectList: [],
  1145. rejectionReasonList: {},
  1146. tableOnlyId: "",
  1147. saleVisible: false,
  1148. saleInfoList: [],
  1149. salePersonList: [],
  1150. saleLoading: false,
  1151. toLeaderVisible: false,
  1152. exportLoading: false,
  1153. lookImageVisible: false,
  1154. lookImageData: null,
  1155. searchForm: this.$form.createForm(this),
  1156. loadDisabled: false,
  1157. files: undefined,
  1158. };
  1159. },
  1160. components: {
  1161. JTreeSelect,
  1162. uploadFile,
  1163. },
  1164. created() {
  1165. if (localStorage.getItem("applicationLog")) {
  1166. this.configForm.advertiserName = localStorage.getItem("applicationLog");
  1167. localStorage.removeItem("applicationLog");
  1168. }
  1169. },
  1170. mounted() {
  1171. this.handleInitTable();
  1172. // this.handleGetAllSaleList();
  1173. // this.handleAddGetArea();
  1174. },
  1175. methods: {
  1176. exportData() {
  1177. this.exportLoading = true;
  1178. const paramsData = {
  1179. userId: this.userInfo().id,
  1180. advertiserName: this.configForm.advertiserName,
  1181. productName: this.configForm.productName,
  1182. paymentMedia: this.configForm.paymentMedia,
  1183. rebateType: this.configForm.rebateType,
  1184. auditStatus: this.configForm.auditStatus,
  1185. accountId: this.configForm.accountId,
  1186. amends: this.configForm.amends,
  1187. startDate:
  1188. this.configForm.time && this.configForm.time.length == 2
  1189. ? moment(this.configForm.time[0]).format("YYYY-MM-DD")
  1190. : null,
  1191. endDate:
  1192. this.configForm.time && this.configForm.time.length == 2
  1193. ? moment(this.configForm.time[1]).format("YYYY-MM-DD")
  1194. : null,
  1195. };
  1196. downFile(
  1197. urlAcount + "/jeecg-boot/financePayment/rechargeApplication/excelInfo",
  1198. paramsData
  1199. ).then((res) => {
  1200. // console.log(res)
  1201. this.exportLoading = false;
  1202. let blob = new Blob([res], {
  1203. type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
  1204. });
  1205. // console.log(blob)
  1206. let downloadElement = document.createElement("a");
  1207. let href = window.URL.createObjectURL(blob); //创建下载的链接
  1208. downloadElement.href = href;
  1209. downloadElement.download = "充值列表" + ".xlsx"; //下载后文件名
  1210. document.body.appendChild(downloadElement);
  1211. downloadElement.click(); //点击下载
  1212. document.body.removeChild(downloadElement); //下载完成移除元素
  1213. window.URL.revokeObjectURL(href); //释放掉blob对象
  1214. });
  1215. },
  1216. lookImageClick(item) {
  1217. this.lookImageVisible = true;
  1218. this.lookImageData = item;
  1219. },
  1220. ...mapGetters(["userInfo"]),
  1221. moment,
  1222. getNewAdvertiserList() {
  1223. var params = {
  1224. table: "finance_payment_pool,advertiser_id,advertiser_name",
  1225. groupBy: "advertiser_id",
  1226. };
  1227. this.postDataAction("/financePayment/pool/querySheetIdAndNameList", params)
  1228. .then((res) => {
  1229. if (res.success) {
  1230. this.advertiserList = res.result;
  1231. } else {
  1232. this.$message.warning(res.message);
  1233. }
  1234. })
  1235. .finally(() => {});
  1236. },
  1237. getNewProductList(value) {
  1238. this.$set(this.queryByIdList, "productId", undefined);
  1239. this.$set(this.queryByIdList, "paymentMedia", undefined);
  1240. this.$set(this.queryByIdList, "projectId", undefined);
  1241. this.$set(this.queryByIdList, "paymentPort", undefined);
  1242. this.queryByIdList.accountList = [];
  1243. this.rebateData = undefined;
  1244. this.totalAmount = undefined;
  1245. if (!!value) {
  1246. var params = {
  1247. table: "finance_payment_pool,product_id,product_name",
  1248. groupBy: "product_id",
  1249. paramters: [
  1250. {
  1251. paramter: "advertiser_id",
  1252. value: value,
  1253. },
  1254. ],
  1255. };
  1256. this.postDataAction("/financePayment/pool/querySheetIdAndNameList", params)
  1257. .then((res) => {
  1258. if (res.success) {
  1259. this.productNewList = res.result;
  1260. } else {
  1261. this.$message.warning(res.message);
  1262. }
  1263. })
  1264. .finally(() => {});
  1265. }
  1266. },
  1267. getMediaList(value) {
  1268. this.$set(this.queryByIdList, "paymentMedia", undefined);
  1269. this.$set(this.queryByIdList, "projectId", undefined);
  1270. this.$set(this.queryByIdList, "paymentPort", undefined);
  1271. this.queryByIdList.accountList = [];
  1272. this.rebateData = undefined;
  1273. this.totalAmount = undefined;
  1274. var params = {
  1275. table: "finance_payment_pool,product_id,payment_media",
  1276. groupBy: "payment_media",
  1277. paramters: [
  1278. {
  1279. paramter: "advertiser_id",
  1280. value: this.queryByIdList.advertiserId,
  1281. },
  1282. {
  1283. paramter: "product_id",
  1284. value: value,
  1285. },
  1286. ],
  1287. };
  1288. this.postDataAction("/financePayment/pool/querySheetIdAndNameList", params)
  1289. .then((res) => {
  1290. if (res.success) {
  1291. this.mediaList = res.result;
  1292. } else {
  1293. this.$message.warning(res.message);
  1294. }
  1295. })
  1296. .finally(() => {});
  1297. },
  1298. getPaymentPortList(params) {
  1299. this.getAction("/financePayment/pool/queryPaymentPort", params)
  1300. .then((res) => {
  1301. if (res.success) {
  1302. this.paymentPortList = res.result;
  1303. } else {
  1304. this.$message.warning(res.message);
  1305. }
  1306. })
  1307. .finally(() => {});
  1308. },
  1309. getProjectList(value) {
  1310. this.$set(this.queryByIdList, "projectId", undefined);
  1311. this.$set(this.queryByIdList, "paymentPort", undefined);
  1312. this.queryByIdList.accountList = [];
  1313. this.rebateData = undefined;
  1314. this.totalAmount = undefined;
  1315. if (!!value) {
  1316. var params = {
  1317. advertiserId: this.queryByIdList.advertiserId,
  1318. type: this.queryByIdList.paymentMedia,
  1319. productId: this.queryByIdList.productId,
  1320. paymentPort: this.queryByIdList.paymentPort,
  1321. paymentMedia: this.queryByIdList.paymentMedia,
  1322. };
  1323. this.getAccountList();
  1324. this.getPaymentPortList(params);
  1325. this.getAction("/financePayment/pool/queryPoolProjectList", params)
  1326. .then((res) => {
  1327. if (res.success) {
  1328. this.projectList = res.result;
  1329. } else {
  1330. this.$message.warning(res.message);
  1331. }
  1332. })
  1333. .finally(() => {});
  1334. } else {
  1335. }
  1336. },
  1337. getMoney() {
  1338. var params = {
  1339. advertiserId: this.queryByIdList.advertiserId,
  1340. type: this.queryByIdList.paymentMedia,
  1341. productId: this.queryByIdList.productId,
  1342. paymentPort: this.queryByIdList.paymentPort,
  1343. };
  1344. this.getAction("/financePayment/pool/queryPool", params)
  1345. .then((res) => {
  1346. if (res.success) {
  1347. this.totalAmount = res.result ? res.result.cashAmount : 0;
  1348. this.rebateData = res.result;
  1349. } else {
  1350. this.$message.warning(res.message);
  1351. }
  1352. })
  1353. .finally(() => {});
  1354. },
  1355. getAccountList() {
  1356. this.queryByIdList.accountList = [];
  1357. var params = {
  1358. advertiserId: this.queryByIdList.advertiserId,
  1359. type: this.queryByIdList.paymentMedia,
  1360. projectId: this.queryByIdList.projectId,
  1361. };
  1362. this.getAction("/financePayment/pool/queryPoolAccountList", params)
  1363. .then((res) => {
  1364. if (res.success) {
  1365. this.accountList = res.result;
  1366. } else {
  1367. this.$message.warning(res.message);
  1368. }
  1369. })
  1370. .finally(() => {});
  1371. },
  1372. removeAccount(index) {
  1373. this.queryByIdList.accountList.splice(index, 1);
  1374. },
  1375. addAccount() {
  1376. this.queryByIdList.accountList.push({
  1377. accountId: undefined,
  1378. cashAmount: undefined,
  1379. receivedAmount: undefined,
  1380. rebateType: undefined,
  1381. rebateRate: undefined,
  1382. accountMoney: undefined,
  1383. });
  1384. },
  1385. getAccountInfo(value, item) {
  1386. if (!!value) {
  1387. var params = {
  1388. media: this.queryByIdList.paymentMedia,
  1389. accountId: value,
  1390. };
  1391. this.getAction("/financePayment/pool/queryAccountBalance", params)
  1392. .then((res) => {
  1393. if (res.success) {
  1394. item.accountMoney = res.result;
  1395. } else {
  1396. this.$message.warning(res.message);
  1397. }
  1398. })
  1399. .finally(() => {});
  1400. } else {
  1401. }
  1402. },
  1403. handleAddPleace() {
  1404. this.rebateData = undefined;
  1405. this.totalAmount = undefined;
  1406. this.auditPolicyStatus = true;
  1407. this.addType = "add";
  1408. this.getNewAdvertiserList();
  1409. },
  1410. handleFilterOption(input, option) {
  1411. return (
  1412. option.componentOptions.children[0].text
  1413. .toLowerCase()
  1414. .indexOf(input.toLowerCase()) >= 0
  1415. );
  1416. },
  1417. filterOption(input, option) {
  1418. return (
  1419. option.componentOptions.children[0].text
  1420. .toLowerCase()
  1421. .indexOf(input.toLowerCase()) >= 0
  1422. );
  1423. },
  1424. handleAddTimesChange(date, dateString) {
  1425. this.policyOperationForm.addTimes = dateString;
  1426. },
  1427. showAreaInfo(data) {
  1428. if (data) {
  1429. var dataShow = this.saleShowOption.filter((item) => {
  1430. return item.saleId == data;
  1431. });
  1432. this.policyOperationForm.areaInfo = dataShow[0].nickName;
  1433. } else {
  1434. this.policyOperationForm.areaInfo = undefined;
  1435. }
  1436. },
  1437. handleAddGetArea(data) {
  1438. const paramsData = {
  1439. userId: this.userInfo().id,
  1440. };
  1441. getAction(urlAcount + "/finance/cwjsPolicyInfo/queryAeraByUserId", paramsData)
  1442. .then((result) => {
  1443. if (result.code === 0) {
  1444. const defaultList = result.result[0].UserCompany;
  1445. this.saleShowOption = defaultList.map((item) => {
  1446. return {
  1447. saleId: item.userId,
  1448. saleName: item.userName,
  1449. };
  1450. });
  1451. this.addAreaList = defaultList[0].nickName.split(",");
  1452. this.addSubjectList = result.result[0].companySubjects;
  1453. getAction(
  1454. urlAcount + "/finance/cwjsSaleAssistantInfo/getCwSaleAndAssistantList",
  1455. paramsData
  1456. )
  1457. .then((result) => {
  1458. if (result.code === 0) {
  1459. for (let i = 0; i < result.result.length; i++) {
  1460. if (this.saleShowOption[0].saleId == result.result[i].saleId) {
  1461. } else {
  1462. this.saleShowOption.push(result.result[i]);
  1463. }
  1464. }
  1465. } else {
  1466. this.$message.error(result.message);
  1467. }
  1468. })
  1469. .catch((error) => {
  1470. console.log(error, "eeee");
  1471. });
  1472. } else {
  1473. this.$message.error(result.message);
  1474. }
  1475. })
  1476. .catch((error) => {
  1477. console.log(error, "eeee");
  1478. });
  1479. },
  1480. handleExamineAll(data) {
  1481. // const paramsData = {
  1482. // id: data.id,
  1483. // type: data.type,
  1484. // userId: this.userInfo().id,
  1485. // approvalContent: data.value,
  1486. // };
  1487. this.postDataAction("/financePayment/rechargeApplication/updateStatus", data)
  1488. .then((result) => {
  1489. if (result.code === 200) {
  1490. this.rejectAuditStatus = false;
  1491. this.auditPolicyStatus = false;
  1492. this.paymentTypeDisable = false;
  1493. this.handleInitTable();
  1494. this.$message.success(result.message);
  1495. } else {
  1496. this.$message.error(result.message);
  1497. }
  1498. })
  1499. .catch((error) => {
  1500. console.log(error, "eeee");
  1501. });
  1502. },
  1503. // 获取所有的媒体 枚举值
  1504. handleGetAllSaleList() {
  1505. const paramsData = {
  1506. userId: this.userInfo().id,
  1507. };
  1508. getAction(
  1509. urlAcount + "/finance/cwjsSaleAssistantInfo/getSaleListByUserDepart",
  1510. paramsData
  1511. )
  1512. .then((result) => {
  1513. if (result.success) {
  1514. this.allSaleListOption = result.result || [];
  1515. } else {
  1516. this.$message.error(result.message);
  1517. }
  1518. })
  1519. .catch((error) => {
  1520. console.log(error, "eeee");
  1521. });
  1522. },
  1523. showLog(item) {
  1524. this.logVisible = true;
  1525. getAction("/financePayment/rechargeApplication/queryAuditProcess", { id: item.id })
  1526. .then((result) => {
  1527. if (result.code === 200) {
  1528. this.logList = result.result;
  1529. this.logActive = this.logList.length - 1;
  1530. } else {
  1531. this.$message.error(result.message);
  1532. }
  1533. })
  1534. .catch((error) => {
  1535. console.log(error, "eeee");
  1536. })
  1537. .finally(() => {});
  1538. },
  1539. // 获取默认的列表数据
  1540. handleInitTable() {
  1541. this.controlLoading = true;
  1542. const paramsData = {
  1543. userId: this.userInfo().id,
  1544. advertiserName: this.configForm.advertiserName,
  1545. productName: this.configForm.productName,
  1546. paymentMedia: this.configForm.paymentMedia,
  1547. rebateType: this.configForm.rebateType,
  1548. auditStatus: this.configForm.auditStatus,
  1549. accountId: this.configForm.accountId,
  1550. amends: this.configForm.amends,
  1551. startDate:
  1552. this.configForm.time && this.configForm.time.length == 2
  1553. ? moment(this.configForm.time[0]).format("YYYY-MM-DD")
  1554. : null,
  1555. endDate:
  1556. this.configForm.time && this.configForm.time.length == 2
  1557. ? moment(this.configForm.time[1]).format("YYYY-MM-DD")
  1558. : null,
  1559. pageNo: this.tablePag.page,
  1560. pageSize: this.tablePag.size,
  1561. };
  1562. getAction("/financePayment/rechargeApplication/list", paramsData)
  1563. .then((result) => {
  1564. if (result.success == true) {
  1565. let defaultList = result.result.list;
  1566. this.dataSource = defaultList;
  1567. this.totalAll = result.result.total;
  1568. } else {
  1569. this.dataSource = [];
  1570. this.tablePag.page = 1;
  1571. this.totalAll = 0;
  1572. this.$message.error(result.message);
  1573. }
  1574. })
  1575. .catch((error) => {
  1576. console.log(error, "eeee");
  1577. })
  1578. .finally(() => {
  1579. this.controlLoading = false;
  1580. });
  1581. },
  1582. overUpload(urlAll) {
  1583. console.log(urlAll);
  1584. },
  1585. handleRemarksChange(e) {
  1586. const targetVal = e.target.value;
  1587. let cnReg = /([\u4e00-\u9fa5]|[\u3000-\u303F]|[\uFF00-\uFF60])/;
  1588. let length = 0;
  1589. let strArr = targetVal.split("");
  1590. strArr.forEach((item) => {
  1591. if (cnReg.test(item)) {
  1592. length += 2;
  1593. } else {
  1594. length += 1;
  1595. }
  1596. });
  1597. if (1 <= length && length <= 500) {
  1598. this.remarksStatus = false;
  1599. } else {
  1600. this.remarksStatus = true;
  1601. }
  1602. },
  1603. handleGroupAbbreviationChange(e) {
  1604. const targetVal = e.target.value;
  1605. let cnReg = /([\u4e00-\u9fa5]|[\u3000-\u303F]|[\uFF00-\uFF60])/;
  1606. let length = 0;
  1607. let strArr = targetVal.split("");
  1608. strArr.forEach((item) => {
  1609. if (cnReg.test(item)) {
  1610. length += 2;
  1611. } else {
  1612. length += 1;
  1613. }
  1614. });
  1615. if (1 <= length && length <= 60) {
  1616. this.subTitleMsgStatus = false;
  1617. } else {
  1618. this.subTitleMsgStatus = true;
  1619. }
  1620. },
  1621. disabledDate(current) {
  1622. return current > moment().subtract(1, "day");
  1623. },
  1624. handleAddOrigin() {
  1625. const randomNum = new Date().getTime() + Math.ceil(Math.random() * 1000);
  1626. this.policyOperationForm.defaultFormList.push({
  1627. id: randomNum,
  1628. value: "",
  1629. });
  1630. },
  1631. handleDelOrigin(list) {
  1632. if (this.policyOperationForm.defaultFormList.length === 1) {
  1633. return;
  1634. }
  1635. let formData = this.policyOperationForm.defaultFormList;
  1636. this.policyOperationForm.defaultFormList = formData.filter(
  1637. (item) => list.id !== item.id
  1638. );
  1639. },
  1640. handleIsDianPayChange(e) {
  1641. if (e.target.value === 0) {
  1642. this.policyOperationForm.dianPayCompanyName = "";
  1643. this.policyOperationForm.dianPayCompanyRebateRate = 0;
  1644. }
  1645. },
  1646. handlePrepaidNotChange(e) {
  1647. if (e.target.value === 1) {
  1648. this.policyOperationForm.accountingPeriod = "";
  1649. this.policyOperationForm.dianPayCompanyName = "";
  1650. this.policyOperationForm.dianPayCompanyRebateRate = 0;
  1651. this.policyOperationForm.isDianPay = undefined;
  1652. } else if (e.target.value === 0) {
  1653. this.policyOperationForm.isDianPay = 0;
  1654. }
  1655. },
  1656. handleExportRules(value, min, max, callback) {
  1657. let cnReg = /([\u4e00-\u9fa5]|[\u3000-\u303F]|[\uFF00-\uFF60])/;
  1658. let length = 0;
  1659. let strArr = value.split("");
  1660. strArr.forEach((item) => {
  1661. if (cnReg.test(item)) {
  1662. length += 2;
  1663. } else {
  1664. length += 1;
  1665. }
  1666. });
  1667. if (min * 2 <= length && length <= max * 2) {
  1668. callback();
  1669. } else {
  1670. callback(`只能输入${min}-${max}个汉字`);
  1671. }
  1672. },
  1673. handleDescRules(value, min, max, callback) {
  1674. let cnReg = /([\u4e00-\u9fa5]|[\u3000-\u303F]|[\uFF00-\uFF60])/;
  1675. let length = 0;
  1676. let strArr = value.split("");
  1677. strArr.forEach((item) => {
  1678. if (cnReg.test(item)) {
  1679. length += 2;
  1680. } else {
  1681. length += 1;
  1682. }
  1683. });
  1684. if (min <= length && length <= max) {
  1685. callback();
  1686. } else {
  1687. callback(`只能输入${min}-${max}个字符`);
  1688. }
  1689. },
  1690. // 分页操作按钮
  1691. handleOnShowSizeChange(current, pageSize) {
  1692. this.tablePag = {
  1693. page: current,
  1694. size: pageSize,
  1695. };
  1696. this.handleInitTable();
  1697. },
  1698. //作废操作
  1699. handleVoid(list) {
  1700. this.voidOperationStatus = true;
  1701. this.voidId = list.id;
  1702. },
  1703. // 编辑按钮操作
  1704. handleEditTable(list) {
  1705. this.addType = "edit";
  1706. this.policyOperationStatus = true;
  1707. this.queryByIdList = list;
  1708. this.policyOperationForm = {
  1709. ...list,
  1710. advertiserId: { key: list.advertiserId, label: list.advertiserName },
  1711. productId: { key: list.productId, label: list.productName },
  1712. files: list.files == "-" ? undefined : JSON.parse(list.files),
  1713. };
  1714. this.getList();
  1715. this.getProductList({ key: list.advertiserId, label: list.advertiserName });
  1716. this.getInfo({ key: list.productId, label: list.productName });
  1717. setTimeout(() => {
  1718. this.$set(this.policyOperationForm, "advertiserId", {
  1719. key: list.advertiserId,
  1720. label: list.advertiserName,
  1721. });
  1722. this.$set(this.policyOperationForm, "productId", {
  1723. key: list.productId,
  1724. label: list.productName,
  1725. });
  1726. this.$set(this.policyOperationForm, "paymentMedia", +list.paymentMedia);
  1727. this.$set(this.policyOperationForm, "paymentPort", +list.paymentPort);
  1728. this.$set(this.policyOperationForm, "cashAmount", list.cashAmount);
  1729. this.$set(this.policyOperationForm, "displayAmount", list.displayAmount);
  1730. this.$set(this.policyOperationForm, "rebateType", +list.rebateType);
  1731. this.$set(this.policyOperationForm, "rebateRate", list.rebateRate);
  1732. this.$set(
  1733. this.policyOperationForm,
  1734. "files",
  1735. list.files == "-" ? undefined : JSON.parse(list.files)
  1736. );
  1737. this.$set(this.policyOperationForm, "remarks", list.remarks);
  1738. this.$set(this.policyOperationForm, "paymentType", +list.paymentType);
  1739. }, 500);
  1740. // this.policyOperationForm = Object.assign({}, list);
  1741. },
  1742. handleAddSureBtn(data, url) {
  1743. postAction(url, data)
  1744. .then((result) => {
  1745. if (result.code === 200) {
  1746. this.totalAmount = undefined;
  1747. this.rebateData = undefined;
  1748. this.$message.success(result.message);
  1749. this.handlePolicyOperationCancel();
  1750. this.handleAuditCancel();
  1751. this.handleInitTable();
  1752. } else {
  1753. this.$message.error(result.message);
  1754. }
  1755. })
  1756. .catch((error) => {
  1757. console.log(error, "eeee");
  1758. })
  1759. .finally(() => {
  1760. this.confirmLoading = false;
  1761. });
  1762. },
  1763. // 新增政策取消按钮
  1764. handlePolicyOperationCancel() {
  1765. this.policyOperationForm = {};
  1766. this.policyOperationStatus = false;
  1767. this.confirmLoading = false;
  1768. this.writeRebate = false;
  1769. this.showRebate = false;
  1770. },
  1771. // 审核拒绝确定按钮
  1772. handleRejectSure() {
  1773. this.$refs.rejectRuleForm.validate((valid) => {
  1774. console.log(valid);
  1775. if (valid) {
  1776. const params = {
  1777. id: this.tableOnlyId || this.queryByIdList.id,
  1778. type: this.okType,
  1779. value: this.reasonForm.desc,
  1780. };
  1781. this.handleExamineAll(params);
  1782. this.handleRejectCancel();
  1783. } else {
  1784. return false;
  1785. }
  1786. });
  1787. },
  1788. //领导审核理由
  1789. handleVoidOk() {
  1790. this.$refs.rejectRuleForm.validate((valid) => {
  1791. if (valid) {
  1792. const params = {
  1793. policyId: this.voidId,
  1794. delReason: this.reasonForm.desc,
  1795. };
  1796. getAction(urlAcount + "/finance/cwjsPolicyInfo/toVoidpolicy", params)
  1797. .then((result) => {
  1798. if (result.code === 0) {
  1799. this.voidOperationStatus = false;
  1800. this.reasonForm.desc = undefined;
  1801. this.handleInitTable();
  1802. } else {
  1803. this.$message.error(result.message);
  1804. }
  1805. })
  1806. .catch((error) => {
  1807. console.log(error, "eeee");
  1808. })
  1809. .finally(() => {
  1810. this.voidOperationStatus = false;
  1811. });
  1812. } else {
  1813. return false;
  1814. }
  1815. });
  1816. },
  1817. //领导审核理由
  1818. handleLeader() {
  1819. this.$refs.rejectRuleForm.validate((valid) => {
  1820. if (valid) {
  1821. const params = {
  1822. id: this.tableOnlyId || this.queryByIdList.id,
  1823. type: 4,
  1824. value: this.reasonForm.desc,
  1825. };
  1826. this.handleExamineAll(params);
  1827. this.handleRejectCancel();
  1828. } else {
  1829. return false;
  1830. }
  1831. });
  1832. },
  1833. // 审核拒绝取消按钮
  1834. handleRejectCancel() {
  1835. this.okType = 3;
  1836. this.reasonForm.desc = "";
  1837. this.rejectAuditStatus = false;
  1838. this.toLeaderVisible = false;
  1839. },
  1840. toLeader() {
  1841. // this.queryByIdList
  1842. this.toLeaderVisible = true;
  1843. this.postDataAction("/financePayment/rechargeApplication/updateStatus", {
  1844. id: this.queryByIdList.id,
  1845. userId: this.userInfo().id,
  1846. auditStatus: 4,
  1847. files: this.files,
  1848. // temporaryPassage: 1,
  1849. }).then((res) => {
  1850. if (res.success) {
  1851. this.toLeaderVisible = false;
  1852. this.paymentTypeDisable = false;
  1853. this.handleInitTable();
  1854. }
  1855. });
  1856. },
  1857. //撤销
  1858. remove(item) {
  1859. this.getAction("/financePayment/rechargeApplication/delete", { id: item })
  1860. .then((res) => {
  1861. if (res.success) {
  1862. this.$message.success("撤销成功");
  1863. this.handleInitTable();
  1864. }
  1865. })
  1866. .catch((error) => {
  1867. this.$message.error(error);
  1868. });
  1869. },
  1870. // 复制信息
  1871. handleCopy(item) {
  1872. this.getAction("/financePayment/rechargeApplication/queryById", {
  1873. id: item.id,
  1874. }).then((res) => {
  1875. this.getAction(
  1876. "/financePayment/rechargeApplication/queryRechargeAccountDetails",
  1877. {
  1878. rechargeId: item.id,
  1879. }
  1880. ).then((result) => {
  1881. var data = `
  1882. 客户名称:${item.advertiserName}
  1883. 产品:${item.productName}
  1884. 政策类型:${result.result[0].rebateType == 1 ? "返货" : "返现"}
  1885. 返点比例: ${result.result[0].rebateRate}
  1886. `;
  1887. for (let i = 0; i < result.result.length; i++) {
  1888. data += `
  1889. 账户名称:${result.result[i].accountName}
  1890. 账户ID: ${result.result[i].accountId}
  1891. 现金金额: ${this.allMoney(result.result[i].cashAmount)}
  1892. 到账金额:${this.allMoney(result.result[i].receivedAmount)}`;
  1893. }
  1894. if (navigator.clipboard && window.isSecureContext) {
  1895. navigator.clipboard
  1896. .writeText(data)
  1897. .then(() => {
  1898. this.$message.success("复制成功");
  1899. })
  1900. .catch((err) => {
  1901. this.$message.error("复制失败");
  1902. });
  1903. } else {
  1904. // 创建text area
  1905. const textArea = document.createElement("textarea");
  1906. textArea.value = data;
  1907. // 使text area不在viewport,同时设置不可见
  1908. document.body.appendChild(textArea);
  1909. textArea.focus();
  1910. textArea.select();
  1911. return new Promise((resolve, reject) => {
  1912. // 执行复制命令并移除文本框
  1913. document.execCommand("copy") ? resolve() : reject(new Error("出错了"));
  1914. textArea.remove();
  1915. }).then(
  1916. () => {
  1917. this.$message.success("复制成功");
  1918. },
  1919. () => {
  1920. this.$message.error("复制失败");
  1921. }
  1922. );
  1923. }
  1924. });
  1925. });
  1926. },
  1927. // 查看的按钮
  1928. handleLook(list, type) {
  1929. this.files = undefined;
  1930. this.paymentTypeDisable = true;
  1931. this.getAction("/financePayment/rechargeApplication/queryById", {
  1932. id: list.id,
  1933. }).then((res) => {
  1934. this.getAction(
  1935. "/financePayment/rechargeApplication/queryRechargeAccountDetails",
  1936. {
  1937. rechargeId: list.id,
  1938. }
  1939. ).then((result) => {
  1940. this.queryByIdList = {
  1941. ...res.result,
  1942. newFiles: undefined,
  1943. rechargeType: +res.result.rechargeType,
  1944. accountList: result.result,
  1945. type: type,
  1946. };
  1947. console.log(this.queryByIdList);
  1948. });
  1949. });
  1950. },
  1951. // 编辑的按钮
  1952. handleDetail(list, type) {
  1953. this.addType = "edit";
  1954. this.auditPolicyStatus = true;
  1955. this.queryByIdList = {
  1956. ...list,
  1957. newFiles: undefined,
  1958. type: type,
  1959. rechargeType: +list.rechargeType,
  1960. accountList: [],
  1961. };
  1962. this.getNewAdvertiserList();
  1963. this.$set(this.queryByIdList, "advertiserId", list.advertiserId);
  1964. this.getNewProductList(this.queryByIdList.advertiserId);
  1965. this.$set(this.queryByIdList, "productId", list.productId);
  1966. this.getMediaList(this.queryByIdList.productId);
  1967. this.$set(this.queryByIdList, "paymentMedia", list.paymentMedia);
  1968. this.getProjectList(this.queryByIdList.paymentMedia);
  1969. this.$set(this.queryByIdList, "projectId", list.projectId);
  1970. this.getAccountList();
  1971. this.getAction("/financePayment/rechargeApplication/queryRechargeAccountDetails", {
  1972. rechargeId: list.id,
  1973. }).then((res) => {
  1974. this.queryByIdList.accountList.push(...res.result);
  1975. });
  1976. this.rebateData = { rebateType: list.rebateType, rebateRate: list.rebateRate };
  1977. },
  1978. // 查看的取消按钮
  1979. handleCloseAuditPolicy() {
  1980. this.auditPolicyStatus = false;
  1981. },
  1982. editMoneyNew(value, type, index) {
  1983. if (
  1984. type == 1 &&
  1985. !!this.rebateData &&
  1986. (!!this.rebateData.rebateRate || this.rebateData.rebateRate == 0)
  1987. ) {
  1988. this.$set(
  1989. this.queryByIdList.accountList[index],
  1990. "cashAmount",
  1991. this.rebateData.rebateType == 1
  1992. ? Math.floor((value / (1 + this.rebateData.rebateRate / 100)) * 100) / 100
  1993. : Math.floor(value * (1 - this.rebateData.rebateRate / 100) * 100) / 100
  1994. );
  1995. } else if (
  1996. type == 2 &&
  1997. !!this.rebateData &&
  1998. (!!this.rebateData.rebateRate || this.rebateData.rebateRate == 0)
  1999. ) {
  2000. this.$set(
  2001. this.queryByIdList.accountList[index],
  2002. "receivedAmount",
  2003. this.rebateData.rebateType == 1
  2004. ? Math.floor(value * (1 + this.rebateData.rebateRate / 100) * 100) / 100
  2005. : Math.floor((value / (1 - this.rebateData.rebateRate / 100)) * 100) / 100
  2006. );
  2007. } else {
  2008. this.$message.error("暂未返点比例");
  2009. }
  2010. },
  2011. // 查看-审核政策-审核通过-按钮
  2012. handleAuditSure(list) {
  2013. this.$refs.queryByIdList.validate((valid) => {
  2014. if (valid) {
  2015. var that = this;
  2016. var total = this.queryByIdList.accountList
  2017. .map((item) => {
  2018. return item.cashAmount;
  2019. })
  2020. .reduce((o, n) => {
  2021. return +o + +n;
  2022. }, 0);
  2023. var amendsStr = this.amends;
  2024. let names = this.queryByIdList.accountList.map((item) => item["accountId"]);
  2025. let nameSet = new Set(names);
  2026. if (nameSet.size == names.length) {
  2027. const paramsData = {
  2028. ...this.queryByIdList,
  2029. applicanterId: this.userInfo().id,
  2030. userId: this.userInfo().id,
  2031. totalAmount: total,
  2032. amends: amendsStr,
  2033. financialReview: total > +that.totalAmount ? 1 : 0,
  2034. list: this.queryByIdList.accountList.map((item) => {
  2035. return {
  2036. ...item,
  2037. rebateType: this.rebateData ? this.rebateData.rebateType : null,
  2038. rebateRate: this.rebateData ? this.rebateData.rebateRate : null,
  2039. };
  2040. }),
  2041. };
  2042. console.log(paramsData, that.totalAmount);
  2043. this.confirmLoading = true;
  2044. if (
  2045. !!this.rebateData &&
  2046. (!!this.rebateData.rebateRate || this.rebateData.rebateRate == 0)
  2047. ) {
  2048. if (this.addType === "add") {
  2049. this.handleAddSureBtn(
  2050. paramsData,
  2051. "/financePayment/rechargeApplication/add"
  2052. );
  2053. } else {
  2054. this.handleAddSureBtn(
  2055. { ...paramsData },
  2056. "/financePayment/rechargeApplication/edit"
  2057. );
  2058. }
  2059. } else {
  2060. this.$message.error("暂时不能进行新增\修改操作,请联系管理员!");
  2061. }
  2062. } else {
  2063. this.$message.error("账户ID填写重复,请检查");
  2064. }
  2065. } else {
  2066. return false;
  2067. }
  2068. });
  2069. },
  2070. okFour(data) {
  2071. this.postDataAction(
  2072. "/financePayment/rechargeApplication/updateTemporaryFiles",
  2073. data
  2074. ).then((result) => {
  2075. if (result.code === 200) {
  2076. this.rejectAuditStatus = false;
  2077. this.auditPolicyStatus = false;
  2078. this.paymentTypeDisable = false;
  2079. this.handleInitTable();
  2080. this.$message.success(result.message);
  2081. } else {
  2082. this.$message.error(result.message);
  2083. }
  2084. });
  2085. },
  2086. // 查看-取消
  2087. handleAuditCancel(data) {
  2088. this.queryByIdList = { accountList: [] };
  2089. this.rebateData = undefined;
  2090. this.totalAmount = undefined;
  2091. this.auditPolicyStatus = false;
  2092. },
  2093. // 通过审核
  2094. handleOk() {
  2095. let that = this;
  2096. this.$confirm({
  2097. title: "提示",
  2098. content: "确认该审核通过",
  2099. onOk() {
  2100. if (that.queryByIdList.auditStatus == 4) {
  2101. const paramsFour = {
  2102. id: that.queryByIdList.id,
  2103. files: that.files,
  2104. };
  2105. that.okFour(paramsFour);
  2106. } else {
  2107. const params = {
  2108. id: that.queryByIdList.id,·
  2109. auditStatus:
  2110. that.queryByIdList.auditStatus == 1
  2111. ? 2
  2112. : that.queryByIdList.auditStatus == 2
  2113. ? 3
  2114. : that.queryByIdList.auditStatus,
  2115. userId: that.userInfo().id,
  2116. files: that.files,
  2117. };
  2118. that.handleExamineAll(params);
  2119. }
  2120. },
  2121. });
  2122. },
  2123. // 修改附件
  2124. handleEditFiles() {
  2125. if (this.editFilesData.length > 0) {
  2126. this.editFileLoading = true;
  2127. this.postDataAction("/financePayment/rechargeApplication/editAll", {
  2128. id: this.editFilesId,
  2129. files: this.editFilesData,
  2130. }).then((res) => {
  2131. if (res.success) {
  2132. this.editFileLoading = false;
  2133. this.editFileVisible = false;
  2134. this.editFilesData = [];
  2135. this.editFilesId = null;
  2136. }else{
  2137. this.$message.error(res.message)
  2138. }
  2139. });
  2140. } else {
  2141. this.$message.error("请上传附件");
  2142. }
  2143. },
  2144. // 审核拒绝
  2145. handleNo() {
  2146. const params = {
  2147. id: this.queryByIdList.id,
  2148. auditStatus: 5,
  2149. userId: this.userInfo().id,
  2150. approvalContent: this.approvalContent,
  2151. };
  2152. this.handleExamineAll(params);
  2153. },
  2154. handleSubmitEdit(list) {},
  2155. // 被拒理由的操作
  2156. handleRejectionReason(val) {
  2157. this.rejectionReasonList = val;
  2158. this.rejectionReasonStatus = true;
  2159. },
  2160. // 被拒理由确定按钮
  2161. handleModeSure() {
  2162. this.rejectionReasonStatus = false;
  2163. },
  2164. // 被拒理由取消按钮
  2165. handleModeCancel() {
  2166. this.rejectionReasonStatus = false;
  2167. },
  2168. // 搜索按钮
  2169. handleQueryList() {
  2170. this.tablePag = {
  2171. page: 1,
  2172. size: 10,
  2173. };
  2174. this.handleInitTable();
  2175. },
  2176. // 重置搜索
  2177. handleResetList() {
  2178. this.configForm = {
  2179. companyId: undefined,
  2180. userName: undefined,
  2181. media: undefined,
  2182. departId: undefined,
  2183. time: [],
  2184. status: undefined,
  2185. type: undefined,
  2186. accountId: undefined,
  2187. amends: undefined,
  2188. };
  2189. this.tablePag = {
  2190. page: 1,
  2191. size: 10,
  2192. };
  2193. this.handleInitTable();
  2194. },
  2195. },
  2196. };
  2197. </script>
  2198. <style lang="less" scoped>
  2199. @import "policy-management";
  2200. </style>