/
home
/
liman
/
panel
/
js
/
File Upload :
llllll
Current File: /home/liman/panel/js/6774.c66af11d.js
(self["webpackChunkliman"]=self["webpackChunkliman"]||[]).push([[6774],{37533:function(t,e,i){"use strict";i.r(e),i.d(e,{default:function(){return m}});var s=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("sedmed-form",{attrs:{items:t.fromItems,"initial-value":t.initialValue,"select-options":t.formOptions,okText:(t.id?"ویرایش":"ثبت")+" کارشناس فروش "},on:{create:t.create,update:t.update,change_province:t.getCities}})},a=[],o=i(44231),r=i(24688),l=i(42281),n=i(11179),c={name:"addEditPorter",components:{SedmedForm:l.Z},data(){return{fromItems:Object.assign(Object.assign({},r),{aria:{label:"منطقه",decorator:[{defaultKey:"required"}]},credit:{label:"اعتبار",custom:{mode:"number",min:0}},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"}})}},mixins:[o.Z,n.Z],computed:{formOptions(){return{province:this.province,city:this.cities}}},async created(){await this.getProvince()}},u=c,d=i(38e3),h=(0,d.Z)(u,s,a,!1,null,"61a0cdda",null),m=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)}}}}},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 s={"./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 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=6774.c66af11d.js.map
Copyright ©2k19 -
Hexid
|
Tex7ure