|
@@ -81,7 +81,7 @@
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
|
- <el-table v-loading="loading" :span-method="mergeMethod" :data="unitList" @selection-change="handleSelectionChange" :height="clientHeight"
|
|
|
+ <el-table v-loading="loading" ref="unitTable" :span-method="mergeMethod" :data="unitList" @selection-change="handleSelectionChange" :height="clientHeight"
|
|
|
border >
|
|
|
<el-table-column type="selection" width="55" align="center"/>
|
|
|
<el-table-column label="单位" align="center" prop="userUnit" :show-overflow-tooltip="true"
|
|
@@ -254,7 +254,17 @@ export default {
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
// 表单校验
|
|
|
- rules: {}
|
|
|
+ rules: {
|
|
|
+ userIds: [
|
|
|
+ { required: true, message: "用户不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ userUnit: [
|
|
|
+ { required: true, message: "用户单位不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ deptId: [
|
|
|
+ { required: true, message: "归属部门不能为空", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -288,20 +298,11 @@ export default {
|
|
|
this.loading = true;
|
|
|
listUnit(this.queryParams).then(response => {
|
|
|
this.unitList = response.rows;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.unitTable.doLayout(); // 解决表格错位
|
|
|
+ });
|
|
|
this.total = response.total;
|
|
|
this.loading = false;
|
|
|
- this.unitList.forEach(function (value, key, arr) {
|
|
|
- let nickName = null;
|
|
|
- let userIds = value.userIds;
|
|
|
- if (userIds != null) {
|
|
|
- _this.userOptions.forEach(function (v, k, arr) {
|
|
|
- if (userIds == v.userId) {
|
|
|
- nickName = v.nickName;
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- _this.unitList[key].nickName = nickName;
|
|
|
- });
|
|
|
});
|
|
|
},
|
|
|
/** 查询部门下拉树结构 */
|
|
@@ -440,14 +441,14 @@ export default {
|
|
|
},
|
|
|
//合并单元格
|
|
|
mergeMethod({row, column, rowIndex, columnIndex}) {
|
|
|
- if (columnIndex === 0) {
|
|
|
- const _row = this.setTable(this.unitList).merge[rowIndex];
|
|
|
- const _col = _row > 0 ? 1 : 0;
|
|
|
- return {
|
|
|
- rowspan: _row,
|
|
|
- colspan: _col
|
|
|
- };
|
|
|
- }
|
|
|
+ // if (columnIndex === 0) {
|
|
|
+ // const _row = this.setTable(this.unitList).merge[rowIndex];
|
|
|
+ // const _col = _row > 0 ? 1 : 0;
|
|
|
+ // return {
|
|
|
+ // rowspan: _row,
|
|
|
+ // colspan: _col
|
|
|
+ // };
|
|
|
+ // }
|
|
|
if (columnIndex === 1) {
|
|
|
const _row = this.setTable(this.unitList).merge[rowIndex];
|
|
|
const _col = _row > 0 ? 1 : 0;
|