2022-06-27 09:50:26 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class="app-container">
|
|
|
|
|
|
<!--工具栏-->
|
|
|
|
|
|
<div class="head-container">
|
|
|
|
|
|
<div v-if="crud.props.searchToggle">
|
|
|
|
|
|
<!-- 搜索 -->
|
|
|
|
|
|
<el-form
|
|
|
|
|
|
:inline="true"
|
|
|
|
|
|
class="demo-form-inline"
|
|
|
|
|
|
label-position="right"
|
|
|
|
|
|
label-width="80px"
|
|
|
|
|
|
label-suffix=":"
|
|
|
|
|
|
size="mini"
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="日期">
|
|
|
|
|
|
<label slot="label">日 期:</label>
|
|
|
|
|
|
<date-range-picker v-model="query.createTime" class="date-item" />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="产品批次">
|
|
|
|
|
|
<el-input
|
|
|
|
|
|
v-model="query.pcsn"
|
|
|
|
|
|
clearable
|
|
|
|
|
|
size="mini"
|
|
|
|
|
|
placeholder="请输入批次"
|
|
|
|
|
|
style="width: 230px;"
|
|
|
|
|
|
class="filter-item"
|
|
|
|
|
|
@keyup.enter.native="crud.toQuery"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="产品编码">
|
|
|
|
|
|
<el-input
|
|
|
|
|
|
v-model="query.material_code"
|
|
|
|
|
|
clearable
|
|
|
|
|
|
size="mini"
|
|
|
|
|
|
placeholder="请输入批次"
|
|
|
|
|
|
style="width: 230px;"
|
|
|
|
|
|
class="filter-item"
|
|
|
|
|
|
@keyup.enter.native="crud.toQuery"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="状态">
|
|
|
|
|
|
<label slot="label">状 态:</label>
|
|
|
|
|
|
<el-select
|
|
|
|
|
|
v-model="query.status"
|
|
|
|
|
|
clearable
|
|
|
|
|
|
size="mini"
|
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
|
class="filter-item"
|
|
|
|
|
|
style="width: 230px;"
|
|
|
|
|
|
@change="hand"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
v-for="item in dict.workorder_status"
|
|
|
|
|
|
:label="item.label"
|
|
|
|
|
|
:value="item.value"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<rrOperation />
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
2022-10-20 21:14:06 +08:00
|
|
|
|
<crudOperation :permission="permission">
|
|
|
|
|
|
<el-button
|
|
|
|
|
|
slot="right"
|
|
|
|
|
|
class="filter-item"
|
|
|
|
|
|
type="success"
|
|
|
|
|
|
icon="el-icon-check"
|
|
|
|
|
|
size="mini"
|
|
|
|
|
|
@click="downdtl"
|
|
|
|
|
|
>
|
|
|
|
|
|
导出Excel
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
</crudOperation>
|
2022-06-27 09:50:26 +08:00
|
|
|
|
<!--表格渲染-->
|
|
|
|
|
|
<el-table
|
|
|
|
|
|
ref="table"
|
2022-08-25 12:11:52 +08:00
|
|
|
|
:max-height="590"
|
2022-06-27 09:50:26 +08:00
|
|
|
|
v-loading="crud.loading"
|
|
|
|
|
|
:data="crud.data"
|
|
|
|
|
|
size="mini"
|
|
|
|
|
|
style="width: 100%;"
|
|
|
|
|
|
@selection-change="crud.selectionChangeHandler"
|
|
|
|
|
|
>
|
2022-09-26 15:04:26 +08:00
|
|
|
|
<el-table-column type="index" label="序号" width="100" align="center" fixed />
|
|
|
|
|
|
<el-table-column prop="0" label="日期" min-width="150" show-overflow-tooltip fixed />
|
|
|
|
|
|
<el-table-column prop="1" label="产品编码" min-width="100" show-overflow-tooltip fixed />
|
|
|
|
|
|
<el-table-column prop="2" label="批号" min-width="100" show-overflow-tooltip fixed />
|
2022-06-27 09:50:26 +08:00
|
|
|
|
<template v-for="(col,index) in cols">
|
|
|
|
|
|
<el-table-column v-if="col" :prop="col.prop" :label="col.label" width="120px" show-overflow-tooltip />
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table>
|
|
|
|
|
|
<!--分页组件-->
|
|
|
|
|
|
<pagination />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import crudPowderorder from '@/api/wms/statistics/powderorder'
|
|
|
|
|
|
import CRUD, { presenter, header, crud } from '@crud/crud'
|
|
|
|
|
|
import rrOperation from '@crud/RR.operation'
|
|
|
|
|
|
import crudOperation from '@crud/CRUD.operation'
|
|
|
|
|
|
import udOperation from '@crud/UD.operation'
|
|
|
|
|
|
import pagination from '@crud/Pagination'
|
|
|
|
|
|
import DateRangePicker from '@/components/DateRangePicker'
|
2022-10-20 21:14:06 +08:00
|
|
|
|
import {download} from "@/api/data";
|
|
|
|
|
|
import {downloadFile} from "@/utils";
|
2022-06-27 09:50:26 +08:00
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
|
name: 'Powderorder',
|
|
|
|
|
|
dicts: ['workorder_status'],
|
|
|
|
|
|
components: { pagination, crudOperation, rrOperation, udOperation, DateRangePicker },
|
|
|
|
|
|
mixins: [presenter(), header(), crud()],
|
|
|
|
|
|
cruds() {
|
|
|
|
|
|
return CRUD({
|
|
|
|
|
|
title: '粉料开单记录',
|
|
|
|
|
|
url: 'api/powderOrderQuery',
|
|
|
|
|
|
idField: 'workorder_id',
|
|
|
|
|
|
sort: 'workorder_id,desc',
|
|
|
|
|
|
crudMethod: { ...crudPowderorder },
|
2022-08-25 11:26:42 +08:00
|
|
|
|
props: {
|
|
|
|
|
|
// 每页数据条数
|
|
|
|
|
|
size: 20
|
|
|
|
|
|
},
|
2022-06-27 09:50:26 +08:00
|
|
|
|
optShow: {
|
|
|
|
|
|
add: false,
|
|
|
|
|
|
edit: false,
|
|
|
|
|
|
del: false,
|
2022-10-20 21:33:22 +08:00
|
|
|
|
download: false,
|
2022-06-27 09:50:26 +08:00
|
|
|
|
reset: true
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
cols: [],
|
|
|
|
|
|
statusList: [],
|
|
|
|
|
|
permission: {
|
|
|
|
|
|
},
|
|
|
|
|
|
rules: {
|
|
|
|
|
|
}}
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
|
|
|
|
|
[CRUD.HOOK.beforeRefresh]() {
|
|
|
|
|
|
crudPowderorder.getHeader().then(res => {
|
|
|
|
|
|
this.cols = res
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
hand(value) {
|
|
|
|
|
|
this.crud.toQuery()
|
2022-10-20 21:14:06 +08:00
|
|
|
|
},
|
|
|
|
|
|
downdtl() {
|
|
|
|
|
|
if (this.currentRow !== null) {
|
|
|
|
|
|
crud.downloadLoading = true
|
2022-10-20 21:33:22 +08:00
|
|
|
|
var data = {}
|
|
|
|
|
|
if (this.crud.query.createTime !== undefined) {
|
|
|
|
|
|
data = {
|
|
|
|
|
|
'begin_time': this.crud.query.createTime[0],
|
|
|
|
|
|
'end_time': this.crud.query.createTime[1],
|
|
|
|
|
|
'status': this.crud.query.status,
|
|
|
|
|
|
'pcsn': this.crud.query.pcsn,
|
|
|
|
|
|
'material_code': this.crud.query.material_code
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
|
|
|
data = {
|
|
|
|
|
|
'status': this.crud.query.status,
|
|
|
|
|
|
'pcsn': this.crud.query.pcsn,
|
|
|
|
|
|
'material_code': this.crud.query.material_code
|
|
|
|
|
|
}
|
2022-10-20 21:14:06 +08:00
|
|
|
|
}
|
|
|
|
|
|
download('/api/powderOrderQuery/download', data).then(result => {
|
|
|
|
|
|
downloadFile(result, '粉料开单记录', 'xlsx')
|
|
|
|
|
|
crud.downloadLoading = false
|
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
|
crud.downloadLoading = false
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
2022-06-27 09:50:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
|
|
|
|
|
|
</style>
|