(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0c031f"],{"416b":function(e,t,a){"use strict";a.r(t);var l=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[a("el-form",{directives:[{name:"show",rawName:"v-show",value:e.showSearch,expression:"showSearch"}],ref:"queryForm",attrs:{model:e.queryParams,size:"small",inline:!0,"label-width":"68px"}},[a("el-form-item",{attrs:{"label-width":"100",label:"总成序列号",prop:"sfcCode"}},[a("el-input",{attrs:{placeholder:"请输入总成序列号",clearable:""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery(t)}},model:{value:e.queryParams.sfcCode,callback:function(t){e.$set(e.queryParams,"sfcCode",t)},expression:"queryParams.sfcCode"}})],1),a("el-form-item",{attrs:{"label-width":"120",label:"采集时间"}},[a("el-date-picker",{attrs:{type:"datetimerange","range-separator":"至","value-format":"yyyy-MM-dd HH:mm:ss","start-placeholder":"开始日期","end-placeholder":"结束日期"},model:{value:e.dateRange,callback:function(t){e.dateRange=t},expression:"dateRange"}})],1),a("el-form-item",{staticStyle:{float:"right"}},[a("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:"mini"},on:{click:e.handleQuery}},[e._v("搜索")]),a("el-button",{attrs:{icon:"el-icon-refresh",size:"mini"},on:{click:e.resetQuery}},[e._v("重置")])],1)],1),a("el-row",{staticClass:"mb8",attrs:{gutter:10}},[a("el-col",{attrs:{span:1.5}},[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["da:materialCollection:export"],expression:"['da:materialCollection:export']"}],attrs:{type:"warning",plain:"",icon:"el-icon-download",size:"mini"},on:{click:e.handleExport}},[e._v("导出")])],1)],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{border:"",data:e.materialCollectionList},on:{"selection-change":e.handleSelectionChange}},[a("el-table-column",{attrs:{"show-overflow-tooltip":"true",type:"selection",width:"55",align:"center"}}),a("el-table-column",{attrs:{label:"总成序列号",align:"center",prop:"sfcCode"}}),a("el-table-column",{attrs:{label:"工位编码",align:"center",prop:"locationCode"}}),a("el-table-column",{attrs:{label:"参数编码",align:"center",prop:"paramCode"}}),a("el-table-column",{attrs:{label:"参数名称",align:"center",prop:"paramName"}}),a("el-table-column",{attrs:{label:"参数值",align:"center",prop:"paramValue"}}),a("el-table-column",{attrs:{label:"采集时间",align:"center",prop:"collectTime",width:"180"}})],1),a("pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total>0"}],attrs:{total:e.total,page:e.queryParams.pageNum,limit:e.queryParams.pageSize},on:{"update:page":function(t){return e.$set(e.queryParams,"pageNum",t)},"update:limit":function(t){return e.$set(e.queryParams,"pageSize",t)},pagination:e.getList}}),a("el-dialog",{attrs:{title:e.title,visible:e.open,width:"500px","append-to-body":""},on:{"update:visible":function(t){e.open=t}}},[a("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"80px"}},[a("el-form-item",{attrs:{label:"总成序列号",prop:"sfcCode"}},[a("el-input",{attrs:{placeholder:"请输入总成序列号"},model:{value:e.form.sfcCode,callback:function(t){e.$set(e.form,"sfcCode",t)},expression:"form.sfcCode"}})],1),a("el-form-item",{attrs:{label:"工位编码",prop:"locationCode"}},[a("el-input",{attrs:{placeholder:"请输入工位编码"},model:{value:e.form.locationCode,callback:function(t){e.$set(e.form,"locationCode",t)},expression:"form.locationCode"}})],1),a("el-form-item",{attrs:{label:"参数编码",prop:"paramCode"}},[a("el-input",{attrs:{placeholder:"请输入参数编码"},model:{value:e.form.paramCode,callback:function(t){e.$set(e.form,"paramCode",t)},expression:"form.paramCode"}})],1),a("el-form-item",{attrs:{label:"参数名称",prop:"paramName"}},[a("el-input",{attrs:{placeholder:"请输入参数名称"},model:{value:e.form.paramName,callback:function(t){e.$set(e.form,"paramName",t)},expression:"form.paramName"}})],1),a("el-form-item",{attrs:{label:"参数值",prop:"paramValue"}},[a("el-input",{attrs:{placeholder:"请输入参数值"},model:{value:e.form.paramValue,callback:function(t){e.$set(e.form,"paramValue",t)},expression:"form.paramValue"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("确 定")]),a("el-button",{on:{click:e.cancel}},[e._v("取 消")])],1)],1)],1)},o=[],r=(a("0643"),a("a573"),a("b775"));function i(e){return Object(r["a"])({url:"/da/materialCollection/list",method:"get",params:e})}function n(e){return Object(r["a"])({url:"/da/materialCollection/"+e,method:"get"})}function s(e){return Object(r["a"])({url:"/da/materialCollection",method:"post",data:e})}function m(e){return Object(r["a"])({url:"/da/materialCollection",method:"put",data:e})}function c(e){return Object(r["a"])({url:"/da/materialCollection/"+e,method:"delete"})}var d={name:"MaterialCollection",data(){return{dateRange:[],loading:!0,ids:[],single:!0,multiple:!0,showSearch:!0,total:0,materialCollectionList:[],title:"",open:!1,queryParams:{pageNum:1,pageSize:10,sfcCode:null,locationCode:null,paramCode:null,paramName:null},form:{},rules:{}}},created(){this.getList()},methods:{getList(){this.loading=!0,i(this.addDateRange(this.queryParams,this.dateRange)).then(e=>{this.materialCollectionList=e.rows,this.total=e.total,this.loading=!1})},cancel(){this.open=!1,this.reset()},reset(){this.form={id:null,sfcCode:null,locationCode:null,paramCode:null,paramName:null,paramValue:null,collectTime:null},this.resetForm("form")},handleQuery(){this.dateRange=[],this.queryParams.pageNum=1,this.getList()},resetQuery(){this.resetForm("queryForm"),this.handleQuery()},handleSelectionChange(e){this.ids=e.map(e=>e.id),this.single=1!==e.length,this.multiple=!e.length},handleAdd(){this.reset(),this.open=!0,this.title="添加物料采集"},handleUpdate(e){this.reset();const t=e.id||this.ids;n(t).then(e=>{this.form=e.data,this.open=!0,this.title="修改物料采集"})},submitForm(){this.$refs["form"].validate(e=>{e&&(null!=this.form.id?m(this.form).then(e=>{this.$modal.msgSuccess("修改成功"),this.open=!1,this.getList()}):s(this.form).then(e=>{this.$modal.msgSuccess("新增成功"),this.open=!1,this.getList()}))})},handleDelete(e){const t=e.id||this.ids;this.$modal.confirm('是否确认删除物料采集编号为"'+t+'"的数据项?').then((function(){return c(t)})).then(()=>{this.getList(),this.$modal.msgSuccess("删除成功")}).catch(()=>{})},handleExport(){this.download("da/materialCollection/export",{...this.queryParams},`materialCollection_${(new Date).getTime()}.xlsx`)}}},u=d,p=a("2877"),h=Object(p["a"])(u,l,o,!1,null,null,null);t["default"]=h.exports}}]);
|