policy-management.vue 77 KB

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