Compare commits

...

4 Commits

Author SHA1 Message Date
lcw
369c41cea6 Merge branch 'master' of http://61.139.16.27:26684/maojiacai/ba_web 2025-09-25 12:42:38 +08:00
lcw
377c62b0d6 lcw 2025-09-25 12:42:28 +08:00
lcw
5662689bb5 Merge branch 'master' of http://61.139.16.27:26684/maojiacai/ba_web 2025-09-25 10:37:28 +08:00
lcw
5aebf4e12f lcw 2025-09-25 10:37:22 +08:00
7 changed files with 358 additions and 74 deletions

View File

@ -75,3 +75,19 @@ export const baxxNjryNjshPage = (data) => {
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
});
};

View 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>

View File

@ -53,6 +53,7 @@
<el-date-picker v-else-if="item.type === 'date'" v-model="searchObj[item.prop]" type="date" <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"> :placeholder="item.placeholder" :shortcuts="item.shortcuts" value-format="YYYY-MM-DD">
</el-date-picker> </el-date-picker>
<el-time-picker v-else-if="item.type == 'time'" v-model="listQuery[item.prop]" placeholder="请选择时间" />
<!-- 插槽 slot --> <!-- 插槽 slot -->
<template v-else-if="item.type === 'slot'"> <template v-else-if="item.type === 'slot'">
<slot :name="item.prop"></slot> <slot :name="item.prop"></slot>

View File

