|
@@ -46,6 +46,8 @@
|
|
|
|
|
|
|
|
|
<el-button class="filter-item" type="primary" icon="el-icon-search" @click="form_search">搜索</el-button>
|
|
|
+ <!-- isRepairExport -->
|
|
|
+ <el-button class="filter-item" type="success" icon="el-icon-download" style="" @click="handleDownload">导出</el-button>
|
|
|
|
|
|
<!-- <el-button v-if="istab2Add" class="filter-item" type="primary" icon="el-icon-edit" @click="form_add">新增</el-button> -->
|
|
|
|
|
@@ -731,9 +733,9 @@
|
|
|
<script>
|
|
|
import echarts from 'echarts'
|
|
|
require('echarts/theme/macarons')
|
|
|
-import { GetDataByNames, GetReportform, GetDataByName, PostDataByName, checkButtons, ExecDataByConfig} from '@/api/common'
|
|
|
+import { GetDataByNames, GetReportform, GetDataByName, PostDataByName, checkButtons,GetAccount, ExecDataByConfig} from '@/api/common'
|
|
|
import Cookies from 'js-cookie'
|
|
|
-import { parseTime, json2excel } from '@/utils/index.js'
|
|
|
+import { parseTime, json2excel,sortChange } from '@/utils/index.js'
|
|
|
import { MessageBox } from 'element-ui'
|
|
|
import Pagination from '@/components/Pagination'
|
|
|
export default {
|
|
@@ -742,6 +744,9 @@ export default {
|
|
|
inject: ['reload'],
|
|
|
data() {
|
|
|
return {
|
|
|
+ isRepairExport: [],
|
|
|
+ isPercentage: false,
|
|
|
+ percentage: 0,
|
|
|
findAllPasture:[],
|
|
|
myHeight:document.documentElement.clientHeight - 85- 200,
|
|
|
//多个下拉框 - 请求内容
|
|
@@ -983,6 +988,74 @@ export default {
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 导出
|
|
|
+ handleDownload() {
|
|
|
+ this.$alert('正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
|
|
|
+ this.isPercentage = true
|
|
|
+ this.percentage = 1
|
|
|
+ var timer = setInterval(() => {
|
|
|
+ this.percentage += 5
|
|
|
+ if (this.percentage > 95) {
|
|
|
+ this.percentage = 99
|
|
|
+ clearInterval(timer)
|
|
|
+ }
|
|
|
+ this.percentage = this.percentage
|
|
|
+ }, 1000)
|
|
|
+ this.downLoadParm = {}
|
|
|
+ this.downLoadParm.name = 'loadRepirsList'
|
|
|
+ this.downLoadParm.offset = 0
|
|
|
+ this.downLoadParm.page = 1
|
|
|
+ this.downLoadParm.returntype = 'Map'
|
|
|
+ if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
|
|
|
+ this.tableObj1.getdataListParm.parammaps.startTime = this.$refs['inputDatetime'].value[0]
|
|
|
+ this.tableObj1.getdataListParm.parammaps.stopTime = this.$refs['inputDatetime'].value[1]
|
|
|
+ } else {
|
|
|
+ this.tableObj1.getdataListParm.parammaps.startTime = ''
|
|
|
+ this.tableObj1.getdataListParm.parammaps.stopTime = ''
|
|
|
+ }
|
|
|
+ this.downLoadParm.parammaps =this.tableObj1.getdataListParm.parammaps
|
|
|
+ GetAccount(this.downLoadParm).then(response => {
|
|
|
+ console.log('导出', response)
|
|
|
+ if(response.data.list !== null && response.data.list !== ''){
|
|
|
+ for(let i=0;i<response.data.list.length;i++){
|
|
|
+ if(response.data.list[i].status == 0){
|
|
|
+ this.$set(response.data.list[i],'status','未离厂')
|
|
|
+ }else if(response.data.list[i].status == 1){
|
|
|
+ this.$set(response.data.list[i],'status','未回厂')
|
|
|
+ }else if(response.data.list[i].status == 2){
|
|
|
+ this.$set(response.data.list[i],'status','已回厂')
|
|
|
+ }
|
|
|
+
|
|
|
+ if (response.data.list[i].reject == 0) {
|
|
|
+ this.$set(response.data.list[i],'reject','正常')
|
|
|
+ } else {
|
|
|
+ this.$set(response.data.list[i],'reject','已关单')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ response.data.list = []
|
|
|
+ }
|
|
|
+ this.downLoadList = response.data.list
|
|
|
+ console.log(this.downLoadList)
|
|
|
+ if (response.data.list !== '') {
|
|
|
+ this.percentage = 99
|
|
|
+ setTimeout(() => {
|
|
|
+ this.isPercentage = false
|
|
|
+ }, 2000)
|
|
|
+ }
|
|
|
+ const elecExcelDatas = [
|
|
|
+ {
|
|
|
+ tHeader: ['委外验收单号', '牧场', '部门', '申请人', '有无合同', '审核状态', '离厂日期','回厂日期','供应商','设备名称','设备内部编号','费用类型','铅封号','历史铅封号','质保日期','领用单号','领用部门','领用日期','领用状态','备件编号','备件名称','备件规格','领用数量'],
|
|
|
+ filterVal: ['acceptanceCode', 'pastureName', 'departmentName', 'applicantName', 'isContract', 'reviewStatus', 'details','departureDate','returnDate','supplier','equipmentName','equipmentInternalCode','costType','sealNumber','historicalSealNumber','warrantyDate','applicationNumber','applicationDepartment','applicationDate','applicationStatus','','','','',],
|
|
|
+ tableDatas: this.downLoadList,
|
|
|
+ sheetName: '验收委外维修'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ json2excel(elecExcelDatas, '验收委外维修', true, 'xlsx')
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
// 删除
|
|
|
removeTag() {
|
|
|
this.tableObj1.getdataListParm.parammaps.pastureArr = []
|