duy 1 month ago
parent
commit
aff9e1b08a

+ 9 - 0
src/api/ruleManage/codeRule.js

@@ -0,0 +1,9 @@
+import request from '@/router/axios';
+//获取试验编号规则
+export const getTrialNumberRule = (params) => {
+    return request({
+        url: '/api//blade-business/trialnumberrule/getTrialNumberRule',
+        method: 'get',
+        params
+    })
+}

+ 8 - 5
src/views/codeRule/LinkEle.vue

@@ -226,6 +226,8 @@ export default {
     return {
       visible: false,
       treeId: '', // 树节点ID
+      deatailId: '', // 详情ID
+
       paramList: [
         {
           symbolName: '<0.75',
@@ -267,12 +269,13 @@ export default {
     }
   },
   methods: {
-    show(val,treeId,id,projectid) {
+    show(val,treeId,id,projectid,deatailId) {
       this.getTableTypelist();
       this.visible = true
       if(val.length > 0&&val[0].name) {
         this.treeId = treeId
         this.id = id
+        this.deatailId = deatailId
         this.projectid = projectid
         this.paramList=val
         val.forEach((item,index)=>{
@@ -287,7 +290,7 @@ export default {
     async handleSelect(index) {
       this.activeIndex = index
       let leftId = this.paramList[index].id
-     let arr= await this.getRelationData(this.id,leftId)
+     let arr= await this.getRelationData(this.deatailId,leftId)
      
       if(arr.length>0){
           this.$nextTick(()=>{
@@ -344,7 +347,7 @@ export default {
   
     handleConfirm() {
       
-      saveElementJoin(this.linkListData,this.id).then((res)=>{
+      saveElementJoin(this.linkListData,this.deatailId).then((res)=>{
         if(res.data.code === 200) {
           this.$message({
             type: 'success',
@@ -382,7 +385,7 @@ export default {
                 this.$message.success(res.data.msg);
               
                 this.linkListData.splice(index, 1);
-                this.getLinkSetData(this.id);
+                this.getLinkSetData(this.deatailId);
               }else{
                 this.$message.error(res.data.msg);
               }
@@ -427,7 +430,7 @@ export default {
         objArr={
           
           privateName: this.checkTableRow.tableName,
-          privateId: this.checkTableRow.id,
+          privateId: this.checkTableRow.pkeyId,
           elementNames: elementNames,
           keys: selectedCodes,
         

+ 1 - 1
src/views/codeRule/ruleManage.vue

@@ -1148,7 +1148,7 @@ import { getStore, setStore } from "@/util/store";
         this.$message.error('请先添加技术指标内容');
         return;
       }
-        this.$refs.linkEleRef.show(this.jsDetail.info, this.treeId,this.id,  this.projectid);
+        this.$refs.linkEleRef.show(this.jsDetail.info, this.treeId,this.id,  this.projectid,this.ruleItemDetail.id);
     },
     confirmLinkEle() {
       console.log('确认关联元素')

+ 46 - 4
src/views/manager/projectinfo/codeSet.vue

@@ -30,11 +30,11 @@
       >
         <el-table-column label="序号" type="index" width="50"></el-table-column>
         
-        <el-table-column label="流水号">
+        <el-table-column label="规则">
           <template slot-scope="scope">
             <el-select 
               v-if="scope.row.isEdit"
-              v-model="scope.row.number" 
+              v-model="scope.row.rule" 
               @change="handleNumberChange($event,scope.row)"
               placeholder="请选择"
               style="width: 100%"
@@ -110,14 +110,20 @@
 </template>
 
 <script>
+import {getTrialNumberRule } from "@/api/ruleManage/codeRule.js";
+import { getDictionary } from "@/api/system/dict";
 export default {
   name: 'FileRuleDialog',
   
   data() {
     return {
+      projectId: '',
+
       dialogVisible: false,
       loading: false,
       tableData: [],
+      tableLoading: false,
+
       numberOptions: [
         { value: '1', label: '固定字符' },
         { value: '2', label: '合同段编号' },
@@ -140,9 +146,16 @@ export default {
   },
 
   methods: {
-    show() {
+    show(pid) {
       this.dialogVisible = true
-      // this.loadData()
+      this.projectId = pid
+      this.getTableData()
+      this.getNumberOptions()
+    },
+
+    handleClick(tab, event) {
+      console.log(tab, event);
+      this.getTableData()
     },
     addRow() {
       this.tableData.unshift({
@@ -151,6 +164,35 @@ export default {
       
       })
     },
+    getNumberOptions(){
+       getDictionary({
+        code:'trial_number_rule',
+      }).then((res) => {
+       
+        this.numberOptions = res.data.data;
+      });
+    },
+    getTableData() 
+    {
+      this.tableLoading = true;
+                getTrialNumberRule({
+                   projectId:this.projectId,
+                   contractId:0,
+                   type:this.activeName,
+             
+                   pageSize:20
+                }).then(res => {
+                    this.tableLoading = false;
+                    if (res.data.code == 200) {
+                       
+                        this.tableData = res.data.data['records'];
+                        this.total = res.data.data['total'];
+                    }else{
+                        this.tableData = [];
+                    }
+                })
+    },
+
 
     refreshData() {
       this.loading = true

+ 1 - 1
src/views/manager/projectinfo/tree.vue

@@ -5336,7 +5336,7 @@ export default {
       if (command === "code") {
         this.codeDialog = true;
       
-        this.$refs.codeSetRef.show()
+        this.$refs.codeSetRef.show(this.projectid)
       }else if(command === "rule") {
           this.$router.push({
             path: "/rule/manager",