opt:库区物料设置功能开发。基础分类功能优化

This commit is contained in:
DESKTOP-5DIJMF9\admin
2025-07-15 15:15:40 +08:00
parent 17b7264522
commit 5bf1e1100b
21 changed files with 387 additions and 265 deletions

View File

@@ -2,7 +2,7 @@ export default {
'lang': 'zh',
// 平台
'platform': {
'title': 'c',
'title': '富佳WMS',
'tip1': '用户名不能为空',
'tip2': '密码不能为空',
'tip3': '验证码不能为空'

View File

@@ -14,7 +14,6 @@
import ECharts from 'vue-echarts'
import 'echarts/lib/chart/line'
import 'echarts/lib/component/polar'
import { initData } from '@/api/data'
export default {
name: 'ServerMonitor',
components: {
@@ -95,12 +94,12 @@ export default {
}
},
created() {
this.init()
/* this.init()
this.monitor = window.setInterval(() => {
setTimeout(() => {
this.init()
}, 2)
}, 3500)
}, 3500)*/
},
destroyed() {
clearInterval(this.monitor)

View File

@@ -4,7 +4,7 @@
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
:show-close="false"
:show-close="true"
width="60%"
@close="close"
>
@@ -68,7 +68,7 @@
</template>
<script>
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import CRUD, { presenter, header, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
@@ -80,9 +80,9 @@ import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import crudStructrelamaterial from '@/views/wms/basedata/materialSet/structrelamaterial'
export default {
name: 'AddShowDialog',
name: 'AddDialog',
components: { pagination, rrOperation, crudOperation, Treeselect },
mixins: [presenter(), header(), form(), crud()],
mixins: [presenter(), header(), crud()],
cruds() {
return CRUD({
url: 'api/Classstandard/getClassTable',
@@ -137,17 +137,12 @@ export default {
})
},
methods: {
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done()
})
.catch(_ => {
})
},
close() {
this.crud.resetQuery(false)
this.query.material_type_id = null
this.sect_id = null
this.query.sect = null
this.$emit('update:dialogShow', false)
this.$emit('AddChanged')
},
sectChange(val) {
this.sect_id = val[1]
@@ -178,23 +173,25 @@ export default {
}
return obj
})
this.crud.toQuery()
})
},
doAdd() {
const data = {}
const _selectData = this.$refs.multipleTable.selection
data.class_rows = _selectData
if (_selectData.length === 0) {
this.crud.notify('请选择记录', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
data.sect_id = this.sect_id
if (!this.query.sect) {
if (!this.crud.query.sect) {
this.crud.notify('请选择库区', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
crudStructrelamaterial.insertSet(data).then(() => {
this.crud.status.add = CRUD.STATUS.NORMAL
this.$emit('update:dialogShow', false)
this.crud.toQuery()
this.crud.notify('新增成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.$parent.freshParentPage()
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.close()
})
}
}

View File

@@ -13,7 +13,6 @@
<el-cascader
v-model="query.sect"
:options="sects"
:props="{ checkStrictly: true }"
clearable
class="filter-item"
@change="sectQueryChange"
@@ -45,6 +44,22 @@
</crudOperation>
<!--表格渲染-->
<el-table ref="table" :max-height="590" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column
v-permission="['admin','structrelamaterial:edit','structrelamaterial:del']"
label="操作"
width="160"
align="center"
fixed="right"
>
<template slot-scope="scope">
<udOperation
:data="scope.row"
:permission="permission"
:disabled-dle="false"
:is-visiable-edit="false"
/>
</template>
</el-table-column>
<el-table-column type="selection" width="55" />
<el-table-column prop="sect_code" label="库区编码" />
<el-table-column prop="sect_name" label="库区名称" />
@@ -52,22 +67,17 @@
<el-table-column prop="class_name" label="物料类别名称" />
<el-table-column prop="set_time" label="设置时间" />
<el-table-column prop="set_name" label="设置人" />
<el-table-column v-permission="['admin','structrelamaterial:edit','structrelamaterial:del']" label="操作" width="150px" align="center">
<template slot-scope="scope">
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" @click="doDelete(scope.row)" />
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
</div>
<AddDialog :dialog-show.sync="addlogDing" />
<AddDialog :dialog-show.sync="addlogDing" @AddChanged="querytable" />
</div>
</template>
<script>
import crudStructrelamaterial from '@/views/wms/basedata/materialSet/structrelamaterial'
import CRUD, { crud, form, header, presenter } from '@crud/crud'
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'
@@ -77,20 +87,24 @@ import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import crudMaterialbase from '@/views/wms/basedata/material/material'
import AddDialog from '@/views/wms/basedata/materialSet/AddDialog'
import udOperation from '@crud/UD.operation'
const defaultForm = { sect_id: null, cascader: null, material_type_id: null, set_id: null, set_name: null, set_time: null }
export default {
name: 'MaterialSet',
components: { AddDialog, pagination, crudOperation, rrOperation, Treeselect },
mixins: [presenter(), header(), form(defaultForm), crud()],
components: { AddDialog, pagination, crudOperation, rrOperation, Treeselect, udOperation },
mixins: [presenter(), header(), crud()],
cruds() {
return CRUD({ title: '物料存放设置',
props: {
// 每页数据条数
size: 20
},
optShow: { add: false, reset: true }, idField: 'class_id',
sort: 'class_id,desc', url: 'api/structrelamaterial', crudMethod: { ...crudStructrelamaterial }})
optShow: { add: false, reset: true, del: true },
crudMethod: { ...crudStructrelamaterial },
idField: 'materset_id',
sort: 'materset_id,desc',
url: 'api/structrelamaterial'
})
},
data() {
return {
@@ -99,28 +113,8 @@ export default {
class_idStr: null,
permission: {
},
material_type_id: null,
is_delete: false,
tableData: [],
sects: [],
sect_id: '',
rules: {
sect_id: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
material_type_id: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
set_id: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
set_name: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
set_time: [
{ required: true, message: '不能为空', trigger: 'blur' }
]
}
sect_id: ''
}
},
created() {
@@ -142,40 +136,17 @@ export default {
return true
},
sectQueryChange(val) {
if (val.length === 1) {
this.query.stor_id = val[0]
this.query.sect_id = ''
}
if (val.length === 0) {
this.query.sect_id = ''
this.query.stor_id = ''
}
if (val.length === 2) {
this.query.stor_id = val[0]
this.query.sect_id = val[1]
}else{
this.query.stor_id = ''
this.query.sect_id = ''
}
},
[CRUD.HOOK.beforeToAdd]() {
this.queryClass()
},
sectChange(val) {
this.sect_id = val[1]
},
queryClass(data) {
crudClassstandard.getClassTable(data).then(res => {
this.tableData = res.content
})
},
freshParentPage() {
querytable() {
this.crud.toQuery()
},
doDelete(data) {
crudStructrelamaterial.delSet(data).then(() => {
this.crud.dleChangePage(1)
this.crud.delSuccessNotify()
this.crud.refresh()
})
},
loadClass({ action, parentNode, callback }) {
if (action === LOAD_CHILDREN_OPTIONS) {
crudClassstandard.getClass({ pid: parentNode.id }).then(res => {

View File

@@ -32,12 +32,4 @@ export function insertSet(data) {
})
}
export function delSet(data) {
return request({
url: 'api/structrelamaterial/delSet',
method: 'post',
data
})
}
export default { add, edit, del, insertSet, delSet }
export default { add, edit, del, insertSet }