(window.webpackJsonp=window.webpackJsonp||[]).push([[323],{"3583":function(t,e,r){"use strict";r.r(e);var s=r(1054),i={"service":0,"catering":1,"retail":2,"entertain":0},o={"components":{"AferGoodsView":s.a},"data":function data(){return{"afterGoodsList":[],"businessType":this.$route.query.from,"orderNo":this.$route.query.orderNo,"orderType":this.$route.query.orderType,"talk":!!this.$route.query.talk,"selectList":[],"existList":[],"isUseStatus":!0,"isPartUseStatus":!1}},"created":function created(){var t=this.$utils.storage.global.get("afterSaleShowList"),e=JSON.parse(t||"[]");null!=e&&e.length&&(this.existList=e);var r={"service":this.serviceDetail,"catering":this.cateringDetail,"retail":this.getGoodsDetail,"entertain":this.getGoodsDetail};this.businessType&&r[this.businessType](),this.toast()},"computed":{"mode":function mode(){return i[this.businessType]||0}},"methods":{"toast":function toast(){this.$toast.loading({"duration":0,"type":"loading","message":"加载中...","forbidClick":!0})},"getUsableStatus":function getUsableStatus(t,e){this.isUseStatus=t,this.isPartUseStatus=t&&e},"serviceDetail":function serviceDetail(){var t=this;this.$api.serviceDetail({"orderNo":this.orderNo,"orderType":this.orderType}).then((function(e){if(console.log(" 我是服务业态"),0===e.code){var r=(e||{}).data;t.afterGoodsList=r.orderItemList||[]}t.$toast.clear()})).catch((function(){t.$toast.clear()}))},"cateringDetail":function cateringDetail(){var t=this,e={};e=this.$route.query.orderNoList&&this.$route.query.orderNo!==this.$route.query.orderNoList?{"tradeNo":this.$route.query.orderNoList,"orderType":this.orderType,"withUnMergerItem":!0,"pageNumber":"1","pageSize":"100"}:{"tradeNo":this.$route.query.orderNo,"orderType":this.orderType,"withUnMergerItem":!0,"pageNumber":"1","pageSize":"100"},this.$api.getUserQueryOrders(e).then((function(e){if(0===e.code){var r=(e||{}).data,s=[];0!==r.records.length&&e.data.records.forEach((function(t){t.orderItemList.forEach((function(t){if(t.repairEndTime){var e=t.repairEndTime.replace(/-/g,"/");new Date(e)>new Date&&t.number-t.finishAfterNumber!=0&&"COMPLETE"===t.state&&s.push(t)}}))})),t.afterGoodsList=s}t.$toast.clear()})).catch((function(){t.$toast.clear()})),console.log(" 我是餐饮业态")},"getGoodsDetail":function getGoodsDetail(){var t=this;this.$api.orderList({"orderNoList":this.$route.query.orderNoList?this.$route.query.orderNoList.split(","):this.$route.query.orderNo.split(","),"orderType":this.orderType}).then((function(e){if(console.log(" 我是零售业态"),0===e.code){var r=(e||{}).data,s=[];r.records.forEach((function(t){t.orderItemList.forEach((function(t){s.push(t)}))})),t.afterGoodsList=s||[]}t.$toast.clear()})).catch((function(){t.$toast.clear()}))},"getAfterSaleDetail":function getAfterSaleDetail(){var t=this;this.$api.afterSaleDetail({"afterSaleNo":this.$route.query.afterSaleNo}).then((function(e){if(console.log(" 我是售后业态"),0===e.code){var r=(e||{}).data;t.afterGoodsList=r.itemList||[]}t.$toast.clear()})).catch((function(){t.$toast.clear()}))},"getSelectData":function getSelectData(t){this.selectList=t},"confirm":function confirm(){var t=this;if(0==this.selectList.length)return this.$toast("请选择商品");this.$route.query.msgId&&this.$utils.PostMessage.sendMessage(this.$route.query.msgId,"1"),this.$utils.storage.global.set("afterSaleShowList",JSON.stringify(this.selectList)),setTimeout((function(){t.$router.go(-1)}),800)}}},a=r(3),n=Object(a.a)(o,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("gm-m-container",[r("gm-m-header",[r("gm-m-nav-header",{"attrs":{"slotsShow":["center"]},"scopedSlots":t._u([{"key":"dynamicsCenter","fn":function(){return[r("span",[t._v("选择售后商品")])]},"proxy":!0}])})],1),t._v(" "),r("gm-m-main",{"attrs":{"bgColor":".gmui-bg-c6"}},[r("AferGoodsView",{"attrs":{"mode":t.mode,"isShowMore":!1,"isTalk":t.talk,"list":t.afterGoodsList,"existList":t.existList},"on":{"onChange":t.getSelectData,"onUsable":t.getUsableStatus}})],1),t._v(" "),r("gm-m-footer",[r("gm-m-button",{"staticStyle":{"width":"100%"},"attrs":{"type":"primary","round":""},"on":{"click":function(e){return e.stopPropagation(),t.confirm.apply(null,arguments)}}},[t._v("确定")])],1)],1)],1)}),[],!1,null,null,null);e.default=n.exports}}]);