rev:优化生箔、烘箱、分切上料功能

This commit is contained in:
2025-06-24 19:34:47 +08:00
parent adb9359604
commit 3cf1175358
33 changed files with 1540 additions and 452 deletions

View File

@@ -111,6 +111,37 @@
<el-form-item label="MES启用" prop="is_used">
<el-switch v-model="form.mes_used" active-value="1" inactive-value="0" />
</el-form-item>
<el-form-item label="满轴位状态" prop="full_point_status">
<el-select
v-model="form.full_point_status"
size="mini"
placeholder="满轴位状态"
class="filter-item"
style="width: 370px;"
>
<el-option
v-for="item in dict.sch_full_point_status"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="空轴位状态" prop="empty_point_status">
<el-select
v-model="form.empty_point_status"
clearable
filterable
size="mini"
class="filter-item"
style="width: 370px;"
>
<el-option
v-for="item in dict.sch_empty_point_status"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>

View File

@@ -9,7 +9,7 @@
@close="close"
>
<el-form ref="form" :model="form1" :rules="rules" size="mini" label-width="110px">
<el-form-item label="重量" prop="productin_qty">
<el-form-item label="重量(Kg)" prop="productin_qty">
<el-input-number v-model="form1.productin_qty" :min="0" :controls="false" :precision="3" style="width: 250px;"/>
</el-form-item>
</el-form>

View File

