1 line
31 KiB
JavaScript
1 line
31 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-51b14ab6"],{2029:function(t,e,n){},"354e":function(t,e,n){"use strict";n.d(e,"d",(function(){return c})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return i})),n.d(e,"e",(function(){return a})),n.d(e,"b",(function(){return s}));var o=n("b775");function c(t){return Object(o["a"])({url:"/bookkeeping/record/list",method:"get",params:t})}function r(t){return Object(o["a"])({url:"/bookkeeping/record/"+t,method:"get"})}function i(t){return Object(o["a"])({url:"/bookkeeping/record",method:"post",data:t})}function a(t){return Object(o["a"])({url:"/bookkeeping/record",method:"put",data:t})}function s(t){return Object(o["a"])({url:"/bookkeeping/record/"+t,method:"delete"})}},4830:function(t,e,n){"use strict";var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"retrieval"},[n("input",{directives:[{name:"show",rawName:"v-show",value:!1,expression:"false"},{name:"model",rawName:"v-model",value:t.result,expression:"result"}],domProps:{value:t.result},on:{input:function(e){e.target.composing||(t.result=e.target.value)}}}),n("input",{directives:[{name:"show",rawName:"v-show",value:!1,expression:"false"},{name:"model",rawName:"v-model",value:t.inputValue,expression:"inputValue"}],attrs:{type:"text"},domProps:{value:t.inputValue},on:{input:function(e){e.target.composing||(t.inputValue=e.target.value)}}}),n("div",{staticClass:"number"},[n("div",{staticClass:"button",on:{click:function(e){return t.clickKey("num","7")}}},[t._v("7")]),n("div",{staticClass:"button",on:{click:function(e){return t.clickKey("num","8")}}},[t._v("8")]),n("div",{staticClass:"button",on:{click:function(e){return t.clickKey("num","9")}}},[t._v("9")]),n("div",{staticClass:"button reduce",on:{click:function(e){return t.clickKey("func","-")}}},[t._v("-")]),n("div",{staticClass:"button",on:{click:function(e){return t.clickKey("num","4")}}},[t._v("4")]),n("div",{staticClass:"button",on:{click:function(e){return t.clickKey("num","5")}}},[t._v("5")]),n("div",{staticClass:"button",on:{click:function(e){return t.clickKey("num","6")}}},[t._v("6")]),n("div",{staticClass:"button add",on:{click:function(e){return t.clickKey("func","+")}}},[t._v("+")]),n("div",{staticClass:"d-flex"},[n("div",{staticClass:"d-flex number-left"},[n("div",{staticClass:"button",on:{click:function(e){return t.clickKey("num","1")}}},[t._v("1")]),n("div",{staticClass:"button",on:{click:function(e){return t.clickKey("num","2")}}},[t._v("2")]),n("div",{staticClass:"button",on:{click:function(e){return t.clickKey("num","3")}}},[t._v("3")]),n("div",{staticClass:"button",on:{click:function(e){return t.clickKey("point",".")}}},[t._v(".")]),n("div",{staticClass:"button",on:{click:function(e){return t.clickKey("num","0")}}},[t._v("0")]),n("div",{staticClass:"button",on:{click:function(e){return t.clickKey("clear")}}},[n("svg-icon",{attrs:{"icon-class":"clear"}})],1)]),n("div",{staticClass:"button confirm",on:{click:function(e){return t.clickKey("confirm")}}},[t._v("确定")])])])])},c=[],r=(n("a9e3"),n("ac1f"),n("1276"),n("fb6a"),{name:"Retrieval",data:function(){return{result:0,inputValue:""}},computed:{isFunction:function(){return-1!==this.inputValue.indexOf("-")||-1!==this.inputValue.indexOf("+")},function:function(){var t="+";return-1!==this.inputValue.indexOf("-")&&(t="-"),-1!==this.inputValue.indexOf("+")&&(t="+"),t}},watch:{inputValue:function(t){this.$emit("getInputValue",t,this.result)}},methods:{clickKey:function(t,e){switch(t){case"num":this.isFunction?(this.inputValue+=e,"+"===this.function?this.result=Number(this.inputValue.split(this.function)[0])+Number(this.inputValue.split(this.function)[1]):"-"===this.function&&(this.result=Number(this.inputValue.split(this.function)[0])-Number(this.inputValue.split(this.function)[1]))):(this.inputValue+=e,this.result=Number(this.inputValue));break;case"func":this.isFunction?(this.inputValue=this.result,this.inputValue+=e):(this.result=Number(this.inputValue),this.inputValue+=e);break;case"point":this.inputValue+=e;break;case"clear":this.inputValue=this.inputValue.slice(0,-1),this.isFunction?"+"===this.function?this.result=Number(this.inputValue.split(this.function)[0])+Number(this.inputValue.split(this.function)[1]):"-"===this.function&&(this.result=Number(this.inputValue.split(this.function)[0])-Number(this.inputValue.split(this.function)[1])):this.result=Number(this.inputValue),console.log(this.inputValue),console.log(this.result);break;case"confirm":this.$emit("confirm");break;default:break}}}}),i=r,a=(n("c85d"),n("2877")),s=Object(a["a"])(i,o,c,!1,null,"9f0e0fe4",null);e["a"]=s.exports},"51eb":function(t,e,n){"use strict";var o=n("825a"),c=n("c04e");t.exports=function(t){if("string"!==t&&"number"!==t&&"default"!==t)throw TypeError("Incorrect hint");return c(o(this),"number"!==t)}},5530:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));n("b64b"),n("a4d3"),n("4de4"),n("d3b7"),n("e439"),n("159b"),n("dbb4");var o=n("53ca");n("8172"),n("efec"),n("e01a"),n("a9e3");function c(t,e){if("object"!==Object(o["a"])(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var c=n.call(t,e||"default");if("object"!==Object(o["a"])(c))return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function r(t){var e=c(t,"string");return"symbol"===Object(o["a"])(e)?e:String(e)}function i(t,e,n){return e=r(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){i(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}},"7db0":function(t,e,n){"use strict";var o=n("23e7"),c=n("b727").find,r=n("44d2"),i=n("ae40"),a="find",s=!0,u=i(a);a in[]&&Array(1)[a]((function(){s=!1})),o({target:"Array",proto:!0,forced:s||!u},{find:function(t){return c(this,t,arguments.length>1?arguments[1]:void 0)}}),r(a)},8172:function(t,e,n){var o=n("746f");o("toPrimitive")},"9fb1":function(t,e,n){"use strict";n.d(e,"e",(function(){return c})),n.d(e,"d",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return a})),n.d(e,"f",(function(){return s})),n.d(e,"b",(function(){return u}));var o=n("b775");function c(t){return Object(o["a"])({url:"/bookkeeping/classification/list",method:"get",params:t})}function r(t){return Object(o["a"])({url:"/bookkeeping/classification/getLatelyTypeList",method:"get",params:t})}function i(t){return Object(o["a"])({url:"/bookkeeping/classification/"+t,method:"get"})}function a(t){return Object(o["a"])({url:"/bookkeeping/classification",method:"post",data:t})}function s(t){return Object(o["a"])({url:"/bookkeeping/classification",method:"put",data:t})}function u(t){return Object(o["a"])({url:"/bookkeeping/classification/"+t,method:"delete"})}},acee:function(t,e,n){"use strict";n.r(e);var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"add-record"},[n("van-nav-bar",{attrs:{fixed:"","left-arrow":"","left-text":"返回",title:"记一笔","right-text":"3"===t.active?"新增":"保存"},on:{"click-left":function(e){return t.$router.go(-1)},"click-right":t.handleAdd}}),n("div",{staticClass:"page"},[n("van-tabs",{attrs:{animated:"",sticky:"",swipeable:""},model:{value:t.active,callback:function(e){t.active=e},expression:"active"}},[t.$route.query.recordId?t._e():n("van-tab",{attrs:{name:"3",title:"模板"}},t._l(t.modelList,(function(e){return n("van-cell",{key:Math.random(),staticClass:"model-one",class:t.moneyStyle(e),attrs:{center:"",value:t._f("moneyFilter")(e.money)},on:{click:function(n){return t.handleSelectModel(e)}},scopedSlots:t._u([{key:"title",fn:function(){return[t.editFlag?n("div",{staticClass:"delete-model"},[n("van-icon",{attrs:{name:"close"},on:{click:function(n){return n.stopPropagation(),t.handleDeleteModel(e)}}}),n("van-icon",{attrs:{name:"edit"},on:{click:function(n){return n.stopPropagation(),t.$router.push("/addModel?id="+e.id)}}})],1):t._e(),n("svg-icon",{staticClass:"business-icon",attrs:{"icon-class":e.typeObject.typeIcon||""}}),n("div",{staticClass:"content"},[n("div",[t._v(t._s(e.name))]),n("div",{staticClass:"remark"},[t._v(" "+t._s(e.remark)+" ")])])]},proxy:!0}],null,!0)})})),1),n("van-tab",{attrs:{name:"1",title:"支出"}},[n("div",{staticClass:"record-form expenditure"},[n("van-field",{staticClass:"money",attrs:{type:"number"},on:{focus:t.noBomBox},model:{value:t.recordForm.money,callback:function(e){t.$set(t.recordForm,"money",e)},expression:"recordForm.money"}}),n("van-field",{staticClass:"temporary",attrs:{readonly:""},model:{value:t.money,callback:function(e){t.money=e},expression:"money"}}),n("van-row",{staticClass:"record-form-item",attrs:{align:"center",type:"flex"},on:{click:function(e){return t.openPopup("showSelectType")}}},[n("van-col",[n("svg-icon",{staticClass:"business-icon",attrs:{"icon-class":"type-icon"}})],1),n("van-col",{staticClass:"line-height",attrs:{offset:1}},[t._v(" 分类 ")]),n("van-col",{staticClass:"d-flex flex-items-center",attrs:{offset:1}},[n("div",{staticClass:"primary line-height"},[t._v(t._s(t.temporaryForm.primaryType))]),n("van-icon",{staticStyle:{margin:"0 1rem"},attrs:{name:"arrow"}}),n("div",{staticClass:"secondary line-height"},[t._v(t._s(t.temporaryForm.secondaryType))])],1)],1),n("van-row",{staticClass:"record-form-item",attrs:{align:"center",type:"flex"},on:{click:function(e){return t.openPopup("showSelectAccount")}}},[n("van-col",[n("svg-icon",{staticClass:"business-icon",attrs:{"icon-class":"a-信用卡"}})],1),n("van-col",{staticClass:"line-height",attrs:{offset:1}},[t._v(" 账户 ")]),n("van-col",{attrs:{offset:1}},[t._v(" "+t._s(t.temporaryForm.account)+" ")])],1),n("van-row",{staticClass:"record-form-item",attrs:{align:"center",type:"flex"},on:{click:function(e){return t.openPopup("showSelectTime")}}},[n("van-col",[n("svg-icon",{staticClass:"business-icon",attrs:{"icon-class":"时间"}})],1),n("van-col",{staticClass:"line-height",attrs:{offset:1}},[t._v(" 时间 ")]),n("van-col",{staticClass:"d-flex flex-items-center",attrs:{offset:1}},[t._v(" "+t._s(t.$moment(t.recordForm.payTime||new Date).calendar(null,{sameDay:"[今天]",nextDay:"[明天]",nextWeek:"dddd",lastDay:"[昨天]",lastWeek:"[上个] dddd",sameElse:"YYYY"})+" "+t.$moment(t.recordForm.payTime||new Date).format("MMMM Do, h:mm a"))+" ")])],1),n("van-row",[n("van-cell",{scopedSlots:t._u([{key:"title",fn:function(){return[n("svg-icon",{staticClass:"business-icon",attrs:{"icon-class":"备注"}}),n("span",{staticStyle:{"margin-left":"1rem"}},[t._v("备注")])]},proxy:!0}])}),n("van-field",{attrs:{autosize:"",maxlength:"200",placeholder:"请输入备注",rows:"2","show-word-limit":"",type:"textarea"},model:{value:t.recordForm.remark,callback:function(e){t.$set(t.recordForm,"remark",e)},expression:"recordForm.remark"}})],1)],1)]),n("van-tab",{attrs:{name:"0",title:"收入"}},[n("div",{staticClass:"record-form income"},[n("van-field",{staticClass:"money",attrs:{type:"number"},on:{focus:t.noBomBox},model:{value:t.recordForm.money,callback:function(e){t.$set(t.recordForm,"money",e)},expression:"recordForm.money"}}),n("van-field",{staticClass:"temporary",attrs:{readonly:""},model:{value:t.money,callback:function(e){t.money=e},expression:"money"}}),n("van-row",{staticClass:"record-form-item",attrs:{align:"center",type:"flex"},on:{click:function(e){return t.openPopup("showSelectType")}}},[n("van-col",[n("svg-icon",{staticClass:"business-icon",attrs:{"icon-class":"type-icon"}})],1),n("van-col",{staticClass:"line-height",attrs:{offset:1}},[t._v(" 分类 ")]),n("van-col",{staticClass:"d-flex flex-items-center",attrs:{offset:1}},[n("div",{staticClass:"primary line-height"},[t._v(t._s(t.temporaryForm.primaryType))]),n("van-icon",{staticStyle:{margin:"0 1rem"},attrs:{name:"arrow"}}),n("div",{staticClass:"secondary line-height"},[t._v(t._s(t.temporaryForm.secondaryType))])],1)],1),n("van-row",{staticClass:"record-form-item",attrs:{align:"center",type:"flex"},on:{click:function(e){return t.openPopup("showSelectAccount")}}},[n("van-col",[n("svg-icon",{staticClass:"business-icon",attrs:{"icon-class":"a-信用卡"}})],1),n("van-col",{staticClass:"line-height",attrs:{offset:1}},[t._v(" 账户 ")]),n("van-col",{attrs:{offset:1}},[t._v(" "+t._s(t.temporaryForm.account)+" ")])],1),n("van-row",{staticClass:"record-form-item",attrs:{align:"center",type:"flex"},on:{click:function(e){return t.openPopup("showSelectTime")}}},[n("van-col",[n("svg-icon",{staticClass:"business-icon",attrs:{"icon-class":"时间"}})],1),n("van-col",{staticClass:"line-height",attrs:{offset:1}},[t._v(" 时间 ")]),n("van-col",{staticClass:"d-flex flex-items-center",attrs:{offset:1}},[t._v(" "+t._s(t.$moment(t.recordForm.payTime||new Date).calendar(null,{sameDay:"[今天]",nextDay:"[明天]",nextWeek:"dddd",lastDay:"[昨天]",lastWeek:"[上个] dddd",sameElse:"YYYY"})+" "+t.$moment(t.recordForm.payTime||new Date).format("MMMM Do, h:mm a"))+" ")])],1),n("van-row",[n("van-cell",{scopedSlots:t._u([{key:"title",fn:function(){return[n("svg-icon",{staticClass:"business-icon",attrs:{"icon-class":"备注"}}),n("span",{staticStyle:{"margin-left":"1rem"}},[t._v("备注")])]},proxy:!0}])}),n("van-field",{attrs:{autosize:"",maxlength:"200",placeholder:"请输入备注",rows:"2","show-word-limit":"",type:"textarea"},model:{value:t.recordForm.remark,callback:function(e){t.$set(t.recordForm,"remark",e)},expression:"recordForm.remark"}})],1)],1)]),n("van-tab",{attrs:{name:"2",title:"转账"}},[n("div",{staticClass:"record-form transfer"},[n("van-field",{staticClass:"money",attrs:{type:"number"},on:{focus:t.noBomBox},model:{value:t.recordForm.money,callback:function(e){t.$set(t.recordForm,"money",e)},expression:"recordForm.money"}}),n("van-field",{staticClass:"temporary",attrs:{readonly:""},model:{value:t.money,callback:function(e){t.money=e},expression:"money"}}),n("van-row",{staticClass:"record-form-item",attrs:{align:"center",type:"flex"},on:{click:function(e){return t.openPopup("showSelectTransfer")}}},[n("van-col",[n("svg-icon",{staticClass:"business-icon",attrs:{"icon-class":"a-信用卡"}})],1),n("van-col",{staticClass:"line-height",attrs:{offset:1}},[t._v(" 账户 ")]),n("van-col",{staticClass:"account-item",attrs:{offset:1}},[n("div",{staticClass:"label"},[t._v("转出")]),n("div",{staticClass:"account"},[t._v(t._s(t._f("ellipsisFilter")(t.temporaryForm.account)))])]),n("van-col",{staticClass:"account-item-middle"},[n("svg-icon",{staticClass:"business-icon",attrs:{"icon-class":"转账"}})],1),n("van-col",{staticClass:"account-item"},[n("div",{staticClass:"label"},[t._v("转入")]),n("div",{staticClass:"account"},[t._v(t._s(t._f("ellipsisFilter")(t.temporaryForm.otherAccount)))])])],1),n("van-row",{staticClass:"record-form-item",attrs:{align:"center",type:"flex"},on:{click:function(e){return t.openPopup("showSelectTime")}}},[n("van-col",[n("svg-icon",{staticClass:"business-icon",attrs:{"icon-class":"时间"}})],1),n("van-col",{staticClass:"line-height",attrs:{offset:1}},[t._v(" 时间 ")]),n("van-col",{staticClass:"d-flex flex-items-center",attrs:{offset:1}},[t._v(" "+t._s(t.$moment(t.recordForm.payTime||new Date).calendar(null,{sameDay:"[今天]",nextDay:"[明天]",nextWeek:"dddd",lastDay:"[昨天]",lastWeek:"[上个] dddd",sameElse:"YYYY"})+" "+t.$moment(t.recordForm.payTime||new Date).format("MMMM Do, h:mm a"))+" ")])],1),n("van-row",[n("van-cell",{scopedSlots:t._u([{key:"title",fn:function(){return[n("svg-icon",{staticClass:"business-icon",attrs:{"icon-class":"备注"}}),n("span",{staticStyle:{"margin-left":"1rem"}},[t._v("备注")])]},proxy:!0}])}),n("van-field",{attrs:{autosize:"",maxlength:"200",placeholder:"请输入备注",rows:"2","show-word-limit":"",type:"textarea"},model:{value:t.recordForm.remark,callback:function(e){t.$set(t.recordForm,"remark",e)},expression:"recordForm.remark"}})],1)],1)])],1),n("div",{staticClass:"bottom-button"},[t.$route.query.recordId&&"3"!==t.active?n("van-button",{staticClass:"delete-button",on:{click:t.handleDelete}},[t._v(" 删除 ")]):t._e(),"3"!==t.active?n("van-button",{staticClass:"save-button",on:{click:t.handleAdd}},[t._v("保存")]):t._e(),"3"===t.active&&!1===t.editFlag?n("van-button",{staticClass:"edit-button",on:{click:function(e){t.editFlag=!0}}},[t._v("编辑 ")]):t._e(),"3"===t.active&&!0===t.editFlag?n("van-button",{staticClass:"edit-button",on:{click:function(e){t.editFlag=!1}}},[t._v("完成 ")]):t._e()],1)],1),n("van-popup",{attrs:{overlay:!1,position:"bottom"},model:{value:t.showCalculator,callback:function(e){t.showCalculator=e},expression:"showCalculator"}},[n("calculator",{on:{confirm:function(e){t.showCalculator=!1},getInputValue:function(e){return t.getInputValue(arguments)}}})],1),n("van-popup",{attrs:{overlay:!1,position:"bottom"},model:{value:t.showSelectType,callback:function(e){t.showSelectType=e},expression:"showSelectType"}},[n("van-picker",{attrs:{columns:t.typeColumns,loading:t.typeLoading,"show-toolbar":"",title:"选择类型","value-key":"typeName"},on:{cancel:function(e){t.showSelectType=!1},confirm:t.confirmType,change:t.changeType},scopedSlots:t._u([{key:"option",fn:function(e){return[n("svg-icon",{staticClass:"business-icon",attrs:{"icon-class":e.typeIcon||""}}),n("span",[t._v(t._s(e.typeName))])]}}])})],1),n("van-popup",{attrs:{overlay:!1,position:"bottom"},model:{value:t.showSelectAccount,callback:function(e){t.showSelectAccount=e},expression:"showSelectAccount"}},[n("van-picker",{attrs:{columns:t.accountColumns,loading:t.accountLoading,"show-toolbar":"",title:"选择账户","value-key":"accountName"},on:{cancel:function(e){t.showSelectAccount=!1},confirm:t.confirmAccount,change:t.changeAccount},scopedSlots:t._u([{key:"option",fn:function(e){return[n("svg-icon",{staticClass:"business-icon",attrs:{"icon-class":e.accountIcon||""}}),n("span",[t._v(t._s(e.accountName))])]}}])})],1),n("van-popup",{attrs:{overlay:!1,position:"bottom"},model:{value:t.showSelectTime,callback:function(e){t.showSelectTime=e},expression:"showSelectTime"}},[n("van-datetime-picker",{attrs:{formatter:t.formatterTime,title:"选择时间",type:"datetime"},on:{cancel:function(e){t.showSelectTime=!1},confirm:function(e){t.showSelectTime=!1}},model:{value:t.recordForm.payTime,callback:function(e){t.$set(t.recordForm,"payTime",e)},expression:"recordForm.payTime"}})],1),n("van-popup",{attrs:{overlay:!1,position:"bottom"},model:{value:t.showSelectTransfer,callback:function(e){t.showSelectTransfer=e},expression:"showSelectTransfer"}},[n("van-picker",{attrs:{columns:t.accountTransferColumns,loading:t.accountTransferLoading,"show-toolbar":"",title:"选择账户","value-key":"accountName"},on:{cancel:function(e){t.showSelectTransfer=!1},confirm:t.confirmTransfer,change:t.changeTransfer},scopedSlots:t._u([{key:"option",fn:function(e){return[n("svg-icon",{staticClass:"business-icon",attrs:{"icon-class":e.accountIcon||""}}),n("span",[t._v(t._s(e.accountName))])]}}])})],1)],1)},c=[],r=n("5530"),i=(n("d81d"),n("d3b7"),n("159b"),n("7db0"),n("4830")),a=n("1619"),s=n("9fb1"),u=n("cb13"),l=n("354e"),d=n("e396"),m={name:"addRecord",components:{Calculator:i["a"]},data:function(){return{temporaryForm:{primaryType:"",secondaryType:"",account:"",otherAccount:""},money:"",active:"1",recordForm:{id:this.$route.query.recordId,money:0,payTime:new Date},showCalculator:!1,showSelectType:!1,typeLoading:!1,typeColumns:[],showSelectAccount:!1,accountLoading:!1,accountColumns:[],showSelectTime:!1,showSelectTransfer:!1,accountTransferLoading:!1,accountTransferColumns:[],defaultHeight:"0",nowHeight:"0",submitFlag:!1,modelList:[],isModel:!1,modelId:void 0,editFlag:!1}},mounted:function(){var t=this;this.defaultHeight=document.documentElement.clientHeight,window.onresize=function(){return function(){t.nowHeight=document.documentElement.clientHeight}()},this.getTypeList(),this.getAccountList(),this.recordForm.id&&Object(l["c"])(this.recordForm.id).then((function(e){t.active=e.data.typeObject.typeDifference}))},watch:{active:function(t){this.showCalculator=!1,this.showSelectType=!1,this.showSelectAccount=!1,this.showSelectTime=!1,this.showSelectTransfer=!1,"2"===t?this.getAllAccountList():"3"===t?this.getModelList():(this.getTypeList(),this.getAccountList())},nowHeight:function(){this.defaultHeight!==this.nowHeight&&this.openPopup()}},methods:{handleDeleteModel:function(t){var e=this;this.$dialog.confirm({title:"删除提示",message:"是否删除该条模板?",confirmButtonText:"删除"}).then((function(){Object(d["b"])(t.id).then((function(t){e.$toast("删除成功"),e.$router.go(-1)}))})).catch((function(){}))},longTap:function(t,e){var n=this;console.log(e),this.$dialog.confirm({title:"提示",message:"操作模板",confirmButtonText:"编辑",confirmButtonColor:"#5A8DEE",cancelButtonText:"删除",cancelButtonColor:"#CD594B"}).then((function(){n.$router.push("/addModel?id="+e.id)})).catch((function(){Object(d["b"])(e.id).then((function(t){n.getModelList(),n.$toast("删除模板成功")}))}))},handleSelectModel:function(t){var e=this;Object(d["c"])(t.id).then((function(n){e.active=n.data.typeObject.typeDifference,e.modelId=t.id,e.isModel=!0}))},getModelList:function(){var t=this;Object(d["d"])().then((function(e){t.modelList=e.rows}))},moneyStyle:function(t){return"1"===t.typeObject.typeDifference?"blue":"0"===t.typeObject.typeDifference?"red":"2"===t.typeObject.typeDifference?"gray":void 0},handleDelete:function(){var t=this;this.$dialog.confirm({title:"删除提示",message:"是否删除该条记录?",confirmButtonText:"删除"}).then((function(){Object(l["b"])(t.recordForm.id).then((function(e){t.$toast("删除成功"),t.$router.go(-1)}))})).catch((function(){}))},openPopup:function(t){this.showSelectType=!1,this.showCalculator=!1,this.showSelectAccount=!1,this.showSelectTime=!1,this[t]=!0},getTypeList:function(){var t=this;this.typeLoading=!0;var e=[],n=[];Object(s["e"])({typeLevel:"0",typeDifference:this.active}).then((function(o){e=o.rows.map((function(t){return Object(r["a"])(Object(r["a"])({},t),{},{children:[]})})),Object(s["e"])({typeLevel:"1",typeDifference:t.active}).then((function(o){n=o.rows,n.forEach((function(t){e.find((function(e){return e.id===t.typeParentId})).children.push(t)})),t.typeColumns=e,Object(s["d"])({typeDifference:t.active}).then((function(e){t.recordForm.id?Object(l["c"])(t.recordForm.id).then((function(e){t.recordForm=e.data,t.temporaryForm.primaryType=t.typeColumns.find((function(e){return e.id===t.recordForm.typeObject.typeParentId}))?t.typeColumns.find((function(e){return e.id===t.recordForm.typeObject.typeParentId})).typeName:t.typeColumns[0].typeName,t.temporaryForm.secondaryType=t.typeColumns.find((function(e){return e.id===t.recordForm.typeObject.typeParentId}))?t.typeColumns.find((function(e){return e.id===t.recordForm.typeObject.typeParentId})).children.find((function(e){return e.id===t.recordForm.typeObject.id})).typeName:t.typeColumns[0].children[0].typeName})):t.isModel?Object(d["c"])(t.modelId).then((function(e){t.recordForm=e.data,t.temporaryForm.primaryType=t.typeColumns.find((function(e){return e.id===t.recordForm.typeObject.typeParentId}))?t.typeColumns.find((function(e){return e.id===t.recordForm.typeObject.typeParentId})).typeName:t.typeColumns[0].typeName,t.temporaryForm.secondaryType=t.typeColumns.find((function(e){return e.id===t.recordForm.typeObject.typeParentId}))?t.typeColumns.find((function(e){return e.id===t.recordForm.typeObject.typeParentId})).children.find((function(e){return e.id===t.recordForm.typeObject.id})).typeName:t.typeColumns[0].children[0].typeName})):e.rows.length>0?(t.typeColumns.unshift({typeName:"最近使用",typeIcon:"最近",children:e.rows}),t.temporaryForm.primaryType="最近使用",t.temporaryForm.secondaryType=e.rows[0].typeName,t.recordForm.type=e.rows[0].id):(t.temporaryForm.primaryType=t.typeColumns[0].typeName,t.temporaryForm.secondaryType=t.typeColumns[0].children[0].typeName)}))})),t.typeLoading=!1}))},confirmType:function(t,e){this.temporaryForm.primaryType=t[0],this.temporaryForm.secondaryType=t[1],this.recordForm.type=this.typeColumns[e[0]].children[e[1]].id,this.showSelectType=!1},changeType:function(t,e){this.temporaryForm.primaryType=e[0],this.temporaryForm.secondaryType=e[1],this.recordForm.type=this.typeColumns.find((function(t){return t.typeName===e[0]})).children.find((function(t){return t.typeName===e[1]})).id},getAccountList:function(){var t=this;this.accountLoading=!0,Object(u["e"])().then((function(e){t.getDicts("px_bookkeeping_account_type").then((function(n){var o=n.data.map((function(t){return{id:t.dictValue,accountName:t.dictLabel,accountIcon:t.remark,children:[]}}));e.rows.forEach((function(t){o.find((function(e){return e.id===t.accountType})).children.push(t)})),t.accountColumns=o,Object(u["d"])({typeDifference:t.active}).then((function(e){e.rows.length>0?(t.accountColumns.unshift({id:"lately",accountIcon:"最近",accountName:"最近使用",children:e.rows}),t.recordForm.id&&!t.temporaryForm.account?Object(l["c"])(t.recordForm.id).then((function(n){t.temporaryForm.account=e.rows.find((function(t){return t.id===n.data.account}))&&e.rows.find((function(t){return t.id===n.data.account})).accountName,t.temporaryForm.otherAccount=e.rows.find((function(t){return t.id===n.data.otherAccount}))&&e.rows.find((function(t){return t.id===n.data.otherAccount})).accountName})):t.isModel?Object(d["c"])(t.modelId).then((function(n){t.temporaryForm.account=e.rows.find((function(t){return t.id===n.data.account}))&&e.rows.find((function(t){return t.id===n.data.account})).accountName,t.temporaryForm.otherAccount=e.rows.find((function(t){return t.id===n.data.otherAccount}))&&e.rows.find((function(t){return t.id===n.data.otherAccount})).accountName})):(t.temporaryForm.account=e.rows[0].accountName,t.recordForm.account=e.rows[0].id)):t.recordForm.id&&!t.temporaryForm.account?Object(l["c"])(t.recordForm.id).then((function(n){t.temporaryForm.account=e.rows.find((function(t){return t.id===n.data.account}))&&e.rows.find((function(t){return t.id===n.data.account})).accountName,t.temporaryForm.otherAccount=e.rows.find((function(t){return t.id===n.data.otherAccount}))&&e.rows.find((function(t){return t.id===n.data.otherAccount})).accountName})):t.isModel?Object(d["c"])(t.modelId).then((function(n){t.temporaryForm.account=e.rows.find((function(t){return t.id===n.data.account}))&&e.rows.find((function(t){return t.id===n.data.account})).accountName,t.temporaryForm.otherAccount=e.rows.find((function(t){return t.id===n.data.otherAccount}))&&e.rows.find((function(t){return t.id===n.data.otherAccount})).accountName})):(t.temporaryForm.account=t.accountColumns[0].children[0].accountName,t.recordForm.account=t.accountColumns[0].children[0].id)})),t.accountLoading=!1}))}))},confirmAccount:function(t,e){this.temporaryForm.account=t[1],this.recordForm.account=this.accountColumns[e[0]].children[e[1]].id,this.showSelectAccount=!1},changeAccount:function(t,e){this.temporaryForm.account=e[1],this.recordForm.account=this.accountColumns.find((function(t){return t.accountName===e[0]})).children.find((function(t){return t.accountName===e[1]})).id},formatterTime:function(t,e){switch(t){case"year":e+="年";break;case"month":e+="月";break;case"day":e+="日";break}return e},getAllAccountList:function(){var t=this;this.accountTransferLoading=!0,Object(u["e"])().then((function(e){t.accountTransferColumns=[{values:e.rows,defaultIndex:0},{values:e.rows,defaultIndex:1}],t.recordForm.account=e.rows[0].id,t.recordForm.otherAccount=e.rows[1].id,t.temporaryForm.account=e.rows[0].accountName,t.temporaryForm.otherAccount=e.rows[1].accountName})),this.accountTransferLoading=!1},confirmTransfer:function(t){this.temporaryForm.account=t[0].accountName,this.recordForm.account=t[0].id,this.temporaryForm.otherAccount=t[1].accountName,this.recordForm.otherAccount=t[1].id,this.showSelectTransfer=!1},changeTransfer:function(t,e){this.temporaryForm.account=e[0].accountName,this.recordForm.account=e[0].id,this.temporaryForm.otherAccount=e[1].accountName,this.recordForm.otherAccount=e[1].id},handleAdd:function(){var t=this;if("3"===this.active)this.$router.push("/addModel");else{if(this.submitFlag)return;if(this.submitFlag=!0,this.recordForm.payTime=this.parseTime(this.recordForm.payTime),"2"===this.active&&(this.recordForm.type=0),this.recordForm.account===this.recordForm.otherAccount)return void this.$toast("转出账户和转入账户不能相同");this.recordForm.payTime||(this.recordForm.payTime=this.parseTime(new Date)),this.recordForm.id&&!this.isModel?Object(l["e"])(this.recordForm).then((function(e){t.$toast("修改成功"),t.$router.go(-1),t.submitFlag=!1})):Object(l["a"])(this.recordForm).then((function(e){t.$toast("新增成功"),t.$router.go(-1),t.submitFlag=!1}))}},noBomBox:function(t){document.activeElement.blur(),this.openPopup("showCalculator")},getInputValue:function(t){this.money=t[0],this.recordForm.money=Object(a["moneyFilter"])(t[1])}}},f=m,p=(n("e6fe"),n("2877")),h=Object(p["a"])(f,o,c,!1,null,"75e5f1f5",null);e["default"]=h.exports},c85d:function(t,e,n){"use strict";n("e6c9")},cb13:function(t,e,n){"use strict";n.d(e,"d",(function(){return c})),n.d(e,"e",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return a})),n.d(e,"f",(function(){return s})),n.d(e,"b",(function(){return u}));var o=n("b775");function c(t){return Object(o["a"])({url:"/bookkeeping/account/getLatelyAccountList",method:"get",params:t})}function r(t){return Object(o["a"])({url:"/bookkeeping/account/list",method:"get",params:t})}function i(t){return Object(o["a"])({url:"/bookkeeping/account/"+t,method:"get"})}function a(t){return Object(o["a"])({url:"/bookkeeping/account",method:"post",data:t})}function s(t){return Object(o["a"])({url:"/bookkeeping/account",method:"put",data:t})}function u(t){return Object(o["a"])({url:"/bookkeeping/account/"+t,method:"delete"})}},dbb4:function(t,e,n){var o=n("23e7"),c=n("83ab"),r=n("56ef"),i=n("fc6a"),a=n("06cf"),s=n("8418");o({target:"Object",stat:!0,sham:!c},{getOwnPropertyDescriptors:function(t){var e,n,o=i(t),c=a.f,u=r(o),l={},d=0;while(u.length>d)n=c(o,e=u[d++]),void 0!==n&&s(l,e,n);return l}})},e396:function(t,e,n){"use strict";n.d(e,"d",(function(){return c})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return i})),n.d(e,"e",(function(){return a})),n.d(e,"b",(function(){return s}));var o=n("b775");function c(t){return Object(o["a"])({url:"/myTool/menstruationRecordModel/list",method:"get",params:t})}function r(t){return Object(o["a"])({url:"/myTool/menstruationRecordModel/"+t,method:"get"})}function i(t){return Object(o["a"])({url:"/myTool/menstruationRecordModel",method:"post",data:t})}function a(t){return Object(o["a"])({url:"/myTool/menstruationRecordModel",method:"put",data:t})}function s(t){return Object(o["a"])({url:"/myTool/menstruationRecordModel/"+t,method:"delete"})}},e439:function(t,e,n){var o=n("23e7"),c=n("d039"),r=n("fc6a"),i=n("06cf").f,a=n("83ab"),s=c((function(){i(1)})),u=!a||s;o({target:"Object",stat:!0,forced:u,sham:!a},{getOwnPropertyDescriptor:function(t,e){return i(r(t),e)}})},e6c9:function(t,e,n){},e6fe:function(t,e,n){"use strict";n("2029")},efec:function(t,e,n){var o=n("9112"),c=n("51eb"),r=n("b622"),i=r("toPrimitive"),a=Date.prototype;i in a||o(a,i,c)}}]); |