From 0b3900a7822edbf2dbf453a2045c3861d4533876 Mon Sep 17 00:00:00 2001
From: 祖安之光 <11848914+light-of-zuan@user.noreply.gitee.com>
Date: Wed, 04 Feb 2026 13:20:32 +0800
Subject: [PATCH] 修改取值
---
src/views/purchase/person.vue | 69 ++++++++++++++++++++++++++--------
1 files changed, 52 insertions(+), 17 deletions(-)
diff --git a/src/views/purchase/person.vue b/src/views/purchase/person.vue
index cd82d61..550a1b7 100644
--- a/src/views/purchase/person.vue
+++ b/src/views/purchase/person.vue
@@ -8,7 +8,7 @@
<el-date-picker
value-format="yyyy-MM-dd HH:mm:ss"
v-model="validTime"
- type="datetimerange"
+ type="daterange"
:default-time="['00:00:00','23:59:59']"
:picker-options="pickerOptions"
range-separator="-"
@@ -27,6 +27,13 @@
:label="item.label"
:value="item.value">
</el-option>
+ </el-select>
+ </div>
+ <div class="basic_search" style="padding-top: 10px;margin-left: 20px" >
+ <span>OCR识别:</span>
+ <el-select v-model="listQuery.filter.isOcr" placeholder="请选择" style="width:100px">
+ <el-option label="是" key="1" :value="1"></el-option>
+ <el-option label="否" key="0" :value="0"></el-option>
</el-select>
</div>
</div>
@@ -121,7 +128,7 @@
<div class="basic_search" >
<el-button style="margin-left: 10px;" type="primary" @click="reset()" size="small">重置</el-button>
<el-button style="margin-left: 10px;" type="primary" icon="el-icon-search" @click="searchProductSearch('查询','')" size="small">查询</el-button>
- <el-button style="margin-left: 10px;" type="primary" icon="el-icon-download" @click="exportToExcel" size="small">导出</el-button>
+ <el-button style="margin-left: 10px;" type="primary" icon="el-icon-download" @click="exportToExcel" v-long-re-click size="small">导出</el-button>
</div>
</div>
@@ -192,6 +199,17 @@
/>
<br>
</div>
+ <el-dialog
+ title="提示"
+ center
+ :visible.sync="reClickTip"
+ width="50%">
+ <span style="color: red">由于导出数据量大,请各监管单位导出数据时不要连续点击,导出按钮已限制30s内只允许点击一次。</span>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="reClickTip = false">取 消</el-button>
+ <el-button type="primary" @click="reClickTip = false">确 定</el-button>
+ </span>
+ </el-dialog>
<personPurchaseDetail ref="person"></personPurchaseDetail>
<upload-dialog ref="upload" @refresh="refresh"></upload-dialog>
</div>
@@ -206,11 +224,12 @@
import Cookies from "js-cookie";
export default {
- name: "addSelfExam",
+ name: "person",
data(){
return{
tableKey:'',
validTime:['',''],
+ reClickTip: false,
listQuery: {
pageSize:10,
pageIndex:1,
@@ -222,6 +241,7 @@
parententerprisename:'',
directioncode:'',
isNeedUploadPhoto:'',
+ isOcr: null,
province:'',
city:'',
district:'',
@@ -263,14 +283,6 @@
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
- picker.$emit('pick', [start, end]);
- }
- }, {
- text: '最近三个月',
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit('pick', [start, end]);
}
}]
@@ -318,7 +330,7 @@
},
showPurchaseDetail(val){
- this.$refs.person.openPersonPurchaseDetail(this.listQuery.filter.starttime,this.listQuery.filter.endtime,val.identify,val.companynumber,this.listQuery.filter.directioncode)
+ this.$refs.person.openPersonPurchaseDetail(this.listQuery.filter.starttime,this.listQuery.filter.endtime,val.identify,val.companynumber,this.listQuery.filter.directioncode,1)
},
showUploadDialogHandler(idCard) {
this.$refs.upload.showDialog(idCard)
@@ -328,8 +340,17 @@
},
async exportToExcel(){
+ this.reClickTip = true
+ if( this.validTime !== null ){
+ this.listQuery.filter.starttime = this.validTime[0]
+ this.listQuery.filter.endtime = this.validTime[1]
+ }else{
+ this.listQuery.filter.starttime = ''
+ this.listQuery.filter.endtime = ''
+ }
let res = await exportPerson(this.listQuery)
if(res.data.code === '200'){
+ this.reClickTip = false
if(res.data.result === null ||res.data.result === [] || res.data.result.length === 0){
this.$message({
type:'warning',
@@ -402,6 +423,7 @@
parententerprisename:'',
directioncode:'',
isNeedUploadPhoto:'',
+ isOcr: null,
province:'',
city:'',
district:'',
@@ -410,9 +432,24 @@
nation:''
},
}
+ this.validTime = ['', '']
+ this.initValidTime()
+ this.getPersonProductList()
},
searchProductSearch(){
+ this.listQuery.pageIndex = 1
+ const date1 = new Date(this.validTime[0]);
+ const date2 = new Date(this.validTime[1]);
+ const differenceInMs = Math.abs(date2 - date1);
+ const differenceInDays = differenceInMs / (1000 * 60 * 60 * 24)
+ if(differenceInDays > 32){
+ this.$message({
+ type: 'warning',
+ message: '时间跨度超过一个月的,请联系管理员查询数据'
+ })
+ return
+ }
this.getPersonProductList()
},
@@ -425,11 +462,9 @@
this.getPersonProductList()
},
initValidTime(){
- const start = new Date();
- const end = new Date();
- start.setTime(end.getTime() - 3600 * 1000 * 24 * 0);
- this.validTime[0] = [start.getFullYear(), start.getMonth() + 1, start.getDate()].join("-") + " 00:00:00" ;
- this.validTime[1] = [end.getFullYear(), end.getMonth() + 1, end.getDate()].join("-") +" 23:59:59";
+ const end = new Date();
+ this.validTime[0] = end.toISOString().slice(0, 10) + " 00:00:00";
+ this.validTime[1] = end.toISOString().slice(0, 10) + " 23:59:59";
},
async getProvince(){
let res = await getProvinceListData()
--
Gitblit v1.9.2