8
0
ZaiZai vor 9 Monaten
Ursprung
Commit
85a5694233
1 geänderte Dateien mit 39 neuen und 13 gelöschten Zeilen
  1. 39 13
      src/views/project/detail/info.vue

+ 39 - 13
src/views/project/detail/info.vue

@@ -15,7 +15,7 @@
                     </el-col>
                     <el-col :span="6">
                         <el-form-item label="合同段类型:" prop="contractType">
-                            <el-select v-model="contractForm.contractType" placeholder="选择所属系统" filterable clearable block :disabled="!!contractForm.id">
+                            <el-select v-model="contractForm.contractType" placeholder="选择所属系统" filterable clearable block :disabled="!!contractForm.id" @change="treeAllConstruction">
                                 <el-option v-for="item in contractTypeList" :key="item.value" :label="item.label" :value="item.value" />
                             </el-select>
                         </el-form-item>
@@ -149,13 +149,17 @@
                     </el-col>
                 </el-row>
             </hc-card-item>
-            <hc-card-item class="mt-14px" title="合同段权限配置">
-                内容区域
+            <hc-card-item v-if="contractForm.contractType !== 1" class="mt-14px" title="合同段权限配置">
+                <el-form-item>
+                    <el-checkbox-group v-model="contractCheckIds">
+                        <el-checkbox v-for="item in contractCheckList" :key="item.contractId" :label="item.contractName" :value="item.contractId" />
+                    </el-checkbox-group>
+                </el-form-item>
             </hc-card-item>
             <hc-card-item class="mt-14px" title="组卷归档默认信息">
                 内容区域
             </hc-card-item>
-            <hc-card-item class="mt-14px" title="附加信息">
+            <hc-card-item v-if="contractForm.contractType === 1" class="mt-14px" title="附加信息">
                 内容区域
             </hc-card-item>
             <hc-card-item class="mt-14px" title="计量信息">
@@ -167,7 +171,7 @@
 
 <script setup>
 import { onMounted, ref, watch } from 'vue'
-import { getObjValue, isNullES } from 'js-fast-way'
+import { getArrValue, getObjValue, isNullES } from 'js-fast-way'
 import { getDictionaryData } from '~uti/tools'
 
 //请求接口
@@ -206,6 +210,7 @@ const getDataApi = async () => {
         }
     }
     await getProjectDeatil()
+    await treeAllConstruction()
     getStoragePeriodList().then()
     getSecurityLevelList().then()
 }
@@ -248,14 +253,6 @@ const getContractInfo2 = async () => {
     contractForm.value = getObjValue(data)
 }
 
-//监理、业主关联施工
-const getContractRelation = async () => {
-    const { cid } = getObjValue(dataInfo.value)
-    if (isNullES(cid)) return
-    const { data } = await projectApi.getContractRelation(cid)
-    console.log(data)
-}
-
 //获取业务字典
 const storagePeriods = ref([])
 const getStoragePeriodList = async () => {
@@ -291,6 +288,35 @@ const startFileSuccess = ({ res }) => {
 const startFileDel = () => {
     contractForm.value.startFileUrl = ''
 }
+
+//合同段信息
+const contractCheckList = ref([])
+const treeAllConstruction = async () => {
+    const { pid } = getObjValue(dataInfo.value)
+    const { contractType } = contractForm.value
+    if (isNullES(pid) || isNullES(contractType)) {
+        contractCheckList.value = []
+        return
+    }
+    //发起请求
+    const { data } = await projectApi.treeAllConstruction({
+        projectId: pid,
+        contractType: contractType,
+    })
+    contractCheckList.value = getArrValue(data)
+}
+
+//监理、业主关联施工
+const contractCheckIds = ref([])
+const getContractRelation = async () => {
+    const { cid } = getObjValue(dataInfo.value)
+    if (isNullES(cid)) return
+    const { data } = await projectApi.getContractRelation(cid)
+    const res = getArrValue(data)
+    contractCheckIds.value = res.map(({ id }) => {
+        return id
+    })
+}
 </script>
 
 <style scoped lang="scss">