1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6ef2f133"],{1567:function(e,t,o){},4361:function(e,t,o){"use strict";o.r(t);var n=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("el-dialog",{attrs:{title:"修改订单商品",visible:e.show,width:"80%","show-close":!1,"close-on-click-modal":!1,"destroy-on-close":!0},on:{"update:visible":function(t){e.show=t}}},[o("el-form",{staticClass:"form",attrs:{"label-width":"80px"}},[o("el-form-item",{attrs:{label:"选择商品:"}},[o("el-select",{attrs:{placeholder:"选择商品"},model:{value:e.selelctedGoodId,callback:function(t){e.selelctedGoodId=t},expression:"selelctedGoodId"}},e._l(e.goodList,(function(e){return o("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1),e._v(" "),o("el-input",{staticStyle:{width:"200px"},attrs:{type:"number",placeholder:"输入数量",min:"1"},model:{value:e.selelctedGoodNum,callback:function(t){e.selelctedGoodNum=t},expression:"selelctedGoodNum"}}),e._v(" "),o("el-button",{attrs:{type:"primary"},on:{click:e.handleAddCar}},[e._v("添加到购物车")])],1)],1),e._v(" "),o("el-table",{staticClass:"table",attrs:{border:"",stripe:"","header-cell-style":{background:"#eef1f9"},data:e.detail?e.detail.goods_detail:[]}},[o("el-table-column",{attrs:{type:"index",width:"60",align:"center"}}),e._v(" "),o("el-table-column",{attrs:{prop:"",label:"主图",align:"center"},scopedSlots:e._u([{key:"default",fn:function(e){var t=e.row;return[o("el-image",{staticStyle:{width:"24px",height:"24px"},attrs:{src:t.main_img,fit:"fill",align:"center"}})]}}])}),e._v(" "),o("el-table-column",{attrs:{prop:"name",label:"商品名称",align:"center"}}),e._v(" "),o("el-table-column",{attrs:{prop:"size",label:"商品规格",align:"center"}}),e._v(" "),o("el-table-column",{attrs:{prop:"num",label:"数量",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[o("el-input-number",{attrs:{min:1,size:"small"},model:{value:n.num,callback:function(t){e.$set(n,"num",t)},expression:"row.num"}})]}}])}),e._v(" "),o("el-table-column",{attrs:{prop:"unit",label:"单位",align:"center"}}),e._v(" "),o("el-table-column",{attrs:{prop:"",label:"单价"},scopedSlots:e._u([{key:"default",fn:function(t){var o=t.row;return[e._v("\n "+e._s(o.price)+"\n ")]}}])}),e._v(" "),o("el-table-column",{attrs:{prop:"money",label:"金额小计",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var o=t.row;return[e._v("\n "+e._s(e._f("toThousandFilter")(o.price*o.num))+"\n ")]}}])}),e._v(" "),o("el-table-column",{attrs:{prop:"money",label:"删除",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.$index;return[o("i",{staticClass:"el-icon-delete",staticStyle:{"font-size":"24px"},on:{click:function(t){return e.detail.goods_detail.splice(n,1)}}})]}}])})],1),e._v(" "),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e.detail?o("span",{staticStyle:{"margin-right":"24px"}},[e._v("\n 应付金额: "),o("span",{staticStyle:{color:"red"}},[e._v(e._s(e._f("toThousandFilter")(e.detail.goods_detail.reduce((function(e,t){return t.price*t.num+e}),0))))])]):e._e(),e._v(" "),o("el-button",{on:{click:function(t){return e.$emit("close")}}},[e._v("取 消")]),e._v(" "),o("el-button",{attrs:{type:"primary"},on:{click:e.submit}},[e._v("确 定")])],1)],1)},r=[],i=(o("6762"),o("2fdb"),o("c5f6"),o("7514"),o("5530")),l=(o("20d6"),o("ac6a"),o("64f9")),a={props:{show:{type:Boolean,default:!1},data:{type:Object,default:function(){}}},data:function(){return{temp:null,detail:null,goodList:[],selelctedGoodId:"",selelctedGoodNum:"",isShow:!1,activitys:[]}},created:function(){this.temp=JSON.parse(JSON.stringify(this.data)),this.detail=JSON.parse(JSON.stringify(this.data)),this.detail.goods_detail.forEach((function(e){e.price||(e.price=e.money/e.num),e.money=e.price*e.num})),this.getOrderGoods()},methods:{getOrderGoods:function(){var e=this,t=this.$loading();Object(l["g"])({mobile:this.detail.get_user.mobile}).then((function(o){t.close(),200===o.code?e.goodList=o.data.good.map((function(e){return e.name+=" - ".concat(e.size),e.price=e.money,e.num=0,e.money=0,e})):e.$message.error(o.message||"获取工作室商品失败")})).catch((function(){t.close(),e.$message.error("获取工作室商品失败")}))},handleAddCar:function(){var e=this;if(!this.selelctedGoodId||!this.selelctedGoodNum||"0"===this.selelctedGoodNum)return this.$message.warning("请选择并正确填写商品数量"),!1;var t=this.detail.goods_detail.findIndex((function(t){return t.id===e.selelctedGoodId}));-1===t?this.detail.goods_detail.push(Object(i["a"])(Object(i["a"])({},this.goodList.find((function(t){return t.id===e.selelctedGoodId}))),{},{num:this.selelctedGoodNum})):this.detail.goods_detail[t].num=Number(this.detail.goods_detail[t].num)+Number(this.selelctedGoodNum),this.selelctedGoodId="",this.selelctedGoodNum=""},submit:function(){var e=this,t={order_id:this.detail.id,size_id:this.detail.goods_detail.map((function(e){return e.id})),num:this.detail.goods_detail.map((function(e){return e.num})),total:this.detail.goods_detail.reduce((function(e,t){return e+Number(t.num)}),0),money:this.detail.goods_detail.reduce((function(e,t){return e+Number(t.num)*Number(t.price)}),0),type:this.detail.goods_detail.length,del_id:this.temp.goods_detail.map((function(e){return e.id})).filter((function(t){return!e.detail.goods_detail.map((function(e){return e.id})).includes(t)})),activity_id:""};Object(l["k"])(t).then((function(t){e.loadingFull=!1,200===t.code?(e.$emit("close"),e.$message.success("修改成功"),e.$emit("refresh")):e.$message.error(t.message||"修改失败")})).catch((function(t){e.loadingFull=!1,e.$message.error(t.message||"修改失败")}))}}},d=a,s=(o("af6b"),o("2877")),u=Object(s["a"])(d,n,r,!1,null,"1ebfeea6",null);t["default"]=u.exports},"64f9":function(e,t,o){"use strict";o.d(t,"i",(function(){return r})),o.d(t,"j",(function(){return i})),o.d(t,"a",(function(){return l})),o.d(t,"b",(function(){return a})),o.d(t,"e",(function(){return d})),o.d(t,"c",(function(){return s})),o.d(t,"k",(function(){return u})),o.d(t,"g",(function(){return c})),o.d(t,"f",(function(){return m})),o.d(t,"h",(function(){return f})),o.d(t,"d",(function(){return p}));var n=o("b775");function r(e){return Object(n["a"])({url:"/studio/studio_order",method:"Get",params:e})}function i(e){return Object(n["a"])({url:"/studio/order_detail",method:"Get",params:e})}function l(e){return Object(n["a"])({url:"/studio/show_address",method:"Get",params:e})}function a(e){return Object(n["a"])({url:"/studio/order_address",method:"Get",params:e})}function d(e){return Object(n["a"])({url:"/studio/destory_order",method:"Get",params:e})}function s(e){return Object(n["a"])({url:"/studio/many_audit_order",method:"post",data:e})}function u(e){return Object(n["a"])({url:"/studio/order_update",method:"post",data:e})}function c(e){return Object(n["a"])({url:"/studioGood/getgoodsinfo",method:"get",params:e})}function m(e){return Object(n["a"])({url:"/studio/orderBreakUpCourier",method:"get",params:e})}function f(e){return Object(n["a"])({url:"/studio/send_order",method:"post",data:e})}function p(e){return Object(n["a"])({url:"/studio/audit_order",method:"post",data:e})}},af6b:function(e,t,o){"use strict";o("1567")}}]);
|