@ -29,7 +29,14 @@ const dialogForm = ref(false);
const FormRef = ref(); const FormRef = ref();
const listQuery = 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: "xm", type: "input" },
{ label: "证件号码", prop: "sfzh", 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: "isnj", type:"select",options: props.dict.D_BZ_SF},
{ label: "年检时间", prop: "njsj", type: "date" }, { label: "年检时间", prop: "njsj", type: "date" },
], ],
]) ]
// 初始化数据
const init = (type, row,) => {
dialogForm.value = true;
listQuery.value=row
}; };
const close = () => { const close = () => {

View File

@ -12,8 +12,8 @@
</FormMessage> </FormMessage>
</div> </div>
<div class="flex just-center mt10" v-if="title == '详情'"> <div class="flex just-center mt10" v-if="title == '详情'">
<el-button type="primary" @click="submit">通过</el-button> <el-button type="primary" @click="submit('01')">通过</el-button>
<el-button type="danger" @click="submit">不通过</el-button> <el-button type="danger" @click="submit('02')">不通过</el-button>
</div> </div>
</div> </div>
</template> </template>
@ -22,7 +22,7 @@
import { qcckPost , qcckGet} from "@/api/qcckApi.js"; import { qcckPost , qcckGet} from "@/api/qcckApi.js";
import FormMessage from "@/components/aboutTable/FormMessage.vue"; import FormMessage from "@/components/aboutTable/FormMessage.vue";
import { ref, reactive, defineEmits, getCurrentInstance } from '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 emit = defineEmits(["refresh"]);
const props = defineProps({ const props = defineProps({
dict: { 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 = () => { const close = () => {
dialogForm.value = false; dialogForm.value = false;

View File

@ -3,73 +3,66 @@
<div class="head_box"> <div class="head_box">
<span class="title">年检培训申请</span> <span class="title">年检培训申请</span>
<div> <div>
<el-button size="small" @click="save" type="primary" :loading="loading">保存</el-button> <el-button size="small" @click="save" type="primary" :loading="loading">保存</el-button>
<el-button size="small" @click="close">关闭</el-button> <el-button size="small" @click="close">关闭</el-button>
</div> </div>
</div> </div>
<div class="cntinfo"> <div class="cntinfo">
<FormMessage ref="FormRef" v-model="listQuery" :formList="formList"> <FormMessage ref="FormRef" v-model="listQuery" :formList="formList">
<el-divider /> <el-divider />
</FormMessage> </FormMessage>
<div style="padding:0 10vw 0 10vw;"> <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;"
<MyTable :tableData="pageData.tableData" :tableColumn="pageData.tableColumn" :tableHeight="pageData.tableHeight" 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" :key="pageData.keyCount" :tableConfiger="pageData.tableConfiger" :controlsWidth="pageData.controlsWidth"
@chooseData="chooseData"> @chooseData="chooseData">
<template #controls="{ row }"> <template #controls="{ row }">
<el-link type="danger" link @click="delRow(row.id)">删除</el-link> <el-link type="danger" link @click="delRow(row.id)">删除</el-link>
</template> </template>
</MyTable> </MyTable>
</div> </div>
</div> </div>
</div> </div>
<ChooseBapxry v-model="dialogFormVisible" :Single="Single" :roleIds="roleIds" @close="closeBapxry"
@choosedUsers="choosedList"></ChooseBapxry>
</template> </template>
<script setup> <script setup>
import MyTable from "@/components/aboutTable/MyTable.vue"; 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 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 emit = defineEmits(["refresh"]);
const dialogForm = ref(false); const dialogForm = ref(false);
const FormRef = ref(); const FormRef = ref();
const listQuery = ref({}); const listQuery = ref({});
const formList = reactive([ const companyList = ref([])
[ const getList = () => {
{ label: "培训日期", prop: "pxrq", type: "input" }, dwglList({}).then(res => {
{ label: "培训时间", prop: "pxsj", type: "input" }, companyList.value = res.length > 0 ? res.filter(item => item.type == '02' || item.type == '03').map(item => {
{ label: "课程名称", prop: "kcmc", type: "input" }, return {
], zdmc: item.dwmc,
[ dm: item.id
{ 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 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({ const pageData = reactive({
tableData: [], tableData: [],
keyCount: 0, keyCount: 0,
@ -78,52 +71,133 @@ const pageData = reactive({
showSelectType: "null", showSelectType: "null",
loading: false, loading: false,
}, },
tableHeight:400, tableHeight: 400,
tableColumn: [ tableColumn: [
{ label: "姓名", prop: "xm"}, { label: "姓名", prop: "xm" },
{ label: "证件号码", prop: "zjhm" }, { label: "证件号码", prop: "zjhm" },
{ label: "电话号码", prop: "dhhm" }, { label: "电话号码", prop: "lxdh" },
{ label: "所属单位", prop: "ssdw" }, { label: "所属单位", prop: "ssdw" },
] ]
}); });
const title = ref("新增")
// 初始化数据 // 初始化数据
const init = async (type, id,) => { const init = async (type, id,) => {
if (id) {
title.value == '新增'
} else {
title.value == '修改'
}
dialogForm.value = true; dialogForm.value = true;
// const res = await qcckGet({ url: `/training/annualInspectionTraining/detail/${id}`}) getList()
// listQuery.value = res || {} 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) => { const delRow = (id) => {
pageData.tableData = pageData.tableData.filter(item => item.id !== id) pageData.tableData = pageData.tableData.filter(item => item.id !== id)
} }
const loading = ref(false)
const save = () => { const save = () => {
FormRef.value.submit(()=>{ FormRef.value.submit(() => {
// loading.value = true; loading.value = true;
// let url = title.value == '新增' ? `/mosty-jbld/jbldzsd/add` : `/mosty-jbld/jbldzsd/update`; let url = title.value == '新增' ? `/baxx/njpx/saveEntity` : `/baxx/njpx/updateEntity `;
// qcckPost(listQuery.value, url).then(() => { console.log(listQuery.value);
// loading.value = false; 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("保存成功"); proxy.$message.success("保存成功");
// emit("refresh");
close(); close();
// }).catch(() => { }).catch(() => {
// loading.value = false; loading.value = false;
// }) })
}); });
} }
const close = () => { const close = () => {
dialogForm.value = false; dialogForm.value = false;
pageData.tableData = []
FormRef.value.reset() FormRef.value.reset()
};; };;
defineExpose({init}) defineExpose({ init })
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "@/assets/css/layout.scss"; @import "@/assets/css/layout.scss";
.table-title{
.table-title {
line-height: 40px; line-height: 40px;
text-align: center; text-align: center;
background: #f5f5f5; background: #f5f5f5;

View File

@ -18,7 +18,8 @@
{{ row.bazyj&&row.tjzm&&row.wfzzmjl?'已上传':'未上传' }} {{ row.bazyj&&row.tjzm&&row.wfzzmjl?'已上传':'未上传' }}
</template> </template>
<template #njzt="{row}"> <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>
<!-- 操作 --> <!-- 操作 -->
<template #controls="{ row }"> <template #controls="{ row }">
@ -45,7 +46,6 @@ import Pages from "@/components/aboutTable/Pages.vue";
import Search from "@/components/aboutTable/Search.vue"; import Search from "@/components/aboutTable/Search.vue";
import DetailForm from "./components/detailForm.vue"; import DetailForm from "./components/detailForm.vue";
import PxApllication from "./components/pxApllication.vue"; import PxApllication from "./components/pxApllication.vue";
import { qcckGet, qcckPost, qcckDelete } from "@/api/qcckApi.js";
import {baxxNjryNjshPage} from '@/api/pxzx.js' import {baxxNjryNjshPage} from '@/api/pxzx.js'
import { reactive, ref, onMounted, getCurrentInstance, nextTick } from "vue"; import { reactive, ref, onMounted, getCurrentInstance, nextTick } from "vue";
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();