284 lines
8.7 KiB
Vue
284 lines
8.7 KiB
Vue
<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=":"
|
||
>
|
||
<el-form-item label="物料">
|
||
<el-input
|
||
v-model="query.material_code"
|
||
clearable
|
||
size="mini"
|
||
placeholder="请输入物料编码或名称"
|
||
style="width: 210px;"
|
||
class="filter-item"
|
||
@keyup.enter.native="crud.toQuery"
|
||
/>
|
||
</el-form-item>
|
||
|
||
<el-form-item label="批次">
|
||
<el-input
|
||
v-model="query.pcsn"
|
||
clearable
|
||
size="mini"
|
||
placeholder="请输入批次"
|
||
style="width: 210px;"
|
||
class="filter-item"
|
||
@keyup.enter.native="crud.toQuery"
|
||
/>
|
||
</el-form-item>
|
||
<el-form-item label="计划发货日期">
|
||
<label slot="label">计划发货日期:</label>
|
||
<el-date-picker
|
||
v-model="query.createTime"
|
||
type="daterange"
|
||
value-format="yyyy-MM-dd HH:mm:ss"
|
||
start-placeholder="开始日期"
|
||
end-placeholder="结束日期"
|
||
:default-time="['00:00:00', '23:59:59']"
|
||
/>
|
||
</el-form-item>
|
||
<el-form-item label="所属组织">
|
||
<el-select
|
||
v-model="query.org_id"
|
||
clearable
|
||
size="mini"
|
||
style="width: 210px;"
|
||
placeholder="所属组织"
|
||
class="filter-item"
|
||
@change="crud.toQuery"
|
||
>
|
||
<el-option
|
||
v-for="item in Depts"
|
||
:key="item.id"
|
||
:label="item.name"
|
||
:value="item.id"
|
||
/>
|
||
</el-select>
|
||
</el-form-item>
|
||
<el-form-item label="工令号">
|
||
<label slot="label">工令号:</label>
|
||
<el-input
|
||
v-model="query.workorder_code"
|
||
clearable
|
||
size="mini"
|
||
placeholder="请输入工令号"
|
||
style="width: 210px;"
|
||
class="filter-item"
|
||
@keyup.enter.native="crud.toQuery"
|
||
/>
|
||
</el-form-item>
|
||
|
||
<el-form-item label="发货人">
|
||
<label slot="label">发货人:</label>
|
||
<el-input
|
||
v-model="query.send_name"
|
||
clearable
|
||
size="mini"
|
||
placeholder="请输入发货人"
|
||
style="width: 210px;"
|
||
class="filter-item"
|
||
@keyup.enter.native="crud.toQuery"
|
||
/>
|
||
</el-form-item>
|
||
|
||
<el-form-item label="是否发货">
|
||
<el-select
|
||
v-model="query.is_send"
|
||
clearable
|
||
size="mini"
|
||
placeholder="请选择"
|
||
class="filter-item"
|
||
style="width: 210px;"
|
||
@change="hand"
|
||
>
|
||
<el-option
|
||
v-for="item in passList"
|
||
:label="item.label"
|
||
:value="item.value"
|
||
/>
|
||
</el-select>
|
||
</el-form-item>
|
||
<rrOperation />
|
||
</el-form>
|
||
</div>
|
||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||
<crudOperation :permission="permission" />
|
||
<!--表格渲染-->
|
||
<el-table ref="table" :max-height="590" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;"
|
||
@selection-change="crud.selectionChangeHandler"
|
||
@current-change="handleCurrentChange"
|
||
@select="handleSelectionChange"
|
||
@select-all="onSelectAll"
|
||
>
|
||
<el-table-column prop="send_date" label="计划发货日期" width="120px" />
|
||
<el-table-column prop="workorder_code" label="工令号" width="120px" />
|
||
<el-table-column prop="org_id" label="所属组织" width="120px" :formatter="orgFormat" />
|
||
<el-table-column prop="material_code" label="物料编码" width="120px" />
|
||
<el-table-column prop="pcsn" label="批次" min-width="100" />
|
||
<el-table-column prop="workorder_qty" label="重量" width="150px" />
|
||
<el-table-column prop="workorder_status" label="工令状态" width="150px" :formatter="stateFormat" />
|
||
<el-table-column prop="storagevehicle_code" label="托盘号" />
|
||
<el-table-column prop="num_bucket" label="桶数" />
|
||
<el-table-column prop="total_qty" label="托盘重量" min-width="120px"/>
|
||
<el-table-column prop="create_name" label="组盘人" />
|
||
<el-table-column prop="create_time" label="组盘时间" min-width="150px" />
|
||
<el-table-column prop="is_send" label="是否已发货" min-width="120px" :formatter="formatResult" />
|
||
<el-table-column prop="send_name" label="发货人" />
|
||
<el-table-column prop="send_time" label="发货时间" min-width="150px" />
|
||
</el-table>
|
||
<!--分页组件-->
|
||
<pagination />
|
||
</div>
|
||
</div>
|
||
</template>
|
||
|
||
<script>
|
||
import crudInspectionsheetmst from '@/api/wms/ql/inspectionsheetmst'
|
||
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'
|
||
import AddDialog from '@/views/wms/ql/inspectionsheet/AddDialog'
|
||
import ResultPutDialog from '@/views/wms/ql/inspectionsheet/ResultPutDialog'
|
||
import Date from '@/utils/datetime'
|
||
import workorder from '@/api/wms/pdm/workorder'
|
||
|
||
export default {
|
||
name: 'SendOutQuery',
|
||
dicts: ['workorder_status', 'ST_INV_TYPE_RC'],
|
||
components: { pagination, crudOperation, rrOperation },
|
||
mixins: [presenter(), header(), crud()],
|
||
cruds() {
|
||
return CRUD({
|
||
title: '外协发货查询',
|
||
url: 'api/statistical/sendOutQuery',
|
||
idField: 'inspection_id',
|
||
sort: '',
|
||
props: {
|
||
// 每页数据条数
|
||
size: 20
|
||
},
|
||
crudMethod: { ...crudInspectionsheetmst },
|
||
optShow: {
|
||
add: false,
|
||
edit: false,
|
||
del: false,
|
||
download: false,
|
||
reset: true
|
||
}})
|
||
},
|
||
data() {
|
||
return {
|
||
statusList: [],
|
||
resultList: [],
|
||
currentRow: {},
|
||
Depts: [],
|
||
resultPutDialog: false,
|
||
openParam: {},
|
||
query_flag: true,
|
||
passList: [
|
||
{ 'label': '是', 'value': '1' },
|
||
{ 'label': '否', 'value': '0' }
|
||
],
|
||
permission: {
|
||
}
|
||
}
|
||
},
|
||
created() {
|
||
crudInspectionsheetmst.getStatus().then(res => {
|
||
this.statusList = res
|
||
})
|
||
workorder.getDepts().then(res => {
|
||
this.Depts = res
|
||
})
|
||
},
|
||
methods: {
|
||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||
[CRUD.HOOK.beforeRefresh]() {
|
||
},
|
||
handleSelectionChange(val, row) {
|
||
if (val.length > 1) {
|
||
this.$refs.table.clearSelection()
|
||
this.$refs.table.toggleRowSelection(val.pop())
|
||
this.buttonChange(row)
|
||
} else if (val.length === 1) {
|
||
this.buttonChange(row)
|
||
}else{
|
||
this.handleCurrentChange(null)
|
||
}
|
||
},
|
||
onSelectAll() {
|
||
this.$refs.table.clearSelection()
|
||
this.handleCurrentChange(null)
|
||
},
|
||
orgFormat(row) {
|
||
for (const item of this.Depts) {
|
||
if (item.id === row.org_id) {
|
||
return item.name
|
||
}
|
||
}
|
||
},
|
||
hand(value) {
|
||
this.crud.toQuery()
|
||
},
|
||
buttonChange(current) {
|
||
if (current !== null) {
|
||
this.currentRow = current
|
||
}
|
||
},
|
||
onInput() {
|
||
this.$forceUpdate()
|
||
},
|
||
mytoQuery(array1){
|
||
if(array1 === null){
|
||
this.crud.query.begin_time = ''
|
||
this.crud.query.end_time = ''
|
||
}else{
|
||
this.crud.query.begin_time = array1[0]
|
||
this.crud.query.end_time = array1[1]
|
||
}
|
||
this.crud.toQuery()
|
||
},
|
||
handleCurrentChange(current) {
|
||
if (current === null) {
|
||
this.currentRow = {}
|
||
}
|
||
},
|
||
formatStatus(row, column) {
|
||
for (const item of this.statusList) {
|
||
if (item.value === row.bill_status) {
|
||
return item.label
|
||
}
|
||
}
|
||
},
|
||
formatResult(row) {
|
||
if (row.is_send === '1') {
|
||
return '是'
|
||
} else return '否'
|
||
},
|
||
stateFormat(row) {
|
||
return this.dict.label.workorder_status[row.workorder_status]
|
||
},
|
||
querytable() {
|
||
this.onSelectAll()
|
||
this.crud.toQuery()
|
||
this.handleCurrentChange(null)
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style scoped>
|
||
|
||
</style>
|