/
home
/
liman
/
panel
/
js
/
File Upload :
llllll
Current File: /home/liman/panel/js/243.e24c7306.js
(self["webpackChunkliman"]=self["webpackChunkliman"]||[]).push([[243],{91394:function(t,e,i){"use strict";i.r(e),i.d(e,{default:function(){return p}});var s=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("h4",[t._v(" اطلاعات پایه ")]),i("a-steps",{attrs:{type:"navigation",size:"small"},model:{value:t.step,callback:function(e){t.step=e},expression:"step"}},t._l(t.formsName,(function(t){return i("a-step",{key:t,attrs:{title:t}})})),1),t._l(t.form,(function(e,s){return i("sedmed-form",{directives:[{name:"show",rawName:"v-show",value:s===t.step,expression:"index === step"}],key:s,ref:"forms",refInFor:!0,attrs:{name:t.formsName[s],hasBtn:!1,items:t.form[s],"initial-value":t.initialValue,"select-options":t.formOptions},on:{change_province:t.getCities}},[i("div",{staticClass:"flex",attrs:{slot:"after"},slot:"after"},[0!==s?i("a-button",{staticClass:"mr-2",on:{click:function(e){t.step--}}},[t._v("مرحله قبل")]):t._e(),4!==s?i("a-button",{attrs:{type:"primary"},on:{click:function(e){return t.validate(s,e)}}},[t._v("مرحله بعد")]):t._e(),4===s?i("a-button",{attrs:{type:"primary"},on:{click:function(e){return t.validate(-1,e)}}},[t._v("ثبت")]):t._e()],1)])}))],2)},a=[],o=i(44231),r=i(24688),l=i(45525),n=i(43431),c=i(11179),u={name:"addEditCustomer",components:{SedmedForm:l.Z},mixins:[o.Z,n.Z,c.Z],data(){return{step:0,initialValue:void 0,contactFromItems:Object.assign(Object.assign({},r),{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(){return{currency:this.currency,metal:this.metal,province:this.province,city:this.cities,porters:this.porters}},form(){return[this.contactFromItems,this.shopFromItems,this.accountFromItems,this.docFromItems,this.additionalFromItems]}},async created(){await Promise.all([this.getNegotiableByType("currency"),this.getNegotiableByType("metal"),this.getProvince(),this.getPorters()])},methods:{async getPorters(){try{this.$store.commit("setLoading",!0);const{data:{rows:t}}=await this.$axios.post("/porter/table",{limit:2e3});this.porters=t[0]}catch(t){console.log(t)}finally{this.$store.commit("setLoading",!1)}},handelSubmit(t){const e=Object.assign(t,{full_name:`${t.first_name} ${t.last_name}`});return"object"==typeof e.city&&e.city.id&&e.city.parent&&e.city.parent.id&&(e.province=e.city.parent.id,e.city=e.city.id),"object"==typeof e.city&&(e.city=null),this.id?this.update(e):this.create(e)},validate(t,e){if(-1!==t){const i=this.$refs.forms[t].handleSubmit(e);if(i)return this.step++}else{let t=!0,i={};for(let s=0;s<5;s++){const a=this.$refs.forms[s].handleSubmit(e);if(!a){t=!1;break}i=Object.assign(i,a)}t&&this.handelSubmit(i)}}}},m=u,d=i(38e3),h=(0,d.Z)(m,s,a,!1,null,"6a05f9da",null),p=h.exports},44231:function(t,e){"use strict";e["Z"]={data(){return{province:[],cities:[]}},methods:{async getProvince(){try{this.$store.commit("setLoading",!0);const{data:{rows:t}}=await this.$caxios.post("/utility/province/table",{limit:2e3,filters:[{field:"level",value:1}]});this.province=t[0]}catch(t){console.log(t)}finally{this.$store.commit("setLoading",!1)}},async getCities(t){try{if(t){this.$store.commit("setLoading",!0);const{data:{rows:e}}=await this.$caxios.post("/utility/province/table",{filters:[{field:"parent",value:t}],limit:2e3});this.cities=e[0]}}catch(e){console.log(e)}finally{this.$store.commit("setLoading",!1)}}}}},43431:function(t,e){"use strict";e["Z"]={data(){return{negoTypes:{currency:1,metal:2,stone:3,negotiable:4},negotiable:[],stone:[],metal:[],currency:[]}},methods:{async getNegotiableByType(t){try{this.$store.commit("setLoading",!0);const{data:{rows:e}}=await this.$axios.post("/negotiable/table",{filters:[{field:"type",op:"like",value:this.negoTypes[t]}],limit:2e3});this[t]=e[0]}catch(e){console.log(e)}finally{this.$store.commit("setLoading",!1)}},showCurrency(t){const e=this.currency.find((e=>e.id==t));return e&&e.name?e.name:"نا معتبر"},showMetal(t){const e=this.metal.find((e=>e.id==t));return e&&e.name?e.name:"نا معتبر"},showStone(t){const e=this.stone.find((e=>e.id==t));return e&&e.name?e.name:"نا معتبر"},showNegotiable(t){const e=this.negotiable.find((e=>e.id==t));return e&&e.name?e.name:"نا معتبر"}}}},11179:function(t,e,i){"use strict";e["Z"]={data(){return{initialValue:void 0,model:void 0,view:!1}},computed:{id(){return this.$route.params.id},restfull(){return this.$route.meta.restfull},restfullPath(){return this.$route.meta.restfullPath||this.$route.meta.restfull},customRoute(){return this.$route.meta.isCustomRoute}},async created(){const t=await i(18847)(`./${this.restfull}Tbl`);this.model=t.default,this.id&&!this.customRoute&&await this.getData(),this.initialValue&&this.initialValue.city&&this.initialValue.province&&await this.getCities(this.initialValue.province)},methods:{async getData(t){try{this.$store.commit("setLoading",!0);const{data:e}=await this.$axios.get(`/${this.restfullPath}/${t||this.id}/`);e&&e.city&&e.city.id&&e.city.parent&&e.city.parent.id?this.initialValue=Object.assign(e,{province:e.city.parent.id,city:e.city.id}):this.initialValue=e}catch(e){console.log(e)}finally{this.$store.commit("setLoading",!1)}},async update(t){try{this.$store.commit("setLoading",!0),await this.$axios.patch(`/${this.restfullPath}/${this.id}/`,t),this.$ntSuccess("اطلاعات با موفقیت آپدیت شد"),await this.$router.push({name:`${this.restfull}_list`})}catch(e){console.log(e)}finally{this.$store.commit("setLoading",!1)}},async create(t){try{this.$store.commit("setLoading",!0),await this.$axios.post(`/${this.restfullPath}/`,t),this.$ntSuccess("اطلاعات با موفقیت ثبت شد"),await this.$router.push({name:`${this.restfull}_list`})}catch(e){console.log(e)}finally{this.$store.commit("setLoading",!1)}},toEdit(t){window.open(`/${this.restfull}/edit/${t}`,"_blank").focus()},setInitialValue(t){this.initialValue=t,this.view=!0},async toView(t){await this.getData(t),this.view=!0},async deleteItem(t){try{this.$store.commit("setLoading",!0),await this.$axios.delete(`/${this.restfullPath}/${t}/`),this.$ntSuccess("آیتم با موفقیت حذف شد"),await this.$refs[`${this.restfull}Tbl`].fetch()}catch(e){console.log(e)}finally{this.$store.commit("setLoading",!1)}}}}},18847:function(t,e,i){var s={"./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 a(t){if(!i.o(s,t))return Promise.resolve().then((function(){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}));var e=s[t],a=e[0];return i.e(e[1]).then((function(){return i(a)}))}a.keys=function(){return Object.keys(s)},a.id=18847,t.exports=a},24688:function(t){"use strict";t.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.e24c7306.js.map
Copyright ©2k19 -
Hexid
|
Tex7ure