2025-09-22 17:25:44 +08:00
|
|
|
<template>
|
2025-09-26 16:08:38 +08:00
|
|
|
<el-dialog class="dialogWerapper" width="80%" v-model="visibleDialog" title="选择公司" @close="handleClose">
|
|
|
|
|
<div>
|
|
|
|
|
<MyTable
|
|
|
|
|
:tableData="pageData.tableData"
|
|
|
|
|
:tableColumn="pageData.tableColumn"
|
|
|
|
|
:tableHeight="pageData.tableHeight"
|
|
|
|
|
:key="pageData.keyCount"
|
|
|
|
|
:tableConfiger="pageData.tableConfiger"
|
|
|
|
|
:controlsWidth="pageData.controlsWidth"
|
|
|
|
|
@chooseData="chooseData"
|
|
|
|
|
>
|
|
|
|
|
</MyTable>
|
|
|
|
|
</div>
|
2025-09-22 17:25:44 +08:00
|
|
|
<template #footer>
|
2025-09-26 16:08:38 +08:00
|
|
|
<div class="flex just-center">
|
|
|
|
|
<el-button type="primary" :loading="loading" @click="handleSubmit">确定</el-button>
|
|
|
|
|
<el-button @click="handleClose">取消</el-button>
|
|
|
|
|
</div>
|
2025-09-22 17:25:44 +08:00
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
2025-09-26 16:08:38 +08:00
|
|
|
import MyTable from "@/components/aboutTable/MyTable.vue";
|
|
|
|
|
import { ref, reactive,getCurrentInstance } from 'vue';
|
|
|
|
|
import { qcckPost } from "@/api/qcckApi.js";
|
|
|
|
|
const emits = defineEmits(['refresh']);
|
2025-09-24 20:32:05 +08:00
|
|
|
const { proxy } = getCurrentInstance();
|
2025-09-26 16:08:38 +08:00
|
|
|
const visibleDialog = ref(false);
|
|
|
|
|
const pageData = reactive({
|
|
|
|
|
tableData: [],
|
|
|
|
|
keyCount: 0,
|
|
|
|
|
tableConfiger: {
|
|
|
|
|
rowHieght: 61,
|
|
|
|
|
showSelectType: "radio",
|
|
|
|
|
loading: false,
|
|
|
|
|
haveControls:false
|
2025-09-22 17:25:44 +08:00
|
|
|
},
|
2025-09-26 16:08:38 +08:00
|
|
|
tableHeight:500,
|
|
|
|
|
pageConfiger: {
|
|
|
|
|
pageSize: 20,
|
|
|
|
|
pageCurrent: 1
|
2025-09-22 17:25:44 +08:00
|
|
|
},
|
2025-09-26 16:08:38 +08:00
|
|
|
controlsWidth: 180,
|
|
|
|
|
tableColumn: [
|
|
|
|
|
{ label: "单位名称", prop: "dwmc" },
|
|
|
|
|
{ label: "信用代码", prop: "xydm" },
|
|
|
|
|
{ label: "场所名称", prop: "csmc" },
|
|
|
|
|
{ label: "场所电话", prop: "csLxdh" }
|
|
|
|
|
]
|
|
|
|
|
});
|
2025-09-22 17:25:44 +08:00
|
|
|
|
|
|
|
|
const formData = ref({})
|
2025-09-26 16:08:38 +08:00
|
|
|
const loading = ref(false)
|
|
|
|
|
const handleClose = () => {
|
|
|
|
|
formData.value = {};
|
|
|
|
|
visibleDialog.value = false;
|
|
|
|
|
}
|
2025-09-22 17:25:44 +08:00
|
|
|
|
2025-09-26 16:08:38 +08:00
|
|
|
const chooseData = (row) => {
|
|
|
|
|
formData.value.pxgsdm = row[0].id;
|
|
|
|
|
formData.value.pxgsid = row[0].id;
|
|
|
|
|
formData.value.pxgs = row[0].dwmc;
|
2025-09-22 17:25:44 +08:00
|
|
|
}
|
|
|
|
|
|
2025-09-26 16:08:38 +08:00
|
|
|
const handleSubmit = async () => {
|
|
|
|
|
if(!formData.value.pxgsid) return proxy.$message.error('请选择公司');
|
|
|
|
|
loading.value = true;
|
|
|
|
|
let data = { ...formData.value }
|
|
|
|
|
data.sfzh = data.zjhm;
|
|
|
|
|
await qcckPost(data, `/mosty-base/baxx/basq/edit`)
|
|
|
|
|
await qcckPost(data, `/mosty-base/baxx/pxry/add`)
|
|
|
|
|
loading.value = false
|
|
|
|
|
proxy.$message.success('培训公司保存成功')
|
|
|
|
|
emits('refresh')
|
|
|
|
|
handleClose()
|
2025-09-22 17:25:44 +08:00
|
|
|
}
|
|
|
|
|
|
2025-09-26 16:08:38 +08:00
|
|
|
function open(row) {
|
|
|
|
|
pageData.keyCount++;
|
|
|
|
|
formData.value = row;
|
|
|
|
|
visibleDialog.value = true;
|
|
|
|
|
getList();
|
2025-09-22 17:25:44 +08:00
|
|
|
}
|
|
|
|
|
|
2025-09-26 16:08:38 +08:00
|
|
|
function getList () {
|
|
|
|
|
pageData.tableConfiger.loading = true;
|
2025-09-26 16:55:18 +08:00
|
|
|
qcckPost({ keyword : localStorage.getItem('idEntityCard') }, "/mosty-base/baxx/dwgl/list").then((res) => {
|
2025-09-26 16:08:38 +08:00
|
|
|
let arr = res || []
|
|
|
|
|
pageData.tableData = arr.filter(item => item.type == '02')
|
|
|
|
|
pageData.tableConfiger.loading = false;
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
pageData.tableConfiger.loading = false;
|
|
|
|
|
});
|
2025-09-22 17:25:44 +08:00
|
|
|
}
|
|
|
|
|
|
2025-09-26 16:08:38 +08:00
|
|
|
defineExpose({
|
|
|
|
|
open
|
|
|
|
|
})
|
2025-09-22 17:25:44 +08:00
|
|
|
</script>
|