add:新增标签管控功能
This commit is contained in:
236
wms/nladmin-ui/src/views/wms/pdm_manage/materialcar/index.vue
Normal file
236
wms/nladmin-ui/src/views/wms/pdm_manage/materialcar/index.vue
Normal file
@@ -0,0 +1,236 @@
|
||||
<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="110px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="袋码/桶码查询">
|
||||
<el-input
|
||||
v-model="query.bag_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="袋码/桶码"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料查询">
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="物料编码、名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次号">
|
||||
<el-input
|
||||
v-model="query.pcsn"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="批次"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="打印状态" prop="status">
|
||||
<el-select
|
||||
v-model="query.status"
|
||||
size="mini"
|
||||
placeholder="全部"
|
||||
style="width: 200px"
|
||||
class="filter-item"
|
||||
clearable
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.PRINT_STATUS"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具类型" prop="vehicle_type">
|
||||
<el-select
|
||||
v-model="query.vehicle_type"
|
||||
size="mini"
|
||||
placeholder="全部"
|
||||
style="width: 200px"
|
||||
class="filter-item"
|
||||
clearable
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in vehicleTypeList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<rrOperation />
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
@click="print"
|
||||
>
|
||||
重新打印
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="danger"
|
||||
icon="el-icon-close"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
@click="clear"
|
||||
>
|
||||
作废
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<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="status" label="打印状态" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status === '1'">正常</el-tag>
|
||||
<el-tag v-else-if="scope.row.status === '2'" type="danger">作废</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="bag_code" label="袋码/桶码" :min-width="flexWidth('bag_code',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="pcsn" label="批次" :min-width="flexWidth('pcsn',crud.data,'批次')" />
|
||||
<el-table-column prop="qty" label="重量" :formatter="crud.formatNum3" :min-width="100" />
|
||||
<el-table-column prop="print_num" label="打印次数" :min-width="flexWidth('print_num',crud.data,'打印次数')" />
|
||||
<el-table-column prop="vehicle_type" label="托盘类型" :min-width="flexWidth('vehicle_type',crud.data,'托盘类型')" :formatter="formattVehicle" />
|
||||
<el-table-column prop="print_no" label="打印标签号" :min-width="flexWidth('print_no',crud.data,'打印标签号')" />
|
||||
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')" />
|
||||
<el-table-column prop="create_name" label="收货人" :min-width="flexWidth('create_name',crud.data,'收货人')" />
|
||||
<el-table-column prop="create_time" label="收货时间" :min-width="flexWidth('create_time',crud.data,'收货时间')" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudMaterialCar from '@/views/wms/pdm_manage/materialcar/materialcar'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
|
||||
const defaultForm = {
|
||||
id: null,
|
||||
bag_code: null,
|
||||
status: null,
|
||||
print_num: null,
|
||||
material_code: null,
|
||||
material_name: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
pcsn: null,
|
||||
qty: null,
|
||||
vehicle_type: null,
|
||||
print_no: null,
|
||||
remark: null
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'MaterialCar',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
// 数据字典
|
||||
dicts: ['PRINT_STATUS'],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '标签管理',
|
||||
url: 'api/materialPrint',
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
},
|
||||
idField: 'id',
|
||||
sort: 'id,desc',
|
||||
crudMethod: { ...crudMaterialCar }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
vehicleTypeList: [
|
||||
{ 'label': '托盘', 'value': '1' },
|
||||
{ 'label': '料桶', 'value': '2' }
|
||||
],
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
formattStatus(row) {
|
||||
return this.dict.label.PRINT_STATUS[row.status]
|
||||
},
|
||||
formattVehicle(row) {
|
||||
if (row.vehicle_type === '1') {
|
||||
return '托盘'
|
||||
} else {
|
||||
return '料桶'
|
||||
}
|
||||
},
|
||||
print() {
|
||||
const row = this.$refs.table.selection[0]
|
||||
// 判断是否是作废状态
|
||||
if (row.status === '2') {
|
||||
this.crud.notify('此标签已作废!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
crudMaterialCar.print(row).then(res => {
|
||||
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
clear() {
|
||||
const row = this.$refs.table.selection[0]
|
||||
crudMaterialCar.clear(row).then(res => {
|
||||
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,43 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/materialPrint',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/materialPrint/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/materialPrint',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function print(data) {
|
||||
return request({
|
||||
url: 'api/materialPrint/print',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function clear(data) {
|
||||
return request({
|
||||
url: 'api/materialPrint/clear',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, print, clear }
|
||||
Reference in New Issue
Block a user