Ver Fonte

关联质检资料调接口

duy há 1 ano atrás
pai
commit
b856d12180

+ 8 - 0
src/api/modules/project/debit/contract/unit.js

@@ -97,4 +97,12 @@ export default {
             params: form,
         }, msg)
     },
+    //获取当前节点下,当期未被计量的所有清单
+    async getCurrentNodeAllForm(form, msg = true) {
+        return HcApi({
+            url: '/api/blade-meter/middleMeterApply/getWbsNodeInfo',
+            method: 'post',
+            data: form,
+        }, msg)
+    },
 }

+ 1 - 1
src/config/index.json

@@ -1,6 +1,6 @@
 {
     "version": "20230607160059",
-    "target": "http://39.108.216.210:8090",
+    "target": "http://192.168.0.125:8090",
     "smsPhone": "",
     "vite": {
         "port": 5180,

+ 1 - 1
src/views/alter/admin/components/order/changePre.vue

@@ -53,7 +53,7 @@ watch(isShow, (val) => {
 
 //搜索表单
 const searchForm = ref({
-    key1: null, current: 1, size: 10, total: 0,
+    key1: null, current: 1, size: 20, total: 0,
 })
 
 //分页

+ 16 - 1
src/views/debit-pay/admin/components/middlepay/addModal.vue

@@ -141,7 +141,7 @@
     />
 
     <!-- 关联质检资料 -->
-    <qualityRleation :quality-moadal="qualityMoadal" :cid="cid" :period-id="period_id" @close="closeQual" />
+    <qualityRleation :quality-moadal="qualityMoadal" :cid="cid" :period-id="period_id" @close="closeQual" @finish="finishModal" />
 </template>
 
 <script setup>
@@ -640,4 +640,19 @@ const associateQual = ()=>{
 const closeQual = ()=>{
     qualityMoadal.value = false
 }
+const finishModal = (rows)=>{
+    let fileList = []
+    rows.forEach(ele => {
+        fileList.push({
+            fileName:ele.dataName,
+            filePdfUrl:ele.evisaPdfUrl ? ele.evisaPdfUrl : ele.pdfUrl,	
+            fileType:1,
+            fileUrl:ele.evisaPdfUrl ? ele.evisaPdfUrl : ele.pdfUrl,	
+        })
+
+    })
+   fileList.forEach((ele)=>{
+    baseForm.value.fileList.push(ele)
+   })
+}
 </script>

+ 86 - 40
src/views/debit-pay/admin/components/middlepay/qualityRleation.vue

@@ -1,16 +1,31 @@
 <!--  -->
 <template>
-    <hc-new-dialog v-model="qualityMoadal" is-table title="关联质检资料" widths="1200px" @close="qulModalClose">
-        <div class="relative h-full flex">
-            <div :id="`hc_tree_card_${uuid}`" class="hc_tree_card_border relative">
-                <hc-body scrollbar padding="0px">
-                    <hc-lazy-tree tree-key="id" :auto-expand-keys="treeAutoExpandKeys" @load="treeLoadNode" />
-                </hc-body>
+    <hc-new-dialog v-model="qualityMoadal" is-table title="关联质检资料" widths="1200px" @close="qulModalClose" @save="saveQualModal">
+        <hc-new-card>
+            <div class="relative h-full flex">
+                <div :id="`hc_tree_card_${uuid}`" v-loading="treeLoading" class="hc_tree_card_border relative">
+                    <hc-body scrollbar padding="0px">
+                        <hc-lazy-tree tree-key="id" @load="treeLoadNode" @node-tap="nodeElTreeClick" />
+                    </hc-body>
+                </div>
+                <div :id="`hc_table_card_${uuid}`" class="relative flex-1">
+                    <HcTable :column="tableColumn" :datas="tableData" is-new is-check is-reserve-selection :loading="tableLoading" @selection-change="tableSelection">
+                        <template #appStatusName="{ row }">
+                            <el-tag
+                                v-if="row.appStatusName"
+                                :type="`${row.appStatusName === '已审批' ? 'success' : row.appStatusName === '待审批' ? 'warning' : row.appStatusName === '已废除' ? 'danger' : 'info'}`"
+                                class="mx-1" effect="dark"
+                            >
+                                {{ row.appStatusName }}
+                            </el-tag>
+                        </template>
+                    </HcTable>
+                </div>
             </div>
-            <div :id="`hc_table_card_${uuid}`" class="relative flex-1">
-                <HcTable :column="tableColumn" :datas="tableData" is-new />
-            </div>
-        </div>
+            <template #action>
+                <hc-pages :pages="searchForm" @change="pageChange" />
+            </template>
+        </hc-new-card>
     </hc-new-dialog>
 </template>
 
@@ -35,9 +50,10 @@ const props = defineProps({
     },
     
 })
-const emit = defineEmits([ 'close'])
+const emit = defineEmits([ 'close', 'finish'])
 const useAppState = useAppStore()
 const contractInfo = ref(useAppState.getContractInfo)
+const projectId = ref(useAppState.getProjectId || '')
 const { contractType } = contractInfo.value
 const classifyType = ref(contractType === 2 ? '2' : '1')
 const qualityMoadal = ref(props.qualityMoadal)
@@ -59,6 +75,7 @@ watch(qualityMoadal, (val) => {
     if (val) {
         nextTick(() => {
                 setSplitRef()
+                tableData.value = []
             })
         }
     
@@ -76,28 +93,10 @@ const setSplitRef = () => {
         console.log(error)
     }
 }
-//数据格式
-const treeProps = {
-    label: 'nodeName',
-    children: 'children',
-    isLeaf: 'notExsitChild',
-}
-const treeAutoExpandKeys = ref([])
-// const treeLoadNode = async ({ item, level }, resolve) => {
-//     let id = 0
-//     if (level !== 0) {
-//         const nodeData = getObjValue(item)
-//         id = nodeData?.id || ''
-//     }
-//     //获取数据
-//     const { data } = await unitApi.lazyTree({
-//         id: id,
-//         contractId: cid.value,
-//         contractPeriodId: periodId.value,
-//     })
-//     resolve(getArrValue(data))
-// }
+
+
 //懒加载的数据
+const treeLoading = ref(false)
 const treeLoadNode = async ({ node, item, level }, resolve) => {
     let contractIdRelation = '', parentId = '', primaryKeyId = ''
     if (level !== 0) {
@@ -106,6 +105,7 @@ const treeLoadNode = async ({ node, item, level }, resolve) => {
         parentId = contractIdRelation ? nodeData?.primaryKeyId : nodeData?.id
         primaryKeyId = nodeData?.id || ''
     }
+    treeLoading.value = true
     //获取数据
     const { data } = await queryWbsTreeData({
         contractId: cid.value || '',
@@ -115,23 +115,69 @@ const treeLoadNode = async ({ node, item, level }, resolve) => {
         classifyType: classifyType.value,
         tableOwner:classifyType.value,
     })
+    treeLoading.value = false
     resolve(getArrValue(data))
    
 }
 const tableColumn = [
-    { key: 'name', name: '分/子分项部位' },
-    { key: 'text', name: '资料名称' },
-    { key: 'color', name: '资料审核状态' },
+    { key: 'partName', name: '分/子分项部位' },
+    { key: 'dataName', name: '资料名称' },
+    { key: 'appStatusName', name: '资料审核状态' },
 ]
-const tableData = ref([
-    { name: '名称1', text: '文本1', color: 'red' },
-    { name: '名称2', text: '文本2', color: 'blue' },
- 
-])
+
 const qulModalClose = ()=>{
     qualityMoadal.value = false
     emit('close')
 }
+
+//搜索表单
+const searchForm = ref({
+ 
+    current: 1, size: 20, total: 0,
+})
+
+const pageChange = ({ current, size }) => {
+    searchForm.value.current = current
+    searchForm.value.size = size
+    getTableData()
+}
+
+const tableData = ref([])
+const tableLoading = ref(false)
+const getTableData = async () => {
+    tableData.value = []
+    tableLoading.value = true
+    const { data } = await unitApi.getCurrentNodeAllForm({
+        ...searchForm.value,
+        contractId:cid.value,
+        projectId:projectId.value,
+        nodeId:curTree.value.id,
+  
+    })
+    tableData.value = getArrValue(data['records'])
+    searchForm.value.total = data.total || 0
+    tableLoading.value = false
+}
+const curTree = ref(null)
+const nodeElTreeClick = ({ node, data, keys })=>{
+    curTree.value = data
+    getTableData()
+}
+//多选
+const tableKeys = ref([])
+const tableSelection = (rows) => {
+    tableKeys.value = rows
+}
+const saveQualModal = ()=>{
+    if ( tableKeys.value.length > 0) {
+        qualityMoadal.value = false
+        emit('close')
+        emit('finish', tableKeys.value)
+    } else {
+        window.$message.warning('请先选择你要关联的质检资料')
+    }
+    
+}
 </script>
 
 <style lang='scss' scoped>

+ 1 - 1
src/views/debit-pay/admin/middlepay.vue

@@ -108,7 +108,7 @@ const setSplitRef = () => {
 //搜索表单
 const searchForm = ref({
     contractPeriodId: null, contractUnitId: null, contractId: contractId.value, type: 1,
-    current: 1, size: 10, total: 0,
+    current: 1, size: 20, total: 0,
 })
 const approveStatus = ref(0)