|
@@ -40,7 +40,150 @@
|
|
|
<!-- <el-input v-model="createTime" style="width:400px"></el-input>-->
|
|
|
<!-- </el-form-item>-->
|
|
|
</el-form>
|
|
|
+ <el-divider></el-divider>
|
|
|
|
|
|
+ <el-tabs v-model="activeName2" stretch>
|
|
|
+ <el-tab-pane label="基础字段" name="first">
|
|
|
+ <el-table :data="fieldBaseShow" style="width: 100%;" ref="baseTable"
|
|
|
+ @select="handleSelectionChange" :row-key="rowKey" stripe>
|
|
|
+ <el-table-column type="selection" :reserve-selection=true width="55" />
|
|
|
+ <el-table-column align="center" label="编号" width="100">
|
|
|
+ <template v-slot="{row}">
|
|
|
+ <span>{{ row.fieldNo}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+
|
|
|
+ <el-table-column align="center" label="字段名称(中文)" width="140">
|
|
|
+ <template v-slot="{row}">
|
|
|
+ <span>{{ row.nameZh}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column align="center" label="字段名称(英文)" width="140">
|
|
|
+ <template v-slot="{row}">
|
|
|
+ <span>{{ row.name}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column align="center" label="提取逻辑" width="100">
|
|
|
+ <template v-slot="{row}">
|
|
|
+ <span>{{ row.fetchLogic}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column align="center" label="类型" width="100">
|
|
|
+ <template v-slot="{row}">
|
|
|
+ <span>{{ row.type}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column prop="state" label="状态" width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.state ? '已启用' : '已禁用' }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column align="center" label="创建者" width="100">
|
|
|
+ <template v-slot="{row}">
|
|
|
+ <span>{{ row.createBy}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column align="center" label="创建时间" width="200">
|
|
|
+ <template v-slot="{row}">
|
|
|
+ <span>{{ row.createTime}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ </el-table>
|
|
|
+ <el-pagination background
|
|
|
+ @size-change="handleSizeChange1"
|
|
|
+ @current-change="handleCurrentChange1"
|
|
|
+ :current-page="currentPage1"
|
|
|
+ :page-size="pagesize1"
|
|
|
+ :page-sizes="[5,10,15]"
|
|
|
+
|
|
|
+ layout="total,jumper,prev, pager, next,sizes"
|
|
|
+ :total=baseTotal >
|
|
|
+ </el-pagination>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="衍生字段" name="second">
|
|
|
+
|
|
|
+ <el-table :data="fieldDerive"
|
|
|
+ ref="deriveTable"
|
|
|
+ style="width: 100%;"
|
|
|
+ @select="handleSelectionChange2" :row-key="rowKey" stripe>
|
|
|
+ <el-table-column type="selection" :reserve-selection=true width="55" />
|
|
|
+
|
|
|
+ <el-table-column align="center" label="编号" width="100">
|
|
|
+ <template v-slot="{row}">
|
|
|
+ <span>{{ row.fieldNo}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+
|
|
|
+ <el-table-column align="center" label="字段名称(中文)" width="140">
|
|
|
+ <template v-slot="{row}">
|
|
|
+ <span>{{ row.nameZh}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column align="center" label="字段名称(英文)" width="140">
|
|
|
+ <template v-slot="{row}">
|
|
|
+ <span>{{ row.name}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column align="center" label="提取逻辑" width="100">
|
|
|
+ <template v-slot="{row}">
|
|
|
+ <span>{{ row.fetchLogic}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column align="center" label="类型" width="100">
|
|
|
+ <template v-slot="{row}">
|
|
|
+ <span>{{ row.type}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column align="center" label="字段状态" width="100">
|
|
|
+ <template v-slot="{row}">
|
|
|
+ <span>{{ row.status}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column align="center" label="创建者" width="100">
|
|
|
+ <template v-slot="{row}">
|
|
|
+ <span>{{ row.createBy}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column align="center" label="创建时间" width="150">
|
|
|
+ <template v-slot="{row}">
|
|
|
+ <span>{{ row.createTime}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </el-table>
|
|
|
+ <el-pagination background
|
|
|
+ @size-change="handleSizeChange2"
|
|
|
+ @current-change="handleCurrentChange2"
|
|
|
+ :current-page="currentPage2"
|
|
|
+ :page-size="pagesize2"
|
|
|
+ :page-sizes="[5,10,15]"
|
|
|
+
|
|
|
+ layout="total,jumper,prev, pager, next,sizes"
|
|
|
+ :total=deriveTotal >
|
|
|
+ </el-pagination>
|
|
|
+ </el-tab-pane>
|
|
|
+
|
|
|
+
|
|
|
+ </el-tabs>
|
|
|
<el-button class="model_add_button " size="small" round type="primary" @click="submit()">完成</el-button>
|
|
|
<el-button class="model_add_button " size="small" round type="danger" @click="return_page()">返回</el-button>
|
|
|
|
|
@@ -57,7 +200,7 @@
|
|
|
|
|
|
import {
|
|
|
getList,
|
|
|
- userInfo, partnerList, fieldDel, cooperatorEdit
|
|
|
+ userInfo, partnerList, fieldDel, cooperatorEdit, findTemplateFieldByNum, fieldListBase
|
|
|
} from '@/api/index.js'
|
|
|
import store from "@/store";
|
|
|
import request from '@/utils/request.js'
|
|
@@ -77,11 +220,21 @@ export default {
|
|
|
|
|
|
activeName: "fourth",
|
|
|
currentPage1: 1,
|
|
|
- pagesize1:5,
|
|
|
-
|
|
|
+ pagesize1:10,
|
|
|
+ currentPage2: 1,
|
|
|
+ pagesize2:10,
|
|
|
fieldList : [],
|
|
|
fieldBase:[],
|
|
|
+ fieldBaseShow:[],
|
|
|
fieldDerive:[],
|
|
|
+ fieldBaseSelected:[],
|
|
|
+ fieldDeriveSelected:[],
|
|
|
+ baseTotal:'',
|
|
|
+ deriveTotal:'',
|
|
|
+ allField: [],
|
|
|
+ selectedNum:0,
|
|
|
+
|
|
|
+
|
|
|
fieldExtra:[],
|
|
|
selected1: true,
|
|
|
selected2: false,
|
|
@@ -101,6 +254,8 @@ export default {
|
|
|
templateId:this.$route.query.templateId,
|
|
|
templateNo:this.$route.query.templateNo,
|
|
|
templateName:this.$route.query.templateName,
|
|
|
+ fieldBaseSelected:[],
|
|
|
+ fieldDeriveSelected:[],
|
|
|
// status:this.$route.query.status,
|
|
|
// createBy:'',
|
|
|
// createTime:'',
|
|
@@ -115,13 +270,75 @@ export default {
|
|
|
|
|
|
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
|
|
|
+ }
|
|
|
+ );
|
|
|
},
|
|
|
beforeUpdate() {},
|
|
|
updated() {},
|
|
|
destroyed() {},
|
|
|
methods: {
|
|
|
request() {},
|
|
|
+ handleSelectionChange(selecteds, row) {
|
|
|
+ if (!this.fieldBaseSelected.includes(row.id)) {
|
|
|
+ // 回显数据里没有本条,把这条加进来(选中)
|
|
|
+ this.fieldBaseSelected.push(row.id);
|
|
|
+ console.log(this.fieldBaseSelected)
|
|
|
|
|
|
+ } else {
|
|
|
+ // 回显数据里有本条,把这条删除(取消选中)
|
|
|
+ this.fieldBaseSelected.forEach((id, index) => {
|
|
|
+ if (id === row.id) {
|
|
|
+ this.fieldBaseSelected.splice(index, 1);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleCurrentChange1:function(currentPage){
|
|
|
+ this.currentPage1=currentPage;
|
|
|
+ findTemplateFieldByNum(this.templateNo,this.currentPage1,this.pagesize1).then(
|
|
|
+ res=>
|
|
|
+ {
|
|
|
+ this.fieldBase=res.data.base_field.list;
|
|
|
+ this.fieldBaseShow = this.fieldBase
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.fieldBase.forEach(item => {
|
|
|
+ // 重点: 在当前分页列表中查询与回显数据是否有一致的id,一致则勾选数据回显
|
|
|
+ // toggleRowSelection(item, true):设置当前行数据为选中状态
|
|
|
+ if (this.fieldBaseSelected.includes(item.id)) {
|
|
|
+ this.$refs.baseTable.toggleRowSelection(item, true);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ )
|
|
|
+ },
|
|
|
+ handleSizeChange1:function(size){
|
|
|
+ this.pagesize1=size;
|
|
|
+ findTemplateFieldByNum(this.templateNo,this.currentPage1,this.pagesize1).then(
|
|
|
+ res=>
|
|
|
+ {
|
|
|
+ this.fieldBase=res.data.base_field.list;
|
|
|
+ this.fieldBaseShow = this.fieldBase
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.fieldBase.forEach(item => {
|
|
|
+ // 重点: 在当前分页列表中查询与回显数据是否有一致的id,一致则勾选数据回显
|
|
|
+ // toggleRowSelection(item, true):设置当前行数据为选中状态
|
|
|
+ if (this.fieldBaseSelected.includes(item.id)) {
|
|
|
+ this.$refs.baseTable.toggleRowSelection(item, true);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ )
|
|
|
+ },
|
|
|
handleClick(tab, event) {
|
|
|
if(tab.name=='second'){
|
|
|
this.gotolinkbusiness();
|
|
@@ -161,6 +378,8 @@ export default {
|
|
|
this.templateData.templateId = this.templateId;
|
|
|
this.templateData.templateNo = this.templateNo;
|
|
|
this.templateData.templateName = this.templateName;
|
|
|
+ this.templateData.fieldBaseSelected = this.fieldBaseSelected;
|
|
|
+
|
|
|
// this.templateData.status = this.status;
|
|
|
|
|
|
|
|
@@ -174,10 +393,8 @@ export default {
|
|
|
this.$router.push({
|
|
|
path: '/fieldTemplate',
|
|
|
query: {
|
|
|
-
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
},
|
|
|
),
|
|
|
console.log(this.templateData)
|