|
@@ -13,8 +13,12 @@
|
|
|
<!--
|
|
|
要resetFields起作用,必须配置:model和prop
|
|
|
-->
|
|
|
- <el-form ref="queryForm" :model="queryModel" inline class="demo-form-inline">
|
|
|
-
|
|
|
+ <el-form
|
|
|
+ ref="queryForm"
|
|
|
+ :model="queryModel"
|
|
|
+ inline
|
|
|
+ class="demo-form-inline"
|
|
|
+ >
|
|
|
<el-form-item label="班次名称" prop="name">
|
|
|
<el-input type="text" size="mini" v-model="queryModel.name"></el-input>
|
|
|
</el-form-item>
|
|
@@ -25,26 +29,36 @@
|
|
|
icon="ios-search"
|
|
|
@click="changePage(1)"
|
|
|
:loading="loading"
|
|
|
- >查询</el-button>
|
|
|
+ >查询</el-button
|
|
|
+ >
|
|
|
<el-button
|
|
|
type="info"
|
|
|
size="mini"
|
|
|
style="margin-left: 8px"
|
|
|
@click="handleReset('queryForm')"
|
|
|
- >重置</el-button>
|
|
|
+ >重置</el-button
|
|
|
+ >
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<el-divider></el-divider>
|
|
|
<el-row class="button-group">
|
|
|
- <el-button type="primary" size="small" plain icon="el-icon-circle-plus" @click="handleAdd">新增</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ plain
|
|
|
+ icon="el-icon-circle-plus"
|
|
|
+ @click="handleAdd"
|
|
|
+ >新增</el-button
|
|
|
+ >
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
size="small"
|
|
|
plain
|
|
|
icon="el-icon-remove"
|
|
|
- :disabled="multipleSelection.length==0"
|
|
|
+ :disabled="multipleSelection.length == 0"
|
|
|
@click="handleBatchDelete"
|
|
|
- >删除选中项</el-button>
|
|
|
+ >删除选中项</el-button
|
|
|
+ >
|
|
|
</el-row>
|
|
|
<el-table
|
|
|
ref="formTable"
|
|
@@ -56,31 +70,58 @@
|
|
|
@selection-change="handleSelectionChange"
|
|
|
>
|
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
|
- <el-table-column prop="number" label="班次编号" width="80"></el-table-column>
|
|
|
- <el-table-column prop="name" label="班次名称" width="150"></el-table-column>
|
|
|
- <el-table-column prop="days" label="天数" width="100" ></el-table-column>
|
|
|
- <el-table-column prop="workTime" label="上班时间" width="120"></el-table-column>
|
|
|
- <el-table-column prop="workStartTime" label="上班考勤时段" width="150">
|
|
|
- <template slot-scope="{row}">
|
|
|
- {{row.workStartTime}}-{{row.workEndTime}}
|
|
|
- </template>
|
|
|
+ <el-table-column
|
|
|
+ prop="number"
|
|
|
+ label="班次编号"
|
|
|
+ width="80"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="name"
|
|
|
+ label="班次名称"
|
|
|
+ width="150"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column prop="days" label="天数" width="100"></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="workTime"
|
|
|
+ label="上班时间"
|
|
|
+ width="120"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column prop="workStartTime" label="上班考勤时段" width="150">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ {{ row.workStartTime }}-{{ row.workEndTime }}
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="closingTime" label="下班时间" width="120"></el-table-column>
|
|
|
- <el-table-column prop="closingStartTime" label="下班考勤时段" width="150">
|
|
|
- <template slot-scope="{row}">
|
|
|
- {{row.closingStartTime}}-{{row.closingEndTime}}
|
|
|
- </template>
|
|
|
+ <el-table-column
|
|
|
+ prop="closingTime"
|
|
|
+ label="下班时间"
|
|
|
+ width="120"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column prop="closingStartTime" label="下班考勤时段" width="150">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ {{ row.closingStartTime }}-{{ row.closingEndTime }}
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column prop="companyList" label="关联部门" width="200">
|
|
|
- <template slot-scope="{row}">
|
|
|
- <div v-for="item in row.companyList" v-bind:key="item.id">
|
|
|
- {{item.name}}
|
|
|
- </div>
|
|
|
- </template>
|
|
|
+ <el-table-column type="expand" width="40">
|
|
|
+ <template slot-scope="props">
|
|
|
+ <el-form label-position="left" inline class="demo-table-expand">
|
|
|
+ <el-form-item label="关联部门">
|
|
|
+ <span v-if="props.row.companyNames != ''">{{
|
|
|
+ props.row.companyNames
|
|
|
+ }}</span>
|
|
|
+ <span v-else>无</span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="companyNames"
|
|
|
+ label="关联部门"
|
|
|
+ width="200"
|
|
|
+ show-overflow-tooltip
|
|
|
+ ></el-table-column>
|
|
|
<el-table-column label="操作" width="150" fixed="right">
|
|
|
- <template slot-scope="{row}">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
<el-link type="primary" @click="handleEdit(row)">编辑</el-link>
|
|
@@ -118,13 +159,13 @@ import NProgress from "nprogress"; // progress bar
|
|
|
import "nprogress/nprogress.css"; // progress bar style
|
|
|
|
|
|
export default {
|
|
|
- name: 'BaseWorkShiftInfoList',
|
|
|
+ name: "BaseWorkShiftInfoList",
|
|
|
data() {
|
|
|
var self = this;
|
|
|
|
|
|
return {
|
|
|
queryModel: {
|
|
|
- name:""
|
|
|
+ name: "",
|
|
|
},
|
|
|
loading: false,
|
|
|
loadingText: "加载中",
|
|
@@ -148,13 +189,11 @@ export default {
|
|
|
// 配置项(必选)
|
|
|
value: "id",
|
|
|
label: "name",
|
|
|
- children: "children"
|
|
|
+ children: "children",
|
|
|
},
|
|
|
};
|
|
|
},
|
|
|
- created() {
|
|
|
-
|
|
|
- },
|
|
|
+ created() {},
|
|
|
methods: {
|
|
|
indexMethod(index) {
|
|
|
return (this.pageIndex - 1) * this.pageSize + (index + 1);
|
|
@@ -168,29 +207,37 @@ export default {
|
|
|
self.pageIndex = pageIndex;
|
|
|
var formData = new FormData();
|
|
|
|
|
|
- formData.append("pageIndex", self.pageIndex);
|
|
|
- formData.append("pageSize", self.pageSize);
|
|
|
+ formData.append("pageIndex", self.pageIndex);
|
|
|
+ formData.append("pageSize", self.pageSize);
|
|
|
|
|
|
- formData.append("name", self.queryModel.name);
|
|
|
+ formData.append("name", self.queryModel.name);
|
|
|
|
|
|
workShiftInfoApi
|
|
|
.pageList(formData)
|
|
|
- .then(function(response) {
|
|
|
+ .then(function (response) {
|
|
|
self.loading = false;
|
|
|
var jsonData = response.data;
|
|
|
-
|
|
|
- if(jsonData.result) {
|
|
|
- var page = jsonData.data;
|
|
|
|
|
|
- self.tableData = page.data;
|
|
|
- self.totalPages = page.totalPages;
|
|
|
- self.totalElements = page.recordsTotal;
|
|
|
- }
|
|
|
- else{
|
|
|
+ if (jsonData.result) {
|
|
|
+ var page = jsonData.data;
|
|
|
+
|
|
|
+ self.tableData = page.data;
|
|
|
+ self.totalPages = page.totalPages;
|
|
|
+ self.totalElements = page.recordsTotal;
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ console.log(self.$refs.formTable.$el.offsetTop);
|
|
|
+
|
|
|
+ //页面高度-列表上面的高度-header高度-分页控件高度
|
|
|
+ self.tableHeight = pageUtil.autoAdjustHeight(
|
|
|
+ self.$refs.formTable.$el
|
|
|
+ );
|
|
|
+ }, 1000);
|
|
|
+ } else {
|
|
|
self.$message.warning(jsonData.message + "");
|
|
|
}
|
|
|
})
|
|
|
- .catch(error => {
|
|
|
+ .catch((error) => {
|
|
|
self.loading = false;
|
|
|
});
|
|
|
},
|
|
@@ -220,10 +267,10 @@ export default {
|
|
|
.$confirm("是否确认删除?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
+ type: "warning",
|
|
|
})
|
|
|
.then(() => {
|
|
|
- workShiftInfoApi.remove(record.id).then(function(response) {
|
|
|
+ workShiftInfoApi.remove(record.id).then(function (response) {
|
|
|
var jsonData = response.data;
|
|
|
|
|
|
if (jsonData.result) {
|
|
@@ -233,7 +280,7 @@ export default {
|
|
|
|
|
|
self.$message({
|
|
|
type: "success",
|
|
|
- message: "删除成功!"
|
|
|
+ message: "删除成功!",
|
|
|
});
|
|
|
}
|
|
|
});
|
|
@@ -242,16 +289,16 @@ export default {
|
|
|
handleBatchDelete() {
|
|
|
var self = this;
|
|
|
|
|
|
- var idList = this.multipleSelection.map(record => {
|
|
|
+ var idList = this.multipleSelection.map((record) => {
|
|
|
return record.id;
|
|
|
});
|
|
|
|
|
|
this.$confirm("是否确认删除选中项?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
+ type: "warning",
|
|
|
}).then(() => {
|
|
|
- workShiftInfoApi.batchRemove(idList).then(function(response) {
|
|
|
+ workShiftInfoApi.batchRemove(idList).then(function (response) {
|
|
|
var jsonData = response.data;
|
|
|
|
|
|
if (jsonData.result) {
|
|
@@ -259,7 +306,7 @@ export default {
|
|
|
|
|
|
self.$message({
|
|
|
type: "success",
|
|
|
- message: "删除成功!"
|
|
|
+ message: "删除成功!",
|
|
|
});
|
|
|
}
|
|
|
});
|
|
@@ -275,12 +322,12 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
},
|
|
|
- mounted: function() {
|
|
|
+ mounted: function () {
|
|
|
this.changePage(1);
|
|
|
},
|
|
|
components: {
|
|
|
"workShiftInfo-detail": workShiftInfoDetail,
|
|
|
- }
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|