add:新增手持功能

This commit is contained in:
2025-08-26 07:32:32 +08:00
parent 5141db3113
commit 05d89b5382
47 changed files with 1601 additions and 221 deletions

View File

@@ -1,8 +1,8 @@
ENV = 'development'
# 接口地址
VUE_APP_BASE_API = 'http://localhost:8011'
VUE_APP_WS_API = 'ws://localhost:8011'
VUE_APP_BASE_API = 'http://localhost:8010'
VUE_APP_WS_API = 'ws://localhost:8010'
# 是否启用 babel-plugin-dynamic-import-node插件
VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

@@ -51,6 +51,7 @@
<el-table-column prop="material_name" label="物料名称" width="170" show-overflow-tooltip />
<el-table-column prop="material_spec" label="物料规格" width="170" show-overflow-tooltip/>
<el-table-column prop="class_name" label="物料分类" width="140" />
<el-table-column prop="measure_unit_id" label="单位编码" width="140" />
<el-table-column prop="unit_name" label="计量单位" />
<el-table-column prop="product_series_name" label="系列" />
<el-table-column prop="update_optname" label="修改人" />

View File

@@ -0,0 +1,228 @@
<template>
<el-dialog
:title="crud.status.title"
append-to-body
fullscreen
:before-close="crud.cancelCU"
:visible.sync="crud.status.cu > 0 || crud.status.view > 0"
width="1600px"
@open="open"
@close="close"
>
<el-row v-show="crud.status.cu > 0" :gutter="20">
<el-col :span="20" style="border: 1px solid white">
<span />
</el-col>
<el-col :span="4">
<span>
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" type="primary" @click="crud.submitCU">保存</el-button>
<el-button icon="el-icon-close" size="mini" type="info" @click="crud.cancelCU">关闭</el-button>
</span>
</el-col>
</el-row>
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" :rules="rules" size="mini" label-width="85px" label-suffix=":">
<el-form-item label="组盘标识" prop="group_id">
<el-input v-model="form.group_id" disabled placeholder="系统生成" clearable style="width: 150px" />
</el-form-item>
<el-form-item label="载具编码" prop="storagevehicle_code">
<el-input v-model="form.storagevehicle_code" disabled placeholder="系统生成" clearable style="width: 150px" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<label slot="label">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:</label>
<el-input v-model="form.remark" style="width: 380px;" rows="2" type="textarea" />
</el-form-item>
</el-form>
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
<div class="crud-opts2" style="margin-bottom: 5px;">
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="insertdtl()"
>
新增一行
</el-button>
</span>
</div>
<!--表格渲染-->
<el-table
ref="table"
:data="form.tableData"
style="width: 100%;"
border
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
>
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column show-overflow-tooltip prop="container_code" label="子卷号">
<template scope="scope">
<el-input v-show="!scope.row.edit" v-model="scope.row.container_code" style="width: 150px;" />
<span v-show="scope.row.edit">{{ scope.row.container_code }}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip width="190px" prop="material_code" label="物料编码" >
<template scope="scope">
<el-input v-show="!scope.row.edit" v-model="scope.row.material_code" disabled class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="queryMater(scope.$index, scope.row)" />
</el-input>
<span v-show="scope.row.edit">{{ scope.row.box_code }}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip :min-width="flexWidth('material_name',crud.data,'物料名称')" prop="material_name" label="物料名称" />
<el-table-column show-overflow-tooltip prop="qty" label="物料数量">
<template scope="scope">
<el-input v-show="!scope.row.edit" v-model="scope.row.qty" style="width: 150px;" />
<span v-show="scope.row.edit">{{ scope.row.qty }}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip :min-width="flexWidth('unit_name',crud.data,'计量单位')" prop="unit_name" label="计量单位" />
<el-table-column show-overflow-tooltip prop="remark" label="备注">
<template scope="scope">
<el-input v-show="!scope.row.edit" v-model="scope.row.remark" style="width: 150px;" />
</template>
</el-table-column>
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="170" fixed="right">
<template scope="scope">
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-delete"
@click.native.prevent="deleteRow(scope.$index, form.tableData)"
/>
</template>
</el-table-column>
</el-table>
<MaterDialog :dialog-show.sync="materShow" @materialChoose="tableChanged2" />
</el-dialog>
</template>
<script>
import CRUD, { crud, form } from '@crud/crud'
import MaterDialog from '@/views/wms/basedata/material/MaterialDialog'
import crudGroup from '@/views/wms/pdm/group/group'
const defaultForm = {
group_id: null,
storagevehicle_code: null,
material_name: null,
material_code: null,
unit_name: null,
measure_unit_id: null,
pcsn: null,
qty: null,
remark: null,
status: null,
create_id: null,
create_name: null,
create_time: null,
ext_code: null,
tableData: []
}
export default {
name: 'AddDialog',
components: { MaterDialog },
mixins: [crud(), form(defaultForm)],
statusEnums: ['FORM_STATUS'],
tableEnums: ['st_ivt_bsrealstorattr#stor_name#stor_code'],
props: {
dialogShow: {
type: Boolean,
default: false
},
openParam: {
type: Object
}
},
data() {
return {
dialogVisible: false,
materShow: false,
dtlShow: false,
nowrow: {},
nowindex: '',
unitDict: [],
materType: '03', // 关键成品
rules: {
}
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
}
},
methods: {
// open() {
// this.form.tableData = []
// },
close() {
this.$emit('AddChanged')
},
[CRUD.HOOK.afterToEdit]() {
crudGroup.getDtl({ 'group_id': this.form.group_id }).then(res => {
this.form.tableData[0] = res
// 将明细变成不可编辑
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
row.edit = false
this.form.tableData.splice(i, 1, row)
}
})
},
[CRUD.HOOK.beforeSubmit]() {
// 提交前校验
debugger
if (this.form.tableData.length === 0) {
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
},
async queryMater(index, row) {
this.materShow = true
this.nowindex = index
this.nowrow = row
},
deleteRow(index, rows) {
rows.splice(index, 1)
},
async insertdtl() {
this.form.tableData.push({ container_code: '', material_code: '', material_name: '', qty: '', measure_unit_id: '', unit_name: '', remark: '', edit: false })
},
tableChanged2(row) {
// 新增一行物料时,给行进行赋值、
this.nowrow.material_code = row.material_code
this.nowrow.material_name = row.material_name
this.nowrow.measure_unit_id = row.measure_unit_id
this.nowrow.unit_name = row.unit_name
this.nowrow.edit = false
this.form.tableData.splice(this.nowindex, 1, this.nowrow) // 通过splice 替换数据 触发视图更新
}
}
}
</script>
<style>
.crud-opts2 {
padding: 4px 0;
display: -webkit-flex;
display: flex;
align-items: center;
}
.crud-opts2 .crud-opts-right2 {
margin-left: auto;
}
</style>

