Explorar o código

获取表单下的设计强度列表

duy %!s(int64=2) %!d(string=hai) anos
pai
achega
ebb3fd0b1c

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

@@ -66,7 +66,12 @@ export const getDapSiteData = (form, msg = true) => httpApi({
     params: form,
 }, msg)
 
-
+//获取表单下的设计强度列表
+export const getDesignStrengthList = (form, msg = true) => httpApi({
+    url: '/api/blade-manager/mixProportion/designStrengthList',
+    method: 'get',
+    params: form,
+}, msg)
 //检查当前合同段是否开启电签
 export const eVisaTaskCheck = (form, msg = true) => httpApi({
     url: '/api/blade-business/eVisaTaskCheck/checkContractIsOpenEVisa',

+ 22 - 2
src/components/plugins/table-form/hc-form-select-search.vue

@@ -9,7 +9,7 @@
 
 <script setup>
 import { nextTick, ref } from 'vue'
-import { getDapSiteData } from '~api/other'
+import { getDapSiteData, getDesignStrengthList } from '~api/other'
 import { ElOption, ElSelect } from 'z-element-plus'
 import { arrIndex, getObjVal, getObjValue } from 'js-fast-way'
 
@@ -48,6 +48,7 @@ const selectVal = ref(props.val)
 
 //加载完成
 nextTick(() => {
+    console.log(props, 'props')
     if (props.keyname && props.type) {
         setTableFormRemoteMethod(props.keyname, props.type)
     }
@@ -57,6 +58,8 @@ nextTick(() => {
 const setTableFormRemoteMethod = async (key, type) => {
     if (type === 'dap_site_data') {
         await getDapSiteDataApi(key)
+    } else if (type === 'strength_search') {
+        await getDesignStrengthListApi(key)
     }
 }
 
@@ -81,7 +84,24 @@ const getDapSiteDataApi = async (key) => {
         }
     }
 }
-
+const getDesignStrengthListApi = async (key) => {
+    const datas = selectDatas.value
+    if (datas.length > 0) {
+        return datas
+    } else {
+        const { error, code, data } = await getDesignStrengthList({
+            contractId: props.contractId,
+            key: key,
+        }, false)
+        //处理数据
+        const resData = getObjVal(data)
+        if (!error && code === 200 && resData) {
+            selectDatas.value = await objToArr(resData, key)
+        } else {
+            selectDatas.value = []
+        }
+    }
+}
 //对象转数组
 const objToArr = async (obj) => {
     let newArr = []