1.beaa45a7704f244b226b.js 18 KB

1
  1. webpackJsonp([1],{EXu4:function(e,t,o){var n=o("P3Eh");"string"==typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);o("rjj0")("5450bcf3",n,!1)},P3Eh:function(e,t,o){(e.exports=o("FZ+f")(!1)).push([e.i,'\n@charset "UTF-8";\n/** 底部步骤 */\n.footer[data-v-9cc088c2] {\n width: 100%;\n padding: 10px;\n bottom: 0px;\n text-align: center;\n z-index: 999;\n}\n.mx[data-v-9cc088c2] {\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 width: 100%;\n}\n.mx .button[data-v-9cc088c2] {\n margin-left: 10px;\n}\n.change-form[data-v-9cc088c2] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: start;\n -ms-flex-pack: start;\n justify-content: flex-start;\n -webkit-box-align: start;\n -ms-flex-align: start;\n align-items: flex-start;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n min-width: 900px;\n}\n.change-form .change-form-item[data-v-9cc088c2] {\n width: 30%;\n margin: 0 10px 20px 0;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n -ms-flex-wrap: nowrap;\n flex-wrap: nowrap;\n}\n.change-form[data-v-9cc088c2] .el-form-item__content {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n width: 100%;\n}\n.change-form[data-v-9cc088c2] .el-date-editor,\n .change-form[data-v-9cc088c2] .el-cascader,\n .change-form[data-v-9cc088c2] .el-select {\n width: 100%;\n}\n.bg-in-stock[data-v-9cc088c2] {\n background-color: #fff;\n margin: 10px;\n padding: 25px;\n}\n.goods-info[data-v-9cc088c2] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.goods-info .goods-name-box[data-v-9cc088c2] {\n text-align: left;\n}\n.goods-info .goods-name-box .goods-name[data-v-9cc088c2] {\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-9cc088c2] {\n color: #999999;\n}\n[data-v-9cc088c2] .el-input--suffix .el-input__inner {\n padding-right: 10px;\n}\n[data-v-9cc088c2] .error-input .el-input__inner {\n border: 1px solid red;\n}\n',""])},PSeb:function(e,t,o){"use strict";t.i=function(e){return Object(n.a)({url:"admin/stock/inventory/confirm/"+e,method:"post"})},t.e=function(e,t){return Object(n.a)({url:"admin/stock/inventory/"+e,method:"post",headers:{"Content-Type":"application/json"},data:t})},t.a=function(e){return Object(n.a)({url:"admin/stock/inventory",method:"post",headers:{"Content-Type":"application/json"},data:e})},t.c=function(e){return Object(n.a)({url:"admin/stock/inventory/cancel/"+e,method:"post"})},t.b=function(e,t){return Object(n.a)({url:"admin/stock/inventory/audit/"+e,method:"post",data:t})},t.f=function(e){return Object(n.a)({url:"admin/stock/inventory/"+e,method:"get",loaidng:!1})},t.g=function(e){return Object(n.a)({url:"admin/stock/inventory",method:"get",loaidng:!1,params:e})},t.d=function(e){return Object(n.a)({url:"admin/stock/inventory/"+e,method:"delete"})},t.h=function(e){return Object(n.a)({url:"/admin/stock/inventory/syncStock/"+e,method:"get",loaidng:!1})};var n=o("vLgD")},Y38y:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=o("Xxa5"),r=o.n(n),i=o("exGp"),s=o.n(i),a=o("Dd8w"),d=o.n(a),c=o("NYxO"),l=o("jQQ7"),u=o("PSeb"),_=o("hky6"),p=o("dClm"),m=(o("CIZm"),o("Pfph")),v={name:"goodsInventoryAdd",data:function(){return{adminList:[],dialogVisible:!1,warehouseList:[],deptList:[],deptListAll:[],id:"",type:"",goodsInventoryAddForm:{product_list:[]},goodsInventoryAddFormRule:{inventory_person_id:{required:!0,message:"请选择盘点人",trigger:"change"},warehouse_id:{required:!0,message:"请选择报仓库",trigger:"change"},dept_id:{required:!0,message:"请选择所属部门",trigger:"change"},creator_id:{required:!0,message:"请选择制单人",trigger:"change"}},warehouseProduct:null,typeList:[]}},computed:d()({},Object(c.b)(["user"])),mounted:function(){"goodsInventoryEdit"===this.$route.name?this.type="edit":"goodsInventoryAudit"===this.$route.name?this.type="audit":"goodsInventoryReturn"===this.$route.name?this.type="return":"goodsInventoryAdd"===this.$route.name?(this.goodsInventoryAddForm.creator_id=this.user.uid,this.goodsInventoryAddForm.inventory_person_id=this.user.uid,this.goodsInventoryAddForm.dept_id=this.user.dept_id,this.GET_WarehouseList({dept_id:this.user.dept_id})):"goodsInventoryDetail"===this.$route.name?this.type="detail":"goodsInventoryCheck"===this.$route.name&&(this.type="check"),this.$route.params.id&&(this.id=this.$route.params.id,this.GET_goodsInventoryAddDetail()),this.GET_AdministratorList(),this.GET_DeptList()},methods:{printIng:function(){},forceUpdate:function(){this.$forceUpdate()},cleanGoodsList:function(){this.goodsInventoryAddForm.product_list=[]},GET_AdministratorList:function(){var e=this;m.h({page_no:1,page_size:9999,user_state:0}).then(function(t){e.adminList=t.data})},handlePassGoodsInventory:function(){var e=this;this.$confirm("确定通过吗?","提示",{type:"warning"}).then(function(){u.b(e.id,{status:"PASS"}).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:"goodsInventory"})})}).catch(function(){})},handleRejectGoodsInventory:function(){var e=this;this.goodsInventoryAddForm.reject_reason?this.$confirm("确定拒绝吗?","提示",{type:"warning"}).then(function(){u.b(e.id,{status:"REJECT",reject_reason:e.goodsInventoryAddForm.reject_reason}).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:"goodsInventory"})})}).catch(function(){}):this.$message.error("请填写驳回原因!")},changewarehouseList:function(e){this.$set(this.goodsInventoryAddForm,"warehouse_id",""),this.GET_WarehouseList({dept_id:e}),this.cleanGoodsList()},GET_WarehouseList:function(e){var t=this;p.C(e).then(function(e){t.warehouseList=e})},submitGoodsInventoryAddForm:function(){var e=this;this.$refs.goodsInventoryAddForm.validate(function(t){if(t){var o=e.goodsInventoryAddForm.id,n=e.MixinClone(e.goodsInventoryAddForm);n.dept_id&&(n.dept_name=e.deptListAll.find(function(e){return e.id===n.dept_id}).name),n.warehouse_id&&(n.warehouse_name=e.warehouseList.find(function(e){return e.id===n.warehouse_id}).name),n.creator_id&&(n.creator=e.adminList.find(function(e){return e.id===n.creator_id}).real_name),n.inventory_person_id&&(n.inventory_person=e.adminList.find(function(e){return e.id===n.inventory_person_id}).real_name),n.product_list=n.product_list.map(function(e){return{diff_num:e.usable_stock-e.inventory_num,inventory_num:1*e.inventory_num,product_id:e.product_id,product_name:e.product_name,product_sn:e.product_sn,specification:e.product_specification,unit:e.product_unit,goods_id:e.id,remark:e.remark}}),o?u.e(o,n).then(function(t){e.$message.success("修改成功!");var o=e.$route.params.callback;"function"==typeof o&&o(),e.$store.dispatch("delCurrentViews",{view:e.$route,$router:e.$router}),e.$router.push({name:"goodsInventory"})}):u.a(n).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:"goodsInventory"})})}})},handleSelectWarehouseEntryBatch:function(){var e=this;return s()(r.a.mark(function t(){var o;return r.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e.goodsInventoryAddForm.warehouse_id){t.next=3;break}return e.$message.error("请先选择仓库!"),t.abrupt("return");case 3:return t.next=5,e.$EnwarehouseEntryBatch({goodsApi:"/admin/erp/warehouseOut/getGoodByWarehouse/"+e.goodsInventoryAddForm.warehouse_id,warehouseList:e.warehouseList,selectedIds:e.id?e.goodsInventoryAddForm.product_list&&e.goodsInventoryAddForm.product_list.map(function(e){return e.id}):e.goodsInventoryAddForm.product_list.map(function(e){return e.id}),purchasePlanApiParams:{warehouse_id:e.goodsInventoryAddForm.warehouse_id}});case 5:o=t.sent,e.goodsInventoryAddForm.warehouse_id=o.warehouse_id,o.purchasePlans.map(function(e){return{product_id:e.product_id,stock_sn:e.warehouse_entry_sn}}),e.goodsInventoryAddForm.product_list=o.purchasePlans;case 9:case"end":return t.stop()}},t,e)}))()},GET_DeptList:function(){var e=this;_.p().then(function(t){e.deptList=l.Foundation.buildTree(t,"0"),e.deptListAll=t}),_.v({dictType:"inventory_type"}).then(function(t){e.typeList=t.data})},handleChangeWareHouse:function(e){this.goodsInventoryAddForm.product_list=[]},GET_goodsInventoryAddDetail:function(){var e=this;u.f(this.id).then(function(t){console.log(t),t.product_list.map(function(e){return e.allow_sn=e.goods_vo.allow_sn,e.bar_code=e.goods_vo.bar_code,e.brand_id=e.goods_vo.brand_id,e.brand_name=e.goods_vo.brand_name,e.category_id=e.goods_vo.category_id,e.category_ids=e.goods_vo.category_ids,e.category_name=e.goods_vo.category_name,e.cost_price=e.goods_vo.cost_price,e.create_time=e.goods_vo.create_time,e.creator=e.goods_vo.creator,e.description=e.goods_vo.description,e.en_name=e.goods_vo.en_name,e.freight_template_id=e.goods_vo.freight_template_id,e.goods_style=e.goods_vo.goods_style,e.goods_unit=e.goods_vo.goods_unit,e.goods_unit=e.goods_vo.goods_unit,e.have_spec=e.goods_vo.have_spec,e.hire_or_sail=e.goods_vo.hire_or_sail,e.image=e.goods_vo.image,e.image_list=e.goods_vo.image_list,e.label_names=e.goods_vo.label_names,e.market_enable=e.goods_vo.market_enable,e.mkt_price=e.goods_vo.mkt_price,e.name=e.goods_vo.name,e.params_list=e.goods_vo.params_list,e.price=e.goods_vo.price,e.sn=e.goods_vo.sn,e.sn_code=e.goods_vo.sn_code,e.sort=e.goods_vo.sort,e.update_time=e.goods_vo.update_time,e.updater=e.goods_vo.updater,e.usable_stock=e.goods_vo.usable_stock,e.video=e.goods_vo.video,e}),e.goodsInventoryAddForm=t,e.GET_WarehouseList({dept_id:t.dept_id}),e.goodsInventoryAddForm.distribution_name=t.staff_name,e.goodsInventoryAddForm.product_list=e.goodsInventoryAddForm.product_list.map(function(e){return e.product_specification=e.specification,e.product_unit=e.unit,e.remain_num=e.stock_num,e})})}}},y=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"bg-in-stock"},[o("el-form",{ref:"goodsInventoryAddForm",staticClass:"change-form",attrs:{model:e.goodsInventoryAddForm,rules:e.goodsInventoryAddFormRule,"label-width":"120px",inline:""}},[o("h3",{staticStyle:{width:"100%"}},[e._v("盘点单")]),e._v(" "),"edit"===e.type||"detail"===e.type?o("el-form-item",{staticClass:"change-form-item",attrs:{label:"盘点编号",prop:"sn"}},[o("el-input",{attrs:{disabled:!0},model:{value:e.goodsInventoryAddForm.sn,callback:function(t){e.$set(e.goodsInventoryAddForm,"sn",t)},expression:"goodsInventoryAddForm.sn"}})],1):e._e(),e._v(" "),o("el-form-item",{staticClass:"change-form-item",attrs:{label:"盘点时间",prop:"inventory_time"}},[o("el-date-picker",{attrs:{"value-format":"yyyy-MM-dd HH:mm:ss",type:"datetime",disabled:"detail"===e.type||"audit"===e.type||"check"===e.type,placeholder:"选择日期时间"},model:{value:e.goodsInventoryAddForm.inventory_time,callback:function(t){e.$set(e.goodsInventoryAddForm,"inventory_time",t)},expression:"goodsInventoryAddForm.inventory_time"}})],1),e._v(" "),o("el-form-item",{staticClass:"change-form-item",attrs:{label:"仓库",prop:"warehouse_id"}},[o("el-select",{attrs:{disabled:"detail"===e.type||"audit"===e.type||"check"===e.type},on:{change:e.handleChangeWareHouse},model:{value:e.goodsInventoryAddForm.warehouse_id,callback:function(t){e.$set(e.goodsInventoryAddForm,"warehouse_id",t)},expression:"goodsInventoryAddForm.warehouse_id"}},e._l(e.warehouseList,function(e){return o("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}),1)],1),e._v(" "),o("el-form-item",{staticClass:"change-form-item",attrs:{label:"盘点人",prop:"inventory_person_id"}},[o("el-select",{attrs:{disabled:"detail"===e.type||"audit"===e.type||"check"===e.type},on:{change:e.forceUpdate},model:{value:e.goodsInventoryAddForm.inventory_person_id,callback:function(t){e.$set(e.goodsInventoryAddForm,"inventory_person_id",t)},expression:"goodsInventoryAddForm.inventory_person_id"}},e._l(e.adminList,function(e){return o("el-option",{key:e.id,attrs:{label:e.real_name,value:e.id}})}),1)],1),e._v(" "),o("el-form-item",{staticClass:"change-form-item",attrs:{label:"制单人",prop:"creator_id"}},[o("el-select",{attrs:{disabled:"detail"===e.type||"audit"===e.type||"check"===e.type},on:{change:e.forceUpdate},model:{value:e.goodsInventoryAddForm.creator_id,callback:function(t){e.$set(e.goodsInventoryAddForm,"creator_id",t)},expression:"goodsInventoryAddForm.creator_id"}},e._l(e.adminList,function(e){return o("el-option",{key:e.id,attrs:{label:e.real_name,value:e.id}})}),1)],1),e._v(" "),o("el-form-item",{staticClass:"change-form-item",attrs:{label:"盘点类型",prop:"inventory_type"}},[o("el-select",{attrs:{disabled:"detail"===e.type||"audit"===e.type||"check"===e.type},on:{change:e.handleChangeWareHouse},model:{value:e.goodsInventoryAddForm.inventory_type,callback:function(t){e.$set(e.goodsInventoryAddForm,"inventory_type",t)},expression:"goodsInventoryAddForm.inventory_type"}},e._l(e.typeList,function(e){return o("el-option",{key:e.id,attrs:{label:e.label,value:e.id}})}),1)],1),e._v(" "),o("div",{staticClass:"mx"},[o("h3",[e._v("商品明细")]),e._v(" "),"detail"!==e.type&&"check"!==e.type?o("el-button",{staticClass:"button",attrs:{size:"mini",type:"primary"},on:{click:e.handleSelectWarehouseEntryBatch}},[e._v("选择")]):e._e()],1),e._v(" "),o("div",{staticStyle:{width:"100%",display:"block"}},[o("el-form-item",{staticStyle:{width:"100%"}},[o("el-table",{staticStyle:{width:"100%","margin-top":"20px"},attrs:{data:e.goodsInventoryAddForm.product_list,border:"","cell-style":{textAlign:"center"},"header-cell-style":{textAlign:"center"}}},[o("el-table-column",{attrs:{label:"商品编号"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.sn)+"\n ")]}}])}),e._v(" "),o("el-table-column",{attrs:{label:"商品名称"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.name)+"\n ")]}}])}),e._v(" "),o("el-table-column",{attrs:{label:"条码"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.bar_code)+"\n ")]}}])}),e._v(" "),o("el-table-column",{attrs:{label:"序列号"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.sn_code)+"\n ")]}}])}),e._v(" "),o("el-table-column",{attrs:{label:"规格型号"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.goods_style)+"\n ")]}}])}),e._v(" "),o("el-table-column",{attrs:{label:"单位"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.goods_unit)+"\n ")]}}])}),e._v(" "),o("el-table-column",{attrs:{label:"库存数量"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.usable_stock)+"\n ")]}}])}),e._v(" "),o("el-table-column",{attrs:{label:"盘点数量"},scopedSlots:e._u([{key:"default",fn:function(t){return[o("el-input",{attrs:{type:"number",min:0,maxlength:20,disabled:"detail"===e.type||"audit"===e.type||"check"===e.type},model:{value:t.row.inventory_num,callback:function(o){e.$set(t.row,"inventory_num",o)},expression:"scope.row.inventory_num"}})]}}])}),e._v(" "),o("el-table-column",{attrs:{label:"差异"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s(t.row.usable_stock-t.row.inventory_num||0)+"\n ")]}}])}),e._v(" "),"detail"!==e.type&&"audit"!==e.type&&"check"!==e.type?o("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[o("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(o){return e.goodsInventoryAddForm.product_list.splice(t.$index,1)}}},[e._v("删除")])]}}],null,!1,2952986069)}):e._e()],1)],1)],1)],1),e._v(" "),o("div",{staticClass:"footer"},["audit"!==e.type&&"detail"!==e.type&&"check"!==e.type?o("el-button",{attrs:{type:"primary"},on:{click:e.submitGoodsInventoryAddForm}},[e._v("保存\n ")]):e._e(),e._v(" "),"check"==e.type?o("el-button",{on:{click:e.printIng}},[e._v("打印")]):e._e(),e._v(" "),o("el-button",{on:{click:function(t){return e.$router.back()}}},[e._v("返回\n ")])],1),e._v(" "),o("el-dialog",{attrs:{title:"提示",visible:e.dialogVisible,width:"30%"},on:{"update:visible":function(t){e.dialogVisible=t}}},[o("el-form",{ref:"goodsInventoryAddForm",staticStyle:{width:"900px"},attrs:{model:e.goodsInventoryAddForm,"label-width":"120px",inline:""}},[o("el-form-item",{attrs:{label:"驳回原因",prop:"reject_reason",required:"true"}},[o("el-input",{attrs:{type:"textarea",minlength:0,maxlength:100},model:{value:e.goodsInventoryAddForm.reject_reason,callback:function(t){e.$set(e.goodsInventoryAddForm,"reject_reason",t)},expression:"goodsInventoryAddForm.reject_reason"}})],1)],1),e._v(" "),o("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v("取 消")]),e._v(" "),o("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.handleRejectGoodsInventory()}}},[e._v("确 定")])],1)],1)],1)},g=[];y._withStripped=!0;var f=o("XyMi"),h=!1;var b=function(e){h||o("EXu4")},w=Object(f.a)(v,y,g,!1,b,"data-v-9cc088c2",null);w.options.__file="src\\views\\stock\\goodsInventory\\goodsInventoryAdd.vue";t.default=w.exports}});