|
@@ -82,6 +82,7 @@
|
|
|
<el-table
|
|
|
:data="tableData"
|
|
|
v-loading="loading"
|
|
|
+ ref="formTable"
|
|
|
:height="tableHeight"
|
|
|
stripe
|
|
|
@sort-change="sortChange"
|
|
@@ -99,27 +100,23 @@
|
|
|
label="部门"
|
|
|
width="90"
|
|
|
></el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="id"
|
|
|
- label="编号"
|
|
|
- width="90"
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="name"
|
|
|
- label="名称"
|
|
|
- width="150"
|
|
|
- ></el-table-column>
|
|
|
+ <el-table-column prop="id" label="编号" width="90"></el-table-column>
|
|
|
+ <el-table-column prop="name" label="名称" width="150"></el-table-column>
|
|
|
<template v-for="col in dayList">
|
|
|
<el-table-column
|
|
|
- :label="col.day+''"
|
|
|
- :prop="col.id+''"
|
|
|
- :key="col.id+''"
|
|
|
+ :label="col.day + ''"
|
|
|
+ :prop="col.id + ''"
|
|
|
+ :key="col.id + ''"
|
|
|
width="80px"
|
|
|
>
|
|
|
<template slot-scope="{ row }">
|
|
|
<div style="display: flex; flex-direction: column">
|
|
|
<template v-for="(item, index) in row.personNumberMap[col.id]">
|
|
|
- <div v-html="showItem(item)" :key="index+''"></div>
|
|
|
+ <div
|
|
|
+ v-html="item"
|
|
|
+ :key="index + ''"
|
|
|
+ v-on:click="changeWork(row.id, row.name, col.day)"
|
|
|
+ ></div>
|
|
|
</template>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -138,6 +135,50 @@
|
|
|
:title="modalTitle"
|
|
|
@close="onDetailModalClose"
|
|
|
></workPersonScheduling-change>
|
|
|
+
|
|
|
+ <!-- 批量解绑设备 -->
|
|
|
+ <el-dialog
|
|
|
+ title="调班"
|
|
|
+ :visible.sync="batchChangeWork"
|
|
|
+ :modal-append-to-body="false"
|
|
|
+ style="text-align: left"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ >
|
|
|
+ <el-form label-width="150px" v-loading="changeWorkDisabled">
|
|
|
+ <el-form-item label="用户" prop="changeCompanyId">
|
|
|
+ <el-input
|
|
|
+ type="text"
|
|
|
+ v-model="changeUser"
|
|
|
+ style="width: 150px"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="部门" prop="changeCompanyId">
|
|
|
+ <el-select-tree
|
|
|
+ :props="props"
|
|
|
+ :options="companyResult"
|
|
|
+ v-model="changeCompanyId"
|
|
|
+ height="200"
|
|
|
+ ></el-select-tree>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="班次">
|
|
|
+ <el-select v-model="changeShiftId" filterable placeholder="请选择">
|
|
|
+ <el-option
|
|
|
+ v-for="shift in shiftData"
|
|
|
+ :key="shift.id"
|
|
|
+ :label="shift.name"
|
|
|
+ :value="shift.id"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="closeBatchChangeWork">关 闭</el-button>
|
|
|
+ <el-button type="primary" @click="handleBatchChangeWork"
|
|
|
+ >确 定</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 批量解绑设备end -->
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
@@ -145,7 +186,9 @@ import Constant from "@/constant";
|
|
|
import WorkPersonSchedulingDetail from "./workPersonScheduling-detail";
|
|
|
import WorkPersonSchedulingChange from "./workPersonScheduling-change";
|
|
|
import workPersonSchedulingApi from "@/api/base/workPersonScheduling";
|
|
|
+import workShiftInfoApi from "@/api/base/workShiftInfo";
|
|
|
import companyInfoApi from "@/api/base/companyInfo";
|
|
|
+import pageUtil from "@/utils/page";
|
|
|
import SelectTree from "@/components/SelectTree";
|
|
|
import NProgress from "nprogress"; // progress bar
|
|
|
import "nprogress/nprogress.css"; // progress bar style
|
|
@@ -158,9 +201,7 @@ export default {
|
|
|
return {
|
|
|
ruleValidate: {
|
|
|
companyId: [{ required: true, message: "不能为空", trigger: "blur" }],
|
|
|
- queryMonth: [
|
|
|
- { required: true, message: "请选择", trigger: "blur" }
|
|
|
- ]
|
|
|
+ queryMonth: [{ required: true, message: "请选择", trigger: "blur" }],
|
|
|
},
|
|
|
queryModel: {
|
|
|
personName: "",
|
|
@@ -188,10 +229,18 @@ export default {
|
|
|
label: "name",
|
|
|
children: "children",
|
|
|
},
|
|
|
- companyResult:[],
|
|
|
- dayList:[],
|
|
|
+ companyResult: [],
|
|
|
+ dayList: [],
|
|
|
tableHeight: 300,
|
|
|
- showChangeModal:false,
|
|
|
+ showChangeModal: false,
|
|
|
+ batchChangeWork: false,
|
|
|
+ changePersonId: "",
|
|
|
+ changeDay: "",
|
|
|
+ changeCompanyId: "",
|
|
|
+ shiftData: [],
|
|
|
+ changeShiftId: "",
|
|
|
+ changeWorkDisabled: false,
|
|
|
+ changeUser: "",
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -206,11 +255,18 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ changeCompanyId: function (val, oldval) {
|
|
|
+ if (val != null && val != "") {
|
|
|
+ this.queryShiftInfo(val);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
methods: {
|
|
|
handleQuery() {
|
|
|
var self = this;
|
|
|
|
|
|
- this.$refs["queryForm"].validate(valid => {
|
|
|
+ this.$refs["queryForm"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
self.changePage(1);
|
|
|
}
|
|
@@ -251,10 +307,12 @@ export default {
|
|
|
var jsonData = response.data;
|
|
|
self.tableData = jsonData.personList;
|
|
|
self.dayList = jsonData.dayList;
|
|
|
- //45为分页栏的高度
|
|
|
- //页面高度-列表上面的高度-分页栏高度
|
|
|
- self.tableHeight =
|
|
|
- window.innerHeight - self.$refs.formTable.$el.offsetTop - 100;
|
|
|
+ setTimeout(() => {
|
|
|
+ console.log(self.$refs.formTable.$el.offsetTop);
|
|
|
+ self.tableHeight = pageUtil.autoAdjustHeight(
|
|
|
+ self.$refs.formTable.$el
|
|
|
+ );
|
|
|
+ }, 1000);
|
|
|
})
|
|
|
.catch((error) => {
|
|
|
self.loading = false;
|
|
@@ -294,6 +352,61 @@ export default {
|
|
|
this.handleQuery();
|
|
|
}
|
|
|
},
|
|
|
+ changeWork(personId, personName, day) {
|
|
|
+ this.changePersonId = personId;
|
|
|
+ this.changeDay = day;
|
|
|
+ this.changeUser = personName + ",调班日期:" + day + "日";
|
|
|
+ this.batchChangeWork = true;
|
|
|
+ },
|
|
|
+ handleBatchChangeWork() {
|
|
|
+ var self = this;
|
|
|
+ var formData = new FormData();
|
|
|
+ formData.append("queryMonth", self.queryModel.queryMonth);
|
|
|
+ formData.append("day", self.changeDay);
|
|
|
+ formData.append("personId", self.changePersonId);
|
|
|
+ formData.append("shiftId", self.changeShiftId);
|
|
|
+
|
|
|
+ workPersonSchedulingApi
|
|
|
+ .changePersonShift(formData)
|
|
|
+ .then(function (response) {
|
|
|
+ var jsonData = response.data;
|
|
|
+ if (jsonData.result) {
|
|
|
+ self.changeDay = "";
|
|
|
+ self.changePersonId = "";
|
|
|
+ self.changeShiftId = "";
|
|
|
+ self.changeCompanyId = "";
|
|
|
+
|
|
|
+ self.changePage(1);
|
|
|
+
|
|
|
+ self.batchChangeWork = false;
|
|
|
+ } else {
|
|
|
+ self.$message({
|
|
|
+ showClose: true,
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
+ message: jsonData.message,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ closeBatchChangeWork() {
|
|
|
+ this.changePersonId = "";
|
|
|
+ this.changeDay = "";
|
|
|
+ this.batchChangeWork = false;
|
|
|
+ },
|
|
|
+ queryShiftInfo(companyId) {
|
|
|
+ var self = this;
|
|
|
+ var formData = new FormData();
|
|
|
+ formData.append("companyId", companyId);
|
|
|
+
|
|
|
+ workShiftInfoApi.shiftList(formData).then(function (response) {
|
|
|
+ var jsonData = response.data;
|
|
|
+ if (jsonData.result) {
|
|
|
+ if (jsonData.data != null && jsonData.data != "") {
|
|
|
+ self.shiftData = jsonData.data;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
mounted: function () {
|
|
|
//this.changePage(1);
|