172 lines
5.0 KiB
Vue
172 lines
5.0 KiB
Vue
<template>
|
||
<div>
|
||
<div class="titleBox">
|
||
<!-- 头部 -->
|
||
<PageTitle title="下发任务">
|
||
<el-button type="primary" @click="addEditForm('add','')">
|
||
<el-icon style="vertical-align: middle">
|
||
<CirclePlus />
|
||
</el-icon>
|
||
<span style="vertical-align: middle">新增</span>
|
||
</el-button>
|
||
|
||
</PageTitle>
|
||
</div>
|
||
<!-- 搜索 -->
|
||
<div ref="searchBox">
|
||
<Search :searchArr="searchConfiger" @submit="onSearch" />
|
||
</div>
|
||
<!-- 表格 -->
|
||
<div class="tabBox">
|
||
<MyTable :tableData="pageData.tableData" :tableColumn="pageData.tableColumn" :tableHeight="pageData.tableHeight" :tableConfiger="pageData.tableConfiger"
|
||
:controlsWidth="pageData.controlsWidth" @chooseData="chooseData">
|
||
<template #rwzt="{ row }">
|
||
<el-table-column prop="wlq" label="未领取"/>
|
||
<el-table-column prop="ylq" label="已领取"/>
|
||
<el-table-column prop="ywc" label="已完成"/>
|
||
</template>
|
||
<template #controls="{ row }">
|
||
<!-- 领取后不可再编辑,领取后不可再删除 -->
|
||
<el-button @click="addEditForm('detail',row)" size="small">详情</el-button>
|
||
<el-button @click="addEditForm('eidt',row)" size="small">编辑</el-button>
|
||
<el-button @click="deletList(row.id)" type="danger" size="small">删除</el-button>
|
||
</template>
|
||
</MyTable>
|
||
<Pages @changeNo="changeNo" @changeSize="changeSize" :tableHeight="pageData.tableHeight" :pageConfiger="{
|
||
...pageData.pageConfiger,
|
||
total: pageData.total
|
||
}"></Pages>
|
||
</div>
|
||
<!-- 编辑-新增 -->
|
||
<EditAddForm ref="editInfo" @updateDate="getDataList" :dic="{D_BZ_SBLX,D_BZ_GZSBLX}"></EditAddForm>
|
||
</div>
|
||
</template>
|
||
|
||
<script setup>
|
||
import { qcckGet, qcckPost, qcckDelete } from "@/api/qcckApi.js";
|
||
import EditAddForm from "./components/editAddForm.vue";
|
||
import PageTitle from "@/components/aboutTable/PageTitle.vue";
|
||
import MyTable from "@/components/aboutTable/MyTable.vue";
|
||
import Pages from "@/components/aboutTable/Pages.vue";
|
||
import Search from "@/components/aboutTable/Search.vue";
|
||
import { reactive, ref, onMounted, getCurrentInstance, nextTick } from "vue";
|
||
const { proxy } = getCurrentInstance();
|
||
const { D_BZ_SBLX, D_BZ_GZSBLX } = proxy.$dict("D_BZ_SBLX", "D_BZ_GZSBLX");
|
||
const ids = ref([]); //多选
|
||
const searchBox = ref(); //搜索框
|
||
const listQuery = ref({});
|
||
const editInfo = ref();
|
||
const searchConfiger = reactive([
|
||
{
|
||
showType: "input",
|
||
prop: "sbmc",
|
||
placeholder: "请输入任务名称",
|
||
label: "任务名称"
|
||
},
|
||
{
|
||
showType: "input",
|
||
prop: "sbbh",
|
||
placeholder: "请输入任务编号",
|
||
label: "任务编号"
|
||
}
|
||
]);
|
||
const pageData = reactive({
|
||
tableData: [], //表格数据
|
||
tableConfiger: {
|
||
loading: false,
|
||
rowHieght: 61,
|
||
showSelectType: "checkBox"
|
||
},
|
||
total: 0,
|
||
pageConfiger: {
|
||
pageSize: 20,
|
||
pageNum: 1
|
||
}, //分页
|
||
controlsWidth: 210, //操作栏宽度
|
||
tableColumn: [
|
||
{ label: "任务名称", prop: "sbmc" },
|
||
{ label: "方格编号", prop: "sbbh" },
|
||
{ label: "下发时间", prop: "xfcsj" },
|
||
{ label: "任务领取人", prop: "rwlqr" },
|
||
{ label: "任务状态", prop: "rwzt", showSolt: true },
|
||
]
|
||
});
|
||
onMounted(() => {
|
||
tabHeightFn();
|
||
getDataList();
|
||
});
|
||
// 搜索
|
||
const onSearch = (val) => {
|
||
listQuery.value = { ...listQuery.value, ...val };
|
||
getDataList();
|
||
};
|
||
|
||
// 获取数据
|
||
const getDataList = () => {
|
||
let pramas = {
|
||
pageSize: pageData.pageConfiger.pageSize,
|
||
pageCurrent: pageData.pageConfiger.pageNum,
|
||
...listQuery.value
|
||
};
|
||
// pageData.tableConfiger.loading = true;
|
||
// qcckPost(pramas, "/mosty-yszx/tbYsSxt/getPageList")
|
||
// .then((res) => {
|
||
// pageData.tableData = res.records || [];
|
||
// pageData.tableConfiger.loading = false;
|
||
// pageData.total = res.total;
|
||
// })
|
||
// .catch(() => {
|
||
// pageData.tableConfiger.loading = false;
|
||
// });
|
||
};
|
||
const changeNo = (val) => {
|
||
pageData.pageConfiger.pageNum = val;
|
||
getDataList();
|
||
};
|
||
const changeSize = (val) => {
|
||
pageData.pageConfiger.pageSize = val;
|
||
getDataList();
|
||
};
|
||
|
||
// 多选
|
||
const chooseData = (val) => {
|
||
if(Array.isArray(val)) ids.value = val.map((v) => v.id);
|
||
};
|
||
//批量删除
|
||
const deletList = (id) => {
|
||
proxy.$confirm("确定要删除", "警告", { type: "warning" }).then(() => {
|
||
// qcckDelete({}, "/mosty-yszx/tbYsSxt/" + id).then(() => {
|
||
// proxy.$message({ type: "success", message: "删除成功" });
|
||
// getDataList();
|
||
// });
|
||
}).catch(() => {
|
||
proxy.$message.info("已取消");
|
||
});
|
||
};
|
||
|
||
// 新增编辑表单
|
||
const addEditForm = (type, row) => {
|
||
nextTick(() => {
|
||
editInfo.value.init(type, row);
|
||
});
|
||
};
|
||
|
||
// 表格高度计算
|
||
const tabHeightFn = () => {
|
||
pageData.tableHeight = window.innerHeight - searchBox.value.offsetHeight - 240;
|
||
window.onresize = function () { tabHeightFn(); };
|
||
};
|
||
</script>
|
||
|
||
<style lang="scss" scoped>
|
||
::v-deep .el-table thead.is-group th.el-table__cell{
|
||
background: rgba(6, 42, 72, 0.8);
|
||
}
|
||
</style>
|
||
<style>
|
||
.el-loading-mask {
|
||
background: rgba(0, 0, 0, 0.3);
|
||
}
|
||
</style>
|
||
|