/
home
/
henzagold
/
adminold
/
export
/
js
/
File Upload :
llllll
Current File: //home/henzagold/adminold/export/js/chunk-2d0a3ae8.7cd2edde.js
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0a3ae8"],{"02e5":function(t,e,r){"use strict";r.r(e);r("a481");var a=function(){var t=this,e=t._self._c;return e("a-form",{attrs:{form:t.autopromotion}},[e("ASpin",{attrs:{spinning:t.loading}},[e("vx-card",{staticClass:"mb-base",attrs:{title:"تخفیف اتوماتیک یکبار مصرف ویژه مشتریان جدید"}},[e("div",{staticClass:"vx-row"},[e("div",{staticClass:"vx-col w-full"},[e("div",{staticClass:"grid sm:grid-cols-1 md:grid-cols-3 gap-4"},[e("a-form-item",{attrs:{label:"وضعیت تخفیف اتوماتیک"}},[e("a-switch",{attrs:{size:"large","checked-children":" ","un-checked-children":""},model:{value:t.state,callback:function(e){t.state=e},expression:"state"}})],1),e("a-form-item",{attrs:{label:"درصد تخفیف اتوماتیک روی محصولات"}},[e("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["discount_percent",{rules:[{required:!0,message:"وارد کردن درصد تخفیف اتوماتیک الزامی است"}]}],expression:"['discount_percent',{ rules: [{ required: true, message: 'وارد کردن درصد تخفیف اتوماتیک الزامی است' }] },]"}],staticStyle:{width:"100%"},attrs:{dir:"ltr",min:0,max:100,formatter:function(t){return"".concat(t,"%")},parser:function(t){return t.replace("%","")}}})],1)],1)])])])],1),e("div",{staticClass:"vx-col w-full flex"},[e("vs-button",{staticClass:"mr-4",attrs:{"icon-pack":"feather",icon:"icon-edit"},on:{click:t.handleSubmit}},[t._v("ثبت اطلاعات\n ")])],1)],1)},n=[],o=(r("96cf"),r("1da1")),i=r("bb36"),s={name:"autopromotion",data:function(){return{state:!1,autopromotion:this.$form.createForm(this,{name:"coordinated"}),loading:!1}},methods:{handleSubmit:function(t){var e=this;t.preventDefault(),this.autopromotion.validateFields(function(){var t=Object(o["a"])(regeneratorRuntime.mark((function t(r,a){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(r){t.next=14;break}return t.prev=1,e.loading=!0,t.next=5,i["b"].put("/autopromotion",{discount_percent:a.discount_percent,is_active:e.state?1:0});case 5:e.$message.info("اطلاعات با موفقیت به ثبت رسید."),t.next=11;break;case 8:t.prev=8,t.t0=t["catch"](1),t.t0.response.data.errors.mobile?e.$message.error(t.t0.response.data.errors.mobile[0]):e.$message.error("خطا در ثبت اطلاعات.");case 11:return t.prev=11,e.loading=!1,t.finish(11);case 14:case"end":return t.stop()}}),t,null,[[1,8,11,14]])})));return function(e,r){return t.apply(this,arguments)}}())}},mounted:function(){var t=Object(o["a"])(regeneratorRuntime.mark((function t(){var e=this;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,i["b"].get("/autopromotion").then((function(t){console.log(t.data),e.state=t.data.is_active,e.autopromotion.setFieldsValue({discount_percent:t.data.discount_percent})})).catch((function(t){console.log(t)}));case 2:case"end":return t.stop()}}),t)})));function e(){return t.apply(this,arguments)}return e}()},c=s,u=r("2877"),l=Object(u["a"])(c,a,n,!1,null,"2cc1f7bb",null);e["default"]=l.exports}}]);
Copyright ©2k19 -
Hexid
|
Tex7ure