2022-10-15 17:49:51 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class="app-container">
|
|
|
|
|
|
<!--工具栏-->
|
|
|
|
|
|
<div class="head-container">
|
2022-10-20 11:01:39 +08:00
|
|
|
|
<div v-if="crud.props.searchToggle">
|
|
|
|
|
|
<!-- 搜索 -->
|
|
|
|
|
|
<el-form
|
|
|
|
|
|
:inline="true"
|
|
|
|
|
|
class="demo-form-inline"
|
|
|
|
|
|
label-position="right"
|
|
|
|
|
|
label-width="80px"
|
|
|
|
|
|
label-suffix=":"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-form-item label="载具类型">
|
|
|
|
|
|
<el-select
|
|
|
|
|
|
v-model="query.vehicle_type"
|
|
|
|
|
|
clearable
|
|
|
|
|
|
size="mini"
|
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
|
class="filter-item"
|
|
|
|
|
|
style="width: 180px;"
|
|
|
|
|
|
@change="hand"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
v-for="item in dict.vehicle_type"
|
|
|
|
|
|
:label="item.label"
|
|
|
|
|
|
:value="item.value"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="载具号">
|
|
|
|
|
|
<el-input
|
|
|
|
|
|
v-model="query.vehicle_code"
|
|
|
|
|
|
clearable
|
|
|
|
|
|
size="mini"
|
|
|
|
|
|
placeholder="载具号"
|
|
|
|
|
|
style="width: 180px;"
|
|
|
|
|
|
class="filter-item"
|
|
|
|
|
|
@keyup.enter.native="crud.toQuery"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<rrOperation/>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
</div>
|
2022-10-15 17:49:51 +08:00
|
|
|
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
2022-10-20 11:01:39 +08:00
|
|
|
|
<crudOperation :permission="permission">
|
|
|
|
|
|
<el-button
|
|
|
|
|
|
slot="right"
|
|
|
|
|
|
class="filter-item"
|
|
|
|
|
|
type="success"
|
|
|
|
|
|
icon="el-icon-printer"
|
|
|
|
|
|
size="mini"
|
|
|
|
|
|
:disabled="crud.selections.length < 1"
|
|
|
|
|
|
@click="print"
|
|
|
|
|
|
>
|
|
|
|
|
|
打印
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
</crudOperation>
|
2022-10-15 17:49:51 +08:00
|
|
|
|
<!--表单组件-->
|
2022-10-18 19:15:14 +08:00
|
|
|
|
<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="mini" label-width="80px">
|
|
|
|
|
|
<el-form-item label="载具编码" prop="vehicle_code">
|
2022-10-20 11:01:39 +08:00
|
|
|
|
<el-input v-model="form.vehicle_code" :disabled="true" style="width: 370px;" />
|
2022-10-18 19:15:14 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="载具类型">
|
2022-10-15 17:49:51 +08:00
|
|
|
|
<el-select
|
2022-10-18 11:24:05 +08:00
|
|
|
|
v-model="form.vehicle_type"
|
2022-10-15 17:49:51 +08:00
|
|
|
|
clearable
|
2022-10-18 19:15:14 +08:00
|
|
|
|
filterable
|
2022-10-15 17:49:51 +08:00
|
|
|
|
size="mini"
|
|
|
|
|
|
class="filter-item"
|
2022-10-18 19:15:14 +08:00
|
|
|
|
style="width: 370px;"
|
2022-10-20 11:01:39 +08:00
|
|
|
|
@change="getVehicle"
|
2022-10-15 17:49:51 +08:00
|
|
|
|
>
|
|
|
|
|
|
<el-option
|
2022-10-18 11:24:05 +08:00
|
|
|
|
v-for="item in dict.vehicle_type"
|
2022-10-15 17:49:51 +08:00
|
|
|
|
:label="item.label"
|
|
|
|
|
|
:value="item.value"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
</el-form-item>
|
2022-10-20 11:01:39 +08:00
|
|
|
|
<el-form-item label="载具数量" prop="num">
|
|
|
|
|
|
<el-input-number :precision="0" :min="1" :max="99" v-model="form.num" style="width: 200px;" />
|
|
|
|
|
|
</el-form-item>
|
2022-10-15 17:49:51 +08:00
|
|
|
|
</el-form>
|
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
2022-10-20 11:01:39 +08:00
|
|
|
|
<el-button type="info" @click="crud.cancelCU">取消</el-button>
|
|
|
|
|
|
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">生成</el-button>
|
|
|
|
|
|
<el-button type="primary" @click="addAndprint">生成并打印</el-button>
|
2022-10-15 17:49:51 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
<!--表格渲染-->
|
2022-10-18 19:15:14 +08:00
|
|
|
|
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
2022-10-15 17:49:51 +08:00
|
|
|
|
<el-table-column type="selection" width="55" />
|
2022-10-18 11:24:05 +08:00
|
|
|
|
<el-table-column prop="vehicle_code" label="载具编码" />
|
2022-10-18 19:15:14 +08:00
|
|
|
|
<el-table-column prop="vehicle_type" label="载具类型" >
|
2022-10-15 17:49:51 +08:00
|
|
|
|
<template slot-scope="scope">
|
2022-10-18 19:15:14 +08:00
|
|
|
|
{{ dict.label.vehicle_type[scope.row.vehicle_type] }}
|
2022-10-15 17:49:51 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
2022-10-20 11:01:39 +08:00
|
|
|
|
<el-table-column prop="create_name" label="创建人" />
|
|
|
|
|
|
<el-table-column prop="create_time" label="创建时间" />
|
2022-10-18 19:15:14 +08:00
|
|
|
|
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
2022-10-15 17:49:51 +08:00
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
<udOperation
|
|
|
|
|
|
:data="scope.row"
|
|
|
|
|
|
:permission="permission"
|
2022-10-20 11:01:39 +08:00
|
|
|
|
:is-visiable-edit="false"
|
2022-10-15 17:49:51 +08:00
|
|
|
|
/>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
</el-table>
|
|
|
|
|
|
<!--分页组件-->
|
|
|
|
|
|
<pagination />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2022-10-18 19:15:14 +08:00
|
|
|
|
import crudVehicle from './vehicle'
|
2022-10-15 17:49:51 +08:00
|
|
|
|
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'
|
2022-10-20 11:01:39 +08:00
|
|
|
|
import { getLodop } from '@/assets/js/lodop/LodopFuncs'
|
2022-10-15 17:49:51 +08:00
|
|
|
|
|
2022-10-20 11:01:39 +08:00
|
|
|
|
const defaultForm = { num: 1, vehicle_id: null, vehicle_code: null, vehicle_name: null, one_code: null, two_code: null, rfid_code: null, vehicle_type: null, vehicle_width: null, vehicle_long: null, vehicle_height: null, overstruct_type: null, occupystruct_qty: null, ext_id: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null }
|
2022-10-15 17:49:51 +08:00
|
|
|
|
export default {
|
2022-10-18 19:15:14 +08:00
|
|
|
|
name: 'Vehicle',
|
|
|
|
|
|
dicts:['vehicle_type'],
|
2022-10-15 17:49:51 +08:00
|
|
|
|
components: { pagination, crudOperation, rrOperation, udOperation },
|
|
|
|
|
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
|
|
|
|
|
cruds() {
|
2022-10-20 11:01:39 +08:00
|
|
|
|
return CRUD({
|
|
|
|
|
|
title: '载具维护',
|
|
|
|
|
|
url: 'api/vehicle',
|
|
|
|
|
|
idField: 'vehicle_id',
|
|
|
|
|
|
sort: 'vehicle_id,desc',
|
|
|
|
|
|
crudMethod: { ...crudVehicle },
|
|
|
|
|
|
optShow: {
|
|
|
|
|
|
add: true,
|
|
|
|
|
|
edit: false,
|
|
|
|
|
|
del: false,
|
|
|
|
|
|
download: false,
|
|
|
|
|
|
reset: true
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
2022-10-15 17:49:51 +08:00
|
|
|
|
},
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
2022-10-18 19:15:14 +08:00
|
|
|
|
permission: {
|
|
|
|
|
|
},
|
2022-10-15 17:49:51 +08:00
|
|
|
|
rules: {
|
2022-10-18 11:24:05 +08:00
|
|
|
|
vehicle_code: [
|
2022-10-18 19:15:14 +08:00
|
|
|
|
{ required: true, message: '载具编码不能为空', trigger: 'blur' }
|
2022-10-15 17:49:51 +08:00
|
|
|
|
],
|
2022-10-18 11:24:05 +08:00
|
|
|
|
vehicle_type: [
|
2022-10-18 19:15:14 +08:00
|
|
|
|
{ required: true, message: '载具类型不能为空', trigger: 'blur' }
|
2022-10-15 17:49:51 +08:00
|
|
|
|
],
|
|
|
|
|
|
overstruct_type: [
|
2022-10-18 19:15:14 +08:00
|
|
|
|
{ required: true, message: '载具超仓位类型不能为空', trigger: 'blur' }
|
2022-10-15 17:49:51 +08:00
|
|
|
|
],
|
2022-10-18 19:15:14 +08:00
|
|
|
|
occupystruct_qty: [
|
|
|
|
|
|
{ required: true, message: '占仓位数不能为空', trigger: 'blur' }
|
2022-10-15 17:49:51 +08:00
|
|
|
|
]
|
2022-10-18 19:15:14 +08:00
|
|
|
|
}}
|
2022-10-15 17:49:51 +08:00
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
|
|
|
|
|
[CRUD.HOOK.beforeRefresh]() {
|
|
|
|
|
|
return true
|
2022-10-20 11:01:39 +08:00
|
|
|
|
},
|
|
|
|
|
|
hand() {
|
|
|
|
|
|
this.crud.toQuery()
|
|
|
|
|
|
},
|
|
|
|
|
|
getVehicle(code) {
|
|
|
|
|
|
if (!code) {
|
|
|
|
|
|
this.crud.notify('请选择载具类型', CRUD.NOTIFICATION_TYPE.INFO)
|
|
|
|
|
|
this.form.vehicle_code = ''
|
|
|
|
|
|
return false
|
|
|
|
|
|
}
|
|
|
|
|
|
crudVehicle.getVehicle(code).then(res => {
|
|
|
|
|
|
this.form.vehicle_code = res.value
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
addAndprint() {
|
|
|
|
|
|
const data = this.form
|
|
|
|
|
|
if (!this.form.vehicle_type) {
|
|
|
|
|
|
this.crud.notify('载具类型不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
|
|
|
|
|
return false
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!this.form.num) {
|
|
|
|
|
|
this.crud.notify('数量不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
|
|
|
|
|
return false
|
|
|
|
|
|
}
|
|
|
|
|
|
crudVehicle.add(data).then(res => {
|
|
|
|
|
|
res.forEach((item) => {
|
|
|
|
|
|
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)
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
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].vehicle_code
|
|
|
|
|
|
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()
|
|
|
|
|
|
}
|
2022-10-15 17:49:51 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
|
|
|
|
|
|
</style>
|