@@ -84,6 +84,17 @@
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission">
<el-button
slot="right"
class="filter-item"
type="success"
icon="el-icon-position"
size="mini"
:disabled="crud.selections.length !== 1"
@click="start"
>
开始工单
</el-button>
<el-button
slot="right"
class="filter-item"
@@ -134,35 +145,8 @@
</el-col>
<el-col :span="12">
<el-form-item label="机台编码" prop="resource_name">
<el-select
v-model="form.resource_name"
clearable
size="mini"
placeholder="请选择"
class="filter-item"
style="width: 250px"
@change="hand"
>
<el-option
v-for="item in resourceList"
:label="item"
:value="item"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="生产工单" prop="mfg_order_name">
<el-input v-model="form.mfg_order_name" style="width: 250px;" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产品编码" prop="product_name">
<el-input v-model="form.product_name" disabled class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="queryMater()" />
<el-input v-model="form.resource_name" disabled class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="querySbpointivt()" />
</el-input>
</el-form-item>
</el-col>
@@ -175,8 +159,10 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="理论长度" prop="theory_height">
<el-input v-model="form.theory_height" style="width: 250px;" />
<el-form-item label="产品编码" prop="product_name">
<el-input v-model="form.product_name" disabled class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="queryMater()" />
</el-input>
</el-form-item>
</el-col>
</el-row>
@@ -204,21 +190,8 @@
<el-row>
<el-col :span="12">
<el-form-item label="重量" prop="productin_qty">
<el-input v-model="form.productin_qty" style="width: 250px;" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="车号" prop="agvno">
<el-input v-model="form.agvno" style="width: 250px;" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="批次号" prop="pscn">
<el-input v-model="form.pscn" style="width: 250px;" />
<el-form-item label="理论长度" prop="theory_height">
<el-input v-model="form.theory_height" style="width: 250px;" />
</el-form-item>
</el-col>
<el-col :span="12">
@@ -255,9 +228,9 @@
<el-table-column prop="theory_height" label="理论长度" :min-width="flexWidth('theory_height',crud.data,'理论长度')" />
<el-table-column prop="realstart_time" label="开始时间" :min-width="flexWidth('realstart_time',crud.data,'开始时间')" />
<el-table-column prop="realend_time" label="结束时间" :min-width="flexWidth('realend_time',crud.data,'结束时间')" />
<el-table-column prop="productin_qty" label="重量" :min-width="flexWidth('productin_qty',crud.data,'重量')" :formatter="crud.formatNum3" />
<el-table-column prop="productin_qty" label="重量(Kg)" :min-width="flexWidth('productin_qty',crud.data,'重量(Kg)')" :formatter="crud.formatNum3" />
<el-table-column prop="agvno" label="车号" :min-width="flexWidth('agvno',crud.data,'车号')" />
<el-table-column prop="pscn" label="批次号" :min-width="flexWidth('pscn',crud.data,'批次号')" />
<el-table-column prop="pscn" label="SAP批次号" :min-width="flexWidth('pscn',crud.data,'批次号')" />
<el-table-column prop="product_area" label="生产区域" :min-width="flexWidth('product_area',crud.data,'生产区域')" />
<el-table-column prop="is_baking" label="请求烘烤" :min-width="flexWidth('is_baking',crud.data,'请求烘烤')" :formatter="formatBakeIsOrNot" />
<el-table-column prop="is_instor" label="请求入半成品库" :min-width="flexWidth('is_instor',crud.data,'请求入半成品库')" :formatter="formatStorIsOrNot" />
@@ -278,6 +251,7 @@
</div>
<Dialog :dialog-show.sync="dialogShow" :open-param="openParam" />
<MaterDialog :dialog-show.sync="materShow" :mater-opt-code.sync="materType" @setMaterValue="setMaterValue" />
<SbpointivtDialog :dialog-show.sync="sbpointivtShow" :mater-opt-code.sync="sbpointivtType" @setSbpointivtValue="setSbpointivtValue" />
</div>
</template>
@@ -291,6 +265,7 @@ import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import sbSbpointivt from '@/views/wms/pdm/ivt/sbpointivt/sbpointivt'
import SbpointivtDialog from '@/views/wms/pub/SbpointivtDialog'
const defaultForm = {
workorder_id: null,
@@ -322,7 +297,7 @@ const defaultForm = {
export default {
name: 'Rawfoilworkorder',
dicts: ['product_area', 'product_status', 'IS_OR_NOT'],
components: { pagination, crudOperation, rrOperation, udOperation, Dialog, MaterDialog },
components: { pagination, crudOperation, rrOperation, udOperation, Dialog, MaterDialog, SbpointivtDialog },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({
@@ -347,6 +322,8 @@ export default {
permission: {},
resourceList: [],
materShow: false,
sbpointivtType: '',
sbpointivtShow: false,
rules: {
container_name: [
{ required: true, message: '母卷号不能为空', trigger: 'blur' }
@@ -407,7 +384,7 @@ export default {
compelEnd() {
const _selectData = this.$refs.table.selection
const data = _selectData[0]
if (data.status === '09') {
if (data.status === '40') {
return this.crud.notify('不能对完成状态的工单强制结束', CRUD.NOTIFICATION_TYPE.INFO)
}
crudRawfoilworkorder.compelEnd(data).then(res => {
@@ -415,9 +392,26 @@ export default {
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
},
start() {
const _selectData = this.$refs.table.selection
const data = _selectData[0]
if (data.status !== '00') {
return this.crud.notify('不能对不是初始化状态的工单开始工单', CRUD.NOTIFICATION_TYPE.INFO)
}
crudRawfoilworkorder.start(data).then(res => {
this.crud.toQuery()
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
},
async querySbpointivt() {
this.sbpointivtShow = true
},
setMaterValue(row) {
this.form.product_name = row.material_code
this.form.description = row.material_name
this.form.product_name = row.material_code
this.form.description = row.material_name
},
setSbpointivtValue(row) {
this.form.resource_name = row.ext_code
},
print() {
const _selectData = this.$refs.table.selection

View File

@@ -48,4 +48,12 @@ export function confirm(data) {
})
}
export default { add, edit, del, compelEnd, confirm, print }
export function start(data) {
return request({
url: 'api/rawfoilworkorder/start',
method: 'post',
data
})
}
export default { add, edit, del, compelEnd, confirm, print, start }

View File

@@ -0,0 +1,601 @@
<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="1200px"
@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="mfg_order_name">
<el-input v-model="form.mfg_order_name" disabled placeholder="系统生成" style="width: 150px;" />
</el-form-item>
<el-form-item label="订单类型" prop="order_type">
<el-select
v-model="form.order_type"
clearable
size="mini"
placeholder="请选择"
class="filter-item"
style="width: 150px"
@change="hand1"
>
<el-option
v-for="item in dict.order_type"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="母卷号" prop="parent_container_name">
<el-input v-model="form.parent_container_name" :disabled="reform_or_normal1()" style="width: 150px;" />
</el-form-item>
<el-form-item label="改制母卷" prop="restruct_container_name">
<el-input v-model="form.restruct_container_name" :disabled="reform_or_normal2()" style="width: 150px;" />
</el-form-item>
<el-form-item label="来源位置" prop="ware_house">
<el-select
v-model="form.ware_house"
clearable
size="mini"
placeholder="请选择"
class="filter-item"
style="width: 150px"
@change="hand"
>
<el-option
v-for="item in dict.ware_house"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="机台编码" prop="resource_name">
<el-input v-model="form.resource_name" disabled class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="queryCutpointivt()" />
</el-input>
</el-form-item>
<el-form-item label="分切组" prop="split_group">
<el-select
v-model="form.split_group"
clearable
size="mini"
placeholder="请选择"
class="filter-item"
style="width: 150px"
@change="hand"
>
<el-option
v-for="item in groups"
:label="item"
:value="item"
/>
</el-select>
</el-form-item>
<el-form-item label="生产日期" prop="manufacture_date">
<el-date-picker
v-model="form.manufacture_date"
style="width: 150px;"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期"
/>
</el-form-item>
<el-form-item label="产品编码" prop="product_name">
<el-input v-model="form.product_name" disabled class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="queryMater(1)" />
</el-input>
</el-form-item>
<el-form-item label="产品描述" prop="description">
<el-input v-model="form.description" disabled style="width: 150px;" />
</el-form-item>
<el-form-item label="客户编码" prop="customer_code">
<el-input v-model="form.customer_code" disabled class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="queryCustomer()" />
</el-input>
</el-form-item>
<el-form-item label="客户名称" prop="customer_name">
<el-input v-model="form.customer_name" disabled style="width: 150px;" />
</el-form-item>
<el-form-item label="明细数" prop="detail_count">
<label slot="label">明&nbsp;&nbsp;细&nbsp;数:</label>
<el-input v-model="form.detail_count" size="mini" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" style="width: 150px;" />
</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 :min-width="flexWidth('container_name',crud.data,'子卷号')" prop="container_name" label="子卷号">
<template scope="scope">
<el-input v-show="!scope.row.edit" v-model="scope.row.container_name" size="mini" />
<span v-show="scope.row.edit">{{ scope.row.container_name }}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip :min-width="flexWidth('paper_tube_or_frp',crud.data,'管件类型')" prop="paper_tube_or_frp" label="管件类型" >
<template scope="scope">
<el-select
v-show="!scope.row.edit"
v-model="scope.row.paper_tube_or_frp"
clearable
size="mini"
placeholder="请选择"
class="filter-item"
style="width: 100px"
@change="hand2"
>
<el-option
v-for="item in dict.paper_tube_or_frp_type"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="paper_tube_material" label="纸筒物料编码" :min-width="flexWidth('paper_tube_material',crud.data,'纸筒物料编码')" >
<template scope="scope">
<el-input v-show="!scope.row.edit" v-model="scope.row.paper_tube_material" disabled class="input-with-select">
<el-button slot="append" icon="el-icon-search" :disabled="tube_or_FRP1()" @click="queryMater(2,scope.$index, scope.row)" />
</el-input>
<span v-show="scope.row.edit">{{ scope.row.paper_tube_material }}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="paper_tube_description" align="center" :min-width="flexWidth('paper_tube_description',crud.data,'纸筒物料描述')" label="纸筒物料描述" />
<el-table-column show-overflow-tooltip :min-width="flexWidth('paper_tube_model',crud.data,'纸筒规格')" prop="paper_tube_model" label="纸筒规格" />
<el-table-column show-overflow-tooltip :min-width="flexWidth('frp_material',crud.data,'FRP管物料编码')" prop="frp_material" label="FRP管物料编码" >
<template scope="scope">
<el-input v-show="!scope.row.edit" v-model="scope.row.frp_material" disabled class="input-with-select">
<el-button slot="append" icon="el-icon-search" :disabled="tube_or_FRP2()" @click="queryMater(3,scope.$index, scope.row)" />
</el-input>
<span v-show="scope.row.edit">{{ scope.row.frp_material }}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip :min-width="flexWidth('frp_description',crud.data,'FRP管物料描述')" prop="frp_description" label="FRP管物料描述" />
<el-table-column show-overflow-tooltip :min-width="flexWidth('frp_model',crud.data,'FRP管规格')" prop="frp_model" label="FRP管规格" />
<el-table-column show-overflow-tooltip :min-width="flexWidth('up_or_down',crud.data,'上轴下轴')" prop="up_or_down" label="上轴下轴" >
<template scope="scope">
<el-select
v-model="scope.row.up_or_down"
clearable
size="mini"
placeholder="请选择"
class="filter-item"
style="width: 370px"
>
<el-option
v-for="item in updowns"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="left_or_right" label="左卷右卷" :min-width="flexWidth('left_or_right',crud.data,'左卷右卷')" >
<template scope="scope">
<el-select
v-model="scope.row.left_or_right"
clearable
size="mini"
placeholder="请选择"
class="filter-item"
style="width: 370px"
>
<el-option
v-for="item in leftorrights"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip :min-width="flexWidth('box_code',crud.data,'木箱物料编码')" prop="frp_material" label="木箱物料编码" >
<template scope="scope">
<el-input v-show="!scope.row.edit" v-model="scope.row.box_code" disabled class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="queryMater(4,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('box_description',crud.data,'木箱描述')" prop="box_description" label="木箱描述" />
<el-table-column show-overflow-tooltip prop="split_breadth" label="子卷幅宽" :min-width="flexWidth('split_breadth',crud.data,'子卷幅宽')">
<template scope="scope">
<el-input v-show="!scope.row.edit" v-model="scope.row.split_breadth" size="mini" />
<span v-show="scope.row.edit">{{ scope.row.split_breadth }}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="split_height" label="子卷理论长度" :min-width="flexWidth('split_height',crud.data,'子卷理论长度')">
<template scope="scope">
<el-input v-show="!scope.row.edit" v-model="scope.row.split_height" size="mini" />
<span v-show="scope.row.edit">{{ scope.row.split_height }}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="split_weight" label="子卷理论长度" :min-width="flexWidth('split_weight',crud.data,'子卷理论重量')">
<template scope="scope">
<el-input v-show="!scope.row.edit" v-model="scope.row.split_weight" size="mini" />
<span v-show="scope.row.edit">{{ scope.row.split_weight }}</span>
</template>
</el-table-column>
<el-table-column v-if="crud.status.cu > 0" align="center" label="操作" width="120" 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" :mater-opt-code.sync="materType" @setMaterValue="setMaterValue" />
<CustomerDialog :dialog-show.sync="customShow" :mater-opt-code.sync="customType" @setCustomValue="setCustomValue" />
<CutpointivtDialog :dialog-show.sync="cutpointivtShow" :mater-opt-code.sync="cutpointivtType" @setCutpointivtValue="setCutpointivtValue" />
</el-dialog>
</template>
<script>
import CRUD, { crud, form } from '@crud/crud'
import crudRawAssist from '@/views/wms/st/inbill/rawassist'
import crudUserStor from '@/views/wms/basedata/st/userStor/userStor'
import MaterDialog from '@/views/wms/pub/MaterDialog'
import CustomerDialog from '@/views/wms/pub/CustomerDialog'
import CutpointivtDialog from '@/views/wms/pub/CutpointivtDialog'
const defaultForm = {
order_type: null,
product_name: null,
description: null,
parent_container_name: null,
restruct_container_name: null,
ware_house: null,
resource_name: null,
split_group: null,
mfg_order_name: null,
manufacture_date: null,
remark: null,
qzzno: null,
customer_code: null,
customer_name: null,
show_edit: false,
tableData: [],
detail_count: '0'
}
export default {
name: 'AddDialog',
components: { MaterDialog, CustomerDialog, CutpointivtDialog },
mixins: [crud(), form(defaultForm)],
dicts: ['product_area', 'order_type', 'cut_product_status', 'ware_house', 'paper_tube_or_frp_type'],
props: {
dialogShow: {
type: Boolean,
default: false
},
bussConfig: {
type: Object
},
openParam: {
type: Object
}
},
data() {
return {
paper_type: '',
order_type_select: '',
groups: ['A', 'B', 'C', 'D', 'F'],
updowns: [{
value: '1',
label: '上轴'
}, {
value: '2',
label: '下轴'
}],
leftorrights: [{
value: '1',
label: '左卷'
}, {
value: '2',
label: '右卷'
}],
dialogVisible: false,
dtlShow: false,
opendtlParam: null,
bill_btn: false,
mater_btn: false,
storlist: [],
nowrow: {},
nowindex: '',
billtypelist: [],
materType: '',
customType: '',
cutpointivtType: '',
indexType: '',
materShow: false,
customShow: false,
cutpointivtShow: false,
rules: {
order_type: [
{ required: true, message: '订单类型不能为空', trigger: 'blur' }
]
}
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
}
}
},
methods: {
open() {
crudUserStor.getUserStor().then(res => {
this.storlist = res
})
},
close() {
this.$emit('AddChanged')
},
[CRUD.HOOK.afterToEdit]() {
// 获取入库单明细
crudRawAssist.getIODtl({ 'bill_code': this.form.bill_code }).then(res => {
this.form.tableData = res
// 将明细变成不可编辑
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
this.form.tableData.splice(i, 1, row)
}
})
},
[CRUD.HOOK.afterToAdd]() {
this.bill_btn = false
this.mater_btn = false
},
[CRUD.HOOK.afterToView]() {
this.bill_btn = true
this.mater_btn = true
crudRawAssist.getIODtl({ 'bill_code': this.form.bill_code }).then(res => {
this.form.tableData = res
// 将明细变成不可编辑
for (let i = 0; i < this.form.tableData.length; i++) {
const row = this.form.tableData[i]
this.form.tableData.splice(i, 1, row)
}
})
},
[CRUD.HOOK.beforeSubmit]() {
// 提交前校验
if (this.form.tableData.length === 0) {
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
},
billTypeChange(val) {
if (val === '000101') {
this.bill_btn = false
this.mater_btn = true
} else if (val === '000102') {
this.bill_btn = true
this.mater_btn = false
} else {
this.bill_btn = true
this.mater_btn = true
}
this.form.tableData = []
this.form.total_qty = 0
this.form.detail_count = 0
},
tableChanged2(row) {
// 新增一行物料时,给行进行赋值
this.nowrow.material_code = row.material_code
this.nowrow.material_id = row.material_id
this.nowrow.material_name = row.material_name
this.nowrow.qty_unit_id = row.base_unit_id
this.nowrow.qty_unit_name = row.unit_name
this.form.tableData.splice(this.nowindex, 1, this.nowrow) // 通过splice 替换数据 触发视图更新
},
fun(val) {
return Number(val).toFixed(3)
},
// async queryMater(index, row) {
// checkoutbill.paramByCodeType({ 'bill_type': this.form.bill_type, 'io_flag': '00' }).then(res => {
// this.materType = res.materType
// this.materShow = true
// this.nowindex = index
// this.nowrow = row
// })
// },
hand() {
this.crud.toQuery()
},
hand1(val) {
this.order_type_select = val
},
hand2(val) {
this.paper_type = val
},
async queryMater(index1, index, row) {
this.indexType = index1
this.materShow = true
this.nowindex = index
this.nowrow = row
// 7019FRP管4822纸管4415木箱7410产品
if (index1 === 1) {
this.materType = '7410'
} else if (index1 === 2) {
this.materType = '4822'
} else if (index1 === 3) {
this.materType = '7019'
} else if (index1 === 4) {
this.materType = '4415'
}
},
async queryCustomer() {
this.customShow = true
},
async queryCutpointivt() {
this.cutpointivtShow = true
},
async insertdtl() {
this.form.tableData.push({ container_name: '', paper_tube_or_frp: '', paper_tube_material: '', paper_tube_description: '', paper_tube_model: '', frp_material: '', frp_description: '', frp_model: '', up_or_down: '', left_or_right: '', box_code: '', box_description: '', box_model: '', split_length: '', split_breadth: '', split_weight: '', edit: false })
this.form.detail_count = this.form.tableData.length
},
tube_or_FRP1() {
if (this.paper_type === '1') {
return false
} else {
return true
}
},
tube_or_FRP2() {
if (this.paper_type === '2') {
return false
} else {
return true
}
},
reform_or_normal1() {
if (this.order_type_select === '1') {
return false
} else {
return true
}
},
reform_or_normal2() {
if (this.order_type_select === '2') {
return false
} else {
return true
}
},
setMaterValue(row) {
if (this.indexType === 1) {
this.form.product_name = row.material_code
this.form.description = row.material_name
} else if (this.indexType === 2) {
this.nowrow.paper_tube_material = row.material_code
this.nowrow.paper_tube_description = row.material_name
this.nowrow.paper_tube_model = row.material_name
} else if (this.indexType === 3) {
this.nowrow.frp_material = row.material_code
this.nowrow.frp_description = row.material_name
this.nowrow.frp_model = row.material_name
} else if (this.indexType === 4) {
this.nowrow.box_code = row.material_code
this.nowrow.box_description = row.material_name
}
this.nowrow.edit = false
this.form.tableData.splice(this.nowindex, 1, this.nowrow) // 通过splice 替换数据 触发视图更新
},
setCustomValue(row) {
this.form.customer_code = row.cust_code
this.form.customer_name = row.cust_name
},
setCutpointivtValue(row) {
this.form.resource_name = row.ext_code
},
deleteRow(index, rows) {
const container_name = rows[index].container_name
let len = rows.length
while (len--) {
const obj = rows[len]
if (container_name === obj.container_name) {
const index = rows.indexOf(obj)
if (index > -1) { // 移除找到的指定元素
rows.splice(index, 1)
this.form.detail_count = this.form.tableData.length
}
}
}
},
tableChanged(rows) {
debugger
// 对新增的行进行校验不能存在相同物料批次
rows.forEach((item) => {
let same_mater = true
this.form.tableData.forEach((row) => {
if (row.container_name === item.container_name) {
same_mater = false
}
})
if (same_mater) {
item.quality_scode = '01'
item.ivt_level = '01'
item.is_active = '1'
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(item.plan_qty)
this.form.tableData.splice(-1, 0, item)
}
})
this.form.detail_count = this.form.tableData.length
},
async insertEvent(row) {
if (this.form.bill_type === '') {
this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
this.opendtlParam = {
optType: 'add'
}
this.dtlShow = true
}
}
}
</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

@@ -333,296 +333,6 @@
</el-button>
</crudOperation>
<!--表单组件-->
<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="150px">
<el-row>
<el-col :span="12">
<el-form-item label="订单类型" prop="order_type">
<el-select
v-model="form.order_type"
clearable
size="mini"
placeholder="请选择"
class="filter-item"
style="width: 370px"
@change="hand1"
>
<el-option
v-for="item in dict.order_type"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="子卷号" prop="container_name">
<el-input v-model="form.container_name" style="width: 370px;" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="产品编码" prop="product_name">
<el-input v-model="form.product_name" disabled class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="queryMater(1)" />
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="产品描述" prop="description">
<el-input v-model="form.description" disabled style="width: 370px;" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="来源母卷号" prop="parent_container_name">
<el-input v-model="form.parent_container_name" :disabled="reform_or_normal1()" style="width: 370px;" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="改制来源子卷号" prop="restruct_container_name">
<el-input v-model="form.restruct_container_name" :disabled="reform_or_normal2()" style="width: 370px;" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="子卷立库木箱号" prop="package_box_sn">
<el-input v-model="form.package_box_sn" style="width: 370px;" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="来源卷位置" prop="ware_house">
<el-select
v-model="form.ware_house"
clearable
size="mini"
placeholder="请选择"
class="filter-item"
style="width: 370px"
@change="hand"
>
<el-option
v-for="item in dict.ware_house"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="分切机台编码" prop="resource_name">
<el-select
v-model="form.resource_name"
clearable
size="mini"
placeholder="请选择"
class="filter-item"
style="width: 370px"
@change="hand"
>
<el-option
v-for="item in resourceList"
:label="item"
:value="item"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="分切组" prop="split_group">
<el-select
v-model="form.split_group"
clearable
size="mini"
placeholder="请选择"
class="filter-item"
style="width: 370px"
@change="hand"
>
<el-option
v-for="item in groups"
:label="item"
:value="item"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="批次号" prop="pscn">
<el-input v-model="form.pscn" style="width: 370px;" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="生产订单" prop="mfg_order_name">
<el-input v-model="form.mfg_order_name" style="width: 370px;" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="生产日期" prop="manufacture_date">
<el-date-picker
v-model="form.manufacture_date"
style="width: 370px;"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="管件类型" prop="paper_tube_or_frp">
<el-select
v-model="form.paper_tube_or_frp"
clearable
size="mini"
placeholder="请选择"
class="filter-item"
style="width: 370px"
@change="hand2"
>
<el-option
v-for="item in dict.paper_tube_or_frp_type"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="纸筒物料编码" prop="paper_tube_material">
<el-input v-model="form.paper_tube_material" disabled class="input-with-select" style="width: 370px;">
<el-button slot="append" :disabled="tube_or_FRP1()" icon="el-icon-search" @click="queryMater(2)" />
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="纸筒物料描述" prop="paper_tube_description">
<el-input v-model="form.paper_tube_description" disabled style="width: 370px;" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="纸筒规格" prop="paper_tube_model">
<el-input v-model="form.paper_tube_model" disabled style="width: 370px;" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="FRP管物料编码" prop="frp_material">
<el-input v-model="form.frp_material" disabled class="input-with-select" style="width: 370px;">
<el-button slot="append" :disabled="tube_or_FRP2()" icon="el-icon-search" @click="queryMater(3)" />
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="FRP管物料描述" prop="frp_description">
<el-input v-model="form.frp_description" disabled style="width: 370px;" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="FRP管规格" prop="frp_model">
<el-input v-model="form.frp_model" disabled style="width: 370px;" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="子卷幅宽" prop="split_breadth">
<el-input v-model="form.split_breadth" style="width: 370px;" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="子卷理论长度" prop="split_height">
<el-input v-model="form.split_height" style="width: 370px;" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="木箱物料编码" prop="box_code">
<el-input v-model="form.box_code" disabled class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="queryMater(4)" />
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="木箱描述" prop="box_description">
<el-input v-model="form.box_description" disabled style="width: 370px;" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="上轴下轴" prop="up_or_down">
<el-select
v-model="form.up_or_down"
clearable
size="mini"
placeholder="请选择"
class="filter-item"
style="width: 370px"
@change="hand"
>
<el-option
v-for="item in updowns"
: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="left_or_right">
<el-select
v-model="form.left_or_right"
clearable
size="mini"
placeholder="请选择"
class="filter-item"
style="width: 370px"
@change="hand"
>
<el-option
v-for="item in leftorrights"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="子卷理论重量" prop="split_weight">
<el-input v-model="form.split_weight" style="width: 370px;" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="销售订单及行号" prop="sale_order_name">
<el-input v-model="form.sale_order_name" style="width: 370px;" />
</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"
@@ -683,7 +393,7 @@
<el-table-column prop="frp_model" label="FRP管规格" min-width="140" show-overflow-tooltip />
<el-table-column prop="box_code" label="木箱物料编码" min-width="140" show-overflow-tooltip />
<el-table-column prop="box_description" label="木箱描述" min-width="140" show-overflow-tooltip />
<el-table-column prop="pscn" label="批次号" min-width="140" show-overflow-tooltip />
<el-table-column prop="pscn" label="SAP批次号" min-width="140" show-overflow-tooltip />
<el-table-column prop="is_parent_ok" label="母卷上料完成" width="100px" :formatter="formatParentName" />
<el-table-column prop="is_child_tz_ok" label="子卷套轴完成" width="100px" :formatter="formatChildName" />
<el-table-column prop="is_child_ps_ok" label="子卷配送完成" width="100px" :formatter="formatChildPsName" />
@@ -715,8 +425,11 @@
<!--分页组件-->
<pagination />
</div>
<AddDialog @AddChanged="querytable" />
<tube-dialog2 :dialog-show.sync="showView2" :rowmst="mstrow" @AddChanged="querytable" />
<MaterDialog :dialog-show.sync="materShow" :mater-opt-code.sync="materType" @setMaterValue="setMaterValue" />
<CustomerDialog :dialog-show.sync="customShow" :mater-opt-code.sync="customType" @setCustomValue="setCustomValue" />
<CutpointivtDialog :dialog-show.sync="cutpointivtShow" :mater-opt-code.sync="cutpointivtType" @setCutpointivtValue="setCutpointivtValue" />
</div>
</template>
@@ -729,7 +442,10 @@ import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
import TubeDialog2 from '@/views/wms/pdm/order/slittingplan/tubeDialog2.vue'
import MaterDialog from '@/views/wms/pub/MaterDialog'
import CustomerDialog from '@/views/wms/pub/CustomerDialog'
import CutpointivtDialog from '@/views/wms/pub/CutpointivtDialog'
import cutSbpointivt from '@/views/wms/pdm/ivt/cutpointivt/cutpointivt'
import AddDialog from '@/views/wms/pdm/order/slittingplan/AddDialog'
const defaultForm = {
workorder_id: null,
@@ -780,6 +496,8 @@ const defaultForm = {
box_code: null,
box_description: null,
pscn: null,
customer_code: null,
customer_name: null,
joint_type: null,
paper_weight: null,
show_edit: false
@@ -787,7 +505,7 @@ const defaultForm = {
export default {
name: 'Slittingproductionplan',
dicts: ['product_area', 'order_type', 'cut_product_status', 'ware_house', 'paper_tube_or_frp_type', 'IS_OR_NOT'],
components: { pagination, crudOperation, rrOperation, udOperation, TubeDialog2, MaterDialog },
components: { pagination, crudOperation, rrOperation, udOperation, TubeDialog2, MaterDialog, CustomerDialog, CutpointivtDialog, AddDialog },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({
@@ -829,8 +547,12 @@ export default {
label: '右卷'
}],
materType: '',
customType: '',
cutpointivtType: '',
indexType: '',
materShow: false,
customShow: false,
cutpointivtShow: false,
rules: {
order_type: [
{ required: true, message: '分切订单类型不能为空', trigger: 'blur' }
@@ -880,9 +602,6 @@ export default {
box_description: [
{ required: true, message: '木箱描述不能为空', trigger: 'blur' }
],
pscn: [
{ required: true, message: '批次号不能为空', trigger: 'blur' }
],
manufacture_date: [
{ required: true, message: '生产日期不能为空', trigger: 'blur' }
],
@@ -929,6 +648,12 @@ export default {
this.materType = '4415'
}
},
async queryCustomer() {
this.customShow = true
},
async queryCutpointivt() {
this.cutpointivtShow = true
},
querytable() {
this.$refs.table.clearSelection()
this.crud.toQuery()
@@ -988,6 +713,13 @@ export default {
this.form.box_description = row.material_name
}
},
setCustomValue(row) {
this.form.customer_code = row.cust_code
this.form.customer_name = row.cust_name
},
setCutpointivtValue(row) {
this.form.resource_name = row.ext_code
},
caseFinish() {
const _selectData = this.$refs.table.selection
const data = {

View 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="cust_code" label="客户编码" min-width="150" show-overflow-tooltip />
<el-table-column prop="cust_name" label="客户名称" min-width="200" show-overflow-tooltip />
<el-table-column prop="cust_simple_name" label="客户简称" show-overflow-tooltip />
<el-table-column prop="corp_address" label="公司地址" show-overflow-tooltip />
<el-table-column prop="faxnumber" label="公司电话" show-overflow-tooltip />
</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 crudCustomerbase from '@/views/wms/basedata/master/customer/customerbase'
import CRUD, { header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
export default {
name: 'CustomerDtl',
components: { rrOperation, pagination },
cruds() {
return CRUD({ title: '客户', url: 'api/customerbase', crudMethod: { ...crudCustomerbase }, 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: {
clickChange(item) {
this.tableRadio = item
},
seriesFormat(row) {
return this.dict.label.product_series[row.product_series]
},
open() {
this.crud.query.material_type_id = this.materOptCode
this.crud.toQuery()
},
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('setCustomValue', 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('setCustomValue', this.rows)
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 0px;
}
</style>

View File

@@ -0,0 +1,182 @@
<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="point_code" label="点位编码" width="100px" show-overflow-tooltip />
<el-table-column prop="full_point_code" label="满轴位" width="110px" show-overflow-tooltip />
<el-table-column prop="full_point_status" label="满轴位状态" min-width="100" show-overflow-tooltip>
<template slot-scope="scope">
{{ dict.label.sch_full_point_status[scope.row.full_point_status] }}
</template>
</el-table-column>
<el-table-column prop="container_name" label="母卷号" width="150px" show-overflow-tooltip />
<el-table-column prop="empty_point_status" label="空轴位状态" min-width="100" show-overflow-tooltip>
<template slot-scope="scope">
{{ dict.label.sch_empty_point_status[scope.row.empty_point_status] }}
</template>
</el-table-column>
<el-table-column prop="empty_vehicle_code" label="空轴编码" width="120px" show-overflow-tooltip />
<el-table-column prop="up_qzzno" label="上气胀轴编码" width="100px" show-overflow-tooltip />
<el-table-column prop="down_qzzno" label="下气胀轴编码" width="100px" show-overflow-tooltip />
<el-table-column prop="ext_code" label="外部编码" width="100px" show-overflow-tooltip />
<el-table-column prop="product_area" label="生产区域" />
<el-table-column prop="point_location" label="位置">
<template slot-scope="scope">
{{ dict.label.point_location[scope.row.point_location] }}
</template>
</el-table-column>
<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>
<!--分页组件-->
<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 crudCutpointivt from '@/views/wms/pdm/ivt/cutpointivt/cutpointivt'
import CRUD, { header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
export default {
name: 'CutpointivtDtl',
components: { rrOperation, pagination },
cruds() {
return CRUD({ title: '分切设备', url: 'api/cutpointivt', crudMethod: { ...crudCutpointivt }, optShow: {}})
},
mixins: [presenter(), header()],
dicts: ['sch_full_point_status', 'sch_empty_point_status', 'product_area', 'is_used', 'point_location'],
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: {
clickChange(item) {
this.tableRadio = item
},
seriesFormat(row) {
return this.dict.label.product_series[row.product_series]
},
open() {
this.crud.query.material_type_id = this.materOptCode
this.crud.toQuery()
},
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('setCutpointivtValue', 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('setCutpointivtValue', this.rows)
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 0px;
}
</style>

View File

@@ -0,0 +1,191 @@
<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="point_code" label="点位编码" />
<el-table-column prop="vehicle_code" label="载具编码" />
<el-table-column prop="full_point_code" label="满轴位" :min-width="flexWidth('full_point_code',crud.data,'满轴位')" />
<el-table-column prop="full_point_status" label="满轴位状态" min-width="100" show-overflow-tooltip>
<template slot-scope="scope">
{{ dict.label.sch_full_point_status[scope.row.full_point_status] }}
</template>
</el-table-column>
<el-table-column prop="empty_point_code" label="空轴位" :min-width="flexWidth('empty_point_code',crud.data,'空轴位')" />
<el-table-column prop="empty_point_status" label="空轴位状态" min-width="100" show-overflow-tooltip>
<template slot-scope="scope">
{{ dict.label.sch_empty_point_status[scope.row.empty_point_status] }}
</template>
</el-table-column>
<el-table-column prop="product_area" label="生产区域">
<template slot-scope="scope">
{{ dict.label.product_area[scope.row.product_area] }}
</template>
</el-table-column>
<el-table-column prop="point_location" label="位置">
<template slot-scope="scope">
{{ dict.label.point_location[scope.row.point_location] }}
</template>
</el-table-column>
<el-table-column prop="ext_code" label="外部编码" />
<el-table-column prop="remark" label="备注" />
<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="mes_used" label="MES启用">
<template slot-scope="scope">
{{ dict.label.is_used[scope.row.mes_used] }}
</template>
</el-table-column>
<el-table-column prop="update_time" label="修改时间" min-width="150" show-overflow-tooltip />
</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 crudSbpointivt from '@/views/wms/pdm/ivt/sbpointivt/sbpointivt'
import CRUD, { header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
export default {
name: 'SbpointivtDtl',
components: { rrOperation, pagination },
cruds() {
return CRUD({ title: '机台编码', url: 'api/sbpointivt', crudMethod: { ...crudSbpointivt }, optShow: {}})
},
mixins: [presenter(), header()],
dicts: ['product_series', 'product_area', 'is_used', 'point_location', 'sch_full_point_status', 'sch_empty_point_status'],
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: {
clickChange(item) {
this.tableRadio = item
},
seriesFormat(row) {
return this.dict.label.product_series[row.product_series]
},
open() {
this.crud.query.material_type_id = this.materOptCode
this.crud.toQuery()
},
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('setSbpointivtValue', 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('setSbpointivtValue', this.rows)
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 0px;
}
</style>