View File

@@ -0,0 +1,185 @@
<template>
<el-dialog
append-to-body
title="组盘详情"
:visible.sync="dialogVisible"
destroy-on-close
fullscreen
@close="close"
@open="open"
>
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" size="mini" label-width="85px" label-suffix=":">
<el-form-item label="载具编码" prop="storagevehicle_code">
<label slot="label">载具编码:</label>
<el-input v-model="form.storagevehicle_code" disabled clearable style="width: 210px" />
</el-form-item>
<el-form-item label="物料编码" prop="material_code">
<label slot="label">物料编码:</label>
<el-input v-model="form.material_code" disabled clearable style="width: 210px" />
</el-form-item>
<el-form-item label="物料名称" prop="物料名称">
<label slot="label">物料名称:</label>
<el-input v-model="form.material_name" disabled clearable style="width: 210px" />
</el-form-item>
<el-form-item label="总数量" prop="qty">
<label slot="label">&nbsp;&nbsp;&nbsp;:</label>
<el-input-number
v-model="form.qty"
:controls="false"
:precision="3"
:min="0"
disabled
style="width: 210px"
/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<label slot="label">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
<el-input v-model="form.remark" style="width: 380px;" rows="2" type="textarea" :disabled="true" />
</el-form-item>
</el-form>
<div class="crud-opts2">
<span class="role-span2">组盘明细</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
<el-table
ref="table"
:data="tableDtl"
style="width: 100%;"
max-height="300"
size="mini"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="handleDtlCurrentChange"
>
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column min-width="120" show-overflow-tooltip prop="container_code" label="卷号" align="center" />
<el-table-column min-width="120" show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
<el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
<el-table-column prop="qty" :formatter="crud.formatNum3" label="物料数量" align="center" />
<el-table-column prop="measure_unit_id" label="计量单位" align="center" />
<el-table-column show-overflow-tooltip prop="remark" label="明细备注" align="center" />
</el-table>
</el-card>
</el-dialog>
</template>
<script>
import { crud } from '@crud/crud'
import crudGroup from '@/views/wms/pdm/group/group'
export default {
name: 'ViewDialog',
components: { },
mixins: [crud()],
dicts: ['io_bill_status', 'work_status', 'task_status', 'SCH_TASK_TYPE_DTL', 'INANDOUT_BILL_TYPE'],
props: {
dialogShow: {
type: Boolean,
default: false
},
rowmst: {
type: Object
}
},
data() {
return {
dialogVisible: false,
tableDtl: [],
tabledis: [],
billtypelist: [],
storlist: [],
currentdtl: null,
currentDis: {},
form: {}
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
},
rowmst: {
handler(newValue) {
this.form = newValue
}
}
},
methods: {
open() {
this.queryTableDtl()
},
close() {
this.$emit('update:dialogShow', false)
this.currentDis = {}
this.currentdtl = null
this.tableDtl = []
this.tabledis = []
this.$emit('TaskChanged')
},
bill_statusFormat(row) {
return this.dict.label.io_bill_status[row.bill_status]
},
taskdtl_typeFormat(row) {
return this.dict.label.SCH_TASK_TYPE_DTL[row.taskdtl_type]
},
task_statusFormat(row) {
return this.dict.label.task_status[row.task_status]
},
work_statusFormat(row) {
return this.dict.label.work_status[row.work_status]
},
handleDtlCurrentChange(current) {
if (current !== null) {
this.tabledis = []
this.currentdtl = current
this.queryTableDdis()
} else {
this.tabledis = []
this.currentdtl = {}
}
},
invtypeFormat(row, column) {
for (const item of this.billtypelist) {
if (item.code === row.source_bill_type) {
return item.name
}
}
},
handleDisCurrentChange(current) {
this.currentDis = current
},
queryTableDtl() {
crudGroup.getDtl({ 'group_id': this.form.group_id }).then(res => {
this.tableDtl = res
})
}
}
}
</script>
<style>
.crud-opts2 {
padding: 0;
display: -webkit-flex;
display: flex;
align-items: center;
}
.crud-opts2 .el-dialog__title2 {
line-height: 24px;
font-size:20px;
color:#303133;
}
.crud-opts2 .role-span2 {
padding: 0px 0px 20px 0px;
}
.crud-opts2 {
padding: 10px 0px 0px 50px;
}
</style>

