SettlementSource.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  1. <template>
  2. <div>
  3. <div class="p-2">
  4. <el-form :inline="true" :model="pageRequest" size="small" label-width="120px">
  5. <el-row>
  6. <el-col :span="6">
  7. <el-form-item label="车牌号:">
  8. <el-input v-model="pageRequest.licenseno" placeholder="请输入车牌号" class="widths" clearable></el-input>
  9. </el-form-item>
  10. </el-col>
  11. <el-col :span="6">
  12. <el-form-item label="险种">
  13. <el-input v-model="pageRequest.insuranceType" placeholder="请输入车牌号" class="widths" clearable></el-input>
  14. </el-form-item>
  15. </el-col>
  16. <el-col :span="6">
  17. <el-form-item label="保险公司">
  18. <el-select v-model="pageRequest.insuranceId" filterable class="widths" clearable>
  19. <el-option v-for="val in companyList" :key="val.id" :label="val.name" :value="val.id"></el-option>
  20. </el-select>
  21. </el-form-item>
  22. </el-col>
  23. <el-col :span="6">
  24. <el-form-item label="交强保单号:">
  25. <el-input v-model="pageRequest.jqPolicyId" placeholder="请输入交强保单号" class="widths" clearable></el-input>
  26. </el-form-item>
  27. </el-col>
  28. <el-col :span="6">
  29. <el-form-item label="商业保单号:">
  30. <el-input v-model="pageRequest.syPolicyId" placeholder="请输入商业保单号" class="widths" clearable></el-input>
  31. </el-form-item>
  32. </el-col>
  33. <el-col :span="6">
  34. <el-form-item label="非车保单号:">
  35. <el-input v-model="pageRequest.nonCarPolicyId" placeholder="请输入非车保单号" class="widths" clearable></el-input>
  36. </el-form-item>
  37. </el-col>
  38. <el-col :span="6">
  39. <el-form-item label="渠道:">
  40. <el-input v-model="pageRequest.channel" placeholder="请输入渠道" class="widths" clearable></el-input>
  41. </el-form-item>
  42. </el-col>
  43. <el-col :span="6">
  44. <el-form-item label="渠道等级:">
  45. <el-input v-model="pageRequest.channelClassification" placeholder="请输入渠道等级" class="widths"
  46. clearable></el-input>
  47. </el-form-item>
  48. </el-col>
  49. <el-col :span="6">
  50. <el-form-item label="被保险人:">
  51. <el-input v-model="pageRequest.insuredName" placeholder="请输入被保险人" class="widths" clearable></el-input>
  52. </el-form-item>
  53. </el-col>
  54. <el-col :span="6">
  55. <el-form-item label="结算时间:">
  56. <el-date-picker v-model="agencySettlementTime" type="daterange" @change="agencySettlementTimeChange"
  57. start-placeholder="开始日期" end-placeholder="结束日期" class="widths" value-format="yyyy-MM-dd"
  58. style="width: 220px" clearable>
  59. </el-date-picker>
  60. </el-form-item>
  61. </el-col>
  62. <el-col :span="6">
  63. <el-form-item label="签单日期">
  64. <el-date-picker v-model="signDateTime" type="daterange" @change="signDateChange" start-placeholder="开始日期"
  65. end-placeholder="结束日期" class="widths" value-format="yyyy-MM-dd" style="width: 220px" clearable>
  66. </el-date-picker>
  67. </el-form-item>
  68. </el-col>
  69. </el-row>
  70. </el-form>
  71. <div class="flex j-end" style="margin-right: 100px">
  72. <el-button type="danger" size="small" @click="templateDownload" style="margin-right: 20px">下载模板</el-button>
  73. <el-button type="primary" size="small" @click="Search" style="margin-right: 20px">查询</el-button>
  74. <el-upload class="upload-demo" :auto-upload="false" :on-change="writeOffUpload" action="###"
  75. :show-file-list="false">
  76. <el-button size="small" type="primary">数据导入</el-button>
  77. </el-upload>
  78. </div>
  79. </div>
  80. <el-main ref="elMain" style="padding: 0px">
  81. <kt-common-table :SerialShow="false" :operationWidth="150" :showOperation="true" permsDelete="sys:user:delete"
  82. :showBatchDelete="true" :showBatchSettled="true" :showBatchPrint="true" permsButton1="sys:user:edit"
  83. permsButton2="sys:user:edit" permsButton3="sys:user:edit" :data="pageResult" :columns="columns"
  84. @findPage="findPage" keyName="id" settledName="批量修改" @handleSettled="handleTableSettled"
  85. @handlePrint="handlePrint" @handleDelete="handleDelete" button1Name="修改" button1Background="#E6A23C"
  86. @handleButton1="sourceUpdate" button1Icon="">
  87. </kt-common-table>
  88. </el-main>
  89. <el-dialog title="信息修改" :visible.sync="dialogFormVisible" v-dialogDrag :close-on-click-modal="false" width="60%">
  90. <el-form :model="updateform" :inline="true" label-width="130px" size="small">
  91. <el-form-item label="渠道:">
  92. <el-input v-model="updateform.channel" autocomplete="off" class="widths"></el-input>
  93. </el-form-item>
  94. <el-form-item label="车牌号:">
  95. <el-input v-model="updateform.licenseno" autocomplete="off" class="widths"></el-input>
  96. </el-form-item>
  97. <el-form-item label="被保险人:">
  98. <el-input v-model="updateform.insuredName" autocomplete="off" class="widths"></el-input>
  99. </el-form-item>
  100. <el-form-item label="险种:">
  101. <el-input v-model="updateform.insuranceType" autocomplete="off" class="widths"></el-input>
  102. </el-form-item>
  103. <el-form-item label="业务归属:">
  104. <el-input v-model="updateform.businessOwner" autocomplete="off" class="widths"></el-input>
  105. </el-form-item>
  106. <el-form-item label="交强保费:">
  107. <el-input v-model="updateform.jqPremiumTax" autocomplete="off" class="widths"></el-input>
  108. </el-form-item>
  109. <el-form-item label="商业保费:">
  110. <el-input v-model="updateform.syPremiumTax" autocomplete="off" class="widths"></el-input>
  111. </el-form-item>
  112. <el-form-item label="非车保费:">
  113. <el-input v-model="updateform.nonCarPremiumTax" autocomplete="off" class="widths"></el-input>
  114. </el-form-item>
  115. <el-form-item label="交强应收比例:">
  116. <el-input v-model="updateform.compulsoryExportRatio" autocomplete="off" class="widths"></el-input>
  117. </el-form-item>
  118. <el-form-item label="商业应收比例:">
  119. <el-input v-model="updateform.commercialExportRatio" autocomplete="off" class="widths"></el-input>
  120. </el-form-item>
  121. <el-form-item label="非车应收比例:">
  122. <el-input v-model="updateform.nonVehicleExportRatio" autocomplete="off" class="widths"></el-input>
  123. </el-form-item>
  124. </el-form>
  125. <div slot="footer" class="dialog-footer">
  126. <el-button size="small" @click="dialogFormVisible = false">取 消</el-button>
  127. <el-button size="small" type="primary" @click="updateSubmit">确 定</el-button>
  128. </div>
  129. </el-dialog>
  130. <el-dialog title="批量修改" :visible.sync="dialogUpdateVisible" v-dialogDrag :close-on-click-modal="false" width="60%">
  131. <el-form :model="batchSizeForm" :inline="true" label-width="130px" size="small">
  132. <el-form-item label="业务归属:">
  133. <el-input v-model="batchSizeForm.businessOwner" autocomplete="off" class="widths"></el-input>
  134. </el-form-item>
  135. <el-form-item label="交强出口比例:">
  136. <el-input v-model="batchSizeForm.compulsoryExportRatio" autocomplete="off" class="widths"></el-input>
  137. </el-form-item>
  138. <el-form-item label="商业出口比例:">
  139. <el-input v-model="batchSizeForm.commercialExportRatio" autocomplete="off" class="widths"></el-input>
  140. </el-form-item>
  141. <el-form-item label="非车出口比例:">
  142. <el-input v-model="batchSizeForm.nonVehicleExportRatio" autocomplete="off" class="widths"></el-input>
  143. </el-form-item>
  144. </el-form>
  145. <div slot="footer" class="dialog-footer">
  146. <el-button size="small" @click="dialogUpdateVisible = false">取 消</el-button>
  147. <el-button size="small" type="primary" @click="BulkUpdate">确 定</el-button>
  148. </div>
  149. </el-dialog>
  150. </div>
  151. </template>
  152. <script>
  153. import KtCommonTable from "@/views/Core/KtCommonTable.vue"; //表格组件
  154. import KtButton from "@/views/Core/KtButton";
  155. import CommonUtil from "@/utils/comutil.js";
  156. export default {
  157. components: {
  158. KtCommonTable,
  159. KtButton,
  160. },
  161. data() {
  162. return {
  163. signDateTime: [],
  164. agencySettlementTime: [],
  165. pageRequest: {
  166. //查询的默认条件
  167. pageNum: 1,
  168. pageSize: 20,
  169. licenseno: "",
  170. insuranceType: "",
  171. insuranceId: "",
  172. signDate: "",
  173. jqPolicyId: "",
  174. syPolicyId: "",
  175. nonCarPolicyId: "",
  176. channel: "",
  177. channelClassification: "",
  178. insuredName: "",
  179. agencySettlementTime: "",
  180. },
  181. // 右侧列表查询数据Start
  182. dialogFormVisible: false,
  183. dialogUpdateVisible: false,
  184. pageResult: [],
  185. updateform: {
  186. channel: "",
  187. licenseno: "",
  188. insuredName: "",
  189. insuranceType: "",
  190. businessOwner: "",
  191. jqPremiumTax: "",
  192. syPremiumTax: "",
  193. nonCarPremiumTax: "",
  194. compulsoryExportRatio: "",
  195. commercialExportRatio: "",
  196. nonVehicleExportRatio: "",
  197. },
  198. batchSizeForm: {
  199. businessOwner: "",
  200. compulsoryExportRatio: "",
  201. commercialExportRatio: "",
  202. nonVehicleExportRatio: "",
  203. },
  204. batchSizeList: [],
  205. columns: [
  206. //数据列
  207. { prop: "id", label: " 编号", minWidth: 160 },
  208. { prop: "operationsTeam", label: "运营小组", minWidth: 100 },
  209. { prop: "channelClassification", label: "渠道分级", minWidth: 100 },
  210. { prop: "channel", label: "渠道", minWidth: 120 },
  211. { prop: "employeeId", label: "工号", minWidth: 160 },
  212. { prop: "signDate", label: "签单日期", minWidth: 160 },
  213. { prop: "licenseno", label: "车牌号", minWidth: 160 },
  214. { prop: "insuredName", label: "被保险人", minWidth: 100 },
  215. { prop: "insuranceCompany", label: "保险公司", minWidth: 120 },
  216. { prop: "insuranceType", label: "险种", minWidth: 120 },
  217. { prop: "businessOwner", label: "业务归属", minWidth: 120 },
  218. {
  219. prop: "jqPolicyId",
  220. label: "交强保单号",
  221. minWidth: 180,
  222. },
  223. { prop: "syPolicyId", label: "商业保单号", minWidth: 180 },
  224. { prop: "nonCarPolicyId", label: "非车保单号", minWidth: 180 },
  225. { prop: "jqPremiumTax", label: "交强保费", minWidth: 140 },
  226. { prop: "vehicleTax", label: "车船税", minWidth: 140 },
  227. { prop: "syPremiumTax", label: "商业保费", minWidth: 140 },
  228. { prop: "nonCarPremiumTax", label: "非车保费", minWidth: 140 },
  229. { prop: "compulsoryExportRatio", label: "交强出口比例", minWidth: 140 },
  230. { prop: "commercialExportRatio", label: "商业出口比例", minWidth: 140 },
  231. { prop: "nonVehicleExportRatio", label: "非车出口比例", minWidth: 140 },
  232. { prop: "subsidyRatio", label: "补贴比例", minWidth: 140 },
  233. { prop: "subsidyAmount", label: "补贴金额", minWidth: 140 },
  234. { prop: "settlementAmount", label: "结算金额", minWidth: 140 },
  235. { prop: "agencySettlementTime", label: "代理结算时间", minWidth: 160 },
  236. ],
  237. companyList: [],
  238. };
  239. },
  240. created() {
  241. this.companyInt();
  242. },
  243. mounted() { },
  244. methods: {
  245. //模板下载
  246. templateDownload() {
  247. this.$api.task.settlementTemplate().then((res) => {
  248. if (res.code == '200') {
  249. let url = process.env.BASE_URL + res.data;
  250. let a = document.createElement("a");
  251. a.href = url;
  252. a.click();
  253. window.URL.revokeObjectURL(url);
  254. } else {
  255. this.$message({
  256. type: 'error',
  257. message: res.msg,
  258. });
  259. }
  260. });
  261. },
  262. signDateChange(e) {
  263. if (e == null) {
  264. this.pageRequest.signDate = "";
  265. } else {
  266. this.pageRequest.signDate = e.toString();
  267. }
  268. },
  269. agencySettlementTimeChange(e) {
  270. if (e == null) {
  271. this.pageRequest.agencySettlementTime = "";
  272. } else {
  273. this.pageRequest.agencySettlementTime = e.toString();
  274. }
  275. },
  276. //保险公司查询
  277. companyInt() {
  278. this.$api.letter.gainTopList().then((res) => {
  279. this.companyList = res.data;
  280. });
  281. },
  282. //附件上传
  283. writeOffUpload(file) {
  284. var file = file.raw;
  285. const params = new FormData(); // 声明formData数据类型
  286. params.append("multipartFile", file);
  287. params.append("type", "settle");
  288. this.$api.letter.uploadFile(params).then((res) => {
  289. if (res.code == "200") {
  290. let url = process.env.BASE_URL + res.data.url;
  291. this.$api.task.settlementExcel(url).then((res) => {
  292. if (res.code == "200") {
  293. this.$message({
  294. type: "success",
  295. message: res.msg,
  296. });
  297. this.findPage();
  298. this.isVisibleexecuteMethod();
  299. } else {
  300. this.$message({
  301. type: "error",
  302. message: res.msg,
  303. });
  304. }
  305. });
  306. }
  307. });
  308. },
  309. //是否匹配
  310. isVisibleexecuteMethod() {
  311. this.$api.task.isVisibledataMatching().then((res) => {
  312. if (res.data) {
  313. this.$alert(res.msg, "匹配提示", {
  314. confirmButtonText: "关闭",
  315. callback: (action) => { },
  316. });
  317. } else {
  318. }
  319. });
  320. },
  321. handleTableSettled(ids) {
  322. this.batchSizeList = ids;
  323. Object.keys(this.batchSizeForm).forEach((key) => {
  324. this.batchSizeForm[key] = "";
  325. });
  326. this.dialogUpdateVisible = true;
  327. },
  328. handleDelete(ids) {
  329. this.$confirm("此操作将永久删除, 是否继续?", "提示", {
  330. confirmButtonText: "确定",
  331. cancelButtonText: "取消",
  332. type: "warning",
  333. })
  334. .then(() => {
  335. this.$api.task.SettlementDeletes(ids).then((res) => {
  336. if (res.code == "200") {
  337. this.$message({
  338. type: "success",
  339. message: "删除成功!",
  340. });
  341. this.findPage();
  342. } else {
  343. this.$message({
  344. type: "error",
  345. message: res.msg,
  346. });
  347. }
  348. });
  349. })
  350. .catch(() => {
  351. this.$message({
  352. type: "info",
  353. message: "已取消删除",
  354. });
  355. });
  356. },
  357. BulkUpdate() {
  358. let params = {
  359. ids: this.batchSizeList,
  360. businessOwner: this.batchSizeForm.businessOwner,
  361. compulsoryExportRatio: this.batchSizeForm.compulsoryExportRatio,
  362. commercialExportRatio: this.batchSizeForm.commercialExportRatio,
  363. nonVehicleExportRatio: this.batchSizeForm.nonVehicleExportRatio,
  364. };
  365. this.$api.task.SettlementUpdates(params).then((res) => {
  366. if (res.code == "200") {
  367. this.$message({
  368. type: "success",
  369. message: "修改成功!",
  370. });
  371. this.dialogUpdateVisible = false;
  372. this.findPage();
  373. } else {
  374. this.$message({
  375. type: "error",
  376. message: res.msg,
  377. });
  378. }
  379. });
  380. },
  381. sourceUpdate({ row, column }) {
  382. this.dialogFormVisible = true;
  383. this.updateform = row;
  384. },
  385. Search() {
  386. this.findPage();
  387. },
  388. updateSubmit() {
  389. this.$api.task.settlementUpdate(this.updateform).then((res) => {
  390. if (res.code == "200") {
  391. this.$message({
  392. type: "success",
  393. message: res.msg,
  394. });
  395. this.dialogFormVisible = false;
  396. this.findPage();
  397. } else {
  398. this.$message({
  399. type: "error",
  400. message: res.msg,
  401. });
  402. }
  403. });
  404. },
  405. handlePrint() {
  406. this.$api.task.SettlementExport(this.pageRequest).then((res) => {
  407. let url = process.env.BASE_URL + res.msg;
  408. // 4.创建url之后可以模拟对此文件对象的一系列操作,例如:预览、下载
  409. let a = document.createElement("a");
  410. a.href = url;
  411. a.download = "结算来源表.xlsx";
  412. a.click();
  413. // 5.释放这个临时的对象url
  414. window.URL.revokeObjectURL(url);
  415. });
  416. },
  417. //联级选择器触发事件
  418. handleChange(val) {
  419. if (val.length !== 0) {
  420. this.pageRequest.deptId = val.at(-1);
  421. } else {
  422. this.pageRequest.deptId = "";
  423. }
  424. },
  425. //-- formatter begin--
  426. agreetypeFormatter(row, column) {
  427. //协议类型
  428. let agreetype = row.agreetype;
  429. return CommonUtil.getDataName({
  430. dataList: this.agreementtypeoptions,
  431. value: "value",
  432. label: "label",
  433. data: agreetype,
  434. });
  435. },
  436. inscompanyFormatter(row, column) {
  437. //协议类型
  438. let inscompany = row.inscompany;
  439. return CommonUtil.getDataName({
  440. dataList: this.global.insCompanyList,
  441. value: "code",
  442. label: "name",
  443. data: inscompany,
  444. });
  445. },
  446. timeFormatter(row, column) {
  447. let time = this.transformTime(row.createTime);
  448. return time;
  449. },
  450. totalmoenyFormatter(row, column) {
  451. //协议类型
  452. let inscompany = row.inscompany;
  453. return (row.feeamount + row.disamount).toFixed(2);
  454. },
  455. //点击查询按钮
  456. //--数据字典 begin --
  457. getDictItems: function (typeName) {
  458. let that = this;
  459. that.$api.dict
  460. .findByLableName(typeName)
  461. .then(function (res) {
  462. that[typeName + "options"] = res.data; // 把获取到的数据赋给this.data
  463. })
  464. .catch(function (error) {
  465. that[typeName + "options"] = [];
  466. });
  467. },
  468. //--数据字典 end --
  469. // 右侧列表的方法Start
  470. findPage(data) {
  471. // 获取分页数据
  472. let that = this;
  473. if (data && data.pageRequest) {
  474. this.pageRequest.pageNum = data.pageRequest.pageNum;
  475. this.pageRequest.pageSize = data.pageRequest.pageSize;
  476. }
  477. that.$api.task
  478. .settlementExcelpage(that.pageRequest)
  479. .then((res) => {
  480. that.pageResult = res.data;
  481. })
  482. .then(data != null ? data.callback : "");
  483. },
  484. },
  485. };
  486. </script>
  487. <style lang="scss" scoped>
  488. .widths {
  489. width: 220px;
  490. }
  491. </style>