/
home
/
liman
/
panel
/
js
/
File Upload :
llllll
Current File: //home/liman/panel/js/5774.e96cfbcd.js
(self["webpackChunkliman"]=self["webpackChunkliman"]||[]).push([[5774],{66140:function(t,e,i){"use strict";i.r(e),i.d(e,{default:function(){return u}});var a=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}})},s=[],o=i(11179),r=i(42281),l={name:"addEditProduct",components:{SedmedForm:r.Z},mixins:[o.Z],data(){return{fromItems:{name:{label:"نام محصول",decorator:[{defaultKey:"required"}]},short_description:{label:"توضیحات کوتاه",decorator:[{defaultKey:"required"}]},price:{label:"قیمت",custom:{mode:"number",min:0},decorator:[{defaultKey:"required"}]},balance:{label:"تعداد",custom:{mode:"number",min:0},decorator:[{defaultKey:"required"}]},sale_price:{label:"قیمت فروش",custom:{mode:"number",min:0}},price_type:{label:"نوع قیمت",custom:{mode:"select",options:"priceType",options_mode:"list",options_key:{val:"id",display:"name"}}},barcode:{label:"بارکد محصول"},category:{label:"دسته بندی",custom:{mode:"select",options:"category",options_mode:"list",options_key:{val:"id",display:"name"}}},brand:{label:"برند",custom:{mode:"select",options:"brand",options_mode:"list",options_key:{val:"id",display:"name"}}},sale_percentage:{label:"درصد فروش (مغازه دار)",itemCls:"w-full",custom:{mode:"number",formatter:t=>`${t}%`,parser:t=>t.replace("%","")}},factory_percentage:{label:"درصد فروش (کارخانه)",itemCls:"w-full",custom:{mode:"number",formatter:t=>`${t}%`,parser:t=>t.replace("%","")}},porter_percentage:{label:"درصد فروش (کارشناس فروش)",itemCls:"w-full",custom:{mode:"number",formatter:t=>`${t}%`,parser:t=>t.replace("%","")}},wholesaler_percentage:{label:"درصد فروش (بنکدار)",itemCls:"w-full",custom:{mode:"number",formatter:t=>`${t}%`,parser:t=>t.replace("%","")}},wage:{label:"اجرت ریالی",itemCls:"w-full",custom:{mode:"number",formatter:t=>`${t} ریال `,parser:t=>t.replace(" ریال ","")}},weight:{label:"وزن",itemCls:"w-full",custom:{mode:"number",formatter:t=>`${t} گرم `,parser:t=>t.replace(" گرم ","")}},description:{label:"توضیحات",custom:{mode:"textarea",autoSize:{minRows:3,maxRows:5}},cls:"md:col-span-3"}},category:[],brand:[]}},computed:{formOptions(){return{priceType:[{id:1,name:"تک فروشی"},{id:2,name:"عمده فروشی"}],category:this.category,brand:this.brand}}},methods:{async getCategory(){try{this.$store.commit("setLoading",!0);const{data:{rows:t}}=await this.$axios.post("/category/table");this.category=t[0]}catch(t){console.log(t)}finally{this.$store.commit("setLoading",!1)}},async getBrand(){try{this.$store.commit("setLoading",!0);const{data:{rows:t}}=await this.$axios.post("/brand/table");this.brand=t[0]}catch(t){console.log(t)}finally{this.$store.commit("setLoading",!1)}}},async created(){await this.getCategory(),await this.getBrand()}},n=l,c=i(38e3),m=(0,c.Z)(n,a,s,!1,null,"43f0195c",null),u=m.exports},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}}]); //# sourceMappingURL=5774.e96cfbcd.js.map
Copyright ©2k19 -
Hexid
|
Tex7ure