Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/views/project/debit/contract/unit.vue
ZaiZai 9 months ago
parent
commit
aa88067884

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

@@ -129,4 +129,12 @@ export default {
             data: form,
         }, msg)
     },
+    //获取合同计量单元导入模板
+    async importTemplate(form, msg = true) {
+        return HcApi({
+                url: '/api/blade-meter/tree/contract/importTemplate',
+                method: 'get',
+                params: form,
+            }, msg)
+    },
 }

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

@@ -192,6 +192,7 @@ const treeNodeTap = ({ data, keys }) => {
     TreeAutoExpandKeys.value = keys || []
     setStoreValue('middlepay-tree-auto-expand-keys', keys)
     getTableData()
+    getCurrentMeterMoney().then()
 }
 //分页
 const pageChange = ({ current, size }) => {

+ 25 - 15
src/views/project/debit/contract/unit.vue

@@ -96,7 +96,7 @@
             <hc-table
                 ui="hc-table-row-drop"
                 :column="sortTableColumn" :datas="sortTableData" :loading="sortTableLoading"
-                is-new is-row-drop quick-sort :index-style="{ width: 80 }"
+                is-row-drop quick-sort is-new :index-style="{ width: 80 }"
                 @row-drop="sortTableRowDrop" @row-sort="sortTableRowDrop"
             >
                 <template #key2="{ row }">
@@ -116,7 +116,7 @@
         <hc-new-dialog v-model="leadModalShow" scrollbar widths="1100px" title="合同计量单元导入" :loading="leadLoaidng" @save="leadModalSave">
             <div class="hc-el-upload-drag">
                 <el-upload
-                    ref="leadUploadRef" drag hc :show-file-list="true" :auto-upload="false" :headers="getHeader()"
+                    ref="leadUploadRef" hc drag :show-file-list="true" :auto-upload="false" :headers="getHeader()"
                     action="/api/blade-meter/tree/contract/import" :data="{ id: checkTreeId, type: typevalue }" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
                     :on-error="handFileError"
                     :on-success="handleFileDUcess"
@@ -463,8 +463,12 @@ const removeContractTreeNode = async () => {
     })
     loadingInstance.close()
     if (!error && code === 200) {
-        window?.$message?.success('删除成功')
-        window?.location?.reload() //刷新页面
+        window?.$message?.success(msg)
+        finishForm()
+        // setTimeout(() => {
+        //     window?.location?.reload() //刷新页面
+        // }, 1000)
+
     } else {
         window.$message.error(msg)
      }
@@ -659,21 +663,27 @@ const leadModalSave = async () => {
     //     ishowTree.value = true
     // }, 1000)
 }
