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()

View File

@@ -261,11 +261,25 @@
<el-table-column prop="is_CXJ006" label="白油" align="center" width="100px" :formatter="crud.formatQlNum4"/>
<el-table-column prop="is_CXJ007" label="油酸" align="center" width="100px" :formatter="crud.formatQlNum4"/>
<el-table-column prop="is_CXJ008" label="8号分散剂" align="center" width="100px" :formatter="crud.formatQlNum4"/>
<el-table-column align="center" label="操作" width="160" fixed="right">
<el-table-column align="center" label="操作" width="270" fixed="right">
<template scope="scope">
<el-button :disabled="!button2" type="danger" class="filter-item" size="mini" icon="el-icon-delete" @click.native.prevent="deleteRow(scope.$index,tableDtl)" />
<el-button v-show="!scope.row.edit" :disabled="!button2" type="primary" class="filter-item" size="mini" icon="el-icon-edit" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
<el-button v-show="scope.row.edit" :disabled="!button2" type="success" class="filter-item" size="mini" icon="el-icon-check" @click="handleEdit(scope.$index, scope.row)">完成</el-button>
<el-button
type="primary" class="filter-item"
size="mini"
icon="el-icon-top"
@click="moveUp(scope.$index, scope.row)"
>
</el-button>
<el-button
type="primary" class="filter-item"
size="mini"
icon="el-icon-bottom"
@click="moveDown(scope.$index, scope.row)"
>
</el-button>
</template>
</el-table-column>
</el-table>
@@ -474,6 +488,25 @@ export default {
}
})
},
moveUp(index, item) {
if (index > 0) {
const upDate = this.tableDtl[index - 1]
this.tableDtl.splice(index - 1, 1)
this.tableDtl.splice(index, 0, upDate)
} else {
this.$message.error('已经是第一条,不可上移')
}
},
moveDown(index, item) {
if ((index + 1) === this.tableDtl.length) {
this.$message.error('已经是最后一条,不可下移')
} else {
console.log(index)
const downDate = this.tableDtl[index + 1]
this.tableDtl.splice(index + 1, 1)
this.tableDtl.splice(index, 0, downDate)
}
},
close() {
this.$refs['form2'].resetFields()
this.$refs['form'].resetFields()