/
proc
/
thread-self
/
root
/
home
/
henzagold
/
admin
/
export
/
js
/
File Upload :
llllll
Current File: //proc/thread-self/root/home/henzagold/admin/export/js/chunk-10eae738.43c205a4.js
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-10eae738"],{"1d9d":function(e,t,r){"use strict";r("7bab")},"7bab":function(e,t,r){},"98c0":function(e,t,r){"use strict";var o=function(){var e=this,t=e._self._c;return t("div",[t("ATooltip",{attrs:{title:e.title}},[e.popTitle?t("APopconfirm",{attrs:{"ok-text":"بله","cancel-text":"خیر",title:e.popTitle},on:{confirm:e.onClick}},[t("feather-icon",{staticClass:"cursor-pointer",attrs:{icon:e.icon,"svg-classes":e.iconClass}})],1):t("div",[t("feather-icon",{staticClass:"cursor-pointer",attrs:{icon:e.icon,"svg-classes":e.iconClass},on:{click:e.onClick}})],1)],1)],1)},s=[],n={name:"TooltipBtn",props:{title:{},popTitle:{},icon:{},iconClass:{default:"w-5 h-5"}},methods:{onClick:function(){this.$emit("click")}}},i=n,a=r("2877"),c=Object(a["a"])(i,o,s,!1,null,"00dfccd3",null);t["a"]=c.exports},bfb6:function(e,t,r){"use strict";r.r(t);r("7f7f");var o=function(){var e=this,t=e._self._c;return t("div",{attrs:{id:"page-user-list"}},[t("vx-card",{ref:"filterCard",staticClass:"vx-card",attrs:{removeCardAction:!1,title:"سفارش های ساختنی"}},[t("div",[t("XTable",{ref:"tbl",attrs:{model:e.model},scopedSlots:e._u([{key:"city",fn:function(r){var o=r.text;return t("div",{},[t("div",o?[e._v(e._s(e.getCity(o)))]:[e._v("-")])])}},{key:"opt",fn:function(r){r.text;var o=r.record;return t("div",{},[t("div",{staticClass:"flex"},[e.$hasPermission("order.makeOrder.view")?t("TooltipBtn",{staticClass:"mr-3",attrs:{"icon-class":"w-5 h-5 text-primary",icon:"ListIcon",title:"مشاهده سفارش"},on:{click:function(t){return e.viewOrder(o)}}}):e._e(),e.$hasPermission("order.makeOrder.remove")?t("TooltipBtn",{staticClass:"mr-3",attrs:{"icon-class":"w-5 h-5 text-danger",icon:"TrashIcon",title:"حذف","pop-title":"آیا مطمئن به حدف رکورد مورد نظر هستید؟"},on:{click:function(t){return e.deleteOrder(o)}}}):e._e(),e.$hasPermission("order.makeOrder.get")?t("div",[t("a",{staticClass:"flex items-center text-sm",attrs:{href:e.getDownloadLinkReport(o),target:"_blank"}},[t("feather-icon",{staticClass:"text-success",attrs:{icon:"FileIcon",svgClasses:"w-5 h-5 "}})],1)]):e._e()],1)])}},{key:"items_len",fn:function(r){var o=r.text;r.record;return t("div",{},[o?t("div",[e._v("\n "+e._s(o.length)+"\n ")]):e._e()])}},{key:"sts_str",fn:function(r){r.text;var o=r.record;return e.$hasPermission("order.makeOrder.state")?t("div",{},[t("a",{attrs:{href:""},on:{click:function(t){return t.preventDefault(),e.showSts(o)}}},[e._v(e._s(o.sts_str))])]):e._e()}},{key:"confirmed_str",fn:function(r){r.text;var o=r.record;return t("div",{},[e._v("\n "+e._s(o.confirmed_str)+"\n ")])}}],null,!0)}),e.$hasPermission("order.makeOrder.state")?t("AModal",{attrs:{title:"وضعیت سفارش"},model:{value:e.visibleSts,callback:function(t){e.visibleSts=t},expression:"visibleSts"}},[e.tempRow?t("ATimeline",e._l(e.tempRow.activity,(function(r,o){return t("ATimelineItem",{key:o,attrs:{color:e.getColorSts(r)}},[t("div",{staticClass:"flex flex-col"},[t("div",[e._v("\n "+e._s(r.title)+"\n ")]),r.proceed?t("div",[t("div",{staticClass:"flex"},[t("div",{staticClass:"flex-1"},[t("ATag",[e._v(e._s(r.uaj))])],1),o>0&&e.$hasPermission("order.makeOrder.state.remove")?t("APopconfirm",{attrs:{"ok-text":"بله","cancel-text":"بی خیال"},on:{confirm:function(t){return e.removeSts(r)}}},[t("template",{slot:"title"},[t("p",[e._v("آیا مطمئن به حذف وضعیت مورد نظر هستید ؟")])]),t("AButton",{attrs:{size:"mini",type:"danger"}},[e._v("\n حذف وضعیت\n ")])],2):e._e()],1)]):e._e(),!r.proceed&&e.$hasPermission("order.makeOrder.state.submit")?t("div",{staticClass:"flex items-center"},[t("AInput",{attrs:{placeholder:"یادداشت"},model:{value:r.note,callback:function(t){e.$set(r,"note",t)},expression:"item.note"}}),t("AButton",{attrs:{type:"flat",size:"mini"},on:{click:function(t){return e.setSts(r)}}},[e._v("\n ثبت وضعیت\n ")])],1):e._e(),r.proceed?t("div",[e._v("\n "+e._s(r.note)+"\n ")]):e._e()])])})),1):e._e(),t("div",{attrs:{slot:"footer"},slot:"footer"},[t("AButton",{on:{click:function(t){e.visibleSts=!1}}},[e._v("باشه")])],1)],1):e._e(),e.$hasPermission("order.makeOrder.view")?t("AModal",{attrs:{title:"مشاهده سفارش",width:"80%"},on:{cancel:function(t){e.$refs.tbl.fetch(),e.editMode=!1}},model:{value:e.visibleList,callback:function(t){e.visibleList=t},expression:"visibleList"}},[e.tempRow?t("div",[t("ADescriptions",[t("ADescriptionsItem",{attrs:{label:"مشتری"}},[e._v("\n "+e._s(e.customerName)+"\n ")]),t("ADescriptionsItem",{attrs:{label:"تلفن همراه"}},[e._v("\n "+e._s(e.customerMobile)+"\n ")]),t("ADescriptionsItem",{attrs:{label:"تاریخ ثبت"}},[e._v("\n "+e._s(e.tempRow.time_creat_fa||"-")+"\n ")]),t("ADescriptionsItem",{attrs:{label:"وضعیت"}},[e._v("\n "+e._s(e.tempRow.sts_str_fa||"-")+"\n ")])],1),t("ACard",[t("div",{attrs:{slot:"title"},slot:"title"},[t("div",{staticClass:"flex"},[t("div",{staticClass:"flex-1"},[e._v("آیتم های سفارش")]),t("div",[e.$hasPermission("order.makeOrder.view.edit")?t("TooltipBtn",{attrs:{"icon-class":"w-5 h-5 color-success",title:"ویرایش",icon:e.getIcon},on:{click:e.editW}}):e._e()],1)])]),t("div",{staticClass:"flex gap-8"},[t("div",[e.tempRow.file&&e.tempRow.file.image?t("img",{staticStyle:{"object-fit":"scale-down"},attrs:{src:e.tempRow.file.image,width:"90px",height:"90px"}}):t("img",{staticStyle:{"object-fit":"scale-down"},attrs:{src:r("529b"),width:"90px",height:"90px"}})]),t("div",{staticClass:"flex"},[t("ADescriptions",[t("ADescriptionsItem",{attrs:{label:"رنگ محصول"}},[e._v("\n "+e._s(e.tempRow.color||"-")+"\n "),e.editMode&&e.$hasPermission("order.makeOrder.view.edit")?t("AInput",{model:{value:e.tempRow.color,callback:function(t){e.$set(e.tempRow,"color",t)},expression:"tempRow.color"}}):e._e()],1),t("ADescriptionsItem",{attrs:{label:"رنگ مینا"}},[e._v("\n "+e._s(e.tempRow.color_mina||"-")+"\n "),e.editMode&&e.$hasPermission("order.makeOrder.view.edit")?t("AInput",{model:{value:e.tempRow.color_mina,callback:function(t){e.$set(e.tempRow,"color_mina",t)},expression:"tempRow.color_mina"}}):e._e()],1),t("ADescriptionsItem",{attrs:{label:"رنگ سنگ"}},[e._v("\n "+e._s(e.tempRow.color_stone||"-")+"\n "),e.editMode&&e.$hasPermission("order.makeOrder.view.edit")?t("AInput",{model:{value:e.tempRow.color_stone,callback:function(t){e.$set(e.tempRow,"color_stone",t)},expression:"tempRow.color_stone"}}):e._e()],1),t("ADescriptionsItem",{attrs:{label:"تعداد"}},[e.editMode?e._e():t("ATag",{attrs:{color:"orange"}},[e._v(e._s(e.tempRow.sum||0))]),e.editMode&&e.$hasPermission("order.makeOrder.view.edit")?t("AInputNumber",{model:{value:e.tempRow.sum,callback:function(t){e.$set(e.tempRow,"sum",t)},expression:"tempRow.sum"}}):e._e()],1),t("ADescriptionsItem",{attrs:{label:"انتخاب کارگاه"}},[t("ASelect",{attrs:{placeholder:"لطفا یک کارگاه را انتخاب کنید"},model:{value:e.tempRow.workshop_id,callback:function(t){e.$set(e.tempRow,"workshop_id",t)},expression:"tempRow.workshop_id"}},e._l(e.option,(function(r,o){return t("ASelectOption",{key:o},[e._v("\n "+e._s(r.name)+"\n ")])})),1)],1)],1)],1)]),e.index<e.tempRow.length-1?t("ADivider"):e._e()],1)],1):t("div",[t("AEmpty",{attrs:{description:"اطلاعاتی برای نمایش وجود ندارد"}})],1),t("div",{attrs:{slot:"footer"},slot:"footer"},[t("AButton",{on:{click:e.handleSave}},[e._v("باشه")])],1)]):e._e()],1)])],1)},s=[],n=(r("7514"),r("20d6"),r("96cf"),r("1da1")),i=r("ff6e"),a=(r("6762"),r("2fdb"),r("e0d2")),c=r("07a4"),l=new a["b"]("https://henzagold.com/oapi/admin/get-custom-orders","سفارش های ساختنی");l.add(new a["a"]("customer.id","شماره").filterNumber()),l.add(new a["a"]("customer.fname","نام مشتری").filterText()),l.add(new a["a"]("customer.lname","نام خانوادگی").filterText()),l.add(new a["a"]("color","رنگ محصول").filterText()),l.add(new a["a"]("size","سایز محصول").filterText()),l.add(new a["a"]("color_mina","رنگ مینا").filterText()),l.add(new a["a"]("color_stone","رنگ سنگ").filterText()),l.add(new a["a"]("sum","تعداد").filterText()),l.add(new a["a"]("time_creat_fa","تاریخ ثبت").filterDate().noSort()),l.add(new a["a"]("time_update_fa","تاریخ ویرایش").hidden().filterDate().noSort()),l.add(new a["a"]("customer.name","ثبت کننده").renderSlot("name").noSort()),c["a"].state.users.roles&&c["a"].state.users.roles.includes("order.tamin.state")&&l.add(new a["a"]("sts_str_fa","وضعیت").renderSlot("sts").noSort()),l.add(new a["a"]("opt","عملیات").noSort().renderSlot("opt"));var d=l,u=r("98c0"),m=r("bb36"),p={components:{TooltipBtn:u["a"],XTable:i["a"]},data:function(){return{model:d,tempRow:void 0,tempItem:void 0,editMode:!1,visibleList:!1,visibleSts:!1,option:void 0}},computed:{getIcon:function(){return this.editMode?"CheckIcon":"EditIcon"},hasItems:function(){return console.log("tempRow:",this.tempRow),console.log("tempRow.items:",this.tempRow.items),this.tempRow&&this.tempRow.items&&Array.isArray(this.tempRow.items)&&this.tempRow.items.length>0},customerName:function(){return this.tempRow&&this.tempRow.customer&&this.tempRow.customer.name||"-"},customerMobile:function(){return this.tempRow&&this.tempRow.customer&&this.tempRow.customer.mobile||"-"}},methods:{getCity:function(e){var t=this.$store.state.users.cityList.filter((function(t){return t.id===e}));return t[0]&&t[0].title?t[0].title:"-"},getDownloadLinkReport:function(e){return m["a"]+"report/order?order_id=".concat(e.id)},deleteRow:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,m["b"].put("custom-order/".concat(t.id));case 3:r=this.tempRow.items.findIndex((function(e){return e.id==t.id})),r>-1&&this.tempRow.items.splice(r,1),this.$message.info("آیتم از سفارش حذف شد"),this.$refs.tbl.fetch(),e.next=13;break;case 9:e.prev=9,e.t0=e["catch"](0),console.error("Error in deleteRow:",e.t0),this.$message.error("خطا در حذف");case 13:case"end":return e.stop()}}),e,this,[[0,9]])})));function t(t){return e.apply(this,arguments)}return t}(),acceptOrder:function(){},deleteOrder:function(e){var t=this;console.log(e),m["b"].put("custom-order/".concat(e.id)).then((function(e){t.$message.info("سفارش با موفقیت حذف گردید"),t.$refs.tbl.fetch()})).catch((function(e){console.error("Error in deleteOrder:",e),t.$message.error("خطا در حذف سفارش")}))},getColorSts:function(e){return e.proceed?"green":"gray"},showSts:function(e){this.tempRow=e,this.visibleSts=!0},editW:function(e){this.editMode=!this.editMode},setSts:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,m["b"].post("get-custom-orders",t);case 3:this.visibleSts=!1,this.$message.info("ویرایش موفق آمیز"),this.$refs.tbl.fetch(),e.next=12;break;case 8:e.prev=8,e.t0=e["catch"](0),console.error("Error in setSts:",e.t0),this.$message.error("خطا در ویرایش");case 12:case"end":return e.stop()}}),e,this,[[0,8]])})));function t(t){return e.apply(this,arguments)}return t}(),removeSts:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,t.remove=!0,e.next=4,m["b"].post("get-custom-orders",t);case 4:this.visibleSts=!1,this.$message.info("ویرایش موفق آمیز"),this.$refs.tbl.fetch(),e.next=13;break;case 9:e.prev=9,e.t0=e["catch"](0),console.error("Error in removeSts:",e.t0),this.$message.error("خطا در ویرایش");case 13:case"end":return e.stop()}}),e,this,[[0,9]])})));function t(t){return e.apply(this,arguments)}return t}(),editRow:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,console.log("Editing row data:",t),e.next=4,m["b"].put("custom-order/".concat(t.id),t);case 4:r=e.sent,console.log("Edit response:",r.data),this.$message.info("ویرایش موفق آمیز"),this.$refs.tbl.fetch(),e.next=14;break;case 10:e.prev=10,e.t0=e["catch"](0),console.error("Error in editRow:",e.t0),this.$message.error("خطا در ویرایش");case 14:case"end":return e.stop()}}),e,this,[[0,10]])})));function t(t){return e.apply(this,arguments)}return t}(),viewOrder:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(t){var r,o;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,m["b"].post("get-custom-orders",{id:t.id});case 3:r=e.sent,console.log("APIResponseeeeee:",r.data),r.data&&r.data.rows?(o=r.data.rows.find((function(e){return e.id===t.id})),o?(this.tempRow=o,console.log("tempRow after setting:",this.tempRow),this.visibleList=!0):(console.error("Selected order not found in response"),this.$message.error("سفارش مورد نظر یافت نشد"))):(console.error("API response structure:",r.data),this.$message.error("اطلاعات سفارش ناقص است")),e.next=12;break;case 8:e.prev=8,e.t0=e["catch"](0),console.error("Error fetching order data:",e.t0),this.$message.error("خطا در دریافت اطلاعات سفارش");case 12:case"end":return e.stop()}}),e,this,[[0,8]])})));function t(t){return e.apply(this,arguments)}return t}(),testApi:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,m["b"].post("get-custom-orders",{id:23});case 3:t=e.sent,console.log("APITesttt:",t.data),e.next=10;break;case 7:e.prev=7,e.t0=e["catch"](0),console.error("Error testing API:",e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));function t(){return e.apply(this,arguments)}return t}(),workshopList:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,m["b"].post("workshop/table");case 3:t=e.sent,console.log("optiooooon:",t.data),this.option=t.data.rows,e.next=11;break;case 8:e.prev=8,e.t0=e["catch"](0),console.error("Error in workshopList:",e.t0);case 11:case"end":return e.stop()}}),e,this,[[0,8]])})));function t(){return e.apply(this,arguments)}return t}(),handleSave:function(){var e=Object(n["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!this.editMode){e.next=14;break}return e.prev=1,console.log("Saving changes for tempRow:",this.tempRow),e.next=5,this.editRow(this.tempRow);case 5:this.editMode=!1,this.visibleList=!1,e.next=12;break;case 9:e.prev=9,e.t0=e["catch"](1),console.error("Error saving changes:",e.t0);case 12:e.next=16;break;case 14:this.visibleList=!1,this.$refs.tbl.fetch();case 16:case"end":return e.stop()}}),e,this,[[1,9]])})));function t(){return e.apply(this,arguments)}return t}()},created:function(){},mounted:function(){this.testApi(),this.workshopList()}},f=p,h=(r("1d9d"),r("2877")),v=Object(h["a"])(f,o,s,!1,null,null,null);t["default"]=v.exports}}]);
Copyright ©2k19 -
Hexid
|
Tex7ure