1 |
- webpackJsonp([3],{PQP8:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r("Xxa5"),o=r.n(n),i=r("exGp"),a=r.n(i),d=r("Dd8w"),s=r.n(d),u=r("NYxO"),l=r("hky6"),c=r("dClm"),m=r("bcP3"),p=r("jQQ7"),f=r("Pfph"),_={name:"orderReturnAdd",data:function(){return{adminList:[],fileList:[],deptList:[],id:"",warehouseList:[],goodsList:[],orderReturnAddForm:{order_id:"",item_list:[]},type:""}},computed:s()({},Object(u.b)(["user"])),mounted:function(){this.GET_DeptList(),this.GET_AdministratorList()},watch:{$route:{immediate:!0,handler:function(e){"orderReturnAudit"===this.$route.name?this.type="audit":"orderReturnAdd"===this.$route.name?(this.orderReturnAddForm={item_list:[]},this.GET_WarehouseList({dept_id:this.user.dept_id}),this.type="add"):"orderReturnDetail"===this.$route.name&&(this.type="detail"),this.$route.params.id&&(this.id=this.$route.params.id,this.orderReturnAddForm.id=this.$route.params.id,this.GET_orderReturnDetail())}}},methods:{passInput:function(e){e.num<e.return_num&&this.$message({message:"请重新输入退货数量",type:"error",showClose:!0})},GET_AdministratorList:function(){var e=this;f.h({page_no:1,page_size:9999,user_state:0}).then(function(t){e.adminList=t.data})},handleSelectOrderSn:function(){var e=this;return a()(o.a.mark(function t(){var r;return o.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$EnPickerOrder({orderApi:"/admin/erp/order",selectedIds:[e.orderReturnAddForm.order_sn],limit:1});case 2:r=t.sent,e.orderReturnAddForm.order_id=r[0].id,r&&m.f(r[0].id).then(function(t){e.orderReturnAddForm.sn=t.sn,e.orderReturnAddForm.item_list=t.item_list});case 5:case"end":return t.stop()}},t,e)}))()},changewarehouseList:function(e){this.$set(this.orderReturnAddForm,"warehouse_id",""),this.GET_WarehouseList({dept_id:e})},GET_WarehouseList:function(e){var t=this;c.D(e).then(function(e){t.warehouseList=e})},auditorderReturnForm:function(e){var t=this;this.$confirm("确定吗?","提示",{type:"warning"}).then(function(){m.b(t.id,{status:e}).then(function(e){t.$message.success("审核完成");var r=t.$route.params.callback;"function"==typeof r&&r(),t.$store.dispatch("delCurrentViews",{view:t.$route,$router:t.$router}),t.$router.push({name:"orderReturn"})})}).catch(function(){})},roBack:function(){var e=this.$route.params.callback;"function"==typeof e&&e(),this.$store.dispatch("delCurrentViews",{view:this.$route,$router:this.$router}),this.$router.push({name:"orderReturn"})},submitorderReturnAddForm:function(){var e=this,t=this.orderReturnAddForm.id,r=this.MixinClone(this.orderReturnAddForm),n={};r.order_sn=r.sn,r.item_list=r.item_list.map(function(e){return n.order_item_id=e.id,n.order_num=e.num,n.product_id=e.product_id,n.return_num=e.return_num,n}),t?m.e(t,r).then(function(t){e.$message.success("修改成功!");var r=e.$route.params.callback;"function"==typeof r&&r(),e.$store.dispatch("delCurrentViews",{view:e.$route,$router:e.$router}),e.$router.push({name:"orderReturn"})}):m.a(r).then(function(){e.$message.success("添加成功!");var t=e.$route.params.callback;"function"==typeof t&&t(),e.$store.dispatch("delCurrentViews",{view:e.$route,$router:e.$router}),e.$router.push({name:"orderReturn"})})},GET_DeptList:function(){var e=this;l.o().then(function(t){e.deptList=p.Foundation.buildTree(t,"0")})},GET_orderReturnDetail:function(){var e=this;m.g(this.id).then(function(t){e.orderReturnAddForm=t,e.GET_WarehouseList({dept_id:t.dept_id})})}}},h=r("XyMi");var v=function(e){r("WCOg")},b=Object(h.a)(_,function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"bg-in-stock"},[r("el-form",{ref:"orderReturnAddForm",staticStyle:{width:"100%"},attrs:{model:e.orderReturnAddForm,"label-width":"120px",inline:""}},[r("h3",[e._v("退货单")]),e._v(" "),r("el-form-item",{attrs:{label:"退货时间",prop:"return_time"}},[r("el-date-picker",{attrs:{"value-format":"yyyy-MM-dd HH:mm:ss",type:"datetime",placeholder:"选择日期时间"},model:{value:e.orderReturnAddForm.return_time,callback:function(t){e.$set(e.orderReturnAddForm,"return_time",t)},expression:"orderReturnAddForm.return_time"}})],1),e._v(" "),r("el-form-item",{staticStyle:{"white-space":"nowrap"},attrs:{label:"订单"}},["detail"!==e.type?r("el-button",{staticClass:"button",attrs:{size:"mini",type:"primary",disabled:"audit"===e.type},on:{click:e.handleSelectOrderSn}},[e._v("选择")]):e._e(),e._v(" "),e.orderReturnAddForm.sn?r("span",[e._v(e._s(e.orderReturnAddForm.sn))]):e._e()],1),e._v(" "),r("el-form-item"),e._v(" "),r("el-form-item",{staticStyle:{width:"900px"},attrs:{label:"退货说明",prop:"return_remark"}},[r("el-input",{staticStyle:{width:"525px"},attrs:{type:"textarea",disabled:"detail"===e.type||"audit"===e.type,autosize:{minRows:3,maxRows:4},placeholder:"请输入退货说明"},model:{value:e.orderReturnAddForm.return_remark,callback:function(t){e.$set(e.orderReturnAddForm,"return_remark",t)},expression:"orderReturnAddForm.return_remark"}})],1),e._v(" "),r("div",{staticClass:"mx"},[r("h3",[e._v("退货明细")])]),e._v(" "),r("div",[r("el-form-item",{staticStyle:{width:"100%"}},[r("el-table",{staticStyle:{width:"100%","margin-top":"20px"},attrs:{data:e.orderReturnAddForm.item_list,border:"","cell-style":{textAlign:"center"},"header-cell-style":{textAlign:"center"}}},[r("el-table-column",{attrs:{label:"商品编号"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.goods_vo.sn)+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"商品名称"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.goods_vo.name)+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"规格型号"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.product_vo.spec_name.join("/"))+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"单位"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.product_vo.unit)+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"单价"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n ¥"+e._s(t.row.product_vo.price)+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"购买数量"},scopedSlots:e._u([{key:"default",fn:function(t){return[e.id?r("span",[e._v(e._s(t.row.order_num))]):r("span",[e._v(e._s(t.row.num))])]}}])}),e._v(" "),r("el-table-column",{attrs:{label:"退货数量"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("el-input",{attrs:{maxlength:"12",disabled:"detail"===e.type||"audit"===e.type},on:{input:function(r){return e.passInput(t.row)}},model:{value:t.row.return_num,callback:function(r){e.$set(t.row,"return_num",r)},expression:"scope.row.return_num"}})]}}])})],1)],1)],1)],1),e._v(" "),r("div",{staticClass:"footer"},["audit"!==e.type&&"detail"!==e.type?r("el-button",{attrs:{type:"primary"},on:{click:e.submitorderReturnAddForm}},[e._v("保存\n ")]):e._e(),e._v(" "),r("el-button",{on:{click:function(t){return e.roBack()}}},[e._v("返回\n ")])],1)],1)},[],!1,v,"data-v-38c71888",null);t.default=b.exports},WCOg:function(e,t,r){var n=r("zj2z");"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);r("rjj0")("65107d71",n,!0)},bcP3:function(e,t,r){"use strict";t.f=function(e){return Object(n.a)({url:"/admin/erp/order/"+e,method:"get",loading:!1})},t.b=function(e,t){return Object(n.a)({url:"admin/erp/orderReturn/"+e+"/audit",method:"post",data:t})},t.g=function(e){return Object(n.a)({url:"admin/erp/orderReturn/"+e,method:"get",loaidng:!1})},t.h=function(e){return Object(n.a)({url:"admin/erp/orderReturn",method:"get",loaidng:!1,params:e})},t.a=function(e){return Object(n.a)({url:"admin/erp/orderReturn",method:"post",headers:{"Content-Type":"application/json"},data:e})},t.e=function(e,t){return Object(n.a)({url:"admin/erp/orderReturn/"+e,method:"put",headers:{"Content-Type":"application/json"},data:t})},t.d=function(e){return Object(n.a)({url:"admin/erp/orderReturn/"+e,method:"delete"})},t.c=function(e,t){return Object(n.a)({url:"/admin/erp/orderReturn/cancel/"+e+"/"+t,method:"post",headers:{"Content-Type":"application/json"}})};var n=r("vLgD")},zj2z:function(e,t,r){(e.exports=r("FZ+f")(!1)).push([e.i,'\n@charset "UTF-8";\n/** 底部步骤 */\n.footer[data-v-38c71888] {\n width: 100%;\n padding: 10px;\n bottom: 0px;\n text-align: center;\n z-index: 999;\n}\n.mx[data-v-38c71888] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.mx .button[data-v-38c71888] {\n margin-left: 10px;\n}\n.bg-in-stock[data-v-38c71888] {\n background-color: #fff;\n margin: 10px;\n padding: 25px;\n}\n.goods-info[data-v-38c71888] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.goods-info .goods-name-box[data-v-38c71888] {\n text-align: left;\n}\n.goods-info .goods-name-box .goods-name[data-v-38c71888] {\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n line-height: 16px;\n}\n.goods-info .goods-name-box .specs[data-v-38c71888] {\n color: #999999;\n}\n[data-v-38c71888] .el-input--suffix .el-input__inner {\n padding-right: 10px;\n}\n[data-v-38c71888] .error-input .el-input__inner {\n border: 1px solid red;\n}\n[data-v-38c71888] .el-form-item {\n width: 100%;\n}\n[data-v-38c71888] .el-form-item .el-form-item__content {\n width: 80%;\n}\n',""])}});
|