SettlementSource.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400
  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.jqPolicyId"
  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-input
  34. v-model="pageRequest.jqPolicyId"
  35. placeholder="请输入商业保单号"
  36. class="widths"
  37. clearable
  38. ></el-input>
  39. </el-form-item>
  40. </el-col>
  41. <el-col :span="6">
  42. <el-form-item label="非车保单号:">
  43. <el-input
  44. v-model="pageRequest.nonCarPolicyId"
  45. placeholder="请输入非车保单号"
  46. class="widths"
  47. clearable
  48. ></el-input>
  49. </el-form-item>
  50. </el-col>
  51. </el-row>
  52. </el-form>
  53. <div class="flex j-end" style="margin-right: 100px">
  54. <el-button
  55. type="primary"
  56. size="small"
  57. @click="Search"
  58. style="margin-right: 20px"
  59. >查询</el-button
  60. >
  61. <el-upload
  62. class="upload-demo"
  63. :auto-upload="false"
  64. :on-change="writeOffUpload"
  65. action="###"
  66. :show-file-list="false"
  67. >
  68. <el-button size="small" type="primary">数据导入</el-button>
  69. </el-upload>
  70. </div>
  71. </div>
  72. <el-main ref="elMain" style="padding: 0px">
  73. <kt-common-table
  74. :SerialShow="false"
  75. :operationWidth="150"
  76. :showOperation="true"
  77. permsDelete="sys:user:delete"
  78. :showBatchDelete="false"
  79. :showBatchSettled="false"
  80. :showBatchPrint="false"
  81. permsButton1="sys:user:edit"
  82. permsButton2="sys:user:edit"
  83. permsButton3="sys:user:edit"
  84. :data="pageResult"
  85. :columns="columns"
  86. @findPage="findPage"
  87. keyName="policyno"
  88. settledName="批量生成"
  89. @handleSettled="handleTableSettled"
  90. @handlePrint="handlePrint"
  91. button1Name="修改"
  92. button1Background="#E6A23C"
  93. @handleButton1="sourceUpdate"
  94. button1Icon=""
  95. >
  96. </kt-common-table>
  97. </el-main>
  98. <el-dialog title="信息修改" :visible.sync="dialogFormVisible" width="60%">
  99. <el-form
  100. :model="updateform"
  101. :inline="true"
  102. label-width="130px"
  103. size="small"
  104. >
  105. <el-form-item label="渠道:">
  106. <el-input
  107. v-model="updateform.channel"
  108. autocomplete="off"
  109. class="widths"
  110. ></el-input>
  111. </el-form-item>
  112. <el-form-item label="车牌号:">
  113. <el-input
  114. v-model="updateform.licenseno"
  115. autocomplete="off"
  116. class="widths"
  117. ></el-input>
  118. </el-form-item>
  119. <el-form-item label="被保险人:">
  120. <el-input
  121. v-model="updateform.insuredName"
  122. autocomplete="off"
  123. class="widths"
  124. ></el-input>
  125. </el-form-item>
  126. <el-form-item label="险种:">
  127. <el-input
  128. v-model="updateform.insuranceType"
  129. autocomplete="off"
  130. class="widths"
  131. ></el-input>
  132. </el-form-item>
  133. <el-form-item label="业务归属:">
  134. <el-input
  135. v-model="updateform.businessOwner"
  136. autocomplete="off"
  137. class="widths"
  138. ></el-input>
  139. </el-form-item>
  140. <el-form-item label="交强保费:">
  141. <el-input
  142. v-model="updateform.jqPremiumTax"
  143. autocomplete="off"
  144. class="widths"
  145. ></el-input>
  146. </el-form-item>
  147. <el-form-item label="商业保费:">
  148. <el-input
  149. v-model="updateform.syPremiumTax"
  150. autocomplete="off"
  151. class="widths"
  152. ></el-input>
  153. </el-form-item>
  154. <el-form-item label="非车保费:">
  155. <el-input
  156. v-model="updateform.nonCarPremiumTax"
  157. autocomplete="off"
  158. class="widths"
  159. ></el-input>
  160. </el-form-item>
  161. <el-form-item label="交强应收比例:">
  162. <el-input
  163. v-model="updateform.compulsoryExportRatio"
  164. autocomplete="off"
  165. class="widths"
  166. ></el-input>
  167. </el-form-item>
  168. <el-form-item label="商业应收比例:">
  169. <el-input
  170. v-model="updateform.commercialExportRatio"
  171. autocomplete="off"
  172. class="widths"
  173. ></el-input>
  174. </el-form-item>
  175. <el-form-item label="非车应收比例:">
  176. <el-input
  177. v-model="updateform.nonVehicleExportRatio"
  178. autocomplete="off"
  179. class="widths"
  180. ></el-input>
  181. </el-form-item>
  182. </el-form>
  183. <div slot="footer" class="dialog-footer">
  184. <el-button size="small" @click="dialogFormVisible = false"
  185. >取 消</el-button
  186. >
  187. <el-button size="small" type="primary" @click="updateSubmit"
  188. >确 定</el-button
  189. >
  190. </div>
  191. </el-dialog>
  192. </div>
  193. </template>
  194. <script>
  195. import KtCommonTable from "@/views/Core/KtCommonTable.vue"; //表格组件
  196. import KtButton from "@/views/Core/KtButton";
  197. import CommonUtil from "@/utils/comutil.js";
  198. export default {
  199. components: {
  200. KtCommonTable,
  201. KtButton,
  202. },
  203. data() {
  204. return {
  205. pageRequest: {
  206. //查询的默认条件
  207. pageNum: 1,
  208. pageSize: 20,
  209. licenseno: "",
  210. jqPolicyId: "",
  211. syPolicyId: "",
  212. nonCarPolicyId: "",
  213. },
  214. // 右侧列表查询数据Start
  215. dialogFormVisible: false,
  216. pageResult: [],
  217. updateform: {
  218. channel: "",
  219. licenseno: "",
  220. insuredName: "",
  221. insuranceType: "",
  222. businessOwner: "",
  223. jqPremiumTax: "",
  224. syPremiumTax: "",
  225. nonCarPremiumTax: "",
  226. compulsoryExportRatio: "",
  227. commercialExportRatio: "",
  228. nonVehicleExportRatio: "",
  229. },
  230. columns: [
  231. //数据列
  232. { prop: "id", label: " 编号", minWidth: 160 },
  233. { prop: "operationsTeam", label: "运营小组", minWidth: 160 },
  234. { prop: "channelClassification", label: "渠道分级", minWidth: 160 },
  235. { prop: "channel", label: "渠道", minWidth: 160 },
  236. { prop: "employeeId", label: "工号", minWidth: 160 },
  237. { prop: "signDate", label: "签单日期", minWidth: 160 },
  238. { prop: "licenseno", label: "车牌号", minWidth: 160 },
  239. { prop: "insuredName", label: "被保险人", minWidth: 100 },
  240. { prop: "insuranceCompany", label: "保险公司", minWidth: 160 },
  241. { prop: "insuranceType", label: "险种", minWidth: 160 },
  242. { prop: "businessOwner", label: "业务归属", minWidth: 160 },
  243. {
  244. prop: "jqPolicyId",
  245. label: "交强保单号",
  246. minWidth: 160,
  247. },
  248. { prop: "syPolicyId", label: "商业保单号", minWidth: 160 },
  249. { prop: "nonCarPolicyId", label: "非车保单号", minWidth: 160 },
  250. { prop: "jqPremiumTax", label: "交强保费", minWidth: 160 },
  251. { prop: "vehicleTax", label: "车船税", minWidth: 160 },
  252. { prop: "syPremiumTax", label: "商业保费", minWidth: 160 },
  253. { prop: "nonCarPremiumTax", label: "非车保费", minWidth: 160 },
  254. { prop: "compulsoryExportRatio", label: "交强出口比例", minWidth: 160 },
  255. { prop: "commercialExportRatio", label: "商业出口比例", minWidth: 160 },
  256. { prop: "nonVehicleExportRatio", label: "非车出口比例", minWidth: 160 },
  257. { prop: "settlementAmount", label: "结算金额", minWidth: 160 },
  258. { prop: "agencySettlementTime", label: "代理结算时间", minWidth: 160 },
  259. ],
  260. };
  261. },
  262. created() {},
  263. mounted() {},
  264. methods: {
  265. //附件上传
  266. writeOffUpload(file) {
  267. var file = file.raw;
  268. const params = new FormData(); // 声明formData数据类型
  269. params.append("multipartFile", file);
  270. params.append("type", "settle");
  271. this.$api.letter.uploadFile(params).then((res) => {
  272. if (res.code == "200") {
  273. let url = process.env.BASE_URL + res.data.url;
  274. this.$api.task.settlementExcel(url).then((res) => {});
  275. }
  276. });
  277. },
  278. handleTableSettled(ids) {
  279. this.plyNoList = ids;
  280. this.dialogVisible11 = true;
  281. },
  282. sourceUpdate({ row, column }) {
  283. this.dialogFormVisible = true;
  284. this.updateform = row;
  285. },
  286. Search() {
  287. this.findPage();
  288. },
  289. updateSubmit() {
  290. this.$api.task.settlementUpdate(this.updateform).then((res) => {
  291. if (res.code == "200") {
  292. this.$message({
  293. type: "success",
  294. message: res.msg,
  295. });
  296. this.dialogFormVisible = false;
  297. this.findPage();
  298. } else {
  299. this.$message({
  300. type: "error",
  301. message: res.msg,
  302. });
  303. }
  304. });
  305. },
  306. handlePrint() {
  307. this.$api.task.excelExport(this.pageRequest).then((res) => {
  308. console.log(res);
  309. let blob = new Blob([res], {
  310. type: "application/vnd.ms-excel",
  311. }); // 2.获取请求返回的response对象中的blob 设置文件类型,这里以excel为例
  312. let url = window.URL.createObjectURL(blob); // 3.创建一个临时的url指向blob对象
  313. // 4.创建url之后可以模拟对此文件对象的一系列操作,例如:预览、下载
  314. let a = document.createElement("a");
  315. a.href = url;
  316. a.download = "手续费管理清单.xlsx";
  317. a.click();
  318. // 5.释放这个临时的对象url
  319. window.URL.revokeObjectURL(url);
  320. });
  321. },
  322. //联级选择器触发事件
  323. handleChange(val) {
  324. console.log(val);
  325. if (val.length !== 0) {
  326. this.pageRequest.deptId = val.at(-1);
  327. } else {
  328. this.pageRequest.deptId = "";
  329. }
  330. },
  331. //-- formatter begin--
  332. agreetypeFormatter(row, column) {
  333. //协议类型
  334. let agreetype = row.agreetype;
  335. return CommonUtil.getDataName({
  336. dataList: this.agreementtypeoptions,
  337. value: "value",
  338. label: "label",
  339. data: agreetype,
  340. });
  341. },
  342. inscompanyFormatter(row, column) {
  343. //协议类型
  344. let inscompany = row.inscompany;
  345. return CommonUtil.getDataName({
  346. dataList: this.global.insCompanyList,
  347. value: "code",
  348. label: "name",
  349. data: inscompany,
  350. });
  351. },
  352. timeFormatter(row, column) {
  353. let time = this.transformTime(row.createTime);
  354. return time;
  355. },
  356. totalmoenyFormatter(row, column) {
  357. //协议类型
  358. let inscompany = row.inscompany;
  359. return (row.feeamount + row.disamount).toFixed(2);
  360. },
  361. //点击查询按钮
  362. //--数据字典 begin --
  363. getDictItems: function (typeName) {
  364. let that = this;
  365. that.$api.dict
  366. .findByLableName(typeName)
  367. .then(function (res) {
  368. console.log(res);
  369. that[typeName + "options"] = res.data; // 把获取到的数据赋给this.data
  370. })
  371. .catch(function (error) {
  372. that[typeName + "options"] = [];
  373. });
  374. },
  375. //--数据字典 end --
  376. // 右侧列表的方法Start
  377. findPage(data) {
  378. // 获取分页数据
  379. let that = this;
  380. if (data && data.pageRequest) {
  381. this.pageRequest.pageNum = data.pageRequest.pageNum;
  382. this.pageRequest.pageSize = data.pageRequest.pageSize;
  383. }
  384. that.$api.task
  385. .settlementExcelpage(that.pageRequest)
  386. .then((res) => {
  387. that.pageResult = res.data;
  388. })
  389. .then(data != null ? data.callback : "");
  390. },
  391. },
  392. };
  393. </script>
  394. <style lang="scss" scoped>
  395. .widths {
  396. width: 220px;
  397. }
  398. </style>