|
|
@ -95,131 +95,7 @@ |
|
|
</el-form> |
|
|
</el-form> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
</template> |
|
|
</template> |
|
|
<<<<<<< HEAD |
|
|
|
|
|
<script lang="ts" setup> |
|
|
|
|
|
import { reactive } from "vue"; |
|
|
|
|
|
import {tarlist,addPostCont,addtarget,getgroupuser,addposttargetcont,search_orgpost} from '@/api/opk/api' |
|
|
|
|
|
import {editPostCont} from '@/api/opk/pulic/api' |
|
|
|
|
|
import { ge_add } from '@/api/opk/news/api' |
|
|
|
|
|
import { create_scheme } from '@/api/opk/zxy/news/api' |
|
|
|
|
|
|
|
|
|
|
|
interface FormInfo { |
|
|
|
|
|
id: string; |
|
|
|
|
|
age: string; |
|
|
|
|
|
name: string; |
|
|
|
|
|
sex: string; |
|
|
|
|
|
ccc: string; |
|
|
|
|
|
ade: string; |
|
|
|
|
|
sort: number; |
|
|
|
|
|
title: string; |
|
|
|
|
|
type: number; |
|
|
|
|
|
} |
|
|
|
|
|
const isshow = ref(false) |
|
|
|
|
|
const props= defineProps( { |
|
|
|
|
|
title: { |
|
|
|
|
|
type: String, |
|
|
|
|
|
default: "", |
|
|
|
|
|
}, |
|
|
|
|
|
addPostBox: { |
|
|
|
|
|
type: Boolean, |
|
|
|
|
|
default: false, |
|
|
|
|
|
}, |
|
|
|
|
|
addrowInfo: { |
|
|
|
|
|
type: Object as () => FormInfo, |
|
|
|
|
|
default() { |
|
|
|
|
|
return {}; |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
arrayNum: { |
|
|
|
|
|
type: Number, |
|
|
|
|
|
default: 0, |
|
|
|
|
|
}, |
|
|
|
|
|
}); |
|
|
|
|
|
const orgTreeProps ={ |
|
|
|
|
|
label: 'name', |
|
|
|
|
|
children:'child' |
|
|
|
|
|
} |
|
|
|
|
|
const orgTreeProp = { |
|
|
|
|
|
label:'title', |
|
|
|
|
|
children:'children' |
|
|
|
|
|
} |
|
|
|
|
|
const emit = defineEmits(["update:addPostBox","editRow","addRow"]) |
|
|
|
|
|
const formData = reactive({ |
|
|
|
|
|
deaprtname:"", |
|
|
|
|
|
value1:"", |
|
|
|
|
|
asd:[] as string[], |
|
|
|
|
|
lzq:"", |
|
|
|
|
|
}) |
|
|
|
|
|
const tableData = ref<any>([]) |
|
|
|
|
|
function jjjs(){ |
|
|
|
|
|
addPostCont("/hrapi/org/govthree","post") |
|
|
|
|
|
.then(data => { |
|
|
|
|
|
tableData.value = data.data[3].child[14].child; |
|
|
|
|
|
}) |
|
|
|
|
|
.catch(error => { |
|
|
|
|
|
console.error('Error fetching data:', error); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
jjjs() |
|
|
|
|
|
const handle = (data:any)=>{ |
|
|
|
|
|
formData.deaprtname = data.id; |
|
|
|
|
|
ge_adds() |
|
|
|
|
|
} |
|
|
|
|
|
//行政组织 |
|
|
|
|
|
const tablea = ref<any>([]) |
|
|
|
|
|
function ge_adds(){ |
|
|
|
|
|
const add = formData.deaprtname.toString() |
|
|
|
|
|
ge_add({id:add}) |
|
|
|
|
|
.then(data => { |
|
|
|
|
|
tablea.value = data.data; |
|
|
|
|
|
}) |
|
|
|
|
|
.catch(error => { |
|
|
|
|
|
console.error('Error fetching data:', error); |
|
|
|
|
|
}).finally(()=>{ |
|
|
|
|
|
isshow.value = false |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
ge_adds() |
|
|
|
|
|
// 关闭弹窗 |
|
|
|
|
|
const handleClose = ()=> { |
|
|
|
|
|
emit("update:addPostBox", false); |
|
|
|
|
|
} |
|
|
|
|
|
const handleDel = (val:any) => { |
|
|
|
|
|
ElMessageBox.confirm("你确定删除这条信息吗?", "提示", { |
|
|
|
|
|
confirmButtonText: "确认", |
|
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
|
type: "warning", |
|
|
|
|
|
}) |
|
|
|
|
|
handleSure(val) |
|
|
|
|
|
console.log(val.id) |
|
|
|
|
|
}; |
|
|
|
|
|
const handleSure = (val:any)=> { |
|
|
|
|
|
const index = tableData.value.findIndex((item:any) => item.id === val.id); |
|
|
|
|
|
if(index!=-1){ |
|
|
|
|
|
tableData.value.splice(index, 1); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
const submitForm=()=> { |
|
|
|
|
|
const add = formData.deaprtname.toString() |
|
|
|
|
|
const ess = new Date(formData.value1).getFullYear() |
|
|
|
|
|
const see = ess.toString() |
|
|
|
|
|
if (props.addrowInfo.name) { |
|
|
|
|
|
// 修改 |
|
|
|
|
|
const id = props.addrowInfo; // 假设你有一个唯一的ID来识别要修改的项 |
|
|
|
|
|
emit("editRow", formData); |
|
|
|
|
|
} else { |
|
|
|
|
|
// 新增 |
|
|
|
|
|
create_scheme({orgid:add,year:see,child:tablea._value}) |
|
|
|
|
|
.then((response:any) => { |
|
|
|
|
|
if (response.code === 200) { |
|
|
|
|
|
ElMessage.success("新增成功"); |
|
|
|
|
|
emit("addRow", formData); |
|
|
|
|
|
} else { |
|
|
|
|
|
ElMessage.error("新增成功"); |
|
|
|
|
|
handleClose() |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
======= |
|
|
|
|
|
<script lang="ts" setup> |
|
|
<script lang="ts" setup> |
|
|
import { reactive } from "vue"; |
|
|
import { reactive } from "vue"; |
|
|
import { |
|
|
import { |
|
|
@ -240,7 +116,7 @@ const getSummaries = (param: any) => { |
|
|
if (index === 0) { |
|
|
if (index === 0) { |
|
|
formData.sums[index] = "合计"; |
|
|
formData.sums[index] = "合计"; |
|
|
return; |
|
|
return; |
|
|
>>>>>>> luzhiqiang_v1 |
|
|
|
|
|
} |
|
|
} |
|
|
const values = data.map((item) => Number(item[column.property])); |
|
|
const values = data.map((item) => Number(item[column.property])); |
|
|
if (!values.every((value) => Number.isNaN(value))) { |
|
|
if (!values.every((value) => Number.isNaN(value))) { |
|
|
|