ZaiZai 10 ay önce
ebeveyn
işleme
e8060941c3

+ 1 - 1
src/styles/view/project/edit-formula.scss

@@ -153,6 +153,6 @@
     }
     //函数公式运算执行溯源
     .hc-formula-card-project {
-
+        position: relative;
     }
 }

+ 42 - 8
src/views/project/list/edit-formula.vue

@@ -122,7 +122,16 @@
                 </div>
                 <!-- 函数公式运算执行溯源 -->
                 <div class="border-dashed-card hc-formula-card-project mb-14px">
-                    111
+                    <div class="header mb-14px text-14px">函数公式运算执行溯源</div>
+                    <div class="body relative">
+                        <el-select v-model="projectId" filterable clearable class="mr-14px w-380px" placeholder="选择项目" @change="projectChange">
+                            <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id" />
+                        </el-select>
+                        <el-select v-model="contractId" filterable clearable class="mr-14px w-200px" placeholder="请选择合同段">
+                            <el-option v-for="item in contractList" :key="item.id" :label="item.contractName" :value="item.id" />
+                        </el-select>
+                        <el-button type="info">查询</el-button>
+                    </div>
                 </div>
             </div>
             <template #action>
@@ -136,16 +145,20 @@
 <script setup>
 import { nextTick, ref, watch } from 'vue'
 import { useClick } from 'hc-vue3-ui'
-import { ElMessageBox } from 'element-plus'
 import {
     arrIndex, deepClone, getArrValue,
     getObjValue, getRandom, isNullES,
 } from 'js-fast-way'
+import { ElMessageBox } from 'element-plus'
 import draggable from 'vuedraggable'
-import mainApi from '~api/project/formula'
-import eleApi from '~api/project/element'
+
+//接口文件
+import projectApi from '~api/project/project'
+import contractApi from '~api/project/contract'
+import formulaApi from '~api/project/formula'
+import elementApi from '~api/project/element'
+import privateApi from '~api/wbs/private'
 import treeApi from '~api/wbs/tree'
-import priApi from '~api/wbs/private'
 
 const props = defineProps({
     data: {
@@ -184,6 +197,7 @@ const getDataApi = async () => {
     console.log(dataInfo.value)
     getTypeMapApi().then()
     getWbsFormElementData().then()
+    getProjectDataApi().then()
 }
 
 //保留位数
@@ -201,7 +215,7 @@ const formulaMenuMap = ref({})
 const formulaMenuIndex = ref(null)
 const formulaMenuList = ref({})
 const getTypeMapApi = async () => {
-    const { data } = await mainApi.getTypeMap()
+    const { data } = await formulaApi.getTypeMap()
     const res = getObjValue(data)
     formulaMenuList.value = deepClone(res)
     //生成map,方便查找
@@ -247,7 +261,7 @@ const getWbsFormElementData = async () => {
     const { eleId } = getObjValue(dataInfo.value)
     resultFormula.value = []
     if (isNullES(eleId)) return
-    const { data } = await eleApi.detail(eleId)
+    const { data } = await elementApi.detail(eleId)
     const obj = getObjValue(data)
     resultFormula.value = [{
         type: 'Element',
@@ -307,7 +321,7 @@ const treeResetFunLazyLoad = async (node, resolve) => {
     if (level === 0) treeResetFunLoading.value = true
     if (!eleType) {
         //获取接口数据
-        const { data } = await priApi.tabTypeLazyTreeAll({
+        const { data } = await privateApi.tabTypeLazyTreeAll({
             parentId,
             current: 1,
             size: 99999,
@@ -573,6 +587,26 @@ const processFormulaItem = (item) => {
     processFormula.value = arr
 }
 
+//获取项目数据
+const projectId = ref('')
+const projectList = ref([])
+const getProjectDataApi = async () => {
+    const { data } = await projectApi.page({
+        current: 1,
+        size: 99999,
+    })
+    projectList.value = getArrValue(data?.records)
+}
+
+//项目被选择
+const contractId = ref('')
+const contractList = ref([])
+const projectChange = async () => {
+    contractId.value = ''
+    const { data } = await contractApi.getList(projectId.value)
+    contractList.value = getArrValue(data)
+}
+
 //关闭抽屉
 const drawerClose = () => {
     isShow.value = false