add:预警管理功能新增
This commit is contained in:
@@ -0,0 +1,305 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="crud.status.title"
|
||||
append-to-body
|
||||
fullscreen
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0 || crud.status.view > 0"
|
||||
width="1200px"
|
||||
@open="open"
|
||||
@close="close"
|
||||
>
|
||||
<el-row v-show="crud.status.cu > 0" :gutter="20">
|
||||
<el-col :span="20" style="border: 1px solid white">
|
||||
<span />
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<span>
|
||||
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" type="primary" @click="crud.submitCU">保存</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form ref="form" :model="form" label-width="100px" :rules="rules" class="custom-form-spacing">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="方案名称" prop="name">
|
||||
<el-input v-model="form.name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="仓库名称" prop="stor_code">
|
||||
<el-select
|
||||
v-model="form.stor_code"
|
||||
placeholder=""
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in stors"
|
||||
:key="item.stor_code"
|
||||
:label="item.stor_name"
|
||||
:value="item.stor_code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="安全库存天数" prop="safe_days">
|
||||
<el-input v-model="form.safe_days" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="安全库存数量" prop="safe_qty">
|
||||
<el-input v-model="form.safe_qty" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="表达式" prop="cron">
|
||||
<el-input v-model="form.cron" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="通知类型" prop="notify_type">
|
||||
<el-select v-model="form.notify_type" filterable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in dict.NOTIFY_TYPE"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="描述" prop="remark">
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
style="width: 400px;"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<div class="crud-opts2" style="margin-bottom: 5px;">
|
||||
<span class="crud-opts-right2">
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<el-button
|
||||
slot="left"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="insertEvent()"
|
||||
>
|
||||
添加预警物料
|
||||
</el-button>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="form.tableData"
|
||||
style="width: 100%;"
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
>
|
||||
<el-table-column show-overflow-tooltip width="300px" prop="material_code" label="物料编码" />
|
||||
<el-table-column show-overflow-tooltip width="300px" prop="material_name" label="物料名称" />
|
||||
<el-table-column show-overflow-tooltip width="300px" prop="material_spec" label="物料规格" />
|
||||
<el-table-column show-overflow-tooltip width="300px" prop="material_model" label="物料型号" />
|
||||
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="0" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button
|
||||
type="danger"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
icon="el-icon-delete"
|
||||
@click.native.prevent="deleteRow(scope.$index, form.tableData)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<AddMaterial :dialog-show.sync="dtlShow" @tableChanged="tableChanged" />
|
||||
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud, form } from '@crud/crud'
|
||||
import AddMaterial from '@/views/wms/forewarning_management/forewarning_config/AddMaterial'
|
||||
import stIvtForewarningconfig from '@/views/wms/forewarning_management/forewarning_config/stIvtForewarningconfig'
|
||||
import crudBsrealstorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
|
||||
import crudStorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
|
||||
|
||||
const defaultForm = {
|
||||
bill_code: '',
|
||||
stor_code: '',
|
||||
bill_status: '10',
|
||||
total_qty: '0',
|
||||
detail_count: '0',
|
||||
bill_type: '',
|
||||
remark: '',
|
||||
biz_date: new Date(),
|
||||
create_mode: '',
|
||||
tableData: []
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'AddDialog',
|
||||
components: { AddMaterial },
|
||||
mixins: [crud(), form(defaultForm)],
|
||||
dicts: ['io_bill_status', 'ST_QUALITY_SCODE', 'ST_INV_IN_TYPE', 'NOTIFY_TYPE'],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
dtlShow: false,
|
||||
bill_btn: false,
|
||||
mater_btn: false,
|
||||
storlist: [],
|
||||
billtypelist: [],
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '方案名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
stor_code: [
|
||||
{ required: true, message: '仓库编码不能为空', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
stors: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudStorattr.getStor().then(res => {
|
||||
this.stors = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
crudBsrealstorattr.getStor().then(res => {
|
||||
this.storlist = res
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$emit('AddChanged')
|
||||
},
|
||||
[CRUD.HOOK.afterToEdit]() {
|
||||
// 获取预警物料
|
||||
stIvtForewarningconfig.getWarningMaterial({ 'config_id': this.form.id }).then(res => {
|
||||
this.form.tableData = res
|
||||
// 将明细变成不可编辑
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
const row = this.form.tableData[i]
|
||||
this.form.tableData.splice(i, 1, row)
|
||||
}
|
||||
})
|
||||
},
|
||||
[CRUD.HOOK.afterToAdd]() {
|
||||
this.bill_btn = false
|
||||
this.mater_btn = false
|
||||
},
|
||||
[CRUD.HOOK.afterToView]() {
|
||||
this.bill_btn = true
|
||||
this.mater_btn = true
|
||||
stIvtForewarningconfig.getWarningMaterial({ 'bill_code': this.form.id }).then(res => {
|
||||
this.form.tableData = res
|
||||
// 将明细变成不可编辑
|
||||
for (let i = 0; i < this.form.tableData.length; i++) {
|
||||
const row = this.form.tableData[i]
|
||||
this.form.tableData.splice(i, 1, row)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
[CRUD.HOOK.beforeSubmit]() {
|
||||
// 提交前校验
|
||||
if (this.form.tableData.length === 0) {
|
||||
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
},
|
||||
billTypeChange(val) {
|
||||
if (val === '000101') {
|
||||
this.bill_btn = false
|
||||
this.mater_btn = true
|
||||
} else if (val === '000102') {
|
||||
this.bill_btn = true
|
||||
this.mater_btn = false
|
||||
} else {
|
||||
this.bill_btn = true
|
||||
this.mater_btn = true
|
||||
}
|
||||
this.form.tableData = []
|
||||
this.form.total_qty = 0
|
||||
this.form.detail_count = 0
|
||||
},
|
||||
fun(val) {
|
||||
return Number(val).toFixed(3)
|
||||
},
|
||||
async insertdtl() {
|
||||
if (this.form.bill_type === '') {
|
||||
this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.form.detail_count = this.form.tableData.length
|
||||
},
|
||||
deleteRow(index, rows) {
|
||||
rows.splice(index, 1)
|
||||
this.form.detail_count = this.form.tableData.length
|
||||
},
|
||||
|
||||
tableChanged(rows) {
|
||||
// 对新增的行进行校验不能存在相同物料批次
|
||||
this.form.tableData = rows
|
||||
this.form.detail_count = this.form.tableData.length
|
||||
},
|
||||
async insertEvent(row) {
|
||||
if (this.form.stor_code === '') {
|
||||
this.crud.notify('请选择仓库!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
this.dtlShow = true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.crud-opts2 {
|
||||
padding: 4px 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.crud-opts2 .crud-opts-right2 {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.custom-form-spacing .el-row {
|
||||
margin-bottom: 24px; /* 或你想要的间距 */
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,136 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="物料新增"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1000px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="物料编码/物料名称"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
<rrOperation />
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation />
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column
|
||||
show-overflow-tooltip
|
||||
:min-width="flexWidth('material_code', crud.data, '物料编码')"
|
||||
prop="material_code"
|
||||
label="物料编码"
|
||||
/>
|
||||
<el-table-column
|
||||
show-overflow-tooltip
|
||||
:min-width="flexWidth('material_name', crud.data, '物料名称')"
|
||||
prop="material_name"
|
||||
label="物料名称"
|
||||
/>
|
||||
<el-table-column
|
||||
show-overflow-tooltip
|
||||
width="300px"
|
||||
prop="material_spec"
|
||||
label="物料规格"
|
||||
/>
|
||||
<el-table-column
|
||||
show-overflow-tooltip
|
||||
:min-width="flexWidth('material_model', crud.data, '物料型号')"
|
||||
prop="material_model"
|
||||
label="物料型号"
|
||||
/>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false;query.search=''">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
export default {
|
||||
name: 'AddMaterial',
|
||||
components: { crudOperation, rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '物料',
|
||||
url: '/api/Materia',
|
||||
crudMethod: {},
|
||||
optShow: {
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
rows: [],
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
close() {
|
||||
this.query.search = ''
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.rows = this.$refs.multipleTable.selection
|
||||
console.log('获取的rows:')
|
||||
console.log(this.rows)
|
||||
this.$emit('tableChanged', this.rows)
|
||||
// crudRawAssist.queryBoxMater(this.rows).then(res => {
|
||||
// this.rows = res
|
||||
// this.$emit('tableChanged', this.rows)
|
||||
// })
|
||||
// this.form = this.$options.data().form
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,270 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<label class="el-form-item-label">方案名称</label>
|
||||
<el-input v-model="query.name" clearable placeholder="方案名称" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<label class="el-form-item-label">仓库名称</label>
|
||||
<el-select
|
||||
v-model="query.stor_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="仓库名称"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in stors"
|
||||
:key="item.stor_code"
|
||||
:label="item.stor_name"
|
||||
:value="item.stor_code"
|
||||
/>
|
||||
</el-select> <label class="el-form-item-label">安全库存数量</label>
|
||||
<el-input v-model="query.safe_qty" clearable placeholder="安全库存数量" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<label class="el-form-item-label">安全库存天数</label>
|
||||
<el-input v-model="query.safe_days" clearable placeholder="安全库存天数" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<label class="el-form-item-label">通知类型</label>
|
||||
<el-select
|
||||
v-model="query.notify_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="通知类型"
|
||||
class="filter-item"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.NOTIFY_TYPE"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<rrOperation :crud="crud" />
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="80%"
|
||||
>
|
||||
<el-form ref="form" :model="form" label-width="100px" :rules="rules" class="custom-form-spacing">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="方案名称" prop="name">
|
||||
<el-input v-model="form.name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="仓库名称" prop="stor_code">
|
||||
<el-select
|
||||
v-model="form.stor_code"
|
||||
placeholder=""
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in stors"
|
||||
:key="item.stor_code"
|
||||
:label="item.stor_name"
|
||||
:value="item.stor_code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="安全库存天数" prop="safe_days">
|
||||
<el-input v-model="form.safe_days" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="安全库存数量" prop="safe_qty">
|
||||
<el-input v-model="form.safe_qty" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="表达式" prop="cron">
|
||||
<el-input v-model="form.cron" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="通知类型" prop="notify_type">
|
||||
<el-select v-model="form.notify_type" filterable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in dict.NOTIFY_TYPE"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="描述" prop="remark">
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
style="width: 400px;"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" 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="name" label="方案名称" :min-width="flexWidth('name',crud.data,'方案名称')" />
|
||||
<el-table-column prop="stor_name" label="仓库名称" :min-width="flexWidth('stor_name',crud.data,'仓库名称')" />
|
||||
<el-table-column prop="safe_qty" label="安全库存数量" :min-width="flexWidth('safe_qty',crud.data,'安全库存数量')" />
|
||||
<el-table-column prop="safe_days" label="安全库存天数" :min-width="flexWidth('safe_days',crud.data,'安全库存天数')" />
|
||||
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')" />
|
||||
<el-table-column label="是否启用" align="center" prop="is_active">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
:value="scope.row.is_active"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
@change="changeEnabled(scope.row, scope.row.is_active)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="cron" label="表达式" :min-width="flexWidth('cron',crud.data,'表达式')" />
|
||||
<el-table-column prop="notify_type" label="通知类型" :min-width="flexWidth('notify_type',crud.data,'通知类型')">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.NOTIFY_TYPE[scope.row.notify_type] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<AddDialog @AddChanged="querytable" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudStIvtForewarningconfig from './stIvtForewarningconfig'
|
||||
import CRUD, { crud, form, header, presenter } 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 crudStorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
|
||||
import AddDialog from '@/views/wms/forewarning_management/forewarning_config/AddDialog.vue'
|
||||
import stIvtForewarningconfig from '@/views/wms/forewarning_management/forewarning_config/stIvtForewarningconfig'
|
||||
|
||||
const defaultForm = {
|
||||
id: null,
|
||||
name: null,
|
||||
stor_code: null,
|
||||
safe_qty: null,
|
||||
safe_days: null,
|
||||
remark: null,
|
||||
is_active: null,
|
||||
is_delete: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
update_id: null,
|
||||
update_name: null,
|
||||
update_time: null,
|
||||
cron: null,
|
||||
notify_type: null
|
||||
}
|
||||
export default {
|
||||
name: 'StIvtForewarningconfig',
|
||||
components: { AddDialog, pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
dicts: ['NOTIFY_TYPE'],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '预警配置',
|
||||
url: 'api/stIvtForewarningconfig',
|
||||
idField: 'id',
|
||||
sort: 'id,desc',
|
||||
crudMethod: { ...crudStIvtForewarningconfig }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '方案名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
stor_code: [
|
||||
{ required: true, message: '仓库编码不能为空', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
queryTypeOptions: [
|
||||
{ key: 'name', display_name: '方案名称' },
|
||||
{ key: 'stor_code', display_name: '仓库编码' },
|
||||
{ key: 'safe_qty', display_name: '安全库存数量' },
|
||||
{ key: 'safe_days', display_name: '安全库存天数' },
|
||||
{ key: 'notify_type', display_name: '通知类型' }
|
||||
],
|
||||
stors: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudStorattr.getStor().then(res => {
|
||||
this.stors = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
querytable() {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
changeEnabled(data, val) {
|
||||
let msg = '此操作将停用,是否继续!'
|
||||
if (val !== true) {
|
||||
msg = '此操作将启用,是否继续!'
|
||||
}
|
||||
this.$confirm(msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
stIvtForewarningconfig.changeActive(data).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
data.is_active = !data.is_active
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.custom-form-spacing .el-form-item {
|
||||
margin-bottom: 24px; /* 或你想要的间距 */
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,43 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/stIvtForewarningconfig',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/stIvtForewarningconfig/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/stIvtForewarningconfig',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getWarningMaterial(params) {
|
||||
return request({
|
||||
url: '/api/stIvtForewarningconfig/getWarningMaterial',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function changeActive(data) {
|
||||
return request({
|
||||
url: 'api/stIvtForewarningconfig/changeActive',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getWarningMaterial, changeActive }
|
||||
@@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<label class="el-form-item-label">物料编码</label>
|
||||
<el-input v-model="query.material_code" clearable placeholder="物料编码" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<label class="el-form-item-label">物料名称</label>
|
||||
<el-input v-model="query.material_name" clearable placeholder="物料名称" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<label class="el-form-item-label">仓库名称</label>
|
||||
<el-select
|
||||
v-model="query.stor_code"
|
||||
placeholder=""
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in stors"
|
||||
:key="item.stor_code"
|
||||
:label="item.stor_name"
|
||||
:value="item.stor_code"
|
||||
/>
|
||||
</el-select>
|
||||
<rrOperation :crud="crud" />
|
||||
</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">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="config_name" label="配置名称" :min-width="flexWidth('config_name',crud.data,'配置名称')" />
|
||||
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
|
||||
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
||||
<el-table-column prop="stor_code" label="仓库编码" :min-width="flexWidth('stor_code',crud.data,'仓库编码')" />
|
||||
<el-table-column prop="stor_name" label="仓库名称" :min-width="flexWidth('stor_name',crud.data,'仓库名称')" />
|
||||
<el-table-column prop="insert_time" label="入库时间" :min-width="flexWidth('insert_time',crud.data,'入库时间')" />
|
||||
<el-table-column prop="overdue_days" label="超时天数" :min-width="flexWidth('overdue_days',crud.data,'超时天数')" />
|
||||
<el-table-column prop="safe_days" label="安全天数" :min-width="flexWidth('safe_days',crud.data,'安全天数')" />
|
||||
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudStIvtOverdueforewarning from './stIvtOverdueforewarning'
|
||||
import CRUD, { crud, form, header, presenter } 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 crudStorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
|
||||
|
||||
const defaultForm = {
|
||||
id: null,
|
||||
config_id: null,
|
||||
material_code: null,
|
||||
material_name: null,
|
||||
stor_code: null,
|
||||
insert_time: null,
|
||||
overdue_days: null,
|
||||
safe_days: null,
|
||||
remark: null,
|
||||
is_delete: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
update_id: null,
|
||||
update_name: null,
|
||||
update_time: null
|
||||
}
|
||||
export default {
|
||||
name: 'StIvtOverdueforewarning',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '库存超期预警',
|
||||
url: 'api/stIvtOverdueforewarning',
|
||||
idField: 'id',
|
||||
sort: 'id,desc',
|
||||
crudMethod: { ...crudStIvtOverdueforewarning }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
},
|
||||
queryTypeOptions: [
|
||||
{ key: 'material_code', display_name: '物料编码' },
|
||||
{ key: 'material_name', display_name: '物料名称' },
|
||||
{ key: 'stor_code', display_name: '仓位编码' }
|
||||
],
|
||||
stors: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudStorattr.getStor().then(res => {
|
||||
this.stors = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/stIvtOverdueforewarning',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/stIvtOverdueforewarning/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/stIvtOverdueforewarning',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
@@ -0,0 +1,123 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<label class="el-form-item-label">物料编码</label>
|
||||
<el-input v-model="query.material_code" clearable placeholder="物料编码" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<label class="el-form-item-label">物料名称</label>
|
||||
<el-input v-model="query.material_name" clearable placeholder="物料名称" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<label class="el-form-item-label">仓库名称</label>
|
||||
<el-select
|
||||
v-model="query.stor_code"
|
||||
placeholder=""
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in stors"
|
||||
:key="item.stor_code"
|
||||
:label="item.stor_name"
|
||||
:value="item.stor_code"
|
||||
/>
|
||||
</el-select>
|
||||
<rrOperation :crud="crud" />
|
||||
</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">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="config_name" label="配置名称" :min-width="flexWidth('config_name',crud.data,'配置名称')" />
|
||||
<el-table-column prop="material_code" label="物料编码" :min-width="flexWidth('material_code',crud.data,'物料编码')" />
|
||||
<el-table-column prop="material_name" label="物料名称" :min-width="flexWidth('material_name',crud.data,'物料名称')" />
|
||||
<el-table-column prop="stor_code" label="仓库编码" :min-width="flexWidth('stor_code',crud.data,'仓库编码')" />
|
||||
<el-table-column prop="stor_name" label="仓库名称" :min-width="flexWidth('stor_name',crud.data,'仓库名称')" />
|
||||
<el-table-column prop="current_qty" label="当前数量" :min-width="flexWidth('current_qty',crud.data,'当前数量')" />
|
||||
<el-table-column prop="safe_qty" label="安全数量" :min-width="flexWidth('safe_qty',crud.data,'安全数量')" />
|
||||
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudStIvtSafetyforewarning from './stIvtSafetyforewarning'
|
||||
import CRUD, { crud, form, header, presenter } 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 crudStorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
|
||||
|
||||
const defaultForm = {
|
||||
id: null,
|
||||
config_id: null,
|
||||
material_code: null,
|
||||
material_name: null,
|
||||
stor_code: null,
|
||||
current_qty: null,
|
||||
safe_qty: null,
|
||||
remark: null,
|
||||
is_delete: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
update_id: null,
|
||||
update_name: null,
|
||||
update_time: null
|
||||
}
|
||||
export default {
|
||||
name: 'StIvtSafetyforewarning',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '安全库存预警',
|
||||
url: 'api/stIvtSafetyforewarning',
|
||||
idField: 'id',
|
||||
sort: 'id,desc',
|
||||
crudMethod: { ...crudStIvtSafetyforewarning }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
},
|
||||
queryTypeOptions: [
|
||||
{ key: 'material_code', display_name: '物料编码' },
|
||||
{ key: 'material_name', display_name: '物料名称' },
|
||||
{ key: 'stor_code', display_name: '仓位编码' }
|
||||
],
|
||||
stors: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudStorattr.getStor().then(res => {
|
||||
this.stors = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/stIvtSafetyforewarning',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/stIvtSafetyforewarning/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/stIvtSafetyforewarning',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
Reference in New Issue
Block a user