|
- webpackJsonp([1],{"+BTi":function(e,t){},"+Rdb":function(e,t){},"/I4U":function(e,t){},"2BWB":function(e,t){},"2rGO":function(e,t){},"3GdY":function(e,t){},"5M0c":function(e,t){},"5ObC":function(e,t){},"8mNY":function(e,t){},BNJR:function(e,t){},Dte2:function(e,t){},GXEp:function(e,t){},I4nB:function(e,t){},Iun5:function(e,t){},NHnr:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});a("cwe7"),a("+BTi");var r=a("2X9z"),o=a.n(r),l=(a("/I4U"),a("yg6k")),n=a.n(l),i=(a("oq7i"),a("+TD8")),s=a.n(i),c=(a("2rGO"),a("nu7/")),u=a.n(c),d=(a("XPMo"),a("uEG6")),p=a.n(d),m=(a("8mNY"),a("YnkO")),_=a.n(m),b=(a("Q6SQ"),a("LQMI")),f=a.n(b),h=(a("jZDA"),a("91Nw")),v=a.n(h),O=(a("d7TW"),a("ajQY")),g=a.n(O),y=(a("Iun5"),a("ttjG")),w=a.n(y),j=(a("+Rdb"),a("Mezo")),x=a.n(j),k=(a("qunJ"),a("vqwl")),$=a.n(k),T=(a("5ObC"),a("4ZDJ")),S=a.n(T),L=(a("2BWB"),a("bFD8")),N=a.n(L),M=(a("isgN"),a("tLa+")),P=a.n(M),C=(a("Dte2"),a("q4le")),D=a.n(C),q=(a("isE6"),a("LR6y")),I=a.n(q),A=(a("GXEp"),a("mtrD")),E=a.n(A),H=(a("5M0c"),a("YJmC")),z=a.n(H),B=(a("I4nB"),a("STLj")),F=a.n(B),R=(a("cDSy"),a("e0Bm")),Y=a.n(R),G=(a("bRYy"),a("eBGF")),J=a.n(G),U=(a("BNJR"),a("fDPO")),W=a.n(U),Q=(a("Zki6"),a("0kY3")),X=a.n(Q),V=(a("X+ky"),a("HJMx")),Z=a.n(V),K=a("7+uW"),ee=a("woOf"),te=a.n(ee),ae=a("Gu7T"),re=a.n(ae),oe=a("mvHQ"),le=a.n(oe),ne=a("//Fk"),ie=a.n(ne),se=a("BO1k"),ce=a.n(se),ue=a("mtWM"),de=a.n(ue),pe={name:"hotel",props:{supplier_idList:Array,userOpt:Array,type:String,saleCount:Number,dataObj:Object,hotelListOpt:Array},data:function(){return{dataObjTemp:this.$lo.cloneDeep(this.dataObj),init:!0,opened:"1",roomListOpt:[],date:[],roomPlan:[],day:[],rules:{hotel_id:[{required:!0,message:"请输入",trigger:"change"}],room_id:[{required:!0,message:"请输入",trigger:"change"}],plan_id:[{required:!0,message:"请输入",trigger:"change"}],customer_name:[{required:!0,message:"请输入",trigger:"blur"}],confirm_status:[{required:!0,message:"请输入",trigger:"blur"}],count:[{required:!0,message:"请输入",trigger:"change"}],supplier_id:[{required:!0,message:"请输入",trigger:"change"}],purchasePriceList:[{type:"array",required:!0,message:"请选择",trigger:"change"}]}}},computed:{disable:function(){return"view"==this.dataObjTemp.editType}},watch:{dataObj:function(e){console.log("change"),this.dataObjTemp=this.$lo.cloneDeep(this.dataObj)},date:function(e){if(console.log(e),e&&e.length>0){this.$set(this.dataObj,"check_in_date",e[0]),this.$set(this.dataObj,"check_out_date",e[1]);var t=new Date(e[0]),a=new Date(e[1]),r=this.getAllDateCN(t,a),o=[],l=!0,n=!1,i=void 0;try{for(var s,c=ce()(r);!(l=(s=c.next()).done);l=!0){var u=s.value;o.push({run_date:u,price:"",cost:"",count:"",customer_comments:"",supplier_id:""})}}catch(e){n=!0,i=e}finally{try{!l&&c.return&&c.return()}finally{if(n)throw i}}this.dataObj.purchasePriceList=o,this.$set(this.dataObj,"purchasePriceList",o)}}},methods:{changeNum:function(e){var t=this;this.dataObj.purchasePriceList.forEach(function(a){t.$set(a,"count",e)}),this.dataObj.count=e},changesupplier_id:function(e){var t=this;this.dataObj.purchasePriceList.forEach(function(a){t.$set(a,"supplier_id",e)}),this.dataObj.supplier_id=e},changeNote:function(e){var t=this;this.dataObj.purchasePriceList.forEach(function(a){t.$set(a,"customer_comments",e)}),this.dataObj.customer_comments=e},arraySpanMethod:function(e){e.row,e.column,e.rowIndex;var t=e.columnIndex;return 3===t?[this.dataObj.purchasePriceList.length,1]:4===t?[this.dataObj.purchasePriceList.length,1]:5===t?[this.dataObj.purchasePriceList.length,1]:[1,1]},getAllDateCN:function(e,t){for(var a=[],r=0;t.getTime()-e.getTime()>0;){var o=e.getFullYear(),l=e.getMonth()+1,n=e.getDate();a[r]=o+"-"+l+"-"+n,e.setDate(e.getDate()+1),r+=1}return a},getSummaries:function(e){var t=this,a=e.columns,r=e.data,o=[];return a.forEach(function(e,l){if(0!==l)if(3!==l){if(5!==l)if(4!==l){var n=r.map(function(t){return Number(t[e.property])*Number(t[a[3].property])});n.every(function(e){return isNaN(e)})?o[l]="N/A":(o[l]=n.reduce(function(e,t){var a=Number(t);return isNaN(a)?e:e+t},0),1==l&&(t.dataObj.total_price=o[l],t.$set(t.dataObj,"total_price",o[l])),2==l&&(t.dataObj.total_cost=o[l],t.$set(t.dataObj,"total_cost",o[l])),4==l&&(t.dataObj.profit=o[l],t.$set(t.dataObj,"profit",o[l])),o[l]+=" 元")}else{var i=r.map(function(e){return(Number(e[a[1].property])*t.saleCount-Number(e[a[2].property]))*Number(e[a[3].property])});i.every(function(e){return isNaN(e)})?o[l]="N/A":(o[l]=i.reduce(function(e,t){var a=Number(t);return isNaN(a)?e:e+t},0),o[l]+=" 元")}}else o[l]="利润";else o[l]="总价"}),o},selectChange:function(e){var t=this;return console.log(e),this.roomListOpt=[],new ie.a(function(a){de.a.get("/hotel.php/cf_room_info/getRoomList?hotelId="+e).then(function(e){console.log(e),t.roomListOpt=e.data.list,t.init||(t.dataObj.room_id="",t.$set(t.dataObj,"room_id","")),a()}).catch(function(e){console.log(e)})})},roomselectChange:function(e){var t=this,a=this.roomListOpt.find(function(t){return t.id==e});return console.log(a),this.dataObjTemp.room_memo=a.room_memo,this.roomPlan=[],new ie.a(function(a){de.a.get("/hotel.php/cf_room_plan/getList?room_id="+e).then(function(e){console.log(e),t.roomPlan=e.data.list,t.init||(t.dataObj.plan_id="",t.$set(t.dataObj,"plan_id","")),a()}).catch(function(e){console.log(e)})})},priceselectChange:function(e){console.log(this.roomPlan);var t=this.$lo.cloneDeep(this.roomPlan.find(function(t){return t.id==e}));this.dataObjTemp.plan_memo=t.plan_memo,this.dataObj.purchase_user_id=t.purchase_user_id,this.$set(this.dataObj,"purchase_user_id",t.purchase_user_id)},edit:function(){this.dataObjTemp.editType="edit"},save:function(){var e=this;this.$refs.form.validate(function(t){if(!t)return console.log("error submit!!"),!1;de.a.post("/hotel.php/order_main/subOrderSave",e.dataObj).then(function(t){console.log(t.data),t.data.flag&&(e.dataObjTemp.editType="view"),e.$alert(t.data.msg,"提示",{confirmButtonText:"确定",callback:function(e){window.close()}})}).catch(function(e){console.log(e)})})},cancel:function(){this.dataObjTemp.editType="view",this.$set(this.dataObj,"editType","view"),this.$set(this,"dataObj",this.dataObjTemp),this.$refs.form.clearValidate()}},mounted:function(){var e=this;this.dataObj.hotel_id&&this.dataObj.room_id&&this.dataObj.plan_id&&this.selectChange(this.dataObj.hotel_id).then(function(){e.roomselectChange(e.dataObj.room_id).then(function(){e.init=!1})})}},me={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",["view"==e.type?a("el-collapse",{model:{value:e.opened,callback:function(t){e.opened=t},expression:"opened"}},[a("el-collapse-item",{attrs:{name:"1"}},[a("template",{slot:"title"},[a("el-row",{staticStyle:{width:"100%","margin-top":"10px","margin-bottom":"10px","padding-right":"20px","background-color":"#9fd8fc"},attrs:{type:"flex",justify:"space-between",align:"middle"}},[a("el-col",{attrs:{span:2}},[e._v("\n "+e._s("酒店")+"\n ")]),e._v(" "),0==e.dataObj.payment_order_status?a("div",[a("el-button",{directives:[{name:"show",rawName:"v-show",value:"view"==e.dataObjTemp.editType,expression:"dataObjTemp.editType=='view'"}],attrs:{type:"primary"},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.edit.apply(null,arguments)}}},[e._v("修改")]),e._v(" "),a("el-button",{directives:[{name:"show",rawName:"v-show",value:"edit"==e.dataObjTemp.editType,expression:"dataObjTemp.editType=='edit'"}],attrs:{type:"primary"},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.save.apply(null,arguments)}}},[e._v("保存")]),e._v(" "),a("el-button",{directives:[{name:"show",rawName:"v-show",value:"edit"==e.dataObjTemp.editType,expression:"dataObjTemp.editType=='edit'"}],attrs:{type:"danger"},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.cancel.apply(null,arguments)}}},[e._v("取消")])],1):e._e()],1)],1),e._v(" "),a("el-form",{ref:"form",attrs:{model:e.dataObj,rules:e.rules,"label-width":"100px",disabled:e.disable}},[a("el-row",{staticStyle:{"margin-top":"25px"}},[a("el-col",{attrs:{span:10}},[a("el-form-item",{attrs:{label:"酒店名称",prop:"hotel_id"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{filterable:"",placeholder:"请选择"},on:{change:e.selectChange},model:{value:e.dataObj.hotel_id,callback:function(t){e.$set(e.dataObj,"hotel_id",t)},expression:"dataObj.hotel_id"}},e._l(e.hotelListOpt,function(e){return a("el-option",{key:"hotel_id"+e.id,attrs:{label:e.name,value:e.id}})}),1)],1)],1),e._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"房型名称",prop:"room_id"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{filterable:"",placeholder:"请选择"},on:{change:e.roomselectChange},model:{value:e.dataObj.room_id,callback:function(t){e.$set(e.dataObj,"room_id",t)},expression:"dataObj.room_id"}},e._l(e.roomListOpt,function(e){return a("el-option",{key:"room_id"+e.id,attrs:{label:e.name,value:e.id}})}),1)],1)],1),e._v(" "),a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"价格方案",prop:"plan_id"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{filterable:"",placeholder:"请选择"},on:{change:e.priceselectChange},model:{value:e.dataObj.plan_id,callback:function(t){e.$set(e.dataObj,"plan_id",t)},expression:"dataObj.plan_id"}},e._l(e.roomPlan,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1)],1)],1),e._v(" "),a("el-row",[a("el-col",{attrs:{span:10}},[a("el-form-item",{attrs:{label:"入离日期",prop:"purchasePriceList"}},[a("el-date-picker",{attrs:{type:"daterange","value-format":"yyyy-MM-dd HH:mm:ss","range-separator":"-","start-placeholder":"入住日期","end-placeholder":"离店日期"},model:{value:e.date,callback:function(t){e.date=t},expression:"date"}})],1)],1),e._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{"label-width":"100px",label:"出游人姓名",prop:"customer_name"}},[a("el-input",{model:{value:e.dataObj.customer_name,callback:function(t){e.$set(e.dataObj,"customer_name",t)},expression:"dataObj.customer_name"}})],1)],1),e._v(" "),a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"确认号",prop:"confirm_no"}},[a("el-input",{model:{value:e.dataObj.confirm_no,callback:function(t){e.$set(e.dataObj,"confirm_no",t)},expression:"dataObj.confirm_no"}})],1)],1)],1),e._v(" "),a("el-form-item",[a("el-table",{staticStyle:{width:"100%","min-width":"890px","margin-top":"20px"},attrs:{data:e.dataObj.purchasePriceList,border:"",height:"320","span-method":e.arraySpanMethod,"summary-method":e.getSummaries,"show-summary":""}},[a("el-table-column",{attrs:{prop:"run_date",label:"日期",width:"180"}}),e._v(" "),a("el-table-column",{attrs:{prop:"price",label:"售卖价"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input-number",{attrs:{size:"small",min:0},model:{value:t.row.price,callback:function(a){e.$set(t.row,"price",a)},expression:"scope.row.price"}})]}}],null,!1,66851190)}),e._v(" "),a("el-table-column",{attrs:{prop:"cost",label:"成本价"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input-number",{attrs:{size:"small",min:0},model:{value:t.row.cost,callback:function(a){e.$set(t.row,"cost",a)},expression:"scope.row.cost"}})]}}],null,!1,983816784)}),e._v(" "),a("el-table-column",{attrs:{prop:"count",label:"数量"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-form-item",{attrs:{prop:"count"}},[a("el-input-number",{attrs:{size:"small",min:0},on:{change:e.changeNum},model:{value:t.row.count,callback:function(a){e.$set(t.row,"count",a)},expression:"scope.row.count"}})],1)]}}],null,!1,3635474167)}),e._v(" "),a("el-table-column",{attrs:{prop:"supplier_id",label:"供应商"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-form-item",{attrs:{prop:"supplier_id"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{filterable:"",placeholder:"请选择"},on:{change:e.changesupplier_id},model:{value:t.row.supplier_id,callback:function(a){e.$set(t.row,"supplier_id",a)},expression:"scope.row.supplier_id"}},e._l(e.supplier_idList,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1)]}}],null,!1,714678206)}),e._v(" "),a("el-table-column",{attrs:{prop:"customer_comments",label:"备注"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input",{attrs:{type:"textarea"},on:{change:e.changeNote},model:{value:t.row.customer_comments,callback:function(a){e.$set(t.row,"customer_comments",a)},expression:"scope.row.customer_comments"}})]}}],null,!1,112926545)})],1)],1),e._v(" "),a("el-row",[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{"label-width":"100px",label:"对方订单号",prop:"trade_order_number"}},[a("el-input",{model:{value:e.dataObj.trade_order_number,callback:function(t){e.$set(e.dataObj,"trade_order_number",t)},expression:"dataObj.trade_order_number"}})],1)],1),e._v(" "),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"资源状态",prop:"confirm_status"}},[a("el-radio-group",{staticStyle:{"min-width":"270px"},attrs:{size:"small"},model:{value:e.dataObj.confirm_status,callback:function(t){e.$set(e.dataObj,"confirm_status",t)},expression:"dataObj.confirm_status"}},[a("el-radio-button",{attrs:{label:1,name:"未发单"}},[e._v("未发单")]),e._v(" "),a("el-radio-button",{attrs:{label:2,name:"已发单"}},[e._v("已发单")]),e._v(" "),a("el-radio-button",{attrs:{label:3,name:"已确认"}},[e._v("已确认")]),e._v(" "),a("el-radio-button",{attrs:{label:4,name:"已取消"}},[e._v("已取消")])],1)],1)],1)],1),e._v(" "),a("el-row",[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{"label-width":"100px",label:"床型说明"}},[a("el-input",{attrs:{disabled:"",type:"textarea"},model:{value:e.dataObjTemp.room_memo,callback:function(t){e.$set(e.dataObjTemp,"room_memo",t)},expression:"dataObjTemp.room_memo"}})],1)],1),e._v(" "),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{"label-width":"100px",label:"采购负责人"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{disabled:"",placeholder:"请选择"},model:{value:e.dataObj.purchase_user_id,callback:function(t){e.$set(e.dataObj,"purchase_user_id",t)},expression:"dataObj.purchase_user_id"}},e._l(e.userOpt,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1)],1),e._v(" "),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{"label-width":"100px",label:"价格方案说明"}},[a("el-input",{attrs:{disabled:"",type:"textarea"},model:{value:e.dataObjTemp.plan_memo,callback:function(t){e.$set(e.dataObjTemp,"plan_memo",t)},expression:"dataObjTemp.plan_memo"}})],1)],1)],1)],1)],2)],1):[a("el-form",{ref:"form",attrs:{model:e.dataObj,rules:e.rules,"label-width":"100px",disabled:e.disable}},[a("el-row",{staticStyle:{"margin-top":"25px"}},[a("el-col",{attrs:{span:10}},[a("el-form-item",{attrs:{label:"酒店名称",prop:"hotel_id"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{filterable:"",placeholder:"请选择"},on:{change:e.selectChange},model:{value:e.dataObj.hotel_id,callback:function(t){e.$set(e.dataObj,"hotel_id",t)},expression:"dataObj.hotel_id"}},e._l(e.hotelListOpt,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1)],1),e._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"房型名称",prop:"room_id"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{filterable:"",placeholder:"请选择"},on:{change:e.roomselectChange},model:{value:e.dataObj.room_id,callback:function(t){e.$set(e.dataObj,"room_id",t)},expression:"dataObj.room_id"}},e._l(e.roomListOpt,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1)],1),e._v(" "),a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"价格方案",prop:"plan_id"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{filterable:"",placeholder:"请选择"},on:{change:e.priceselectChange},model:{value:e.dataObj.plan_id,callback:function(t){e.$set(e.dataObj,"plan_id",t)},expression:"dataObj.plan_id"}},e._l(e.roomPlan,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1)],1)],1),e._v(" "),a("el-row",[a("el-col",{attrs:{span:10}},[a("el-form-item",{attrs:{label:"入离日期",prop:"purchasePriceList"}},[a("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"daterange","value-format":"yyyy-MM-dd HH:mm:ss","range-separator":"-","start-placeholder":"入住日期","end-placeholder":"离店日期"},model:{value:e.date,callback:function(t){e.date=t},expression:"date"}})],1)],1),e._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{"label-width":"100px",label:"出游人姓名",prop:"customer_name"}},[a("el-input",{model:{value:e.dataObj.customer_name,callback:function(t){e.$set(e.dataObj,"customer_name",t)},expression:"dataObj.customer_name"}})],1)],1),e._v(" "),a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"确认号",prop:"confirm_no"}},[a("el-input",{model:{value:e.dataObj.confirm_no,callback:function(t){e.$set(e.dataObj,"confirm_no",t)},expression:"dataObj.confirm_no"}})],1)],1)],1),e._v(" "),a("el-form-item",[a("el-table",{staticStyle:{width:"100%","min-width":"890px","margin-top":"20px"},attrs:{data:e.dataObj.purchasePriceList,border:"",height:"320","summary-method":e.getSummaries,"span-method":e.arraySpanMethod,"show-summary":""}},[a("el-table-column",{attrs:{prop:"run_date",label:"日期",width:"180"}}),e._v(" "),a("el-table-column",{attrs:{prop:"price",label:"售卖价"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input-number",{attrs:{size:"small",min:0},model:{value:t.row.price,callback:function(a){e.$set(t.row,"price",a)},expression:"scope.row.price"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"cost",label:"成本价"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input-number",{attrs:{size:"small",min:0},model:{value:t.row.cost,callback:function(a){e.$set(t.row,"cost",a)},expression:"scope.row.cost"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"count",label:"数量"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-form-item",{attrs:{prop:"count"}},[a("el-input-number",{attrs:{size:"small",min:0},on:{change:e.changeNum},model:{value:t.row.count,callback:function(a){e.$set(t.row,"count",a)},expression:"scope.row.count"}})],1)]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"supplier_id",label:"供应商"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-form-item",{attrs:{prop:"supplier_id"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{filterable:"",placeholder:"请选择"},on:{change:e.changesupplier_id},model:{value:t.row.supplier_id,callback:function(a){e.$set(t.row,"supplier_id",a)},expression:"scope.row.supplier_id"}},e._l(e.supplier_idList,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1)]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"customer_comments",label:"备注"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input",{attrs:{type:"textarea"},on:{change:e.changeNote},model:{value:t.row.customer_comments,callback:function(a){e.$set(t.row,"customer_comments",a)},expression:"scope.row.customer_comments"}})]}}])})],1)],1),e._v(" "),a("el-row",[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{"label-width":"100px",label:"对方订单号",prop:"trade_order_number"}},[a("el-input",{model:{value:e.dataObj.trade_order_number,callback:function(t){e.$set(e.dataObj,"trade_order_number",t)},expression:"dataObj.trade_order_number"}})],1)],1),e._v(" "),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"资源状态",prop:"confirm_status"}},[a("el-radio-group",{staticStyle:{"min-width":"270px"},attrs:{size:"small"},model:{value:e.dataObj.confirm_status,callback:function(t){e.$set(e.dataObj,"confirm_status",t)},expression:"dataObj.confirm_status"}},[a("el-radio-button",{attrs:{label:1,name:"未发单"}},[e._v("未发单")]),e._v(" "),a("el-radio-button",{attrs:{label:2,name:"已发单"}},[e._v("已发单")]),e._v(" "),a("el-radio-button",{attrs:{label:3,name:"已确认"}},[e._v("已确认")]),e._v(" "),a("el-radio-button",{attrs:{label:4,name:"已取消"}},[e._v("已取消")])],1)],1)],1)],1),e._v(" "),a("el-row",[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{"label-width":"100px",label:"床型说明"}},[a("el-input",{attrs:{disabled:"",type:"textarea"},model:{value:e.dataObjTemp.room_memo,callback:function(t){e.$set(e.dataObjTemp,"room_memo",t)},expression:"dataObjTemp.room_memo"}})],1)],1),e._v(" "),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{"label-width":"100px",label:"采购负责人"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{disabled:"",placeholder:"请选择"},model:{value:e.dataObj.purchase_user_id,callback:function(t){e.$set(e.dataObj,"purchase_user_id",t)},expression:"dataObj.purchase_user_id"}},e._l(e.userOpt,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1)],1),e._v(" "),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{"label-width":"100px",label:"价格方案说明"}},[a("el-input",{attrs:{disabled:"",type:"textarea"},model:{value:e.dataObjTemp.plan_memo,callback:function(t){e.$set(e.dataObjTemp,"plan_memo",t)},expression:"dataObjTemp.plan_memo"}})],1)],1)],1)],1)]],2)},staticRenderFns:[]};var _e=a("VU/8")(pe,me,!1,function(e){a("3GdY")},"data-v-1d33828c",null).exports,be={name:"hotelother",props:{supplier_idList:Array,cf_itemOpt:Array,userOpt:Array,type:String,saleCount:Number,dataObj:Object},data:function(){return{dataObjTemp:this.$lo.cloneDeep(this.dataObj),opened:"1",check_in_date:"",day:[],rules:{item_id:[{required:!0,message:"请输入",trigger:"change"}],customer_name:[{required:!0,message:"请输入",trigger:"blur"}],purchase_user_id:[{required:!0,message:"请输入",trigger:"change"}],confirm_status:[{required:!0,message:"请输入",trigger:"blur"}],count:[{required:!0,message:"请输入",trigger:"change"}],supplier_id:[{required:!0,message:"请输入",trigger:"change"}],purchasePriceList:[{type:"array",required:!0,message:"请输入",trigger:"change"}]}}},computed:{disable:function(){return"view"==this.dataObjTemp.editType}},watch:{dataObj:function(e){console.log("change"),this.dataObjTemp=this.$lo.cloneDeep(this.dataObj)},check_in_date:function(e){if(e){var t=this.getAllDateCN(e);console.log(t),this.$set(this.dataObj,"check_in_date",t);var a=[];a.push({run_date:t,price:"",cost:"",count:"",customer_comments:"",supplier_id:""}),this.dataObj.purchasePriceList=a,this.$set(this.dataObj,"purchasePriceList",a)}}},methods:{changeItem:function(e){var t=this.cf_itemOpt.find(function(t){return t.id==e});console.log("changeItem",t,this.dataObj.purchase_user_id),t.item_name=t.name,this.dataObjTemp=te()(this.dataObjTemp,t)},changeNum:function(e){var t=this;this.dataObj.purchasePriceList.forEach(function(a){t.$set(a,"count",e)}),this.dataObj.count=e},changesupplier_id:function(e){var t=this;this.dataObj.purchasePriceList.forEach(function(a){t.$set(a,"supplier_id",e)}),this.dataObj.supplier_id=e},changeNote:function(e){var t=this;this.dataObj.purchasePriceList.forEach(function(a){t.$set(a,"customer_comments",e)}),this.dataObj.customer_comments=e},arraySpanMethod:function(e){e.row,e.column,e.rowIndex;var t=e.columnIndex;return 3===t?[this.dataObj.purchasePriceList.length,1]:4===t?[this.dataObj.purchasePriceList.length,1]:5===t?[this.dataObj.purchasePriceList.length,1]:[1,1]},getAllDateCN:function(e){return e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate()},getSummaries:function(e){var t=this,a=e.columns,r=e.data,o=[];return a.forEach(function(e,l){if(0!==l)if(3!==l){if(5!==l)if(4!==l){var n=r.map(function(t){return Number(t[e.property])*Number(t[a[3].property])});n.every(function(e){return isNaN(e)})?o[l]="N/A":(o[l]=n.reduce(function(e,t){var a=Number(t);return isNaN(a)?e:e+t},0),1==l&&(t.dataObj.total_price=o[l],t.$set(t.dataObj,"total_price",o[l])),2==l&&(t.dataObj.total_cost=o[l],t.$set(t.dataObj,"total_cost",o[l])),4==l&&(t.dataObj.profit=o[l],t.$set(t.dataObj,"profit",o[l])),o[l]+=" 元")}else{var i=r.map(function(e){return(Number(e[a[1].property])*t.saleCount-Number(e[a[2].property]))*Number(e[a[3].property])});i.every(function(e){return isNaN(e)})?o[l]="N/A":(o[l]=i.reduce(function(e,t){var a=Number(t);return isNaN(a)?e:e+t},0),o[l]+=" 元")}}else o[l]="利润";else o[l]="总价"}),o},edit:function(){this.dataObjTemp.editType="edit"},save:function(){var e=this;this.$refs.form.validate(function(t){if(!t)return console.log("error submit!!"),!1;de.a.post("/hotel.php/order_main/subOrderSave",e.dataObj).then(function(t){console.log(t),t.data.flag&&(e.dataObjTemp.editType="view"),e.$alert(t.data.msg,"提示",{confirmButtonText:"确定",callback:function(e){window.close()}})}).catch(function(e){console.log(e)})})},cancel:function(){this.dataObjTemp.editType="view",this.$set(this.dataObj,"editType","view"),this.$set(this,"dataObj",this.dataObjTemp),this.$refs.form.clearValidate()}},mounted:function(){this.dataObj.item_id&&this.changeItem(this.dataObj.item_id)}},fe={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",["view"==e.type?a("el-collapse",{model:{value:e.opened,callback:function(t){e.opened=t},expression:"opened"}},[a("el-collapse-item",{attrs:{name:"1"}},[a("template",{slot:"title"},[a("el-row",{staticStyle:{width:"100%","margin-top":"10px","margin-bottom":"10px","padding-right":"20px","background-color":"#9fd8fc"},attrs:{type:"flex",justify:"space-between",align:"middle"}},[a("el-col",{attrs:{span:2}},[e._v("\n "+e._s("附加项目")+"\n ")]),e._v(" "),0==e.dataObj.payment_order_status?a("div",[e._v(">\n "),a("el-button",{directives:[{name:"show",rawName:"v-show",value:"view"==e.dataObjTemp.editType,expression:"dataObjTemp.editType=='view'"}],attrs:{type:"primary"},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.edit.apply(null,arguments)}}},[e._v("修改")]),e._v(" "),a("el-button",{directives:[{name:"show",rawName:"v-show",value:"edit"==e.dataObjTemp.editType,expression:"dataObjTemp.editType=='edit'"}],attrs:{type:"primary"},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.save.apply(null,arguments)}}},[e._v("保存")]),e._v(" "),a("el-button",{directives:[{name:"show",rawName:"v-show",value:"edit"==e.dataObjTemp.editType,expression:"dataObjTemp.editType=='edit'"}],attrs:{type:"danger"},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.cancel.apply(null,arguments)}}},[e._v("取消")])],1):e._e()],1)],1),e._v(" "),a("el-form",{ref:"form",attrs:{model:e.dataObj,rules:e.rules,"label-width":"100px",disabled:e.disable}},[a("el-row",{staticStyle:{"margin-top":"25px"}},[a("el-col",{attrs:{span:10}},[a("el-form-item",{attrs:{"label-width":"120px",label:"附加项目名称",prop:"item_id"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{filterable:"",placeholder:"请选择"},on:{change:e.changeItem},model:{value:e.dataObj.item_id,callback:function(t){e.$set(e.dataObj,"item_id",t)},expression:"dataObj.item_id"}},e._l(e.cf_itemOpt,function(e){return a("el-option",{key:"item_id"+e.id,attrs:{label:e.name,value:e.id}})}),1)],1)],1),e._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"附加项目类型"}},[a("el-input",{attrs:{disabled:""},model:{value:e.dataObjTemp.item_type_name,callback:function(t){e.$set(e.dataObjTemp,"item_type_name",t)},expression:"dataObjTemp.item_type_name"}})],1)],1),e._v(" "),a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"计价单位"}},[a("el-input",{attrs:{disabled:""},model:{value:e.dataObjTemp.item_unit,callback:function(t){e.$set(e.dataObjTemp,"item_unit",t)},expression:"dataObjTemp.item_unit"}})],1)],1)],1),e._v(" "),a("el-row",[a("el-col",{attrs:{span:10}},[a("el-form-item",{attrs:{"label-width":"120px",label:"使用日期",prop:"purchasePriceList"}},[a("el-col",{attrs:{span:11}},[a("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"date",placeholder:"选择日期"},model:{value:e.check_in_date,callback:function(t){e.check_in_date=t},expression:"check_in_date"}})],1)],1)],1),e._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{"label-width":"100px",label:"出游人姓名",prop:"customer_name"}},[a("el-input",{model:{value:e.dataObj.customer_name,callback:function(t){e.$set(e.dataObj,"customer_name",t)},expression:"dataObj.customer_name"}})],1)],1),e._v(" "),a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"确认号",prop:"confirm_no"}},[a("el-input",{model:{value:e.dataObj.confirm_no,callback:function(t){e.$set(e.dataObj,"confirm_no",t)},expression:"dataObj.confirm_no"}})],1)],1)],1),e._v(" "),a("el-form-item",[a("el-table",{staticStyle:{width:"100%","min-width":"890px","margin-top":"20px"},attrs:{data:e.dataObj.purchasePriceList,border:"",height:"160","span-method":e.arraySpanMethod,"summary-method":e.getSummaries,"show-summary":""}},[a("el-table-column",{attrs:{prop:"run_date",label:"日期",width:"180"}}),e._v(" "),a("el-table-column",{attrs:{prop:"price",label:"售卖价"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input-number",{attrs:{size:"small",min:0},model:{value:t.row.price,callback:function(a){e.$set(t.row,"price",a)},expression:"scope.row.price"}})]}}],null,!1,66851190)}),e._v(" "),a("el-table-column",{attrs:{prop:"cost",label:"成本价"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input-number",{attrs:{size:"small",min:0},model:{value:t.row.cost,callback:function(a){e.$set(t.row,"cost",a)},expression:"scope.row.cost"}})]}}],null,!1,983816784)}),e._v(" "),a("el-table-column",{attrs:{prop:"count",label:"数量"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-form-item",{attrs:{prop:"count"}},[a("el-input-number",{attrs:{size:"small",min:0},on:{change:e.changeNum},model:{value:t.row.count,callback:function(a){e.$set(t.row,"count",a)},expression:"scope.row.count"}})],1)]}}],null,!1,3635474167)}),e._v(" "),a("el-table-column",{attrs:{prop:"supplier_id",label:"供应商"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-form-item",{attrs:{prop:"supplier_id"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{filterable:"",placeholder:"请选择"},on:{change:e.changesupplier_id},model:{value:t.row.supplier_id,callback:function(a){e.$set(t.row,"supplier_id",a)},expression:"scope.row.supplier_id"}},e._l(e.supplier_idList,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1)]}}],null,!1,714678206)}),e._v(" "),a("el-table-column",{attrs:{prop:"customer_comments",label:"备注"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input",{attrs:{type:"textarea"},on:{change:e.changeNote},model:{value:t.row.customer_comments,callback:function(a){e.$set(t.row,"customer_comments",a)},expression:"scope.row.customer_comments"}})]}}],null,!1,112926545)})],1)],1),e._v(" "),a("el-row",[a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{"label-width":"100px",label:"对方订单号",prop:"trade_order_number"}},[a("el-input",{model:{value:e.dataObj.trade_order_number,callback:function(t){e.$set(e.dataObj,"trade_order_number",t)},expression:"dataObj.trade_order_number"}})],1)],1),e._v(" "),a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{"label-width":"120px",label:"采购负责人",prop:"purchase_user_id"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{disabled:"",placeholder:"请选择"},model:{value:e.dataObjTemp.purchase_user_id,callback:function(t){e.$set(e.dataObjTemp,"purchase_user_id",t)},expression:"dataObjTemp.purchase_user_id"}},e._l(e.userOpt,function(e){return a("el-option",{key:"purchase_user_id"+e.id,attrs:{label:e.name,value:e.id}})}),1)],1)],1),e._v(" "),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"资源状态",prop:"confirm_status"}},[a("el-radio-group",{staticStyle:{"min-width":"270px"},attrs:{size:"small"},model:{value:e.dataObj.confirm_status,callback:function(t){e.$set(e.dataObj,"confirm_status",t)},expression:"dataObj.confirm_status"}},[a("el-radio-button",{attrs:{label:1,name:"未发单"}},[e._v("未发单")]),e._v(" "),a("el-radio-button",{attrs:{label:2,name:"已发单"}},[e._v("已发单")]),e._v(" "),a("el-radio-button",{attrs:{label:3,name:"已确认"}},[e._v("已确认")]),e._v(" "),a("el-radio-button",{attrs:{label:4,name:"已取消"}},[e._v("已取消")])],1)],1)],1)],1),e._v(" "),a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{"label-width":"100px",label:"附加项目说明"}},[a("el-input",{attrs:{disabled:"",type:"textarea"},model:{value:e.dataObjTemp.item_memo,callback:function(t){e.$set(e.dataObjTemp,"item_memo",t)},expression:"dataObjTemp.item_memo"}})],1)],1)],1)],1)],2)],1):[a("el-form",{ref:"form",attrs:{model:e.dataObj,rules:e.rules,"label-width":"100px",disabled:e.disable}},[a("el-row",{staticStyle:{"margin-top":"25px"}},[a("el-col",{attrs:{span:10}},[a("el-form-item",{attrs:{"label-width":"120px",label:"附加项目名称",prop:"item_id"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{filterable:"",placeholder:"请选择"},on:{change:e.changeItem},model:{value:e.dataObj.item_id,callback:function(t){e.$set(e.dataObj,"item_id",t)},expression:"dataObj.item_id"}},e._l(e.cf_itemOpt,function(e){return a("el-option",{key:"item_id"+e.id,attrs:{label:e.name,value:e.id}})}),1)],1)],1),e._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{label:"附加项目类型"}},[a("el-input",{attrs:{disabled:""},model:{value:e.dataObjTemp.item_type_name,callback:function(t){e.$set(e.dataObjTemp,"item_type_name",t)},expression:"dataObjTemp.item_type_name"}})],1)],1),e._v(" "),a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"计价单位"}},[a("el-input",{attrs:{disabled:""},model:{value:e.dataObjTemp.item_unit,callback:function(t){e.$set(e.dataObjTemp,"item_unit",t)},expression:"dataObjTemp.item_unit"}})],1)],1)],1),e._v(" "),a("el-row",[a("el-col",{attrs:{span:10}},[a("el-form-item",{attrs:{"label-width":"120px",label:"使用日期",prop:"purchasePriceList"}},[a("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"date",placeholder:"选择日期"},model:{value:e.check_in_date,callback:function(t){e.check_in_date=t},expression:"check_in_date"}})],1)],1),e._v(" "),a("el-col",{attrs:{span:8}},[a("el-form-item",{attrs:{"label-width":"100px",label:"出游人姓名",prop:"customer_name"}},[a("el-input",{model:{value:e.dataObj.customer_name,callback:function(t){e.$set(e.dataObj,"customer_name",t)},expression:"dataObj.customer_name"}})],1)],1),e._v(" "),a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"确认号",prop:"confirm_no"}},[a("el-input",{model:{value:e.dataObj.confirm_no,callback:function(t){e.$set(e.dataObj,"confirm_no",t)},expression:"dataObj.confirm_no"}})],1)],1)],1),e._v(" "),a("el-form-item",[a("el-table",{staticStyle:{width:"100%","min-width":"890px","margin-top":"20px"},attrs:{data:e.dataObj.purchasePriceList,border:"",height:"160","summary-method":e.getSummaries,"span-method":e.arraySpanMethod,"show-summary":""}},[a("el-table-column",{attrs:{prop:"run_date",label:"日期",width:"180"}}),e._v(" "),a("el-table-column",{attrs:{prop:"price",label:"售卖价"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input-number",{attrs:{size:"small",min:0},model:{value:t.row.price,callback:function(a){e.$set(t.row,"price",a)},expression:"scope.row.price"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"cost",label:"成本价"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input-number",{attrs:{size:"small",min:0},model:{value:t.row.cost,callback:function(a){e.$set(t.row,"cost",a)},expression:"scope.row.cost"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"count",label:"数量"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-form-item",{attrs:{prop:"count"}},[a("el-input-number",{attrs:{size:"small",min:0},on:{change:e.changeNum},model:{value:t.row.count,callback:function(a){e.$set(t.row,"count",a)},expression:"scope.row.count"}})],1)]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"supplier_id",label:"供应商"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-form-item",{attrs:{prop:"supplier_id"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{filterable:"",placeholder:"请选择"},on:{change:e.changesupplier_id},model:{value:t.row.supplier_id,callback:function(a){e.$set(t.row,"supplier_id",a)},expression:"scope.row.supplier_id"}},e._l(e.supplier_idList,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1)]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"customer_comments",label:"备注"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-input",{attrs:{type:"textarea"},on:{change:e.changeNote},model:{value:t.row.customer_comments,callback:function(a){e.$set(t.row,"customer_comments",a)},expression:"scope.row.customer_comments"}})]}}])})],1)],1),e._v(" "),a("el-row",[a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{"label-width":"100px",label:"对方订单号",prop:"trade_order_number"}},[a("el-input",{model:{value:e.dataObj.trade_order_number,callback:function(t){e.$set(e.dataObj,"trade_order_number",t)},expression:"dataObj.trade_order_number"}})],1)],1),e._v(" "),a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{"label-width":"120px",label:"采购负责人",prop:"purchase_user_id"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{disabled:"",placeholder:"请选择"},model:{value:e.dataObjTemp.purchase_user_id,callback:function(t){e.$set(e.dataObjTemp,"purchase_user_id",t)},expression:"dataObjTemp.purchase_user_id"}},e._l(e.userOpt,function(e){return a("el-option",{key:"purchase_user_id"+e.id,attrs:{label:e.name,value:e.id}})}),1)],1)],1),e._v(" "),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"资源状态",prop:"confirm_status"}},[a("el-radio-group",{staticStyle:{"min-width":"270px"},attrs:{size:"small"},model:{value:e.dataObj.confirm_status,callback:function(t){e.$set(e.dataObj,"confirm_status",t)},expression:"dataObj.confirm_status"}},[a("el-radio-button",{attrs:{label:1,name:"未发单"}},[e._v("未发单")]),e._v(" "),a("el-radio-button",{attrs:{label:2,name:"已发单"}},[e._v("已发单")]),e._v(" "),a("el-radio-button",{attrs:{label:3,name:"已确认"}},[e._v("已确认")]),e._v(" "),a("el-radio-button",{attrs:{label:4,name:"已取消"}},[e._v("已取消")])],1)],1)],1)],1),e._v(" "),a("el-row",[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{"label-width":"100px",label:"附加项目说明"}},[a("el-input",{attrs:{disabled:"",type:"textarea"},model:{value:e.dataObjTemp.item_memo,callback:function(t){e.$set(e.dataObjTemp,"item_memo",t)},expression:"dataObjTemp.item_memo"}})],1)],1)],1)],1)]],2)},staticRenderFns:[]};var he={components:{hotel:_e,hotelother:a("VU/8")(be,fe,!1,function(e){a("xKoU")},"data-v-6fd0d05e",null).exports},data:function(){return{active:"1",type:window.id?"view":"add",saleCount:1,editSingle:!1,orderMain:{commissioner_id:"",channel_id:"",channel_order_no:"",user_name:"",user_phone:"",order_memo:""},rules:{commissioner_id:[{required:!0,message:"请输入",trigger:"blur"}],channel_id:[{required:!0,message:"请输入",trigger:"blur"}],channel_order_no:[{required:!0,message:"请输入",trigger:"blur"}],user_name:[{required:!0,message:"请输入",trigger:"blur"}],order_memo:[{required:!0,message:"请输入",trigger:"blur"}]},orderMainCopy:{},hotelListObj:{prod_type:"hotel",hotel_id:"",room_id:"",plan_id:"",check_in_date:"",check_out_date:"",customer_name:"",confirm_no:"",trade_order_number:"",confirm_status:"1",room_memo:"",purchase_user_id:"",plan_memo:"",total_price:"",total_cost:"",profit:"",count:"",supplier_id:"",editType:"add",purchasePriceList:[{run_date:"请选择日期",price:"",cost:"",count:"",customer_comments:"",supplier_id:null}]},hotelList:[],hotelotherListObj:{prod_type:"item",item_id:"",item_name:"",item_unit:"",check_in_date:"",customer_name:"",confirm_no:"",trade_order_number:"",purchase_user_id:"",confirm_status:"1",item_memo:"",total_price:"",total_cost:"",profit:"",count:"",supplier_id:"",editType:"add",purchasePriceList:[{run_date:"请选择日期",price:"",cost:"",count:"",customer_comments:"",supplier_id:null}]},hotelotherList:[],hotelListOpt:[],channelListOpt:[],userOpt:[],cf_itemOpt:[],supplier_idList:[]}},computed:{disable:function(){return!("add"==this.type||this.editSingle)}},methods:{selectChange:function(e){this.saleCount=this.channelListOpt.filter(function(t){return t.id==e}),this.saleCount=Number(this.saleCount.commission_rate)||1,console.log(this.saleCount)},addHotel:function(){this.hotelList.push(JSON.parse(le()(this.hotelListObj)))},addHotelOther:function(){this.hotelotherList.push(JSON.parse(le()(this.hotelotherListObj)))},delSinHotel:function(e){this.hotelList.splice(e,1)},delSinHotelOther:function(e){this.hotelotherList.splice(e,1)},onSubmit:function(){var e=this;console.log("submit!"),this.$refs.form.validate(function(t){if(!t)return console.log("error submit!!"),!1;!function(){var t=[];for(var a in e.hotelList)console.log(e.$refs["formhotel"+a]),e.$refs["formhotel"+a][0].$refs.form.validate(function(e){e?t.push("true"):t.push("false")});for(var r in e.hotelotherList)e.$refs["formhotelother"+r][0].$refs.form.validate(function(e){e?t.push("true"):t.push("false")});if(t.indexOf("false")<0){var o,l=[].concat(re()(e.hotelList),re()(e.hotelotherList));o=te()({},e.orderMain,{subOrderList:l}),de.a.post("/hotel.php/order_main/save",o).then(function(t){e.$alert("新增成功","提示",{confirmButtonText:"确定",callback:function(e){window.close()}})}).catch(function(e){console.log(e)})}else console.error(t)}()})},save:function(){var e=this;this.editSingle=!1;var t=this.orderMain;this.$refs.form.validate(function(a){if(!a)return console.log("error submit!!"),!1;de.a.post("/hotel.php/order_main/save",t).then(function(t){t.data.flag,e.$alert(t.data.msg,"提示",{confirmButtonText:"确定",callback:function(e){window.close()}})}).catch(function(e){console.log(e)})})},cancel:function(){this.editSingle=!1,this.orderMain=this.orderMainCopy}},mounted:function(){var e=this;de.a.get("/hotel.php/cf_item/getList").then(function(t){e.cf_itemOpt=t.data.list}).catch(function(e){console.log(e)}),de.a.get("/hotel.php/auth/admin/getList").then(function(t){e.userOpt=t.data.list}).catch(function(e){console.log(e)}),de.a.get("/hotel.php/cf_hotel_info/getHotelList").then(function(t){e.hotelListOpt=t.data.list}).catch(function(e){console.log(e)}),de.a.get("/hotel.php/cf_suplier_info/getList").then(function(t){e.supplier_idList=t.data.list}).catch(function(e){console.log(e)}),de.a.get("/hotel.php/cf_channel_info/getList").then(function(t){e.channelListOpt=t.data.list}).catch(function(e){console.log(e)}),console.log(this.type),"add"!=this.type&&de.a.post("/hotel.php/order_main/getShowInfo",{id:window.id}).then(function(t){if(console.log("detailDatas",t.data),t.data.flag){var a=e.$lo.cloneDeep(t.data.data);delete a.subOrderList,0!=a.receipt_order_status&&(e.type="view"),e.orderMain=a,e.orderMainCopy=e.$lo.cloneDeep(a),t.data.data.subOrderList.forEach(function(e){e.purchasePriceList.forEach(function(t){e.count=t.count,t.supplier_id=e.supplier_id,t.customer_comments=e.customer_comments}),e.editType="view"}),e.hotelList=t.data.data.subOrderList.filter(function(e){return e.hotel_id}),e.hotelotherList=t.data.data.subOrderList.filter(function(e){return e.item_id})}}).catch(function(e){console.log(e)})}},ve={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("el-collapse",{model:{value:e.active,callback:function(t){e.active=t},expression:"active"}},[a("el-collapse-item",{attrs:{name:"1"}},[a("template",{slot:"title"},[a("el-row",{staticStyle:{width:"100%",padding:"0 30px"},attrs:{type:"flex",justify:"space-between"}},[a("el-button",{attrs:{type:"text"}},[e._v("基本信息")]),e._v(" "),0==e.orderMain.receipt_order_status?a("div",[a("el-button",{directives:[{name:"show",rawName:"v-show",value:"view"==e.type&&!e.editSingle,expression:"type=='view'&&!editSingle"}],attrs:{type:"primary"},on:{click:function(t){t.stopPropagation(),t.preventDefault(),e.editSingle=!0}}},[e._v("修改\n ")]),e._v(" "),a("el-button",{directives:[{name:"show",rawName:"v-show",value:e.editSingle,expression:"editSingle"}],attrs:{type:"primary"},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.save.apply(null,arguments)}}},[e._v("保存")]),e._v(" "),a("el-button",{directives:[{name:"show",rawName:"v-show",value:e.editSingle,expression:"editSingle"}],attrs:{type:"danger"},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.cancel.apply(null,arguments)}}},[e._v("取消")])],1):e._e()],1)],1),e._v(" "),a("el-form",{ref:"form",attrs:{model:e.orderMain,rules:e.rules,"label-width":"120px",disabled:e.disable}},[a("el-row",[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"订单专员",prop:"commissioner_id"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{filterable:"",placeholder:"请选择"},model:{value:e.orderMain.commissioner_id,callback:function(t){e.$set(e.orderMain,"commissioner_id",t)},expression:"orderMain.commissioner_id"}},e._l(e.userOpt,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1)],1),e._v(" "),a("el-col",{attrs:{span:12}})],1),e._v(" "),a("el-row",[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"订单渠道",prop:"channel_id"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{filterable:"",placeholder:"请选择"},on:{change:e.selectChange},model:{value:e.orderMain.channel_id,callback:function(t){e.$set(e.orderMain,"channel_id",t)},expression:"orderMain.channel_id"}},e._l(e.channelListOpt,function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1)],1),e._v(" "),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"渠道订单编号",prop:"channel_order_no"}},[a("el-input",{model:{value:e.orderMain.channel_order_no,callback:function(t){e.$set(e.orderMain,"channel_order_no",t)},expression:"orderMain.channel_order_no"}})],1)],1)],1),e._v(" "),a("el-row",[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"用户姓名",prop:"user_name"}},[a("el-input",{model:{value:e.orderMain.user_name,callback:function(t){e.$set(e.orderMain,"user_name",t)},expression:"orderMain.user_name"}})],1)],1),e._v(" "),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"用户电话",prop:"user_phone"}},[a("el-input",{model:{value:e.orderMain.user_phone,callback:function(t){e.$set(e.orderMain,"user_phone",t)},expression:"orderMain.user_phone"}})],1)],1)],1),e._v(" "),a("el-form-item",{attrs:{label:"备注"}},[a("el-input",{attrs:{type:"textarea"},model:{value:e.orderMain.order_memo,callback:function(t){e.$set(e.orderMain,"order_memo",t)},expression:"orderMain.order_memo"}})],1),e._v(" "),"add"!=e.type?[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"收款单信息",prop:"receipt_order_name"}},[a("el-input",{attrs:{disabled:""},model:{value:e.orderMain.receipt_order_name,callback:function(t){e.$set(e.orderMain,"receipt_order_name",t)},expression:"orderMain.receipt_order_name"}})],1)],1),e._v(" "),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"收款单状态",prop:"receipt_order_status"}},[a("el-input",{attrs:{disabled:""},model:{value:0==e.orderMain.receipt_order_status?"未收款":1==e.orderMain.receipt_order_status?"收款中":"已收款",callback:function(t){e.$set(0==e.orderMain.receipt_order_status?"未收款":e.orderMain,"receipt_order_status==1?'收款中':'已收款'",t)},expression:"orderMain.receipt_order_status==0?'未收款':orderMain.receipt_order_status==1?'收款中':'已收款'"}})],1)],1)]:e._e()],2)],2)],1),e._v(" "),a("el-form",[a("el-form-item",[a("el-row",{staticStyle:{"margin-top":"20px"},attrs:{type:"flex"}},[a("el-button",{attrs:{type:"primary"},on:{click:e.addHotel}},[e._v("添加酒店")])],1)],1),e._v(" "),e._l(e.hotelList,function(t,r){return[a("el-card",{key:"hotel"+r,staticClass:"card",staticStyle:{"margin-top":"20px"},attrs:{shadow:"hover"}},["add"==e.type?a("el-row",{attrs:{type:"flex",justify:"end"}},[a("el-button",{attrs:{type:"danger"},on:{click:function(t){return e.delSinHotel(r)}}},[e._v("删除")])],1):e._e(),e._v(" "),a("hotel",{ref:"formhotel"+r,refInFor:!0,attrs:{userOpt:e.userOpt,supplier_idList:e.supplier_idList,dataObj:t,hotelListOpt:e.hotelListOpt,saleCount:e.saleCount,type:e.type}})],1)]}),e._v(" "),a("el-form-item",[a("el-row",{staticStyle:{"margin-top":"20px"},attrs:{type:"flex"}},[a("el-button",{attrs:{type:"primary"},on:{click:e.addHotelOther}},[e._v("添加附加项目")])],1)],1),e._v(" "),e._l(e.hotelotherList,function(t,r){return[a("el-card",{key:"hotelother"+r,staticClass:"card",staticStyle:{"margin-top":"20px"},attrs:{shadow:"hover"}},["add"==e.type?a("el-row",{attrs:{type:"flex",justify:"end"}},[a("el-button",{attrs:{type:"danger"},on:{click:function(t){return e.delSinHotel(r)}}},[e._v("删除")])],1):e._e(),e._v(" "),a("hotelother",{ref:"formhotelother"+r,refInFor:!0,attrs:{userOpt:e.userOpt,supplier_idList:e.supplier_idList,dataObj:t,cf_itemOpt:e.cf_itemOpt,saleCount:e.saleCount,type:e.type}})],1)]}),e._v(" "),0==e.orderMain.receipt_order_status||"add"==e.type?a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v("提交订单")])],1):e._e()],2)],1)},staticRenderFns:[]};var Oe={name:"App",components:{HelloWorld:a("VU/8")(he,ve,!1,function(e){a("yAKI")},null,null).exports}},ge={render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{attrs:{id:"app"}},[t("HelloWorld")],1)},staticRenderFns:[]};var ye=a("VU/8")(Oe,ge,!1,function(e){a("U0mk")},null,null).exports,we=a("M4fF"),je=a.n(we);K.default.use(Z.a),K.default.use(X.a),K.default.use(W.a),K.default.use(J.a),K.default.use(Y.a),K.default.use(F.a),K.default.use(z.a),K.default.use(E.a),K.default.use(I.a),K.default.use(D.a),K.default.use(P.a),K.default.use(N.a),K.default.use(S.a),K.default.use($.a),K.default.use(x.a),K.default.use(w.a),K.default.use(g.a),K.default.use(v.a),K.default.use(f.a),K.default.use(_.a),K.default.use(p.a),K.default.use(u.a.directive),K.default.prototype.$loading=u.a.service,K.default.prototype.$msgbox=s.a,K.default.prototype.$alert=s.a.alert,K.default.prototype.$confirm=s.a.confirm,K.default.prototype.$prompt=s.a.prompt,K.default.prototype.$notify=n.a,K.default.prototype.$message=o.a,K.default.config.productionTip=!1,K.default.prototype.$lo=je.a,new K.default({el:"#app",render:function(e){return e(ye)}})},Q6SQ:function(e,t){},U0mk:function(e,t){},"X+ky":function(e,t){},XPMo:function(e,t){},Zki6:function(e,t){},bRYy:function(e,t){},cDSy:function(e,t){},cwe7:function(e,t){},d7TW:function(e,t){},isE6:function(e,t){},isgN:function(e,t){},jZDA:function(e,t){},oq7i:function(e,t){},qunJ:function(e,t){},xKoU:function(e,t){},yAKI:function(e,t){}},["NHnr"]);
|