/
home
/
liman
/
panel
/
js
/
File Upload :
llllll
Current File: //home/liman/panel/js/243-legacy.617d9415.js
(self["webpackChunkliman"]=self["webpackChunkliman"]||[]).push([[243],{91394:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return v}});var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("h4",[e._v(" اطلاعات پایه ")]),r("a-steps",{attrs:{type:"navigation",size:"small"},model:{value:e.step,callback:function(t){e.step=t},expression:"step"}},e._l(e.formsName,(function(e){return r("a-step",{key:e,attrs:{title:e}})})),1),e._l(e.form,(function(t,n){return r("sedmed-form",{directives:[{name:"show",rawName:"v-show",value:n===e.step,expression:"index === step"}],key:n,ref:"forms",refInFor:!0,attrs:{name:e.formsName[n],hasBtn:!1,items:e.form[n],"initial-value":e.initialValue,"select-options":e.formOptions},on:{change_province:e.getCities}},[r("div",{staticClass:"flex",attrs:{slot:"after"},slot:"after"},[0!==n?r("a-button",{staticClass:"mr-2",on:{click:function(t){e.step--}}},[e._v("مرحله قبل")]):e._e(),4!==n?r("a-button",{attrs:{type:"primary"},on:{click:function(t){return e.validate(n,t)}}},[e._v("مرحله بعد")]):e._e(),4===n?r("a-button",{attrs:{type:"primary"},on:{click:function(t){return e.validate(-1,t)}}},[e._v("ثبت")]):e._e()],1)])}))],2)},i=[],a=r(60372),o=r(37703),s=(r(49955),r(49966),r(97244),r(776),r(50098),r(44231)),c=r(24688),u=r(45525),l=r(43431),m=r(11179),d={name:"addEditCustomer",components:{SedmedForm:u.Z},mixins:[s.Z,l.Z,m.Z],data:function(){return{step:0,initialValue:void 0,contactFromItems:Object.assign(Object.assign({},c),{phone:{label:"تلفن ثابت",decorator:[{defaultKey:"phone"}]},email:{label:"ایمیل",decorator:[{defaultKey:"mail"}]},porters:{label:"کارشناسان فروش",custom:{type:"select",mode:"multiple",options:"porters",options_mode:"list",options_key:{val:"user",display:"user+user__full_name"},filterOption:!0,search:!0}}}),shopFromItems:{shop_name:{label:"نام فروشگاه",decorator:[{defaultKey:"required"}]},aria:{label:"منطقه",decorator:[{defaultKey:"required"}]},postcode:{label:"کد پستی",decorator:[{defaultKey:"zip"}]},province:{label:"استان",decorator:[],getEvent:!0,custom:{type:"select",options:"province",options_mode:"list",options_key:{val:"id",display:"name"},filterOption:!0,search:!0}},city:{label:"شهر",decorator:[],custom:{type:"select",options:"city",options_mode:"list",options_key:{val:"id",display:"name"},filterOption:!0,search:!0}},address:{label:"آدرس",decorator:[],custom:{type:"textarea",autoSize:{minRows:3,maxRows:5}},cls:"md:col-span-3"}},accountFromItems:{max_debt:{label:"سقف بدهی",custom:{type:"number",min:0},itemCls:"w-full hide-counter"},max_period:{label:"سقف مدت",custom:{type:"number",min:0},itemCls:"w-full hide-counter"},economical_number:{label:"شماره اقتصادی",decorator:[{defaultKey:"num"}]},registration_number:{label:"شماره ثبت",decorator:[{defaultKey:"num"}]}},additionalFromItems:{telegram:{label:"آیدی تلگرام"},instagram:{label:"آیدی اینستاگرام"},whatsapp:{label:"آیدی واتس اپ"},web_url:{label:"آدرس سایت"},first_currency:{label:"نوع ارز اول",decorator:[{defaultKey:"required"}],custom:{type:"select",options:"currency",options_mode:"list",options_key:{val:"id",display:"name"},filterOption:!0,search:!0}},second_currency:{label:"نوع ارز دوم",decorator:[{defaultKey:"required"}],custom:{type:"select",options:"currency",options_mode:"list",options_key:{val:"id",display:"name"},filterOption:!0,search:!0}},metal:{label:"جنس فلز",decorator:[{defaultKey:"required"}],custom:{type:"select",options:"metal",options_mode:"list",options_key:{val:"id",display:"name"},filterOption:!0,search:!0}}},docFromItems:{national_card_img:{label:"تصویر کارت ملی",custom:{type:"upload",mode:"single",urlKey:"national_card_img_url"},initialValue:[]},license_img:{label:"تصویر جواز",custom:{type:"upload",mode:"single",urlKey:"license_img_url"},initialValue:[]},doc_img:{label:"تصویر سند یا اجاره نامه",custom:{type:"upload",mode:"single",urlKey:"doc_img_url"},initialValue:[]}},formsName:["اطلاعات تماس","اطلاعات فروشگاه","اطلاعات حساب کاربری","مدارک","اطلاعات تکمیلی"],porters:[]}},computed:{formOptions:function(){return{currency:this.currency,metal:this.metal,province:this.province,city:this.cities,porters:this.porters}},form:function(){return[this.contactFromItems,this.shopFromItems,this.accountFromItems,this.docFromItems,this.additionalFromItems]}},created:function(){var e=this;return(0,o.Z)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Promise.all([e.getNegotiableByType("currency"),e.getNegotiableByType("metal"),e.getProvince(),e.getPorters()]);case 2:case"end":return t.stop()}}),t)})))()},methods:{getPorters:function(){var e=this;return(0,o.Z)(regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,e.$store.commit("setLoading",!0),t.next=4,e.$axios.post("/porter/table",{limit:2e3});case 4:r=t.sent,n=r.data.rows,e.porters=n[0],t.next=12;break;case 9:t.prev=9,t.t0=t["catch"](0),console.log(t.t0);case 12:return t.prev=12,e.$store.commit("setLoading",!1),t.finish(12);case 15:case"end":return t.stop()}}),t,null,[[0,9,12,15]])})))()},handelSubmit:function(e){var t=Object.assign(e,{full_name:"".concat(e.first_name," ").concat(e.last_name)});return"object"==(0,a.Z)(t.city)&&t.city.id&&t.city.parent&&t.city.parent.id&&(t.province=t.city.parent.id,t.city=t.city.id),"object"==(0,a.Z)(t.city)&&(t.city=null),this.id?this.update(t):this.create(t)},validate:function(e,t){if(-1!==e){var r=this.$refs.forms[e].handleSubmit(t);if(r)return this.step++}else{for(var n=!0,i={},a=0;a<5;a++){var o=this.$refs.forms[a].handleSubmit(t);if(!o){n=!1;break}i=Object.assign(i,o)}n&&this.handelSubmit(i)}}}},p=d,f=r(38e3),h=(0,f.Z)(p,n,i,!1,null,"6a05f9da",null),v=h.exports},44231:function(e,t,r){"use strict";var n=r(37703);r(49955);t["Z"]={data:function(){return{province:[],cities:[]}},methods:{getProvince:function(){var e=this;return(0,n.Z)(regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,e.$store.commit("setLoading",!0),t.next=4,e.$caxios.post("/utility/province/table",{limit:2e3,filters:[{field:"level",value:1}]});case 4:r=t.sent,n=r.data.rows,e.province=n[0],t.next=12;break;case 9:t.prev=9,t.t0=t["catch"](0),console.log(t.t0);case 12:return t.prev=12,e.$store.commit("setLoading",!1),t.finish(12);case 15:case"end":return t.stop()}}),t,null,[[0,9,12,15]])})))()},getCities:function(e){var t=this;return(0,n.Z)(regeneratorRuntime.mark((function r(){var n,i;return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(r.prev=0,!e){r.next=8;break}return t.$store.commit("setLoading",!0),r.next=5,t.$caxios.post("/utility/province/table",{filters:[{field:"parent",value:e}],limit:2e3});case 5:n=r.sent,i=n.data.rows,t.cities=i[0];case 8:r.next=13;break;case 10:r.prev=10,r.t0=r["catch"](0),console.log(r.t0);case 13:return r.prev=13,t.$store.commit("setLoading",!1),r.finish(13);case 16:case"end":return r.stop()}}),r,null,[[0,10,13,16]])})))()}}}},43431:function(e,t,r){"use strict";var n=r(37703);r(37217),r(49966),r(92206),r(49955);t["Z"]={data:function(){return{negoTypes:{currency:1,metal:2,stone:3,negotiable:4},negotiable:[],stone:[],metal:[],currency:[]}},methods:{getNegotiableByType:function(e){var t=this;return(0,n.Z)(regeneratorRuntime.mark((function r(){var n,i;return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return r.prev=0,t.$store.commit("setLoading",!0),r.next=4,t.$axios.post("/negotiable/table",{filters:[{field:"type",op:"like",value:t.negoTypes[e]}],limit:2e3});case 4:n=r.sent,i=n.data.rows,t[e]=i[0],r.next=12;break;case 9:r.prev=9,r.t0=r["catch"](0),console.log(r.t0);case 12:return r.prev=12,t.$store.commit("setLoading",!1),r.finish(12);case 15:case"end":return r.stop()}}),r,null,[[0,9,12,15]])})))()},showCurrency:function(e){var t=this.currency.find((function(t){return t.id==e}));return t&&t.name?t.name:"نا معتبر"},showMetal:function(e){var t=this.metal.find((function(t){return t.id==e}));return t&&t.name?t.name:"نا معتبر"},showStone:function(e){var t=this.stone.find((function(t){return t.id==e}));return t&&t.name?t.name:"نا معتبر"},showNegotiable:function(e){var t=this.negotiable.find((function(t){return t.id==e}));return t&&t.name?t.name:"نا معتبر"}}}},11179:function(e,t,r){"use strict";var n=r(37703);r(49955),r(49966),r(97244),r(776),r(50098);t["Z"]={data:function(){return{initialValue:void 0,model:void 0,view:!1}},computed:{id:function(){return this.$route.params.id},restfull:function(){return this.$route.meta.restfull},restfullPath:function(){return this.$route.meta.restfullPath||this.$route.meta.restfull},customRoute:function(){return this.$route.meta.isCustomRoute}},created:function(){var e=this;return(0,n.Z)(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r(18847)("./".concat(e.restfull,"Tbl"));case 2:if(n=t.sent,e.model=n.default,!e.id||e.customRoute){t.next=7;break}return t.next=7,e.getData();case 7:if(!(e.initialValue&&e.initialValue.city&&e.initialValue.province)){t.next=10;break}return t.next=10,e.getCities(e.initialValue.province);case 10:case"end":return t.stop()}}),t)})))()},methods:{getData:function(){var e=arguments,t=this;return(0,n.Z)(regeneratorRuntime.mark((function r(){var n,i,a;return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return n=e.length>0&&void 0!==e[0]?e[0]:void 0,r.prev=1,t.$store.commit("setLoading",!0),r.next=5,t.$axios.get("/".concat(t.restfullPath,"/").concat(n||t.id,"/"));case 5:i=r.sent,a=i.data,a&&a.city&&a.city.id&&a.city.parent&&a.city.parent.id?t.initialValue=Object.assign(a,{province:a.city.parent.id,city:a.city.id}):t.initialValue=a,r.next=13;break;case 10:r.prev=10,r.t0=r["catch"](1),console.log(r.t0);case 13:return r.prev=13,t.$store.commit("setLoading",!1),r.finish(13);case 16:case"end":return r.stop()}}),r,null,[[1,10,13,16]])})))()},update:function(e){var t=this;return(0,n.Z)(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return r.prev=0,t.$store.commit("setLoading",!0),r.next=4,t.$axios.patch("/".concat(t.restfullPath,"/").concat(t.id,"/"),e);case 4:return t.$ntSuccess("اطلاعات با موفقیت آپدیت شد"),r.next=7,t.$router.push({name:"".concat(t.restfull,"_list")});case 7:r.next=12;break;case 9:r.prev=9,r.t0=r["catch"](0),console.log(r.t0);case 12:return r.prev=12,t.$store.commit("setLoading",!1),r.finish(12);case 15:case"end":return r.stop()}}),r,null,[[0,9,12,15]])})))()},create:function(e){var t=this;return(0,n.Z)(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return r.prev=0,t.$store.commit("setLoading",!0),r.next=4,t.$axios.post("/".concat(t.restfullPath,"/"),e);case 4:return t.$ntSuccess("اطلاعات با موفقیت ثبت شد"),r.next=7,t.$router.push({name:"".concat(t.restfull,"_list")});case 7:r.next=12;break;case 9:r.prev=9,r.t0=r["catch"](0),console.log(r.t0);case 12:return r.prev=12,t.$store.commit("setLoading",!1),r.finish(12);case 15:case"end":return r.stop()}}),r,null,[[0,9,12,15]])})))()},toEdit:function(e){window.open("/".concat(this.restfull,"/edit/").concat(e),"_blank").focus()},setInitialValue:function(e){this.initialValue=e,this.view=!0},toView:function(e){var t=this;return(0,n.Z)(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return r.next=2,t.getData(e);case 2:t.view=!0;case 3:case"end":return r.stop()}}),r)})))()},deleteItem:function(e){var t=this;return(0,n.Z)(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return r.prev=0,t.$store.commit("setLoading",!0),r.next=4,t.$axios.delete("/".concat(t.restfullPath,"/").concat(e,"/"));case 4:return t.$ntSuccess("آیتم با موفقیت حذف شد"),r.next=7,t.$refs["".concat(t.restfull,"Tbl")].fetch();case 7:r.next=12;break;case 9:r.prev=9,r.t0=r["catch"](0),console.log(r.t0);case 12:return r.prev=12,t.$store.commit("setLoading",!1),r.finish(12);case 15:case"end":return r.stop()}}),r,null,[[0,9,12,15]])})))()}}}},18847:function(e,t,r){var n={"./brandTbl":[54660,660],"./categoryTbl":[22881,881],"./customerTbl":[61003,3],"./documentTbl":[1370,370],"./factorTbl":[13159,159],"./negotiable-typeTbl":[47429,429],"./negotiableTbl":[2941,941],"./porterTbl":[63685,685],"./productTbl":[44740,740],"./userTbl":[66896,896]};function i(e){if(!r.o(n,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=n[e],i=t[0];return r.e(t[1]).then((function(){return r(i)}))}i.keys=function(){return Object.keys(n)},i.id=18847,e.exports=i},24688:function(e){"use strict";e.exports=JSON.parse('{"first_name":{"label":"نام","decorator":[{"defaultKey":"required"},{"defaultKey":"fa"}]},"last_name":{"label":"نام خانوادگی","decorator":[{"defaultKey":"required"},{"defaultKey":"fa"}]},"mobile":{"label":"تلفن همراه","decorator":[{"defaultKey":"required"},{"defaultKey":"mobile"}]}}')}}]); //# sourceMappingURL=243-legacy.617d9415.js.map
Copyright ©2k19 -
Hexid
|
Tex7ure