/
home
/
liman
/
panel
/
js
/
File Upload :
llllll
Current File: //home/liman/panel/js/5774-legacy.16cfc93e.js
(self["webpackChunkliman"]=self["webpackChunkliman"]||[]).push([[5774],{66140:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return d}});var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("sedmed-form",{attrs:{items:e.fromItems,"initial-value":e.initialValue,"select-options":e.formOptions,okText:(e.id?"ویرایش":"ثبت")+" محصول "},on:{create:e.create,update:e.update}})},a=[],o=r(37703),i=(r(49955),r(19701),r(31014),r(11179)),c=r(42281),s={name:"addEditProduct",components:{SedmedForm:c.Z},mixins:[i.Z],data:function(){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:function(e){return"".concat(e,"%")},parser:function(e){return e.replace("%","")}}},factory_percentage:{label:"درصد فروش (کارخانه)",itemCls:"w-full",custom:{mode:"number",formatter:function(e){return"".concat(e,"%")},parser:function(e){return e.replace("%","")}}},porter_percentage:{label:"درصد فروش (کارشناس فروش)",itemCls:"w-full",custom:{mode:"number",formatter:function(e){return"".concat(e,"%")},parser:function(e){return e.replace("%","")}}},wholesaler_percentage:{label:"درصد فروش (بنکدار)",itemCls:"w-full",custom:{mode:"number",formatter:function(e){return"".concat(e,"%")},parser:function(e){return e.replace("%","")}}},wage:{label:"اجرت ریالی",itemCls:"w-full",custom:{mode:"number",formatter:function(e){return"".concat(e," ریال ")},parser:function(e){return e.replace(" ریال ","")}}},weight:{label:"وزن",itemCls:"w-full",custom:{mode:"number",formatter:function(e){return"".concat(e," گرم ")},parser:function(e){return e.replace(" گرم ","")}}},description:{label:"توضیحات",custom:{mode:"textarea",autoSize:{minRows:3,maxRows:5}},cls:"md:col-span-3"}},category:[],brand:[]}},computed:{formOptions:function(){return{priceType:[{id:1,name:"تک فروشی"},{id:2,name:"عمده فروشی"}],category:this.category,brand:this.brand}}},methods:{getCategory: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("/category/table");case 4:r=t.sent,n=r.data.rows,e.category=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]])})))()},getBrand: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("/brand/table");case 4:r=t.sent,n=r.data.rows,e.brand=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]])})))()}},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,e.getCategory();case 2:return t.next=4,e.getBrand();case 4:case"end":return t.stop()}}),t)})))()}},u=s,l=r(38e3),m=(0,l.Z)(u,n,a,!1,null,"43f0195c",null),d=m.exports},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){t.next=13;break}return t.next=10,e.getProvince();case 10:if(!e.initialValue.province){t.next=13;break}return t.next=13,e.getCities(e.initialValue.province);case 13:case"end":return t.stop()}}),t)})))()},methods:{getData:function(){var e=arguments,t=this;return(0,n.Z)(regeneratorRuntime.mark((function r(){var n,a,o;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:a=r.sent,o=a.data,o&&o.city&&o.city.id&&o.city.parent&&o.city.parent.id?t.initialValue=Object.assign(o,{province:o.city.parent.id,city:o.city.id}):t.initialValue=o,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,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(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],a=t[0];return r.e(t[1]).then((function(){return r(a)}))}a.keys=function(){return Object.keys(n)},a.id=18847,e.exports=a}}]); //# sourceMappingURL=5774-legacy.16cfc93e.js.map
Copyright ©2k19 -
Hexid
|
Tex7ure