@ -1,183 +1,184 @@
< template >
< el -dialog
title = "物料选择"
append - to - body
: visible . sync = "dialogVisible"
destroy - on - close
width = "1000px"
@ close = "close"
@ open = "open"
< 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
: inline = "true"
class = "demo-form-inline"
label - position = "right"
label - width = "80px"
label - suffix = ":"
>
< el -form -item label = "物料编码" >
< el -input
v - model = "query.productname"
clearable
size = "mini"
placeholder = "物料编码"
disabled = "false"
@ keyup . enter . native = "crud.toQuery"
/ >
< / e l - f o r m - i t e m >
< el -form -item label = "工单号" >
< el -input
v - model = "query.workorder_code"
clearable
size = "mini"
placeholder = "工单号"
disabled = "false"
@ keyup . enter . native = "crud.toQuery"
/ >
< / e l - f o r m - i t e m >
< rrOperation / >
< / e l - f o r m >
< el -form -item label = "物料编码" >
< el -input
v - model = "query.productname"
clearable
size = "mini"
placeholder = "物料编码"
disabled = "false"
@ keyup . enter . native = "crud.toQuery"
/ >
< / e l - f o r m - i t e m >
< el -form -item label = "工单号" >
< el -input
v - model = "query.workorder_code"
clearable
size = "mini"
placeholder = "工单号"
disabled = "false"
@ keyup . enter . native = "crud.toQuery"
/ >
< / e l - f o r m - i t e m >
< rrOperation / >
< / e l - f o r m >
<!-- 表格渲染 -- >
< el -table
ref = "table"
v - loading = "crud.loading"
: data = "crud.data"
style = "width: 100%;"
size = "mini"
border
: cell - style = "{'text-align':'center'}"
: header - cell - style = "{background:'#f5f7fa',color:'#606266','text-align':'center'}"
@ selection - change = "crud.selectionChangeHandler"
>
< el -table -column type = "selection" width = "55" / >
< el -table -column prop = "point_code" label = "所在点位" width = "120px" / >
< el -table -column prop = "productName" label = "物料编码" / >
< el -table -column prop = "palletSN" label = "子托盘号" min -width = " 120 " show -overflow -tooltip / >
< el -table -column prop = "qty" label = "数量" width = "100" show -overflow -tooltip / >
< / e l - t a b l e >
<!-- 分页组件 -- >
< pagination / >
<!-- < span slot = "footer" class = "dialog-footer" >
<!-- 表格渲染 -- >
< el -table
ref = "table"
v - loading = "crud.loading"
: data = "crud.data"
style = "width: 100%;"
size = "mini"
border
: cell - style = "{'text-align':'center'}"
: header - cell - style = "{background:'#f5f7fa',color:'#606266','text-align':'center'}"
@ selection - change = "crud.selectionChangeHandler"
>
< el -table -column type = "selection" width = "55" / >
< el -table -column prop = "point_code" label = "所在点位" width = "120px" / >
< el -table -column prop = "productName" label = "物料编码" / >
< el -table -column prop = "palletSN" label = "子托盘号" min -width = " 120 " show -overflow -tooltip / >
< el -table -column prop = "qty" label = "数量" width = "100" show -overflow -tooltip / >
< / e l - t a b l e >
<!-- 分页组件 -- >
< pagination / >
<!-- < span slot = "footer" class = "dialog-footer" >
< el -button @ click = "dialogVisible = false" > 取 消 < / e l - b u t t o n >
< el -button type = "primary" @click ="submit" > 确 定 < / el -button >
< / span > -- >
< el -button
< el -button
type = "primary"
@ click = "submitSelectedRows" >
@ click = "submitSelectedRows"
>
原材料出库
< / e l - b u t t o n >
< / e l - d i a l o g >
< / template >
< / e l - d i a l o g >
< / template >
< script >
< script >
import CRUD , { header , presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import CRUD , { header , presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { mount } from 'sortablejs'
export default {
name : 'WorkOrderDetailDialog' ,
components : { rrOperation , pagination } ,
dicts : [ 'is_used' , 'vehicle_type' ] ,
cruds ( ) {
return CRUD ( { title : '点位详情' , url : 'api/pointDetail' , optShow : { } } )
export default {
name : 'WorkOrderDetailDialog' ,
components : { rrOperation , pagination } ,
dicts : [ 'is_used' , 'vehicle_type' ] ,
cruds ( ) {
return CRUD ( { title : '点位详情' , url : 'api/pointDetail' , optShow : { } } )
} ,
mixins : [ presenter ( ) , header ( ) ] ,
props : {
dialogShow : {
type : Boolean ,
default : false
} ,
mixins : [ presenter ( ) , header ( ) ] ,
props : {
dialogShow : {
type : Boolean ,
default : false
} ,
isSingle : {
type : Boolean ,
default : false
} ,
productname : {
isSingle : {
type : Boolean ,
default : false
} ,
productname : {
type : String ,
default : ''
} , workorder_c ode: {
} , workorderCode : {
type : String ,
default : ''
}
} ,
data ( ) {
return {
dialogVisible : false ,
tableRadio : null ,
tableData : [ ]
} ,
data ( ) {
return {
dialogVisible : false ,
tableRadio : null ,
tableData : [ ]
}
} ,
watch : {
dialogShow : {
handler ( newValue ) {
this . dialogVisible = newValue
}
} ,
watch : {
dialogShow : {
handler ( newValue ) {
this . dialogVisible = newValue
}
} ,
productname ( newVal ) {
productname ( newVal ) {
/ / 监 听 传 递 的 值 变 化 , 并 在 变 化 时 执 行 赋 值 操 作
this . query . productname = newVal ;
this . executeQuery ( ) ;
this . query . productname = newVal
this . executeQuery ( )
} ,
workorder_code ( newVal ) {
/ / 监 听 传 递 的 值 变 化 , 并 在 变 化 时 执 行 赋 值 操 作
this . query . workorder_code = newVal
this . workorder_code = newVal ;
this . query . workorder_code = newVal
this . workorder_code = newVal
}
} ,
methods : {
clickChange ( item ) {
this . tableRadio = item
} ,
methods : {
clickChange ( item ) {
this . tableRadio = item
} ,
open ( ) {
open ( ) {
} ,
handleSelectionChange ( val , row ) {
if ( val . length > 1 ) {
this . $refs . table . clearSelection ( )
this . $refs . table . toggleRowSelection ( val . pop ( ) )
} else {
this . checkrow = row
}
} ,
onSelectAll ( ) {
} ,
handleSelectionChange ( val , row ) {
if ( val . length > 1 ) {
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 ( 'tableChanged' , this . tableRadio )
return
}
this . rows = this . $refs . table . selection
if ( this . rows . length <= 0 ) {
this . $message ( '请先勾选物料' )
return
}
this . crud . resetQuery ( false )
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 ( 'tableChanged' , this . rows )
} , executeQuery ( ) {
this . crud . toQuery ( ) ;
} , submitSelectedRows ( ) {
const selectedRows = this . $refs . table . selection ;
this . $emit ( 'tableChanged' , 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 ( 'tableChanged' , this . rows )
} , executeQuery ( ) {
this . crud . toQuery ( )
} , submitSelectedRows ( ) {
const selectedRows = this . $refs . table . selection
if ( selectedRows . length === 0 ) {
this . $message . error ( '请至少选择一行数据' ) ;
return ;
this . $message . error ( '请至少选择一行数据' )
return
}
/ / 获 取 选 中 行 的 p o i n t _ c o d e
const pointCodes = selectedRows . map ( row => row . point_code ) ;
/ / 获 取 选 中 行 的 p o i n t _ c o d e
const pointCodes = selectedRows . map ( row => row . point_code )
/ / 弹 出 输 入 回 温 时 间 和 回 温 模 式 的 对 话 框
this . $prompt ( '请输入回温时间' , '提示' , {
/ / 弹 出 输 入 回 温 时 间 和 回 温 模 式 的 对 话 框
this . $prompt ( '请输入回温时间' , '提示' , {
confirmButtonText : '确定' ,
cancelButtonText : '取消' ,
inputPattern : /\d+/ ,
@ -195,36 +196,35 @@ import { mount } from 'sortablejs'
workorder_code : this . workorder_code / / 使 用 w o r k o r d e r _ c o d e 属 性
} ) . then ( response => {
/ / 提 交 成 功 处 理
this . $message . success ( '提交成功!' ) ;
this . $message . success ( '提交成功!' )
/ / 关 闭 当 前 对 话 框
this . dialogVisible = false ;
this . dialogVisible = false
} ) . catch ( error => {
/ / 提 交 失 败 处 理
this . $message . error ( '提交失败,请重试' ) ;
} ) ;
this . $message . error ( '提交失败,请重试' )
} )
} ) . catch ( ( ) => {
/ / 用 户 点 击 了 取 消 按 钮
this . $message ( {
type : 'info' ,
message : '已取消提交操作'
} ) ;
} ) ;
} )
} )
} ) . catch ( ( ) => {
/ / 用 户 点 击 了 取 消 按 钮
this . $message ( {
type : 'info' ,
message : '已取消提交操作'
} ) ;
} ) ;
} )
} )
}
}
}
< / script >
}
< / script >
< style rel = "stylesheet/scss" lang = "scss" scoped >
: : v - deep . el - dialog__body {
padding - top : 0 px ;
}
< / style >