|
@@ -12,7 +12,7 @@
|
|
|
<div class="mg-b-10">
|
|
|
<el-alert
|
|
|
:closable="false"
|
|
|
- title="选择需要关联的清表 注意:每次只能单选操作"
|
|
|
+ title="勾选试验划分节点,被勾选的节点数据将会汇总到当前台账分类中"
|
|
|
type="warning">
|
|
|
</el-alert>
|
|
|
</div>
|
|
@@ -21,12 +21,12 @@
|
|
|
style="width: 100%"
|
|
|
v-model="testGLExcelFrom.name"
|
|
|
placeholder="请选择"
|
|
|
- @change="changetherr()"
|
|
|
+ @change="changetherr"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="(item, key) in testGLExcelData"
|
|
|
:key="key"
|
|
|
- :label="item.name"
|
|
|
+ :label="item.projectName"
|
|
|
:value="item.id"
|
|
|
>
|
|
|
</el-option>
|
|
@@ -44,10 +44,10 @@
|
|
|
style="margin-top: 10px"
|
|
|
:props="testGLExcelProps"
|
|
|
:data="testexceldata"
|
|
|
- node-key="id"
|
|
|
+ node-key="primaryKeyId"
|
|
|
accordion
|
|
|
show-checkbox
|
|
|
- @check="checkchange"
|
|
|
+ @check-change="checkchange"
|
|
|
v-loading="testGLExcelLoading"
|
|
|
>
|
|
|
</el-tree>
|
|
@@ -63,7 +63,7 @@
|
|
|
style="margin-left: 30px"
|
|
|
type="primary"
|
|
|
v-throttle="2000"
|
|
|
- @click="saveLinkTab()"
|
|
|
+ @click="saveLink()"
|
|
|
>确 定</el-button
|
|
|
>
|
|
|
</span>
|
|
@@ -71,18 +71,19 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import {
|
|
|
- getList as getListQing,
|
|
|
- tabLazytreeAll,
|
|
|
- saveLinkTab,
|
|
|
- getExcelHtml,
|
|
|
-} from "@/api/exctab/excelmodel";
|
|
|
+
|
|
|
+import { getProjectList,findProjectTree } from "@/api/manager/projectinfo";
|
|
|
+import {matching} from "@/api/tentative/testcollect";
|
|
|
export default{
|
|
|
props: {
|
|
|
testGLExcel: {
|
|
|
type: Boolean,
|
|
|
default:false
|
|
|
},
|
|
|
+ setId:{
|
|
|
+ type:[String,Number],
|
|
|
+ default:''
|
|
|
+ }
|
|
|
|
|
|
},
|
|
|
data(){
|
|
@@ -100,9 +101,9 @@
|
|
|
testGLExcelData:[],
|
|
|
testexceldata:[],
|
|
|
testGLExcelProps: {
|
|
|
- label: "name",
|
|
|
+ label: "title",
|
|
|
children: "children",
|
|
|
- disabled: "hasChildren",
|
|
|
+ // disabled: "hasChildren",
|
|
|
isLeaf: function (data) {
|
|
|
let tag = false;
|
|
|
if (!data.hasChildren) {
|
|
@@ -127,13 +128,10 @@
|
|
|
|
|
|
this.testGLExcel = false;
|
|
|
},
|
|
|
- async tabLazytreeAll() {
|
|
|
+ async tabLazytreeAll(val,pid) {
|
|
|
//清表树信息
|
|
|
this.GLExcelLoading = true;
|
|
|
- const { data: res } = await tabLazytreeAll({
|
|
|
- modeId: this.testGLExcelFrom.name,
|
|
|
- name: this.testGLExcelFrom.search,
|
|
|
- });
|
|
|
+ const { data: res } = await findProjectTree(val,pid);
|
|
|
this.testGLExcelLoading = false;
|
|
|
console.log(res);
|
|
|
if (res.code === 200 && res.msg === "操作成功") {
|
|
@@ -141,18 +139,21 @@
|
|
|
}
|
|
|
},
|
|
|
async getList(da) {
|
|
|
- //获取清表模板信息
|
|
|
- const { data: res } = await getListQing(da);
|
|
|
- console.log(res);
|
|
|
- if (res.code === 200 && res.msg === "操作成功") {
|
|
|
- this.testGLExcelData = res.data.records;
|
|
|
- }
|
|
|
+ getProjectList(1, 999).then((res) => {
|
|
|
+ this.testGLExcelData = res.data.data.records;
|
|
|
+ });
|
|
|
+
|
|
|
},
|
|
|
- changetherr() {
|
|
|
- //清表类型选择框change事件
|
|
|
+ changetherr(val) {
|
|
|
if (this.testGLExcelFrom.name != "") {
|
|
|
this.testGLExcelFrom.search = "";
|
|
|
- this.tabLazytreeAll();
|
|
|
+ let pid=''
|
|
|
+ this.testGLExcelData.forEach((ele)=>{
|
|
|
+ if(ele.id===val){
|
|
|
+ pid=ele.referenceWbsTemplateIdTrial
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.tabLazytreeAll(val,pid);
|
|
|
}
|
|
|
},
|
|
|
filterNode222(value,data,node) {
|
|
@@ -169,19 +170,35 @@
|
|
|
return result;
|
|
|
},
|
|
|
getReturnNode2(node,_array,value){
|
|
|
- let isPass = node.data && node.data.name && node.data.name.indexOf(value) !== -1;
|
|
|
+ let isPass = node.data && node.data.title && node.data.title.indexOf(value) !== -1;
|
|
|
isPass?_array.push(isPass):'';
|
|
|
if(!isPass && node.level!=1 && node.parent){
|
|
|
this.getReturnNode2(node.parent,_array,value);
|
|
|
}
|
|
|
},
|
|
|
- checkchange(data) {
|
|
|
- //节点选中回调
|
|
|
- if (this.$refs.tree.getCheckedNodes().length === 0) {
|
|
|
- this.$refs.tree.setCheckedKeys([]);
|
|
|
- } else if (this.$refs.tree.getCheckedNodes().length >= 1) {
|
|
|
- this.$refs.tree.setCheckedKeys([data.id]);
|
|
|
- }
|
|
|
+ checkchange(data1,data2,data3) {
|
|
|
+
|
|
|
+ },
|
|
|
+ saveLink(){
|
|
|
+ let checkIds=this.$refs.tree.getCheckedKeys()
|
|
|
+ if(checkIds.length==0){
|
|
|
+ this.$message.warning('请选择关联的内容')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ matching({
|
|
|
+ classId:this.setId,
|
|
|
+ ids:checkIds.join(',')
|
|
|
+ }).then(() => {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ });
|
|
|
+ this.testGLExcel=false
|
|
|
+ }, error => {
|
|
|
+
|
|
|
+ console.log(error);
|
|
|
+ });
|
|
|
+
|
|
|
},
|
|
|
},
|
|
|
watch:{
|
|
@@ -200,6 +217,9 @@
|
|
|
this.$refs.tree.filter(val);
|
|
|
}
|
|
|
},
|
|
|
+ setId(val){
|
|
|
+ this.setId=val
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|