(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["views-admin-agent-AgentUserLoans"],{f042:function(t,a,e){"use strict";e.r(a);var s=function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("v-container",{attrs:{fluid:""}},[e("v-row",[t.loanTypes.length?e("v-col",{attrs:{cols:"12"}},[e("span",{staticClass:"ml-2"},[t._v("فیلترها: ")]),e("v-btn-toggle",{staticClass:"mr-2 flex-wrap",attrs:{dense:"",tile:"",outlined:"",color:"purple"},model:{value:t.loanTypeFilter,callback:function(a){t.loanTypeFilter=a},expression:"loanTypeFilter"}},t._l(t.loanTypes,(function(a){return e("v-btn",{key:a.id,attrs:{value:a.id,small:""}},[t._v(" "+t._s(a.title)+" "),e("v-badge",{attrs:{color:"blue",content:0===a.id?t.items.length:t.items.filter((function(t){return t.loanModel.id==a.id})).length||"0",inline:""}})],1)})),1)],1):t._e(),e("v-col",{attrs:{cols:"11"}},[e("v-text-field",{staticClass:"mb-5",attrs:{"append-icon":"mdi-magnify",label:"اطلاعات مورد نظر خود جهت جستجو وارد کنید","single-line":"","hide-details":""},model:{value:t.search,callback:function(a){t.search=a},expression:"search"}})],1),e("v-col",{attrs:{cols:"1"}},[e("export-excel",{attrs:{items:t.items,headers:t.headers,fileName:"لیست پرونده وام های نماینده"}})],1),e("v-col",{attrs:{cols:"12"}},[e("v-data-table",{staticClass:"elevation-1",attrs:{headers:t.headers,loading:t.loading,items:t.filteredItems,"items-per-page":500,search:t.search},scopedSlots:t._u([{key:"item",fn:function(a){return[e("tr",[e("td",{staticClass:"text-right"},[e("div",[e("small",[t._v(t._s(a.item.memberModel.fullName))])]),e("div",[e("small",{staticClass:"grey--text"},[t._v(t._s(a.item.memberModel.nationalCode))])])]),e("td",{staticClass:"text-right"},[e("div",[e("small",[t._v("شماره وام: ")]),e("small",{staticClass:"grey--text"},[t._v(t._s(a.item.code))])]),e("div",[e("small",[t._v("عنوان وام: ")]),e("small",{staticClass:"grey--text"},[t._v(t._s(a.item.loanModel.title))])]),e("div",[e("small",[t._v("تاریخ شروع: ")]),e("small",{staticClass:"grey--text"},[t._v(t._s(a.item.startDate_Persian.date))])]),e("div",[e("small",[t._v("مبلغ وام: ")]),e("small",{staticClass:"grey--text"},[t._v(t._s(a.item.amount.toString().toPriceFormat()))])])]),e("td",{staticClass:"text-right"},[e("div",[e("small",[t._v("قابل پرداخت: ")]),e("small",{staticClass:"grey--text"},[t._v(t._s(a.item.payableAmount.toString().toPriceFormat()))])]),e("div",[e("small",[t._v("تعداد اقساط: ")]),e("small",{staticClass:"grey--text"},[t._v(t._s(a.item.month))])]),e("div",[e("small",[t._v("مجموع اقساط پرداخت شده: ")]),e("small",{staticClass:"grey--text"},[t._v(t._s(a.item.paid.toString().toPriceFormat()))])]),e("div",[e("small",[t._v("مانده: ")]),e("small",{staticClass:"grey--text"},[t._v(t._s(a.item.remain.toString().toPriceFormat()))])])]),e("td",{staticClass:"text-right"},[t.agent.agentId?e("div",[e("small",[t._v("نام نماینده: ")]),e("small",{staticClass:"grey--text"},[t._v(t._s(a.item.agentModel.businessName))])]):t._e(),e("div",[e("small",[t._v("سررسید تسویه: ")]),e("small",{staticClass:"grey--text"},[t._v(t._s(a.item.agentDueDate_Persian?a.item.agentDueDate_Persian.date:""))])]),e("div",[e("small",[t._v("سهم نماینده: ")]),e("small",{staticClass:"grey--text"},[t._v(t._s(a.item.agentPrice.toString().toPriceFormat()))])]),e("div",[e("small",[t._v("مجموع واریز اسپانسر: ")]),e("small",{staticClass:"info--text",staticStyle:{cursor:"pointer"},on:{click:function(e){return t.transactionList(a.item)}}},[t._v(t._s(a.item.sumSponsorPayments.toString().toPriceFormat()))])]),e("div",{staticClass:"text-center"},[e("v-btn",{attrs:{color:"secondary","x-small":""},on:{click:function(e){return t.transaction(a.item)}}},[t._v("ثبت واریزی")])],1)]),t.agent.agentId?e("td",{staticClass:"text-right"},[e("div",[e("small",[t._v("سررسید تسویه: ")]),e("small",{staticClass:"grey--text"},[t._v(t._s(a.item.subAgentDueDate_Persian?a.item.subAgentDueDate_Persian.date:""))])]),e("div",[e("small",[t._v("سهم زیرمجموعه: ")]),e("small",{staticClass:"grey--text"},[t._v(t._s(a.item.subAgentPrice.toString().toPriceFormat()))])]),e("div",[e("small",[t._v("مجموع واریز به زیرمجموعه: ")]),e("small",{staticClass:"info--text",staticStyle:{cursor:"pointer"},on:{click:function(e){return t.subAgentTransactionList(a.item)}}},[t._v(" "+t._s(a.item.sumParentAgentPayments.toString().toPriceFormat())+" ")])])]):t._e()])]}}])})],1)],1),e("v-dialog",{attrs:{scrollable:"","max-width":"925px"},model:{value:t.dialogTransaction,callback:function(a){t.dialogTransaction=a},expression:"dialogTransaction"}},[e("v-card",[e("v-card-title",[e("div",[e("span",{staticClass:"headline"})]),e("v-spacer"),e("v-btn",{attrs:{icon:""},on:{click:function(a){t.dialogTransaction=!1}}},[e("v-icon",[t._v("mdi-close")])],1)],1),e("v-card-text",[e("v-container",[t.dialogTransaction?e("ModifyTransaction",{attrs:{data:t.selectedTransaction},on:{callbck:t.callbck_transaction}}):t._e()],1)],1)],1)],1),e("v-dialog",{attrs:{scrollable:"","max-width":"1200px"},model:{value:t.dialogAgentTransactionsList,callback:function(a){t.dialogAgentTransactionsList=a},expression:"dialogAgentTransactionsList"}},[e("v-card",[e("v-card-title",[e("div",[e("span",{staticClass:"headline"},[t._v("لیست واریزی ها")])]),e("v-spacer"),e("v-btn",{attrs:{icon:""},on:{click:function(a){t.dialogAgentTransactionsList=!1}}},[e("v-icon",[t._v("mdi-close")])],1)],1),e("v-card-text",[t.dialogAgentTransactionsList?e("AgentTransactions",{attrs:{agent:t.localAgent,userLoan:t.selectedUserLoan},on:{update:function(){t.loadData(),t.$emit("update")}}}):t._e()],1)],1)],1),e("v-dialog",{attrs:{scrollable:"","max-width":"1200px"},model:{value:t.dialogSubAgentTransactionsList,callback:function(a){t.dialogSubAgentTransactionsList=a},expression:"dialogSubAgentTransactionsList"}},[e("v-card",[e("v-card-title",[e("div",[e("span",{staticClass:"headline"},[t._v("لیست واریزی ها")])]),e("v-spacer"),e("v-btn",{attrs:{icon:""},on:{click:function(a){t.dialogSubAgentTransactionsList=!1}}},[e("v-icon",[t._v("mdi-close")])],1)],1),e("v-card-text",[t.dialogSubAgentTransactionsList?e("SubAgentTransactions",{attrs:{agent:t.agent,userLoan:t.selectedUserLoan},on:{update:function(){t.loadData(),t.$emit("update")}}}):t._e()],1)],1)],1),e("confirm-dlg",{ref:"confirm"}),e("div",{staticClass:"py-3"})],1)},n=[],i=(e("99af"),e("4de4"),e("c975"),e("13d5"),e("d3b7"),e("07ac"),e("ade3")),l=e("5530"),o=e("2909"),r=e("7c44"),c=e("5aff"),d=e("324f"),g={name:"AgentUserLoans",props:{agent:{type:Object}},components:{ConfirmDlg:function(){return Promise.resolve().then(e.bind(null,"9420"))},AgentTransactions:function(){return e.e("views-admin-agent-AgentTransactions").then(e.bind(null,"462e"))},ModifyTransaction:function(){return Promise.all([e.e("chunk-2d216256"),e.e("views-admin-ModifyTransaction")]).then(e.bind(null,"c0e8"))},SubAgentTransactions:function(){return e.e("views-agent-sub-agent-SubAgentTransactions").then(e.bind(null,"660e"))}},data:function(){return{localAgent:null,selectedTransaction:null,selectedUserLoan:null,dialogAgentTransactionsList:!1,dialogSubAgentTransactionsList:!1,dialogTransaction:!1,errorMessages:"",search:"",loading:!1,headers:[{text:"مشخصات مشتری",align:"start",sortable:!0,value:"memberModel.fullName",width:170},{text:"کد ملی",align:"start d-none",sortable:!0,value:"memberModel.nationalCode"},{text:"مشخصات وام",align:"start",sortable:!0,value:"code",width:200},{text:"مشخصات بازپرداخت",align:"start",sortable:!0,value:"paid",width:250},{text:"".concat(this.agent.agentId?"تسویه با نماینده سطح 1":"تسویه با نماینده"),align:"center",sortable:!0,value:"agentDueDate_Persian",width:220},{text:"تسویه با نماینده زیرمجموعه",align:"center",sortable:!0,value:"userLoan.subAgentDueDate_Persian",width:250}],items:[],loanTypes:[],loanTypeFilter:""}},mounted:function(){this.localAgent=this.agent,this.localAgent.agentId||(this.headers=this.headers.filter((function(t){return"userLoan.subAgentDueDate_Persian"!==t.value}))),this.loadData()},computed:{filteredItems:function(){var t,a=this;if(!this.loanTypeFilter)return this.items;var e=[];return(t=e).push.apply(t,Object(o["a"])(this.items)),e=e.filter((function(t){return a.loanTypeFilter.indexOf(t.loanModel.id)>-1})),e}},methods:{loadData:function(){var t=this;this.loading=!0,r["a"].get("agent/userLoan/GetLoansByAgentId/"+this.agent.id,null).then((function(a){t.items=a,t.loanTypes=Object.values(a.reduce((function(t,a){return Object(l["a"])(Object(l["a"])({},t),{},Object(i["a"])({},a.loanModel.id,a.loanModel))}),{})),t.loanTypes.length&&(t.loanTypes.push({id:0,title:"همه"}),t.loanTypeFilter=0)})).catch((function(t){c["a"].error(t.message)})).finally((function(){t.loading=!1}))},transaction:function(t){t.agentModel&&(this.localAgent=t.agentModel),this.selectedTransaction={id:d["a"],paymentMethod:2,isWithdraw:!0,agent:{id:this.localAgent.id,businessName:this.localAgent.businessName,mobile:this.localAgent.mobile,firstName:this.localAgent.firstName,bankAccountsJson:this.localAgent.bankAccountsJson},userLoan:{id:t.id,title:"شماره وام: ".concat(t.code,", عنوان: ").concat(t.loanModel.title),code:t.code},amount:Math.max(t.agentPrice-t.sumSponsorPayments,0),maxAmount:t.agentPrice-t.sumSponsorPayments},this.dialogTransaction=!0},callbck_transaction:function(t){this.dialogTransaction=!1,t&&(this.loadData(),this.$emit("update"))},transactionList:function(t){t.agentModel&&(this.localAgent=t.agentModel),this.selectedUserLoan=t,this.dialogAgentTransactionsList=!0},subAgentTransactionList:function(t){this.selectedUserLoan=t,this.dialogSubAgentTransactionsList=!0}}},m=g,u=e("2877"),v=e("6544"),h=e.n(v),_=e("4ca6"),b=e("8336"),f=e("a609"),p=e("b0af"),T=e("99d9"),x=e("62ad"),y=e("a523"),A=e("8fea"),C=e("169a"),L=e("132d"),P=e("0fd9"),S=e("2fa4"),D=e("8654"),w=Object(u["a"])(m,s,n,!1,null,null,null);a["default"]=w.exports;h()(w,{VBadge:_["a"],VBtn:b["a"],VBtnToggle:f["a"],VCard:p["a"],VCardText:T["c"],VCardTitle:T["d"],VCol:x["a"],VContainer:y["a"],VDataTable:A["a"],VDialog:C["a"],VIcon:L["a"],VRow:P["a"],VSpacer:S["a"],VTextField:D["a"]})}}]);
//# sourceMappingURL=views-admin-agent-AgentUserLoans.e8c83fd2.js.map