代码更新
This commit is contained in:
262
mes/qd/src/views/wms/statistics/sheetQuery/index.vue
Normal file
262
mes/qd/src/views/wms/statistics/sheetQuery/index.vue
Normal file
@@ -0,0 +1,262 @@
|
||||
<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.inspection_code"
|
||||
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.inspection_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 210px;"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.QC_INV_TYPE"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="日期">
|
||||
<label slot="label">日 期:</label>
|
||||
<date-range-picker v-model="query.createTime" class="date-item" style="width: 210px" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="物料">
|
||||
<label slot="label">物 料:</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="批号">
|
||||
<label slot="label">批 号:</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="单据状态">
|
||||
<el-select
|
||||
v-model="query.bill_status"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 210px;"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in statusList"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="是否合格">
|
||||
<el-select
|
||||
v-model="query.is_pass"
|
||||
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" 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 type="selection" width="55" />
|
||||
<el-table-column v-if="false" prop="inspection_id" label="质检单标识" />
|
||||
<el-table-column show-overflow-tooltip prop="inspection_code" label="质检单号" min-width="130">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.inspection_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="material_code" label="物料编码" width="120px" show-overflow-tooltip/>
|
||||
<el-table-column prop="material_name" label="物料名称" width="150px" show-overflow-tooltip/>
|
||||
<el-table-column prop="pcsn" label="批次" min-width="100" show-overflow-tooltip/>
|
||||
<el-table-column prop="bill_status" label="单据状态" :formatter="formatStatus" />
|
||||
<el-table-column prop="result" label="处理结果" :formatter="formatResult" />
|
||||
<el-table-column prop="source_bill_type" label="源单据类型" :formatter="formatBillType" width="120px"/>
|
||||
<el-table-column prop="source_bill_code" label="源单号" width="120px" />
|
||||
<el-table-column prop="input_optname" label="创建人" />
|
||||
<el-table-column prop="input_time" label="创建时间" width="150px" />
|
||||
<el-table-column prop="confirm_optname" label="确认人" />
|
||||
<el-table-column prop="confirm_time" label="确认时间" width="150px" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<AddDialog @AddChanged="querytable" />
|
||||
<ResultPutDialog :dialog-show.sync="resultPutDialog" :open-param="openParam" @AddChanged="querytable" />
|
||||
</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'
|
||||
|
||||
export default {
|
||||
name: 'SheetQuery',
|
||||
dicts: ['QC_INV_TYPE', 'ST_INV_TYPE_RC'],
|
||||
components: { AddDialog, pagination, crudOperation, rrOperation, udOperation, DateRangePicker, ResultPutDialog },
|
||||
mixins: [presenter(), header(), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '质检单管理',
|
||||
url: 'api/inspectionsheetmst',
|
||||
idField: 'inspection_id',
|
||||
sort: '',
|
||||
crudMethod: { ...crudInspectionsheetmst },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
}})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
statusList: [],
|
||||
resultList: [],
|
||||
currentRow: {},
|
||||
resultPutDialog: false,
|
||||
openParam: {},
|
||||
passList: [
|
||||
{ 'label': '合格', 'value': '01' },
|
||||
{ 'label': '不合格', 'value': '02' }
|
||||
],
|
||||
permission: {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudInspectionsheetmst.getStatus().then(res => {
|
||||
this.statusList = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
this.handleCurrentChange(null)
|
||||
},
|
||||
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)
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
buttonChange(current) {
|
||||
if (current !== null) {
|
||||
this.currentRow = current
|
||||
}
|
||||
},
|
||||
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, column) {
|
||||
if (row.result === '01') {
|
||||
return '合格'
|
||||
} else if (row.result === '02') {
|
||||
return '不合格'
|
||||
} else if (row.result === '03') {
|
||||
return '紧急放行'
|
||||
}
|
||||
},
|
||||
formatBillType(row, column) {
|
||||
return this.dict.label.ST_INV_TYPE_RC[row.source_bill_type]
|
||||
},
|
||||
querytable() {
|
||||
this.onSelectAll()
|
||||
this.crud.toQuery()
|
||||
this.handleCurrentChange(null)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user