1 line
4.7 KiB
JavaScript
1 line
4.7 KiB
JavaScript
webpackJsonp([314],{KTOj:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o={components:{ExcelImport:a("UoGq").a},data:function(){return{search_data:{pageno:1,pagesize:10},total:0,pageSizes:[10,20,50],pictLoading:!1,btnDelDisabled:!0,tableData:[],ids:[]}},created:function(){var e=this;document.onkeydown=function(t){"Enter"===t.key&&e.search()}},mounted:function(){this.getList()},methods:{getList:function(){var e=this;this.pictLoading=!0,this.$api.checkProjectAPI.listCheckProject(this.search_data).then(function(t){e.pictLoading=!1,console.log(t.data),t.data?(e.total=t.data.totalRows,e.tableData=t.data.datas?t.data.datas:[]):(e.total=0,e.tableData=[])})},gotoEdit:function(e){console.log(e.id),this.$router.push({path:"/basic/check_project_edit",query:{id:e.id,t:Date.now()}})},remove:function(){var e=this,t=[];console.log(this.ids),this.ids.forEach(function(e){t.push(e.id),console.log(t)}),this.$confirm("确认删除选中的检验项目吗?","提示",{type:"warning"}).then(function(){e.$api.checkProjectAPI.removeCheckProjects({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"})})})},search:function(){this.search_data.pageno=1,this.getList()},gotoAdd:function(){this.$router.push("/basic/check_project_add")},clickRow:function(){},handleSizeChange:function(e){this.search_data.pagesize=e,this.getList()},handleCurrentChange:function(e){this.search_data.pageno=e,this.getList()},handleSelectionChange:function(e){console.log(e),this.ids=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}}},n={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"sys-box plan-box"},[a("div",{staticClass:"sys-operate"},[a("el-button",{directives:[{name:"has",rawName:"v-has",value:"basic:checkProject:add",expression:"'basic:checkProject:add'"}],attrs:{type:"primary"},on:{click:e.gotoAdd}},[e._v("新增")]),e._v(" "),a("el-button",{directives:[{name:"has",rawName:"v-has",value:"basic:checkProject:delete",expression:"'basic:checkProject:delete'"}],attrs:{type:"primary",disabled:e.btnDelDisabled},on:{click:e.remove}},[e._v("删除")]),e._v(" "),a("ExcelImport",{attrs:{roleLink:"basic:checkProject:import",tmpLink:"/static/muban/muban1.xlsx"},on:{finish:function(t){return e.getList()}}})],1),e._v(" "),a("div",{staticClass:"sys-search"},[a("el-form",{attrs:{inline:""}},[a("el-form-item",{attrs:{label:"检验项目名称"}},[a("el-input",{attrs:{placeholder:"输入检验项目名称模糊查询",clearable:""},model:{value:e.search_data.name,callback:function(t){e.$set(e.search_data,"name",t)},expression:"search_data.name"}})],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.search}},[e._v("查询")])],1)],1)],1),e._v(" "),a("div",{staticClass:"sys-table"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.pictLoading,expression:"pictLoading"}],ref:"tb",attrs:{border:"",data:e.tableData,"header-cell-style":{fontWeight:"normal",textAlign:"center",backgroundColor:"#eceff4",color:"#222"}},on:{"row-click":e.gotoEdit,"selection-change":e.handleSelectionChange}},[a("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),e._v(" "),a("el-table-column",{attrs:{prop:"code",align:"center",label:"检验项目代码","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-link",{attrs:{type:"primary"},on:{click:function(a){return a.stopPropagation(),e.gotoEdit(t.row)}}},[e._v(e._s(t.row.code))])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"name",align:"center",label:"检验项目名称","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"norm",align:"center",label:"检验标准","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"method",align:"center",label:"检验方法","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"instrumentName",align:"center",label:"检验仪器","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{prop:"remark",align:"center",label:"备注","show-overflow-tooltip":""}})],1)],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)])},staticRenderFns:[]};var s=a("VU/8")(o,n,!1,function(e){a("OuU+")},"data-v-8334d63e",null);t.default=s.exports},"OuU+":function(e,t){}}); |