<template>
|
<div class="entry-notes-info-block">
|
<s-table
|
ref="table"
|
:columns="columns"
|
:data="loadData"
|
:alert="true"
|
rowKey="tableRowKey"
|
:pageSize="queried.PageSize"
|
:pageSizeOptions="['5','10','20','30']"
|
:rowSelection="null">
|
<template class="table-operator" slot="operator" >
|
<span style="font-weight:bold;cursor:default;"><a style="cursor:default;">{{orderNo}}</a>单据详情</span>
|
</template>
|
<template slot="index" slot-scope="text,record,index">{{(queried.PageNo-1)*queried.PageSize+(index+1)}}</template>
|
<template slot="specSlots" slot-scope="text,record">
|
{{`${record.long}*${record.wide}*${record.high}`}}
|
</template>
|
<template slot="statusSlots" slot-scope="text,record">
|
<a-tag :color="text==='完成'?'#008000':(
|
text==='执行中'?'#1e90ff':(
|
text==='取消'?'#556b2f':(
|
text==='暂停'?'#8b0000':(
|
text==='撤回'?'#ff00ff':'gray'
|
)
|
)
|
)
|
)">{{text}}</a-tag>
|
</template>
|
<template slot="action" slot-scope="text,record">
|
<a @click="onOpenEntrance(record.id)">入库</a>
|
<a style="margin-left:10px;" :class="[record.isCancel!==1?'disabled':'']" @click="onCancel(record)">取消</a>
|
</template>
|
</s-table>
|
|
<entrance-select-modal :visible.sync="entranceVisible" :preferredPortList="preferredPortList" :did="entraceId" @callback="actionBack" />
|
</div>
|
</template>
|
|
<script>
|
import { STable } from '@/components'
|
import { FoamingRuKuOrderDetailPage, FoamingRuKuDetailCancel } from '@/api/modular/main/FoamingRuKuOrderManage'
|
import entranceSelectModal from './entranceSelectModal.vue'
|
const pagination = {PageNo:1,PageSize:5}
|
export default {
|
name:'entryNotesInfoBlock',
|
components:{STable,entranceSelectModal},
|
props:{
|
queryId:{
|
type:[Number,null],
|
default:null
|
},
|
orderNo:{
|
type:String,
|
default:''
|
},
|
preferredPortList:{
|
type:Array,
|
default:function(){
|
return []
|
}
|
}
|
},
|
data(){
|
return {
|
columns:[
|
{ title: '序号', key: 'index', width: 70, align:'center', fixed:"left", scopedSlots: { customRender: 'index' }},
|
{ title: '物料编号', align:'center', dataIndex: 'materialNo', key: 'materialNo' },
|
{ title: '批次', align:'center', dataIndex: 'batch', key: 'batch' },
|
{ title: '密度', align:'center', dataIndex: 'materialDensity', key: 'materialDensity', width: 80 },
|
{ title: '尺寸', align:'center', dataIndex: 'spec', scopedSlots: { customRender: 'specSlots' }, width: 150 },
|
{ title: '入库口', align:'center', dataIndex: 'preferredPort', key: 'preferredPort' },
|
{ title: '任务状态', align:'center', dataIndex: 'taskStatusName', scopedSlots: { customRender: 'statusSlots' }, width: 150 }
|
],
|
queried:{...pagination},
|
refreshKey:true,
|
entranceVisible:false,
|
entraceId:null
|
}
|
},
|
created(){
|
if (this.hasPerm('fp_rk_action')) {
|
this.columns.push({ title: '操作', align: 'center', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: 105 })
|
}
|
},
|
watch:{
|
queryId(newV,oldV){
|
if (newV!==oldV){
|
this.initData()
|
}
|
}
|
},
|
methods:{
|
initData(){
|
this.refreshKey = true
|
this.$refs.table.refresh()
|
},
|
loadData(parameter){
|
parameter.OrderId = this.queryId
|
if (this.queryId) {
|
if (this.refreshKey) {
|
parameter.pageNo = pagination.PageNo
|
parameter.pageSize = pagination.PageSize
|
}
|
this.refreshKey = false
|
this.queried.PageNo = parameter.pageNo
|
this.queried.PageSize = parameter.pageSize
|
return FoamingRuKuOrderDetailPage(parameter).then((res) => {
|
if (res.data.rows) {
|
res.data.rows = res.data.rows.map((item,index)=>{
|
item.tableRowKey = index
|
return item
|
})
|
}
|
return res.data
|
})
|
} else {
|
return new Promise((resolve,reject)=>{
|
resolve({
|
pageNo:pagination.PageNo,
|
pageSize:pagination.PageSize,
|
rows:[],
|
totalPage:0,
|
totalRows:0
|
})
|
})
|
}
|
},
|
onOpenEntrance(id){
|
this.entraceId = id
|
this.entranceVisible = true
|
},
|
actionBack(){
|
this.$refs.table.refresh()
|
},
|
onCancel(obj){
|
if (obj.isCancel!==1) return false
|
this.dealCancel(obj.id)
|
},
|
dealCancel(id){
|
this.$confirm({
|
title: '确定要进行取消操作吗?',
|
okText: '确定',
|
okType: 'danger',
|
cancelText: '取消',
|
onOk:()=>{
|
this.handleCancel(id,(f)=>{
|
if (f) {
|
this.$refs.table.refresh()
|
}
|
})
|
}
|
});
|
},
|
handleCancel(id,callback){
|
this.$loading.show()
|
FoamingRuKuDetailCancel(id).then(()=>{
|
this.$loading.hide()
|
callback(true)
|
}).catch(()=>{
|
this.$loading.hide()
|
callback(false)
|
})
|
}
|
}
|
}
|
</script>
|
|
<style lang="less" scoped>
|
.entry-notes-info-block{
|
padding-top: 8px;
|
}
|
</style>
|