SettlementSource.vue 16 KB

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