paymentstatement.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <div class="paymentstatement-all">
  3. <el-dialog width="60%" title="日常付款类型筛选" :visible.sync="dialogFormVisible">
  4. <div class="paymentstatement-dialog-ul">
  5. <div v-for="(item,index) in DailypaymentTypelist" :key="index" class="paymentstatement-dialog-li">
  6. <div>
  7. <div class="modulename">{{item.name}}</div>
  8. <div class="paymentstatement-dialog-type">
  9. <el-checkbox v-model='items.isChecked' v-for="(items,index) in item.subData" :key="index" :label="items.name"></el-checkbox>
  10. </div>
  11. </div>
  12. </div>
  13. </div>
  14. <div slot="footer" class="dialog-footer">
  15. <el-button size="small" @click="checkidall">全 选</el-button>
  16. <el-button size="small" @click="checkidclear">清 空</el-button>
  17. <el-button size="small" @click="dialogFormVisible = false">取 消</el-button>
  18. <el-button size="small" type="primary" @click="checkidarr">确 定</el-button>
  19. </div>
  20. </el-dialog>
  21. <div class="paymentstatement-haed">
  22. <el-date-picker style="width:350px" v-model="value2" type="daterange" align="left"
  23. unlink-panels range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
  24. :picker-options="pickerOptions">
  25. </el-date-picker>
  26. <el-button @click="dialogFormVisible = true" type="primary">更改筛选器</el-button>
  27. </div>
  28. </div>
  29. </template>
  30. <script>
  31. export default {
  32. data () {
  33. return {
  34. token:'',
  35. dialogFormVisible:true,
  36. pickerOptions: {
  37. shortcuts: [{
  38. text: '最近一周',
  39. onClick(picker) {
  40. const end = new Date();
  41. const start = new Date();
  42. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  43. picker.$emit('pick', [start, end]);
  44. }
  45. }, {
  46. text: '最近一个月',
  47. onClick(picker) {
  48. const end = new Date();
  49. const start = new Date();
  50. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  51. picker.$emit('pick', [start, end]);
  52. }
  53. }, {
  54. text: '最近三个月',
  55. onClick(picker) {
  56. const end = new Date();
  57. const start = new Date();
  58. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  59. picker.$emit('pick', [start, end]);
  60. }
  61. }]
  62. },
  63. value2:'',
  64. DailypaymentTypelist:[],
  65. typeIds:[]
  66. }
  67. },
  68. methods:{
  69. //日付类型
  70. DailypaymentTypeInit(){
  71. var url = "/api/Statistics/DailypaymentTypeInit"
  72. var that = this
  73. this.$axios({
  74. method: 'post',
  75. url: url,
  76. headers: {
  77. Authorization: 'Bearer ' + that.token
  78. },
  79. data: {
  80. portType: 1 ,
  81. }
  82. }).then(function (res) {
  83. if (res.data.code == 200) {
  84. that.DailypaymentTypelist=res.data.data
  85. } else {
  86. that.$message.error(res.data.msg);
  87. }
  88. }).catch(function (error) {
  89. that.$message.error("接口错误,请联系信息部!");
  90. });
  91. },
  92. //获取勾选id
  93. checkidarr(){
  94. this.typeIds=[];
  95. for(let i=0;i<this.DailypaymentTypelist.length;i++){
  96. for(let j=0;j<this.DailypaymentTypelist[i].subData.length;j++){
  97. if(this.DailypaymentTypelist[i].subData[j].isChecked==true){
  98. this.typeIds.push(this.DailypaymentTypelist[i].subData[j].id);
  99. }
  100. }
  101. }
  102. this.DailypaymentTypeDataSave(this.typeIds)
  103. },
  104. //all in
  105. checkidall(){
  106. for(let i=0;i<this.DailypaymentTypelist.length;i++){
  107. for(let j=0;j<this.DailypaymentTypelist[i].subData.length;j++){
  108. this.DailypaymentTypelist[i].subData[j].isChecked=true;
  109. }
  110. }
  111. },
  112. //清空
  113. checkidclear(){
  114. for(let i=0;i<this.DailypaymentTypelist.length;i++){
  115. for(let j=0;j<this.DailypaymentTypelist[i].subData.length;j++){
  116. this.DailypaymentTypelist[i].subData[j].isChecked=false;
  117. }
  118. }
  119. },
  120. //保存筛选条件
  121. DailypaymentTypeDataSave(val){
  122. var url = "/api/Statistics/DailypaymentTypeDataSave"
  123. var that = this
  124. this.$axios({
  125. method: 'post',
  126. url: url,
  127. headers: {
  128. Authorization: 'Bearer ' + that.token
  129. },
  130. data: {
  131. portType: 1 ,
  132. typeIds:val
  133. }
  134. }).then(function (res) {
  135. if (res.data.code == 200) {
  136. that.dialogFormVisible=false;
  137. that.$message({
  138. message: res.data.msg,
  139. type: 'success'
  140. });
  141. } else {
  142. that.$message.error(res.data.msg);
  143. }
  144. }).catch(function (error) {
  145. that.$message.error("接口错误,请联系信息部!");
  146. });
  147. },
  148. },
  149. mounted(){
  150. this.DailypaymentTypeInit();
  151. }
  152. }
  153. </script>
  154. <style>
  155. .paymentstatement-all{
  156. background-color: #fff;
  157. padding: 10px;
  158. box-shadow: 0 0 5px #0005;
  159. border-radius: 10px;
  160. height: 100%;
  161. min-height: 830px;
  162. }
  163. .paymentstatement-haed{
  164. display: flex;
  165. justify-content: space-between;
  166. margin-bottom: 20px;
  167. }
  168. .paymentstatement-dialog-type{
  169. display: flex;
  170. flex-wrap:wrap ;
  171. }
  172. .paymentstatement-dialog-type .el-checkbox{
  173. width: 290px;
  174. }
  175. .paymentstatement-dialog-li .modulename{
  176. font-size: 15px;
  177. font-weight: 600;
  178. }
  179. .paymentstatement-all .el-dialog__body{
  180. padding-top: 10px;
  181. }
  182. .paymentstatement-dialog-li .el-checkbox{
  183. margin-top: 4px;
  184. margin-bottom: 4px;
  185. }
  186. </style>