/**
|
*liu
|
**/
|
|
|
|
<template>
|
<basic-container class="dispatchChildoperable">
|
<avue-crud
|
:option="option1"
|
:data="data1"
|
:page.sync="page1"
|
@row-save="rowSave1"
|
@row-update="rowUpdate1"
|
@row-del="rowDel1"
|
:table-loading="loading1"
|
@current-change="CurrentChange1"
|
@size-change="SizeChange1"
|
@refresh-change="refreshChange"
|
@on-load="onLoad1"
|
>
|
</avue-crud>
|
</basic-container>
|
</template>
|
|
<script>
|
// import { column, column1 } from "./data";
|
import {
|
securityBaseInfoColumn,
|
practitionersColumn,
|
trackRecordColumn,
|
} from "./data";
|
import { getUserPractitionersInfo } from "@/api/system/user";
|
import { mapGetters } from "vuex";
|
import { add, update, getpage, remove } from "@/api/performance/performance";
|
export default {
|
data() {
|
let baseUrl = "https://cli.avuejs.com/api/area";
|
return {
|
deptCategory: "",
|
deptId: "",
|
|
loading1: true, //派遣记录
|
selectionList1: [],
|
page1: {
|
pageSize: 10,
|
currentPage: 1,
|
total: 0,
|
},
|
query1: {},
|
data1: [],
|
option1: {
|
card: true,
|
menu: false,
|
addBtn: false,
|
height: "auto",
|
widtd: "auto",
|
calcHeight: 54,
|
indexLabel: "序号",
|
border: true, //liu
|
stripe: true,
|
tip: false,
|
index: true,
|
dialogClickModal: false,
|
headerAlign: "center",
|
align: "center",
|
column: trackRecordColumn,
|
},
|
};
|
},
|
computed: {
|
...mapGetters(["userInfo"]),
|
|
ids1() {
|
let ids1 = [];
|
this.selectionList1.forEach((ele) => {
|
ids1.push(ele.id);
|
});
|
return ids1.join(",");
|
},
|
},
|
methods: {
|
sizeChange1(val) {
|
this.page1.currentPage = 1;
|
this.page1.pageSize = val;
|
this.refreshChange();
|
},
|
currentChange1(val) {
|
this.page1.currentPage = val;
|
this.refreshChange();
|
},
|
rowSave1(form, done, loading) {
|
adddata1(form).then(
|
(res) => {
|
this.onLoad1(this.page1);
|
this.$message({
|
type: "success",
|
message: "操作成功!",
|
});
|
done();
|
},
|
(error) => {
|
window.console.log(error);
|
loading();
|
}
|
);
|
// }
|
},
|
searchChange1(params, done) {
|
this.query1 = params;
|
this.page1.currentPage = 1;
|
this.refreshChange();
|
done();
|
},
|
searchReset1() {
|
this.query = {};
|
this.onLoad1(this.page1);
|
},
|
rowUpdate1(row, index, done, loading) {
|
update1(row).then(
|
() => {
|
this.onLoad1(this.page1);
|
this.$message({
|
type: "success",
|
message: "操作成功!",
|
});
|
done();
|
},
|
(error) => {
|
window.console.log(error);
|
loading();
|
}
|
);
|
},
|
rowDel1(row) {
|
this.$confirm("确定将选择数据删除?", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning",
|
})
|
.then(() => {
|
return remove1(row.id);
|
})
|
.then(() => {
|
this.onLoad1(this.page1);
|
this.$message({
|
type: "success",
|
message: "操作成功!",
|
});
|
});
|
},
|
selectionChange1(list) {
|
this.selectionList1 = list;
|
// console.log(this.selectionList1.length);
|
},
|
handleDelete1() {
|
console.log(this.selectionList1);
|
if (this.selectionList1.length === 0) {
|
this.$message.warning("请选择至少一条数据");
|
return;
|
}
|
this.$confirm("确定将选择数据删除?", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning",
|
})
|
.then(() => {
|
return remove1(this.ids1);
|
})
|
.then(() => {
|
this.onLoad1(this.page1);
|
this.$message({
|
type: "success",
|
message: "操作成功!",
|
});
|
this.$refs.crudrec1.toggleSelection();
|
});
|
},
|
refreshChange() {
|
this.onLoad1(this.page1, this.query1);
|
},
|
|
getStartTime() {
|
if (
|
this.$route.query.startTime != undefined &&
|
this.$route.query.startTime != null &&
|
this.$route.query.startTime != ""
|
) {
|
return this.$route.query.startTime;
|
}
|
return "";
|
},
|
getEndTime() {
|
if (
|
this.$route.query.endTime != undefined &&
|
this.$route.query.endTime != null &&
|
this.$route.query.endTime != ""
|
) {
|
return this.$route.query.endTime;
|
}
|
return "";
|
},
|
//
|
onLoad1(page1, params = {}) {
|
this.loading1 = true;
|
|
var cardid = this.userInfo.user_id;
|
|
params = {
|
...params,
|
securityid: cardid,
|
};
|
getpage(page1.currentPage, page1.pageSize, params).then((res2) => {
|
const data = res2.data.data;
|
this.page1.total = data.total;
|
this.data1 = data.records;
|
console.log(this.data1, 1);
|
this.loading1 = false;
|
});
|
},
|
},
|
mounted() {
|
this.onLoad1(this.page1, this.query1);
|
//去掉缓存
|
// this.typeTABS = this.optionTABS.column[0];
|
// var row = {};
|
// if (this.readLock("paqiandata") != null) {
|
// row = JSON.parse(this.readLock("paqiandata"));
|
// this.obj0.name = row.name;
|
// for (var k in row) {
|
// this.obj0[k] = row[k];
|
// }
|
// console.log(this.obj0, 11111111);
|
// this.id = row.id;
|
// if (this.readLock("paqiandataS") != null) {
|
// var b = JSON.parse(this.readLock("paqiandataS"));
|
// var i = 0;
|
// for (var k in b) {
|
// if (b[k].name == row.name) {
|
// i = 1;
|
// }
|
// }
|
// if (i == 1) {
|
// // console.log("存在");
|
// } else {
|
// // console.log("已删除");
|
// this.obj0 = {};
|
// this.obj0.name = row.name + " 该派遣单位已删除";
|
// window.localStorage.removeItem("paqiandata");
|
// this.id = 1244241;
|
// }
|
// }
|
// } else {
|
// // console.log("no");
|
// this.obj0.name = " 未选择派遣单位";
|
// }
|
},
|
};
|
</script>
|
|
<style lang="scss" scoped>
|
.dispatch {
|
width: 100%;
|
height: 100%;
|
// border: 1px solid #000;
|
box-sizing: border-box;
|
}
|
.el-collapse-item {
|
padding-top: 15px !important;
|
}
|
</style>
|