|
@@ -134,6 +134,7 @@ import {
|
|
orderBaseStatusCount,
|
|
orderBaseStatusCount,
|
|
orderEsBaseListEs,
|
|
orderEsBaseListEs,
|
|
orderEsBaseListExportEs,
|
|
orderEsBaseListExportEs,
|
|
|
|
+ orderEsBaseListExportEs2,
|
|
orderEsBaseStatusCountEs,
|
|
orderEsBaseStatusCountEs,
|
|
orderBaseImport,
|
|
orderBaseImport,
|
|
orderBaseImport2,
|
|
orderBaseImport2,
|
|
@@ -444,7 +445,50 @@ export default {
|
|
.catch(() => {})
|
|
.catch(() => {})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- ]
|
|
|
|
|
|
+ ],
|
|
|
|
+ [
|
|
|
|
+ this.optionsEvensAuth('exp2', {
|
|
|
|
+ click: () => {
|
|
|
|
+ const loading = this.$loading({
|
|
|
|
+ lock: true,
|
|
|
|
+ text: '正在导出',
|
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
|
+ })
|
|
|
|
+ const queryParmas = this.$refs?.pageRef?.getParams()
|
|
|
|
+ const pms = this.$refs?.pageRef?.parameter
|
|
|
|
+ // 等待getList返回结果后再执行后续代码
|
|
|
|
+ this.getList(pms).then(res => {
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ // 修复逻辑判断:当没有记录时显示错误
|
|
|
|
+ if (!res?.data?.records?.length) {
|
|
|
|
+ this.$message.error('导出条件没有查到任何符合条件的数据,请调整查询条件再导出。')
|
|
|
|
+ loading.close()
|
|
|
|
+ } else {
|
|
|
|
+ const exportFieldFiters = ['service_order_id','id','total_num','over_time','sign_datetime']
|
|
|
|
+ const exportFields = []
|
|
|
|
+ res?.fieldBeans?.forEach(item => {
|
|
|
|
+ if (exportFieldFiters.includes(item.colName)) {
|
|
|
|
+ exportFields.push(item)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ //组成请求对象
|
|
|
|
+ orderEsBaseListExportEs2({
|
|
|
|
+ ...pms,
|
|
|
|
+ params: queryParmas.querylist,
|
|
|
|
+ pageSize: -1,
|
|
|
|
+ exportFields: exportFields
|
|
|
|
+ }, '工单固定列导出.xlsx')
|
|
|
|
+ loading.close()
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(res.msg)
|
|
|
|
+ loading.close()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ ],
|
|
]
|
|
]
|
|
]
|
|
]
|
|
}
|
|
}
|
|
@@ -632,6 +676,7 @@ export default {
|
|
|
|
|
|
// 列表请求函数
|
|
// 列表请求函数
|
|
getList(p, cb) {
|
|
getList(p, cb) {
|
|
|
|
+ console.log(p);
|
|
var pam = JSON.parse(JSON.stringify(p))
|
|
var pam = JSON.parse(JSON.stringify(p))
|
|
try {
|
|
try {
|
|
if (pam.orderStatus) {
|
|
if (pam.orderStatus) {
|