View File

@@ -24,4 +24,12 @@ export function edit(data) {
})
}
export default { add, edit, del }
export function getDtl(params) {
return request({
url: '/api/group/getDtl',
method: 'get',
params
})
}
export default { add, edit, del, getDtl }

View File

@@ -61,85 +61,6 @@
<!--如果想在工具栏加入更多按钮可以使用插槽方式 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="1200px"
>
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="110px">
<el-row>
<el-col :span="8">
<el-form-item label="物料编码" prop="material_code" >
<el-input v-model="form.material_code" @focus="getMaterial" style="width: 200px;" :disabled="crud.status.edit > 0" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="物料名称" prop="material_name">
<el-input disabled v-model="form.material_name" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="规格" prop="material_spec">
<label slot="label">规&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;格</label>
<el-input disabled v-model="form.material_spec" style="width: 200px;" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="载具编码" prop="storagevehicle_code">
<label slot="label">载具编码</label>
<el-input v-model="form.storagevehicle_code" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="物料批号" prop="pcsn">
<el-input v-model="form.pcsn" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="物料数量" prop="qty">
<el-input-number v-model="form.qty" style="width: 200px;" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="单位" prop="qty_unit_name">
<el-select
v-model="form.qty_unit_name"
style="width: 100px"
placeholder=""
@change="unitChange"
>
<el-option
v-for="item in tableEnum.md_pb_measureunit"
:key="item.id"
:label="item.label"
:value="item.value+'@'+item.label"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="源单号" prop="ext_code">
<el-input v-model="form.ext_code" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="源单类型" prop="ext_type">
<el-input v-model="form.ext_type" style="width: 200px;" />
</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>
</div>
</el-dialog>
<!--表格渲染-->
<el-table
ref="table"
@@ -149,7 +70,11 @@
style="width: 100%;"
@selection-change="crud.selectionChangeHandler"
>
<el-table-column prop="storagevehicle_code" label="载具编码" :min-width="flexWidth('storagevehicle_code',crud.data,'载具编码')" />
<el-table-column prop="storagevehicle_code" label="载具编码" :min-width="flexWidth('storagevehicle_code',crud.data,'载具编码')">
<template slot-scope="scope">
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.storagevehicle_code }}</el-link>
</template>
</el-table-column>
<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,'批次')" />
@@ -178,24 +103,28 @@
<pagination />
</div>
<!--放引用的组件-->
<AddDialog @AddChanged="querytable" />
<ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable" />
<MaterialDialog :dialog-show.sync="materialDialog" @materialChoose="materialChoose" />
</div>
</template>
<script>
import crudGroup from '@/views/wms/pdm/group/group'
import AddDialog from '@/views/wms/pdm/group/AddDialog'
import ViewDialog from '@/views/wms/pdm/group/ViewDialog'
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'
import MaterialDialog from '@/views/wms/basedata/material/MaterialDialog'
const defaultForm = {
group_id: null,
storagevehicle_code: null,
material_id: null,
material_name: null,
material_code: null,
material_spec: null,
pcsn: null,
qty_unit_id: null,
@@ -207,11 +136,13 @@ const defaultForm = {
create_name: null,
create_time: null,
ext_code: null,
tableData: [],
ext_type: null
}
export default {
name: 'Group',
components: { pagination, MaterialDialog, crudOperation, rrOperation, udOperation },
components: { ViewDialog, pagination, MaterialDialog, crudOperation, rrOperation, udOperation, AddDialog },
mixins: [presenter(), header(), form(defaultForm), crud()],
tableEnums: ['md_pb_measureunit#unit_name#measure_unit_id'],
// 数据字典
@@ -234,6 +165,8 @@ export default {
permission: {},
materialDialog: false,
classes: [],
viewShow: false,
mstrow: {},
rules: {
}
}
@@ -246,9 +179,17 @@ export default {
formattStatus(row) {
return this.dict.label.GROUP_STATUS[row.status]
},
querytable() {
this.$refs.table.clearSelection()
this.crud.toQuery()
},
getMaterial() {
this.materialDialog = true
},
toView(index, row) {
this.mstrow = row
this.viewShow = true
},
unitChange(row) {
const split = row.split('@')
this.form.qty_unit_id = split[0]

View File

@@ -0,0 +1,185 @@
<template>
<el-dialog
append-to-body
title="组盘详情"
:visible.sync="dialogVisible"
destroy-on-close
fullscreen
@close="close"
@open="open"
>
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" size="mini" label-width="85px" label-suffix=":">
<el-form-item label="载具编码" prop="vehicle_code">
<label slot="label">载具编码:</label>
<el-input v-model="form.vehicle_code" disabled clearable style="width: 210px" />
</el-form-item>
<el-form-item label="物料编码" prop="material_code">
<label slot="label">物料编码:</label>
<el-input v-model="form.material_code" disabled clearable style="width: 210px" />
</el-form-item>
<el-form-item label="物料名称" prop="物料名称">
<label slot="label">物料名称:</label>
<el-input v-model="form.物料名称" disabled clearable style="width: 210px" />
</el-form-item>
<el-form-item label="总数量" prop="qty">
<label slot="label">&nbsp;&nbsp;&nbsp;:</label>
<el-input-number
v-model="form.qty"
:controls="false"
:precision="3"
:min="0"
disabled
style="width: 210px"
/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<label slot="label">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
<el-input v-model="form.remark" style="width: 380px;" rows="2" type="textarea" :disabled="true" />
</el-form-item>
</el-form>
<div class="crud-opts2">
<span class="role-span2">组盘明细</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
<el-table
ref="table"
:data="tableDtl"
style="width: 100%;"
max-height="300"
size="mini"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="handleDtlCurrentChange"
>
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column min-width="120" show-overflow-tooltip prop="container_code" label="卷号" align="center" />
<el-table-column min-width="120" show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
<el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
<el-table-column prop="qty" :formatter="crud.formatNum3" label="物料数量" align="center" />
<el-table-column prop="measure_unit_id" label="计量单位" align="center" />
<el-table-column show-overflow-tooltip prop="remark" label="明细备注" align="center" />
</el-table>
</el-card>
</el-dialog>
</template>
<script>
import { crud } from '@crud/crud'
import crudSchBaseVehiclematerialgroup from './schBaseVehiclematerialgroup'
export default {
name: 'ViewDialog',
components: { },
mixins: [crud()],
dicts: ['io_bill_status', 'work_status', 'task_status', 'SCH_TASK_TYPE_DTL', 'INANDOUT_BILL_TYPE'],
props: {
dialogShow: {
type: Boolean,
default: false
},
rowmst: {
type: Object
}
},
data() {
return {
dialogVisible: false,
tableDtl: [],
tabledis: [],
billtypelist: [],
storlist: [],
currentdtl: null,
currentDis: {},
form: {}
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
},
rowmst: {
handler(newValue) {
this.form = newValue
}
}
},
methods: {
open() {
this.queryTableDtl()
},
close() {
this.$emit('update:dialogShow', false)
this.currentDis = {}
this.currentdtl = null
this.tableDtl = []
this.tabledis = []
this.$emit('TaskChanged')
},
bill_statusFormat(row) {
return this.dict.label.io_bill_status[row.bill_status]
},
taskdtl_typeFormat(row) {
return this.dict.label.SCH_TASK_TYPE_DTL[row.taskdtl_type]
},
task_statusFormat(row) {
return this.dict.label.task_status[row.task_status]
},
work_statusFormat(row) {
return this.dict.label.work_status[row.work_status]
},
handleDtlCurrentChange(current) {
if (current !== null) {
this.tabledis = []
this.currentdtl = current
this.queryTableDdis()
} else {
this.tabledis = []
this.currentdtl = {}
}
},
invtypeFormat(row, column) {
for (const item of this.billtypelist) {
if (item.code === row.source_bill_type) {
return item.name
}
}
},
handleDisCurrentChange(current) {
this.currentDis = current
},
queryTableDtl() {
crudSchBaseVehiclematerialgroup.getDtl({ 'group_ip': this.form.group_ip }).then(res => {
this.tableDtl = res
})
}
}
}
</script>
<style>
.crud-opts2 {
padding: 0;
display: -webkit-flex;
display: flex;
align-items: center;
}
.crud-opts2 .el-dialog__title2 {
line-height: 24px;
font-size:20px;
color:#303133;
}
.crud-opts2 .role-span2 {
padding: 0px 0px 20px 0px;
}
.crud-opts2 {
padding: 10px 0px 0px 50px;
}
</style>

View File

@@ -235,20 +235,26 @@
</div>
</el-dialog>
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler" @current-change="handleCurrentChange"
@select="handleSelectionChange"
@select-all="onSelectAll">
<el-table-column type="selection" width="55" />
<el-table-column sortable prop="vehicle_code" label="载具编码" :min-width="flexWidth('vehicle_code',crud.data,'载具编码', 30)" />
<!-- <el-table-column prop="child_vehicle_code" label="子载具编码" :min-width="flexWidth('child_vehicle_code',crud.data,'子载具编码')"/>-->
<el-table-column prop="source_vehicle_code" label="来源载具" :min-width="flexWidth('source_vehicle_code',crud.data,'来源载具')" />
<el-table-column prop="region_name" label="所属区域" :min-width="flexWidth('region_name',crud.data,'所属区域')" />
<el-table-column prop="point_code" label="当前点位编码" :min-width="flexWidth('point_code',crud.data,'当前点位编码')" />
<el-table-column prop="point_name" label="当前点位名称" :min-width="flexWidth('point_name',crud.data,'当前点位名称')" />
<el-table-column prop="move_way" label="移动路径" :min-width="flexWidth('move_way',crud.data,'点位名称')" />
<el-table-column prop="is_full" label="是否满托" :min-width="flexWidth('is_full',crud.data,'是否满托')">
<el-table-column sortable prop="storagevehicle_code" label="载具编码" :min-width="flexWidth('storagevehicle_code',crud.data,'载具编码', 30)">
<template slot-scope="scope">
{{ scope.row.is_full?'是':'否' }}
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.vehicle_code }}</el-link>
</template>
</el-table-column>
<!-- <el-table-column prop="child_vehicle_code" label="子载具编码" :min-width="flexWidth('child_vehicle_code',crud.data,'子载具编码')"/>-->
<!-- <el-table-column prop="source_vehicle_code" label="来源载具" :min-width="flexWidth('source_vehicle_code',crud.data,'来源载具')" />-->
<!-- <el-table-column prop="region_name" label="所属区域" :min-width="flexWidth('region_name',crud.data,'所属区域')" />-->
<!-- <el-table-column prop="point_code" label="当前点位编码" :min-width="flexWidth('point_code',crud.data,'当前点位编码')" />-->
<!-- <el-table-column prop="point_name" label="当前点位名称" :min-width="flexWidth('point_name',crud.data,'当前点位名称')" />-->
<!-- <el-table-column prop="move_way" label="移动路径" :min-width="flexWidth('move_way',crud.data,'点位名称')" />-->
<!-- <el-table-column prop="is_full" label="是否满托" :min-width="flexWidth('is_full',crud.data,'是否满托')">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.is_full?'是':'否' }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column prop="pcsn" label="批次" :min-width="flexWidth('pcsn',crud.data,'批次')" />
<el-table-column prop="workorder_code" label="工单编码" :min-width="flexWidth('workorder_code',crud.data,'工单编码')" />
<el-table-column prop="instorage_time" label="入库时间" :min-width="flexWidth('instorage_time',crud.data,'入库时间')" />
@@ -289,6 +295,7 @@
<!--分页组件-->
<pagination />
</div>
<ViewDialog :dialog-show.sync="viewShow" :rowmst="mstrow" @AddChanged="querytable" />
<!-- <MaterialDialog :dialog-show.sync="materialDialog" @tableChanged="tableChanged" />-->
<!-- <WorkOrderDialog :dialog-show.sync="workOrderDialog" @tableChanged="tableChanged" />-->
</div>
@@ -309,7 +316,7 @@ import crudSchBaseRegion from '@/views/wms/sch/region/schBaseRegion'
const defaultForm = {
group_id: null,
vehicle_code: null,
storagevehicle_code: null,
vehicle_type: null,
material_id: null,
child_vehicle_code: null,
@@ -366,6 +373,8 @@ export default {
workShopList: [],
pointList: [],
regionList: [],
viewShow: false,
mstrow: {},
choose: '物料',
materialDialog: false,
workOrderDialog: false
@@ -386,11 +395,56 @@ export default {
this.workShopList = res
})
},
handleSelectionChange(val, row) {
if (val.length > 1) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(val.pop())
this.buttonChange(row)
} else if (val.length === 1) {
this.buttonChange(row)
} else {
this.handleCurrentChange(null)
}
},
onSelectAll() {
this.$refs.table.clearSelection()
this.handleCurrentChange(null)
},
buttonChange(currentRow) {
if (currentRow !== null) {
this.currentRow = currentRow
if (currentRow.bill_status === '10' || currentRow.bill_status === '20' || currentRow.bill_status === '30' || currentRow.bill_status === '40') {
this.dis_flag = false
} else {
this.dis_flag = true
}
if (currentRow.bill_status === '30' || currentRow.bill_status === '40') {
this.task_flag = false
} else {
this.task_flag = true
}
}
},
handleCurrentChange(currentRow) {
if (currentRow === null) {
this.dis_flag = true
this.task_flag = true
this.currentRow = {}
}
},
getRegionList() {
crudSchBaseRegion.getRegionList().then(res => {
this.regionList = res
})
},
toView(index, row) {
this.mstrow = row
this.viewShow = true
},
querytable() {
this.onSelectAll()
this.crud.toQuery()
},
getMaterial() {
if (this.choose === '物料') {
this.materialDialog = true

View File

@@ -32,4 +32,6 @@ export function getGroup(data) {
})
}
export default { add, edit, del, getGroup }