更新数据
This commit is contained in:
@ -93,6 +93,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import * as MOSTY from "@/components/MyComponents/index";
|
||||
import PageTitle from "@/components/aboutTable/PageTitle.vue";
|
||||
import MyTable from "@/components/aboutTable/MyTable.vue";
|
||||
import Pages from "@/components/aboutTable/Pages.vue";
|
||||
@ -117,7 +118,6 @@ const searchConfiger = ref([
|
||||
{ label: "结束时间", prop: 'zxjssj', placeholder: "请选择结束时间", showType: "date" },
|
||||
{ label: "指向地点", prop: 'zxdz', placeholder: "请输入指向地点", showType: "input" },
|
||||
]);
|
||||
const elForm = ref()
|
||||
const chooseRow = ref({})
|
||||
const rules = reactive({
|
||||
bhyy:false,
|
||||
|
@ -2,6 +2,9 @@
|
||||
<div class="dialog" v-if="dialogForm">
|
||||
<div class="head_box">
|
||||
<span class="title">人力情报信息采集流转详情</span>
|
||||
<div>
|
||||
<el-button @click="close">关闭</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form_cnt">
|
||||
<FormMessage disabled v-model="listQuery" :formList="formData" ref="elform" :rules="rules">
|
||||
@ -41,12 +44,12 @@
|
||||
</template>
|
||||
<!-- 操作 -->
|
||||
<template #controls="{ row,index }">
|
||||
<el-link size="small" type="success" @click="addEdit('detail', row,index)">编辑</el-link>
|
||||
<el-link size="small" type="success" @click="addEdit('detail', row,index)">详情</el-link>
|
||||
</template>
|
||||
</MyTable>
|
||||
</div>
|
||||
<!-- 人员 -->
|
||||
<AddPeo ref="showAdd" :dic="props.dic" @change="getPeo"></AddPeo>
|
||||
<AddPeo ref="showAdd" :dic="props.dic" ></AddPeo>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -136,37 +139,6 @@ const addEdit = (type,row,index) =>{
|
||||
showAdd.value.init(type,row,index)
|
||||
}
|
||||
|
||||
// 新增人员
|
||||
const getPeo = (val) =>{
|
||||
if(val.type == '新增'){
|
||||
pageForm.tableData.push(val.data);
|
||||
}else{
|
||||
pageForm.tableData.splice(val.index, 1, val.data); // 在索引2的位置删除一个元素,并插入newValue
|
||||
}
|
||||
}
|
||||
|
||||
const deleteRow = (index) =>{
|
||||
pageForm.tableData.splice(index,1)
|
||||
}
|
||||
|
||||
// 提交
|
||||
const submit = () => {
|
||||
elform.value.submit((data) => {
|
||||
let url = title.value == "新增" ? "/mosty-gsxt/qbcj/add" : "/mosty-gsxt/qbcj/update";
|
||||
let params = { ...data ,ryList:pageForm.tableData,cjLx:'0'};
|
||||
params.fjdz = fjdz.value.length > 0 ? fjdz.value.join(','):'';
|
||||
loading.value = true;
|
||||
qcckPost(params, url).then((res) => {
|
||||
loading.value = false;
|
||||
proxy.$message({ type: "success", message: title.value + "成功" });
|
||||
emit("change");
|
||||
close();
|
||||
}).catch(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// 关闭
|
||||
const close = () => {
|
||||
fjdz.value = []
|
||||
@ -175,6 +147,7 @@ const close = () => {
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
|
||||
// 表格高度计算
|
||||
const tabHeightFn = () => {
|
||||
pageForm.tableHeight = window.innerHeight - 720;
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog v-model="showDialog" :destroy-on-close="true" :title="title+'人员'" @close="close" :close-on-click-modal="false">
|
||||
<el-dialog v-model="showDialog" :destroy-on-close="true" title="人员详情" @close="close" :close-on-click-modal="false">
|
||||
<FormMessage v-model="listQuery" :formList="formData" labelWidth="120px" ref="elform" :rules="rules">
|
||||
<template #bqList>
|
||||
<div class="marks pointer" >
|
||||
@ -52,10 +52,8 @@ const rules = reactive({
|
||||
hjd: [{ required: true, message: "请输入户籍地", trigger: "blur" }],
|
||||
})
|
||||
const title = ref('')
|
||||
const order = ref(null)
|
||||
const init = (type,row,index) =>{
|
||||
title.value = type == 'add' ? '新增' :'编辑';
|
||||
order.value = index;
|
||||
showDialog.value = true;
|
||||
if(row) listQuery.value = {...row};
|
||||
}
|
||||
|
Reference in New Issue
Block a user