Compare commits
4 Commits
5a8cf86eff
...
369c41cea6
| Author | SHA1 | Date | |
|---|---|---|---|
| 369c41cea6 | |||
| 377c62b0d6 | |||
| 5662689bb5 | |||
| 5aebf4e12f |
@ -75,3 +75,19 @@ export const baxxNjryNjshPage = (data) => {
|
||||
data
|
||||
});
|
||||
};
|
||||
// /baxx/njry / njsh Edit
|
||||
export const baxxNjryNjryNjsh = (data) => {
|
||||
return request({
|
||||
url: api + "/baxx/njry/njsh",
|
||||
method: "POST",
|
||||
data
|
||||
});
|
||||
};
|
||||
// /baxx/njpx / saveEntity
|
||||
export const baxxNjpxSaveEntity = (data) => {
|
||||
return request({
|
||||
url: api + "/baxx/njpx/saveEntity",
|
||||
method: "POST",
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
182
src/components/ChooseList/ChooseBapxry/index.vue
Normal file
182
src/components/ChooseList/ChooseBapxry/index.vue
Normal file
@ -0,0 +1,182 @@
|
||||
<template>
|
||||
<el-dialog :title="data.title" width="1400px" :model-value="modelValue" append-to-body @close="closed" v-if="modelValue">
|
||||
<div>
|
||||
<el-form :model="listQuery" class="mosty-from-wrap" :inline="true">
|
||||
<el-form-item label="姓名">
|
||||
<el-input placeholder="请输入姓名" v-model="listQuery.xm" clearabl></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="success" @click="handleFilter">查询</el-button>
|
||||
<el-button type="info" @click="reset"> 重置 </el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="tabBox" :class="props.data.Single ? 'tabBoxRadio' : ''" style="margin-top: 0px">
|
||||
<el-table :loading="loading" @selection-change="handleSelectionChange" :row-key="keyid" height="450" ref="multipleUserRef" :data="tableData" border style="width: 100%">
|
||||
<el-table-column type="selection" width="55" :reserve-selection="true"/>
|
||||
<el-table-column prop="xm" align="center" label="姓名"></el-table-column>
|
||||
<el-table-column prop="zjhm" align="center" label="证件号码"></el-table-column>
|
||||
<el-table-column prop="lxdh" align="center" label="联系方式"></el-table-column>
|
||||
<el-table-column prop="sqrq" align="center" label="申请时间"></el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="fenye" :style="{ top: tableHeight + 'px' }">
|
||||
<el-pagination
|
||||
class="pagination"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="listQuery.pageCurrent"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="listQuery.pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total"
|
||||
></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="closed">取消</el-button>
|
||||
<el-button type="primary" @click="onComfirm">确认</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { defineProps, watch, ref, onMounted, nextTick, reactive } from "vue";
|
||||
import {baxxNjryNjshPage} from '@/api/pxzx'
|
||||
const props = defineProps({
|
||||
modelValue: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
},
|
||||
data:{
|
||||
type: Object,
|
||||
default: {
|
||||
title:'选择年检通过人员',
|
||||
type:'wgy',//选择类型
|
||||
Single:false,//是否单选
|
||||
roleIds:[],//回显的数据
|
||||
}
|
||||
},
|
||||
});
|
||||
const emits = defineEmits(["update:modelValue", "choosedUsers",'close']);
|
||||
const total = ref(0);
|
||||
const loading = ref(false);
|
||||
const listQuery = reactive({
|
||||
pageCurrent: 1,
|
||||
pageSize: 20
|
||||
});
|
||||
const tableData = ref([]);
|
||||
const multipleUserRef = ref(null);
|
||||
const multipleSelectionUser = ref([]);
|
||||
|
||||
watch(()=>props.modelValue, (val) => {
|
||||
if (val) {
|
||||
nextTick(() => {
|
||||
getListData();
|
||||
});
|
||||
}
|
||||
},{immediate: true});
|
||||
|
||||
const keyid = (row) => {
|
||||
return row.id;
|
||||
};
|
||||
|
||||
// 列表数据
|
||||
const getListData = () => {
|
||||
let params = { ...listQuery,njzt:'01' }
|
||||
loading.value = true;
|
||||
baxxNjryNjshPage(params).then((res) => {
|
||||
loading.value = false;
|
||||
tableData.value = res?.records;
|
||||
total.value = Number(res.total);
|
||||
multipleUser();
|
||||
}).catch(()=>{
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
//列表回显
|
||||
function multipleUser() {
|
||||
let ids = props.data.roleIds ? props.data.roleIds :[];
|
||||
tableData.value.forEach((item) => {
|
||||
if (ids.some((id) => id == item.id)) {
|
||||
multipleUserRef.value.toggleRowSelection(item, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 页码改变触发
|
||||
*/
|
||||
const handleCurrentChange = (currentPage) => {
|
||||
listQuery.pageCurrent = currentPage;
|
||||
getListData();
|
||||
};
|
||||
|
||||
|
||||
// 筛选
|
||||
const handleFilter = () => {
|
||||
listQuery.pageCurrent = 1;
|
||||
getListData();
|
||||
};
|
||||
|
||||
|
||||
// 重置
|
||||
const reset = () => {
|
||||
listQuery.pageCurrent = 1
|
||||
listQuery.pageSize = 10
|
||||
getListData();
|
||||
};
|
||||
|
||||
// pageSize 改变触发
|
||||
const handleSizeChange = (currentSize) => {
|
||||
listQuery.pageSize = currentSize;
|
||||
getListData();
|
||||
};
|
||||
|
||||
// 为用户分配角色
|
||||
const onComfirm = () => {
|
||||
const userList = multipleSelectionUser.value;
|
||||
let list = [],listId = [];
|
||||
userList.forEach((val) => {
|
||||
if (listId.indexOf(val.id) == -1) {
|
||||
list.push(val);
|
||||
listId.push(val.id);
|
||||
}
|
||||
});
|
||||
emits("choosedUsers", list);
|
||||
emits("choosedUsersLeader", { userList: userList });
|
||||
closed();
|
||||
};
|
||||
|
||||
// 选择的数据
|
||||
const handleSelectionChange = (val) => {
|
||||
if (props.data.Single && val.length > 1) {
|
||||
let del_row = val.shift();
|
||||
multipleUserRef.value.toggleRowSelection(del_row, false);
|
||||
}
|
||||
multipleSelectionUser.value = val;
|
||||
};
|
||||
|
||||
// 关闭
|
||||
const closed = () => {
|
||||
emits("update:modelValue", false);
|
||||
emits("close");
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "@/assets/css/layout.scss";
|
||||
@import "@/assets/css/element-plus.scss";
|
||||
</style>
|
||||
<style>
|
||||
.tabBoxRadio .el-checkbox__inner {
|
||||
border-radius: 50% !important;
|
||||
}
|
||||
.tabBoxRadio .el-table__header-wrapper .el-checkbox {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
@ -53,6 +53,7 @@
|
||||
<el-date-picker v-else-if="item.type === 'date'" v-model="searchObj[item.prop]" type="date"
|
||||
:placeholder="item.placeholder" :shortcuts="item.shortcuts" value-format="YYYY-MM-DD">
|
||||
</el-date-picker>
|
||||
<el-time-picker v-else-if="item.type == 'time'" v-model="listQuery[item.prop]" placeholder="请选择时间" />
|
||||
<!-- 插槽 slot -->
|
||||
<template v-else-if="item.type === 'slot'">
|
||||
<slot :name="item.prop"></slot>
|
||||
|
||||
@ -29,7 +29,14 @@ const dialogForm = ref(false);
|
||||
const FormRef = ref();
|
||||
const listQuery = ref({});
|
||||
|
||||
const formList = reactive([
|
||||
const formList = ref([])
|
||||
|
||||
|
||||
// 初始化数据
|
||||
const init = (type, row,) => {
|
||||
dialogForm.value = true;
|
||||
listQuery.value=row
|
||||
formList.value=[
|
||||
[
|
||||
{ label: "姓名", prop: "xm", type: "input" },
|
||||
{ label: "证件号码", prop: "sfzh", type: "input" },
|
||||
@ -39,13 +46,8 @@ const formList = reactive([
|
||||
{ label: "是否年检", prop: "isnj", type:"select",options: props.dict.D_BZ_SF},
|
||||
{ label: "年检时间", prop: "njsj", type: "date" },
|
||||
],
|
||||
])
|
||||
]
|
||||
|
||||
|
||||
// 初始化数据
|
||||
const init = (type, row,) => {
|
||||
dialogForm.value = true;
|
||||
listQuery.value=row
|
||||
};
|
||||
|
||||
const close = () => {
|
||||
|
||||
@ -12,8 +12,8 @@
|
||||
</FormMessage>
|
||||
</div>
|
||||
<div class="flex just-center mt10" v-if="title == '详情'">
|
||||
<el-button type="primary" @click="submit">通过</el-button>
|
||||
<el-button type="danger" @click="submit">不通过</el-button>
|
||||
<el-button type="primary" @click="submit('01')">通过</el-button>
|
||||
<el-button type="danger" @click="submit('02')">不通过</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -22,7 +22,7 @@
|
||||
import { qcckPost , qcckGet} from "@/api/qcckApi.js";
|
||||
import FormMessage from "@/components/aboutTable/FormMessage.vue";
|
||||
import { ref, reactive, defineEmits, getCurrentInstance } from 'vue';
|
||||
import {baxxNjryEdit} from "@/api/pxzx.js";
|
||||
import {baxxNjryEdit,baxxNjryNjryNjsh} from "@/api/pxzx.js";
|
||||
const emit = defineEmits(["refresh"]);
|
||||
const props = defineProps({
|
||||
dict: {
|
||||
@ -90,7 +90,16 @@ const save = () => {
|
||||
// })
|
||||
});
|
||||
}
|
||||
|
||||
const submit = (val) => {
|
||||
baxxNjryNjryNjsh({
|
||||
id: listQuery.value.id,
|
||||
njzt: val,
|
||||
}).then(res => {
|
||||
proxy.$message.success('操作成功');
|
||||
emit("refresh");
|
||||
close();
|
||||
})
|
||||
}
|
||||
|
||||
const close = () => {
|
||||
dialogForm.value = false;
|
||||
|
||||
@ -12,7 +12,10 @@
|
||||
<el-divider />
|
||||
</FormMessage>
|
||||
<div style="padding:0 10vw 0 10vw;">
|
||||
<div class="table-title">培训保安人员 <el-icon size="20px" style="top: 4px;" color="green"><CirclePlusFilled /></el-icon> </div>
|
||||
<div class="table-title" @click="dialogFormVisible = true">培训保安人员 <el-icon size="20px" style="top: 4px;"
|
||||
color="green">
|
||||
<CirclePlusFilled />
|
||||
</el-icon> </div>
|
||||
<MyTable :tableData="pageData.tableData" :tableColumn="pageData.tableColumn" :tableHeight="pageData.tableHeight"
|
||||
:key="pageData.keyCount" :tableConfiger="pageData.tableConfiger" :controlsWidth="pageData.controlsWidth"
|
||||
@chooseData="chooseData">
|
||||
@ -23,53 +26,43 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ChooseBapxry v-model="dialogFormVisible" :Single="Single" :roleIds="roleIds" @close="closeBapxry"
|
||||
@choosedUsers="choosedList"></ChooseBapxry>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import MyTable from "@/components/aboutTable/MyTable.vue";
|
||||
import { qcckPost , qcckGet} from "@/api/qcckApi.js";
|
||||
import ChooseBapxry from "@/components/ChooseList/ChooseBapxry/index.vue";
|
||||
import FormMessage from "@/components/aboutTable/FormMessage.vue";
|
||||
import { ref, reactive,defineEmits,getCurrentInstance } from 'vue';
|
||||
import { ref, reactive, defineEmits, getCurrentInstance } from 'vue';
|
||||
import { dwglList, baxxNjpxSaveEntity } from '@/api/pxzx';
|
||||
const { proxy } = getCurrentInstance();
|
||||
const emit = defineEmits(["refresh"]);
|
||||
const dialogForm = ref(false);
|
||||
const FormRef = ref();
|
||||
const listQuery = ref({});
|
||||
const formList = reactive([
|
||||
[
|
||||
{ label: "培训日期", prop: "pxrq", type: "input" },
|
||||
{ label: "培训时间", prop: "pxsj", type: "input" },
|
||||
{ label: "课程名称", prop: "kcmc", type: "input" },
|
||||
],
|
||||
[
|
||||
{ label: "组织单位", prop: "zzdw", type: "input" },
|
||||
{ label: "授课教员", prop: "skfcy", type: "select" },
|
||||
{ label: "培训内容", prop: "pxnr", type: "input" },
|
||||
],
|
||||
{ label: "分割线", prop: "diver", type: "slot" },
|
||||
[
|
||||
{ label: "培训日期", prop: "pxrq", type: "input" },
|
||||
{ label: "培训时间", prop: "pxsj", type: "input" },
|
||||
{ label: "课程名称", prop: "kcmc", type: "input" },
|
||||
],
|
||||
[
|
||||
{ label: "组织单位", prop: "zzdw", type: "input" },
|
||||
{ label: "授课教员", prop: "skfcy", type: "select" },
|
||||
{ label: "培训内容", prop: "pxnr", type: "input" },
|
||||
],
|
||||
{ label: "分割线", prop: "diver", type: "slot" },
|
||||
[
|
||||
{ label: "培训日期", prop: "pxrq", type: "input" },
|
||||
{ label: "培训时间", prop: "pxsj", type: "input" },
|
||||
{ label: "课程名称", prop: "kcmc", type: "input" },
|
||||
],
|
||||
[
|
||||
{ label: "组织单位", prop: "zzdw", type: "input" },
|
||||
{ label: "授课教员", prop: "skfcy", type: "select" },
|
||||
{ label: "培训内容", prop: "pxnr", type: "input" },
|
||||
],
|
||||
|
||||
])
|
||||
const companyList = ref([])
|
||||
const getList = () => {
|
||||
dwglList({}).then(res => {
|
||||
companyList.value = res.length > 0 ? res.filter(item => item.type == '02' || item.type == '03').map(item => {
|
||||
return {
|
||||
zdmc: item.dwmc,
|
||||
dm: item.id
|
||||
}
|
||||
}) : []
|
||||
})
|
||||
}
|
||||
|
||||
const formList = ref()
|
||||
const dialogFormVisible = ref(false)
|
||||
const roleIds = ref([])
|
||||
const choosedList = (val) => {
|
||||
pageData.tableData = val;
|
||||
roleIds.value = val.map(item => item.id)
|
||||
}
|
||||
const closeBapxry = () => {
|
||||
dialogFormVisible.value = false
|
||||
}
|
||||
const pageData = reactive({
|
||||
tableData: [],
|
||||
keyCount: 0,
|
||||
@ -78,52 +71,133 @@ const pageData = reactive({
|
||||
showSelectType: "null",
|
||||
loading: false,
|
||||
},
|
||||
tableHeight:400,
|
||||
tableHeight: 400,
|
||||
tableColumn: [
|
||||
{ label: "姓名", prop: "xm"},
|
||||
{ label: "姓名", prop: "xm" },
|
||||
{ label: "证件号码", prop: "zjhm" },
|
||||
{ label: "电话号码", prop: "dhhm" },
|
||||
{ label: "电话号码", prop: "lxdh" },
|
||||
{ label: "所属单位", prop: "ssdw" },
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
const title = ref("新增")
|
||||
// 初始化数据
|
||||
const init = async (type, id,) => {
|
||||
if (id) {
|
||||
title.value == '新增'
|
||||
} else {
|
||||
title.value == '修改'
|
||||
}
|
||||
dialogForm.value = true;
|
||||
// const res = await qcckGet({ url: `/training/annualInspectionTraining/detail/${id}`})
|
||||
// listQuery.value = res || {}
|
||||
getList()
|
||||
formList.value = [
|
||||
[
|
||||
{ label: "培训日期", prop: "pxrq0", type: "date" },
|
||||
{ label: "培训时间", prop: "pxsj0", type: "time" },
|
||||
{ label: "课程名称", prop: "kcmc0", type: "input" },
|
||||
],
|
||||
[
|
||||
{ label: "组织单位", prop: "zzdw0", type: "select", options: companyList },
|
||||
{ label: "授课教员", prop: "skfcy0", type: "input" },
|
||||
{ label: "培训内容", prop: "pxnr0", type: "input" },
|
||||
],
|
||||
{ label: "分割线", prop: "diver", type: "slot" },
|
||||
[
|
||||
{ label: "培训日期", prop: "pxrq1", type: "date" },
|
||||
{ label: "培训时间", prop: "pxsj1", type: "time" },
|
||||
{ label: "课程名称", prop: "kcmc1", type: "input" },
|
||||
],
|
||||
[
|
||||
{ label: "组织单位", prop: "zzdw1", type: "select", options: companyList },
|
||||
{ label: "授课教员", prop: "skfcy1", type: "input" },
|
||||
{ label: "培训内容", prop: "pxnr1", type: "input" },
|
||||
],
|
||||
{ label: "分割线", prop: "diver", type: "slot" },
|
||||
[
|
||||
{ label: "培训日期", prop: "pxrq2", type: "date" },
|
||||
{ label: "培训时间", prop: "pxsj2", type: "time" },
|
||||
{ label: "课程名称", prop: "kcmc2", type: "input" },
|
||||
],
|
||||
[
|
||||
{ label: "组织单位", prop: "zzdw2", type: "select", options: companyList },
|
||||
{ label: "授课教员", prop: "skfcy2", type: "input" },
|
||||
{ label: "培训内容", prop: "pxnr2", type: "input" },
|
||||
],
|
||||
]
|
||||
};
|
||||
|
||||
const delRow = (id) => {
|
||||
pageData.tableData = pageData.tableData.filter(item => item.id !== id)
|
||||
}
|
||||
const loading = ref(false)
|
||||
const save = () => {
|
||||
FormRef.value.submit(()=>{
|
||||
// loading.value = true;
|
||||
// let url = title.value == '新增' ? `/mosty-jbld/jbldzsd/add` : `/mosty-jbld/jbldzsd/update`;
|
||||
// qcckPost(listQuery.value, url).then(() => {
|
||||
// loading.value = false;
|
||||
FormRef.value.submit(() => {
|
||||
loading.value = true;
|
||||
let url = title.value == '新增' ? `/baxx/njpx/saveEntity` : `/baxx/njpx/updateEntity `;
|
||||
console.log(listQuery.value);
|
||||
let pxkcList = []
|
||||
// 固定是3个
|
||||
for (let i = 0; i < 3; i++) {
|
||||
pxkcList.push({
|
||||
pxrq: listQuery.value[`pxrq${i}`],
|
||||
pxsj: listQuery.value[`pxsj${i}`],
|
||||
kcmc: listQuery.value[`kcmc${i}`],
|
||||
zzdw: listQuery.value[`zzdw${i}`],
|
||||
skfcy: listQuery.value[`skfcy${i}`],
|
||||
pxnr: listQuery.value[`pxnr${i}`],
|
||||
})
|
||||
}
|
||||
|
||||
const pxkcryList = pageData.tableData.map(item => {
|
||||
return {
|
||||
pxdwid: item.pxdwid,
|
||||
xm: item.xm,
|
||||
zjhm: item.zjhm,
|
||||
dhhm: item.lxdh,
|
||||
ssdw: item.ssdw,
|
||||
ssdwdm: item.ssdwdm,
|
||||
}
|
||||
})
|
||||
if (JSON.stringify(listQuery.value) == '{}') {
|
||||
loading.value = false;
|
||||
proxy.$message.error("请填写培训课程");
|
||||
return;
|
||||
}
|
||||
if (pxkcryList.length == 0) {
|
||||
loading.value = false;
|
||||
proxy.$message.error("请选择培训人员");
|
||||
return;
|
||||
}
|
||||
const promes = {
|
||||
pxgsdm: listQuery.value.pxgsdm,
|
||||
pxkcList: pxkcList,
|
||||
pxrq: listQuery.value.pxrq0,
|
||||
pxryList: pxkcryList,
|
||||
pxrysl: pxkcryList.length,
|
||||
}
|
||||
baxxNjpxSaveEntity(promes).then(() => {
|
||||
loading.value = false;
|
||||
proxy.$message.success("保存成功");
|
||||
// emit("refresh");
|
||||
close();
|
||||
// }).catch(() => {
|
||||
// loading.value = false;
|
||||
// })
|
||||
}).catch(() => {
|
||||
loading.value = false;
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
const close = () => {
|
||||
dialogForm.value = false;
|
||||
pageData.tableData = []
|
||||
FormRef.value.reset()
|
||||
};;
|
||||
|
||||
defineExpose({init})
|
||||
defineExpose({ init })
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "@/assets/css/layout.scss";
|
||||
.table-title{
|
||||
|
||||
.table-title {
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
background: #f5f5f5;
|
||||
|
||||
@ -18,7 +18,8 @@
|
||||
{{ row.bazyj&&row.tjzm&&row.wfzzmjl?'已上传':'未上传' }}
|
||||
</template>
|
||||
<template #njzt="{row}">
|
||||
<DictTag :options="D_BZ_SF" v-model:value="row.njzt" tag></DictTag>
|
||||
{{ row.njzt == '01'?'通过':row.njzt == '02'?'不通过':'' }}
|
||||
<!-- <DictTag :options="D_BZ_SF" v-model:value="row.njzt" tag></DictTag> -->
|
||||
</template>
|
||||
<!-- 操作 -->
|
||||
<template #controls="{ row }">
|
||||
@ -45,7 +46,6 @@ import Pages from "@/components/aboutTable/Pages.vue";
|
||||
import Search from "@/components/aboutTable/Search.vue";
|
||||
import DetailForm from "./components/detailForm.vue";
|
||||
import PxApllication from "./components/pxApllication.vue";
|
||||
import { qcckGet, qcckPost, qcckDelete } from "@/api/qcckApi.js";
|
||||
import {baxxNjryNjshPage} from '@/api/pxzx.js'
|
||||
import { reactive, ref, onMounted, getCurrentInstance, nextTick } from "vue";
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
Reference in New Issue
Block a user