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