2022-11-25 11:13:29 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class="app-container">
|
|
|
|
|
|
<!--工具栏-->
|
|
|
|
|
|
<div class="head-container">
|
|
|
|
|
|
<div v-if="crud.props.searchToggle">
|
|
|
|
|
|
<el-form
|
|
|
|
|
|
size="mini"
|
|
|
|
|
|
:inline="true"
|
|
|
|
|
|
class="demo-form-inline"
|
|
|
|
|
|
label-position="right"
|
|
|
|
|
|
label-width="80px"
|
|
|
|
|
|
label-suffix=":"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-form-item label="物料类别">
|
|
|
|
|
|
<treeselect
|
|
|
|
|
|
v-model="query.material_type_id"
|
|
|
|
|
|
:load-options="loadClass"
|
|
|
|
|
|
:options="classes"
|
|
|
|
|
|
style="width: 200px;"
|
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="模糊查询">
|
|
|
|
|
|
<el-input
|
|
|
|
|
|
v-model="query.material_code"
|
|
|
|
|
|
clearable
|
|
|
|
|
|
placeholder="编码、名称"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="仅显示预警" label-width="120px">
|
|
|
|
|
|
<el-switch v-model="query.is_all" active-value="1" inactive-value="0" @change="crud.toQuery()"/>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
<rrOperation />
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
|
|
|
|
|
<crudOperation :permission="permission">
|
|
|
|
|
|
<el-button
|
|
|
|
|
|
slot="right"
|
|
|
|
|
|
class="filter-item"
|
|
|
|
|
|
type="success"
|
|
|
|
|
|
icon="el-icon-check"
|
|
|
|
|
|
size="mini"
|
|
|
|
|
|
@click="downdtl"
|
|
|
|
|
|
>
|
|
|
|
|
|
导出Excel
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
</crudOperation>
|
|
|
|
|
|
<!--表格渲染-->
|
|
|
|
|
|
<el-table ref="table" border :cell-style="cellStyle" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
|
|
|
|
|
<el-table-column type="selection" width="55" />
|
|
|
|
|
|
<el-table-column prop="material_code" label="物料编码" />
|
|
|
|
|
|
<el-table-column prop="material_name" label="物料名称" />
|
|
|
|
|
|
<el-table-column prop="class_name" label="物料分类" />
|
|
|
|
|
|
<el-table-column prop="safe_ivt_down" label="安全库存下限" :formatter="crud.formatNum2" />
|
|
|
|
|
|
<el-table-column prop="ivt_qty" label="库存" :formatter="crud.formatNum2" />
|
|
|
|
|
|
<el-table-column prop="qty_unit_name" label="单位" />
|
|
|
|
|
|
</el-table>
|
|
|
|
|
|
<!--分页组件-->
|
|
|
|
|
|
<pagination />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import crudDevicesafetyqtyquery from '@/api/wms/sb/devicesafetyqtyquery'
|
|
|
|
|
|
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
|
|
|
|
|
import rrOperation from '@crud/RR.operation'
|
|
|
|
|
|
import crudOperation from '@crud/CRUD.operation'
|
|
|
|
|
|
import pagination from '@crud/Pagination'
|
|
|
|
|
|
import { download } from '@/api/data'
|
|
|
|
|
|
import { downloadFile } from '@/utils'
|
|
|
|
|
|
import crudClassstandard from '@/api/wms/basedata/master/classstandard'
|
|
|
|
|
|
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
|
|
|
|
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
|
|
|
|
import crudMaterialbase from '@/api/wms/basedata/master/materialbase'
|
|
|
|
|
|
|
|
|
|
|
|
const defaultForm = { }
|
|
|
|
|
|
export default {
|
2022-11-30 19:08:02 +08:00
|
|
|
|
name: 'Devicesafetyqtyquery2',
|
2022-11-25 11:13:29 +08:00
|
|
|
|
components: { pagination, crudOperation, rrOperation, Treeselect },
|
|
|
|
|
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
|
|
|
|
|
cruds() {
|
|
|
|
|
|
return CRUD({
|
|
|
|
|
|
title: '安全库存预警',
|
|
|
|
|
|
url: 'api/devicesafetyqtyquery/query2',
|
|
|
|
|
|
idField: 'stockrecord_id',
|
|
|
|
|
|
sort: '',
|
|
|
|
|
|
query: { is_all: '1' },
|
|
|
|
|
|
crudMethod: { ...crudDevicesafetyqtyquery },
|
|
|
|
|
|
optShow: {
|
|
|
|
|
|
add: false,
|
|
|
|
|
|
edit: false,
|
|
|
|
|
|
del: false,
|
|
|
|
|
|
download: false,
|
|
|
|
|
|
reset: true
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
classes: [],
|
|
|
|
|
|
class_idStr: null,
|
|
|
|
|
|
materOpt_code: '28',
|
|
|
|
|
|
deviceTypeList: [
|
|
|
|
|
|
{ 'label': '超上限', 'value': '01' },
|
|
|
|
|
|
{ 'label': '超下限', 'value': '02' },
|
|
|
|
|
|
{ 'label': '正常', 'value': '03' }
|
|
|
|
|
|
],
|
|
|
|
|
|
permission: {
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
created() {
|
|
|
|
|
|
const param = {
|
|
|
|
|
|
'materOpt_code': this.materOpt_code
|
|
|
|
|
|
}
|
|
|
|
|
|
crudMaterialbase.getMaterOptType(param).then(res => {
|
|
|
|
|
|
this.class_idStr = res.class_idStr
|
|
|
|
|
|
this.crud.query.class_idStr = this.class_idStr
|
|
|
|
|
|
this.crud.toQuery()
|
|
|
|
|
|
this.queryClassId()
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
hand(value) {
|
|
|
|
|
|
this.crud.toQuery()
|
|
|
|
|
|
},
|
|
|
|
|
|
loadClass({ action, parentNode, callback }) {
|
|
|
|
|
|
if (action === LOAD_CHILDREN_OPTIONS) {
|
|
|
|
|
|
crudClassstandard.getClass({ pid: parentNode.id }).then(res => {
|
|
|
|
|
|
parentNode.children = res.content.map(function(obj) {
|
|
|
|
|
|
if (obj.hasChildren) {
|
|
|
|
|
|
obj.children = null
|
|
|
|
|
|
}
|
|
|
|
|
|
return obj
|
|
|
|
|
|
})
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
callback()
|
|
|
|
|
|
}, 100)
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
queryClassId() {
|
|
|
|
|
|
const param = {
|
|
|
|
|
|
'class_idStr': this.class_idStr
|
|
|
|
|
|
}
|
|
|
|
|
|
crudClassstandard.queryClassById(param).then(res => {
|
|
|
|
|
|
this.classes = res.content.map(obj => {
|
|
|
|
|
|
if (obj.hasChildren) {
|
|
|
|
|
|
obj.children = null
|
|
|
|
|
|
}
|
|
|
|
|
|
return obj
|
|
|
|
|
|
})
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
downdtl() {
|
|
|
|
|
|
if (this.currentRow !== null) {
|
|
|
|
|
|
crud.downloadLoading = true
|
2022-11-25 21:12:35 +08:00
|
|
|
|
download('/api/devicesafetyqtyquery/download2', this.crud.query).then(result => {
|
|
|
|
|
|
downloadFile(result, '安全库存预警', 'xlsx')
|
2022-11-25 11:13:29 +08:00
|
|
|
|
crud.downloadLoading = false
|
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
|
crud.downloadLoading = false
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
cellStyle({ row, column, rowIndex, columnIndex }) {
|
|
|
|
|
|
const safe_ivt_down = parseInt(row.safe_ivt_down)
|
|
|
|
|
|
const ivt_qty = parseInt(row.ivt_qty)
|
|
|
|
|
|
|
|
|
|
|
|
if (column.property === 'ivt_qty') {
|
|
|
|
|
|
if (ivt_qty < safe_ivt_down) {
|
|
|
|
|
|
return 'background: red'
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (safe_ivt_down <= ivt_qty) {
|
|
|
|
|
|
return ''
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
|
|
|
|
|
::v-deep {
|
|
|
|
|
|
|
|
|
|
|
|
.vue-treeselect__menu {
|
|
|
|
|
|
|
|
|
|
|
|
overflow-x: auto !important;
|
|
|
|
|
|
|
|
|
|
|
|
width: 300px;
|
|
|
|
|
|
|
|
|
|
|
|
max-height: 300px !important;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.vue-treeselect__label {
|
|
|
|
|
|
|
|
|
|
|
|
overflow: unset;
|
|
|
|
|
|
|
|
|
|
|
|
text-overflow: unset;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.vue-treeselect__control {
|
|
|
|
|
|
|
|
|
|
|
|
height: 20px !important;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.vue-treeselect__multi-value-item-container,
|
|
|
|
|
|
|
|
|
|
|
|
.vue-treeselect--has-value .vue-treeselect__multi-value {
|
|
|
|
|
|
|
|
|
|
|
|
height: 30px;
|
|
|
|
|
|
|
|
|
|
|
|
line-height: 24px;
|
|
|
|
|
|
|
|
|
|
|
|
padding: 0;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.vue-treeselect__limit-tip,
|
|
|
|
|
|
|
|
|
|
|
|
.vue-treeselect--searchable.vue-treeselect--multi.vue-treeselect--has-value
|
|
|
|
|
|
|
|
|
|
|
|
.vue-treeselect__input-container {
|
|
|
|
|
|
|
|
|
|
|
|
padding-top: 0;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.vue-treeselect__placeholder,
|
|
|
|
|
|
|
|
|
|
|
|
.vue-treeselect__single-value {
|
|
|
|
|
|
|
|
|
|
|
|
height: 28px;
|
|
|
|
|
|
|
|
|
|
|
|
line-height: 32px;
|
|
|
|
|
|
|
|
|
|
|
|
font-size: small;
|
|
|
|
|
|
|
|
|
|
|
|
color: "#CCCFD6";
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.vue-treeselect--has-value .vue-treeselect__input {
|
|
|
|
|
|
|
|
|
|
|
|
height: 18px !important;
|
|
|
|
|
|
|
|
|
|
|
|
line-height: 18px !important;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.vue-treeselect div,
|
|
|
|
|
|
|
|
|
|
|
|
.vue-treeselect span {
|
|
|
|
|
|
|
|
|
|
|
|
box-sizing: content-box;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.vue-treeselect__multi-value-label {
|
|
|
|
|
|
|
|
|
|
|
|
display: block;
|
|
|
|
|
|
|
|
|
|
|
|
width: 140px;
|
|
|
|
|
|
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.vue-treeselect__value-container {
|
|
|
|
|
|
|
|
|
|
|
|
display: block;
|
|
|
|
|
|
|
|
|
|
|
|
height: 32px;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|