Browse Source

公式参数配置调接口更改

duy 2 years ago
parent
commit
92bf84f8b4

+ 8 - 1
src/api/modules/data-fill/query.js

@@ -18,9 +18,16 @@ export default {
         }, msg)
     },
     //获取当前合同段下所有的上报批次
+    // async getReportNumber(form, msg = true) {
+    //     return httpApi({
+    //         url: '/api/blade-business/informationWriteQuery/getReportNumberByContractId',
+    //         method: 'get',
+    //         params: form
+    //     }, msg)
+    // },
     async getReportNumber(form, msg = true) {
         return httpApi({
-            url: '/api/blade-business/informationWriteQuery/getReportNumberByContractId',
+            url: 'api/blade-business/task/query-batch-list-two',
             method: 'get',
             params: form
         }, msg)

+ 16 - 0
src/api/modules/data-fill/wbs.js

@@ -258,4 +258,20 @@ export default {
             params: form
         },msg)
     },
+    //查询公式参数面板
+    async queryPanel(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-manager/formula/panel',
+            method: 'get',
+            params: form
+        },msg)
+    },
+    //保存公式参数
+    async savePanel(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-manager/formula/panel-save',
+            method: 'post',
+            params: form
+        },msg);
+    },
 }

+ 6 - 2
src/api/modules/other.js

@@ -41,12 +41,16 @@ export const userConfigInfo = (form, msg = true) => httpApi({
 }, msg);
 
 //获取上报批次
+// export const getReportNumber = (form, msg = true) => httpApi({
+//     url: '/api/blade-business/informationWriteQuery/getReportNumberByContractId',
+//     method: 'get',
+//     params: form
+// }, msg);
 export const getReportNumber = (form, msg = true) => httpApi({
-    url: '/api/blade-business/informationWriteQuery/getReportNumberByContractId',
+    url: 'api/blade-business/task/query-batch-list-two',
     method: 'get',
     params: form
 }, msg);
-
 //获取类型
 export const getDictionary = (form, msg = true) => httpApi({
     url: '/api/blade-system/dict/dictionary',

+ 45 - 4
src/views/data-fill/components/ListItem.vue

@@ -330,7 +330,7 @@
 
     </HcDialog>
     <!-- 公式参数配置 -->
-    <HcDialog :show="formulaModal" title="公式参数配置"  widths="84%"  saveText="保存" @close="formulaModal = false" @save="saveformulaModal">
+    <HcDialog :show="formulaModal" title="公式参数配置"  widths="84%"  saveText="保存" @close="formulaModal = false" @save="PanelSaveClick">
  
                 <div v-if="componentDetail['type']==='radio'">
                      <el-form ref="formIDVFRef" :model="formulaModalinfo" label-width="auto" size="large"  >
@@ -515,20 +515,21 @@ const setFormDataNum = (datas) => {
 //展开事件
 const ActiveKey = ref([])
 const formKeyIds = ref('')
+const formparentId=ref('')
 const CollapseChange = async (name) => {
     ActiveKey.value = name
-    console.log(name,'name');
     let names=[]
     if(name.length>0){
          names = name[0] ? name[name.length-1].split('-') : name[0]
     }
    
-    console.log(names,'names');
     if (names.length > 0) {
         getOffsetTop(name);
         const index = names[1]
         const item = listDatas.value[index]
+        console.log(item,'item');
         formKeyIds.value = item.pkeyId ? item.pkeyId + '' : ''
+        formparentId.value= item.parentId ? item.parentId + '' : ''
         if (!item.isTableFormRender) {
             //获取已填写的数据
             await getBussDataInfo(item,item.pkeyId, index)
@@ -974,7 +975,7 @@ const setTableFormMenu = (info) => {
     newArr.push({label: '插入特殊字符', key: "special"})
     newArr.push({label: '关联试验数据', key: "CTD"}),
     newArr.push({label: '关联试验文件', key: "file"}),
-    //   newArr.push({label: '公式参数', key:"formula"})
+      newArr.push({label: '公式参数', key:"formula"})
     tableFormMenu.value = newArr
 }
 
@@ -982,6 +983,7 @@ const setTableFormMenu = (info) => {
 //鼠标右键事件
 const contextMenuRef = ref(null)
 const onRightClick = (event, KeyName, index) => {
+    console.log(KeyName,'KeyName');
     //取光标位置
     const specialDom = document.getElementById(KeyName + "")
     const startPos = specialDom?.selectionStart || 0
@@ -1011,13 +1013,52 @@ const handleMenuSelect = ({key}) => {
        
     }
     else if(key === 'formula'){
+         getPanel()
        console.log('公式参数');
+       console.log(tableFormItemNode.value,'tableFormItemNode.value');
        formulaModal.value=true
+      
+      
        
     }
 
 }
+//获取公式面板数据
+const getPanel= async () => {
+    const pkeyIds=formKeyIds.value
+    if (pkeyIds) {
+        const {error, code, data} = await wbsApi.queryPanel({
+            ekey:tableFormItemNode.value['KeyName'],
+            contractId:contractId.value,
+            pKeyId:pkeyIds,
 
+        }, false)
+   
+        if (!error && code === 200) {
+            componentDetail.value = getArrValue(data)
+        } else {
+            componentDetail.value = []
+        }
+    } else {
+        window?.$message?.warning('pkeyId为空')
+    }
+}
+const PanelSaveClick = async (item,index) => {
+        const {res,error,code }= await wbsApi.savePanel({
+            parentId:formparentId.value ,
+            ekey: tableFormItemNode.value['KeyName'],
+            contractId: 1624967193488187394,
+            value:formulaModalinfo.type,
+            pKeyId:contractId.value,
+            scope:componentDetail?.value['scope']
+        })
+        if (!error && code === 200) {
+            window?.$message?.success('操作成功')
+            formulaModal.value=false;
+        }
+        
+     
+}
 //插入设计值
 const IDVFModal = ref(false)
 const formIDVFRef = ref(null)

+ 2 - 1
src/views/data-fill/query.vue

@@ -302,7 +302,8 @@ const getFileUser = async () => {
 //获取上报批次
 const getReportNumber = async () => {
     const {error, code, data} = await queryApi.getReportNumber({
-        contractId: contractId.value
+        contractId: contractId.value,
+        projectId:projectId.value
     })
     //判断状态
     if (!error && code === 200) {

+ 1 - 1
src/views/ledger/components/internal.vue

@@ -152,7 +152,7 @@ const queryBatchList = async () => {
         //     contractId: contractId.value || ''
         // })
        const { error, code, data } = await queryApi.getReportNumber({
-           
+           projectId:projectId.value,
             contractId: contractId.value || ''
         })
         if (!error && code === 200) {

+ 1 - 0
src/views/other/first-item copy.vue

@@ -303,6 +303,7 @@ const reportBatch = ref([])
 const getReportNumberByContractId = async (cid) => {
     const { data } = await getReportNumber({
         contractId: contractId.value,
+        projectId:projectId.value,
         contractIdRelation: cid ?? '',
         firstTitle: tabTypeKey.value === 'query' ? 1: null
     })

+ 1 - 0
src/views/other/first-item.vue

@@ -294,6 +294,7 @@ const queryNodeStatus = async () => {
 const reportBatch = ref([])
 const getReportNumberByContractId = async (cid) => {
     const { data } = await getReportNumber({
+         projectId:projectId.value,
         contractId: contractId.value,
         contractIdRelation: cid ?? '',
         firstTitle: tabTypeKey.value === 'query' ? 1: null