/
home
/
henzagold
/
adminold
/
export
/
js
/
File Upload :
llllll
Current File: /home/henzagold/adminold/export/js/chunk-2d22891e.04a68b19.js
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d22891e"],{da6a:function(t,e,a){"use strict";a.r(e);a("6762"),a("2fdb"),a("7f7f");var r,s,n,o=function(){var t=this,e=t._self._c;return e("vx-card",[e("a-spin",{attrs:{spinning:t.loading}},[e("div",{staticClass:"grid gap-4 grid-cols-1 md:grid-cols-3"},[e("a-form-item",{attrs:{label:"نوع نمایش"}},[e("a-select",{staticClass:"w-full",on:{change:t.getData},model:{value:t.mode,callback:function(e){t.mode=e},expression:"mode"}},[e("a-select-option",{attrs:{value:"title"}},[t._v("\n عنوان مسیر\n ")]),e("a-select-option",{attrs:{value:"customer/all"}},[t._v("\n تمام مشتریان\n ")]),e("a-select-option",{attrs:{value:"customer/id"}},[t._v("\n یک مشتری\n ")])],1)],1),"customer/id"===t.mode?e("a-form-item",{attrs:{label:"مشتری"}},[e("a-select",{staticClass:"w-full",attrs:{"show-search":"","filter-option":t.filterOption},on:{change:t.getData},model:{value:t.customer,callback:function(e){t.customer=e},expression:"customer"}},t._l(t.customer_list,(function(a){return e("a-select-option",{key:a.id,attrs:{value:a.id}},[t._v("\n "+t._s(a.name)+"\n ")])})),1)],1):t._e(),"customer/id"===t.mode?e("a-form-item",{staticClass:"flex flex-col justify-end"},[e("a-input",{attrs:{disabled:""}},[e("div",{attrs:{slot:"prefix"},slot:"prefix"},[t._v("آخرین بازدید:")]),e("div",{attrs:{slot:"suffix"},slot:"suffix"},[t._v(t._s(this.lastSeen.ago?this.lastSeen.ago:""))])])],1):t._e()],1),e("a-form",{attrs:{form:t.formDate}},[e("div",{staticClass:"grid gap-4 grid-cols-1 md:grid-cols-3 mb-5"},[e("div",[e("DateInput",{attrs:{field:"start_at",displayFormat:"jYYYY/jMM/jDD",format:"YYYY-MM-DD",label:"تاریخ شروع",options:{rules:[{required:!1,message:"تاریخ شروع را وارد نمایید"}]}}})],1),e("div",[e("DateInput",{attrs:{field:"end_at",displayFormat:"jYYYY/jMM/jDD",format:"YYYY-MM-DD",label:"تاریخ پایان",options:{rules:[{required:!1,message:"تاریخ پایان را وارد نمایید"}]}}})],1),e("div",{staticClass:"flex justify-between items-center"},[e("vs-button",{staticClass:"mr-4 py-2 mt-3",on:{click:t.handleSubmit}},[t._v("جستجو")]),e("feather-icon",{staticClass:"cursor-pointer mt-5",attrs:{icon:"RotateCwIcon"},on:{click:t.getData}})],1)])]),e("a-table",{attrs:{columns:t.cols,"data-source":t.dataSource,bordered:""},scopedSlots:t._u([{key:"row",fn:function(a,r,s){return e("div",{},[t._v(t._s(s+1))])}},{key:"product",fn:function(a,r,s){return e("div",{},[t._v(t._s(r.title&&r.title.includes("تک-محصول")&&r.product.title?r.product.title:null))])}}])})],1)],1)},i=[],c=(a("96cf"),a("1da1")),l=a("bb36"),u=a("e133"),d={name:"index",data:function(){return{dataSource:[],customer_list:[],mode:"title",customer:null,loading:!1,formDate:this.$form.createForm(this,{name:"coordinated"}),lastSeen:[]}},components:{DateInput:u["a"]},computed:{cols:function(){var t=[{title:"ردیف",dataIndex:"time",key:"time",scopedSlots:{customRender:"row"}}];return"customer/all"!==this.mode?t.push({title:"عنوان",dataIndex:"title",key:"title"}):t.push({title:"مشتری",dataIndex:"customer",key:"customer",children:[{title:"شناسه",dataIndex:"customer.id",key:"customer.id"},{title:"نام",dataIndex:"customer.name",key:"customer.name"},{title:"موبایل",dataIndex:"customer.mobile",key:"customer.mobile"}]}),t.push({title:"زمان",dataIndex:"time",key:"time"}),t.push({title:"نام محصول",dataIndex:"title",key:"title",scopedSlots:{customRender:"product"}}),t}},methods:{handleSubmit:function(){var t,e=this;this.formDate.validateFields((function(a,r){return(t=t||Object(c["a"])(regeneratorRuntime.mark((function t(a,r){var s,n,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!r.start_at||!r.end_at){t.next=20;break}return t.prev=1,e.loading=!0,s="customer/id"!==e.mode?"log/".concat(e.mode):e.customer?"log/customer/".concat(e.customer):void 0,t.next=6,l["b"].post(s,r);case 6:n=t.sent,o=n.data,e.dataSource=o,t.next=15;break;case 11:t.prev=11,t.t0=t["catch"](1),console.log(t.t0),e.$ntSetError("خطا در دریافت اطلاعات");case 15:return t.prev=15,e.loading=!1,t.finish(15);case 18:t.next=21;break;case 20:e.$ntSetError("پر کردن فیلد تاریخ اجباری است");case 21:case"end":return t.stop()}}),t,null,[[1,11,15,18]])})))).apply(this,arguments)}))},filterOption:function(t,e){return e.componentOptions.children[0].text.toLowerCase().indexOf(t.toLowerCase())>=0},getData:function(){return(r=r||Object(c["a"])(regeneratorRuntime.mark((function t(){var e,a,r,s,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(t.prev=0,this.loading=!0,e="customer/id"!==this.mode?"log/".concat(this.mode):this.customer?"log/customer/".concat(this.customer):void 0,!e){t.next=15;break}return t.next=6,l["b"].post(e);case 6:if(a=t.sent,r=a.data,this.dataSource=r,"customer/id"!==this.mode){t.next=15;break}return t.next=12,l["b"].get("log/ago/".concat(this.customer));case 12:s=t.sent,n=s.data,this.lastSeen=n;case 15:t.next=21;break;case 17:t.prev=17,t.t0=t["catch"](0),console.log(t.t0),this.$ntSetError("خطا در دریافت اطلاعات");case 21:return t.prev=21,this.loading=!1,t.finish(21);case 24:case"end":return t.stop()}}),t,this,[[0,17,21,24]])})))).apply(this,arguments)},getCustomerList:function(){return(s=s||Object(c["a"])(regeneratorRuntime.mark((function t(){var e,a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,this.loading=!0,t.next=4,l["b"].get("/log/list/customer");case 4:e=t.sent,a=e.data,this.customer_list=a,t.next=13;break;case 9:t.prev=9,t.t0=t["catch"](0),console.log(t.t0),this.$ntSetError("خطا در دریافت اطلاعات");case 13:return t.prev=13,this.loading=!1,t.finish(13);case 16:case"end":return t.stop()}}),t,this,[[0,9,13,16]])})))).apply(this,arguments)}},created:function(){return(n=n||Object(c["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.getData();case 2:return t.next=4,this.getCustomerList();case 4:case"end":return t.stop()}}),t,this)})))).apply(this,arguments)}},m=d,p=a("2877"),f=Object(p["a"])(m,o,i,!1,null,"64bc2fbc",null);e["default"]=f.exports}}]);
Copyright ©2k19 -
Hexid
|
Tex7ure