chunk-2f5a153e.de00cc8d.js 75 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2f5a153e","chunk-03ad842a","chunk-6473e5ac","chunk-c06d096a","chunk-4f634a89","chunk-718fc9a1","chunk-107342c4","chunk-0812dd4e","chunk-fe48addc","chunk-2d21d8c0"],{"01e4":function(t,e,i){"use strict";i.r(e);var r=function(){var t=this,e=t._self._c;return e("div",{staticClass:"order-detail"},[e("el-drawer",{attrs:{visible:t.showOrderDetail,size:"1000px","before-close":t.closeFn,"custom-class":"order-draw-wrap",direction:"ltr"},on:{"update:visible":function(e){t.showOrderDetail=e},close:t.closeTrigger}},[t.$util.isEmpty(t.data)?e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{height:"800px"}}):e("div",{staticClass:"order-manage-wrap"},[e("div",{staticClass:"card-wrap",staticStyle:{"margin-top":"0px"}},[e("div",{staticClass:"card-tit"},[t._v("备注")]),e("div",{staticClass:"card-body"},[e("el-input",{attrs:{type:"textarea",rows:2,placeholder:"请输入内容"},model:{value:t.data[0].remark,callback:function(e){t.$set(t.data[0],"remark",e)},expression:"data[0].remark"}})],1),e("div",{staticStyle:{"text-align":"center","margin-top":"4px"}},[e("el-button",{staticStyle:{margin:"0 auto"},attrs:{size:"small",type:"primary"},on:{click:function(e){return e.stopPropagation(),t.modifyRemark()}}},[t._v("修改")])],1)]),e("div",{staticClass:"card-wrap"},[e("div",{staticClass:"card-tit"},[t._v("花材信息")]),e("div",{staticClass:"card-body"},[e("el-table",{attrs:{data:t.data[0].product}},[e("el-table-column",{attrs:{label:"图片"},scopedSlots:t._u([{key:"default",fn:function(t){return[e("cl-avatar",{attrs:{shape:"square",size:30,src:t.row.cover}})]}}],null,!1,2761605533)}),e("el-table-column",{attrs:{property:"name",label:"名称"}}),e("el-table-column",{attrs:{property:"xhUnitPrice",label:"单价"}}),e("el-table-column",{attrs:{label:"数量"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",{staticStyle:{cursor:"pointer"},on:{click:function(e){return t.getStockDetail(i.row)}}},[e("i",{staticClass:"el-icon-s-order",staticStyle:{color:"#409eff","font-size":"17px"},attrs:{slot:"reference"},slot:"reference"}),t._v(" "+t._s(i.row.num?parseFloat(i.row.num):0)+" ")])]}}],null,!1,2521193535)}),e("el-table-column",{attrs:{property:"refundNum",label:"已退数"}}),e("el-table-column",{attrs:{label:"备注"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",{staticStyle:{cursor:"pointer"},on:{click:function(e){return t.modifyItemRemark(i.row)}}},[e("i",{staticClass:"el-icon-edit",staticStyle:{color:"#409eff","font-size":"17px",cursor:"pointer"},attrs:{slot:"reference"},slot:"reference"}),t._v(t._s(i.row.remark))])]}}],null,!1,997837959)})],1)],1)])])])],1)},s=[],a={name:"order-detail",props:{orderOperate:{type:Object,default:()=>{}}},data(){return{showOrderDetail:!1,data:[],loading:!0}},methods:{closeTrigger(){this.$emit("searchFocus")},getStockDetail(t){this.$emit("getStockDetail",t)},modifyItemRemark(t){this.$prompt("请输入备注","提示",{confirmButtonText:"确定",cancelButtonText:"取消",inputPattern:/\S/,inputErrorMessage:"请写备注",inputValue:t.remark}).then(({value:e})=>{this.$service.orderItem.updateItemRemark({remark:e,id:t.id}).then(i=>{t.remark=e,this.$message.success("修改成功")})})},modifyRemark(){this.$service.order.modifyRemark({id:this.orderOperate.id,remark:this.data[0].remark}).then(t=>{this.$message.success("修改成功")})},init(){this.data=[],this.showOrderDetail=!0,this.$service.order.info({id:this.orderOperate.id}).then(t=>{this.data=[t]})},closeFn(){this.showOrderDetail=!1}}},n=a,o=(i("d8ae"),i("90f2"),i("1805")),c=Object(o["a"])(n,r,s,!1,null,"70dcf340",null);e["default"]=c.exports},"029d":function(t,e,i){},"0a8b":function(t,e,i){"use strict";i("db83")},"0ce5":function(t,e,i){"use strict";i.r(e);var r=function(){var t=this,e=t._self._c;return e("div",[e("el-drawer",{attrs:{visible:t.showArea,size:"50vw","before-close":t.closeFn,"custom-class":"drawer-class",direction:"ltr"},on:{"update:visible":function(e){t.showArea=e},close:t.closeTrigger}},[e("div",[e("div",{staticStyle:{"margin-left":"10px","font-weight":"bold"}},[t._v("售后记录")]),e("x-crud",{on:{load:t.onLoad},scopedSlots:t._u([{key:"table-column-status",fn:function({scope:e}){return[t._v(" "+t._s(0==e.row.status?"待审核":1==e.row.status?"已通过":2==e.row.status?"已驳回":"已取消")+" ")]}},{key:"slot-column-option",fn:function({scope:i}){return[e("el-button",{attrs:{size:"medium",type:"primary"},on:{click:function(e){return e.stopPropagation(),t.getDetail(i.row)}}},[t._v("明细")])]}}])})],1),t.$util.isEmpty(t.info)?t._e():e("div",{staticClass:"app-content"},[e("div",{staticClass:"flex refund-item"},[e("div",{staticClass:"refund-label"},[t._v("售后方式:")]),e("div",{staticClass:"flex list",staticStyle:{"align-items":"center"}},[e("div",{staticClass:"flex",staticStyle:{"align-items":"center"}},[t._v(t._s(1==t.refundType?"退货并退款":"只退款"))])])]),1==t.refundType?e("div",{staticClass:"refund-item-list"},[e("div",{staticClass:"refund-label"},[t._v("售后商品:")]),e("div",t._l(t.product,(function(i,r){return e("div",{key:r,staticClass:"list"},[e("div",{staticClass:"flex list-title"},[t._v(" "+t._s(i.name)+" ¥"+t._s(parseFloat(i.xhUnitPrice))+"x"+t._s(i.xhNum)+t._s(i.xhUnitName)+"=¥"+t._s(parseFloat(i.xhPrice))+" ")])])})),0)]):t._e(),e("div",{staticClass:"flex refund-item"},[e("div",{staticClass:"refund-label"},[t._v("申请时间:")]),e("div",{staticClass:"flex list",staticStyle:{"align-items":"center"}},[e("div",{staticClass:"flex",staticStyle:{"align-items":"center"}},[t._v(t._s(t.info.addTime?t.info.addTime.substr(5,11):""))])])]),e("div",{staticClass:"flex refund-item"},[e("div",{staticClass:"refund-label"},[t._v("售后原因:")]),e("div",{staticClass:"flex list",staticStyle:{"align-items":"center"}},[e("div",{staticClass:"flex",staticStyle:{"align-items":"center"}},[t._v(" "+t._s(0==t.info.cause?"质量问题":1==t.info.cause?"多开错开":2==t.info.cause?"打包原因":3==t.info.cause?"物流原因":"其它")+" "),e("span",{staticStyle:{"margin-left":"20px",color:"#3385FF",cursor:"pointer"},on:{click:function(e){t.showChoice=!0}}},[t._v("修改")])])])]),1==t.showChoice?e("div",{staticClass:"flex refund-item"},[e("div",{staticClass:"refund-label"},[t._v("选择原因:")]),e("div",{staticClass:"flex list",staticStyle:{"align-items":"center"}},[e("div",{staticClass:"flex",staticStyle:{"align-items":"center"}},[e("el-button",{attrs:{size:"medium",type:"primary"},on:{click:function(e){return e.stopPropagation(),t.changeCause(t.info,0)}}},[t._v("质量问题")]),e("el-button",{attrs:{size:"medium",type:"primary"},on:{click:function(e){return e.stopPropagation(),t.changeCause(t.info,1)}}},[t._v("多开错开")]),e("el-button",{attrs:{size:"medium",type:"primary"},on:{click:function(e){return e.stopPropagation(),t.changeCause(t.info,2)}}},[t._v("打包原因")]),e("el-button",{attrs:{size:"medium",type:"primary"},on:{click:function(e){return e.stopPropagation(),t.changeCause(t.info,3)}}},[t._v("物流原因")])],1)])]):t._e(),e("div",{staticClass:"flex refund-item"},[e("div",{staticClass:"refund-label"},[t._v("售后单号:")]),e("div",{staticClass:"flex list",staticStyle:{"align-items":"center"}},[e("div",{staticClass:"flex",staticStyle:{"align-items":"center"}},[t._v(t._s(t.info.orderSn))])])]),e("div",{staticClass:"flex refund-item"},[e("div",{staticClass:"refund-label"},[t._v("售后金额:")]),e("div",{staticClass:"list"},[t._v(" ¥"+t._s(t.refundPrice)+" "),Number(t.info.refundPackCost)>0?e("span",{staticStyle:{"margin-left":"8px","font-size":"16px"}},[t._v("(含退打包费"+t._s(t.info.refundPackCost?parseFloat(t.info.refundPackCost):0)+"元)")]):t._e(),Number(t.info.refundSendCost)>0?e("span",{staticStyle:{"margin-left":"8px","font-size":"16px"}},[t._v("(含退运费"+t._s(t.info.refundSendCost?parseFloat(t.info.refundSendCost):0)+"元)")]):t._e()])]),e("div",{staticClass:"refund-item"},[e("div",{staticClass:"refund-label",staticStyle:{color:"red","font-weight":"bold"}},[t._v("退款状态:")]),e("div",{staticClass:"list",staticStyle:{color:"red","font-weight":"bold"}},[t._v(t._s(0==t.info.status?"待审核":1==t.info.status?"已通过":2==t.info.status?"已驳回":3==t.info.status?"已取消":""))])]),e("div",{staticClass:"refund-item"},[e("div",{staticClass:"refund-label"},[t._v("操作人员:")]),e("div",{staticClass:"list"},[t._v(t._s(t.info.shopAdminName||""))])]),e("div",{staticClass:"refund-item"},[t.$util.isEmpty(t.info.rejectReason)?t._e():e("div",{staticClass:"refund-label",staticStyle:{color:"red","font-weight":"bold"}},[t._v("驳回原因:")]),e("div",{staticClass:"list",staticStyle:{color:"red","font-weight":"bold"}},[t._v(t._s(t.info.rejectReason?t.info.rejectReason:""))])]),t.$util.isEmpty(t.info.remark)?t._e():e("div",{staticClass:"refund-item"},[e("div",{staticClass:"refund-label",staticStyle:{color:"red","font-weight":"bold"}},[t._v("备注信息:")]),e("div",{staticClass:"list",staticStyle:{color:"red","font-weight":"bold"}},[t._v(t._s(t.info.remark?t.info.remark:""))])]),t.info.smallImgList&&!t.$util.isEmpty(t.info.smallImgList)?e("div",{staticClass:"refund-item"},[e("div",{staticClass:"refund-label",staticStyle:{color:"red","font-weight":"bold"}},[t._v("售后图片:")]),e("div",{staticClass:"list",staticStyle:{color:"red","font-weight":"bold"}},t._l(t.info.smallImgList,(function(t,i){return e("span",{key:i},[e("img",{staticStyle:{width:"30px",height:"30px",float:"left","margin-left":"9px","margin-bottom":"4px"},attrs:{src:t}})])})),0)]):t._e(),e("div",{staticStyle:{"margin-left":"80px","margin-top":"20px"}},[e("el-button",{staticStyle:{"margin-left":"120px"},on:{click:t.closeFn}},[t._v("关闭")]),0==t.info.status?e("el-button",{staticStyle:{"margin-left":"120px"},attrs:{type:"primary"},on:{click:function(e){return t.reject()}}},[t._v("驳回")]):t._e(),0==t.info.status?e("el-popconfirm",{staticStyle:{"margin-left":"180px"},attrs:{title:"确认通过?"},on:{confirm:function(e){return t.pass(0)},onConfirm:function(e){return t.pass(0)}}},[e("el-button",{attrs:{slot:"reference",type:"primary"},slot:"reference"},[t._v("通过")])],1):t._e()],1)])])],1)},s=[],a={name:"refund-record",props:{currentData:{type:Object,default:()=>{}}},data(){return{showArea:!1,product:"",refundPrice:0,refundType:1,remark:"",info:[],rejectReason:"",from:0,refundAmount:"",showChoice:!1}},methods:{closeTrigger(){this.$emit("searchFocus")},reject(){this.$message.error("开发中")},pass(t){this.$message.error("开发中")},changeCause(t,e){this.$service.refund.modifyCause({id:t.id,cause:e}).then(i=>{console.log(i),this.showChoice=!1,t.cause=e,that.$message.success("修改成功")})},getDetail(t){this.$service.refund.detail({id:t.id}).then(t=>{this.product=t.itemList||[],this.refundType=t.info.refundType||0,this.refundPrice=t.info.refundPrice?parseFloat(t.info.refundPrice):0,this.remark=t.info.remark,this.info=t.info})},init(){this.showArea=!0,this.info=[],this.app&&this.app.refresh({orderSn:this.currentData.orderSn})},closeFn(){this.showArea=!1},onLoad({ctx:t,app:e}){this.app=e,t.service(this.$service.refund).set("table",{columns:[{label:"日期",prop:"addTime",align:"center"},{label:"单号",prop:"orderSn",align:"center"},{label:"金额",prop:"refundPrice",align:"center"},{label:"操作",prop:"shopAdminName",align:"center"},{label:"状态",prop:"status",align:"center"}],op:{visible:!0,props:{width:160,align:"center",fixed:"right",label:"操作"},layout:["slot-column-option"]}}).set("layout",[["data-table"],["flex1","pagination"]]).set("pagination",{size:4}).done(),e.refresh({orderSn:this.currentData.orderSn})}}},n=a,o=(i("b745"),i("1805")),c=Object(o["a"])(n,r,s,!1,null,"c4ebc6c0",null);e["default"]=c.exports},"1e93":function(t,e,i){},"20e5":function(t,e,i){},"2a54":function(t,e,i){},3698:function(t,e,i){"use strict";i.r(e);var r=function(){var t=this,e=t._self._c;return e("div",{staticClass:"app-list-content"},[e("x-crud",{staticClass:"liu-crud-wrap order-list-wrap",on:{load:t.onLoad},scopedSlots:t._u([{key:"slot-tabs",fn:function(){return[e("el-tabs",{staticClass:"liu-tabs",attrs:{type:"border-card"},on:{"tab-click":t.handleClick},model:{value:t.tabIndex,callback:function(e){t.tabIndex=e},expression:"tabIndex"}},t._l(t.tabsData,(function(t,i){return e("el-tab-pane",{key:i,attrs:{label:""+t.text,name:t.key}})})),1)]},proxy:!0},{key:"table-column-sendStaffName",fn:function({scope:i}){return[""!=i.row.sendStaffName?e("span",{staticStyle:{cursor:"pointer"},on:{click:function(e){return t.changeSendStaff(i.row)}}},[t._v(t._s(i.row.sendStaffName))]):e("span",[e("i",{staticClass:"el-icon-edit",staticStyle:{color:"#409eff","font-size":"17px",cursor:"pointer"},attrs:{slot:"reference"},on:{click:function(e){return t.changeSendStaff(i.row)}},slot:"reference"})])]}},{key:"table-column-shopAdminName",fn:function({scope:i}){return[""!=i.row.shopAdminName?e("span",{staticStyle:{cursor:"pointer"},on:{click:function(e){return t.changeKdStaff(i.row)}}},[t._v(t._s(i.row.shopAdminName))]):e("span",[e("i",{staticClass:"el-icon-edit",staticStyle:{color:"#409eff","font-size":"17px",cursor:"pointer"},attrs:{slot:"reference"},on:{click:function(e){return t.changeKdStaff(i.row)}},slot:"reference"})])]}},{key:"table-column-clearSign",fn:function({scope:i}){return[0==i.row.clearSign?e("div",[e("el-popconfirm",{attrs:{title:"确认已结算?"},on:{confirm:function(e){return t.updateClearSign(i.row)},onConfirm:function(e){return t.updateClearSign(i.row)}}},[e("i",{staticClass:"el-icon-edit",staticStyle:{color:"#409eff","font-size":"17px",cursor:"pointer"},attrs:{slot:"reference"},slot:"reference"})])],1):e("div",[e("i",{staticClass:"el-icon-success",staticStyle:{color:"green","font-size":"17px"}})])]}},{key:"table-column-reCheck",fn:function({scope:i}){return[0==i.row.reCheck?e("div",[e("i",{staticClass:"el-icon-edit",staticStyle:{color:"#409eff","font-size":"17px",cursor:"pointer"},on:{click:function(e){return t.changeReCheck(i.row)}}})]):e("div",[e("i",{staticClass:"el-icon-success",staticStyle:{color:"green","font-size":"17px"}})])]}},{key:"table-column-debt",fn:function({scope:i}){return[1==i.row.debt?e("span",{staticStyle:{"font-size":"13px"}},[t._v("是")]):e("span",[t._v("-")])]}},{key:"table-column-addTime",fn:function({scope:i}){return[e("div",[t._v(" "+t._s(i.row.addTime?t.formatTime(i.row.addTime):"")+" ")])]}},{key:"table-column-payTime",fn:function({scope:i}){return[e("div",[t._v(" "+t._s(i.row.payTime&&"0000-00-00 00:00:00"!=i.row.payTime?t.formatTime(i.row.payTime):"-")+" ")])]}},{key:"table-column-printNum",fn:function({scope:i}){return[i.row.printNum>0?e("span",[t._v(" "+t._s(i.row.printNum)+" ")]):e("span",{staticStyle:{"font-size":"14px"}},[t._v(" "+t._s(i.row.printNum)+" ")])]}},{key:"table-column-customMobile",fn:function({scope:i}){return[""==i.row.customMobile?e("div",[t._v("-")]):e("div",[t._v(t._s(i.row.customMobile))])]}},{key:"table-column-sameTimeIdsNum",fn:function({scope:i}){return[i.row.sameTimeIdsNum>1?e("div",{staticStyle:{"font-size":"14px"}},[t._v(t._s(i.row.sameTimeIdsNum))]):e("div",[t._v("-")])]}},{key:"table-column-book",fn:function({scope:i}){return[1==i.row.book?e("span",{staticStyle:{"font-size":"13px"}},[t._v("是")]):e("span",[t._v("-")])]}},{key:"table-column-sendTimeWant",fn:function({scope:i}){return[1==i.row.book?e("span",{staticStyle:{"font-size":"13px"}},[t._v(t._s(i.row.sendTimeWant?i.row.sendTimeWant.substr(5,5):""))]):e("span",[t._v("-")])]}},{key:"table-column-status",fn:function({scope:i}){return[2==i.row.status?e("span",[t._v("待发货")]):3==i.row.status?e("span",[t._v("待收货")]):4==i.row.status?e("span",[t._v("已完成")]):5==i.row.status?e("span",[t._v("已取消")]):e("span",[t._v("待付款")])]}},{key:"slot-column-option",fn:function({scope:i}){return[1!=i.row.status&&5!=i.row.status?e("el-button",{attrs:{size:"small",type:"success"},on:{click:function(e){return e.stopPropagation(),t.detailShowFn(i.row)}}},[t._v("详情")]):e("el-button",{attrs:{size:"small"},on:{click:function(e){return e.stopPropagation(),t.detailShowFn(i.row)}}},[t._v("详情")]),0==i.row.book?[5!=i.row.status&&2==i.row.status?e("el-popconfirm",{staticStyle:{"margin-left":"10px","margin-right":"10px"},attrs:{title:"确认已发货?"},on:{confirm:function(e){return t.confirmSend(i.row)},onConfirm:function(e){return t.confirmSend(i.row)}}},[e("el-button",{attrs:{slot:"reference",size:"small",type:"primary"},slot:"reference"},[t._v("确认发货")])],1):e("el-button",{attrs:{size:"small"}},[t._v("确认发货")])]:[2==i.row.status?e("el-button",{attrs:{size:"small",type:"primary"},on:{click:function(e){return e.stopPropagation(),t.confirmArrival(i.row)}}},[t._v("确认发货")]):e("el-button",{attrs:{size:"small"}},[t._v("确认发货")])],4==i.row.status?[e("el-button",{attrs:{size:"small",type:"primary"},on:{click:function(e){return t.goRefund(i.row)}}},[t._v("发起售后")])]:1==i.row.status||5==i.row.status?[e("el-button",{attrs:{size:"small"}},[t._v("发起售后")])]:[0==i.row.book?[e("el-button",{attrs:{size:"small",type:"primary"},on:{click:function(e){return t.confirmReach(i.row)}}},[t._v("确认送达")])]:[e("el-button",{attrs:{size:"small"}},[t._v("发起售后")])]],1!=i.row.status&&5!=i.row.status?e("el-button",{attrs:{size:"small",type:"primary"},on:{click:function(e){return e.stopPropagation(),t.beginPrint(i.row)}}},[t._v("打票")]):e("el-button",{attrs:{size:"small"}},[t._v("打票")]),1!=i.row.status&&5!=i.row.status?e("el-button",{attrs:{size:"small",type:"primary"},on:{click:function(e){return e.stopPropagation(),t.printOrder(i.row)}}},[t._v("打A4")]):e("el-button",{attrs:{size:"small"}},[t._v("打A4")]),5!=i.row.status&&1!=i.row.status?e("el-button",{attrs:{size:"small",type:"primary"},on:{click:function(e){return e.stopPropagation(),t.down(i.row)}}},[t._v("下载")]):e("el-button",{attrs:{size:"small"}},[t._v("下载")]),5!=i.row.status&&1!=i.row.status&&i.row.sameTimeIdsNum>1?e("el-button",{attrs:{size:"small",type:"primary"},on:{click:function(e){return e.stopPropagation(),t.allDown(i.row)}}},[t._v("全下载")]):e("el-button",{attrs:{size:"small"}},[t._v("全下载")]),e("el-dropdown",{staticStyle:{"margin-left":"10px"},on:{command:function(e){return t.doMore(e,i.row)}}},[5!=i.row.status&&1!=i.row.status?e("el-button",{attrs:{type:"primary",size:"small"}},[t._v("更多"),e("i",{staticClass:"el-icon-arrow-down el-icon--right"})]):e("el-button",{attrs:{size:"small"}},[t._v("更多"),e("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),e("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[e("el-dropdown-item",{attrs:{command:"printPin"}},[t._v("打多联")]),e("el-dropdown-item",{attrs:{command:"refundShowRecord"}},[t._v("售后记录")]),e("el-dropdown-item",{attrs:{command:"downExcel"}},[t._v("下载excel")]),e("el-dropdown-item",{attrs:{command:"cancelCurrentOrder"}},[t._v("取消")])],1)],1)]}},{key:"slot-search-option",fn:function({scope:i}){return[e("el-input",{ref:"orderSearchRef",staticStyle:{width:"140px"},attrs:{placeholder:"客户名称 / 订单号",size:"mini",clearable:!0},on:{input:function(e){return t.changeSearch()},focus:function(e){t.name=""}},model:{value:t.name,callback:function(e){t.name=e},expression:"name"}}),e("el-select",{staticStyle:{width:"110px","margin-left":"8px"},attrs:{size:"mini",placeholder:"开单人",clearable:!0},on:{change:t.getKdStaff},model:{value:t.currentKdStaffName,callback:function(e){t.currentKdStaffName=e},expression:"currentKdStaffName"}},t._l(t.staffList,(function(t){return e("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1),e("span",{staticStyle:{"margin-left":"9px","font-size":"16px"}},[t._v("账单时间:")]),e("el-date-picker",{staticClass:"custom-date-picker",staticStyle:{"margin-right":"8px"},attrs:{type:"daterange",align:"right","unlink-panels":"","range-separator":"至","start-placeholder":"开始日期","value-format":"yyyy-MM-dd","end-placeholder":"结束日期","picker-options":t.pickerOptions,size:"mini"},on:{change:t.getSearchDate},model:{value:t.currentDateList,callback:function(e){t.currentDateList=e},expression:"currentDateList"}}),e("el-radio-group",{staticStyle:{"margin-right":"20px","padding-top":"6px","margin-left":"4px"},on:{change:t.changeBook},model:{value:t.book,callback:function(e){t.book=e},expression:"book"}},[e("el-radio",{attrs:{label:"-1"}},[t._v("全部")]),e("el-radio",{attrs:{label:"0"}},[t._v("常规订单")]),e("el-radio",{attrs:{label:"1"}},[t._v("预订单")])],1),e("el-radio-group",{staticStyle:{"margin-right":"15px","padding-top":"6px","margin-left":"4px"},on:{change:t.changeClearSign},model:{value:t.clearSign,callback:function(e){t.clearSign=e},expression:"clearSign"}},[e("el-radio",{attrs:{label:"-1"}},[t._v("全部")]),e("el-radio",{attrs:{label:"0"}},[t._v("待结款")]),e("el-radio",{attrs:{label:"1"}},[t._v("已结款")])],1)]}},{key:"slot-export-order",fn:function(){return[e("el-button",{staticStyle:{"margin-left":"10px"},attrs:{type:"primary",size:"mini"},on:{click:function(e){return t.exportData()}}},[t._v("导出数据")])]},proxy:!0},{key:"slot-more-do-btn",fn:function(){return[e("el-dropdown",{attrs:{size:"medium","split-button":"",type:"primary"},on:{click:t.batchDown,command:function(e){return t.bottomDoMore(e)}}},[t._v(" 批量下载 "),e("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[e("el-dropdown-item",{attrs:{command:"batchAllDown"}},[t._v("批量全下载")])],1)],1)]},proxy:!0}])}),e("select-staff",{ref:"selectStaffRef",attrs:{staffData:t.staffData},on:{getStaff:t.getStaff}}),e("arrival",{ref:"arrivalRef",attrs:{arrivalData:t.arrivalData},on:{searchFocus:t.searchFocus,addNewItem:t.addNewItem,refreshData:t.refreshData,getStockDetail:t.getStockDetail,getCostChange:t.getCostChange,openLoan:t.openLoan}}),e("simple-item",{ref:"simpleItemRef",attrs:{simpleData:t.simpleData},on:{renewArrival:t.renewArrival}}),e("order-detail",{ref:"orderDetail",attrs:{orderOperate:t.optionData},on:{getStockDetail:t.getStockDetail,searchFocus:t.searchFocus}}),e("sel-order",{ref:"selOrder",attrs:{id:t.optionData.id},on:{"song-success":t.onSongSuccess}}),e("stock-detail",{ref:"stockDetail",attrs:{itemData:t.itemData}}),e("begin-refund",{ref:"beginRefundRef",attrs:{currentRefundData:t.currentRefundData},on:{searchFocus:t.searchFocus}}),e("refund-record",{ref:"refundRecordRef",attrs:{currentData:t.refundRecordData},on:{searchFocus:t.searchFocus}}),e("cost-change",{ref:"costChangeRef",attrs:{costData:t.costData},on:{searchFocus:t.searchFocus}}),e("loan-item",{ref:"loanItemRef",attrs:{currentData:t.loanData},on:{renewArrival:t.renewArrival}}),e("div",{staticClass:"print-html-box"},[e("table",{staticStyle:{border:"solid 1px #fff","border-collapse":"collapse"},attrs:{border:"0",width:"730"}},[e("tr",[e("td",{staticStyle:{width:"340px"}},[t._v("客户:"+t._s(t.orderData.customName)+" "+t._s(t.orderData.customMobile))]),e("td",{staticStyle:{width:"200px"}},[t._v("单号:"+t._s(t.orderData.orderSn))]),e("td",{staticStyle:{width:"220px"}},[t._v("日期:"+t._s(t.orderData.deadline))])]),e("tr",[e("td",{attrs:{colspan:"3"}},[t._v("地址:"+t._s(t.orderData.fullAddress)),""!=t.orderData.showAddress?e("span",[t._v("("+t._s(t.orderData.showAddress)+")")]):t._e()])])]),e("table",{staticStyle:{border:"solid 1px black","border-collapse":"collapse"},attrs:{border:"1",width:"730"}},[t._m(0),t._l(t.orderData.product,(function(i,r){return e("tr",[e("td",{staticStyle:{width:"50px","text-align":"center"}},[t._v(t._s(r+1))]),e("td",{staticStyle:{width:"250px","text-align":"center"}},[t._v(t._s(i.name))]),e("td",{staticStyle:{width:"80px","text-align":"center"}},[t._v("扎/支")]),e("td",{staticStyle:{width:"80px","text-align":"center"}},[t._v(t._s(`${i.bigNum}/${i.smallNum}`))]),e("td",{staticStyle:{width:"80px","text-align":"center"}},[t._v(t._s(i.price))]),0==i.ratio?e("td",{staticStyle:{width:"80px","text-align":"center"}},[t._v(t._s(Number(i.price)*(Number(i.bigNum)+0)))]):e("td",{staticStyle:{width:"80px","text-align":"center"}},[t._v(t._s(Number(i.price)*(Number(i.bigNum)+Number(i.smallNum)/Number(i.ratio))))]),e("td",{staticStyle:{width:"100px","text-align":"center"}})])})),e("tr",[e("td",{staticStyle:{width:"100px"}}),e("td",{staticStyle:{width:"100px","font-weight":"bold"},attrs:{colspan:"6"}},[e("span",[t._v("合计:"+t._s(t.orderData.actPrice)),t.orderData.sendCost>0?e("span",[t._v("(运费:"+t._s(t.orderData.sendCost)+" )")]):t._e()]),e("span",{staticStyle:{"margin-left":"30px"}},[t._v("应收:"+t._s(t.orderData.realPrice))]),e("span",{staticStyle:{"margin-left":"30px"}},[t._v("实收:"+t._s(0==t.orderData.debt?t.orderData.realPrice:"0.00"))]),t.orderData.debtAmount>0?e("span",{staticStyle:{"margin-left":"30px"}},[t._v("累计欠款:"+t._s(t.orderData.debtAmount))]):t._e()])]),e("tr",[e("td",{staticStyle:{width:"100px"}},[t._v("其他说明:")]),e("td",{staticStyle:{width:"100px"},attrs:{colspan:"6"}},[t._v(t._s(t.orderData.remark))])])],2),e("table",{staticStyle:{border:"solid 1px #fff","border-collapse":"collapse"},attrs:{border:"0",width:"730"}},[e("tr",[e("td",{staticStyle:{width:"260px"},attrs:{colspan:"2"}},[t._v("开单:"+t._s(t.orderData.shopAdminName))]),e("td",{staticStyle:{width:"260px"}},[t._v("打印时间:"+t._s(t.todays(1)))])])])])],1)},s=[function(){var t=this,e=t._self._c;return e("tr",[e("td",{staticStyle:{width:"50px","text-align":"center"}},[t._v("序号")]),e("td",{staticStyle:{width:"250px","text-align":"center"}},[t._v("名称")]),e("td",{staticStyle:{width:"80px","text-align":"center"}},[t._v("单位")]),e("td",{staticStyle:{width:"80px","text-align":"center"}},[t._v("数量")]),e("td",{staticStyle:{width:"80px","text-align":"center"}},[t._v("单价")]),e("td",{staticStyle:{width:"60px","text-align":"center"}},[t._v("金额")]),e("td",{staticStyle:{width:"100px","text-align":"center"}},[t._v("备注")])])}],a=(i("f16c"),i("45d2"),i("8160"),i("9052"),i("d284")),n=i("ad3b"),o=i("f152"),c=i("01e4"),l=i("e78b"),d=i("b4a4"),u=i("9dba"),f=i("0ce5"),p=i("3b9e"),m=i("bd0a"),h=i("54a1"),b={components:{SelOrder:o["default"],OrderDetail:c["default"],arrival:l["default"],simpleItem:d["default"],beginRefund:u["default"],refundRecord:f["default"],selectStaff:a["default"],stockDetail:n["default"],costChange:p["default"],loanItem:m["default"]},data(){return{app:null,tabIndex:"0",tabsData:[{text:"全部订单",key:"0",val:0},{text:"待付款",key:"1",val:0},{text:"待发货",key:"2",val:0},{text:"待收货",key:"3",val:0},{text:"已完成",key:"4",val:0}],optionData:{},arrivalData:{},costData:{},loanData:{},simpleData:{},staffData:{title:"",changeType:"",obj:null},orderData:"",book:"-1",clearSign:"-1",currentDateList:[],pickerOptions:{shortcuts:[{text:"最近一周",onClick(t){const e=new Date,i=new Date;i.setTime(i.getTime()-6048e5),t.$emit("pick",[i,e])}},{text:"最近一个月",onClick(t){const e=new Date,i=new Date;i.setTime(i.getTime()-2592e6),t.$emit("pick",[i,e])}},{text:"最近三个月",onClick(t){const e=new Date,i=new Date;i.setTime(i.getTime()-7776e6),t.$emit("pick",[i,e])}}]},startTime:"",endTime:"",searchTime:"",name:"",currentRefundData:{},refundRecordData:{},currentKdStaffName:"",currentKdStaffId:0,staffList:[],selectedData:[],itemData:{id:0},totalActPrice:0,totalTkPrice:0}},created(){this.init()},mounted(){let t=this;document.onkeydown=function(e){if(e&&","==e.key&&e.ctrlKey){let e={};t.$router.push({path:"/order/add",query:e})}if(e&&"."==e.key&&e.ctrlKey){let e={};t.$router.push({path:"/in/add",query:e})}},this.$nextTick(()=>{this.$refs.orderSearchRef.focus()}),t.$service.shopAdmin.getAllStaff().then(e=>{t.staffList=e.list})},methods:{searchFocus(){let t=this;setTimeout(()=>{t.$refs.orderSearchRef.focus()},1e3)},getStaff(t){let e=this;if("changeSend"==this.staffData.changeType){let i=this.staffData.obj;return this.$service.order.changeSendStaff({orderId:i.id,staffId:t.id}).then(t=>{this.$message.success("修改成功"),setTimeout(()=>{e.refreshData()},1e3)}),!0}if("changeKd"==this.staffData.changeType)return this.$message.error("开发中"),!1},changeSendStaff(t){this.staffData={title:"修改送货员",changeType:"changeSend",obj:t},this.$refs.selectStaffRef.init()},changeKdStaff(t){this.staffData={title:"修改开单人",changeType:"changeKd",obj:t},this.$refs.selectStaffRef.init()},doMore(t,e){if("printPin"==t){if(1!=e.payStatus)return this.$message.error("没有付款"),!1;this.$service.order.info({id:e.id,printType:1}).then(t=>{let i=t.printData?t.printData:"",r=t.template?t.template:"",s=JSON.parse(r);var a=new h["hiprint"].PrintTemplate({template:s});a.print(i),this.$service.order.addPrintNum({id:e.id}).then(t=>{this.app.refresh({status:this.tabIndex,book:this.book,clearSign:this.clearSign,name:this.name})})})}if("cancelCurrentOrder"==t){if(1==e.book&&2==e.status)return this.$confirm("确认取消?","提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{this.$service.order.cancelBookOrder({id:e.id}).then(t=>{this.$message.success("取消成功"),this.refreshData()})}),!0;if(0==e.book&&1==e.status)return this.$confirm("确认取消?","提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(()=>{this.$service.order.cancelOrder({id:e.id}).then(t=>{this.$message.success("取消成功"),this.refreshData()})}),!0;this.$message.error("不能取消")}"refundShowRecord"==t&&(this.refundRecordData=e,setTimeout(()=>{this.$refs.refundRecordRef.init()})),"downExcel"==t&&this.$service.orderItem.getDownExcel({id:e.id}).then(t=>{t.file&&(window.location.href=t.file)})},goRefund(t){this.currentRefundData=t,setTimeout(()=>{this.$refs.beginRefundRef.init()})},renewArrival(t){this.confirmArrival(t)},getStockDetail(t){this.itemData={id:t.productId,name:t.name,direction:"rtl"},setTimeout(()=>{this.$refs.stockDetail.init()})},getCostChange(t){this.costData={id:t.productId,name:t.name,direction:"rtl"},setTimeout(()=>{this.$refs.costChangeRef.init()})},openLoan(t,e){this.$service.bookItemCustom.getInfo({orderId:e,productId:t.productId}).then(t=>{let i=t.res;this.loanData={customId:i.customId,customName:i.customName,id:i.id,itemName:i.name,itemId:i.itemId,direction:"rtl",orderId:e},setTimeout(()=>{this.$refs.loanItemRef.init()})})},addNewItem(t){this.simpleData=t,setTimeout(()=>{this.$refs.simpleItemRef.init()})},confirmArrival(t){this.arrivalData={id:t.id},setTimeout(()=>{this.$refs.arrivalRef.init()})},changeSearch(){let t=this;null!=this.T&&clearTimeout(this.T),this.T=setTimeout((function(){t.app.refresh({status:t.tabIndex,book:t.book,clearSign:t.clearSign,searchTime:t.searchTime,startTime:t.startTime,endTime:t.endTime,name:t.name,shopAdminId:this.currentKdStaffId})}),650)},confirmReach(t){let e=this;this.$confirm("确认已送达?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{this.$service.order.confirmReach({id:t.id}).then(t=>{e.$message.success("确认成功"),e.refreshData()})})},confirmSend(t){let e=this;this.$service.order.fh({id:t.id,fhType:0}).then(t=>{this.$notify({title:"操作成功",message:"",type:"success"}),e.refreshData()})},changeReCheck(t){this.$service.order.modifyReCheck({id:t.id}).then(e=>{this.$notify({title:"操作成功",message:"",type:"success"}),t.reCheck=1})},updateClearSign(t){this.$service.order.modifyClearSign({id:t.id}).then(e=>{this.$notify({title:"操作成功",message:"",type:"success"}),t.clearSign=1})},newCg(){let t={};this.$router.push({path:"/in/add",query:t})},billing(){let t={};this.$router.push({path:"/order/add",query:t})},changeClearSign(t){this.clearSign=t,this.app.refresh({status:this.tabIndex,book:this.book,clearSign:this.clearSign,name:this.name,shopAdminId:this.currentKdStaffId})},changeBook(t){this.book=t,this.app.refresh({status:this.tabIndex,book:this.book,clearSign:this.clearSign,name:this.name,shopAdminId:this.currentKdStaffId})},getSearchDate(){this.$util.isEmpty(this.currentDateList)?(this.searchTime="",this.startTime="",this.endTime=""):(this.searchTime="custom",this.startTime=this.currentDateList[0],this.endTime=this.currentDateList[1]),this.app.refresh({status:this.tabIndex,book:this.book,clearSign:this.clearSign,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,name:this.name,shopAdminId:this.currentKdStaffId})},refreshData(){this.app.refresh({status:this.tabIndex,book:this.book,clearSign:this.clearSign,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,name:this.name,shopAdminId:this.currentKdStaffId})},todays(t){var e=new Date;let i="";if(1==t)i=e.getFullYear()+"-"+parseInt(e.getMonth()+1)+"-"+e.getDate()+" "+e.getHours()+":"+e.getMinutes()+":"+e.getSeconds();else if("time"==t)i=e.getHours()+":"+e.getMinutes();else{let t=e.getDate()>9?e.getDate():"0"+e.getDate(),r=parseInt(e.getMonth()+1)>9?parseInt(e.getMonth()+1):"0"+parseInt(e.getMonth()+1);i=e.getFullYear()+"-"+r+"-"+t}return i},formatTime(t){const e=(new Date).getFullYear(),i=parseInt(t.substr(0,4));return i!==e?t.substr(0,16):t.substr(5,11)},formatProgress(){return""},init(){this.$store.dispatch("getUsage")},beginPrint(t){t.printNum&&Number(t.printNum)>0?this.$confirm("请检查是否发过货,确认补打?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{this.printBilling(t)}):this.printBilling(t)},printBilling(t){this.$service.order.cloudPrintOrder({id:t.id}).then(t=>{t.hasNoPrint&&1==t.hasNoPrint?this.$confirm("请先设置打印小票机","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{}):this.$notify({title:"已打印",message:"操作成功",type:"success"})})},printOrder(t){this.$service.order.info({id:t.id}).then(e=>{let i=e.printData?e.printData:"",r=e.template?e.template:"",s=JSON.parse(r);var a=new h["hiprint"].PrintTemplate({template:s});a.print(i),this.$service.order.addPrintNum({id:t.id}).then(t=>{this.app.refresh({status:this.tabIndex,book:this.book,clearSign:this.clearSign,name:this.name})})})},selfGetCancel(t){this.$refs["popover-"+t][1].doClose()},noSendShipFn(t){this.$refs["popover-"+t.id][1].doClose(),this.$service.order.freeShipping({id:t.id}).then(e=>{this.$message.success("操作成功!"),t.buttonList.forEach(t=>{"selfGet"==t.type&&(t.disable=1)})})},shipDrawFn(t){this.optionData=t,setTimeout(()=>{this.$refs.selOrder.init()})},batchDown(){let t=this;if(this.$util.isEmpty(this.selectedData))return this.$message.error("请选择订单"),!1;let e=0;if(this.selectedData.forEach((t,i,r)=>{1!=Number(t.status)&&5!=Number(t.status)&&e++}),0==e)return this.$message.error("没有订单需要下载"),!1;this.$confirm("共"+e+"个,确认下载?确认后请稍等30秒","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{this.selectedData.forEach((e,i,r)=>{1!=Number(e.status)&&5!=Number(e.status)&&setTimeout(()=>{t.down({id:e.id})},6e3*i)})})},getKdStaff(t){this.currentKdStaffId=t,this.refreshData()},bottomDoMore(t){if("batchAllDown"==t){let t=this;if(this.$util.isEmpty(this.selectedData))return this.$message.error("请选择订单"),!1;let e=0;if(this.selectedData.forEach((t,i,r)=>{1!=Number(t.status)&&5!=Number(t.status)&&Number(t.sameTimeIdsNum)>1&&e++}),0==e)return this.$message.error("没有订单需要下载"),!1;this.$confirm("共"+e+"个,确认下载?确认后请稍等30秒","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{this.selectedData.forEach((e,i,r)=>{1!=Number(e.status)&&5!=Number(e.status)&&Number(e.sameTimeIdsNum)>1&&setTimeout(()=>{t.allDown({id:e.id})},6e3*i)})})}},down(t){let e=this.$service.order.down(t.id,0);location.href=e},allDown(t){let e=this.$service.order.down(t.id,1);location.href=e},detailShowFn(t){this.optionData=t,setTimeout(()=>{this.$refs.orderDetail.init()})},handleClick(t,e){this.app.refresh({status:this.tabIndex,book:this.book,clearSign:this.clearSign,name:this.name})},exportData(){this.$service.order.getOrderList({status:this.tabIndex,book:this.book,clearSign:this.clearSign,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,pageSize:9999999,export:1,name:this.name,shopAdminId:this.currentKdStaffId}).then(t=>{t.file&&(window.location.href=t.file)})},onLoad({ctx:t,app:e}){this.app=e,this.$route.query.status&&(this.tabIndex=this.$route.query.status),this.$route.query.customName&&(this.name=this.$route.query.customName),this.$route.query.searchTime&&(this.searchTime=this.$route.query.searchTime),this.$route.query.startTime&&(this.startTime=this.$route.query.startTime),this.$route.query.endTime&&(this.endTime=this.$route.query.endTime),t.service(this.$service.order).set("table",{columns:[{type:"selection",align:"center",width:"40"},{prop:"orderSn",label:"单号",align:"center",width:"130"},{prop:"sendNum",label:"编号",align:"center",width:"55"},{prop:"printNum",label:"打印",align:"center",width:"50"},{prop:"customName",label:"客户",align:"center",width:"120"},{prop:"customMobile",label:"手机号",align:"center",width:"100"},{prop:"bigNum",label:"数量",align:"center",width:"50"},{prop:"debt",label:"赊账",align:"center",width:"50"},{prop:"sameTimeIdsNum",label:"多单",align:"center",width:"60"},{prop:"status",label:"状态",align:"center",width:70},{prop:"reCheck",label:"复核",align:"center",width:50},{prop:"clearSign",label:"结算",align:"center",width:50},{prop:"book",label:"预订",align:"center",width:"50"},{prop:"sendTimeWant",label:"预订发货",align:"center",width:"75"},{prop:"prePrice",label:"总价",align:"center",width:"90"},{prop:"actPrice",label:"实际",align:"center",emptyText:"无",width:"90"},{prop:"discountAmount",label:"已优惠",align:"center",emptyText:"无",width:"90"},{prop:"tkPrice",label:"已退",align:"center",width:80},{prop:"shopAdminName",label:"开单人",align:"center",width:90},{prop:"sendStaffName",label:"配送人",align:"center",width:90},{prop:"payTime",label:"账单时间",align:"center",width:90},{prop:"addTime",label:"开单时间",align:"center",width:90}],on:{"selection-change":t=>{this.selectedData=t.map(t=>({id:t.id,status:t.status,sameTimeIdsNum:t.sameTimeIdsNum}))}},props:{"default-sort":{prop:"addTime",order:"descending"}},op:{visible:!0,props:{width:630,align:"center",fixed:"right",label:"操作"},layout:["slot-column-option"]}}).set("layout",[["slot-tabs"],["slot-search-option","slot-export-order"],["data-table"],["slot-more-do-btn","flex1","pagination"]]).on("refresh",async(t,{next:e})=>{this.name=t.name?t.name:"";let i=await e(t);this.totalTkPrice=i.totalTkPrice?i.totalTkPrice:0,this.totalActPrice=i.totalActPrice?i.totalActPrice:0}).done(),e.refresh({status:this.tabIndex,book:this.book,clearSign:this.clearSign,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,name:this.name,shopAdminId:this.currentKdStaffId})},onSongSuccess(){}}},g=b,v=(i("88e2"),i("871a"),i("1805")),y=Object(v["a"])(g,r,s,!1,null,"7c2b6eca",null);e["default"]=y.exports},"3b9e":function(t,e,i){"use strict";i.r(e);var r=function(){var t=this,e=t._self._c;return e("div",[e("el-drawer",{attrs:{visible:t.showArea,size:"55vw","before-close":t.closeFn,"custom-class":"drawer-class",direction:t.direction},on:{"update:visible":function(e){t.showArea=e},close:t.closeTrigger}},[e("div",[e("div",{staticStyle:{"margin-left":"2px","font-weight":"bold"}},[e("el-date-picker",{staticStyle:{"margin-right":"10px"},attrs:{type:"daterange",align:"right","unlink-panels":"","range-separator":"至","start-placeholder":"开始日期","value-format":"yyyy-MM-dd","end-placeholder":"结束日期","picker-options":t.pickerOptions,size:"mini"},on:{change:t.getSearchDate},model:{value:t.currentDateList,callback:function(e){t.currentDateList=e},expression:"currentDateList"}}),t._v(" 【"+t._s(t.costData.name?t.costData.name:"")+"】成本变动 ")],1),e("x-crud",{on:{load:t.onLoad},scopedSlots:t._u([{key:"table-column-bigNumOrder",fn:function({scope:i}){return[t._v(" "+t._s(1==i.row.io?"+":"-")),e("span",[t._v(t._s(i.row.bigNumOrder))])]}}])})],1)])],1)},s=[],a={name:"stock-detail",props:{costData:{type:Object,default:()=>{}}},data(){return{options:[],currentDateList:[],showArea:!1,pickerOptions:{shortcuts:[{text:"最近一周",onClick(t){const e=new Date,i=new Date;i.setTime(i.getTime()-6048e5),t.$emit("pick",[i,e])}},{text:"最近一个月",onClick(t){const e=new Date,i=new Date;i.setTime(i.getTime()-2592e6),t.$emit("pick",[i,e])}},{text:"最近三个月",onClick(t){const e=new Date,i=new Date;i.setTime(i.getTime()-7776e6),t.$emit("pick",[i,e])}}]},startTime:"",endTime:"",searchTime:"",direction:"ltr"}},methods:{goRefresh(){this.app.refresh({id:this.costData.id,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime})},closeTrigger(){this.$emit("searchFocus")},getSearchDate(){this.$util.isEmpty(this.currentDateList)?this.resetSearch():(this.searchTime="custom",this.startTime=this.currentDateList[0],this.endTime=this.currentDateList[1]),this.app.refresh({id:this.costData.id,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime})},resetSearch(){this.searchTime="",this.startTime="",this.endTime=""},init(){this.showArea=!0,this.costData.direction&&!this.$util.isEmpty(this.costData.direction)&&(this.direction=this.costData.direction),this.resetSearch(),this.app&&this.goRefresh()},closeFn(){this.showArea=!1},onLoad({ctx:t,app:e}){this.app=e,t.service(this.$service.costChange).set("table",{columns:[{label:"日期",prop:"addTime",align:"center"},{label:"操作",prop:"staffName",align:"center"},{label:"事项",prop:"event",align:"center"},{label:"成本",prop:"cost",align:"center"}],op:{visible:!0,props:{width:160,align:"center",fixed:"right",label:"操作"},layout:[]}}).set("layout",[["data-table"],["flex1","pagination"]]).on("refresh",async(t,{next:e})=>{let i=await e(t);this.options=i.typeList}).done(),e.refresh({id:this.costData.id,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime})}}},n=a,o=(i("e0fe"),i("1805")),c=Object(o["a"])(n,r,s,!1,null,"604dee50",null);e["default"]=c.exports},"3dd5":function(t,e,i){"use strict";i("6b99")},"40eb":function(t,e,i){"use strict";i("f8ce")},"5d48":function(t,e,i){"use strict";i("ddca")},"5e36":function(t,e,i){"use strict";i("2a54")},"6b99":function(t,e,i){},"77b5":function(t,e,i){"use strict";i("9d77")},"871a":function(t,e,i){"use strict";i("b70a")},8744:function(t,e,i){},"88e2":function(t,e,i){"use strict";i("8744")},"90f2":function(t,e,i){"use strict";i("1e93")},"9d09":function(t,e,i){},"9d77":function(t,e,i){},"9dba":function(t,e,i){"use strict";i.r(e);var r=function(){var t=this,e=t._self._c;return e("div",[e("el-drawer",{attrs:{visible:t.showDtail,size:"750px","custom-class":"order-draw-wrap",direction:"ltr"},on:{"update:visible":function(e){t.showDtail=e},close:t.closeTrigger}},[t.$util.isEmpty(t.orderInfo)?t._e():e("div",{staticClass:"order-manage-wrap"},[e("div",[e("div",[e("div",{staticClass:"accounts-list"},[t._v(" 退款方式 "),e("div",{staticClass:"accounts-center"},[1==t.refundType?e("div",[e("el-button",{attrs:{type:"primary"},on:{click:function(e){t.refundType=1}}},[t._v("退货并退款")]),e("el-button",{staticStyle:{"margin-left":"20px"},on:{click:function(e){t.refundType=2}}},[t._v("仅退款")])],1):e("div",[e("el-button",{on:{click:function(e){t.refundType=1}}},[t._v("退货并退款")]),e("el-button",{staticStyle:{"margin-left":"20px"},attrs:{type:"primary"},on:{click:function(e){t.refundType=2}}},[t._v("仅退款")])],1)])])]),e("div",[1==t.refundType?e("div",{staticClass:"refund-item-list"},[e("div",{staticClass:"refund-label"},[t._v("选择花材")]),e("div",t._l(t.product,(function(i,r){return e("div",{key:r,staticClass:"list"},[e("div",{staticClass:"flex list-title"},[e("span",{staticClass:"product-name"},[t._v(t._s(i.name))]),e("span",{staticClass:"product-num"},[t._v(t._s(""+parseFloat(i.xhNum))+t._s(i.xhUnitName))]),e("span",{staticClass:"product-price"},[t._v(t._s(""+parseFloat(i.xhUnitPrice))+"元/"+t._s(i.xhUnitName))])]),e("div",{staticClass:"flex list-val",staticStyle:{"font-size":"18px","font-weight":"bold"}},[e("input",{directives:[{name:"model",rawName:"v-model",value:i.refundCount,expression:"res.refundCount"}],attrs:{type:"text",placeholder:"退货数","placeholder-style":"color:#CCCCCC"},domProps:{value:i.refundCount},on:{input:function(e){e.target.composing||t.$set(i,"refundCount",e.target.value)}}}),e("span",{staticStyle:{"margin-left":"10px"}},[t._v(t._s(i.xhUnitName))]),e("span",{staticStyle:{color:"green","margin-left":"20px"}},[t._v("可退"+t._s(Number(i.xhNum)-Number(i.refundNum))+t._s(i.xhUnitName))])])])})),0)]):t._e(),Number(t.orderInfo.packCost)>0||Number(t.orderInfo.sendCost)>0?e("div",{staticClass:"refund-item-list"},[e("div",{staticClass:"refund-label"},[t._v("其他可退:")]),e("div",[Number(t.orderInfo.packCost)>0?e("div",{staticClass:"list"},[e("div",{staticClass:"flex list-title"},[e("span",{staticClass:"product-name"},[t._v("打包费")]),e("span",{staticClass:"product-num"},[t._v(t._s(t.orderInfo.packCost?parseFloat(t.orderInfo.packCost):0)+"元")])]),e("div",{staticClass:"flex list-val",staticStyle:{"font-size":"17px","font-weight":"bold"}},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.orderInfo.refundPackCostAmount,expression:"orderInfo.refundPackCostAmount"}],attrs:{type:"digit",placeholder:"金额","placeholder-style":"color:#CCCCCC"},domProps:{value:t.orderInfo.refundPackCostAmount},on:{input:function(e){e.target.composing||t.$set(t.orderInfo,"refundPackCostAmount",e.target.value)}}}),e("span",{staticStyle:{"margin-left":"10px"}},[t._v("元")]),e("span",{staticStyle:{color:"green","margin-left":"20px"}},[t._v("可退"+t._s(parseFloat((Number(t.orderInfo.packCost)-Number(t.orderInfo.refundPackCost)).toFixed(2)))+"元")])])]):t._e(),Number(t.orderInfo.sendCost)>0?e("div",{staticClass:"list"},[e("div",{staticClass:"flex list-title"},[e("span",{staticClass:"product-name"},[t._v("运费")]),e("span",{staticClass:"product-num"},[t._v(t._s(t.orderInfo.sendCost?parseFloat(t.orderInfo.sendCost):0)+"元")])]),e("div",{staticClass:"flex list-val",staticStyle:{"font-size":"17px","font-weight":"bold"}},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.orderInfo.refundSendCostAmount,expression:"orderInfo.refundSendCostAmount"}],attrs:{type:"digit",placeholder:"金额","placeholder-style":"color:#CCCCCC"},domProps:{value:t.orderInfo.refundSendCostAmount},on:{input:function(e){e.target.composing||t.$set(t.orderInfo,"refundSendCostAmount",e.target.value)}}}),e("span",{staticStyle:{"margin-left":"10px"}},[t._v("元")]),e("span",{staticStyle:{color:"green","margin-left":"20px"}},[t._v("可退"+t._s(parseFloat((Number(t.orderInfo.sendCost)-Number(t.orderInfo.refundSendCost)).toFixed(2)))+"元")])])]):t._e()])]):t._e()]),e("div",[e("div",{staticClass:"accounts-list"},[t._v(" 退款原因 "),e("div",{staticClass:"accounts-center"},[e("el-button",{class:[0==t.cause?"active-button":""],attrs:{size:"small"},on:{click:function(e){t.cause=0}}},[t._v("质量问题")]),e("el-button",{class:[1==t.cause?"active-button":""],staticStyle:{"margin-left":"20px"},attrs:{size:"small"},on:{click:function(e){t.cause=1}}},[t._v("多开错开")]),e("el-button",{class:[2==t.cause?"active-button":""],staticStyle:{"margin-left":"20px"},attrs:{size:"small"},on:{click:function(e){t.cause=2}}},[t._v("打包原因")]),e("el-button",{class:[3==t.cause?"active-button":""],staticStyle:{"margin-left":"20px"},attrs:{size:"small"},on:{click:function(e){t.cause=3}}},[t._v("物流原因")])],1)])]),e("div",{staticClass:"accounts-list"},[t._v(" 订单金额 "),e("div",{staticClass:"accounts-center"},[t._v(" ¥"+t._s(t.orderInfo.orderPrice?parseFloat(t.orderInfo.orderPrice):0)+" "),Number(t.orderInfo.tkPrice)>0?e("span",{staticStyle:{"margin-left":"15px","font-size":"18px",color:"green","font-weight":"bold"}},[t._v("已退¥"+t._s(t.orderInfo.tkPrice?parseFloat(t.orderInfo.tkPrice):0))]):t._e()])]),e("div",{staticClass:"accounts-list"},[t._v(" 可退金额 "),e("div",{staticClass:"accounts-center"},[t._v("¥"+t._s(t.couldRefundPrice))])]),e("div",{staticClass:"accounts-list"},[t._v(" 预计退款 "),e("div",{staticClass:"accounts-center"},[t._v("¥"+t._s(t.refundPrice))])]),e("div",{staticClass:"accounts-list"},[t._v(" 实际退款 "),e("div",{staticClass:"accounts-center"},[e("el-input",{staticStyle:{width:"120px"},attrs:{placeholder:"输入金额"},on:{focus:function(e){t.refundMoney=""}},model:{value:t.refundMoney,callback:function(e){t.refundMoney=e},expression:"refundMoney"}})],1)]),e("div",{staticClass:"accounts-list"},[t._v(" 备注内容 "),e("div",{staticClass:"accounts-center"},[e("el-input",{attrs:{type:"textarea",rows:2,placeholder:"请输入内容"},model:{value:t.remark,callback:function(e){t.remark=e},expression:"remark"}})],1)])]),e("div",{staticStyle:{padding:"20upx 0 20upx 0","font-size":"30upx","font-weight":"bold","margin-left":"70px"}},[2==t.orderInfo.onlinePay?e("span",{staticStyle:{color:"green"}},[t._v("此单线上付款,提交后,钱会原路自动退回给客户")]):[Number(t.orderInfo.debtPrice)>0?e("span",{staticStyle:{color:"#3385ff"}},[t._v(" 此单为欠款单,提交后,欠款金额会自动减少 ")]):e("span",{staticStyle:{color:"red"}},[t._v("此单线下付款,提交后钱不会原路退回,请线下转账给客户")])]],2),e("div",{staticStyle:{"margin-left":"80px","margin-top":"20px"}},[e("el-button",{staticStyle:{"margin-left":"120px"},on:{click:t.closeOpen}},[t._v("取消")]),e("el-popconfirm",{staticStyle:{"margin-left":"180px"},attrs:{title:"确认退款?"},on:{confirm:function(e){return t.confirmRefund()},onConfirm:function(e){return t.confirmRefund()}}},[e("el-button",{attrs:{slot:"reference",type:"primary"},slot:"reference"},[t._v("确认")])],1)],1),t.$util.isEmpty(t.unClear)?t._e():e("div",{staticStyle:{"font-size":"20px","z-index":"9999",color:"red","text-align":"center","font-weight":"bold","margin-bottom":"30px"}},[e("span",[t._v("有一个待结账单 ¥"+t._s(t.unClear.actPrice?parseFloat(t.unClear.actPrice):0))])])])])],1)},s=[],a=(i("f16c"),i("45d2"),i("8160"),i("9052"),{name:"begin-refund",props:{currentRefundData:{type:Object,default:()=>{}}},data(){return{showDtail:!1,loading:!0,product:[],refundMoney:0,refundType:1,cause:0,remark:"",orderInfo:{},couldRefundPrice:0,unClear:{}}},computed:{refundPrice(){let t=0;if(this.product)for(const e of this.product)if(Number(e.refundCount)>0){let i=Number(e.refundCount)*Number(e.xhUnitPrice);i.toFixed(2),t=Number(t)+Number(i),t.toFixed(2)}return Number(this.orderInfo.refundSendCostAmount)>0&&(t=Number(this.orderInfo.refundSendCostAmount)+Number(t)),Number(this.orderInfo.refundPackCostAmount)>0&&(t=Number(this.orderInfo.refundPackCostAmount)+Number(t)),t=parseFloat(t.toFixed(2)),this.refundMoney=t,t}},methods:{closeTrigger(){this.$emit("searchFocus")},confirmRefund(){let t=!1,e=[],i=this;if(this.product.forEach(i=>{let r=i.refundCount?Number(i.refundCount):0,s=i.xhNum?Number(i.xhNum):0,a=i.refundNum?Number(i.refundNum):0,n=Number(s)-Number(a);if(Number(r)>Number(n))return this.$message.error(i.name+"超过可退数量"),t=!0,!1;Number(i.refundCount)>0&&e.push({productId:i.productId,num:i.refundCount,unitType:i.unitType,unitName:i.xhUnitName,unitType:i.xhUnitType,unitPrice:i.xhUnitPrice})}),t)return;if(this.$util.isEmpty(e)&&1==this.refundType)return void this.$message.error("请选择商品");if(Number(this.orderInfo.refundPackCostAmount)>0){let t=parseFloat((Number(this.orderInfo.packCost)-Number(this.orderInfo.refundPackCost)).toFixed(2));if(Number(this.orderInfo.refundPackCostAmount)>Number(t))return this.$message.error("打包费超出可退金额"),!1}if(Number(this.orderInfo.refundSendCostAmount)>0){let t=parseFloat((Number(this.orderInfo.sendCost)-Number(this.orderInfo.refundSendCost)).toFixed(2));if(Number(this.orderInfo.refundSendCostAmount)>Number(t))return this.$message.error("运费超出可退金额"),!1}let r={id:this.currentRefundData.id,product:JSON.stringify(e),price:this.refundMoney,remark:this.remark,refundType:this.refundType,getOriginalItem:1,cause:this.cause,refundSendCost:this.orderInfo.refundSendCostAmount,refundPackCost:this.orderInfo.refundPackCostAmount};this.$service.refund.refund(r).then(t=>{if(t.error&&"hasUnClearOrder"==t.error)return i.needCancelRemind(t.clearId),!1;i.$message.success("售后成功"),i.closeOpen()})},needCancelRemind(t){this.$message.error("有结账单取消了才能退款")},init(){this.product=[],this.refundMoney=0,this.refundType=1,this.cause=0,this.remark="",this.orderInfo={},this.couldRefundPrice=0,this.unClear={},this.showDtail=!0,this.$service.order.detail({id:this.currentRefundData.id,getOriginalItem:1}).then(t=>{this.orderInfo={...t,refundPackCostAmount:"",refundSendCostAmount:""},this.couldRefundPrice=Number(t.orderPrice)-Number(t.tkPrice),this.couldRefundPrice=this.couldRefundPrice.toFixed(2),this.couldRefundPrice=parseFloat(this.couldRefundPrice),this.product=t.product.map(t=>({...t,refundCount:null}));let e=t.customId?t.customId:0;Number(e)>0&&this.$service.clear.getUnClear({customId:e}).then(t=>{this.unClear=t.info})})},closeOpen(){this.showDtail=!1}}}),n=a,o=(i("0a8b"),i("77b5"),i("1805")),c=Object(o["a"])(n,r,s,!1,null,"4034ffb6",null);e["default"]=c.exports},aa05:function(t,e,i){},ad3b:function(t,e,i){"use strict";i.r(e);var r=function(){var t=this,e=t._self._c;return e("div",[e("el-drawer",{attrs:{visible:t.showArea,size:"55vw","before-close":t.closeFn,"custom-class":"drawer-class",direction:t.direction},on:{"update:visible":function(e){t.showArea=e},close:t.closeTrigger}},[e("div",[e("div",{staticStyle:{"margin-left":"2px","font-weight":"bold"}},[e("el-date-picker",{staticStyle:{"margin-right":"10px"},attrs:{type:"daterange",align:"right","unlink-panels":"","range-separator":"至","start-placeholder":"开始日期","value-format":"yyyy-MM-dd","end-placeholder":"结束日期","picker-options":t.pickerOptions,size:"mini"},on:{change:t.getSearchDate},model:{value:t.currentDateList,callback:function(e){t.currentDateList=e},expression:"currentDateList"}}),e("el-select",{staticStyle:{width:"150px"},attrs:{placeholder:"请选事项",size:"mini",clearable:!0},on:{change:t.changeType,clear:t.clearType},model:{value:t.typeValue,callback:function(e){t.typeValue=e},expression:"typeValue"}},t._l(t.options,(function(t){return e("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1),t._v(" 【"+t._s(t.itemData.name?t.itemData.name:"")+"】库存明细 ")],1),e("x-crud",{on:{load:t.onLoad},scopedSlots:t._u([{key:"table-column-bigNumOrder",fn:function({scope:i}){return[t._v(" "+t._s(1==i.row.io?"+":"-")),e("span",[t._v(t._s(i.row.bigNumOrder))])]}}])})],1)])],1)},s=[],a={name:"stock-detail",props:{itemData:{type:Object,default:()=>{}}},data(){return{direction:"ltr",options:[],typeValue:"",currentDateList:[],showArea:!1,pickerOptions:{shortcuts:[{text:"最近一周",onClick(t){const e=new Date,i=new Date;i.setTime(i.getTime()-6048e5),t.$emit("pick",[i,e])}},{text:"最近一个月",onClick(t){const e=new Date,i=new Date;i.setTime(i.getTime()-2592e6),t.$emit("pick",[i,e])}},{text:"最近三个月",onClick(t){const e=new Date,i=new Date;i.setTime(i.getTime()-7776e6),t.$emit("pick",[i,e])}}]},startTime:"",endTime:"",searchTime:""}},methods:{clearType(){this.typeValue="",this.refreshData()},changeType(t){this.refreshData()},refreshData(){this.app.refresh({id:this.itemData.id,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,recordType:this.typeValue})},closeTrigger(){this.$emit("searchFocus")},getSearchDate(){this.$util.isEmpty(this.currentDateList)?(this.searchTime="",this.startTime="",this.endTime=""):(this.searchTime="custom",this.startTime=this.currentDateList[0],this.endTime=this.currentDateList[1]),this.app.refresh({id:this.itemData.id,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,recordType:this.typeValue})},init(){this.$util.isEmpty(this.itemData.direction)||(this.direction=this.itemData.direction),this.showArea=!0,this.app&&this.app.refresh({id:this.itemData.id})},closeFn(){this.showArea=!1},onLoad({ctx:t,app:e}){this.app=e,t.service(this.$service.stock).set("table",{columns:[{label:"日期",prop:"addTime",align:"center"},{label:"名称",prop:"relateName",align:"center"},{label:"事项",prop:"typeName",align:"center"},{label:"变动",prop:"bigNumOrder",align:"center"},{label:"剩余",prop:"bigNumStock",align:"center"}],op:{visible:!0,props:{width:160,align:"center",fixed:"right",label:"操作"},layout:[]}}).set("layout",[["data-table"],["flex1","pagination"]]).on("refresh",async(t,{next:e})=>{let i=await e(t);this.options=i.typeList}).done(),e.refresh({id:this.itemData.id,searchTime:this.searchTime,startTime:this.startTime,endTime:this.endTime,recordType:this.typeValue})}}},n=a,o=(i("5e36"),i("1805")),c=Object(o["a"])(n,r,s,!1,null,"513f6cf1",null);e["default"]=c.exports},b4a4:function(t,e,i){"use strict";i.r(e);var r=function(){var t=this,e=t._self._c;return e("div",[e("el-drawer",{attrs:{visible:t.showArea,size:"44vw","before-close":t.closeFn,"custom-class":"drawer-class",direction:"rtl"},on:{"update:visible":function(e){t.showArea=e}}},[e("div",[e("x-crud",{on:{load:t.onLoad},scopedSlots:t._u([{key:"table-column-cover",fn:function({scope:t}){return[e("el-popover",{attrs:{placement:"right",width:"200",trigger:"hover"}},[e("div",{staticStyle:{width:"200px",height:"200px"}},[e("img",{staticStyle:{width:"100%",height:"100%","object-fit":"cover"},attrs:{src:t.row.bigCover}})]),e("div",{staticStyle:{width:"40px"},attrs:{slot:"reference"},slot:"reference"},[e("img",{staticStyle:{width:"100%",height:"100%","object-fit":"cover","border-radius":"5px"},attrs:{src:t.row.cover}})])])]}},{key:"table-column-name",fn:function({scope:i}){return[e("span",{staticStyle:{"font-size":"16px"}},[t._v(t._s(i.row.name))])]}},{key:"table-column-stock",fn:function({scope:i}){return[e("span",{staticStyle:{"font-size":"13px"}},[t._v(t._s(i.row.stock?parseFloat(i.row.stock):0))])]}},{key:"table-column-showUsePrice",fn:function({scope:i}){return[e("el-input",{attrs:{placeholder:"价格"},model:{value:i.row.showUsePrice,callback:function(e){t.$set(i.row,"showUsePrice",e)},expression:"scope.row.showUsePrice"}})]}},{key:"table-column-bigCount",fn:function({scope:i}){return[e("el-input",{attrs:{placeholder:"数量"},model:{value:i.row.bigCount,callback:function(e){t.$set(i.row,"bigCount",e)},expression:"scope.row.bigCount"}})]}},{key:"slot-column-option",fn:function({scope:i}){return[e("el-button",{attrs:{size:"medium",type:"primary"},on:{click:function(e){return e.stopPropagation(),t.confirmAdd(i.row)}}},[t._v("添加")])]}},{key:"slot-option-area-list",fn:function(){return[e("el-input",{ref:"itemSearchRef",staticStyle:{width:"200px"},attrs:{placeholder:"搜索花材",size:"big",clearable:!0},on:{input:function(e){return t.changeSearch()},focus:function(e){t.search=""}},model:{value:t.search,callback:function(e){t.search=e},expression:"search"}}),e("el-button",{staticStyle:{"margin-left":"30px"},attrs:{size:"medium",type:"primary"},on:{click:function(e){return e.stopPropagation(),t.closeFn()}}},[t._v("关闭")])]},proxy:!0}])})],1)])],1)},s=[],a={name:"simple-item",props:{simpleData:{type:Object,default:()=>{}}},data(){return{showArea:!1,search:""}},methods:{changeSearch(){let t=this;null!=this.T&&clearTimeout(this.T),this.T=setTimeout((function(){t.app.refresh({name:this.search})}),650)},init(){this.showArea=!0,this.search="",this.app&&this.app.refresh({name:this.search}),this.$nextTick(()=>{this.$refs.itemSearchRef.focus()})},closeFn(){this.showArea=!1},confirmAdd(t){if(Number(t.bigCount)<=0)return this.$message.error("请填写数量"),!1;let e=Number(t.showUsePrice)>0?t.showUsePrice:100,i=[{id:t.id,bigCount:t.bigCount,price:e}];this.$service.orderItem.addItem({data:JSON.stringify(i),id:this.simpleData.id}).then(t=>{this.$message.success("添加成功"),this.$emit("renewArrival",this.simpleData)})},onLoad({ctx:t,app:e}){this.app=e;let i=()=>this.$service.item.simpleList({name:this.search});t.service({page:i}).set("table",{columns:[{label:"ID",prop:"id",align:"center",width:70},{label:"图片",prop:"cover",align:"center",width:65},{label:"名称",prop:"name",align:"center",width:200},{label:"库存",prop:"stock",align:"center",width:90},{label:"价格",prop:"showUsePrice",align:"center",width:100},{label:"数量",prop:"bigCount",align:"center",width:100}],op:{visible:!0,props:{width:130,align:"center",fixed:"right",label:"操作"},layout:["slot-column-option"]}}).set("layout",[["slot-option-area-list"],["data-table"],["flex1"]]).done(),e.refresh({name:this.search})}}},n=a,o=(i("3dd5"),i("1805")),c=Object(o["a"])(n,r,s,!1,null,"5e6f1863",null);e["default"]=c.exports},b70a:function(t,e,i){},b745:function(t,e,i){"use strict";i("20e5")},bd0a:function(t,e,i){"use strict";i.r(e);var r=function(){var t=this,e=t._self._c;return e("div",[e("el-drawer",{attrs:{visible:t.showArea,size:"44vw","before-close":t.closeFn,"custom-class":"drawer-class",direction:t.direction},on:{"update:visible":function(e){t.showArea=e}}},[e("div",[e("x-crud",{on:{load:t.onLoad},scopedSlots:t._u([{key:"table-column-cover",fn:function({scope:t}){return[e("el-popover",{attrs:{placement:"right",width:"200",trigger:"hover"}},[e("div",{staticStyle:{width:"200px",height:"200px"}},[e("img",{staticStyle:{width:"100%",height:"100%","object-fit":"cover"},attrs:{src:t.row.bigCover}})]),e("div",{staticStyle:{width:"40px"},attrs:{slot:"reference"},slot:"reference"},[e("img",{staticStyle:{width:"100%",height:"100%","object-fit":"cover","border-radius":"5px"},attrs:{src:t.row.cover}})])])]}},{key:"table-column-name",fn:function({scope:i}){return[e("span",{staticStyle:{"font-size":"16px"}},[t._v(t._s(i.row.name))])]}},{key:"table-column-stock",fn:function({scope:i}){return[e("span",{staticStyle:{"font-size":"13px"}},[t._v(t._s(i.row.stock?parseFloat(i.row.stock):0))])]}},{key:"table-column-bigCount",fn:function({scope:i}){return[e("el-input",{attrs:{placeholder:"数量"},model:{value:i.row.bigCount,callback:function(e){t.$set(i.row,"bigCount",e)},expression:"scope.row.bigCount"}})]}},{key:"slot-column-option",fn:function({scope:i}){return[e("el-button",{attrs:{size:"medium",type:"primary"},on:{click:function(e){return e.stopPropagation(),t.confirmLoan(i.row)}}},[t._v("借用")])]}},{key:"slot-option-area-list",fn:function(){return[e("el-input",{ref:"itemSearchRef",staticStyle:{width:"200px"},attrs:{placeholder:"搜索花材",size:"big",clearable:!0},on:{input:function(e){return t.changeSearch()},focus:function(e){t.search=""}},model:{value:t.search,callback:function(e){t.search=e},expression:"search"}}),e("span",{staticStyle:{"margin-left":"10px","font-size":"27px"}},[t._v("【"+t._s(t.currentData.customName?t.currentData.customName:"")+"】"+t._s(t.currentData.itemName?t.currentData.itemName:"")+" 借库存")])]},proxy:!0}])})],1)])],1)},s=[],a={name:"loan-item",props:{currentData:{type:Object,default:()=>{}}},data(){return{showArea:!1,search:"",direction:"ltr"}},methods:{changeSearch(){let t=this;null!=this.T&&clearTimeout(this.T),this.T=setTimeout((function(){t.app.refresh({name:this.search})}),650)},init(){this.currentData.direction&&!this.$util.isEmpty(this.currentData.direction)&&(this.direction=this.currentData.direction),this.showArea=!0,this.search="",this.app&&this.app.refresh({name:this.search}),this.$nextTick(()=>{this.$refs.itemSearchRef.focus()})},closeFn(){this.showArea=!1},confirmLoan(t){let e=this;if(Number(t.bigCount)<=0)return this.$message.error("请填写数量"),!1;let i={inId:this.currentData.itemId,outId:t.id,num:t.bigCount,bookItemCustomId:this.currentData.id};this.$confirm("确认借用?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{this.$service.checkOrder.loan(i).then(t=>{e.$message.success("借用成功"),this.currentData.orderId&&Number(this.currentData.orderId)>0?e.$emit("renewArrival",{id:this.currentData.orderId}):e.$emit("refreshData"),this.showArea=!1})})},onLoad({ctx:t,app:e}){this.app=e;let i=()=>this.$service.item.getLoanList({name:this.search});t.service({page:i}).set("table",{columns:[{label:"ID",prop:"id",align:"center",width:80},{label:"图片",prop:"cover",align:"center",width:65},{label:"名称",prop:"name",align:"center",width:300},{label:"可借",prop:"stock",align:"center",width:100},{label:"要借",prop:"bigCount",align:"center",width:130}],op:{visible:!0,props:{width:130,align:"center",fixed:"right",label:"操作"},layout:["slot-column-option"]}}).set("layout",[["slot-option-area-list"],["data-table"],["flex1"]]).done(),e.refresh({name:this.search})}}},n=a,o=(i("5d48"),i("1805")),c=Object(o["a"])(n,r,s,!1,null,"68b775af",null);e["default"]=c.exports},d284:function(t,e,i){"use strict";i.r(e);var r=function(){var t=this,e=t._self._c;return e("el-dialog",{attrs:{title:t.title,visible:t.showDtail,top:"1vh",width:"40%"},on:{"update:visible":function(e){t.showDtail=e}}},[e("el-table",{attrs:{data:t.staffList}},[e("el-table-column",{attrs:{property:"id",label:"ID",width:"120",align:"center"}}),e("el-table-column",{attrs:{property:"name",label:"姓名",width:"190",align:"center"}}),e("el-table-column",{attrs:{property:"mobile",label:"手机号",width:"130",align:"center"}}),e("el-table-column",{attrs:{prop:"cover",label:"操作",align:"center"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.getStaff(i.row)}}},[t._v("选择")])]}}])})],1),e("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.showDtail=!1}}},[t._v("关 闭")])],1)],1)},s=[],a={name:"select-staff",props:{staffData:{type:Object,default:()=>{}}},data(){return{showDtail:!1,staffList:[],title:"请选择"}},computed:{},methods:{init(){this.staffData.title&&(this.title=this.staffData.title),this.staffList=[],this.showDtail=!0,this.$service.shopAdmin.getAllStaff().then(t=>{this.staffList=t.list})},closeFn(){this.showDtail=!1},getStaff(t){this.$emit("getStaff",t),this.closeFn()}}},n=a,o=i("1805"),c=Object(o["a"])(n,r,s,!1,null,null,null);e["default"]=c.exports},d8ae:function(t,e,i){"use strict";i("9d09")},da50:function(t,e,i){"use strict";i("029d")},db83:function(t,e,i){},ddca:function(t,e,i){},e0fe:function(t,e,i){"use strict";i("aa05")},e78b:function(t,e,i){"use strict";i.r(e);var r=function(){var t=this,e=t._self._c;return e("div",{staticClass:"order-detail"},[e("el-drawer",{attrs:{visible:t.showDtail,size:"1100px","before-close":t.closeFn,"custom-class":"order-draw-wrap",direction:"ltr"},on:{"update:visible":function(e){t.showDtail=e},close:t.closeTrigger}},[t.$util.isEmpty(t.detailInfo)?e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{height:"800px"}}):e("div",{staticClass:"order-manage-wrap"},[e("div",{staticClass:"card-wrap"},[e("div",{staticClass:"card-tit"},[t._v(" 花材信息 (按 Esc 关闭窗口) "),e("el-button",{staticStyle:{"margin-left":"399px"},on:{click:function(e){return t.usePrice(t.detailInfo,0)}}},[t._v("使用填单价")]),e("el-button",{staticStyle:{"margin-left":"30px"},on:{click:function(e){return t.usePrice(t.detailInfo,1)}}},[t._v("使用自带价")]),e("el-button",{staticStyle:{"margin-left":"30px"},attrs:{type:"primary"},on:{click:function(e){return t.addItme()}}},[t._v("添加花材")])],1),e("div",{staticClass:"card-body"},[e("el-table",{attrs:{data:t.detailInfo.product}},[e("el-table-column",{attrs:{label:"图片"},scopedSlots:t._u([{key:"default",fn:function(t){return[e("el-popover",{attrs:{placement:"right",width:"200",trigger:"hover"}},[e("div",{staticStyle:{width:"200px",height:"200px"}},[e("img",{staticStyle:{width:"100%",height:"100%","object-fit":"cover"},attrs:{src:t.row.bigCover}})]),e("div",{staticStyle:{width:"30px"},attrs:{slot:"reference"},slot:"reference"},[e("img",{staticStyle:{width:"100%",height:"100%","object-fit":"cover","border-radius":"5px"},attrs:{src:t.row.cover}})])])]}}],null,!1,1714386569)}),e("el-table-column",{attrs:{property:"name",label:"名称"}}),e("el-table-column",{attrs:{label:"成本"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",{staticStyle:{cursor:"pointer"},on:{click:function(e){return t.getCostChange(i.row)}}},[e("i",{staticClass:"el-icon-s-order",staticStyle:{color:"#409eff","font-size":"17px",cursor:"pointer"},attrs:{slot:"reference"},slot:"reference"}),t._v(" "+t._s(i.row.cost?parseFloat(i.row.cost):0)+" ")])]}}],null,!1,1703928452)}),e("el-table-column",{attrs:{label:"剩余"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",{staticStyle:{cursor:"pointer"},on:{click:function(e){return t.getStockDetail(i.row)}}},[e("i",{staticClass:"el-icon-s-order",staticStyle:{color:"#409eff","font-size":"17px"},attrs:{slot:"reference"},slot:"reference"}),t._v(" "+t._s(i.row.stock?parseFloat(i.row.stock):0)+" ")])]}}],null,!1,2659607935)}),e("el-table-column",{attrs:{label:"单价"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-input",{class:[Number(i.row.cost)>Number(i.row.currentHdPrice)?"cost-blue":""],staticStyle:{width:"50px","margin-right":"2px"},attrs:{placeholder:"数量"},on:{focus:function(t){i.row.currentHdPrice=""}},model:{value:i.row.currentHdPrice,callback:function(e){t.$set(i.row,"currentHdPrice",e)},expression:"scope.row.currentHdPrice"}}),t._v("元 ")]}}],null,!1,1557681376)}),e("el-table-column",{attrs:{label:"数量"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-input",{class:[Number(i.row.xhNum)>Number(i.row.stock)?"stock-red":""],staticStyle:{width:"50px"},attrs:{placeholder:"数量"},on:{focus:function(t){i.row.xhNum=""}},model:{value:i.row.xhNum,callback:function(e){t.$set(i.row,"xhNum",e)},expression:"scope.row.xhNum"}})]}}],null,!1,2985177083)}),e("el-table-column",{attrs:{label:"备注"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",{staticStyle:{cursor:"pointer"},on:{click:function(e){return t.modifyItemRemark(i.row)}}},[e("i",{staticClass:"el-icon-edit",staticStyle:{color:"#409eff","font-size":"17px",cursor:"pointer"},attrs:{slot:"reference"},slot:"reference"}),t._v(t._s(i.row.remark))])]}}],null,!1,997837959)}),e("el-table-column",{attrs:{label:"操作",width:"200"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("el-popconfirm",{attrs:{title:"确认删除?"},on:{confirm:function(e){return t.confirmDel(i.row)},onConfirm:function(e){return t.confirmDel(i.row)}}},[e("el-button",{attrs:{slot:"reference",size:"small",type:"primary"},slot:"reference"},[t._v("删除")])],1),e("el-button",{staticStyle:{"margin-left":"20px"},attrs:{size:"small",type:"primary"},on:{click:function(e){return t.openLoan(i.row)}}},[t._v("借库存")])]}}],null,!1,3591088100)})],1)],1)]),e("div",[e("div",{staticClass:"accounts-list"},[t._v(" 客户名称 "),e("div",{staticClass:"accounts-center",staticStyle:{"font-weight":"bold",color:"black"}},[t._v(t._s(t.detailInfo.customName||""))])]),e("div",{staticClass:"accounts-list"},[t._v(" 商品金额 "),e("div",{staticClass:"accounts-center",staticStyle:{"font-weight":"bold",color:"black"}},[t._v("¥"+t._s(t.itemPrice))])]),e("div",{staticClass:"accounts-list"},[t._v(" 总计 "),e("div",{staticClass:"accounts-center",staticStyle:{"font-weight":"bold",color:"black"}},[t._v("¥"+t._s(t.allPrice))])]),e("div",{staticClass:"accounts-list"},[t._v(" 预付金额 "),e("div",{staticClass:"accounts-center",staticStyle:{"font-weight":"bold",color:"black"}},[t._v("¥"+t._s(t.detailInfo.bookPrice?parseFloat(t.detailInfo.bookPrice):0))])]),e("div",{staticClass:"accounts-list"},[t._v(" 结账 "),t.settlePrice>0?e("div",{staticClass:"accounts-center",staticStyle:{"font-weight":"bold",color:"green"}},[t._v("退 ¥"+t._s(t.settlePrice)+",确认后自动退款")]):t.settlePrice<0?e("div",{staticClass:"accounts-center",staticStyle:{"font-weight":"bold",color:"red"}},[t._v("欠 ¥"+t._s(Math.abs(t.settlePrice))+",确认后变成欠款单")]):e("div",{staticClass:"accounts-center",staticStyle:{"font-weight":"bold",color:"black"}},[t._v("0")])]),e("div",{staticClass:"accounts-list"},[t._v(" 允许低于成本 "),e("div",{staticClass:"accounts-center"},[e("el-switch",{attrs:{"active-value":"1","inactive-value":"0"},model:{value:t.lessCostCould,callback:function(e){t.lessCostCould=e},expression:"lessCostCould"}})],1)])]),e("div",{staticStyle:{"margin-left":"80px","margin-top":"20px"}},[e("el-button",{on:{click:t.closeFn}},[t._v("取消")]),e("el-popconfirm",{staticStyle:{"margin-left":"320px"},attrs:{title:"确认保存?"},on:{confirm:function(e){return t.savePrice()},onConfirm:function(e){return t.savePrice()}}},[e("el-button",{attrs:{slot:"reference"},slot:"reference"},[t._v("保存修改")])],1),e("el-popconfirm",{staticStyle:{"margin-left":"320px"},attrs:{title:"确认要提交?"},on:{confirm:function(e){return t.commitItem()},onConfirm:function(e){return t.commitItem()}}},[e("el-button",{attrs:{slot:"reference",type:"primary"},slot:"reference"},[t._v("确认提交")])],1)],1)])])],1)},s=[],a=(i("45d2"),i("8160"),i("9052"),{name:"arrival",props:{arrivalData:{type:Object,default:()=>{}}},data(){return{showDtail:!1,detailInfo:{},loading:!0,itemPrice:0,settlePrice:0,sendCost:0,packCost:0,addSelectItem:1,lessCostCould:0}},computed:{allPrice(){let t=0;if(this.itemPrice=0,this.totalWeight=0,this.detailInfo&&this.detailInfo.product)for(const e of this.detailInfo.product)if(e.currentHdPrice){let t=Number(e.xhNum)*Number(e.currentHdPrice);t=t.toFixed(2),this.itemPrice=Number(this.itemPrice)+Number(t),this.itemPrice.toFixed(2)}return this.itemPrice=parseFloat(this.itemPrice.toFixed(2)),t=Number(this.itemPrice),Number(this.sendCost)>0&&(t+=Number(this.sendCost)),Number(this.packCost)>0&&(t+=Number(this.packCost)),t=parseFloat(t.toFixed(2)),this.settlePrice=Number(this.detailInfo.bookPrice)-Number(t),this.settlePrice=parseFloat(this.settlePrice.toFixed(2)),t}},methods:{modifyItemRemark(t){this.$prompt("请输入备注","提示",{confirmButtonText:"确定",cancelButtonText:"取消",inputPattern:/\S/,inputErrorMessage:"请写备注",inputValue:t.remark}).then(({value:e})=>{this.$service.orderItem.updateItemRemark({remark:e,id:t.id}).then(i=>{t.remark=e,this.$message.success("修改成功")})})},closeTrigger(){this.$emit("searchFocus")},getCostChange(t){this.$emit("getCostChange",t)},getStockDetail(t){this.$emit("getStockDetail",t)},usePrice(t,e){t.product&&!this.$util.isEmpty(t.product)&&(t.product.forEach((t,i,r)=>{t.currentHdPrice=0==e?t.itemModifyPrice:t.itemSalePrice}),this.$forceUpdate())},commitItem(){let t=[],e=!1,i=this,r=!1;if(this.detailInfo&&this.detailInfo.product)for(const s of this.detailInfo.product){if(s.currentHdPrice.length<=0){this.$message.error("请填写价格,价格要大于0"),e=!0;break}if(this.$util.isEmpty(s.xhNum)||Number(s.xhNum)<0){this.$message.error("请填写到货数,没有填0"),e=!0;break}let i=s.xhNum?Number(s.xhNum):0,a=s.currentHdPrice?Number(s.currentHdPrice):0,n=s.productId||0;t=[...t,{productId:n,price:a,num:i}],Number(s.cost)>Number(s.currentHdPrice)&&(r=!0)}return 1==r&&0==this.lessCostCould?(this.$message.error("有花材低于成本销售,请允许"),!1):1!=e&&void this.$service.order.arrival({id:i.arrivalData.id,product:JSON.stringify(t),packCost:i.packCost,sendCost:i.sendCost}).then(t=>{this.$message.success("提交成功"),this.closeFn(),this.$emit("refreshData")})},savePrice(){if(this.$util.isEmpty(this.detailInfo.product))return this.$message.error("没有花材信息"),!1;const t=this.detailInfo.product.map(t=>({orderSn:t.orderSn,xhNum:t.xhNum,xhUnitPrice:t.currentHdPrice,id:t.id}));this.$service.orderItem.modifyBookItem({data:t,id:this.detailInfo.id,packCost:this.packCost,sendCost:this.sendCost}).then(t=>{this.$message.success("修改成功")})},confirmDel(t){this.$service.orderItem.delItem({id:this.arrivalData.id,smallId:t.id}).then(t=>{this.$message.success("删除成功"),this.init()})},openLoan(t){this.$emit("openLoan",t,this.arrivalData.id)},addItme(){this.$emit("addNewItem",this.arrivalData)},init(){this.detailInfo=[],this.showDtail=!0,this.$service.order.arrivalDetail({id:this.arrivalData.id}).then(t=>{this.detailInfo=t})},closeFn(){this.showDtail=!1}}}),n=a,o=(i("40eb"),i("da50"),i("1805")),c=Object(o["a"])(n,r,s,!1,null,"0f2e9204",null);e["default"]=c.exports},f8ce:function(t,e,i){}}]);