yxk_pc_mdh/gyhl/static/js/419.2f560062d6cd189d8e44.js

1 line
11 KiB
JavaScript

webpackJsonp([419],{"4/xZ":function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=a("mvHQ"),s=a.n(i),l=a("pFYg"),o=a.n(l),n=a("Dd8w"),r=a.n(n),c=a("NYxO"),h=a("ysqt"),d=a("OG67"),u=(a("t4zo"),a("bzuE")),p={components:{btnInput:h.a,dialogChooseSingleParts:d.a},data:function(){return{totalSize:0,pageSizes:[10,20,50],search_data:{pageno:1,pagesize:20,materielName:"",materielId:"",materielType:"",facilityId:""},fac_type_list1:[],deviceType:[],tableData:[],childList:[],chooseParts:[],dialogTitle:"",totalNum:{},addBtn:!1,config:u.a,btnDelDisabled:!0,btnOtherDisabled:!0,chooseMaterielVisible:!1,dialogLoading:!1,dialogVisible:!1,columnSetDialogVisible:!1,columnSetDialogTitle:"设置显示字段列表",tableId:"stockAgeSetting_ageAnalysis_table",pictLoading:!1,showTableColumnsDefault:[],showTableColumns:[],showTableColumnsTemp:[],formTableData:[],totalTransferAmount:0}},created:function(){var t=this;document.onkeydown=function(e){"Enter"===e.key&&t.search()}},computed:r()({},Object(c.c)({userInfo:"user/getUserInfo"})),mounted:function(){this.getDateList(),this.initData()},watch:{childList:{handler:function(t,e){console.log(this.childList),this.childList.length>0?(1==this.childList.length&&(this.childList[0].name="0-"+this.childList[0].day+"天"),""==this.childList[this.childList.length-1].day?(this.addBtn=!0,this.childList.length>1&&(this.childList[this.childList.length-1].name=this.childList[this.childList.length-2].day+"天以上")):(this.addBtn=!1,this.childList.length>1?this.childList[this.childList.length-1].name=this.childList[this.childList.length-2].day+"-"+this.childList[this.childList.length-1].day+"天":this.childList[0].name="0-"+this.childList[this.childList.length-1].day+"天")):this.addBtn=!1},deep:!0}},methods:{handleSizeChange:function(t){this.search_data.pagesize=t,this.getList()},handleCurrentChange:function(t){this.search_data.pageno=t,this.getList()},addLine:function(){var t=[];t.push({name:"",day:""}),this.childList=this.childList.concat(t),console.log(this.childList)},removeLines:function(){var t=this;if(console.log(this.chooseParts),this.chooseParts){var e=[];this.chooseParts.forEach(function(a){e.push(a.id);var i=t.childList.findIndex(function(t){if(t.id==a.id)return!0});t.childList.splice(i,1)})}},setting:function(){this.getDateList(),this.dialogTitle="账龄分组设置",this.dialogVisible=!0},downLoadRecord:function(){this.$api.ageAnalysisAPI.exportExcel().then(function(t){})},getSummaries:function(t){var e=this,a=t.columns,i=(t.data,[]);return a.forEach(function(t,a){i[0]="合计";for(var s=0;s<e.showTableColumnsDefault.length;s++)t.property==e.showTableColumnsDefault[s].prop_&&(i[a]=e.totalNum[t.property])}),i},save:function(){var t=this;console.log(this.childList),console.log(o()(this.childList));for(var e=0;e<this.childList.length;e++)if(this.childList[this.childList.length-1].day)return void this.$message({message:"请确保最后一行的账龄分组为xx天以上",type:"warning"});for(e=0;e<this.childList.length-2;e++)if(this.childList[e].day>this.childList[e+1].day)return void this.$message({message:"下一行的库存天数要大于上一行的库存天数",type:"warning"});var a=s()(this.childList);console.log(a),this.$api.stockAgeSettingAPI.save(a).then(function(e){0==e.code?(t.$message({message:e.msg,type:"success"}),t.dialogVisible=!1,t.getDateList()):t.$message({message:e.msg,type:"error"})})},search:function(){this.search_data.pageno=1,this.getList()},getList:function(){var t=this;this.pictLoading=!0,this.$api.ageAnalysisAPI.ageAnalysis(this.search_data).then(function(e){t.pictLoading=!1,e.data?(t.totalSize=e.totalSize?e.totalSize:0,t.totalNum=e.total?e.total:{},t.tableData=e.data?e.data:[]):(t.totalSize=0,t.tableData=[])}).catch(function(t){console.log(t)})},initData:function(){var t=this;this.$api.gylInventoryAPI.facilityList({pageno:1,pagesize:1e3,auditSign:179}).then(function(e){t.fac_type_list1=e.data.datas?e.data.datas:"",t.fac_type_list2=e.data.datas?e.data.datas:""}).catch(function(t){console.log(t)}),this.$api.materielAPI.typeList({pageno:1,pagesize:1e3}).then(function(e){0===e.code&&e.data&&(t.deviceType=e.data.datas)})},getDateList:function(){var t=this;this.showTableColumnsDefault=[],this.$api.stockAgeSettingAPI.pageList().then(function(e){if(e.data){var a={};e.data.forEach(function(i,s){console.log(i),a=(e.data.length,{title:i.name,prop_:i.name}),t.showTableColumnsDefault.push(a)})}t.formTableData=t.showTableColumnsDefault,t.showTableColumns=t.showTableColumnsDefault,t.childList=e.data?e.data:[],console.log(t.showTableColumnsDefault)})},getPart:function(t){console.log(t),t?(this.$set(this.search_data,"materielId",t.id),this.$set(this.search_data,"materielName",t.name)):(this.$set(this.search_data,"materielId",""),this.$set(this.search_data,"materielName",""))},handleSelectionChange:function(t){console.log(t),this.chooseParts=t,this.setBtn(t)},setBtn:function(t){var e=!0,a=!0;t.length>0?(a=!1,1==t.length&&(e=!1)):(e=!0,a=!0),this.btnOtherDisabled=a,this.btnDelDisabled=e}}},g={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"sys-box"},[a("div",{staticClass:"sys-operate"},[a("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.downLoadRecord()}}},[t._v("导出")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.setting()}}},[t._v("库龄分组配置")])],1),t._v(" "),a("div",{staticClass:"sys-search"},[a("el-form",{staticClass:"form_item_search_out",attrs:{inline:""}},[a("div",{staticClass:"form_item_input_out"},[a("el-form-item",{staticClass:"form_item-inline",staticStyle:{width:"33%"},attrs:{label:"仓库"}},[a("el-select",{attrs:{placeholder:"请选择",clearable:""},model:{value:t.search_data.facilityId,callback:function(e){t.$set(t.search_data,"facilityId",e)},expression:"search_data.facilityId"}},t._l(t.fac_type_list1,function(t){return a("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})}),1)],1),t._v(" "),a("el-form-item",{staticClass:"form_item-inline",staticStyle:{width:"33%"},attrs:{label:"物料类型"}},[a("el-select",{attrs:{clearable:"",filterable:"",placeholder:"请选择物料类型"},model:{value:t.search_data.materielType,callback:function(e){t.$set(t.search_data,"materielType",e)},expression:"search_data.materielType"}},t._l(t.deviceType,function(t){return a("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})}),1)],1),t._v(" "),a("el-form-item",{staticClass:"form_item-inline",staticStyle:{width:"33%"},attrs:{label:"物料名称"}},[a("btn-input",{attrs:{valueText:t.search_data.materielName,valueId:t.search_data.materielId,chooseVisible:t.chooseMaterielVisible},on:{"update:valueText":function(e){return t.$set(t.search_data,"materielName",e)},"update:value-text":function(e){return t.$set(t.search_data,"materielName",e)},"update:valueId":function(e){return t.$set(t.search_data,"materielId",e)},"update:value-id":function(e){return t.$set(t.search_data,"materielId",e)},"update:chooseVisible":function(e){t.chooseMaterielVisible=e},"update:choose-visible":function(e){t.chooseMaterielVisible=e}}})],1)],1),t._v(" "),a("div",{staticClass:"form_item_btn_out"},[a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.search()}}},[t._v("查询")])],1)],1)])],1),t._v(" "),a("div",{staticClass:"sys-table"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.pictLoading,expression:"pictLoading"}],ref:"tb",attrs:{border:"",id:"out-table",data:t.tableData,"summary-method":t.getSummaries,"show-summary":"","header-cell-style":{fontWeight:"normal",textAlign:"center",backgroundColor:"#eceff4",color:"#222"}}},[a("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"facilityName",align:"center",label:"仓库"}}),t._v(" "),a("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"typeName",align:"center",label:"物料类型"}}),t._v(" "),a("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"serialNo",align:"center",label:"物料编号"}}),t._v(" "),a("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"name",align:"center",label:"物料名称"}}),t._v(" "),a("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"specification",align:"center",label:"规格型号"}}),t._v(" "),a("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"supportUomName",align:"center",label:"辅助单位"}}),t._v(" "),a("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"stockCountSub",align:"center",label:"库存数量(辅助单位)"}}),t._v(" "),t._l(t.formTableData,function(t,e){return a("el-table-column",{key:e,attrs:{prop:t.prop_,label:t.title,align:"center","show-overflow-tooltip":""}})})],2)],1),t._v(" "),a("div",{staticClass:"sys-pagination"},[a("el-pagination",{attrs:{"current-page":t.search_data.pageno,"page-sizes":t.pageSizes,"page-size":t.search_data.pagesize,layout:"total, sizes, prev, pager, next, jumper",total:t.totalSize},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1),t._v(" "),a("el-dialog",{attrs:{title:t.dialogTitle,center:"",visible:t.dialogVisible,width:"600px"},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("div",{staticClass:"sys-operate",staticStyle:{"margin-bottom":"10px"}},[a("el-button",{attrs:{type:"primary",size:"small",disabled:t.addBtn},on:{click:function(e){return t.addLine()}}},[t._v("新增")]),t._v(" "),a("el-button",{attrs:{type:"primary",size:"small"},on:{click:t.removeLines}},[t._v("删除")])],1),t._v(" "),a("el-table",{attrs:{data:t.childList,"header-cell-style":{fontWeight:"normal",textAlign:"center",backgroundColor:"#eceff4",color:"#222"},border:""},on:{"selection-change":t.handleSelectionChange}},[a("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{prop:"name",align:"center",label:"账龄分组"}}),t._v(" "),a("el-table-column",{attrs:{prop:"day",align:"center",width:"180",label:"库存天数"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-input-number",{staticClass:"inputClass",staticStyle:{width:"100%"},attrs:{min:0,size:"small","controls-position":"right"},model:{value:e.row.day,callback:function(a){t.$set(e.row,"day",a)},expression:"scope.row.day"}})]}}])})],1),t._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.dialogVisible=!1}}},[t._v(t._s(t.config.cancelText))]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.save()}}},[t._v("保存")])],1)],1),t._v(" "),a("dialogChooseSingleParts",{attrs:{visible:t.chooseMaterielVisible},on:{"update:visible":function(e){t.chooseMaterielVisible=e},change:t.getPart}})],1)},staticRenderFns:[]};var m=a("VU/8")(p,g,!1,function(t){a("rRYm")},"data-v-3125219a",null);e.default=m.exports},rRYm:function(t,e){}});