|
@@ -2,32 +2,22 @@
|
|
|
<div class="pageBody">
|
|
|
<div class="titleBox">
|
|
|
<div class="status flex-wrap">
|
|
|
- <el-radio
|
|
|
- v-model="radio"
|
|
|
- :label="item.id"
|
|
|
- v-for="(item, index) in option"
|
|
|
- :key="index"
|
|
|
- >{{ item.label }}</el-radio
|
|
|
- >
|
|
|
+ <el-radio v-model="radio" :label="item.id" v-for="(item, index) in option" :key="index">{{ item.label }}</el-radio>
|
|
|
</div>
|
|
|
- <Search
|
|
|
- @getSearchData="getSearchData"
|
|
|
- @clearSearchData="clearSearchData"
|
|
|
- :isSlot="false"
|
|
|
- >
|
|
|
+ <Search @getSearchData="getSearchData" @clearSearchData="clearSearchData" :isSlot="false">
|
|
|
</Search>
|
|
|
</div>
|
|
|
- <div class="contantBox">
|
|
|
+ <div v-infinite-scroll="load" :infinite-scroll-distance="20" infinite-scroll-disabled="disabled" class="contantBox scrollbar">
|
|
|
<div class="itemBox" v-for="(item, index) in listData" :key="index">
|
|
|
<div class="del" @click="delate(item.JobId)">
|
|
|
<i class="el-icon-close"></i>
|
|
|
</div>
|
|
|
<div>
|
|
|
<el-row>
|
|
|
- <el-col :span="24" class="nameBox"
|
|
|
- ><div class="name">{{ item.JobName }}</div>
|
|
|
- <div class="loger" @click="toEdit(item.JobId)"></div
|
|
|
- ></el-col>
|
|
|
+ <el-col :span="24" class="nameBox">
|
|
|
+ <div class="name">{{ item.JobName }}</div>
|
|
|
+ <div class="loger" @click="toEdit(item.JobId)"></div>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
|
|
|
<el-row>
|
|
@@ -35,22 +25,14 @@
|
|
|
</el-row>
|
|
|
|
|
|
<el-row class="conntent" v-if="radio == 1">
|
|
|
- <el-col :span="12"
|
|
|
- >上级组织:<span>{{ item.OrganName }}</span></el-col
|
|
|
- >
|
|
|
- <el-col :span="12" class="flexLeft"
|
|
|
- >权限项数:<span>{{ item.AuthCount }}</span></el-col
|
|
|
- >
|
|
|
+ <el-col :span="12">上级组织:<span>{{ item.OrganName }}</span></el-col>
|
|
|
+ <el-col :span="12" class="flexLeft">权限项数:<span>{{ item.AuthCount }}</span></el-col>
|
|
|
</el-row>
|
|
|
<el-row class="conntent" v-if="radio == 1">
|
|
|
- <el-col :span="24"
|
|
|
- >拥有职员:<span>{{ item.OfficerCount }}</span></el-col
|
|
|
- >
|
|
|
+ <el-col :span="24">拥有职员:<span>{{ item.OfficerCount }}</span></el-col>
|
|
|
</el-row>
|
|
|
<el-row class="conntent2" v-if="radio == 2">
|
|
|
- <el-col :span="24"
|
|
|
- ><span>{{ item.UpLink }}</span></el-col
|
|
|
- >
|
|
|
+ <el-col :span="24"><span>{{ item.UpLink }}</span></el-col>
|
|
|
</el-row>
|
|
|
<el-row class="conntent">
|
|
|
<el-col :span="12">
|
|
@@ -58,44 +40,35 @@
|
|
|
<span class="unUsed" v-else-if="item.Status == 0">停用</span>
|
|
|
</el-col>
|
|
|
<el-col :span="12" class="flexLeft">
|
|
|
- <el-switch
|
|
|
- @change="isUsedChange(item, index)"
|
|
|
- v-model="item.Flag"
|
|
|
- :active-value="true"
|
|
|
- :inactive-value="false"
|
|
|
- active-color="#6F81BC"
|
|
|
- inactive-color="#CFD6E2"
|
|
|
- >
|
|
|
+ <el-switch @change="isUsedChange(item, index)" v-model="item.Flag" :active-value="true" :inactive-value="false" active-color="#6F81BC" inactive-color="#CFD6E2">
|
|
|
</el-switch>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <Dialog :flag="dialogVisible">
|
|
|
- <div class="closeDialog">
|
|
|
- <div class="title">删除岗位</div>
|
|
|
- <div class="content">是否确定要删除该岗位?</div>
|
|
|
- <div class="foot right t30">
|
|
|
- <el-button size="medium" type="danger" class="r24" @click="del()"
|
|
|
- >删除</el-button
|
|
|
- >
|
|
|
+ </div>
|
|
|
+ <p class="center" v-if="loading">加载中...</p>
|
|
|
+ <p class="center" v-if="noMore && !loading">没有更多数据了~</p>
|
|
|
+ <Dialog :flag="dialogVisible">
|
|
|
+ <div class="closeDialog">
|
|
|
+ <div class="title">删除岗位</div>
|
|
|
+ <div class="content">是否确定要删除该岗位?</div>
|
|
|
+ <div class="foot right t30">
|
|
|
+ <el-button size="medium" type="danger" class="r24" @click="del()">删除</el-button>
|
|
|
|
|
|
- <el-button size="medium" @click="dialogVisible = false"
|
|
|
- >取消</el-button
|
|
|
- >
|
|
|
- </div>
|
|
|
+ <el-button size="medium" @click="dialogVisible = false">取消</el-button>
|
|
|
</div>
|
|
|
- </Dialog>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ </Dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import Search from "@/layout/components/Search";
|
|
|
import Dialog from "@/layout/components/Dialog";
|
|
|
-import { GetJobList, ChangeJobStatus ,DeleteJob} from "@/api/jobApi";
|
|
|
+import { GetJobList, ChangeJobStatus, DeleteJob } from "@/api/jobApi";
|
|
|
export default {
|
|
|
- data() {
|
|
|
+ data () {
|
|
|
return {
|
|
|
dialogVisible: false,
|
|
|
GroupUpid: "",
|
|
@@ -113,28 +86,56 @@ export default {
|
|
|
id: 2,
|
|
|
},
|
|
|
],
|
|
|
+ pageSize: 20,
|
|
|
+ pageNum: 1,
|
|
|
+ total: '',
|
|
|
+ loading: false,
|
|
|
+ dataList: []
|
|
|
};
|
|
|
},
|
|
|
components: { Search, Dialog },
|
|
|
- created() {
|
|
|
- if(this.$route.query.keyWords){
|
|
|
+ created () {
|
|
|
+ if (this.$route.query.keyWords) {
|
|
|
this.serachinfo = this.$route.query.keyWords;
|
|
|
}
|
|
|
- this.AccountList(this.serachinfo);
|
|
|
+ this.AccountList({
|
|
|
+ QueryName: this.serachinfo,
|
|
|
+ PageSize: this.pageSize,
|
|
|
+ PageIndex: this.pageNum
|
|
|
+ });
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ noMore () {
|
|
|
+ return this.pageNum >= this.total
|
|
|
+ },
|
|
|
+ disabled () {
|
|
|
+ return this.loading || this.noMore
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
//查询
|
|
|
- getSearchData(val) {
|
|
|
+ getSearchData (val) {
|
|
|
+ this.pageNum = 1;
|
|
|
this.serachinfo = val;
|
|
|
- this.AccountList(val);
|
|
|
+ this.AccountList({
|
|
|
+ QueryName: this.serachinfo,
|
|
|
+ PageSize: this.pageSize,
|
|
|
+ PageIndex: this.pageNum
|
|
|
+ }, true);
|
|
|
},
|
|
|
|
|
|
//清除查询
|
|
|
- clearSearchData() {
|
|
|
- this.AccountList();
|
|
|
+ clearSearchData () {
|
|
|
+ this.pageNum = 1;
|
|
|
+ this.serachinfo = '';
|
|
|
+ this.AccountList({
|
|
|
+ QueryName: this.serachinfo,
|
|
|
+ PageSize: this.pageSize,
|
|
|
+ PageIndex: this.pageNum
|
|
|
+ }, true);
|
|
|
},
|
|
|
//修改状态
|
|
|
- async isUsedChange(value, index) {
|
|
|
+ async isUsedChange (value, index) {
|
|
|
let item = _.cloneDeep(value);
|
|
|
try {
|
|
|
let data = null;
|
|
@@ -155,7 +156,11 @@ export default {
|
|
|
ChangeJobStatus(data).then((result) => {
|
|
|
if (result.code == 0) {
|
|
|
this.$message.success(str);
|
|
|
- this.AccountList();
|
|
|
+ this.AccountList({
|
|
|
+ QueryName: this.serachinfo,
|
|
|
+ PageSize: this.pageSize,
|
|
|
+ PageIndex: this.pageNum
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
} catch (error) {
|
|
@@ -166,60 +171,79 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- delate: function (id) {
|
|
|
+ delate (id) {
|
|
|
this.dialogVisible = true;
|
|
|
this.delId = id;
|
|
|
},
|
|
|
|
|
|
- toEdit(id) {
|
|
|
+ toEdit (id) {
|
|
|
this.$router.push({
|
|
|
path: "jobs/edit",
|
|
|
query: { JobId: id },
|
|
|
});
|
|
|
},
|
|
|
//获取列表
|
|
|
- async AccountList() {
|
|
|
+ async AccountList (obj, type = '') {
|
|
|
try {
|
|
|
- const result = await GetJobList({
|
|
|
- QueryName: this.serachinfo,
|
|
|
- });
|
|
|
+ this.loading = true;
|
|
|
+ const result = await GetJobList(obj);
|
|
|
if (result.code === 0) {
|
|
|
- const { returnData } = result;
|
|
|
- returnData.forEach((element, index) => {
|
|
|
+ const datas = result.returnData.records;
|
|
|
+ datas.forEach((element, index) => {
|
|
|
if (element.Status == 1) {
|
|
|
element["Flag"] = true;
|
|
|
} else {
|
|
|
element["Flag"] = false;
|
|
|
}
|
|
|
- returnData[index] = element;
|
|
|
+ datas[index] = element;
|
|
|
});
|
|
|
- this.listData = result.returnData;
|
|
|
+ let arrs = [];
|
|
|
+ if (type) {
|
|
|
+ arrs = datas;
|
|
|
+ } else {
|
|
|
+ this.dataList.push(datas);
|
|
|
+ arrs = this.dataList.flat();
|
|
|
+ }
|
|
|
+ this.listData = arrs;
|
|
|
+ this.total = result.returnData.pages;
|
|
|
+ this.loading = false;
|
|
|
} else {
|
|
|
this.$message.error(result.message);
|
|
|
+ this.loading = false;
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.log("出错了", error);
|
|
|
+ this.loading = false;
|
|
|
}
|
|
|
},
|
|
|
|
|
|
//删除接口
|
|
|
- async del() {
|
|
|
+ async del () {
|
|
|
try {
|
|
|
const result = await DeleteJob({
|
|
|
- JobId: this.delId,
|
|
|
- });
|
|
|
- if (result.code === 0) {
|
|
|
- this.dialogVisible = false;
|
|
|
- this.$message.success(result.message);
|
|
|
- this.AccountList();
|
|
|
- }
|
|
|
+ JobId: this.delId,
|
|
|
+ });
|
|
|
+ if (result.code === 0) {
|
|
|
+ this.dialogVisible = false;
|
|
|
+ this.$message.success(result.message);
|
|
|
+ this.AccountList();
|
|
|
+ }
|
|
|
} catch (error) {
|
|
|
- this.dialogVisible = false;
|
|
|
+ this.dialogVisible = false;
|
|
|
// this.$message.error("删除失败");
|
|
|
console.log("出错了", error);
|
|
|
}
|
|
|
|
|
|
},
|
|
|
+ //滚动加载数据
|
|
|
+ load () {
|
|
|
+ this.pageNum += 1;
|
|
|
+ this.AccountList({
|
|
|
+ QueryName: this.serachinfo,
|
|
|
+ PageSize: this.pageSize,
|
|
|
+ PageIndex: this.pageNum
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -290,6 +314,9 @@ export default {
|
|
|
flex-wrap: wrap;
|
|
|
justify-content: flex-start;
|
|
|
width: calc(100% + 10px);
|
|
|
+ height: 79vh;
|
|
|
+ overflow-y: auto;
|
|
|
+ overflow-x: hidden;
|
|
|
.itemBox {
|
|
|
width: calc(25% - 20px);
|
|
|
margin: 10px;
|
|
@@ -299,6 +326,7 @@ export default {
|
|
|
box-shadow: 0px 6px 7px 0px rgba(0, 0, 0, 0.06);
|
|
|
border-radius: 16px;
|
|
|
overflow: hidden;
|
|
|
+ max-height: 200px;
|
|
|
.headLine {
|
|
|
width: 100%;
|
|
|
height: 4px;
|