组盘
This commit is contained in:
27
wms/qd/src/api/wms/st/buss/stBussVehicleGroup.js
Normal file
27
wms/qd/src/api/wms/st/buss/stBussVehicleGroup.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/stBussVehicleGroup',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/stBussVehicleGroup',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/stBussVehicleGroup/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
@@ -59,13 +59,13 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="false" label="外部标识">
|
||||
<el-form-item label="外部标识">
|
||||
<el-input v-model="form.ext_id" 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.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
<el-button size="mini" :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
@@ -200,7 +200,8 @@ export default {
|
||||
stewing_time: [
|
||||
{ required: true, message: '静止时间不能为空', trigger: 'blur' }
|
||||
]
|
||||
}}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
@@ -247,7 +248,7 @@ export default {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudMdMeMaterial.edit(data).then(res => {
|
||||
this.crud.notify(this.dict.label.is_used[val] + '成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.notify((val === 1 ? '切换人工打包' : '切换机器打包') + '成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
debugger
|
||||
if (data.is_manmade === '0') {
|
||||
|
||||
148
wms/qd/src/views/wms/st/buss/vehiclegroup/VehicleDialog.vue
Normal file
148
wms/qd/src/views/wms/st/buss/vehiclegroup/VehicleDialog.vue
Normal file
@@ -0,0 +1,148 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="物料选择"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
width="1000px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<!--工具栏-->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="模糊搜索">
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="编码、名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
size="mini"
|
||||
border
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}"
|
||||
@select="handleSelectionChange"
|
||||
@select-all="onSelectAll"
|
||||
@current-change="clickChange"
|
||||
>
|
||||
<el-table-column v-if="!isSingle" type="selection" width="55" />
|
||||
<el-table-column v-if="isSingle" label="选择" width="55">
|
||||
<template slot-scope="scope">
|
||||
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="vehicle_code" label="托盘编码" show-overflow-tooltip />
|
||||
<el-table-column prop="vehicle_name" label="托盘名称" show-overflow-tooltip />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button size="mini" @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button size="mini" type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudMdPbVehicle from '@/api/wms/database/mdPbVehicle'
|
||||
export default {
|
||||
name: 'VehicleDialog',
|
||||
components: { rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({ title: '载具', url: 'api/mdPbVehicle/getVehicleByType', crudMethod: { ...crudMdPbVehicle }, optShow: {}})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isSingle: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
vehicleOptCode: {
|
||||
type: String,
|
||||
default: '00'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
tableRadio: null,
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickChange(item) {
|
||||
this.tableRadio = item
|
||||
},
|
||||
open() {
|
||||
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length > 1) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(val.pop())
|
||||
} else {
|
||||
this.checkrow = row
|
||||
}
|
||||
},
|
||||
onSelectAll() {
|
||||
this.$refs.table.clearSelection()
|
||||
},
|
||||
close() {
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
// 处理单选
|
||||
if (this.isSingle && this.tableRadio) {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged4', this.tableRadio)
|
||||
return
|
||||
}
|
||||
this.rows = this.$refs.table.selection
|
||||
if (this.rows.length <= 0) {
|
||||
this.$message('请先勾选托盘')
|
||||
return
|
||||
}
|
||||
this.crud.resetQuery(false)
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('tableChanged4', this.rows)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
@@ -5,7 +5,7 @@
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<label class="el-form-item-label" />
|
||||
<el-input v-model="query.name" clearable placeholder="输入名称或编码" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<el-input v-model="query.name" clearable placeholder="输入托盘编码" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<rrOperation :crud="crud" />
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
@@ -14,7 +14,7 @@
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="550px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="110px">
|
||||
<el-form-item label="托盘编码" prop="vehicle_code">
|
||||
<el-input v-model="form.vehicle_code" style="width: 370px;" />
|
||||
<el-input v-model="form.vehicle_code" style="width: 370px;" @focus="getVehicle" />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="false" label="物料id">
|
||||
<el-input v-model="form.material_id" style="width: 370px;" />
|
||||
@@ -36,12 +36,33 @@
|
||||
</el-form-item>
|
||||
</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>
|
||||
<el-button size="mini" type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button size="mini" :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<MaterDialog :dialog-show.sync="materDialog" :dialog-matertype="materType" @tableChanged3="tableChanged3" />
|
||||
<VehicleDialog :dialog-show.sync="vehicleDialog" :dialog-vehicletype="vehicleType" @tableChanged4="tableChanged4" />
|
||||
</div>
|
||||
<!--表格-->
|
||||
<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="group_id" label="组盘标识" />
|
||||
<el-table-column prop="vehicle_code" label="托盘编码" />
|
||||
<el-table-column prop="material_code" label="物料编码" />
|
||||
<el-table-column prop="material_name" label="物料名称 " />
|
||||
<el-table-column prop="pcsn" label="批次" />
|
||||
<el-table-column prop="qty" label="数量" />
|
||||
<el-table-column prop="create_name" label="组盘人" />
|
||||
<el-table-column prop="create_time" label="组盘时间" width="150" />
|
||||
<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>
|
||||
@@ -52,8 +73,10 @@ import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudMdMeMaterial from '@/api/wms/database/mdMeMaterial'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import crudStBussVehicleGroup from '@/api/wms/st/buss/stBussVehicleGroup'
|
||||
import MaterDialog from '../../in/MaterDialog'
|
||||
import VehicleDialog from '@/views/wms/st/buss/vehiclegroup/VehicleDialog'
|
||||
|
||||
const defaultForm = {
|
||||
group_id: null,
|
||||
@@ -62,36 +85,43 @@ const defaultForm = {
|
||||
material_code: null,
|
||||
material_name: null,
|
||||
pcsn: null,
|
||||
qty: null
|
||||
qty: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'Vehiclegroup',
|
||||
components: { pagination, crudOperation, rrOperation, MaterDialog },
|
||||
components: { VehicleDialog, pagination, crudOperation, rrOperation, MaterDialog, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({ title: '物料', url: 'api/mdMeMaterial', idField: 'material_id', sort: 'material_id,desc', crudMethod: { ...crudMdMeMaterial },
|
||||
// 拿数据,改成组盘信息
|
||||
return CRUD({ title: '组盘', url: 'api/stBussVehicleGroup', idField: 'group_id', sort: 'group_id,desc', crudMethod: { ...crudStBussVehicleGroup },
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
del: false,
|
||||
del: true,
|
||||
download: false,
|
||||
reset: true
|
||||
}})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
vehicle_code: [
|
||||
{ required: true, message: '托盘编码不能为空', trigger: 'blur' }
|
||||
{ required: true, message: '托盘编码不能为空', trigger: 'change' }
|
||||
],
|
||||
material_name: [
|
||||
{ required: true, message: '物料不能为空', trigger: 'change' }
|
||||
]
|
||||
},
|
||||
materDialog: false,
|
||||
materType: ''
|
||||
materType: '',
|
||||
vehicleDialog: false,
|
||||
vehicleType: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -108,6 +138,14 @@ export default {
|
||||
this.form.material_id = row.material_id
|
||||
this.form.material_code = row.material_code
|
||||
this.form.material_name = row.material_name
|
||||
},
|
||||
tableChanged4(row) {
|
||||
console.log(row)
|
||||
this.form.vehicle_code = row.vehicle_code
|
||||
},
|
||||
// 打开选择托盘对话框
|
||||
getVehicle() {
|
||||
this.vehicleDialog = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user