+const getImportTemplate = async (type)=>{
+    const { error, code, msg, data } = await unitApi.importTemplate({
+        type,
+    })
+    if (!error && code === 200) {
+        if (data) {
+            window.open(data)
+        }
+
+    } else {
+        window.$message.error(msg)
+     }
+}
 //下载范例模板
 const downLoadExel = ()=>{
   if (typevalue.value) {
-    if (typevalue.value === '1') {
-            window.open('https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20240307/1430b65643615f80156ec328a9a09ff8.xlsx', '_blank')
-     } else if (typevalue.value === '2') {
-            window.open('https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20240109/98addbf48d620030504b2cb03b1c24f5.xls', '_blank')
-      } else if (typevalue.value === '3') {
-            window.open('https://blade-oss-chongqing.oss-cn-shenzhen.aliyuncs.com//upload/20240320/88fc4e47dd3f729b1b71cf79a6db44ae.xlsx', '_blank')
+    getImportTemplate(typevalue.value)
 
-        } else {
-            window.$message.warning('请先选择模板')
-        }
-
-    }
+  } else {
+    window.$message.error('请选择范例模板')
+  }
 }
 const typeoptions = ref([
 {

+ 26 - 13
yarn.lock

@@ -822,6 +822,14 @@
     "@unocss/core" "0.58.7"
     unconfig "^0.3.11"
 
+"@unocss/config@0.58.9":
+  version "0.58.9"
+  resolved "http://39.108.216.210:9000/@unocss/config/-/config-0.58.9.tgz#9c3bcae0d91687991177bd9751f1653097cd006f"
+  integrity sha512-90wRXIyGNI8UenWxvHUcH4l4rgq813MsTzYWsf6ZKyLLvkFjV2b2EfGXI27GPvZ7fVE1OAqx+wJNTw8CyQxwag==
+  dependencies:
+    "@unocss/core" "0.58.9"
+    unconfig "^0.3.11"
+
 "@unocss/core@0.56.5", "@unocss/core@^0.56.5":
   version "0.56.5"
   resolved "http://39.108.216.210:9000/@unocss/core/-/core-0.56.5.tgz#5c3caf24dd0d13e359aa71112d0487b685cb165a"
@@ -832,21 +840,26 @@
   resolved "http://39.108.216.210:9000/@unocss/core/-/core-0.58.7.tgz#906073a09acd946b7408fc562faaa1187201011c"
   integrity sha512-Df5ytibV0MB7kWLggzLHsJUj08Of2oqXmPg7QjRUghMvCT3dl2LUIZXiztYPMH0F4x0cPebNoa/pavNt8xz9eQ==
 
-"@unocss/eslint-config@^0.58.7":
-  version "0.58.7"
-  resolved "http://39.108.216.210:9000/@unocss/eslint-config/-/eslint-config-0.58.7.tgz#bc032491a25fc4f657a370f371418306ddbd0e5a"
-  integrity sha512-6FzSUIiomTywOmrMYWTnRQ318K5mvoNao6SqLB4YaRA4bSvtfXrv0tb54qXl0ahwlX1O6I6dyFrEwfOAdApK4w==
+"@unocss/core@0.58.9":
+  version "0.58.9"
+  resolved "http://39.108.216.210:9000/@unocss/core/-/core-0.58.9.tgz#a613e9d88160c5b260b1406082a9f73d789b9ea9"
+  integrity sha512-wYpPIPPsOIbIoMIDuH8ihehJk5pAZmyFKXIYO/Kro98GEOFhz6lJoLsy6/PZuitlgp2/TSlubUuWGjHWvp5osw==
+
+"@unocss/eslint-config@^0.58.5":
+  version "0.58.9"
+  resolved "http://39.108.216.210:9000/@unocss/eslint-config/-/eslint-config-0.58.9.tgz#d5a1c7f5c57161b322416729769120e111c8459b"
+  integrity sha512-7Cf9NVPQqdhd6rbe2JDlqY9bBwuFfxvZOmeEUcKaI10QNNrDNvnMKd8rToxCdm5RToSjNeuj66V/scl8Kv8rfQ==
   dependencies:
-    "@unocss/eslint-plugin" "0.58.7"
+    "@unocss/eslint-plugin" "0.58.9"
 
-"@unocss/eslint-plugin@0.58.7":
-  version "0.58.7"
-  resolved "http://39.108.216.210:9000/@unocss/eslint-plugin/-/eslint-plugin-0.58.7.tgz#1ad5c7c630cf0545ec77a5a8e758e60a16b98846"
-  integrity sha512-b2i18LAADv0j5L4O+6ju+6PHBucnvgD8ipvDZvZWEX0EFIiFVO9CoMLJhMpONcahnPmWWrs/sELhwQu3uyCKVg==
+"@unocss/eslint-plugin@0.58.9":
+  version "0.58.9"
+  resolved "http://39.108.216.210:9000/@unocss/eslint-plugin/-/eslint-plugin-0.58.9.tgz#7a46eb2127379770651777c120b934ec31ab5692"
+  integrity sha512-StlHO850jow2w/PTA01opkGAD6WO+iu65fxel062gp/aeoO/cRwVlQntVX7Z8QHDGXnftjW83RjvX9LqW8+iLw==
   dependencies:
     "@typescript-eslint/utils" "^7.4.0"
-    "@unocss/config" "0.58.7"
-    "@unocss/core" "0.58.7"
+    "@unocss/config" "0.58.9"
+    "@unocss/core" "0.58.9"
     magic-string "^0.30.8"
     synckit "^0.9.0"
 
@@ -1686,7 +1699,7 @@ escape-string-regexp@^4.0.0:
   resolved "http://39.108.216.210:9000/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
   integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==
 
-eslint-plugin-vue@^9.24.0:
+eslint-plugin-vue@^9.22.0:
   version "9.24.0"
   resolved "http://39.108.216.210:9000/eslint-plugin-vue/-/eslint-plugin-vue-9.24.0.tgz#71209f4652ee767f18c0bf56f25991b7cdc5aa46"
   integrity sha512-9SkJMvF8NGMT9aQCwFc5rj8Wo1XWSMSHk36i7ZwdI614BU7sIOR28ZjuFPKp8YGymZN12BSEbiSwa7qikp+PBw==
@@ -1713,7 +1726,7 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4
   resolved "http://39.108.216.210:9000/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800"
   integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==
 
-eslint@^8.57.0:
+eslint@^8.56.0:
   version "8.57.0"
   resolved "http://39.108.216.210:9000/eslint/-/eslint-8.57.0.tgz#c786a6fd0e0b68941aaf624596fb987089195668"
   integrity sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==