add:木箱库
This commit is contained in:
@@ -32,6 +32,14 @@ export function getMaterOptType(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function getMaterialByName(data) {
|
||||
return request({
|
||||
url: 'api/Materialbase/getMaterialByName',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function isAlongMaterType(data) {
|
||||
return request({
|
||||
url: 'api/Materialbase/isAlongMaterType',
|
||||
@@ -47,4 +55,4 @@ export function getProductSeries() {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getMaterOptType, isAlongMaterType, getProductSeries }
|
||||
export default { add, edit, del, getMaterOptType, isAlongMaterType, getProductSeries, getMaterialByName }
|
||||
|
||||
160
lms/nladmin-ui/src/views/wms/basedata/st/boxInfo/MaterDialog.vue
Normal file
160
lms/nladmin-ui/src/views/wms/basedata/st/boxInfo/MaterDialog.vue
Normal file
@@ -0,0 +1,160 @@
|
||||
<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
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
@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="material_code" label="物料编码" min-width="150" show-overflow-tooltip/>
|
||||
<el-table-column prop="material_name" label="物料名称" min-width="200" show-overflow-tooltip/>
|
||||
<el-table-column prop="unit_name" label="计量单位"/>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination/>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import crudMaterialbase from '@/views/wms/basedata/master/material/materialbase'
|
||||
import CRUD, {header, presenter} from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
export default {
|
||||
name: 'MaterDtl',
|
||||
components: {rrOperation, pagination},
|
||||
cruds() {
|
||||
return CRUD({title: '物料', url: 'api/Materialbase', crudMethod: {...crudMaterialbase}, optShow: {}})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
dicts: ['product_series'],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isSingle: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
materOptCode: {
|
||||
type: String,
|
||||
default: '木箱'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
tableRadio: null,
|
||||
checkrow: null,
|
||||
rows: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
this.crud.query.box = this.materOptCode
|
||||
},
|
||||
clickChange(item) {
|
||||
this.tableRadio = item
|
||||
},
|
||||
seriesFormat(row) {
|
||||
return this.dict.label.product_series[row.product_series]
|
||||
},
|
||||
open() {
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (this.isSingle) {
|
||||
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('handleSetMaterialValue', 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('handleSetMaterialValue', this.rows)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -37,76 +37,114 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<rrOperation />
|
||||
<rrOperation/>
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-printer"
|
||||
size="mini"
|
||||
@click="print"
|
||||
>
|
||||
打印
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<!--<el-dialog
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="800px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="120px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="130px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="木箱类型:" prop="box_type">
|
||||
<el-input v-model="form.box_type" style="width: 200px;" :disabled="crud.status.edit > 0" />
|
||||
<el-form-item label="物料编码:" prop="material_code">
|
||||
<!-- <el-input v-model="form.material_code" style="width: 200px;" :disabled="crud.status.edit > 0"/>-->
|
||||
<el-input
|
||||
v-model="form.material_code" style="width: 200px;"
|
||||
:disabled="crud.status.edit > 0"
|
||||
@click.native="openMaterialDialog"
|
||||
readonly
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="木箱描述:" prop="box_name">
|
||||
<el-input v-model="form.box_name" style="width: 200px;" :disabled="crud.status.edit > 0" />
|
||||
<el-form-item label="物料名称:" prop="material_name">
|
||||
<el-input v-model="form.material_name" style="width: 200px;" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="捆扎模版:" prop="lash_num">
|
||||
<el-input v-model="form.lash_num" style="width: 200px;" />
|
||||
<el-form-item label="生成木箱号数量:" prop="box_num">
|
||||
<el-input-number :step="1" :min="1" :max="100" v-model="form.box_num" size="mini"
|
||||
:controls="false" style="width: 200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="叉车取货宽度:" prop="expend_width">
|
||||
<el-input-number :precision="2" :step="0.1" :min="0" :max="100" v-model="form.expend_width" size="mini" :controls="false" style="width: 200px" />
|
||||
<el-form-item label="最大子卷数:" prop="num">
|
||||
<el-input-number :step="1" :min="1" :max="100" v-model="form.num" size="mini"
|
||||
:controls="false" style="width: 200px"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="一次捆扎次数:" prop="lash_num_one">
|
||||
<el-input-number :precision="0" :step="1" :min="0" :max="9" v-model="form.lash_num_one" size="mini" :controls="false" style="width: 200px" />
|
||||
<el-form-item label="载具类型:" prop="vehicle_type">
|
||||
<el-select v-model="form.vehicle_type" placeholder="请选择载具类型" clearable style="width: 200px;">
|
||||
<el-option
|
||||
v-for="item in vehicleTypeList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="二次捆扎次数:" prop="lash_num_tow">
|
||||
<el-input-number :precision="0" :step="1" :min="0" :max="9" v-model="form.lash_num_tow" size="mini" :controls="false" style="width: 200px" />
|
||||
<el-form-item label="木箱重量:" prop="box_weight">
|
||||
<el-input-number
|
||||
:value="form.box_weight === null ? undefined : form.box_weight"
|
||||
@input="val => form.box_weight = val"
|
||||
:precision="2"
|
||||
:step="0.1"
|
||||
:min="0"
|
||||
:max="1000"
|
||||
size="mini"
|
||||
:controls="false" style="width: 200px;"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否一次捆扎:" prop="need_lash_one">
|
||||
<el-radio v-model="form.need_lash_one" label="1" style="width: 79px;" border>是</el-radio>
|
||||
<el-radio v-model="form.need_lash_one" label="0" style="width: 79px;" border>否</el-radio>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否二次捆扎:" prop="need_lash_two">
|
||||
<el-radio v-model="form.need_lash_two" label="1" style="width: 79px;" border>是</el-radio>
|
||||
<el-radio v-model="form.need_lash_two" label="0" style="width: 79px;" border>否</el-radio>
|
||||
<el-form-item label="是否装箱:" prop="is_packing">
|
||||
<el-radio-group v-model="form.is_packing" size="mini">
|
||||
<el-radio
|
||||
v-for="item in packingList"
|
||||
:key="item.value"
|
||||
:label="item.value"
|
||||
>
|
||||
{{ item.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</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>
|
||||
<el-button type="text" :loading="crud.cu === 2" @click="crud.submitCU">保存</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="savePrint">保存并打印</el-button>
|
||||
</div>
|
||||
</el-dialog>-->
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
@@ -116,18 +154,21 @@
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column prop="box_no" sortable label="木箱号" :min-width="flexWidth('box_no',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="num" label="最大子卷数" :min-width="flexWidth('num',crud.data,'最大子卷数')" />
|
||||
<el-table-column prop="box_length" label="木箱长度" :min-width="flexWidth('box_length',crud.data,'木箱长度')" />
|
||||
<el-table-column prop="box_width" label="木箱宽度" :min-width="flexWidth('box_width',crud.data,'木箱宽度')" />
|
||||
<el-table-column prop="box_high" label="木箱高度" :min-width="flexWidth('box_high',crud.data,'木箱高度')" />
|
||||
<el-table-column prop="vehicle_type" label="载具类型" :min-width="flexWidth('vehicle_type',crud.data,'载具类型')" :formatter="formattTwo"/>
|
||||
<el-table-column prop="is_packing" label="是否装箱" :min-width="flexWidth('is_packing',crud.data,'是否装箱')" :formatter="formatOne" />
|
||||
<el-table-column prop="box_weight" label="木箱重量" :min-width="flexWidth('box_weight',crud.data,'木箱重量')" />
|
||||
<el-table-column prop="insert_time" label="创建时间" :min-width="flexWidth('insert_time',crud.data,'创建时间')" />
|
||||
<!-- <el-table-column
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column prop="box_no" sortable label="木箱号" :min-width="flexWidth('box_no',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="num" label="最大子卷数" :min-width="flexWidth('num',crud.data,'最大子卷数')"/>
|
||||
<el-table-column prop="box_length" label="木箱长度" :min-width="flexWidth('box_length',crud.data,'木箱长度')"/>
|
||||
<el-table-column prop="box_width" label="木箱宽度" :min-width="flexWidth('box_width',crud.data,'木箱宽度')"/>
|
||||
<el-table-column prop="box_high" label="木箱高度" :min-width="flexWidth('box_high',crud.data,'木箱高度')"/>
|
||||
<el-table-column prop="vehicle_type" label="载具类型" :min-width="flexWidth('vehicle_type',crud.data,'载具类型')"
|
||||
:formatter="formattTwo"/>
|
||||
<el-table-column prop="is_packing" label="是否装箱" :min-width="flexWidth('is_packing',crud.data,'是否装箱')"
|
||||
:formatter="formatOne"/>
|
||||
<el-table-column prop="box_weight" label="木箱重量" :min-width="flexWidth('box_weight',crud.data,'木箱重量')"/>
|
||||
<el-table-column prop="insert_time" label="创建时间" :min-width="flexWidth('insert_time',crud.data,'创建时间')"/>
|
||||
<el-table-column
|
||||
v-permission="['admin','sectattr:edit','sectattr:del']"
|
||||
label="操作"
|
||||
width="120px"
|
||||
@@ -140,50 +181,61 @@
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
<pagination/>
|
||||
</div>
|
||||
<mater-dialog
|
||||
ref="materDialog"
|
||||
:dialog-show="dialogMaterialVisible"
|
||||
is-single
|
||||
mater-opt-code="木箱"
|
||||
@handleSetMaterialValue="handleSetMaterialValue"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudBoxinfo from '@/views/wms/basedata/st/boxInfo/boxinfo'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
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 MaterDialog from '@/views/wms/basedata/st/boxInfo/MaterDialog'
|
||||
import { getLodop } from '@/assets/js/lodop/LodopFuncs'
|
||||
|
||||
|
||||
const defaultForm = {
|
||||
box_id: null,
|
||||
box_no: null,
|
||||
box_num: 1,
|
||||
material_code: null,
|
||||
material_name: null,
|
||||
num: null,
|
||||
num: 1,
|
||||
box_length: null,
|
||||
box_width: null,
|
||||
box_high: null,
|
||||
insert_time: null,
|
||||
lash_num: null,
|
||||
vehicle_type: null,
|
||||
is_packing: null,
|
||||
is_packing: '0',
|
||||
box_weight: null
|
||||
}
|
||||
export default {
|
||||
name: 'BoxInfo',
|
||||
dicts: ['IS_OR_NOT'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
components: {pagination, crudOperation, rrOperation, udOperation, MaterDialog},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '木箱信息',
|
||||
optShow: { add: false, reset: true },
|
||||
optShow: {add: true, edit: true, del: true, reset: true},
|
||||
url: 'api/boxinfo',
|
||||
idField: 'box_id',
|
||||
sort: 'box_no,desc',
|
||||
crudMethod: { ...crudBoxinfo }
|
||||
crudMethod: {...crudBoxinfo}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
@@ -195,10 +247,33 @@ export default {
|
||||
del: ['admin', 'user:del']
|
||||
},
|
||||
packingList: [
|
||||
{ 'label': '是', 'value': '1' },
|
||||
{ 'label': '否', 'value': '0' }
|
||||
{'label': '是', 'value': '1'},
|
||||
{'label': '否', 'value': '0'}
|
||||
],
|
||||
vehicleTypeList: [
|
||||
{'label': '小托盘', 'value': '1'},
|
||||
{'label': '大托盘', 'value': '2'}
|
||||
],
|
||||
dialogMaterialVisible: false,
|
||||
rules: {
|
||||
material_code: [
|
||||
{required: true, message: '木箱规格编码不能为空', trigger: 'blur'}
|
||||
],
|
||||
material_name: [
|
||||
{required: true, message: '木箱规格名称不能为空', trigger: 'blur'}
|
||||
],
|
||||
box_num: [
|
||||
{required: true, message: '生成木箱号数量不能为空', trigger: 'blur'}
|
||||
],
|
||||
num: [
|
||||
{required: true, message: '最大子卷数量不能为空', trigger: 'blur'}
|
||||
],
|
||||
vehicle_type: [
|
||||
{required: true, message: '载具类型不能为空', trigger: 'blur'}
|
||||
],
|
||||
is_packing: [
|
||||
{required: true, message: '是否装箱不能为空', trigger: 'blur'}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -207,9 +282,27 @@ export default {
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
openMaterialDialog() {
|
||||
if (this.crud.status.edit > 0) return // 如果是编辑状态,则不允许重新选择
|
||||
this.dialogMaterialVisible = true
|
||||
},
|
||||
handleSetMaterialValue(material) {
|
||||
this.form.material_code = material.material_code
|
||||
this.form.material_name = material.material_name
|
||||
this.dialogMaterialVisible = false
|
||||
},
|
||||
formatOne(row) {
|
||||
return this.dict.label.IS_OR_NOT[row.is_packing]
|
||||
},
|
||||
savePrint() {
|
||||
crudBoxinfo.savePrint(this.form).then(() => {
|
||||
// 这里可以调用打印逻辑,比如 window.print() 或其他打印插件
|
||||
this.$message.success('保存成功,准备打印...')
|
||||
}).catch(err => {
|
||||
this.$message.error('保存失败')
|
||||
console.error(err)
|
||||
})
|
||||
},
|
||||
formattTwo(row) {
|
||||
if (row.vehicle_type === '1') {
|
||||
return '小托盘'
|
||||
@@ -218,7 +311,58 @@ export default {
|
||||
if (row.vehicle_type === '2') {
|
||||
return '大托盘'
|
||||
}
|
||||
}
|
||||
},
|
||||
print() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
if (!_selectData || _selectData.length < 1) {
|
||||
this.crud.notify('请选择一条记录', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
for (let i = 0; i < _selectData.length; i++) {
|
||||
const code = _selectData[i].box_no
|
||||
const material_code = item.material_code
|
||||
const material_name = item.material_name
|
||||
const LODOP = getLodop()
|
||||
LODOP.SET_SHOW_MODE('HIDE_DISBUTTIN_SETUP', 1)// 隐藏那些无效按钮
|
||||
// 打印纸张大小设置https://www.it610.com/article/2094844.html
|
||||
LODOP.SET_PRINT_PAGESIZE(1, '50mm', '30mm', '')
|
||||
// LODOP.ADD_PRINT_RECT('0mm', '0mm', '48mm', '28mm', 0, 1)
|
||||
LODOP.ADD_PRINT_BARCODE('4.3mm', '8.2mm', '40mm', '20mm', '128Auto', code)
|
||||
// LODOP.PREVIEW()// 预览
|
||||
LODOP.PRINT()// 打印
|
||||
this.crud.notify('打印成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
}
|
||||
},
|
||||
addAndprint() {
|
||||
const data = this.form
|
||||
if (!this.form.storagevehicle_type) {
|
||||
this.crud.notify('载具类型不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (!this.form.num) {
|
||||
this.crud.notify('数量不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
crudBoxinfo.add(data).then(res => {
|
||||
res.forEach((item) => {
|
||||
const box_no = item.box_no
|
||||
const material_code = item.material_code
|
||||
const material_name = item.material_name
|
||||
const LODOP = getLodop()
|
||||
LODOP.SET_SHOW_MODE('HIDE_DISBUTTIN_SETUP', 1)// 隐藏那些无效按钮
|
||||
// 打印纸张大小设置https://www.it610.com/article/2094844.html
|
||||
LODOP.SET_PRINT_PAGESIZE(1, '50mm', '30mm', '1')
|
||||
// LODOP.ADD_PRINT_RECT('0mm', '0mm', '50mm', '30mm', 0, 1)
|
||||
LODOP.ADD_PRINT_BARCODE('4.3mm', '6.2mm', '40mm', '20mm', '128Auto', item)
|
||||
// LODOP.PREVIEW()// 预览
|
||||
LODOP.PRINT()// 打印
|
||||
})
|
||||
this.crud.status.add = CRUD.STATUS.NORMAL
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,247 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:visible.sync="dialogVisible"
|
||||
append-to-body
|
||||
fullscreen
|
||||
title="堆叠位详情"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<el-card class="box-card" shadow="never">
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" label-width="180px" size="mini">
|
||||
<el-form-item label="堆叠位编码">
|
||||
<el-input v-model="form.stack_code" disabled style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="堆叠位名称">
|
||||
<el-input v-model="form.stack_name" disabled style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="堆叠位区域">
|
||||
<el-select
|
||||
disabled
|
||||
v-model="form.point_status"
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
style="width: 200px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.boxinfo_area"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="最大堆叠数">
|
||||
<el-input v-model="form.max_layer_count" disabled style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="当前堆叠数">
|
||||
<el-input v-model="form.current_layer_count" disabled style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="排">
|
||||
<el-input v-model="form.x" disabled style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="列">
|
||||
<el-input v-model="form.y" disabled style="width: 200px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="木箱规格">
|
||||
<el-input
|
||||
v-model="form.box_spec" style="width: 200px;"
|
||||
@click.native="openMaterialDialog"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<div class="crud-opts2" style="margin-top: 30px;margin-bottom: 15px">
|
||||
<span class="role-span">堆叠位层数详情</span>
|
||||
<span class="crud-opts-right2">
|
||||
<!--左侧插槽-->
|
||||
<slot name="left"/>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
:data="form.tableData"
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
:highlight-current-row="true"
|
||||
border
|
||||
max-height="300"
|
||||
style="width: 100%;"
|
||||
>
|
||||
<el-table-column label="木箱层数" prop="layer_index"/>
|
||||
<el-table-column label="木箱号" prop="box_code">
|
||||
<template scope="scope">
|
||||
<div v-if="scope.row.editing">
|
||||
<el-input v-model="scope.row.box_code"/>
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ scope.row.box_code }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" width="160" fixed="right">
|
||||
<template scope="scope">
|
||||
<el-button
|
||||
v-if="!scope.row.editing"
|
||||
type="primary"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
icon="el-icon-edit"
|
||||
@click="enableEdit(scope.row)"
|
||||
/>
|
||||
<el-button
|
||||
v-if="scope.row.editing"
|
||||
type="success"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
icon="el-icon-finished"
|
||||
@click="editFinish(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="dialogVisible = false">关 闭</el-button>
|
||||
<el-button type="primary" @click="submit">保 存</el-button>
|
||||
</span>
|
||||
<mater-dialog
|
||||
:key="materialDialogKey"
|
||||
ref="materDialog"
|
||||
:dialog-show="dialogMaterialVisible"
|
||||
is-single
|
||||
mater-opt-code="木箱"
|
||||
@handleSetMaterialValue="handleSetMaterialValue"
|
||||
/>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {crud} from '@crud/crud'
|
||||
import MaterDialog from './MaterDialog'
|
||||
import crudBoxstack from './boxstack'
|
||||
|
||||
export default {
|
||||
name: 'LayerViewDialog',
|
||||
components: {MaterDialog},
|
||||
dicts: ['IS_OR_NOT', 'boxinfo_area'],
|
||||
mixins: [crud()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
bussConfig: {
|
||||
type: Object
|
||||
},
|
||||
openParam: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogMaterialVisible: false,
|
||||
materialDialogKey: 0,
|
||||
dialogVisible: false,
|
||||
form: {
|
||||
stack_id: null,
|
||||
stack_code: null,
|
||||
stack_name: null,
|
||||
point_status: null,
|
||||
max_layer_count: null,
|
||||
current_layer_count: null,
|
||||
box_spec: null,
|
||||
x: null,
|
||||
y: null,
|
||||
tableData: []
|
||||
},
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
enableEdit(row) {
|
||||
row.editing = true
|
||||
},
|
||||
editFinish(row) {
|
||||
row.editing = false
|
||||
const filledBoxNum = this.form.tableData.filter(item => item.box_code).length
|
||||
this.form.current_layer_count = filledBoxNum
|
||||
},
|
||||
submit() {
|
||||
const tableData = this.form.tableData || []
|
||||
|
||||
if (!this.form.box_spec && tableData.some(item => item.box_code)) {
|
||||
this.$message.error('请填写木箱规格')
|
||||
return
|
||||
}
|
||||
if (this.form.box_spec && tableData.every(item => !item.box_code)) {
|
||||
this.$message.error('请填写至少一个木箱号')
|
||||
return
|
||||
}
|
||||
crudBoxstack.saveBoxStack(this.form).then(res => {
|
||||
this.$emit('editChanged')
|
||||
this.dialogVisible = false
|
||||
this.crud.notify('保存成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
},
|
||||
openMaterialDialog() {
|
||||
if (this.crud.status.edit > 0) return // 如果是编辑状态,则不允许重新选择
|
||||
this.dialogMaterialVisible = true
|
||||
this.materialDialogKey += 1;
|
||||
},
|
||||
handleSetMaterialValue(material) {
|
||||
this.form.box_spec = material.material_code
|
||||
this.dialogMaterialVisible = false
|
||||
},
|
||||
setForm(row) {
|
||||
this.dialogVisible = true
|
||||
crudBoxstack.getBoxLayer(row.stack_id).then(res => {
|
||||
this.form.tableData = res.map(item => ({
|
||||
...item,
|
||||
editing: false
|
||||
}))
|
||||
})
|
||||
this.form.stack_id = row.stack_id
|
||||
this.form.stack_code = row.stack_code
|
||||
this.form.stack_name = row.stack_name
|
||||
this.form.point_status = row.point_status
|
||||
this.form.x = row.x
|
||||
this.form.y = row.y
|
||||
this.form.box_spec = row.box_spec
|
||||
this.form.max_layer_count = row.max_layer_count
|
||||
this.form.current_layer_count = row.current_layer_count
|
||||
},
|
||||
open() {
|
||||
|
||||
},
|
||||
close() {
|
||||
this.$emit('editChanged')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.crud-opts2 {
|
||||
padding: 0 0;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.crud-opts2 .crud-opts-right2 {
|
||||
margin-left: auto;
|
||||
padding: 4px 4px;
|
||||
}
|
||||
|
||||
.input-with-select {
|
||||
background-color: #fff;
|
||||
}
|
||||
</style>
|
||||
161
lms/nladmin-ui/src/views/wms/pdm/ivt/boxstack/MaterDialog.vue
Normal file
161
lms/nladmin-ui/src/views/wms/pdm/ivt/boxstack/MaterDialog.vue
Normal file
@@ -0,0 +1,161 @@
|
||||
<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
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
@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="material_code" label="物料编码" min-width="150" show-overflow-tooltip/>
|
||||
<el-table-column prop="material_name" label="物料名称" min-width="200" show-overflow-tooltip/>
|
||||
<el-table-column prop="unit_name" label="计量单位"/>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination/>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import crudMaterialbase from '@/views/wms/basedata/master/material/materialbase'
|
||||
import CRUD, {header, presenter} from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
|
||||
export default {
|
||||
name: 'MaterDtl',
|
||||
components: {rrOperation, pagination},
|
||||
cruds() {
|
||||
return CRUD({title: '物料', url: 'api/Materialbase', crudMethod: {...crudMaterialbase}, optShow: {}})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
dicts: ['product_series'],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
isSingle: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
materOptCode: {
|
||||
type: String,
|
||||
default: '木箱'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
tableRadio: null,
|
||||
checkrow: null,
|
||||
rows: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue) {
|
||||
this.dialogVisible = newValue
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
this.crud.query.box = this.materOptCode
|
||||
},
|
||||
clickChange(item) {
|
||||
this.tableRadio = item
|
||||
},
|
||||
seriesFormat(row) {
|
||||
return this.dict.label.product_series[row.product_series]
|
||||
},
|
||||
open() {
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (this.isSingle) {
|
||||
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('handleSetMaterialValue', 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('handleSetMaterialValue', this.rows)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
42
lms/nladmin-ui/src/views/wms/pdm/ivt/boxstack/boxstack.js
Normal file
42
lms/nladmin-ui/src/views/wms/pdm/ivt/boxstack/boxstack.js
Normal file
@@ -0,0 +1,42 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/bstIvtboxstack',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/bstIvtboxstack',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/bstIvtboxstack',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getBoxLayer(id) {
|
||||
return request({
|
||||
url: 'api/bstIvtboxstacklayer/getBoxLayer/' + id,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function saveBoxStack(data) {
|
||||
return request({
|
||||
url: 'api/bstIvtboxstack/saveBoxStack',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default {add, edit, del, getBoxLayer, saveBoxStack}
|
||||
320
lms/nladmin-ui/src/views/wms/pdm/ivt/boxstack/index.vue
Normal file
320
lms/nladmin-ui/src/views/wms/pdm/ivt/boxstack/index.vue
Normal file
@@ -0,0 +1,320 @@
|
||||
<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="90px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="堆叠位信息">
|
||||
<el-input
|
||||
v-model="query.stack_info"
|
||||
clearable
|
||||
placeholder="输入堆叠位编码或名称"
|
||||
style="width: 185px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="木箱规格">
|
||||
<el-input
|
||||
v-model="query.box_spec"
|
||||
clearable
|
||||
placeholder="输入木箱规格"
|
||||
style="width: 185px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="点位区域">
|
||||
<el-select
|
||||
v-model="query.point_status"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
style="width: 185px;"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.boxinfo_area"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否启用">
|
||||
<el-switch
|
||||
v-model="query.is_used"
|
||||
active-value="0"
|
||||
inactive-value="1"
|
||||
active-color="#C0CCDA"
|
||||
inactive-color="#409EFF"
|
||||
@change="hand"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation :crud="crud"/>
|
||||
</el-form>
|
||||
</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="500px"
|
||||
>
|
||||
<br>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="100px">
|
||||
<el-form-item label="堆叠位编码" prop="stack_code">
|
||||
<el-input v-model="form.stack_code" style="width: 300px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="堆叠位名称" prop="stack_name">
|
||||
<el-input v-model="form.stack_name" style="width: 300px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="堆叠位区域" prop="point_status">
|
||||
<el-select
|
||||
v-model="form.point_status"
|
||||
clearable
|
||||
filterable
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
style="width: 300px;"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.boxinfo_area"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="最大堆叠数" prop="max_layer_count">
|
||||
<el-input
|
||||
v-model.number="form.max_layer_count" style="width: 300px;"
|
||||
oninput="this.value = this.value.replace(/[^0-9]/g, '')"
|
||||
placeholder="请输入大于等于1的整数"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="当前堆叠数" prop="current_layer_count">
|
||||
<el-input disabled v-model="form.current_layer_count" style="width: 300px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="排" prop="x">
|
||||
<el-input
|
||||
v-model.number="form.x" style="width: 300px;"
|
||||
oninput="this.value = this.value.replace(/[^0-9]/g, '')"
|
||||
placeholder="请输入大于等于1的整数"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="列" prop="y">
|
||||
<el-input
|
||||
v-model.number="form.y" style="width: 300px;"
|
||||
oninput="this.value = this.value.replace(/[^0-9]/g, '')"
|
||||
placeholder="请输入大于等于1的整数"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否启用" prop="is_used">
|
||||
<el-switch v-model="form.is_used" active-value="1" inactive-value="0"/>
|
||||
</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>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
:row-style="rowStyle"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column prop="stack_code" label="堆叠位编码" width="100px">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="toView(scope.row)">{{ scope.row.stack_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="stack_name" label="堆叠位名称" width="140px"/>
|
||||
<el-table-column prop="point_status" label="区域类型">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.boxinfo_area[scope.row.point_status] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="current_layer_count" label="当前堆叠数" width="140px"/>
|
||||
<el-table-column prop="max_layer_count" label="最大堆叠数" width="100px"/>
|
||||
<el-table-column prop="box_spec" label="木箱规格" show-overflow-tooltip width="150px"/>
|
||||
<el-table-column prop="box_spec_name" label="木箱规格名称" show-overflow-tooltip width="200px"/>
|
||||
<el-table-column prop="x" label="排" width="100px"/>
|
||||
<el-table-column prop="y" label="列" width="100px"/>
|
||||
<el-table-column prop="is_used" label="是否启用">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.is_used[scope.row.is_used] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="created_name" label="创建人" min-width="150" show-overflow-tooltip/>
|
||||
<el-table-column prop="created_time" label="创建时间" min-width="150" show-overflow-tooltip/>
|
||||
<el-table-column prop="update_name" label="修改人" min-width="150" show-overflow-tooltip/>
|
||||
<el-table-column prop="update_time" label="修改时间" min-width="150" show-overflow-tooltip/>
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
:is-visiable-del="false"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination/>
|
||||
</div>
|
||||
<mater-dialog
|
||||
:key="materialDialogKey"
|
||||
ref="materDialog"
|
||||
:dialog-show="dialogMaterialVisible"
|
||||
is-single
|
||||
mater-opt-code="木箱"
|
||||
@handleSetMaterialValue="handleSetMaterialValue"
|
||||
/>
|
||||
<LayerViewDialog ref="boxStackLayerView" @editChanged="crud.toQuery()"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudBoxStack from './boxstack'
|
||||
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 MaterDialog from './MaterDialog'
|
||||
import LayerViewDialog from './LayerViewDialog'
|
||||
|
||||
|
||||
const defaultForm = {
|
||||
stack_id: null,
|
||||
stack_code: null,
|
||||
stack_name: null,
|
||||
current_layer_count: 0,
|
||||
max_layer_count: 3,
|
||||
point_status: null,
|
||||
box_spec: null,
|
||||
is_used: "1",
|
||||
x: null,
|
||||
y: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
update_id: null,
|
||||
update_name: null,
|
||||
update_time: null
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'Boxstack',
|
||||
components: {pagination, crudOperation, rrOperation, udOperation, MaterDialog, LayerViewDialog},
|
||||
dicts: ['boxinfo_area', 'is_used'],
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '木箱库',
|
||||
url: 'api/bstIvtboxstack',
|
||||
idField: 'stack_id',
|
||||
sort: 'stack_id,desc',
|
||||
crudMethod: {...crudBoxStack},
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: true,
|
||||
del: true,
|
||||
download: false,
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
dialogMaterialVisible: false,
|
||||
materialDialogKey: 0,
|
||||
rules: {
|
||||
stack_code: [
|
||||
{required: true, message: '堆叠位编码不能为空', trigger: 'blur'}
|
||||
],
|
||||
stack_name: [
|
||||
{required: true, message: '堆叠位名称不能为空', trigger: 'blur'}
|
||||
],
|
||||
current_layer_count: [
|
||||
{required: true, message: '当前堆叠数不能为空', trigger: 'blur'}
|
||||
],
|
||||
max_layer_count: [
|
||||
{required: true, message: '最大堆叠数不能为空', trigger: 'blur'}
|
||||
],
|
||||
point_status: [
|
||||
{required: true, message: '区域不能为空', trigger: 'blur'}
|
||||
],
|
||||
x: [
|
||||
{required: true, message: '木箱排不能为空', trigger: 'blur'}
|
||||
],
|
||||
y: [
|
||||
{required: true, message: '木箱列不能为空', trigger: 'blur'}
|
||||
],
|
||||
is_used: [
|
||||
{required: true, message: '是否启用不能为空', trigger: 'blur'}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
toView(row) {
|
||||
if (row !== null) {
|
||||
this.$refs.boxStackLayerView.setForm(row)
|
||||
}
|
||||
},
|
||||
openMaterialDialog() {
|
||||
if (this.crud.status.edit > 0) return // 如果是编辑状态,则不允许重新选择
|
||||
this.dialogMaterialVisible = true
|
||||
this.materialDialogKey += 1;
|
||||
},
|
||||
handleSetMaterialValue(material) {
|
||||
this.form.box_spec = material.material_code
|
||||
this.dialogMaterialVisible = false
|
||||
},
|
||||
rowStyle({row, index}) {
|
||||
let backgroun = {}
|
||||
if (row.container_name != null && row.update_time != null && row.update_time != undefined) {
|
||||
let now = new Date()
|
||||
let before = new Date(row.update_time)
|
||||
const diff = now.getTime() - before.getTime();
|
||||
let min = Math.floor(diff / (1000 * 60))
|
||||
console.log(min)
|
||||
if (min > 120) {
|
||||
backgroun.background = 'red';
|
||||
}
|
||||
}
|
||||
return backgroun;
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user