From 4cfbfd1b425f7b22b876ae6cae95c4fc29ae6bfb Mon Sep 17 00:00:00 2001 From: 马宇豪 <978517621@qq.com> Date: 星期五, 23 二月 2024 09:25:33 +0800 Subject: [PATCH] 盘库修改 --- src/views/purchase/generation.vue | 7 src/views/stock/enterprisePurchaseStatistics.vue | 53 - src/views/trouble/selfexam.vue | 7 src/views/purchase/race.vue | 7 src/views/stock/statePurchaseStatistics.vue | 76 ++- src/views/warehouse/components/enterpriseStock.vue | 30 + src/views/purchase/enterpriseESS.vue | 46 + src/views/purchase/product.vue | 40 + src/views/usermng/product.vue | 2 src/views/flow/outStorage.vue | 40 + src/views/purchase/cityESS.vue | 45 ++ src/views/stock/enterpriseSale.vue | 76 +++ src/views/purchase/cityInAndOut.vue | 44 + src/views/purchase/dailySaleReport.vue | 83 +-- src/views/stock/cityOutStatistics.vue | 61 +- src/views/purchase/person.vue | 41 + src/views/stock/cityEntryStatistics.vue | 61 +- src/api/warehouse.js | 12 src/views/stock/components/statePurchaseDetail.vue | 1 src/views/warehouse/stockSupervision.vue | 4 src/views/warning/purchase.vue | 38 + src/views/purchase/citySaleStatistics.vue | 62 +- src/views/warehouse/stockManage.vue | 15 src/views/warehouse/stockAnalyse.vue | 11 src/views/purchase/enterpriseSaleStatistics.vue | 58 +- src/views/warning/stock.vue | 47 ++ src/views/purchase/personDetail.vue | 7 src/views/stock/enterpriseEntryStatistics.vue | 58 +- src/views/flow/inStorage.vue | 60 +- src/api/warning.js | 11 src/views/stock/enterpriseOutStatistics.vue | 61 +- 31 files changed, 716 insertions(+), 448 deletions(-) diff --git a/src/api/warehouse.js b/src/api/warehouse.js index 75fd542..c9aad12 100644 --- a/src/api/warehouse.js +++ b/src/api/warehouse.js @@ -92,6 +92,18 @@ }) } +// 各企业存货汇总信息 +export function listStockHzDataByStorehouseId(params) { + return request({ + headers: { + 'Authorization': getToken() + }, + url: process.env.BASE_API + '/reserveManage/select/stockDetailBySidAndEid', + method: 'get', + params: params || {} + }) +} + // 进行盘库 export function updateStorehouseData(data) { return request({ diff --git a/src/api/warning.js b/src/api/warning.js index 512399b..9c3b6bd 100644 --- a/src/api/warning.js +++ b/src/api/warning.js @@ -87,3 +87,14 @@ params: params || {} }) } + +export function setSolved(data) { + return request({ + headers: { + 'Authorization': getToken() + }, + url: process.env.BASE_API + '/mendAlarm', + method: 'post', + data + }) +} diff --git a/src/views/flow/inStorage.vue b/src/views/flow/inStorage.vue index 2494064..12ca151 100644 --- a/src/views/flow/inStorage.vue +++ b/src/views/flow/inStorage.vue @@ -61,17 +61,17 @@ <div style="display: block"> <div class="basic_search" style="padding-top: 10px;"> <span>按时间查询:</span> - <el-date-picker - value-format="yyyy-MM-dd HH:mm:ss" - v-model="validTime" - type="datetimerange" - :default-time="['00:00:00','23:59:59']" - :picker-options="pickerOptions" - range-separator="-" - start-placeholder="开始日期" - end-placeholder="结束日期" - > - </el-date-picker> + <el-date-picker + value-format="yyyy-MM-dd HH:mm:ss" + v-model="validTime" + type="daterange" + :default-time="['00:00:00','23:59:59']" + :picker-options="pickerOptions" + range-separator="-" + start-placeholder="开始日期" + end-placeholder="结束日期" + > + </el-date-picker> </div> <div class="basic_search" style="padding-top: 10px;margin-left: 15px"> <span>安全监管分类:</span> @@ -250,14 +250,6 @@ 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]); - } }] }, } @@ -379,9 +371,24 @@ transportcert: '', }, } + this.validTime = ['', ''] + this.initValidTime() + this.getInStorageData() }, 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.getInStorageData() }, @@ -396,6 +403,13 @@ async exportToExcel(){ + 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 exportInStorage(this.listQuery) if(res.data.code === '200'){ if(res.data.result === null ||res.data.result === [] || res.data.result.length === 0){ @@ -534,11 +548,9 @@ } }, 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"; } }, diff --git a/src/views/flow/outStorage.vue b/src/views/flow/outStorage.vue index 09860c0..78edbd3 100644 --- a/src/views/flow/outStorage.vue +++ b/src/views/flow/outStorage.vue @@ -67,7 +67,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="-" @@ -228,14 +228,6 @@ 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]); - } }] }, listQuery: { @@ -380,9 +372,24 @@ transportcert: '', }, } + this.validTime = ['', ''] + this.initValidTime() + this.getOutStorageData() }, 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.getOutStorageData() }, @@ -396,6 +403,13 @@ }, async exportToExcel(){ + 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 exportOutStorage(this.listQuery) if(res.data.result === null ||res.data.result === [] || res.data.result.length === 0){ this.$message({ @@ -526,11 +540,9 @@ } }, initValidTime(){ - const start = new Date(); - const end = new Date(); - start.setTime(end.getTime() - 3600 * 1000 * 24 * 6); - 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"; } }, diff --git a/src/views/purchase/cityESS.vue b/src/views/purchase/cityESS.vue index ec5d856..9c7f438 100644 --- a/src/views/purchase/cityESS.vue +++ b/src/views/purchase/cityESS.vue @@ -38,7 +38,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']" range-separator="-" start-placeholder="开始日期" @@ -51,7 +51,7 @@ <el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="validTime2" - type="datetimerange" + type="daterange" :default-time="['00:00:00','23:59:59']" range-separator="-" start-placeholder="开始日期" @@ -157,8 +157,10 @@ }, created() { // this.getProductList() + this.initValidTime() this.getProvince() this.changeArea("province"); + // this.getProductList() }, watch: { }, @@ -193,6 +195,17 @@ }, async exportToExcel(){ + if( this.validTime !== null ){ + this.listQuery.filter.starttime = this.validTime[0] + this.listQuery.filter.endtime = this.validTime[1] + this.listQuery.filter.starttime2 = this.validTime2[0] + this.listQuery.filter.endtime2 = this.validTime2[1] + }else{ + this.listQuery.filter.starttime = '' + this.listQuery.filter.endtime = '' + this.listQuery.filter.starttime2 = '' + this.listQuery.filter.endtime2 = '' + } let res = await getCityESSListData(this.listQuery) if(res.data.code === '200'){ if(res.data.result === null ||res.data.result === [] || res.data.result.length === 0){ @@ -240,6 +253,14 @@ formatJson(filterVal, jsonData) { return jsonData.map(v => filterVal.map(j => v[j])) + }, + + initValidTime(){ + 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"; + this.validTime2[0] = end.toISOString().slice(0, 10) + " 00:00:00"; + this.validTime2[1] = end.toISOString().slice(0, 10) + " 23:59:59"; }, async getProvince(){ @@ -316,9 +337,29 @@ endtime2: '', }, } + this.validTime = ['',''] + this.validTime2 = ['',''] + this.initValidTime() + this.getProductList() }, searchProductSearch(){ + this.listQuery.pageIndex = 1 + const date1 = new Date(this.validTime[0]); + const date2 = new Date(this.validTime[1]); + const date3 = new Date(this.validTime2[0]); + const date4 = new Date(this.validTime2[1]); + const differenceInMs = Math.abs(date2 - date1); + const differenceInDays = differenceInMs / (1000 * 60 * 60 * 24) + const differenceInMs2 = Math.abs(date4 - date3); + const differenceInDays2 = differenceInMs2 / (1000 * 60 * 60 * 24) + if(differenceInDays > 32 || differenceInDays2 > 32){ + this.$message({ + type: 'warning', + message: '查询时间或对比时间跨度超过一个月的,请联系管理员查询数据' + }) + return + } this.getProductList() }, diff --git a/src/views/purchase/cityInAndOut.vue b/src/views/purchase/cityInAndOut.vue index c55efdb..162119b 100644 --- a/src/views/purchase/cityInAndOut.vue +++ b/src/views/purchase/cityInAndOut.vue @@ -7,7 +7,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="-" @@ -51,7 +51,7 @@ <span class="click-color" @click="openDetailDialog(scope.row.name,validTime,listQuery.filter.safetysupervision)">{{scope.row.name}}</span> </template> </el-table-column> - <el-table-column label="进货数量(箱)" prop="innum" align="center"> + <el-table-column label="入库数量(箱)" prop="innum" align="center"> </el-table-column> <el-table-column label="出货数量(箱)" prop="outnum" align="center"> </el-table-column> @@ -128,14 +128,6 @@ 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]); - } }] }, } @@ -178,6 +170,13 @@ async exportToExcel(){ + 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 exportArea(this.listQuery) if(res.data.code === '200'){ if(res.data.result === null ||res.data.result === [] || res.data.result.length === 0){ @@ -237,6 +236,18 @@ }, searchCityInOutSearch(){ + 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.getCityInOutList() }, @@ -249,11 +260,14 @@ this.getCityInOutList() }, initValidTime(){ - const start = new Date(); - const end = new Date(); - start.setTime(end.getTime() - 3600 * 1000 * 24 * 6); - 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 start = new Date(); + // const end = new Date(); + // start.setTime(end.getTime() - 3600 * 1000 * 24 * 6); + // 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"; } }, } diff --git a/src/views/purchase/citySaleStatistics.vue b/src/views/purchase/citySaleStatistics.vue index cbf989a..e4255fe 100644 --- a/src/views/purchase/citySaleStatistics.vue +++ b/src/views/purchase/citySaleStatistics.vue @@ -7,7 +7,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="-" @@ -152,14 +152,6 @@ 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]); - } }] }, } @@ -200,10 +192,15 @@ showCityDetail(city){ this.$refs.citySale.showCitySaleDetail(this.listQuery.filter.starttime,this.listQuery.filter.endtime,this.listQuery.filter.enterprisename,this.listQuery.filter.safetysupervision,city) }, - refresh(){ - this.getPersonProductList() - }, + async exportToExcel(){ + 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 exportCity(this.listQuery) if(res.data.code === '200'){ if(res.data.result === null ||res.data.result === [] || res.data.result.length === 0){ @@ -271,9 +268,24 @@ itemcode:'', }, } + 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() }, @@ -287,30 +299,8 @@ }, initValidTime(){ const end = new Date(); - if(end.getDate() - 1 === 0){ - this.validTime[0] = [end.getFullYear(), end.getMonth() , this.returnDay(end.getMonth(),end.getFullYear())].join("-") + " 00:00:00" ; - this.validTime[1] = [end.getFullYear(), end.getMonth() , this.returnDay(end.getMonth(),end.getFullYear())].join("-") +" 23:59:59"; - }else if(end.getDate() - 1 === 0 && end.getMonth() === 0){ - this.validTime[0] = [end.getFullYear() - 1, 12, 31].join("-") + " 00:00:00" ; - this.validTime[1] = [end.getFullYear() - 1, 12, 31].join("-") +" 23:59:59"; - } - else{ - this.validTime[0] = [end.getFullYear(), end.getMonth() + 1, end.getDate() - 1].join("-") + " 00:00:00" ; - this.validTime[1] = [end.getFullYear(), end.getMonth() + 1, end.getDate() - 1].join("-") +" 23:59:59"; - } - }, - returnDay(value,year){ - if(value === 1 || value === 3|| value === 5 || value === 7 || value === 8 || value === 10 || value === 12){ - return 31 - }else if(value === 2){ - if(year % 4 === 0){ - return 29 - }else{ - return 28 - } - }else{ - return 30 - } + this.validTime[0] = end.toISOString().slice(0, 10) + " 00:00:00"; + this.validTime[1] = end.toISOString().slice(0, 10) + " 23:59:59"; } }, } diff --git a/src/views/purchase/dailySaleReport.vue b/src/views/purchase/dailySaleReport.vue index 0aff90d..2863f99 100644 --- a/src/views/purchase/dailySaleReport.vue +++ b/src/views/purchase/dailySaleReport.vue @@ -3,14 +3,21 @@ <div class="filter-container" style="padding: 20px"> <el-row> 时间:   - <el-date-picker - v-model="dateRange" - type="datetimerange" - start-placeholder="开始日期" - end-placeholder="结束日期" - :clearable="false" - :default-time="['00:00:00','23:59:59']"> - </el-date-picker> +<!-- <el-date-picker--> +<!-- v-model="dateRange"--> +<!-- type="date"--> +<!-- start-placeholder="开始日期"--> +<!-- end-placeholder="结束日期"--> +<!-- :clearable="false"--> +<!-- :default-time="['00:00:00','23:59:59']">--> +<!-- </el-date-picker>--> + <el-date-picker + v-model="currentDate" + value-format="yyyy-MM-dd" + type="date" + @change="changeDate" + placeholder="选择日期"> + </el-date-picker> <el-button class="filter-item" style="margin-left: 10px;margin-bottom: 0" type="primary" icon="el-icon-back" @click="dayForward">前一天</el-button> <el-button class="filter-item" style="margin-left: 10px;margin-bottom: 0" type="primary" icon="el-icon-right" @@ -96,6 +103,7 @@ name: "dailySaleReport", data(){ return{ + currentDate: '', dateRange:[], startDate:'', endDate:'', @@ -110,8 +118,9 @@ } }, - mounted() { - this.queryDateHandle(); + created() { + this.queryDateHandle() + this.getReportList() }, methods:{ // queryHandle(){ @@ -167,50 +176,36 @@ }, dayForward(){ if (this.dateRange != null){ - const start = this.dateRange[0]; - const end = this.dateRange[1]; - start.setTime(start.getTime() - 3600 * 1000 * 24); - end.setTime(end.getTime() - 3600 * 1000 * 24); - start.setHours(0); - start.setMinutes(0); - start.setSeconds(0); - end.setHours(23); - end.setMinutes(59); - end.setSeconds(59); - this.dateRange = [start,end] + const start = new Date(this.currentDate); + start.setDate(start.getDate() - 1); + this.currentDate = start.toISOString().slice(0, 10) + this.dateRange[0] = start.toISOString().slice(0, 10) + " 00:00:00"; + this.dateRange[1] = start.toISOString().slice(0, 10) + " 23:59:59"; this.getReportList() } }, dayBackward(){ if (this.dateRange != null){ - const start = this.dateRange[0]; - const end = this.dateRange[1]; - start.setTime(start.getTime() + 3600 * 1000 * 24); - end.setTime(end.getTime() + 3600 * 1000 * 24); - start.setHours(0); - start.setMinutes(0); - start.setSeconds(0); - end.setHours(23); - end.setMinutes(59); - end.setSeconds(59); - this.dateRange = [start,end] + const start = new Date(this.currentDate); + start.setDate(start.getDate() + 1); + this.currentDate = start.toISOString().slice(0, 10) + this.dateRange[0] = start.toISOString().slice(0, 10) + " 00:00:00"; + this.dateRange[1] = start.toISOString().slice(0, 10) + " 23:59:59"; this.getReportList() } }, queryDateHandle(){ - const end = new Date(); - const start = new Date(); - start.setHours(0); - start.setMinutes(0); - start.setSeconds(0); - end.setHours(23); - end.setMinutes(59); - end.setSeconds(59); - this.dateRange.push(start,end); - this.startDate = start; - this.endDate = end; - this.getReportList() + const end = new Date(); + this.currentDate = end.toISOString().slice(0, 10) + this.dateRange[0] = end.toISOString().slice(0, 10) + " 00:00:00"; + this.dateRange[1] = end.toISOString().slice(0, 10) + " 23:59:59"; }, + changeDate(){ + console.log(this.currentDate,555) + this.dateRange[0] = this.currentDate + " 00:00:00" + this.dateRange[1] = this.currentDate + " 23:59:59" + this.getReportList() + }, sortChange(param){ this.sort = param.prop; this.order = param.order; diff --git a/src/views/purchase/enterpriseESS.vue b/src/views/purchase/enterpriseESS.vue index 7b289a9..0f8d030 100644 --- a/src/views/purchase/enterpriseESS.vue +++ b/src/views/purchase/enterpriseESS.vue @@ -66,14 +66,14 @@ <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="-" start-placeholder="开始日期" end-placeholder="结束日期" > - </el-date-picker> + </el-date-picker> </div> <div class="basic_search" style="padding-top: 10px"> <span>安全监管分类:</span> @@ -208,14 +208,6 @@ 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]); - } }] }, } @@ -256,6 +248,13 @@ }, async exportToExcel(){ + 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 getEnterpriseESSExportData(this.listQuery) if(res.data.code === '200'){ if(res.data.result === null ||res.data.result === [] || res.data.result.length === 0){ @@ -386,9 +385,23 @@ itemcode: '', }, } + this.initValidTime() + this.getProductList() }, 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.getProductList() }, @@ -401,11 +414,14 @@ this.getProductList() }, initValidTime(){ - const start = new Date(); - const end = new Date(); - start.setTime(end.getTime() - 3600 * 1000 * 24 * 6); - 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 start = new Date(); + // const end = new Date(); + // start.setTime(end.getTime() - 3600 * 1000 * 24 * 6); + // 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"; } }, } diff --git a/src/views/purchase/enterpriseSaleStatistics.vue b/src/views/purchase/enterpriseSaleStatistics.vue index 1373f63..ad605a1 100644 --- a/src/views/purchase/enterpriseSaleStatistics.vue +++ b/src/views/purchase/enterpriseSaleStatistics.vue @@ -43,7 +43,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="-" @@ -191,14 +191,6 @@ 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]); - } }] }, } @@ -243,6 +235,13 @@ }, async exportToExcel(){ + 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 exportEnterpriseSaleStatistics(this.listQuery) if(res.data.code === '200'){ if(res.data.result === null ||res.data.result === [] || res.data.result.length === 0){ @@ -346,8 +345,23 @@ district: '', }, } + 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() }, @@ -361,30 +375,8 @@ }, initValidTime(){ const end = new Date(); - if(end.getDate() - 1 === 0){ - this.validTime[0] = [end.getFullYear(), end.getMonth() , this.returnDay(end.getMonth(),end.getFullYear())].join("-") + " 00:00:00" ; - this.validTime[1] = [end.getFullYear(), end.getMonth() , this.returnDay(end.getMonth(),end.getFullYear())].join("-") +" 23:59:59"; - }else if(end.getDate() - 1 === 0 && end.getMonth() === 0){ - this.validTime[0] = [end.getFullYear() - 1, 12, 31].join("-") + " 00:00:00" ; - this.validTime[1] = [end.getFullYear() - 1, 12, 31].join("-") +" 23:59:59"; - } - else{ - this.validTime[0] = [end.getFullYear(), end.getMonth() + 1, end.getDate() - 1].join("-") + " 00:00:00" ; - this.validTime[1] = [end.getFullYear(), end.getMonth() + 1, end.getDate() - 1].join("-") +" 23:59:59"; - } - }, - returnDay(value,year){ - if(value === 1 || value === 3|| value === 5 || value === 7 || value === 8 || value === 10 || value === 12){ - return 31 - }else if(value === 2){ - if(year % 4 === 0){ - return 29 - }else{ - return 28 - } - }else{ - return 30 - } + this.validTime[0] = end.toISOString().slice(0, 10) + " 00:00:00"; + this.validTime[1] = end.toISOString().slice(0, 10) + " 23:59:59"; } }, } diff --git a/src/views/purchase/generation.vue b/src/views/purchase/generation.vue index fd56185..9f54cd7 100644 --- a/src/views/purchase/generation.vue +++ b/src/views/purchase/generation.vue @@ -268,6 +268,13 @@ }) }, async exportToExcel(){ + 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'){ if(res.data.result === null ||res.data.result === [] || res.data.result.length === 0){ diff --git a/src/views/purchase/person.vue b/src/views/purchase/person.vue index 6915551..b38db5f 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="-" @@ -277,14 +277,6 @@ 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]); - } }] }, } @@ -294,7 +286,6 @@ uploadDialog }, created() { - console.log('Component created:', this.$options.name); this.initValidTime() this.getPersonProductList() this.getProvince() @@ -342,6 +333,13 @@ 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 @@ -425,9 +423,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() }, @@ -440,11 +453,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() diff --git a/src/views/purchase/personDetail.vue b/src/views/purchase/personDetail.vue index 166999a..5834cbc 100644 --- a/src/views/purchase/personDetail.vue +++ b/src/views/purchase/personDetail.vue @@ -284,6 +284,13 @@ }) }, async exportToExcel(){ + 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'){ if(res.data.result === null ||res.data.result === [] || res.data.result.length === 0){ diff --git a/src/views/purchase/product.vue b/src/views/purchase/product.vue index 68d7042..1694225 100644 --- a/src/views/purchase/product.vue +++ b/src/views/purchase/product.vue @@ -66,7 +66,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="-" @@ -219,14 +219,6 @@ 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]); - } }] }, //总计 @@ -278,6 +270,13 @@ }, async exportToExcel(){ + 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 exportProduct(this.listQuery) if(res.data.code === '200'){ if(res.data.result === null ||res.data.result === [] || res.data.result.length === 0){ @@ -412,9 +411,24 @@ itemcode: '', }, } + this.validTime = ['', ''] + this.initValidTime() + this.getProductList() }, 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.getProductList() }, @@ -427,11 +441,9 @@ this.getProductList() }, 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"; } }, } diff --git a/src/views/purchase/race.vue b/src/views/purchase/race.vue index 134401e..0da7f6d 100644 --- a/src/views/purchase/race.vue +++ b/src/views/purchase/race.vue @@ -284,6 +284,13 @@ }) }, async exportToExcel(){ + 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'){ if(res.data.result === null ||res.data.result === [] || res.data.result.length === 0){ diff --git a/src/views/stock/cityEntryStatistics.vue b/src/views/stock/cityEntryStatistics.vue index e3e113e..195b477 100644 --- a/src/views/stock/cityEntryStatistics.vue +++ b/src/views/stock/cityEntryStatistics.vue @@ -7,7 +7,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="-" @@ -144,14 +144,6 @@ 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]); - } }] }, } @@ -191,11 +183,15 @@ } this.listLoading = false }, - refresh(){ - this.getPersonProductList() - }, async exportToExcel(){ + 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 exportCityEntryStatistics(this.listQuery) if(res.data.code === '200'){ if(res.data.result === null ||res.data.result === [] || res.data.result.length === 0){ @@ -261,9 +257,24 @@ itemcode:'', }, } + 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() }, @@ -277,30 +288,8 @@ }, initValidTime(){ const end = new Date(); - if(end.getDate() - 1 === 0){ - this.validTime[0] = [end.getFullYear(), end.getMonth() , this.returnDay(end.getMonth(),end.getFullYear())].join("-") + " 00:00:00" ; - this.validTime[1] = [end.getFullYear(), end.getMonth() , this.returnDay(end.getMonth(),end.getFullYear())].join("-") +" 23:59:59"; - }else if(end.getDate() - 1 === 0 && end.getMonth() === 0){ - this.validTime[0] = [end.getFullYear() - 1, 12, 31].join("-") + " 00:00:00" ; - this.validTime[1] = [end.getFullYear() - 1, 12, 31].join("-") +" 23:59:59"; - } - else{ - this.validTime[0] = [end.getFullYear(), end.getMonth() + 1, end.getDate() - 1].join("-") + " 00:00:00" ; - this.validTime[1] = [end.getFullYear(), end.getMonth() + 1, end.getDate() - 1].join("-") +" 23:59:59"; - } - }, - returnDay(value,year){ - if(value === 1 || value === 3|| value === 5 || value === 7 || value === 8 || value === 10 || value === 12){ - return 31 - }else if(value === 2){ - if(year % 4 === 0){ - return 29 - }else{ - return 28 - } - }else{ - return 30 - } + this.validTime[0] = end.toISOString().slice(0, 10) + " 00:00:00"; + this.validTime[1] = end.toISOString().slice(0, 10) + " 23:59:59"; } }, } diff --git a/src/views/stock/cityOutStatistics.vue b/src/views/stock/cityOutStatistics.vue index 5e2bbc8..370409e 100644 --- a/src/views/stock/cityOutStatistics.vue +++ b/src/views/stock/cityOutStatistics.vue @@ -7,7 +7,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="-" @@ -144,14 +144,6 @@ 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]); - } }] }, } @@ -191,11 +183,15 @@ } this.listLoading = false }, - refresh(){ - this.getPersonProductList() - }, async exportToExcel(){ + 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 exportCityOutStatistics(this.listQuery) if(res.data.code === '200'){ if(res.data.result === null ||res.data.result === [] || res.data.result.length === 0){ @@ -261,9 +257,24 @@ itemcode:'', }, } + 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() }, @@ -277,30 +288,8 @@ }, initValidTime(){ const end = new Date(); - if(end.getDate() - 1 === 0){ - this.validTime[0] = [end.getFullYear(), end.getMonth() , this.returnDay(end.getMonth(),end.getFullYear())].join("-") + " 00:00:00" ; - this.validTime[1] = [end.getFullYear(), end.getMonth() , this.returnDay(end.getMonth(),end.getFullYear())].join("-") +" 23:59:59"; - }else if(end.getDate() - 1 === 0 && end.getMonth() === 0){ - this.validTime[0] = [end.getFullYear() - 1, 12, 31].join("-") + " 00:00:00" ; - this.validTime[1] = [end.getFullYear() - 1, 12, 31].join("-") +" 23:59:59"; - } - else{ - this.validTime[0] = [end.getFullYear(), end.getMonth() + 1, end.getDate() - 1].join("-") + " 00:00:00" ; - this.validTime[1] = [end.getFullYear(), end.getMonth() + 1, end.getDate() - 1].join("-") +" 23:59:59"; - } - }, - returnDay(value,year){ - if(value === 1 || value === 3|| value === 5 || value === 7 || value === 8 || value === 10 || value === 12){ - return 31 - }else if(value === 2){ - if(year % 4 === 0){ - return 29 - }else{ - return 28 - } - }else{ - return 30 - } + this.validTime[0] = end.toISOString().slice(0, 10) + " 00:00:00"; + this.validTime[1] = end.toISOString().slice(0, 10) + " 23:59:59"; } }, } diff --git a/src/views/stock/components/statePurchaseDetail.vue b/src/views/stock/components/statePurchaseDetail.vue index 45b1956..baee16c 100644 --- a/src/views/stock/components/statePurchaseDetail.vue +++ b/src/views/stock/components/statePurchaseDetail.vue @@ -82,6 +82,7 @@ }, async getStatepifaBox(stateName,startTime,endTime){ this.listLoading = true + this.statePurchaseDetailData = [] const listQuery = { startTime: startTime, endTime: endTime, diff --git a/src/views/stock/enterpriseEntryStatistics.vue b/src/views/stock/enterpriseEntryStatistics.vue index 233ab31..d3b65ab 100644 --- a/src/views/stock/enterpriseEntryStatistics.vue +++ b/src/views/stock/enterpriseEntryStatistics.vue @@ -43,7 +43,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="-" @@ -189,14 +189,6 @@ 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]); - } }] }, } @@ -244,6 +236,13 @@ }, async exportToExcel(){ + 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 exportEnterpriseEntryStatistics(this.listQuery) if(res.data.code === '200'){ if(res.data.result === null ||res.data.result === [] || res.data.result.length === 0){ @@ -345,8 +344,23 @@ district: '', }, } + 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() }, @@ -360,30 +374,8 @@ }, initValidTime(){ const end = new Date(); - if(end.getDate() - 1 === 0){ - this.validTime[0] = [end.getFullYear(), end.getMonth() , this.returnDay(end.getMonth(),end.getFullYear())].join("-") + " 00:00:00" ; - this.validTime[1] = [end.getFullYear(), end.getMonth() , this.returnDay(end.getMonth(),end.getFullYear())].join("-") +" 23:59:59"; - }else if(end.getDate() - 1 === 0 && end.getMonth() === 0){ - this.validTime[0] = [end.getFullYear() - 1, 12, 31].join("-") + " 00:00:00" ; - this.validTime[1] = [end.getFullYear() - 1, 12, 31].join("-") +" 23:59:59"; - } - else{ - this.validTime[0] = [end.getFullYear(), end.getMonth() + 1, end.getDate() - 1].join("-") + " 00:00:00" ; - this.validTime[1] = [end.getFullYear(), end.getMonth() + 1, end.getDate() - 1].join("-") +" 23:59:59"; - } - }, - returnDay(value,year){ - if(value === 1 || value === 3|| value === 5 || value === 7 || value === 8 || value === 10 || value === 12){ - return 31 - }else if(value === 2){ - if(year % 4 === 0){ - return 29 - }else{ - return 28 - } - }else{ - return 30 - } + this.validTime[0] = end.toISOString().slice(0, 10) + " 00:00:00"; + this.validTime[1] = end.toISOString().slice(0, 10) + " 23:59:59"; } }, } diff --git a/src/views/stock/enterpriseOutStatistics.vue b/src/views/stock/enterpriseOutStatistics.vue index a533357..0d9a733 100644 --- a/src/views/stock/enterpriseOutStatistics.vue +++ b/src/views/stock/enterpriseOutStatistics.vue @@ -43,7 +43,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="-" @@ -189,14 +189,6 @@ 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]); - } }] }, } @@ -239,11 +231,15 @@ } this.listLoading = false }, - refresh(){ - this.getPersonProductList() - }, async exportToExcel(){ + 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 exportEnterpriseOutStatistics(this.listQuery) if(res.data.code === '200'){ if(res.data.result === null ||res.data.result === [] || res.data.result.length === 0){ @@ -345,8 +341,23 @@ district: '', }, } + 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() }, @@ -360,31 +371,9 @@ }, initValidTime(){ const end = new Date(); - if(end.getDate() - 1 === 0){ - this.validTime[0] = [end.getFullYear(), end.getMonth() , this.returnDay(end.getMonth(),end.getFullYear())].join("-") + " 00:00:00" ; - this.validTime[1] = [end.getFullYear(), end.getMonth() , this.returnDay(end.getMonth(),end.getFullYear())].join("-") +" 23:59:59"; - }else if(end.getDate() - 1 === 0 && end.getMonth() === 0){ - this.validTime[0] = [end.getFullYear() - 1, 12, 31].join("-") + " 00:00:00" ; - this.validTime[1] = [end.getFullYear() - 1, 12, 31].join("-") +" 23:59:59"; - } - else{ - this.validTime[0] = [end.getFullYear(), end.getMonth() + 1, end.getDate() - 1].join("-") + " 00:00:00" ; - this.validTime[1] = [end.getFullYear(), end.getMonth() + 1, end.getDate() - 1].join("-") +" 23:59:59"; - } + this.validTime[0] = end.toISOString().slice(0, 10) + " 00:00:00"; + this.validTime[1] = end.toISOString().slice(0, 10) + " 23:59:59"; }, - returnDay(value,year){ - if(value === 1 || value === 3|| value === 5 || value === 7 || value === 8 || value === 10 || value === 12){ - return 31 - }else if(value === 2){ - if(year % 4 === 0){ - return 29 - }else{ - return 28 - } - }else{ - return 30 - } - } }, } </script> diff --git a/src/views/stock/enterprisePurchaseStatistics.vue b/src/views/stock/enterprisePurchaseStatistics.vue index d2f9e72..806a4a7 100644 --- a/src/views/stock/enterprisePurchaseStatistics.vue +++ b/src/views/stock/enterprisePurchaseStatistics.vue @@ -43,7 +43,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="-" @@ -166,16 +166,7 @@ end.setTime(end.getTime() + 3600 * 1000 * 24) picker.$emit('pick', [start, end]) } - }, { - text: '最近三个月', - onClick(picker) { - const end = new Date() - const start = new Date() - start.setTime(start.getTime() - 3600 * 1000 * 24 * 89) - end.setTime(end.getTime() + 3600 * 1000 * 24) - picker.$emit('pick', [start, end]) - } - },] + }] }, provinceList:[], cityList:[], @@ -345,37 +336,29 @@ city: '', district: '', } + this.validTime = ['',''] + this.initValidTime() + this.getpifaBox() }, searchProductSearch(){ + 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.getpifaBox() }, initValidTime(){ const end = new Date(); - if(end.getDate() - 1 === 0){ - this.validTime[0] = [end.getFullYear(), end.getMonth() , this.returnDay(end.getMonth(),end.getFullYear())].join("-") + " 00:00:00" ; - this.validTime[1] = [end.getFullYear(), end.getMonth() , this.returnDay(end.getMonth(),end.getFullYear())].join("-") +" 23:59:59"; - }else if(end.getDate() - 1 === 0 && end.getMonth() === 0){ - this.validTime[0] = [end.getFullYear() - 1, 12, 31].join("-") + " 00:00:00" ; - this.validTime[1] = [end.getFullYear() - 1, 12, 31].join("-") +" 23:59:59"; - } - else{ - this.validTime[0] = [end.getFullYear(), end.getMonth() + 1, end.getDate() - 1].join("-") + " 00:00:00" ; - this.validTime[1] = [end.getFullYear(), end.getMonth() + 1, end.getDate() - 1].join("-") +" 23:59:59"; - } - }, - returnDay(value,year){ - if(value === 1 || value === 3|| value === 5 || value === 7 || value === 8 || value === 10 || value === 12){ - return 31 - }else if(value === 2){ - if(year % 4 === 0){ - return 29 - }else{ - return 28 - } - }else{ - return 30 - } + this.validTime[0] = end.toISOString().slice(0, 10) + " 00:00:00"; + this.validTime[1] = end.toISOString().slice(0, 10) + " 23:59:59"; }, showDetail(param){ if( this.validTime !== null ){ diff --git a/src/views/stock/enterpriseSale.vue b/src/views/stock/enterpriseSale.vue index d1ef8bf..36bb265 100644 --- a/src/views/stock/enterpriseSale.vue +++ b/src/views/stock/enterpriseSale.vue @@ -4,12 +4,15 @@ <el-row> 时间:   <el-date-picker + value-format="yyyy-MM-dd HH:mm:ss" v-model="dateRange" - type="datetimerange" + type="daterange" + :default-time="['00:00:00','23:59:59']" + :picker-options="pickerOptions" + range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" - :clearable="false" - :default-time="['00:00:00','23:59:59']"> + > </el-date-picker> <el-button class="filter-item" style="margin-left: 15px;" type="primary" icon="el-icon-refresh" @click="refreshHandle">刷新 @@ -220,6 +223,25 @@ community:'', enterpriseType:'', }, + pickerOptions: { + shortcuts: [{ + text: '最近一周', + onClick(picker) { + const end = new Date(); + const start = new Date(); + start.setTime(start.getTime() - 3600 * 1000 * 24 * 7); + picker.$emit('pick', [start, end]); + } + }, { + text: '最近一个月', + onClick(picker) { + const end = new Date(); + const start = new Date(); + start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); + picker.$emit('pick', [start, end]); + } + }] + }, totalRow:{} } }, @@ -228,7 +250,7 @@ outStorageDetail, saleDetail }, - mounted(){ + created(){ getManufacturerTree().then(res=>{ this.manufacturerTree=(res.data) ; }); @@ -300,10 +322,35 @@ this.$router.push({path:'/sale/info',query:{enterpriseNumber:enterpriseNumber,beginDate:this.queryForm.beginDate,endDate:this.queryForm.endDate}}) }, refreshHandle: function () { + this.currentPage = 1 + this.queryForm = { + name: '', + beginDate:'', + endDate:'', + province:'', + city:'', + area:'', + town:'', + community:'', + enterpriseType:'', + } + this.dateRange = [] + this.queryDateHandle() this.getSaleList(); }, queryHandle: function () { this.currentPage = 1; + const date1 = new Date(this.dateRange[0]); + const date2 = new Date(this.dateRange[1]); + const differenceInMs = Math.abs(date2 - date1); + const differenceInDays = differenceInMs / (1000 * 60 * 60 * 24) + if(differenceInDays > 32){ + this.$message({ + type: 'warning', + message: '时间跨度超过一个月的,请联系管理员查询数据' + }) + return + } this.getSaleList(); }, handleSizeChange: function (val) { @@ -400,15 +447,20 @@ }, queryDateHandle(){ + // const end = new Date(); + // const start = new Date(); + // start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); + // start.setHours(0); + // start.setMinutes(0); + // start.setSeconds(0); + // this.dateRange.push(start,end); + // this.queryForm.beginDate = start; + // this.queryForm.endDate = end; const end = new Date(); - const start = new Date(); - start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); - start.setHours(0); - start.setMinutes(0); - start.setSeconds(0); - this.dateRange.push(start,end); - this.queryForm.beginDate = start; - this.queryForm.endDate = end; + const start = new Date(end); + start.setDate(start.getDate() - 7); + this.dateRange[0] = start.toISOString().slice(0, 10) + " 00:00:00"; + this.dateRange[1] = end.toISOString().slice(0, 10) + " 23:59:59"; }, exportAllHandle () { const _this = this; diff --git a/src/views/stock/statePurchaseStatistics.vue b/src/views/stock/statePurchaseStatistics.vue index 3a5cd8d..951b9af 100644 --- a/src/views/stock/statePurchaseStatistics.vue +++ b/src/views/stock/statePurchaseStatistics.vue @@ -43,7 +43,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="-" @@ -171,14 +171,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]); } }] @@ -324,7 +316,6 @@ }, reset() { - this.initValidTime() this.listQuery = { startTime: '', endTime: '', @@ -333,38 +324,57 @@ city: '', district: '', } + this.validTime = ['', ''] + this.initValidTime() this.getRegionPifaBox() }, searchProductSearch() { + 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.getRegionPifaBox() }, initValidTime() { + // const end = new Date(); + // if (end.getDate() - 1 === 0) { + // this.validTime[0] = [end.getFullYear(), end.getMonth(), this.returnDay(end.getMonth(), end.getFullYear())].join("-") + " 00:00:00"; + // this.validTime[1] = [end.getFullYear(), end.getMonth(), this.returnDay(end.getMonth(), end.getFullYear())].join("-") + " 23:59:59"; + // } else if (end.getDate() - 1 === 0 && end.getMonth() === 0) { + // this.validTime[0] = [end.getFullYear() - 1, 12, 31].join("-") + " 00:00:00"; + // this.validTime[1] = [end.getFullYear() - 1, 12, 31].join("-") + " 23:59:59"; + // } else { + // this.validTime[0] = [end.getFullYear(), end.getMonth() + 1, end.getDate() - 1].join("-") + " 00:00:00"; + // this.validTime[1] = [end.getFullYear(), end.getMonth() + 1, end.getDate() - 1].join("-") + " 23:59:59"; + // } const end = new Date(); - if (end.getDate() - 1 === 0) { - this.validTime[0] = [end.getFullYear(), end.getMonth(), this.returnDay(end.getMonth(), end.getFullYear())].join("-") + " 00:00:00"; - this.validTime[1] = [end.getFullYear(), end.getMonth(), this.returnDay(end.getMonth(), end.getFullYear())].join("-") + " 23:59:59"; - } else if (end.getDate() - 1 === 0 && end.getMonth() === 0) { - this.validTime[0] = [end.getFullYear() - 1, 12, 31].join("-") + " 00:00:00"; - this.validTime[1] = [end.getFullYear() - 1, 12, 31].join("-") + " 23:59:59"; - } else { - this.validTime[0] = [end.getFullYear(), end.getMonth() + 1, end.getDate() - 1].join("-") + " 00:00:00"; - this.validTime[1] = [end.getFullYear(), end.getMonth() + 1, end.getDate() - 1].join("-") + " 23:59:59"; - } + // const start = new Date(end); + // start.setDate(start.getDate() - 7); + // this.validTime[0] = start.toISOString().slice(0, 10) + " 00:00:00"; + this.validTime[0] = end.toISOString().slice(0, 10) + " 00:00:00"; + this.validTime[1] = end.toISOString().slice(0, 10) + " 23:59:59"; }, - returnDay(value, year) { - if (value === 1 || value === 3 || value === 5 || value === 7 || value === 8 || value === 10 || value === 12) { - return 31 - } else if (value === 2) { - if (year % 4 === 0) { - return 29 - } else { - return 28 - } - } else { - return 30 - } - }, + // returnDay(value, year) { + // if (value === 1 || value === 3 || value === 5 || value === 7 || value === 8 || value === 10 || value === 12) { + // return 31 + // } else if (value === 2) { + // if (year % 4 === 0) { + // return 29 + // } else { + // return 28 + // } + // } else { + // return 30 + // } + // }, showDetail(param) { if( this.validTime !== null ){ if(param.subRegionData){ diff --git a/src/views/trouble/selfexam.vue b/src/views/trouble/selfexam.vue index 7300c15..9db8107 100644 --- a/src/views/trouble/selfexam.vue +++ b/src/views/trouble/selfexam.vue @@ -264,6 +264,13 @@ }, async exportToExcel(){ + 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 exportSelfExam(this.listQuery) if(res.data.code === '200'){ if(res.data.result === null || res.data.result === []){ diff --git a/src/views/usermng/product.vue b/src/views/usermng/product.vue index e9eeab2..41dfafe 100644 --- a/src/views/usermng/product.vue +++ b/src/views/usermng/product.vue @@ -104,7 +104,7 @@ <span>{{ scope.row.specification }}</span> </template> </el-table-column> - <el-table-column label="单挂(个)含药量" prop="explosiveContent" align="center" sortable="custom"> + <el-table-column label="箱含药量" prop="explosiveContent" align="center" sortable="custom"> <template slot-scope="scope"> <span>{{ scope.row.explosiveContent }}</span> </template> diff --git a/src/views/warehouse/components/enterpriseStock.vue b/src/views/warehouse/components/enterpriseStock.vue index fdd9e13..6972463 100644 --- a/src/views/warehouse/components/enterpriseStock.vue +++ b/src/views/warehouse/components/enterpriseStock.vue @@ -55,7 +55,7 @@ <script> import {computePageCount} from "@/utils"; - import {listStockDataByStorehouseId} from "../../../api/warehouse"; + import {listStockDataByStorehouseId, listStockHzDataByStorehouseId} from "../../../api/warehouse"; export default { name: "index", @@ -70,8 +70,13 @@ }, components: {}, methods:{ - open(data){ - this.getList(data.id || data.storehouseId) + open(data,type){ + console.log(data,'data') + if(type == '监管' || type == '管理'){ + this.getList(data.id || data.storehouseId) + }else{ + this.getHzList(data) + } this.dialogVisible = true }, async getList(id){ @@ -87,6 +92,25 @@ }) } this.listLoading = false + }, + async getHzList(data){ + this.listLoading = true + let res = await listStockHzDataByStorehouseId({sid: data.storehouseId,eid: data.gId}) + if(res.data.code === "200"){ + if(res.data.result && res.data.result.stockDataInfos.length>0 && res.data.result.reserveName && res.data.result.storehouseName){ + this.listData = res.data.result.stockDataInfos + this.title = '库区:'+res.data.result.reserveName +' 仓库:'+ res.data.result.storehouseName + '各企业库存情况' + }else{ + this.listData = [] + this.title = '暂无企业库存情况' + } + }else{ + this.$message({ + type:'warning', + message:res.data.message + }) + } + this.listLoading = false } } } diff --git a/src/views/warehouse/stockAnalyse.vue b/src/views/warehouse/stockAnalyse.vue index 9cc28ed..7ab0b52 100644 --- a/src/views/warehouse/stockAnalyse.vue +++ b/src/views/warehouse/stockAnalyse.vue @@ -106,7 +106,7 @@ <el-table-column label="操作" align="center" width="120" class-name="small-padding fixed-width" fixed="right"> <template slot-scope="scope" v-if="scope.row.storehouseName !== '本库区合计' && scope.row.storehouseName !== '合计'"> <el-button type="text" @click="showEnterprises(scope.row)">查看详情</el-button> - <el-button type="text" @click="delData(scope.row)">删除</el-button> +<!-- <el-button type="text" @click="delData(scope.row)">删除</el-button>--> </template> </el-table-column> </el-table> @@ -187,7 +187,7 @@ } }) } - console.log(gData,'gData') + if(Array.isArray(gData)){ gData.map(item=>{ if(Array.isArray(item.storehouse.warehouses) && item.storehouse.whTotal){ @@ -212,7 +212,8 @@ item.storehouse.warehouses.map((subRes, subIndex)=>{ let content2 = {} content2 = subRes - content2['gId'] = item.enterpriseId + content2['gId'] = item.gId + content2['ggId'] = item.enterpriseId content2['gStock'] = item.gStock content2['gName'] = item.gName content2['gNum'] = item.gNum || null @@ -237,6 +238,7 @@ topId: null, reserveName: total.name, gId: null, + ggId: null, gName: total.name, gStock: total.enterpriseTotalStock, storehouseName: total.name, @@ -260,6 +262,7 @@ } this.stateStockData.push(totalObj) } + console.log(this.stateStockData,'G') }else{ this.$message({ type:'warning', @@ -281,7 +284,7 @@ showEnterprises(row){ const t = this - t.$refs.enterStock.open(row) + t.$refs.enterStock.open(row,'汇总') }, openStock(type,data){ diff --git a/src/views/warehouse/stockManage.vue b/src/views/warehouse/stockManage.vue index f64983c..1ac57e4 100644 --- a/src/views/warehouse/stockManage.vue +++ b/src/views/warehouse/stockManage.vue @@ -58,8 +58,8 @@ </el-table-column> <el-table-column label="是否允许盘库" align="center" width="120" class-name="small-padding fixed-width" fixed="right"> <template slot-scope="scope"> - <span type="text" v-if="scope.row.inventoryStatus == 1">否</span> - <el-button v-if="scope.row.inventoryStatus == 0" type="text" @click="stockEdit(scope.row)">允许盘库</el-button> + <span type="text" v-if="scope.row.inventoryStatus == 0">否</span> + <el-button v-if="scope.row.inventoryStatus == 1" type="text" @click="stockEdit(scope.row)">盘库</el-button> </template> </el-table-column> </el-table> @@ -97,12 +97,19 @@ stateStockData: [], rowIndex: '-1', OrderIndexArr: [], - hoverOrderArr: [] + hoverOrderArr: [], + isAdmin: false } }, created() { const t = this t.getList() + const roles = JSON.parse(Cookies.get('roles')) + if(roles.find(i=>i.name == '管理员'|| i.name == '监管部门')){ + this.isAdmin = true + }else{ + this.isAdmin = false + } }, mounted() { }, @@ -158,7 +165,7 @@ }, showEnterprises(row){ const t = this - t.$refs.enterStock.open(row) + t.$refs.enterStock.open(row,'管理') }, deliverUsage(row){ const t = this diff --git a/src/views/warehouse/stockSupervision.vue b/src/views/warehouse/stockSupervision.vue index c1b64d5..055d90a 100644 --- a/src/views/warehouse/stockSupervision.vue +++ b/src/views/warehouse/stockSupervision.vue @@ -86,6 +86,7 @@ <el-table-column label="库容量/箱" prop="approvedReserves" align="center"></el-table-column> <el-table-column label="核药量/kg" prop="nuclearDose" align="center"></el-table-column> <el-table-column label="当前总库存" prop="totalStock" align="center"></el-table-column> +<!-- <el-table-column label="存药量" prop="totalStock" align="center"></el-table-column>--> <el-table-column label="爆竹类(箱)" prop="firecracker" align="center"></el-table-column> <el-table-column label="喷花类(箱)" prop="spray" align="center"></el-table-column> <el-table-column label="旋转类(箱)" prop="rotation" align="center"></el-table-column> @@ -267,7 +268,7 @@ showEnterprises(row){ const t = this - t.$refs.enterStock.open(row) + t.$refs.enterStock.open(row,'监管') }, openStock(type,data){ @@ -333,6 +334,7 @@ message: res.data.message }) } + await this.getList() }).catch(() => { this.getList() }) diff --git a/src/views/warning/purchase.vue b/src/views/warning/purchase.vue index c929993..189e07a 100644 --- a/src/views/warning/purchase.vue +++ b/src/views/warning/purchase.vue @@ -167,6 +167,12 @@ type="text" @click="showDetailHandle(scope.row)" >购买明细</el-button> + <el-button + v-if="isAdmin" + :disabled="scope.row.ismend == 1" + type="text" + @click="markSolved(scope.row)" + >标记已处理</el-button> </template> </el-table-column> </el-table> @@ -246,7 +252,7 @@ <script> import { mapGetters } from 'vuex' - import { getPurchaseWarningList, getPurchaseDetailList } from '@/api/warning' + import { getPurchaseWarningList, getPurchaseDetailList, setSolved } from '@/api/warning' import { parseTime, computePageCount } from '@/utils' import { parseError } from '@/utils/messageDialog' import Cookies from 'js-cookie' @@ -281,6 +287,7 @@ tableKey: 0, stockWarningData: null, listLoading: true, + isAdmin: false, queryForm: { warnlevel: '', customer:'', @@ -357,6 +364,12 @@ created() { this.setDateRange(); this.getPurchaseWarningList() + const roles = JSON.parse(Cookies.get('roles')) + if(roles.find(i=>i.name == '管理员'|| i.name == '监管部门')){ + this.isAdmin = true + }else{ + this.isAdmin = false + } }, methods: { setDateRange(){ @@ -480,6 +493,29 @@ this.detailCurrentPage = 1 this.getEntryDetailInfoList() }, + markSolved(row){ + MessageBox.confirm('确定将该数据标记为已处理', '标记已处理', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(async () => { + const res = await setSolved({id: row.id}) + if(res.data.code === "200"){ + this.$message({ + type:'success', + message: '标记成功' + }) + this.getPurchaseWarningList() + }else{ + this.$message({ + type:'warning', + message:res.data.message + }) + } + }).catch(() => { + console.log('已取消') + }) + }, handleDetailSizeChange: function(val) { this.detailPageSize = val this.detailCurrentPage = 1 diff --git a/src/views/warning/stock.vue b/src/views/warning/stock.vue index af0b027..55e1f5b 100644 --- a/src/views/warning/stock.vue +++ b/src/views/warning/stock.vue @@ -235,6 +235,20 @@ <span>{{ scope.row.modifieddate | parseTime('{y}-{m}-{d}') }}</span> </template> </el-table-column> + <el-table-column + label="操作" + align="center" + width="100" + class-name="small-padding fixed-width" + v-if="isAdmin" + ><template slot-scope="scope"> + <el-button + type="text" + :disabled="scope.row.ismend == 1" + @click="markSolved(scope.row)" + >标记已处理</el-button> + </template> + </el-table-column> </el-table> <br> <el-pagination @@ -256,7 +270,7 @@ <script> import { mapGetters } from 'vuex' - import { getStockWarningList } from '@/api/warning' + import { getStockWarningList, setSolved } from '@/api/warning' import { parseTime, computePageCount } from '@/utils' import { parseError } from '@/utils/messageDialog' import Cookies from 'js-cookie' @@ -316,6 +330,7 @@ } ], dateRange: [], + isAdmin: false, pickClear:false, pickerOptions: { shortcuts: [{ @@ -368,6 +383,12 @@ this.getProvince(); this.getDictionaryEnterpriseType(); this.getCertWarningList(); + const roles = JSON.parse(Cookies.get('roles')) + if(roles.find(i=>i.name == '管理员'|| i.name == '监管部门')){ + this.isAdmin = true + }else{ + this.isAdmin = false + } }, methods: { setDateRange(){ @@ -491,6 +512,30 @@ this.currentPage = val this.getCertWarningList() }, + markSolved(row){ + MessageBox.confirm('确定将该数据标记为已处理', '标记已处理', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(async () => { + const res = await setSolved({id: row.id}) + if(res.data.code === "200"){ + this.$message({ + type:'success', + message: '标记成功' + }) + this.getCertWarningList() + }else{ + this.$message({ + type:'warning', + message:res.data.message + }) + } + }).catch(() => { + console.log('已取消') + }) + + }, getBtnPermission(btnType) { return checkBtnPermission(this.userType, btnType) }, -- Gitblit v1.9.2