This commit is contained in:
zds
2022-08-10 16:09:18 +08:00
parent d885047303
commit d87802ba7e
6 changed files with 244 additions and 7 deletions

View File

@@ -38,7 +38,7 @@
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"
@change="crud.toQuery"
@change="mytoQuery"
/>
</el-form-item>
<el-form-item label="工令类型">
@@ -182,6 +182,16 @@
>
打印工令指令卡
</el-button>
<el-button
slot="right"
class="filter-item"
type="warning"
icon="el-icon-check"
size="mini"
@click="downdData"
>
导出Excel
</el-button>
</crudOperation>
<!--表格渲染-->
<el-table
@@ -264,6 +274,8 @@ import crudseriesProcessRoute from "@/api/wms/pdm/seriesProcessRoute";
import {getLodop} from "@/assets/js/lodop/LodopFuncs";
import Date from "@/utils/datetime";
import crudWorkProcedure from "@/api/wms/basedata/pdm/workProcedure";
import { download } from '@/api/data'
import { downloadFile } from '@/utils'
export default {
name: 'workorder',
@@ -302,6 +314,7 @@ export default {
viewShow: false,
changeShow: false,
currentRow: null,
query_flag: true,
checkrows: []
}
},
@@ -322,13 +335,18 @@ export default {
this.Depts = res
})
this.crud.query.createTime = [new Date(), new Date().daysLater(2)]
this.crud.toQuery()
//this.crud.toQuery()
},
methods: {
canUd(row) {
return row.status !== '10'
},
[CRUD.HOOK.beforeRefresh]() {
if(this.query_flag){
this.crud.query.begin_time = (new Date()).toISOString()
this.crud.query.end_time = (new Date().daysLater(2)).toISOString()
this.query_flag = false
}
this.handleCurrentChange()
},
toView(index, row) {
@@ -436,6 +454,15 @@ export default {
this.querytable()
})
},
downdData() {
crud.downloadLoading = true
download('/api/workorder/download', this.crud.getQueryParams()).then(result => {
downloadFile(result, this.crud.title + '数据', 'xlsx')
crud.downloadLoading = false
}).catch(() => {
crud.downloadLoading = false
})
},
openWork() {
this.checkrows = this.$refs.table.selection
if(this.checkrows.length === 0 ){
@@ -458,6 +485,11 @@ export default {
this.querytable()
})
},
mytoQuery(array1){
this.crud.query.begin_time = array1[0]
this.crud.query.end_time = array1[1]
this.crud.toQuery()
},
querytable() {
this.crud.toQuery()
this.handleCurrentChange()