/
home
/
henzagold
/
admin_report
/
js
/
File Upload :
llllll
Current File: /home/henzagold/admin_report/js/chunk-0e70b67c.9fd52dd4.js
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0e70b67c"],{"02c0":function(t,e,s){},5900:function(t,e,s){"use strict";s("02c0")},a674:function(t,e,s){"use strict";s.r(e);var a=function(){var t=this,e=t._self._c;return e("a-spin",{attrs:{tip:"در حال پردازش اطلاعات",spinning:t.loading}},[e("div",[e("div",{staticClass:"grid grid-cols-1 lg:grid-cols-5 lg:gap-2"},[e("vx-card",{staticClass:"lg:col-span-1",attrs:{title:"واردکردن محصولات"}},[e("div",{staticClass:"w-full"},[e("XUploadExcel",{attrs:{disabled:t.sendingData,uploadType:t.uploadType,url:"https://kidslandtoys.com/kernel/admin/product/import"},on:{output:t.setRows}})],1),e("div",{staticClass:"mt-3"},[e("div",[t._v("نوع بارگذاری:")]),e("a-radio-group",{staticClass:"flex mt-2",model:{value:t.uploadType,callback:function(e){t.uploadType=e},expression:"uploadType"}},[e("a-radio",{staticClass:"w-1/2",attrs:{value:1}},[t._v("\n عادی\n ")]),e("a-radio",{staticClass:"w-1/2",attrs:{value:2}},[t._v("\n پیشرفته\n ")])],1)],1)]),2===t.uploadType?e("transition",{attrs:{mode:"out-in",name:"fade"}},[0!==t.firstTableCols.length?e("vx-card",{staticClass:"lg:col-span-4 mt-2 lg:mt-0",attrs:{title:"تنظیم دسته ها"}},[e("div",{staticClass:"w-full grid grid-cols-1 lg:grid-cols-3 gap-2"},t._l(t.mainTableCols,(function(s,a){return e("div",{staticClass:"rectangle-css flex-row-reverse"},[e("a-select",{key:t.selectClear,staticClass:"text-sm xl:text-base",staticStyle:{width:"125px"},attrs:{placeholder:"انتخاب ستون","option-filter-prop":"children","filter-option":t.filterOption},on:{focus:t.handleFocus,change:function(e){return t.handleChange(e,s.key)}}},t._l(t.freeCols,(function(s,a){return e("a-select-option",{attrs:{value:s.dataIndex}},[t._v("\n "+t._s(s.title)+"\n ")])})),1),e("feather-icon",{staticClass:"ml-2 mr-2",attrs:{icon:"ChevronsRightIcon"}}),e("div",{staticClass:"text-sm xl:text-base",staticStyle:{"margin-inline-end":"auto","align-self":"center"}},[t._v(" "+t._s(s.title)+"\n ")])],1)})),0),e("div",{staticClass:"mt-5"},[e("a-button",{attrs:{disabled:t.sendingData||!t.convertButtonEnabled||t.convertButtonState(),h:"",type:"primary"},on:{click:function(e){return t.convertTable()}}},[e("div",{staticClass:"text-lg"},[t._v("تبدیل")])]),e("a-button",{staticClass:"ml-2",attrs:{disabled:t.sendingData,type:"danger",icon:"undo"},on:{click:function(e){return t.refreshSelect()}}})],1)]):e("vx-card",{staticClass:"col-span-4 mt-2 lg:mt-0",attrs:{title:"تنظیم دسته ها"}},[e("div",{staticClass:"text-center"},[t._v("لطفا فایل اکسل خود را بارگذاری کنید")])])],1):t._e()],1),e("transition-group",{attrs:{mode:"out-in",name:"fade"}},[t.sendingData?e("vx-card",{key:t.sendingData,staticClass:"mt-2"},[e("div",{staticClass:"flex center items-center"},[e("a-spin"),e("div",{staticClass:"ml-5"},[t._v("\n در حال ذخیره اطلاعات\n ")])],1)]):t._e(),0!==t.firstTableCols.length?e("vx-card",{key:t.firstTableCols.length,staticClass:"mt-2",attrs:{title:"جدول اولیه"}},[e("a-table",{staticClass:"flex-row-reverse",attrs:{columns:t.firstTableCols,"data-source":t.rows},scopedSlots:t._u([{key:"name",fn:function(s){return e("a",{},[t._v(t._s(s))])}}],null,!1,64187105)})],1):t._e(),0!==t.firstTableCols.length?e("vx-card",{key:t.firstTableCols.length,staticClass:"mt-2",attrs:{title:"جدول نهایی"}},[e("a-table",{staticClass:"flex-row-reverse",attrs:{columns:t.mainTableCols,"data-source":t.mainTableChild},scopedSlots:t._u([{key:"name",fn:function(s){return e("a",{},[t._v(t._s(s))])}}],null,!1,64187105)}),e("div",{staticClass:"mt-5"},[e("a-button",{attrs:{id:"last-table",disabled:t.sendingData||0===t.mainTableChild.length,type:"primary"},on:{click:function(e){return t.sendData()}}},[e("div",{staticClass:"text-lg"},[t._v("ثبت نهایی")])])],1)],1):t._e()],1)],1)])},i=[],n=(s("96cf"),s("1da1")),l=(s("ac6a"),s("2e53")),r=s("bb36"),o=[{title:"كد كالا",dataIndex:"product_code",key:"product_code"},{title:"نام كالا",dataIndex:"title",key:"title"},{title:"واحد",dataIndex:"type",key:"type"},{title:"موجودي",dataIndex:"count",key:"count"},{title:"قیمت عمده",dataIndex:"omde_price",key:"omde_price"},{title:"قیمت تک",dataIndex:"one_price",key:"one_price"}],c={name:"UploadProduct",data:function(){return{loading:!1,rows:void 0,firstTableCols:[],freeCols:[],firstTableChild:void 0,selectedQuery:[],firstKeys:[],selectClear:!1,mainTableCols:o,uploadType:2,mainTableChild:[],convertButtonEnabled:!0,sendingData:!1}},created:function(){var t=this;this.mainTableCols.forEach((function(e){t.selectedQuery[e.key]=void 0,t.firstKeys.push(e)}))},watch:{uploadType:function(t){1===t&&(this.firstTableCols=[],this.freeCols=[],this.firstTableChild=void 0,this.selectedQuery=[],this.firstKeys=[],this.selectClear=!this.selectedQuery,this.mainTableChild=[])}},methods:{sendData:function(){var t=Object(n["a"])(regeneratorRuntime.mark((function t(){var e,s=this;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.loading=!0,window.smoothscroll(),t.prev=2,t.next=5,r["b"].post("/admin/product/test",this.mainTableChild);case 5:e=t.sent,e.data,this.sendingData=!0,setTimeout((function(){s.sendingData=!1,s.refreshSelect()}),4e4),this.loading=!1,t.next=16;break;case 12:t.prev=12,t.t0=t["catch"](2),this.loading=!1,console.log(t.t0);case 16:case"end":return t.stop()}}),t,this,[[2,12]])})));function e(){return t.apply(this,arguments)}return e}(),refreshSelect:function(){this.freeCols=this.firstTableCols.slice(),this.clearSth()},clearSth:function(){var t=this;this.mainTableChild=[],this.selectClear=!this.selectClear,this.convertButtonEnabled=!0,this.firstKeys.forEach((function(e){t.selectedQuery[e.key]=void 0}))},setRows:function(){var t=Object(n["a"])(regeneratorRuntime.mark((function t(e){var s=this;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.loading=!0,this.rows=void 0,this.firstTableCols=[],this.freeCols=[],this.clearSth(),t.next=7,e[0].forEach((function(t,e){return s.firstTableCols.push({title:t,dataIndex:e})}));case 7:this.freeCols=this.firstTableCols.slice(),this.rows=e.slice(1),this.loading=!1;case 10:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}(),convertButtonState:function(){var t=this,e=!1;return this.firstKeys.forEach((function(s){void 0===t.selectedQuery[s.key]&&(e=!0)})),e},convertTable:function(){var t=this;this.convertButtonEnabled=!1,window.scrollTo({top:document.body.scrollHeight,left:0,behavior:"smooth"}),this.rows.forEach((function(e,s){var a={};t.firstKeys.forEach((function(s){a[s.key]=e[t.selectedQuery[s.key]]})),t.mainTableChild.push(a)}))},handleChange:function(t,e){var s=this;this.selectedQuery[e]=t,this.freeCols=this.firstTableCols.slice(),this.firstKeys.forEach((function(t){s.freeCols.forEach((function(e,a){e.dataIndex===s.selectedQuery[t.key]&&s.freeCols.splice(a,1)}))}))},handleFocus:function(t){console.log("focus")},filterOption:function(t,e){return e.componentOptions.children[0].text.toLowerCase().indexOf(t.toLowerCase())>=0}},components:{XUploadExcel:l["a"]}},d=c,u=(s("5900"),s("2877")),h=Object(u["a"])(d,a,i,!1,null,null,null);e["default"]=h.exports}}]); //# sourceMappingURL=chunk-0e70b67c.9fd52dd4.js.map
Copyright ©2k19 -
Hexid
|
Tex7ure