1 line
17 KiB
JavaScript
1 line
17 KiB
JavaScript
webpackJsonp([362],{"9yll":function(e,t){},q9GX:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=a("BO1k"),s=a.n(o),i=a("mvHQ"),l=a.n(i),r=a("ysqt"),n=a("GKmE"),c=a("bzuE"),u=a("o4dX"),p=a("G9gL"),h=a("S4un"),m=a("OG67"),d={components:{btnInput:r.a,dialogChooseSingleUsers:u.a,dialogChooseSingleDevice:p.a,dialogChooseSingleProcess:h.a,dialogChooseSingleParts:m.a},name:"material_collect_list",data:function(){return{advanceQueryDialogVisible:!1,formData:{},total:0,pageSizes:[10,20,50],search_data:{pageno:1,pagesize:10},btnDelDisabled:!0,btnOtherDisabled:!0,rowIds:[],totalCollectMaterialCount:0,totalMateriaCountSupport:0,tableData:[],totalPlanCount:0,config:c.a,chooseUserVisible:!1,chooseDevicesVisible:!1,chooseProcessVisible:!1,chooseMaterielVisible:!1,columnSetDialogVisible:!1,columnSetDialogTitle:"设置显示字段列表",tableId:"jobShop_material_collect_table",pictLoading:!1,showTableColumnsDefault:[{title:"采集时间",prop_:"createTime",select:!0},{title:"生产人员",prop_:"operatorName",select:!0},{title:"生产部门",prop_:"deptName",select:!0},{title:"加工设备",prop_:"deviceName",select:!0},{title:"汇报工序",prop_:"processName",select:!0},{title:"用料代码",prop_:"collectSerialNo",select:!0},{title:"用料名称",prop_:"collectMateriaName",select:!0},{title:"规格型号",prop_:"collectSpecification",select:!0},{title:"主计量单位",prop_:"collectUnitName",select:!0},{title:"主单位数量",prop_:"collectMaterialCount",select:!0},{title:"辅助单位",prop_:"supportUomName",select:!0},{title:"辅单位数量",prop_:"materiaCountSupport",select:!0},{title:"批次号",prop_:"batch",select:!0},{title:"供应商",prop_:"supplierName",select:!0},{title:"工序计划单号",prop_:"planCode",select:!0},{title:"产品代码",prop_:"serialNo",select:!0},{title:"产品名称",prop_:"materielName",select:!0},{title:"规格型号",prop_:"specification",select:!0},{title:"计量单位",prop_:"unitName",select:!0},{title:"计划数量",prop_:"planCount",select:!0}],showTableColumns:[{title:"采集时间",prop_:"createTime",select:!0},{title:"生产人员",prop_:"operatorName",select:!0},{title:"生产部门",prop_:"deptName",select:!0},{title:"加工设备",prop_:"deviceName",select:!0},{title:"汇报工序",prop_:"processName",select:!0},{title:"用料代码",prop_:"collectSerialNo",select:!0},{title:"用料名称",prop_:"collectMateriaName",select:!0},{title:"规格型号",prop_:"collectSpecification",select:!0},{title:"主计量单位",prop_:"collectUnitName",select:!0},{title:"主单位数量",prop_:"collectMaterialCount",select:!0},{title:"辅助单位",prop_:"supportUomName",select:!0},{title:"辅单位数量",prop_:"materiaCountSupport",select:!0},{title:"批次号",prop_:"batch",select:!0},{title:"供应商",prop_:"supplierName",select:!0},{title:"工序计划单号",prop_:"planCode",select:!0},{title:"产品代码",prop_:"serialNo",select:!0},{title:"产品名称",prop_:"materielName",select:!0},{title:"规格型号",prop_:"specification",select:!0},{title:"计量单位",prop_:"unitName",select:!0},{title:"计划数量",prop_:"planCount",select:!0}],showTableColumnsTemp:[],formTableData:[]}},created:function(){this.initData(),this.getList();var e=this;document.onkeydown=function(t){"Enter"===t.key&&e.search()}},mounted:function(){this.showTableColumns=JSON.parse(l()(this.showTableColumns)),this.showTableColumnsTemp=JSON.parse(l()(this.showTableColumns)),this.getShowColumns()},methods:{showColumnSetDialog:function(){this.columnSetDialogVisible=!0,this.showTableColumnsTemp=JSON.parse(l()(this.showTableColumns))},toUp:function(e){if(0==e.$index)return!1;for(var t=void 0,a=0;a<this.showTableColumns.length;a++)this.showTableColumns[a].prop_==e.row.prop_&&(t=a);var o=this.showTableColumns[t];this.showTableColumns[t]=this.showTableColumns[t-1],this.showTableColumns[t-1]=o,this.$forceUpdate()},toDown:function(e){if(e.$index==this.showTableColumns.length-1)return!1;for(var t=void 0,a=0;a<this.showTableColumns.length;a++)this.showTableColumns[a].prop_==e.row.prop_&&(t=a);var o=this.showTableColumns[t];this.showTableColumns[t]=this.showTableColumns[t+1],this.showTableColumns[t+1]=o,this.$forceUpdate()},toDefault:function(){this.showTableColumns=JSON.parse(l()(this.showTableColumnsDefault)),this.$forceUpdate()},saveAndCloseColumnSetDialog:function(){var e=this,t=this.tableId,a=l()(this.showTableColumns);this.columnSetDialogVisible=!1,this.$api.tableColumnAPI.saveShowColumns({tableNo:t,tableColumns:a}).then(function(t){var a=JSON.parse(l()(e.showTableColumns));e.formTableData=[];for(var o=0;o<a.length;o++)a[o].select&&e.formTableData.push(a[o])}).catch(function(e){console.log(e)})},handleClose:function(){this.showTableColumns=JSON.parse(l()(this.showTableColumnsTemp)),this.columnSetDialogVisible=!1},getShowColumns:function(){var e=this,t=this.tableId;this.formTableData=[],this.$api.tableColumnAPI.getShowColumns({tableNo:t}).then(function(t){if(0==t.code)if(t.results){e.showTableColumns=JSON.parse(t.results);for(var a=JSON.parse(l()(e.showTableColumns)),o=0;o<a.length;o++)a[o].select&&e.formTableData.push(a[o]);e.$forceUpdate()}else{for(var s=JSON.parse(l()(e.showTableColumnsDefault)),i=0;i<s.length;i++)s[i].select&&e.formTableData.push(s[i]);e.$forceUpdate()}else e.$message({message:t.msg?t.msg:"获取列表信息失败",type:"error"})}).catch(function(t){e.$message({message:t,type:"error"}),console.log(t)})},viewDetail1:function(e){var t=e.planId;this.$router.push({path:"/planManagement/working_procedure_add",query:{id:t,t:Date.now()}})},getSummaries:function(e){var t=this,a=e.columns,o=(e.data,[]);return a.forEach(function(e,a){o[0]="合计","collectMaterialCount"!=e.property?"materiaCountSupport"!=e.property?"planCount"!=e.property||(o[a]=t.totalPlanCount):o[a]=t.totalMateriaCountSupport:o[a]=t.totalCollectMaterialCount}),o},moreSearch:function(){this.advanceQueryDialogVisible=!0},save:function(){for(var e in this.formData)this.search_data[e]=this.formData[e];this.search_data.pageno=1,this.$nextTick(function(){this.advanceQueryDialogVisible=!1,this.getList()})},clear:function(){for(var e in this.formData)this.formData[e]="";this.$forceUpdate()},sortChange:function(e){var t={column:e.column,prop:e.prop,order:e.order},a="ascending"==t.order?"asc":"desc";this.$set(this.search_data,"sort",t.prop),this.$set(this.search_data,"order",a),this.getList()},treeFindPath:function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(!e)return[];var o=!0,i=!1,l=void 0;try{for(var r,n=s()(e);!(o=(r=n.next()).done);o=!0){var c=r.value;if(a.push(c.id),t(c))return a;if(c.children){var u=this.treeFindPath(c.children,t,a);if(u.length)return u}a.pop()}}catch(e){i=!0,l=e}finally{try{!o&&n.return&&n.return()}finally{if(i)throw l}}return[]},initData:function(){},clickRow:function(e){this.$refs.tb.toggleRowSelection(e)},getUser:function(e){e?this.$set(this.formData,"operatorName",e.NAME):this.$set(this.formData,"operatorName","")},getDevice:function(e){e?this.$set(this.formData,"deviceName",e.name):this.$set(this.formData,"deviceName","")},getProcess:function(e){e?this.$set(this.search_data,"processName",e.name):this.$set(this.search_data,"processName","")},getPart:function(e){e?this.$set(this.search_data,"materielName",e.name):this.$set(this.search_data,"materielName","")},getList:function(){var e=this;this.pictLoading=!0,this.search_data.time?(this.search_data.startTime=Object(n.b)(this.search_data.time[0]),this.search_data.endTimes=Object(n.b)(this.search_data.time[1])):(this.search_data.startTime="",this.search_data.endTimes=""),this.$api.materialCollectAPI.materialCollectList(this.search_data).then(function(t){e.pictLoading=!1,t.data?(e.total=t.data.totalRows,e.totalCollectMaterialCount=t.data.totalCollectMaterialCount,e.totalMateriaCountSupport=t.data.totalMateriaCountSupport,e.totalPlanCount=t.data.totalPlanCount,e.tableData=t.data.datas?t.data.datas:[]):(e.total=0,e.tableData=[])}).catch(function(t){e.pictLoading=!1,console.log(t)})},search:function(){this.search_data.pageno=1,this.getList()},handleCurrentChange:function(e){this.search_data.pageno=e,this.getList()},handleSizeChange:function(e){this.search_data.pagesize=e,this.getList()},remove:function(){var e=this,t=[];this.rowIds.forEach(function(e){t.push(e.id)});this.$confirm("确认删除选中的用料采集单吗?","提示",{type:"warning"}).then(function(){e.$api.materialCollectAPI.detailOfCollect({ids:t}).then(function(t){0===t.code?(e.$message({message:t.msg,type:"success"}),e.getList()):e.$message({message:t.msg?t.msg:"删除失败,请重试",type:"error"})}).catch(function(t){e.$message({message:"删除失败,请重试",type:"error"})})})},handleSelectionChange:function(e){this.rowIds=e,this.setBtn(e)},setBtn:function(e){var t=!0,a=!0;e.length>0?(a=!1,1==e.length&&(t=!1)):(t=!0,a=!0),this.btnDelDisabled=a,this.btnOtherDisabled=t}}},f={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"sys-task sys-box"},[a("div",{staticClass:"sys-operate sys-tabs"},[a("el-button",{directives:[{name:"has",rawName:"v-has",value:"jobShop:materialCollect:delete",expression:"'jobShop:materialCollect:delete'"}],attrs:{type:"primary",disabled:e.btnDelDisabled},on:{click:function(t){return e.remove()}}},[e._v("删除\n ")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:e.showColumnSetDialog}},[e._v(e._s(e.config.configureBtnName))])],1),e._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:"31%"},attrs:{label:"日期"}},[a("el-date-picker",{attrs:{type:"daterange",format:"yyyy-MM-dd","range-separator":"—","start-placeholder":"开始日期","end-placeholder":"结束日期"},model:{value:e.search_data.time,callback:function(t){e.$set(e.search_data,"time",t)},expression:"search_data.time"}})],1),e._v(" "),a("el-form-item",{staticClass:"form_item-inline",staticStyle:{width:"23%"},attrs:{label:"工序名"}},[a("btn-input",{attrs:{valueText:e.search_data.processName,valueId:e.search_data.processName,chooseVisible:e.chooseProcessVisible},on:{"update:valueText":function(t){return e.$set(e.search_data,"processName",t)},"update:value-text":function(t){return e.$set(e.search_data,"processName",t)},"update:valueId":function(t){return e.$set(e.search_data,"processName",t)},"update:value-id":function(t){return e.$set(e.search_data,"processName",t)},"update:chooseVisible":function(t){e.chooseProcessVisible=t},"update:choose-visible":function(t){e.chooseProcessVisible=t}}})],1),e._v(" "),a("el-form-item",{staticClass:"form_item-inline",staticStyle:{width:"23%"},attrs:{label:"产品名"}},[a("btn-input",{attrs:{valueText:e.search_data.materielName,valueId:e.search_data.materielName,chooseVisible:e.chooseMaterielVisible},on:{"update:valueText":function(t){return e.$set(e.search_data,"materielName",t)},"update:value-text":function(t){return e.$set(e.search_data,"materielName",t)},"update:valueId":function(t){return e.$set(e.search_data,"materielName",t)},"update:value-id":function(t){return e.$set(e.search_data,"materielName",t)},"update:chooseVisible":function(t){e.chooseMaterielVisible=t},"update:choose-visible":function(t){e.chooseMaterielVisible=t}}})],1),e._v(" "),a("el-form-item",{staticClass:"form_item-inline",staticStyle:{width:"23%"},attrs:{label:"用料"}},[a("el-input",{attrs:{placeholder:"用料名",clearable:""},model:{value:e.search_data.collectMateriaName,callback:function(t){e.$set(e.search_data,"collectMateriaName",t)},expression:"search_data.collectMateriaName"}})],1)],1),e._v(" "),a("div",{staticClass:"form_item_btn_out"},[a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.search()}}},[e._v("查询")])],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.moreSearch()}}},[e._v("高级查询")])],1)],1)])],1),e._v(" "),a("div",{staticClass:"sys-table"},[e.formTableData.length>0?a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.pictLoading,expression:"pictLoading"}],ref:"tb",attrs:{border:"",fit:"",data:e.tableData,"summary-method":e.getSummaries,"show-summary":"","header-cell-style":{fontWeight:"normal",textAlign:"center",backgroundColor:"#eceff4",color:"#222"}},on:{"sort-change":e.sortChange,"row-click":e.clickRow,"selection-change":e.handleSelectionChange}},[a("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),e._v(" "),e._l(e.formTableData,function(t,o){return a("el-table-column",{key:o,attrs:{prop:t.prop_,label:t.title,align:"center","show-overflow-tooltip":"",sortable:"createTime"==t.prop_&&"custom"},scopedSlots:e._u([{key:"default",fn:function(o){return[a("div",["planCode"==t.prop_?a("div",[a("el-link",{attrs:{type:"primary"},on:{click:function(t){return t.stopPropagation(),e.viewDetail1(o.row)}}},[e._v(e._s(o.row.planCode)+"\n ")])],1):a("div",[a("div",{staticStyle:{overflow:"hidden"}},[e._v(e._s(o.row[t.prop_]))])])])]}}],null,!0)})})],2):e._e()],1),e._v(" "),a("div",{staticClass:"sys-pagination"},[a("el-pagination",{attrs:{"current-page":e.search_data.pageno,"page-sizes":e.pageSizes,"page-size":e.search_data.pagesize,layout:"total, sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1),e._v(" "),a("el-dialog",{attrs:{title:e.columnSetDialogTitle,center:"",visible:e.columnSetDialogVisible,width:"531px","before-close":e.handleClose},on:{"update:visible":function(t){e.columnSetDialogVisible=t}}},[a("el-table",{key:Math.random(),staticStyle:{width:"100%"},attrs:{border:"",data:e.showTableColumns,"max-height":"350"}},[a("el-table-column",{attrs:{prop:"title",label:"列表名称",width:"180",fixed:""}}),e._v(" "),a("el-table-column",{attrs:{prop:"select",label:"是否显示",width:"180"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-switch",{model:{value:t.row.select,callback:function(a){e.$set(t.row,"select",a)},expression:"scope.row.select"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return e.toUp(t)}}},[e._v("前移")]),e._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return e.toDown(t)}}},[e._v("后移")])]}}])})],1),e._v(" "),a("el-row",{staticClass:"row-bg",staticStyle:{"margin-top":"10px"},attrs:{type:"flex",justify:"center"}},[a("el-col",{attrs:{span:6}},[a("el-button",{attrs:{type:"primary",size:"middle"},on:{click:e.saveAndCloseColumnSetDialog}},[e._v("完成")])],1),e._v(" "),a("el-col",{attrs:{span:6}},[a("el-button",{attrs:{type:"primary",size:"middle"},on:{click:e.toDefault}},[e._v("恢复默认")])],1)],1)],1),e._v(" "),a("el-dialog",{attrs:{title:"高级查询",center:"",visible:e.advanceQueryDialogVisible,width:"670px"},on:{"update:visible":function(t){e.advanceQueryDialogVisible=t}}},[a("el-form",{ref:"form",staticClass:"dialog-form",staticStyle:{width:"620px"},attrs:{inline:!0,"label-width":"80px"}},[a("div",{staticClass:"dialog-line"},[a("el-form-item",{staticClass:"dialog-form-inline",attrs:{label:"设备"}},[a("btn-input",{attrs:{valueText:e.formData.deviceName,valueId:e.formData.deviceName,chooseVisible:e.chooseDevicesVisible},on:{"update:valueText":function(t){return e.$set(e.formData,"deviceName",t)},"update:value-text":function(t){return e.$set(e.formData,"deviceName",t)},"update:valueId":function(t){return e.$set(e.formData,"deviceName",t)},"update:value-id":function(t){return e.$set(e.formData,"deviceName",t)},"update:chooseVisible":function(t){e.chooseDevicesVisible=t},"update:choose-visible":function(t){e.chooseDevicesVisible=t}}})],1),e._v(" "),a("el-form-item",{staticClass:"dialog-form-inline",attrs:{label:"操作工"}},[a("btn-input",{attrs:{valueText:e.formData.operatorName,valueId:e.formData.operatorName,chooseVisible:e.chooseUserVisible},on:{"update:valueText":function(t){return e.$set(e.formData,"operatorName",t)},"update:value-text":function(t){return e.$set(e.formData,"operatorName",t)},"update:valueId":function(t){return e.$set(e.formData,"operatorName",t)},"update:value-id":function(t){return e.$set(e.formData,"operatorName",t)},"update:chooseVisible":function(t){e.chooseUserVisible=t},"update:choose-visible":function(t){e.chooseUserVisible=t}}})],1)],1)]),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:e.save}},[e._v("确定")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){e.advanceQueryDialogVisible=!1}}},[e._v("关闭")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:e.clear}},[e._v("清空")])],1)],1),e._v(" "),a("dialogChooseSingleUsers",{attrs:{visible:e.chooseUserVisible},on:{"update:visible":function(t){e.chooseUserVisible=t},change:e.getUser}}),e._v(" "),a("dialogChooseSingleDevice",{attrs:{visible:e.chooseDevicesVisible},on:{"update:visible":function(t){e.chooseDevicesVisible=t},change:e.getDevice}}),e._v(" "),a("dialogChooseSingleProcess",{attrs:{visible:e.chooseProcessVisible},on:{"update:visible":function(t){e.chooseProcessVisible=t},change:e.getProcess}}),e._v(" "),a("dialogChooseSingleParts",{attrs:{visible:e.chooseMaterielVisible},on:{"update:visible":function(t){e.chooseMaterielVisible=t},change:e.getPart}})],1)},staticRenderFns:[]};var b=a("VU/8")(d,f,!1,function(e){a("9yll")},null,null);t.default=b.exports}}); |