/
home
/
liman
/
panel
/
js
/
File Upload :
llllll
Current File: //home/liman/panel/js/5098.7c5de5ec.js
(self["webpackChunkliman"]=self["webpackChunkliman"]||[]).push([[5098],{57038:function(t,e,i){"use strict";i.r(e),i.d(e,{default:function(){return p}});var a=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,a){return i("sedmed-form",{directives:[{name:"show",rawName:"v-show",value:a===t.step,expression:"index === step"}],key:a,ref:"forms",refInFor:!0,attrs:{name:t.formsName[a],hasBtn:!1,items:t.form[a],"initial-value":t.initialValue,"select-options":1===a?t.shopformOptions:4===a?t.additionalformOptions:void 0},on:{change_province:t.getCities}},[i("div",{staticClass:"flex",attrs:{slot:"after"},slot:"after"},[0!==a?i("a-button",{staticClass:"mr-2",on:{click:function(e){t.step--}}},[t._v("مرحله قبل")]):t._e(),4!==a?i("a-button",{attrs:{type:"primary"},on:{click:function(e){return t.validate(a,e)}}},[t._v("مرحله بعد")]):t._e(),4===a?i("a-button",{attrs:{type:"primary"},on:{click:function(e){return t.validate(-1,e)}}},[t._v("ثبت")]):t._e()],1)])}))],2)},s=[],o=i(44231),l=i(24688),r=i(42281),n=i(43431),c=i(11179),u={name:"addEditCustomer",components:{SedmedForm:r.Z},mixins:[o.Z,n.Z,c.Z],data(){return{step:0,initialValue:void 0,contactFromItems:Object.assign(Object.assign({},l),{phone:{label:"تلفن ثابت",decorator:[{defaultKey:"phone"}]},email:{label:"ایمیل",decorator:[{defaultKey:"mail"}]}}),shopFromItems:{shop_name:{label:"نام فروشگاه",decorator:[{defaultKey:"required"}]},aria:{label:"منطقه",decorator:[{defaultKey:"required"}]},postcode:{label:"کد پستی",decorator:[{defaultKey:"zip"}]},province:{label:"استان",decorator:[],getEvent:!0,custom:{mode:"select",options:"province",options_mode:"list",options_key:{val:"id",display:"name"},filterOption:!0,search:!0}},city:{label:"شهر",decorator:[],custom:{mode:"select",options:"city",options_mode:"list",options_key:{val:"id",display:"name"},filterOption:!0,search:!0}},address:{label:"آدرس",decorator:[],custom:{mode:"textarea",autoSize:{minRows:3,maxRows:5}},cls:"md:col-span-3"}},accountFromItems:{max_debt:{label:"سقف بدهی",custom:{mode:"number",min:0},itemCls:"w-full hide-counter"},max_period:{label:"سقف مدت",custom:{mode:"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:{mode:"select",options:"currency",options_mode:"list",options_key:{val:"id",display:"name"},filterOption:!0,search:!0}},second_currency:{label:"نوع ارز دوم",decorator:[{defaultKey:"required"}],custom:{mode:"select",options:"currency",options_mode:"list",options_key:{val:"id",display:"name"},filterOption:!0,search:!0}},metal:{label:"جنس فلز",decorator:[{defaultKey:"required"}],custom:{mode:"select",options:"metal",options_mode:"list",options_key:{val:"id",display:"name"},filterOption:!0,search:!0}}},docFromItems:{national_card_img:{label:"تصویر کارت ملی",custom:{mode:"upload",type:"single",urlKey:"national_card_img_url"},initialValue:[]},license_img:{label:"تصویر جواز",custom:{mode:"upload",type:"single",urlKey:"license_img_url"},initialValue:[]},doc_img:{label:"تصویر سند یا اجاره نامه",custom:{mode:"upload",type:"single",urlKey:"doc_img_url"},initialValue:[]}},formsName:["اطلاعات تماس","اطلاعات فروشگاه","اطلاعات حساب کاربری","مدارک","اطلاعات تکمیلی"]}},computed:{additionalformOptions(){return{currency:this.currency,metal:this.metal}},shopformOptions(){return{province:this.province,city:this.cities}},form(){return[this.contactFromItems,this.shopFromItems,this.accountFromItems,this.docFromItems,this.additionalFromItems]}},async created(){await this.getNegotiableByType("currency"),await this.getNegotiableByType("metal")},methods:{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 a=0;a<5;a++){const s=this.$refs.forms[a].handleSubmit(e);if(!s){t=!1;break}i=Object.assign(i,s)}t&&this.handelSubmit(i)}}}},m=u,d=i(38e3),h=(0,d.Z)(m,a,s,!1,null,"20a7eae4",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&&(await this.getProvince(),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 a={"./brandTbl":[54660,4660],"./categoryTbl":[22881,2881],"./constantTbl":[77041,7041],"./customerTbl":[61003,1003],"./documentTbl":[1370,1370],"./factorTbl":[13159,3159],"./negotiable-typeTbl":[47429,7429],"./negotiableTbl":[2941,2941],"./orderTbl":[56730,6730],"./porsantTbl":[45693,5693],"./porterTbl":[63685,3685],"./productTbl":[44740,4740],"./sasheTbl":[45868,5868],"./userTbl":[66896,6896]};function s(t){if(!i.o(a,t))return Promise.resolve().then((function(){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}));var e=a[t],s=e[0];return i.e(e[1]).then((function(){return i(s)}))}s.keys=function(){return Object.keys(a)},s.id=18847,t.exports=s},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=5098.7c5de5ec.js.map
Copyright ©2k19 -
Hexid
|
Tex7ure