|
@@ -200,7 +200,7 @@
|
|
|
|
|
|
import {
|
|
import {
|
|
getList,
|
|
getList,
|
|
- userInfo, partnerList, fieldDel, cooperatorEdit, findTemplateFieldByNum, fieldListBase
|
|
|
|
|
|
+ userInfo, partnerList, fieldDel, cooperatorEdit, findBaseFieldByNo, fieldListBase, fieldListDerive,findDeriveFieldByNo
|
|
} from '@/api/index.js'
|
|
} from '@/api/index.js'
|
|
import store from "@/store";
|
|
import store from "@/store";
|
|
import request from '@/utils/request.js'
|
|
import request from '@/utils/request.js'
|
|
@@ -228,7 +228,12 @@ export default {
|
|
fieldBaseShow:[],
|
|
fieldBaseShow:[],
|
|
fieldDerive:[],
|
|
fieldDerive:[],
|
|
fieldBaseSelected:[],
|
|
fieldBaseSelected:[],
|
|
|
|
+ fieldBaseSelectedOld:[],
|
|
|
|
+
|
|
fieldDeriveSelected:[],
|
|
fieldDeriveSelected:[],
|
|
|
|
+ fieldDeriveSelectedOld:[],
|
|
|
|
+ fieldTemplateDerive:[],
|
|
|
|
+ fieldTemplateBase:[],
|
|
baseTotal:'',
|
|
baseTotal:'',
|
|
deriveTotal:'',
|
|
deriveTotal:'',
|
|
allField: [],
|
|
allField: [],
|
|
@@ -255,7 +260,11 @@ export default {
|
|
templateNo:this.$route.query.templateNo,
|
|
templateNo:this.$route.query.templateNo,
|
|
templateName:this.$route.query.templateName,
|
|
templateName:this.$route.query.templateName,
|
|
fieldBaseSelected:[],
|
|
fieldBaseSelected:[],
|
|
|
|
+ fieldBaseSelectedOld:[],
|
|
|
|
+
|
|
fieldDeriveSelected:[],
|
|
fieldDeriveSelected:[],
|
|
|
|
+ fieldDeriveSelectedOld:[],
|
|
|
|
+
|
|
// status:this.$route.query.status,
|
|
// status:this.$route.query.status,
|
|
// createBy:'',
|
|
// createBy:'',
|
|
// createTime:'',
|
|
// createTime:'',
|
|
@@ -270,16 +279,77 @@ export default {
|
|
|
|
|
|
mounted()
|
|
mounted()
|
|
{
|
|
{
|
|
- findTemplateFieldByNum(this.templateNo,this.currentPage1,this.pagesize1).then(
|
|
|
|
- res=>
|
|
|
|
- {
|
|
|
|
- this.fieldBase=res.data.base_field.list;
|
|
|
|
- this.fieldBaseShow = this.fieldBase
|
|
|
|
-
|
|
|
|
- var j = parseInt(res.data.base_field.total)
|
|
|
|
- this.baseTotal = j
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
|
|
+ fieldListBase(this.currentPage1,this.pagesize1).then(
|
|
|
|
+ res=>
|
|
|
|
+ {
|
|
|
|
+ this.fieldBase=res.data.fieldListBase.list;
|
|
|
|
+ this.fieldBaseShow = this.fieldBase
|
|
|
|
+ var j = parseInt(res.data.fieldListBase.total)
|
|
|
|
+ this.baseTotal = j
|
|
|
|
+ findBaseFieldByNo(this.templateNo,this.currentPage1,this.pagesize1).then(
|
|
|
|
+ res=>
|
|
|
|
+ {
|
|
|
|
+ this.fieldTemplateBase=res.data.base_field.list;
|
|
|
|
+ for (let i = 0; i < this.fieldTemplateBase.length; i++) {
|
|
|
|
+ if (!this.fieldBaseSelected.includes(this.fieldTemplateBase[i].fieldDefineId)) {
|
|
|
|
+ // 回显数据里没有本条,把这条加进来(选中)
|
|
|
|
+ this.fieldBaseSelected.push(this.fieldTemplateBase[i].fieldDefineId);
|
|
|
|
+ this.fieldBaseSelectedOld.push(this.fieldTemplateBase[i].id);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.fieldBase.forEach(item => {
|
|
|
|
+ // 重点: 在当前分页列表中查询与回显数据是否有一致的id,一致则勾选数据回显
|
|
|
|
+ // toggleRowSelection(item, true):设置当前行数据为选中状态
|
|
|
|
+ if (this.fieldBaseSelected.includes(item.id)) {
|
|
|
|
+ this.$refs.baseTable.toggleRowSelection(item, true);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ console.log("adshkjagsdhiuka")
|
|
|
|
+ console.log(this.fieldTemplateBase)
|
|
|
|
+
|
|
|
|
+ console.log(this.fieldBaseSelectedOld)
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ // console.log(this.fieldBase)
|
|
|
|
+ }
|
|
|
|
+ )
|
|
|
|
+ fieldListDerive(this.currentPage2,this.pagesize2).then(
|
|
|
|
+ res=>
|
|
|
|
+ {
|
|
|
|
+ this.fieldDerive=res.data.fieldListDerive.list;
|
|
|
|
+
|
|
|
|
+ this.fieldDeriveShow = this.fieldDerive
|
|
|
|
+ var k = parseInt(res.data.fieldListDerive.total)
|
|
|
|
+ this.deriveTotal = k
|
|
|
|
+ findDeriveFieldByNo(this.templateNo,this.currentPage2,this.pagesize2).then(
|
|
|
|
+ res=>
|
|
|
|
+ {
|
|
|
|
+ this.fieldTemplateDerive=res.data.derive_field.list;
|
|
|
|
+ for (let i = 0; i < this.fieldTemplateDerive.length; i++) {
|
|
|
|
+ if (!this.fieldDeriveSelected.includes(this.fieldTemplateDerive[i].fieldDefineId)) {
|
|
|
|
+ // 回显数据里没有本条,把这条加进来(选中)
|
|
|
|
+ this.fieldDeriveSelected.push(this.fieldTemplateDerive[i].fieldDefineId);
|
|
|
|
+ this.fieldDeriveSelectedOld.push(this.fieldTemplateDerive[i].id);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.fieldDerive.forEach(item => {
|
|
|
|
+ // 重点: 在当前分页列表中查询与回显数据是否有一致的id,一致则勾选数据回显
|
|
|
|
+ // toggleRowSelection(item, true):设置当前行数据为选中状态
|
|
|
|
+ if (this.fieldDeriveSelected.includes(item.id)) {
|
|
|
|
+ this.$refs.deriveTable.toggleRowSelection(item, true);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ console.log(this.fieldDeriveSelectedOld)
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ // console.log(this.fieldDerive)
|
|
|
|
+ }
|
|
|
|
+ )
|
|
|
|
+
|
|
},
|
|
},
|
|
beforeUpdate() {},
|
|
beforeUpdate() {},
|
|
updated() {},
|
|
updated() {},
|
|
@@ -301,12 +371,13 @@ export default {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+
|
|
handleCurrentChange1:function(currentPage){
|
|
handleCurrentChange1:function(currentPage){
|
|
this.currentPage1=currentPage;
|
|
this.currentPage1=currentPage;
|
|
- findTemplateFieldByNum(this.templateNo,this.currentPage1,this.pagesize1).then(
|
|
|
|
|
|
+ fieldListBase(this.currentPage1,this.pagesize1).then(
|
|
res=>
|
|
res=>
|
|
{
|
|
{
|
|
- this.fieldBase=res.data.base_field.list;
|
|
|
|
|
|
+ this.fieldBase=res.data.fieldListBase.list;
|
|
this.fieldBaseShow = this.fieldBase
|
|
this.fieldBaseShow = this.fieldBase
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
this.fieldBase.forEach(item => {
|
|
this.fieldBase.forEach(item => {
|
|
@@ -322,10 +393,10 @@ export default {
|
|
},
|
|
},
|
|
handleSizeChange1:function(size){
|
|
handleSizeChange1:function(size){
|
|
this.pagesize1=size;
|
|
this.pagesize1=size;
|
|
- findTemplateFieldByNum(this.templateNo,this.currentPage1,this.pagesize1).then(
|
|
|
|
|
|
+ fieldListBase(this.currentPage1,this.pagesize1).then(
|
|
res=>
|
|
res=>
|
|
{
|
|
{
|
|
- this.fieldBase=res.data.base_field.list;
|
|
|
|
|
|
+ this.fieldBase=res.data.fieldListBase.list;
|
|
this.fieldBaseShow = this.fieldBase
|
|
this.fieldBaseShow = this.fieldBase
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
this.fieldBase.forEach(item => {
|
|
this.fieldBase.forEach(item => {
|
|
@@ -339,6 +410,63 @@ export default {
|
|
}
|
|
}
|
|
)
|
|
)
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+ handleSelectionChange2(selecteds, row) {
|
|
|
|
+ if (!this.fieldDeriveSelected.includes(row.id)) {
|
|
|
|
+ // 回显数据里没有本条,把这条加进来(选中)
|
|
|
|
+ this.fieldDeriveSelected.push(row.id);
|
|
|
|
+ console.log(this.fieldDeriveSelected)
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ // 回显数据里有本条,把这条删除(取消选中)
|
|
|
|
+ this.fieldDeriveSelected.forEach((id, index) => {
|
|
|
|
+ if (id === row.id) {
|
|
|
|
+ this.fieldDeriveSelected.splice(index, 1);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ handleCurrentChange2:function(currentPage){
|
|
|
|
+ this.currentPage2=currentPage;
|
|
|
|
+ fieldListDerive(this.currentPage2,this.pagesize2).then(
|
|
|
|
+ res=>
|
|
|
|
+ {
|
|
|
|
+ this.fieldDerive=res.data.fieldListDerive.list;
|
|
|
|
+
|
|
|
|
+ this.fieldDeriveShow = this.fieldDerive
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.fieldDerive.forEach(item => {
|
|
|
|
+ // 重点: 在当前分页列表中查询与回显数据是否有一致的id,一致则勾选数据回显
|
|
|
|
+ // toggleRowSelection(item, true):设置当前行数据为选中状态
|
|
|
|
+ if (this.fieldDeriveSelected.includes(item.id)) {
|
|
|
|
+ this.$refs.deriveTable.toggleRowSelection(item, true);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ )
|
|
|
|
+ },
|
|
|
|
+ handleSizeChange2:function(size){
|
|
|
|
+ this.pagesize2=size;
|
|
|
|
+ fieldListDerive(this.currentPage2,this.pagesize2).then(
|
|
|
|
+ res=>
|
|
|
|
+ {
|
|
|
|
+ this.fieldDerive=res.data.fieldListDerive.list;
|
|
|
|
+
|
|
|
|
+ this.fieldDeriveShow = this.fieldDerive
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.fieldDerive.forEach(item => {
|
|
|
|
+ // 重点: 在当前分页列表中查询与回显数据是否有一致的id,一致则勾选数据回显
|
|
|
|
+ // toggleRowSelection(item, true):设置当前行数据为选中状态
|
|
|
|
+ if (this.fieldDeriveSelected.includes(item.id)) {
|
|
|
|
+ this.$refs.deriveTable.toggleRowSelection(item, true);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ )
|
|
|
|
+
|
|
|
|
+ },
|
|
handleClick(tab, event) {
|
|
handleClick(tab, event) {
|
|
if(tab.name=='second'){
|
|
if(tab.name=='second'){
|
|
this.gotolinkbusiness();
|
|
this.gotolinkbusiness();
|
|
@@ -379,6 +507,10 @@ export default {
|
|
this.templateData.templateNo = this.templateNo;
|
|
this.templateData.templateNo = this.templateNo;
|
|
this.templateData.templateName = this.templateName;
|
|
this.templateData.templateName = this.templateName;
|
|
this.templateData.fieldBaseSelected = this.fieldBaseSelected;
|
|
this.templateData.fieldBaseSelected = this.fieldBaseSelected;
|
|
|
|
+ this.templateData.fieldBaseSelectedOld = this.fieldBaseSelectedOld;
|
|
|
|
+
|
|
|
|
+ this.templateData.fieldDeriveSelected = this.fieldDeriveSelected;
|
|
|
|
+ this.templateData.fieldDeriveSelectedOld = this.fieldDeriveSelectedOld;
|
|
|
|
|
|
// this.templateData.status = this.status;
|
|
// this.templateData.status = this.status;
|
|
|
|
|