Browse Source

系统分部分项划分

iZaiZaiA 2 years ago
parent
commit
3ae389c0e6

+ 1 - 1
src/styles/data-fill/division.scss

@@ -134,7 +134,7 @@
     }
     .hc-import-node-tree-box {
         position: relative;
-        height: calc(100% - 80px);
+        height: 100%;//calc(100% - 80px);
         overflow: hidden;
         display: flex;
         .import-node-tree-box {

+ 10 - 5
src/views/data-fill/components/division/HcUpload.vue

@@ -28,6 +28,10 @@ const props = defineProps({
         type: [Number,String],
         default: 0
     },
+    primaryKeyId: {
+        type: [Number,String],
+        default: 0
+    },
 })
 
 //变量
@@ -43,18 +47,19 @@ watch(() => [
     props.contractId,
     props.type,
     props.isSplicingNumber,
-], ([contractId, type, isSplicingNumber]) => {
-    setUploadData(contractId, type, isSplicingNumber)
+    props.primaryKeyId
+], ([contractId, type, isSplicingNumber, pid]) => {
+    setUploadData(contractId, type, isSplicingNumber, pid)
 })
 
 //渲染完成
 onMounted(()=> {
-    setUploadData(props.contractId, props.type, props.isSplicingNumber)
+    setUploadData(props.contractId, props.type, props.isSplicingNumber, props.primaryKeyId)
 })
 
 //设置附加参数
-const setUploadData = (contractId, type, isSplicingNumber) => {
-    uploadData.value = {contractId, type, isSplicingNumber}
+const setUploadData = (contractId, type, isSplicingNumber, primaryKeyId) => {
+    uploadData.value = {contractId, type, isSplicingNumber, primaryKeyId}
 }
 
 

+ 8 - 5
src/views/data-fill/division.vue

@@ -39,7 +39,7 @@
                     <HcIcon name="download-2"/>
                     <span>下载导入划分模板</span>
                 </el-button>
-                <el-button type="primary" hc-btn @click="toImportTempClick">
+                <el-button type="primary" hc-btn :disabled="!treePrimaryKeyId" @click="toImportTempClick">
                     <HcIcon name="folder-upload"/>
                     <span>导入划分模板</span>
                 </el-button>
@@ -174,14 +174,14 @@
         <!--导入划分模板-->
         <HcDialog :show="importTempModal" title="导入划分模板" widths="84%" ui="hc-modal-table" @close="importTempModal = false">
             <div class="hc-import-temp-box">
-                <div class="hc-choose-type-box">
+                <!--div class="hc-choose-type-box">
                     <div class="text-title text-orange">请选择需要导入的工程类别:</div>
                     <div class="hc-type-box">
                         <el-radio-group v-model="importRadio" size="large">
                             <el-radio v-for="item in importRadioData" :label="item.key">{{item.name}}</el-radio>
                         </el-radio-group>
                     </div>
-                </div>
+                </div-->
                 <div class="hc-import-node-tree-box" v-loading="uploadLoading" element-loading-text="Loading...">
                     <div class="import-node-tree-box">
                         <div class="hc-tree-title-box">导入并识别成功</div>
@@ -204,7 +204,8 @@
             <template #footer>
                 <div class="lr-dialog-footer">
                     <div class="left">
-                        <HcUpload ref="uploadRef" :contractId="contractId" :type="importRadio" :isSplicingNumber="isSplicingNumber" @change="uploadChange" @progress="uploadprogress" @finished="uploadFinished"/>
+                        <HcUpload ref="uploadRef" :contractId="contractId" :type="importRadio" :primaryKeyId="treePrimaryKeyId" :isSplicingNumber="isSplicingNumber"
+                                  @change="uploadChange" @progress="uploadprogress" @finished="uploadFinished"/>
                     </div>
                     <div class="right flex">
                         <div class="mr-6">
@@ -348,8 +349,9 @@ const getRowTableType = (type) => {
 
 
 //树被点击
-const treeItemInfo = ref({})
 const treeNodeInfo = ref({})
+const treeItemInfo = ref({})
+const treePrimaryKeyId = ref('')
 const wbsElTreeClick = ({node, data, keys}) => {
     treeNodeInfo.value = node
     treeItemInfo.value = data
@@ -357,6 +359,7 @@ const wbsElTreeClick = ({node, data, keys}) => {
     setStoreData('wbsTreeExpandKeys',keys)
     treeAutoExpandKeys.value = keys || []
     if (node.level > 1) {
+        treePrimaryKeyId.value = data['primaryKeyId']
         searchNodeAllTableApi(data['primaryKeyId'])
     }
 }