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