修改bug

This commit is contained in:
yangjun 2024-08-22 11:20:15 +08:00
parent 2a4f3b5b07
commit 27bd145d82
3 changed files with 131 additions and 12 deletions

View File

@ -113,6 +113,20 @@
</template>
</a-table>
</a-col>
<!-- 自增表格两列关联 10 -->
<a-col v-else-if="item.type === '10'" :span="24">
<div><a-button type="primary" @click="handleZzbg(item)">新增</a-button> </div>
<a-table :columns="getTableZzColumns(item.zyJxdgPzxxList)" :dataSource="item.list" :pagination="false">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<a-button type="danger" @click="handleZzbgDel(item.list, record.sort)">删除</a-button>
</template>
<template v-else>
<a-input placeholder="请输入内容" v-model:value="record[column.key]" @blur="handleTwoGlxm(item)" style="width: 100%"></a-input>
</template>
</template>
</a-table>
</a-col>
<a-col v-else> </a-col>
@ -131,7 +145,7 @@
import { defineComponent, ref, reactive, computed, toRaw, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useValidateAntFormAndTable } from '/@/hooks/system/useJvxeMethods';
import { queryZyJxdgMainListByMainId, queryZyJxdgMainListByMainId2, saveOrUpdate2,queryDataById2 } from '../ZyJxdgBanben.api';
import { queryZyJxdgMainListByMainId, queryZyJxdgMainListByMainId2, saveOrUpdate2, queryDataById2 } from '../ZyJxdgBanben.api';
import { JVxeTable } from '/@/components/jeecg/JVxeTable';
import { zyJxdgMainColumns } from '../ZyJxdgBanben.data';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
@ -368,11 +382,11 @@ export default defineComponent({
key: 'action',
};
columns.push(inePar2);
console.log('👺11111111', columns);
return columns;
}
//
function handleGlxm(item) {
console.log('👩‍🍳', item);
var sfsglxm = item.sfsglxm;
if (sfsglxm == '1') {
//
@ -395,6 +409,7 @@ export default defineComponent({
}
//
var item3 = item2.zyJxdgPzxxList;
console.log('👶', item3);
if (item3 != null && item3.length > 0) {
item2.list.push({ [item3[0].id]: title });
}
@ -404,6 +419,47 @@ export default defineComponent({
}
}
}
//
function handleTwoGlxm(item) {
var sfsglxm = item.sfsglxm;
if (sfsglxm == '1') {
//
var list1 = item.list; //
if (list1 != null) {
//
var sort = item.sort; //
var alllist = zyJxdgMainTable.dataSource; //
for (var j = 0; j < alllist.length; j++) {
for (var i = 0; i < list1.length; i++) {
var item1 = list1[i];
var item2 = alllist[j]; //
item2.list = item2.list || [];
if (item2.guanlian == sort) {
//
var item3 = item.zyJxdgPzxxList;
var item4 = item2.zyJxdgPzxxList;
console.log('🤐', item2);
console.log('🕵️‍♀️', item3);
var title1 = item1[item3[0].id];
var title2 = item1[item3[1].id];
console.log('🧜title', title1, title2);
//
if (i == 0) {
//
item2.list = [];
}
console.log('👶', item3);
if (item3 != null && item3.length > 0) {
item2.list.push({ [item4[0].id]: title1, [item4[1].id]: title2 });
}
}
}
}
}
}
}
return {
zyJxdgMainTableRef,
@ -434,6 +490,7 @@ export default defineComponent({
handleGlxm,
handleZzbg,
handleZzbgDel,
handleTwoGlxm,
};
},
});

View File

@ -22,6 +22,7 @@
自增富文本 7
自增多行文本 8
自增表格 9
自增表格两列关联10
-->
<a-row>
<a-col :span="24" v-for="(item, index) in zyJxdgMainTable.dataSource" :key="index">
@ -46,7 +47,7 @@
<a-form v-bind="formItemLayout">
<a-row>
<a-col v-for="(item2, index2) in item.zyJxdgPzxxList" :key="index2" :span="12">
<a-form-item :label="item2.title"><a-input :placeholder="`请输入` + item2.title" v-model:value="item2.content"/></a-form-item>
<a-form-item :label="item2.title"><a-input :placeholder="`请输入` + item2.title" v-model:value="item2.content" /></a-form-item>
<!-- {{ item2.title }}:<a-input placeholder="请输入内容" style="width:60%;"></a-input> -->
</a-col>
</a-row>
@ -113,6 +114,21 @@
</template>
</a-table>
</a-col>
<!-- 自增表格两列关联 10 -->
<a-col v-else-if="item.type === '10'" :span="24">
<div><a-button type="primary" @click="handleZzbg(item)">新增</a-button> </div>
-{{ getTableZzColumns(item.zyJxdgPzxxList) }}-
<a-table :columns="getTableZzColumns(item.zyJxdgPzxxList)" :dataSource="item.list" :pagination="false">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<a-button type="danger" @click="handleZzbgDel(item.list, record.sort)">删除</a-button>
</template>
<template v-else>
<a-input placeholder="请输入内容" v-model:value="record[column.key]" @blur="handleTwoGlxm(item)" style="width: 100%"></a-input>
</template>
</template>
</a-table>
</a-col>
<a-col v-else> </a-col>
@ -230,13 +246,13 @@ export default defineComponent({
console.log('✋', alllist);
var values = {
id:'',
rwbh:'202320242000629',
banbenId:oldInfo.value.id,
teacherNo:'2002900106',
sffb:'0',
list:alllist,
}
id: '',
rwbh: '202320242000629',
banbenId: oldInfo.value.id,
teacherNo: '2002900106',
sffb: '0',
list: alllist,
};
// const mainData = await getFormData();
// const subData = zyJxdgMainTable.dataSource;
// const values = Object.assign({}, dbData, mainData);
@ -367,15 +383,18 @@ export default defineComponent({
}
//
function handleGlxm(item) {
console.log('👩‍🍳', item);
console.log('👩‍🍳item', item);
var sfsglxm = item.sfsglxm;
if (sfsglxm == '1') {
//
var list1 = item.list; //
console.log('👨🔧list1', list1);
if (list1 != null) {
//
var sort = item.sort; //
console.log('💆sort', sort);
var alllist = zyJxdgMainTable.dataSource; //
console.log('🧜alllist', alllist);
for (var j = 0; j < alllist.length; j++) {
for (var i = 0; i < list1.length; i++) {
var item1 = list1[i];
@ -400,6 +419,48 @@ export default defineComponent({
}
}
//
function handleTwoGlxm(item) {
var sfsglxm = item.sfsglxm;
if (sfsglxm == '1') {
//
var list1 = item.list; //
if (list1 != null) {
//
var sort = item.sort; //
var alllist = zyJxdgMainTable.dataSource; //
for (var j = 0; j < alllist.length; j++) {
for (var i = 0; i < list1.length; i++) {
var item1 = list1[i];
var item2 = alllist[j]; //
item2.list = item2.list || [];
if (item2.guanlian == sort) {
//
var item3 = item.zyJxdgPzxxList;
var item4 = item2.zyJxdgPzxxList;
console.log('🤐', item2);
console.log('🕵️‍♀️', item3);
var title1 = item1[item3[0].id];
var title2 = item1[item3[1].id];
console.log('🧜title', title1, title2);
//
if (i == 0) {
//
item2.list = [];
}
console.log('👶', item3);
if (item3 != null && item3.length > 0) {
item2.list.push({ [item4[0].id]: title1, [item4[1].id]: title2 });
}
}
}
}
}
}
}
return {
zyJxdgMainTableRef,
zyJxdgMainTable,
@ -429,6 +490,7 @@ export default defineComponent({
handleGlxm,
handleZzbg,
handleZzbgDel,
handleTwoGlxm,
};
},
});

View File

@ -52,7 +52,7 @@
富文本 3
表单 4
表格 5 -->
<a-col v-if="item.type==='4' || item.type==='5' || item.type==='9'">
<a-col v-if="item.type==='4' || item.type==='5' || item.type==='9'|| item.type==='10'">
<a-row>
<a-col :span="24">
<a-button type="primary" @click="handleTwoType(item)">新增字段</a-button>