SigningCollect.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <template>
  2. <div>
  3. <div class="p-2">
  4. <el-form
  5. :inline="true"
  6. size="small"
  7. :model="formInline"
  8. class="demo-form-inline"
  9. >
  10. <el-col :span="6">
  11. <el-form-item label="选择年份:">
  12. <el-date-picker
  13. v-model="formInline.monthValue"
  14. type="year"
  15. value-format="yyyy"
  16. placeholder="选择年"
  17. >
  18. </el-date-picker>
  19. </el-form-item>
  20. </el-col>
  21. <el-col :span="6">
  22. <el-form-item label="保险公司:">
  23. <el-select
  24. v-model="pageRequest.insuranceId"
  25. filterable
  26. class="widths"
  27. clearable
  28. @change="companySelectChange"
  29. collapse-tags
  30. >
  31. <el-option
  32. v-for="val in companyList"
  33. :key="val.id"
  34. :label="val.name"
  35. :value="val.id"
  36. ></el-option>
  37. </el-select>
  38. </el-form-item>
  39. </el-col>
  40. <el-form-item>
  41. <el-button type="primary" @click="formQuery">查询</el-button>
  42. </el-form-item>
  43. </el-form>
  44. </div>
  45. <el-main ref="elMain" style="padding: 0px">
  46. <kt-common-table
  47. :SerialShow="false"
  48. :operationWidth="150"
  49. :showOperation="false"
  50. permsDelete="sys:user:delete"
  51. :showBatchDelete="false"
  52. :showBatchSettled="false"
  53. :showBatchPrint="false"
  54. permsButton1="sys:user:edit"
  55. permsButton2="sys:user:edit"
  56. permsButton3="sys:user:edit"
  57. :data="pageResult"
  58. :columns="columns"
  59. @findPage="findPage"
  60. keyName="policyno"
  61. settledName="批量生成"
  62. :isshowpagination="false"
  63. @handleSettled="handleTableSettled"
  64. >
  65. </kt-common-table>
  66. </el-main>
  67. </div>
  68. </template>
  69. <script>
  70. import KtCommonTable from "@/views/Core/KtCommonTable.vue"; //表格组件
  71. import CommonUtil from "@/utils/comutil.js";
  72. export default {
  73. components: {
  74. KtCommonTable,
  75. },
  76. data() {
  77. return {
  78. companyList:[],//保险公司数据
  79. insuranceIdlist: [],//保险公司值
  80. //地区编码数据
  81. regionalCode: [],
  82. formInline: {
  83. monthValue: "2024",
  84. },
  85. pageRequest: {
  86. //查询的默认条件
  87. insuranceId:'',
  88. },
  89. dateTime: [],
  90. companyList: [],
  91. institutionOptions: [],
  92. dialogVisible: false,
  93. docOrderid: "",
  94. plyNoList: [],
  95. // 右侧列表查询数据Start
  96. pageResult: [],
  97. columns: [
  98. //数据列
  99. { prop: "yearmonth", label: "签单日期", minWidth: 160 },
  100. { prop: "jqPremiumTax", label: "交强保费", minWidth: 160 },
  101. { prop: "syPremiumTax", label: "商业保费", minWidth: 160 },
  102. { prop: "nonCarPremiumTax", label: "非车保费", minWidth: 160 },
  103. { prop: "writtenPremium", label: "签单保费", minWidth: 160 },
  104. { prop: "settlementAmount", label: "应收金额", minWidth: 160 },
  105. ],
  106. };
  107. },
  108. created() {
  109. this.companyInt();
  110. },
  111. mounted() {
  112. this.formInline.monthValue = this.monthProcess();
  113. },
  114. methods: {
  115. //选择保险公司change事件
  116. companySelectChange(val) {
  117. this.pageRequest.insuranceId = val
  118. },
  119. //获取保险公司数据
  120. companyInt() {
  121. this.$api.letter.gainTopList().then((res) => {
  122. this.companyList = res.data;
  123. });
  124. },
  125. formQuery() {
  126. // this.findPage();
  127. this.$api.task
  128. .signingSourceResult(this.formInline.monthValue,this.pageRequest.insuranceId)
  129. .then((res) => {
  130. this.pageResult = res.data;
  131. });
  132. },
  133. handleTableSettled(ids) {
  134. this.plyNoList = ids;
  135. this.dialogVisible11 = true;
  136. },
  137. inscompanyFormatter(row, column) {
  138. //协议类型
  139. let inscompany = row.inscompany;
  140. return CommonUtil.getDataName({
  141. dataList: this.global.insCompanyList,
  142. value: "code",
  143. label: "name",
  144. data: inscompany,
  145. });
  146. },
  147. timeFormatter(row, column) {
  148. let time = this.transformTime(row.createTime);
  149. return time;
  150. },
  151. totalmoenyFormatter(row, column) {
  152. //协议类型
  153. let inscompany = row.inscompany;
  154. return (row.feeamount + row.disamount).toFixed(2);
  155. },
  156. //点击查询按钮
  157. //--数据字典 begin --
  158. getDictItems: function (typeName) {
  159. let that = this;
  160. that.$api.dict
  161. .findByLableName(typeName)
  162. .then(function (res) {
  163. that[typeName + "options"] = res.data; // 把获取到的数据赋给this.data
  164. })
  165. .catch(function (error) {
  166. that[typeName + "options"] = [];
  167. });
  168. },
  169. //--数据字典 end --
  170. // 右侧列表的方法Start
  171. findPage(data) {
  172. let year = this.monthProcess();
  173. // 获取分页数据
  174. let that = this;
  175. that.$api.task
  176. .signingSourceResult(year,that.pageRequest.insuranceId)
  177. .then((res) => {
  178. if(res.code==200){
  179. that.pageResult = res.data;
  180. }else{
  181. that.$message.error(res.msg)
  182. }
  183. })
  184. .then(data != null ? data.callback : "");
  185. },
  186. monthProcess() {
  187. // 创建一个新的Date对象,默认构造函数会生成当前日期和时间
  188. const now = new Date();
  189. // 获取当前年份
  190. const year = now.getFullYear();
  191. // // 获取当前月份,加1得到常规表示的月份
  192. // const month = now.getMonth() + 1;
  193. // // 转换月份为两位数字符串
  194. // const formattedMonth = month.toString().padStart(2, "0");
  195. // // 合并年份和月份为"年-月"格式
  196. return `${year}`;
  197. },
  198. },
  199. };
  200. </script>
  201. <style lang="scss" scoped>
  202. .widths {
  203. width: 220px;
  204. }
  205. .demo-form-inline{
  206. height: 80px;
  207. display: flex;
  208. align-items: center;
  209. }
  210. </style>