no message
parent
a3624bc45b
commit
118891d244
|
|
@ -0,0 +1,27 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function add(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/workPoint',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function del(ids) {
|
||||||
|
return request({
|
||||||
|
url: 'api/workPoint/',
|
||||||
|
method: 'delete',
|
||||||
|
data: ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function edit(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/workPoint',
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default { add, edit, del }
|
||||||
|
|
@ -124,6 +124,9 @@
|
||||||
import CRUD, {crud} from '@crud/crud'
|
import CRUD, {crud} from '@crud/crud'
|
||||||
import crudTableConfig from '@/api/tableConfig'
|
import crudTableConfig from '@/api/tableConfig'
|
||||||
import Sortable from 'sortablejs'
|
import Sortable from 'sortablejs'
|
||||||
|
import {mapGetters} from "vuex";
|
||||||
|
import { getToken } from '@/utils/auth'
|
||||||
|
|
||||||
|
|
||||||
function sortWithRef(src, ref) {
|
function sortWithRef(src, ref) {
|
||||||
const result = Object.assign([], ref)
|
const result = Object.assign([], ref)
|
||||||
|
|
@ -162,8 +165,14 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters([
|
||||||
|
'baseApi'
|
||||||
|
])
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
headers: { 'Authorization': getToken() },
|
||||||
hiddenColumns: [],
|
hiddenColumns: [],
|
||||||
table_configs: [],
|
table_configs: [],
|
||||||
table_configs_xs: [],
|
table_configs_xs: [],
|
||||||
|
|
@ -197,11 +206,25 @@ export default {
|
||||||
// 方法区
|
// 方法区
|
||||||
this.initcolumn();
|
this.initcolumn();
|
||||||
}, 200)
|
}, 200)
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleSuccess(response, file, fileList) {
|
||||||
|
this.crud.notify('上传成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
this.$refs.upload.clearFiles()
|
||||||
|
this.crud.status.add = CRUD.STATUS.NORMAL
|
||||||
|
this.crud.resetForm()
|
||||||
|
this.crud.toQuery()
|
||||||
|
},
|
||||||
|
// 监听上传失败
|
||||||
|
handleError(e, file, fileList) {
|
||||||
|
const msg = JSON.parse(e.message)
|
||||||
|
this.$notify({
|
||||||
|
title: msg.message,
|
||||||
|
type: 'error',
|
||||||
|
duration: 2500
|
||||||
|
})
|
||||||
|
this.loading = false
|
||||||
|
},
|
||||||
initcolumn() {
|
initcolumn() {
|
||||||
this.updateTableColumns()
|
this.updateTableColumns()
|
||||||
const strHidden = sessionStorage.getItem(this.tableKey)
|
const strHidden = sessionStorage.getItem(this.tableKey)
|
||||||
|
|
|
||||||
|
|
@ -65,18 +65,6 @@
|
||||||
>
|
>
|
||||||
状态调整
|
状态调整
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-upload
|
|
||||||
class="upload-demo"
|
|
||||||
slot='right'
|
|
||||||
style="float: right;padding-left: 5px"
|
|
||||||
:headers="headers"
|
|
||||||
action="/api/stock/import_stock"
|
|
||||||
:file-list="fileList"
|
|
||||||
:on-error="handleErr"
|
|
||||||
:on-success=" (response, file, fileList) => { return handleSuccess(response, file, fileList,crud);}"
|
|
||||||
:show-file-list="true">
|
|
||||||
<el-button size="mini" type="success" icon="el-icon-upload2">导入</el-button>
|
|
||||||
</el-upload>
|
|
||||||
</crudOperation>
|
</crudOperation>
|
||||||
|
|
||||||
<!-- 批量修改状态 -->
|
<!-- 批量修改状态 -->
|
||||||
|
|
@ -201,7 +189,8 @@ export default {
|
||||||
edit: false,
|
edit: false,
|
||||||
del: false,
|
del: false,
|
||||||
reset: true,
|
reset: true,
|
||||||
download: true
|
download: true,
|
||||||
|
import: true
|
||||||
},
|
},
|
||||||
queryOnPresenterCreated: true
|
queryOnPresenterCreated: true
|
||||||
})
|
})
|
||||||
|
|
@ -216,7 +205,8 @@ export default {
|
||||||
permission: {
|
permission: {
|
||||||
add: ['admin', 'stock:add'],
|
add: ['admin', 'stock:add'],
|
||||||
edit: ['admin', 'stock:edit'],
|
edit: ['admin', 'stock:edit'],
|
||||||
del: ['admin', 'stock:del']
|
del: ['admin', 'stock:del'],
|
||||||
|
import: ['admin', 'stock:import']
|
||||||
},
|
},
|
||||||
stockTypes: [],
|
stockTypes: [],
|
||||||
rules: {
|
rules: {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,162 @@
|
||||||
|
<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.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.areaId" clearable placeholder="所属库区" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||||
|
<rrOperation :crud="crud" />
|
||||||
|
</div>
|
||||||
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||||
|
<crudOperation :permission="permission" :tableKey="this.$options.name"/>
|
||||||
|
<!--表单组件-->
|
||||||
|
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
|
||||||
|
<el-form-item label="编码" prop="code">
|
||||||
|
<el-input v-model="form.code" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="所属库区" prop="areaId">
|
||||||
|
未设置字典,请手动设置 Select
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="上料接驳口数" prop="upNumber">
|
||||||
|
<el-input v-model="form.upNumber" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="上料接驳口" prop="upPointId">
|
||||||
|
未设置字典,请手动设置 Select
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="下料接驳口数" prop="downNumber">
|
||||||
|
<el-input v-model="form.downNumber" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="下料接驳口" prop="downPointId">
|
||||||
|
未设置字典,请手动设置 Select
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="接驳口车辆数">
|
||||||
|
<el-input v-model="form.agvNumber" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="输送线最大容量">
|
||||||
|
<el-input v-model="form.maxNumber" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="输送线返库料箱数">
|
||||||
|
<el-input v-model="form.backNumber" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="最大料箱任务数">
|
||||||
|
<el-input v-model="form.maxStockNumber" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="描述">
|
||||||
|
<el-input v-model="form.description" :rows="3" type="textarea" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否启用">
|
||||||
|
<el-input v-model="form.enabled" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建人">
|
||||||
|
<el-input v-model="form.createBy" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="修改人">
|
||||||
|
<el-input v-model="form.updateBy" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建时间">
|
||||||
|
<el-input v-model="form.createTime" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="修改时间">
|
||||||
|
<el-input v-model="form.updateTime" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||||
|
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table ref="table" v-loading="crud.loading" :data="crud.data" :height="crud.tableHeight" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||||
|
<el-table-column type="selection" width="55" />
|
||||||
|
<el-table-column prop="code" label="编码" />
|
||||||
|
<el-table-column prop="areaId" label="所属库区" />
|
||||||
|
<el-table-column prop="upNumber" label="上料接驳口数" />
|
||||||
|
<el-table-column prop="upPointId" label="上料接驳口" />
|
||||||
|
<el-table-column prop="downNumber" label="下料接驳口数" />
|
||||||
|
<el-table-column prop="downPointId" label="下料接驳口" />
|
||||||
|
<el-table-column prop="agvNumber" label="接驳口车辆数" />
|
||||||
|
<el-table-column prop="maxNumber" label="输送线最大容量" />
|
||||||
|
<el-table-column prop="backNumber" label="输送线返库料箱数" />
|
||||||
|
<el-table-column prop="maxStockNumber" label="最大料箱任务数" />
|
||||||
|
<el-table-column prop="description" label="描述" />
|
||||||
|
<el-table-column v-if="checkPer(['admin','workPoint:edit','workPoint:del'])" label="操作" width="150px" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<udOperation
|
||||||
|
:data="scope.row"
|
||||||
|
:permission="permission"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!--分页组件-->
|
||||||
|
<pagination />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import crudWorkPoint from '@/api/workPoint'
|
||||||
|
import CRUD, { presenter, header, form, 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'
|
||||||
|
|
||||||
|
const defaultForm = { id: null, code: null, name: null, areaId: null, upNumber: null, upPointId: null, downNumber: null, downPointId: null, agvNumber: null, maxNumber: null, backNumber: null, maxStockNumber: null, deptId: null, description: null, enabled: null, createBy: null, updateBy: null, createTime: null, updateTime: null }
|
||||||
|
export default {
|
||||||
|
name: 'WorkPoint',
|
||||||
|
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||||
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
|
dicts: ['base_staus'],
|
||||||
|
cruds() {
|
||||||
|
return CRUD({ title: 'workPoint', url: 'api/workPoint', idField: 'id', sort: 'id,desc', crudMethod: { ...crudWorkPoint }})
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
permission: {
|
||||||
|
add: ['admin', 'workPoint:add'],
|
||||||
|
edit: ['admin', 'workPoint:edit'],
|
||||||
|
del: ['admin', 'workPoint:del']
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
code: [
|
||||||
|
{ required: true, message: '编码不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
areaId: [
|
||||||
|
{ required: true, message: '所属库区不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
upNumber: [
|
||||||
|
{ required: true, message: '上料接驳口数不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
upPointId: [
|
||||||
|
{ required: true, message: '上料接驳口不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
downNumber: [
|
||||||
|
{ required: true, message: '下料接驳口数不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
downPointId: [
|
||||||
|
{ required: true, message: '下料接驳口不能为空', trigger: 'blur' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
queryTypeOptions: [
|
||||||
|
{ key: 'code', display_name: '编码' },
|
||||||
|
{ key: 'areaId', display_name: '所属库区' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||||
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
Loading…
Reference in New Issue