1 line
3.7 KiB
JavaScript
1 line
3.7 KiB
JavaScript
webpackJsonp([300],{YFBJ:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s={data:function(){return{search_data:{pageno:1,pagesize:10},total:0,pageSizes:[10,20,50],pictLoading:!1,btnDelDisabled:!0,btnOtherDisabled:!0,tableData:[],ids:[]}},mounted:function(){this.getList()},methods:{getList:function(){var t=this;this.pictLoading=!0,this.$api.shiftAPI.shiftOfLists(this.search_data).then(function(e){t.pictLoading=!1,console.log(e.data),e.data?(t.total=e.data.totalRows,t.tableData=e.data.datas?e.data.datas:[]):(t.total=0,t.tableData=[])})},remove:function(){var t=this,e=[];this.ids.forEach(function(t){e.push(t.id)}),this.$confirm("确认删除选中的班制吗?","提示",{type:"warning"}).then(function(){t.$api.shiftAPI.batchDelete({ids:e}).then(function(e){0===e.code?(t.$message({message:e.msg,type:"success"}),t.getList()):t.$message({message:e.msg?e.msg:"删除失败,请重试",type:"error"})}).catch(function(e){t.$message({message:"删除失败,请重试",type:"error"})})})},search:function(){this.search_data.pageno=1,this.getList()},gotoAdd:function(){this.$router.push("/basic/shift_add")},gotoEdit:function(t){var e=t.id;this.$router.push({path:"/basic/shift_edit",query:{id:e,t:Date.now()}})},clickRow:function(){},handleSizeChange:function(t){this.search_data.pagesize=t,this.getList()},handleCurrentChange:function(t){this.search_data.pageno=t,this.getList()},handleSelectionChange:function(t){this.ids=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.btnDelDisabled=a,this.btnOtherDisabled=e}}},i={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"sys-box plan-box"},[a("div",{staticClass:"sys-operate"},[a("el-button",{directives:[{name:"has",rawName:"v-has",value:"basic:shift:add",expression:"'basic:shift:add'"}],attrs:{type:"primary"},on:{click:t.gotoAdd}},[t._v("新增")]),t._v(" "),a("el-button",{directives:[{name:"has",rawName:"v-has",value:"basic:shift:delete",expression:"'basic:shift:delete'"}],attrs:{type:"primary",disabled:t.btnDelDisabled},on:{click:t.remove}},[t._v("删除")])],1),t._v(" "),a("div",{staticClass:"sys-search"}),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:"",data:t.tableData,"header-cell-style":{fontWeight:"normal",textAlign:"center",backgroundColor:"#eceff4",color:"#222"}},on:{"selection-change":t.handleSelectionChange}},[a("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{prop:"code",align:"center",label:"班制代码"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-link",{attrs:{type:"primary"},on:{click:function(a){return t.gotoEdit(e.row)}}},[t._v(t._s(e.row.code))])]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"name",align:"center",label:"班制名称"}}),t._v(" "),a("el-table-column",{attrs:{prop:"manHour",align:"center",label:"工作时长(小时)"}}),t._v(" "),a("el-table-column",{attrs:{prop:"startTime",align:"center",label:"开始时间"}}),t._v(" "),a("el-table-column",{attrs:{prop:"endTime",align:"center",label:"结束时间"}}),t._v(" "),a("el-table-column",{attrs:{prop:"remark",align:"center",label:"备注"}})],1)],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.total},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1)])},staticRenderFns:[]};var n=a("VU/8")(s,i,!1,function(t){a("bwTa")},"data-v-99dd69fe",null);e.default=n.exports},bwTa:function(t,e){}}); |