1 line
6.2 KiB
JavaScript
1 line
6.2 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-37cebe4a"],{"354e":function(e,t,r){"use strict";r.d(t,"d",(function(){return a})),r.d(t,"c",(function(){return i})),r.d(t,"a",(function(){return s})),r.d(t,"e",(function(){return c})),r.d(t,"b",(function(){return o}));var n=r("b775");function a(e){return Object(n["a"])({url:"/bookkeeping/record/list",method:"get",params:e})}function i(e){return Object(n["a"])({url:"/bookkeeping/record/"+e,method:"get"})}function s(e){return Object(n["a"])({url:"/bookkeeping/record",method:"post",data:e})}function c(e){return Object(n["a"])({url:"/bookkeeping/record",method:"put",data:e})}function o(e){return Object(n["a"])({url:"/bookkeeping/record/"+e,method:"delete"})}},"3cbe":function(e,t,r){},"3dc1":function(e,t,r){"use strict";r.r(t);var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"record"},[r("van-nav-bar",{attrs:{fixed:"","left-arrow":"","left-text":"返回",title:"账目清单"},on:{"click-left":function(t){return e.$router.go(-1)}}}),r("div",{staticClass:"page"},[r("div",{staticClass:"bookkeeping-background background-image-1"},[r("van-row",{staticClass:"expenditure"},[r("span",[e._v(e._s(""+e.parseTime(e.queryParams.payTime,"{m}")))]),r("span",[e._v("月·支出")])]),r("van-row",[e._v(e._s(e._f("moneyFilter")(e.expenditure)))]),r("van-row",{staticClass:"income",attrs:{type:"flex",align:"center"}},[r("van-col",[e._v("本月收入")]),r("van-col",[e._v(e._s(e._f("moneyFilter")(e.income)))])],1)],1),e._l(e.recordList,(function(t){return e.recordList.length>0?r("van-cell-group",{key:Math.random(),attrs:{inset:""}},[r("van-row",{staticClass:"date",attrs:{type:"flex",align:"center",justify:"space-between"}},[r("van-col",{staticClass:"left"},[r("span",[e._v(e._s(new Date(t.payTime).getDate()))]),r("span",[e._v("日 / 周"+e._s(e.parseTime(new Date(t.payTime),"{a}")))])]),r("van-col",{staticClass:"right"},[e.arraySum(t.recordList.filter((function(e){return e.typeObject&&"0"===e.typeObject.typeDifference})),"money")?r("span",[r("svg-icon",{attrs:{"icon-class":"加号"}}),r("span",[e._v(e._s(e._f("moneyFilter")(e.arraySum(t.recordList.filter((function(e){return e.typeObject&&"0"===e.typeObject.typeDifference})),"money"))))])],1):e._e(),e.arraySum(t.recordList.filter((function(e){return e.typeObject&&"1"===e.typeObject.typeDifference})),"money")?r("span",{staticClass:"income"},[r("svg-icon",{attrs:{"icon-class":"减少"}}),r("span",[e._v(e._s(e._f("moneyFilter")(e.arraySum(t.recordList.filter((function(e){return e.typeObject&&"1"===e.typeObject.typeDifference})),"money"))))])],1):e._e()])],1),e._l(t.recordList,(function(t){return r("van-cell",{key:Math.random(),staticClass:"record-day",class:e.moneyStyle(t),attrs:{center:"",value:e._f("moneyFilter")(t.money)},on:{click:function(r){return e.handleEdit(t)}},scopedSlots:e._u([{key:"title",fn:function(){return[r("svg-icon",{staticClass:"business-icon",attrs:{"icon-class":t.typeObject&&t.typeObject.typeIcon||""}}),r("div",{staticClass:"content"},[t.typeObject&&"2"===t.typeObject.typeDifference?r("div",{staticClass:"transfer"},[r("span",[e._v(e._s(t.accountObject.accountName))]),r("svg-icon",{staticClass:"business-icon",attrs:{"icon-class":"右箭头"}}),r("span",[e._v(e._s(t.otherAccountObject.accountName))])],1):r("div",[e._v(e._s(t.typeObject&&t.typeObject.typeName))]),r("div",{staticClass:"remark"},[e._v(" "+e._s(t.remark)+" ")])])]},proxy:!0}],null,!0)})}))],2):e._e()})),0===e.recordList.length?r("van-row",{staticStyle:{"background-color":"#fff",margin:"0 1rem","border-radius":"0.5rem"}},[r("van-empty",{attrs:{description:"暂无记录"}})],1):e._e(),r("van-row",{staticClass:"pagination",attrs:{align:"center",justify:"space-between",type:"flex"}},[r("van-col",{on:{click:function(t){return e.getRecordList(0)}}},[e._v("上个月")]),r("van-col",[e._v(e._s(e.parseTime(e.queryParams.payTime,"{y}-{m}")))]),r("van-col",{on:{click:function(t){return e.getRecordList(1)}}},[e._v("下个月")])],1)],2)],1)},a=[],i=(r("4de4"),r("d3b7"),r("159b"),r("7db0"),r("354e")),s={name:"Record",data:function(){return{expenditure:0,income:0,recordList:this.getLocal("recordList")||[],queryParams:{payTime:this.parseTime(new Date)}}},mounted:function(){this.getRecordList()},methods:{handleEdit:function(e){e.typeObject&&"3"===e.typeObject.typeDifference?this.$toast("抱歉,余额变更不可编辑"):this.$router.push("/addRecord?recordId="+e.id)},moneyStyle:function(e){return e.typeObject&&"1"===e.typeObject.typeDifference?"blue":e.typeObject&&"0"===e.typeObject.typeDifference?"red":e.typeObject&&"2"===e.typeObject.typeDifference?"gray":void 0},getRecordList:function(e){var t=this;this.expenditure=0,this.income=0,this.recordList=[],0===e&&(this.queryParams.payTime=new Date(this.queryParams.payTime),this.queryParams.payTime=this.queryParams.payTime.setMonth(this.queryParams.payTime.getMonth()-1),this.queryParams.payTime=this.parseTime(new Date(this.queryParams.payTime))),1===e&&(this.queryParams.payTime=new Date(this.queryParams.payTime),this.queryParams.payTime=this.queryParams.payTime.setMonth(this.queryParams.payTime.getMonth()+1),this.queryParams.payTime=this.parseTime(new Date(this.queryParams.payTime))),Object(i["d"])(this.queryParams).then((function(e){t.expenditure=t.arraySum(e.rows.filter((function(e){return e.typeObject&&"1"===e.typeObject.typeDifference})),"money"),t.income=t.arraySum(e.rows.filter((function(e){return e.typeObject&&"0"===e.typeObject.typeDifference})),"money"),e.rows.forEach((function(e){t.recordList.find((function(r){return r.payTime===t.parseTime(new Date(e.payTime),"{y}-{m}-{d}")}))?t.recordList.find((function(r){return r.payTime===t.parseTime(new Date(e.payTime),"{y}-{m}-{d}")})).recordList.push(e):t.recordList.push({payTime:t.parseTime(new Date(e.payTime),"{y}-{m}-{d}"),recordList:[e]})})),t.$sortDesByKey(t.recordList,"payTime"),t.setLocal("recordList",t.recordList)}))}}},c=s,o=(r("9dbb"),r("2877")),u=Object(o["a"])(c,n,a,!1,null,"6539b543",null);t["default"]=u.exports},"7db0":function(e,t,r){"use strict";var n=r("23e7"),a=r("b727").find,i=r("44d2"),s=r("ae40"),c="find",o=!0,u=s(c);c in[]&&Array(1)[c]((function(){o=!1})),n({target:"Array",proto:!0,forced:o||!u},{find:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}}),i(c)},"9dbb":function(e,t,r){"use strict";r("3cbe")}}]); |