Explorar el Código

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	package.json
#	yarn.lock
ZaiZai hace 1 año
padre
commit
e7e4393ee0

+ 3 - 2
src/api/modules/tentative/collect/test.js

@@ -37,7 +37,8 @@ export const save = (form, msg = true) => HcApi({
 //下载
 export const download = (form, msg = true) => HcApi({
     url: '/api/blade-business/trial/summary/download',
-    method: 'post',
-    data: form,
+    method: 'get',
+    params: form,
 }, msg)
 
+

+ 2 - 2
src/views/tentative/collect/monthly.vue

@@ -274,7 +274,7 @@ const getTableData = async () => {
     } else if (!searchForm.value.startTime || !searchForm.value.endTime) {
         window.$message.warning('请选择开始时间和结束时间')
         return
-    } else if (searchForm.value.ids) {
+    } else if (!searchForm.value.ids) {
         window.$message.warning('请选择试验检测项目名称')
         return
     }
@@ -395,7 +395,7 @@ const downClick = async ()=>{
         window.$message.warning('请选择试验检测项目名称')
         return
     }
-    const {error, code, data} = await downloadMonth({
+    const { error, code, data } = await downloadMonth({
             ...searchForm.value,
             ids:'1635200237830144002',
             contractId:contractId.value,

+ 16 - 3
src/views/tentative/collect/test.vue

@@ -28,13 +28,13 @@
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_collect_test_download">
-                        <el-button hc-btn color="#A16222">
+                        <el-button hc-btn color="#A16222" :loading="downLoading" :disabled="tableCheckedKeys.length === 0" @click="downClick">
                             <HcIcon name="download" />
                             <span>下载</span>
                         </el-button>
                     </HcTooltip>
                     <HcTooltip keys="tentative_collect_test_del">
-                        <el-button hc-btn color="#e03997" @click="delModalClick">
+                        <el-button hc-btn color="#e03997" :disabled="tableCheckedKeys.length === 0" @click="delModalClick">
                             <HcIcon name="delete-bin-2" />
                             <span>删除</span>
                         </el-button>
@@ -159,7 +159,7 @@
 import { onMounted, ref, watch } from 'vue'
 import { useAppStore } from '~src/store'
 import { download, getContractList, getPage, getSummaryList, removeByIds, save } from '~api/tentative/collect/test'
-import { arrToId, getArrValue, getObjValue } from 'js-fast-way'
+import { arrToId, getArrValue, getObjValue, isString } from 'js-fast-way'
 
 import { delMessageV2 } from '~com/message/index.js'
 import { getDictionary } from '~api/other'
@@ -435,6 +435,19 @@ const addModalSave = async ()=>{
 const unitOpt = ref([
     { name:'施工', id:'1' },
 ])
+const downLoading = ref(false)
+const downClick = async ()=>{
+    downLoading.value = true
+    const { error, code, data } = await download({
+            ids: arrToId( tableCheckedKeys.value),
+        })
+        downLoading.value = false
+ 
+    const res = isString(data) ? data || '' : ''
+    if (!error && code === 200 && res) {
+        window.open(res, '_blank')
+    }
+}
 </script>
 
 <style lang="scss" scoped>