428 lines
17 KiB
Vue
428 lines
17 KiB
Vue
<template>
|
||
<div class="app-container">
|
||
<!--工具栏-->
|
||
<div class="head-container">
|
||
<!-- <el-input v-model="query.itemCode" clearable placeholder="物料代码" style="width: 140px;" class="filter-item" @keyup.enter.native="crud.toQuery" />-->
|
||
<el-select v-model="query.itemCode" placeholder="物料编码" clearable filterable style="width: 140px;" class="filter-item">
|
||
<el-option
|
||
@keyup.enter.native="crud.toQuery"
|
||
v-for="item in itemListData"
|
||
:key="item.code"
|
||
:label="item.code"
|
||
:value="item.code">
|
||
<span style="float: left">{{ item.code }}</span>
|
||
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</span>
|
||
</el-option>
|
||
</el-select>
|
||
<el-input v-model="query.itemName" clearable placeholder="物料名称" style="width: 140px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||
<el-select
|
||
v-model="query.taskStatus"
|
||
clearable
|
||
size="small"
|
||
placeholder="任务状态"
|
||
class="filter-item"
|
||
style="width: 100px"
|
||
@change="crud.toQuery"
|
||
>
|
||
<el-option
|
||
v-for="item in dict.asn_task_status"
|
||
:key="item.id"
|
||
:label="item.label"
|
||
:value="item.value"
|
||
/>
|
||
</el-select>
|
||
<el-input v-model="query.srcPointCode" clearable placeholder="原点位" style="width: 140px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||
<el-input v-model="query.dstPointCode" clearable placeholder="目标点位" style="width: 140px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||
<date-range-picker v-if="crud.props.searchToggle" start-placeholder="创建日期" v-model="query.createTime" class="date-item" style="width: 100px" />
|
||
<rrOperation :crud="crud" />
|
||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||
<crudOperation :permission="permission" :tableKey="this.$options.name">
|
||
<el-button
|
||
v-permission="permission.rgAsn"
|
||
slot="right"
|
||
class="filter-item"
|
||
type="primary"
|
||
size="mini"
|
||
icon="el-icon-document-add"
|
||
v-show="true"
|
||
@click="ManualReceivingFlag=true;AsnType='STORAGE';agvFlag=0;fromManualReceiving={}"
|
||
>
|
||
人工入库
|
||
</el-button>
|
||
<el-button
|
||
v-permission="permission.agvAsn"
|
||
slot="right"
|
||
class="filter-item"
|
||
type="primary"
|
||
size="mini"
|
||
icon="el-icon-document-add"
|
||
v-show="true"
|
||
@click="ManualReceivingFlag=true;AsnType='BOX';agvFlag=1"
|
||
>
|
||
AGV入库
|
||
</el-button>
|
||
<el-button
|
||
v-permission="permission.agvStockAsn"
|
||
slot="right"
|
||
class="filter-item"
|
||
type="primary"
|
||
size="mini"
|
||
icon="el-icon-document-add"
|
||
v-show="true"
|
||
@click="fromSTAgvReceiving=true;AsnType='BOX';getPoints('LX');"
|
||
>
|
||
AGV搬运容器入场
|
||
</el-button>
|
||
<el-button
|
||
v-permission="permission.lxPutAway"
|
||
slot="right"
|
||
class="filter-item"
|
||
type="danger"
|
||
size="mini"
|
||
icon="el-icon-document-add"
|
||
v-show="true"
|
||
:disabled="crud.selections.length !== 1 || this.crud.selections[0].taskStatus!=='PUTAWAY'"
|
||
@click="putawaySync()"
|
||
>
|
||
料箱上架
|
||
</el-button>
|
||
</crudOperation>
|
||
<el-dialog title="AGV搬运容器入场" :visible.sync="fromSTAgvReceiving" width="400px">
|
||
<el-form ref="fromBack" :model="fromBack" :rules="ruleBack" size="small" label-width="80px">
|
||
<el-form-item label="容器类型" prop="storageType">
|
||
<el-select v-model="fromBack.storageType" value-key="id" filterable placeholder="请选择">
|
||
<el-option
|
||
v-for="item in storageTypes"
|
||
:key="item.id"
|
||
:label="item.name"
|
||
:value="item.code"
|
||
/>
|
||
</el-select>
|
||
</el-form-item>
|
||
<el-form-item label="起点库位" prop="point">
|
||
<el-select v-model="fromBack.poinId" clearable value-key="id" filterable placeholder="请选择">
|
||
<el-option
|
||
v-for="item in pointList"
|
||
:key="item.id"
|
||
:label="item.area.name+item.name"
|
||
:value="item.id"
|
||
/>
|
||
</el-select>
|
||
</el-form-item>
|
||
</el-form>
|
||
<div slot="footer" class="dialog-footer">
|
||
<el-button @click="fromSTAgvReceiving = false">取 消</el-button>
|
||
<el-button type="primary" @click="STAgvReceiving(fromBack.poinId)">确 定</el-button>
|
||
</div>
|
||
</el-dialog>
|
||
<el-dialog title="料箱上架" :visible.sync="fromSTputawayFlag" width="400px">
|
||
<el-form ref="fromBack" :model="fromSTputaway" :rules="ruleBack" size="small" label-width="80px">
|
||
<el-form-item label="目标库位" prop="point">
|
||
<el-select v-model="fromSTputaway.pointId" clearable value-key="id" filterable placeholder="请选择">
|
||
<el-option
|
||
v-for="item in pointList"
|
||
:key="item.id"
|
||
:label="item.area.name+item.name"
|
||
:value="item.id"
|
||
/>
|
||
</el-select>
|
||
</el-form-item>
|
||
</el-form>
|
||
<div slot="footer" class="dialog-footer">
|
||
<el-button @click="fromSTputawayFlag = false">取 消</el-button>
|
||
<el-button type="primary" @click="ButSTputaway()">确 定</el-button>
|
||
</div>
|
||
</el-dialog>
|
||
<!--表单组件-->
|
||
<el-dialog title="入库" :visible.sync="ManualReceivingFlag" width="600px">
|
||
<el-form ref="fromBack" :inline="true" :model="fromManualReceiving" :rules="rules" size="mini" label-width="120px">
|
||
<!-- <el-form-item label="容器类型" prop="storageType">
|
||
<el-select v-model="fromBack.storageType" value-key="id" filterable placeholder="请选择">
|
||
<el-option
|
||
v-for="item in storageTypes"
|
||
:key="item.id"
|
||
:label="item.name"
|
||
:value="item.code"
|
||
/>
|
||
</el-select>
|
||
</el-form-item>-->
|
||
<el-form-item label="RFID" prop="RFID">
|
||
<el-input v-model="fromManualReceiving.RFID" :rows="3" type="textarea" style="width: 350px;" @change="devan_rfid()"/>
|
||
</el-form-item>
|
||
<el-form-item label="登记单号" prop="relatedBill2">
|
||
<el-input v-model="fromManualReceiving.relatedBill2" :disabled="true" style="width: 200px;"/>
|
||
</el-form-item>
|
||
<el-form-item label="系统单号" prop="relatedBill1">
|
||
<el-input v-model="fromManualReceiving.relatedBill1" :disabled="true" style="width: 200px;"/>
|
||
</el-form-item>
|
||
<el-form-item label="sku" prop="sku">
|
||
<el-input v-model="fromManualReceiving.sku" :disabled="true" style="width: 330px;"/>
|
||
</el-form-item>
|
||
<el-form-item label="明细行数" prop="lineNo">
|
||
<el-input v-model="fromManualReceiving.lineNos" :disabled="true" style="width: 100px;"/>
|
||
</el-form-item>
|
||
<el-form-item label="剩余订单数量" prop="orderQty">
|
||
<el-input v-model="fromManualReceiving.orderQty" :disabled="true" style="width: 100px;"/>
|
||
</el-form-item>
|
||
<el-form-item label="收货数量" prop="receivedQty">
|
||
<el-input v-model="fromManualReceiving.receivedQty" :disabled="true" style="width: 330px;"/>
|
||
</el-form-item>
|
||
<el-form-item label="目标库位" prop="RFID">
|
||
<el-select v-model="fromManualReceiving.pointId" clearable value-key="id" filterable placeholder="请选择" style="width: 330px;">
|
||
<el-option
|
||
v-for="item in pointList"
|
||
:key="item.id"
|
||
:label="item.area.name+item.name"
|
||
:value="item.id"
|
||
/>
|
||
</el-select>
|
||
</el-form-item>
|
||
</el-form>
|
||
<div slot="footer" class="dialog-footer">
|
||
<el-button @click="ManualReceivingFlag = false;">取 消</el-button>
|
||
<el-button type="primary" @click="manualReceiving()">确 定</el-button>
|
||
</div>
|
||
</el-dialog>
|
||
<!--表格渲染-->
|
||
<el-table ref="table" border height="66vh" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||
<el-table-column type="selection" width="55"/>
|
||
<el-table-column prop="xh" type="index" :index="indexMethod" label="序号"/>
|
||
<el-table-column prop="id"label="ID"/>
|
||
<el-table-column :show-overflow-tooltip="true" prop="itemCode" label="物料编码">
|
||
<template slot-scope="scope">
|
||
<div>{{ scope.row.itemKey.item.code }}</div>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column :show-overflow-tooltip="true" prop="itemName" label="物料名称">
|
||
<template slot-scope="scope">
|
||
<div>{{ scope.row.itemKey.item.name }}</div>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column prop="agvStatus" label="任务状态">
|
||
<template slot-scope="scope">
|
||
<span v-if="dict.label.asn_task_status[scope.row.taskStatus] ==null">{{ scope.row.taskStatus }}</span>
|
||
<span v-if="scope.row.taskStatus !=null">{{ dict.label.asn_task_status[scope.row.taskStatus] }}</span>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column prop="srcPointCode" label="原点位">
|
||
<template slot-scope="scope">
|
||
<div v-if="scope.row.srcPoint !=null">{{ scope.row.srcPoint.code }}</div>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column prop="dstPointCode" label="目标点位">
|
||
<template slot-scope="scope">
|
||
<div v-if="scope.row.dstPoint !=null">{{ scope.row.dstPoint.code }}</div>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column prop="agvTask" label="AGV搬运任务">
|
||
<template slot-scope="scope">
|
||
<div v-if="scope.row.agvTask !=null">{{ scope.row.agvTask.id }}</div>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column prop="beSkip" label="是否AGV任务" />
|
||
<el-table-column prop="putCode" :show-overflow-tooltip="true" label="单品流水号" />
|
||
<el-table-column prop="planQty" label="计划数量" />
|
||
<el-table-column prop="moveQty" label="移位数量" />
|
||
<el-table-column prop="itemKey.propC1" label="批次号" />
|
||
<el-table-column prop="itemKey.propC2" label="字符" />
|
||
<el-table-column prop="itemKey.propC3" label="计划单号" />
|
||
<el-table-column prop="itemKey.propC4" label="厂家供货码" />
|
||
<el-table-column prop="itemKey.propC5" label="供货数量" />
|
||
<el-table-column prop="itemKey.propC6" :show-overflow-tooltip="true" label="流水号" />
|
||
<el-table-column prop="createBy" label="创建人" />
|
||
<el-table-column prop="createTime" label="创建时间" />
|
||
</el-table>
|
||
<!--分页组件-->
|
||
<div style="float: right;">
|
||
<pagination/>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
|
||
<script>
|
||
import crudTask, { devanRfid,butSTputaway } from '@/api/task'
|
||
import DonMessage from "@/utils/message";
|
||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||
import rrOperation from '@crud/RR.operation'
|
||
import crudOperation from '@crud/CRUD.operation'
|
||
import udOperation from '@crud/UD.operation'
|
||
import pagination from '@crud/Pagination'
|
||
import DateRangePicker from "@/components/DateRangePicker/index.vue";
|
||
import {getItemsList} from "@/api/item";
|
||
import pointUrl, {getPoints} from "@/api/point";
|
||
import {getStockTypes} from "@/api/stockType";
|
||
import {devan} from "@/api/inventory";
|
||
|
||
const defaultForm = { id: null, itemId: null,agvTask: null, itemKeyId: null, billCode: null, taskType: null, asnDetailId: null, moveDetailId: null, waveDetailId: null, pickDetailId: null, srcStockId: null, dstStockId: null, srcPoint: null, dstPoint: null, srcStockCode: null, dstStockCode: null, srcPointCode: null, dstPointCode: null, invStatus: null, taskStatus: null, beSkip: null, beBack: null, planQty: null, moveQty: null, putCode: null, invId: null, deptId: null, createBy: null, updateBy: null, createTime: null, updateTime: null }
|
||
export default {
|
||
name: 'Task',
|
||
components: {DateRangePicker, pagination, crudOperation, rrOperation, udOperation},
|
||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||
dicts: ['asn_task_status'],
|
||
cruds() {
|
||
return CRUD({
|
||
query: {taskType: ['FC_RK','SM_RK','RM_RK']},
|
||
title: '收货任务',
|
||
url: 'api/task',
|
||
idField: 'id',
|
||
sort: 'id,desc',
|
||
crudMethod: {...crudTask},
|
||
optShow: {
|
||
add: false,
|
||
edit: false,
|
||
del: true,
|
||
reset: true,
|
||
download: true
|
||
},
|
||
queryOnPresenterCreated: true
|
||
}
|
||
)
|
||
},
|
||
data() {
|
||
return {
|
||
fromSTputawayFlag:false,
|
||
fromSTputaway:{pointId:null},
|
||
fromSTAgvReceiving:false,
|
||
storageTypes:[],
|
||
fromBack: {storageType: null,ids:[]},
|
||
ManualReceivingFlag: false,
|
||
agvFlag: 0,
|
||
AsnType: 'STORAGE',
|
||
permission: {
|
||
add: ['admin', 'task:add'],
|
||
edit: ['admin', 'task:edit'],
|
||
del: ['admin', 'task:del'],
|
||
download: ['admin', 'task:download'],
|
||
agvAsn: ['admin', 'task:agvAsn'],
|
||
rgAsn: ['admin', 'task:rgAsn'],
|
||
agvStockAsn: ['admin', 'task:agvStockAsn'],
|
||
lxPutAway: ['admin', 'task:lxPutAway']
|
||
},
|
||
rules: {
|
||
RFID: [
|
||
{required: true, message: '必填', trigger: 'blur'}
|
||
],
|
||
},
|
||
ruleBack: {
|
||
storageType: [
|
||
{required: true, message: '必填', trigger: 'blur'}
|
||
],
|
||
point: [
|
||
{required: true, message: '必填', trigger: 'blur'}
|
||
],
|
||
},
|
||
queryTypeOptions: [
|
||
{key: 'itemCode', display_name: '物料代码'},
|
||
{key: 'itemName', display_name: '物料名称'},
|
||
{key: 'taskStatus', display_name: '任务状态'},
|
||
{ key: 'srcPointCode', display_name: '源点位编码' },
|
||
{ key: 'dstPointCode', display_name: '目标点位编码' }
|
||
],
|
||
itemListData: [],
|
||
pointList: [],
|
||
// 入库
|
||
fromManualReceiving:{ RFID:null,pointId:null }
|
||
}
|
||
},
|
||
mounted() {
|
||
// 初始化数据
|
||
this.itemDataGet();
|
||
this.getPoints(null);
|
||
this.getStorageTypes();
|
||
},
|
||
methods: {
|
||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||
[CRUD.HOOK.beforeRefresh]() {
|
||
return true
|
||
},
|
||
getStorageTypes() {
|
||
getStockTypes({ }).then(res => {
|
||
this.storageTypes= res.content.map(function(obj) {
|
||
if (obj.hasChildren) {
|
||
obj.children = null
|
||
}
|
||
return obj
|
||
})
|
||
})
|
||
},
|
||
//容器入场
|
||
STAgvReceiving(pointId) {
|
||
const ids = [];
|
||
ids.push(pointId)
|
||
this.fromBack.ids=ids;
|
||
crudTask.STAgvReceiving(this.fromBack).then(res => {
|
||
this.fromSTAgvReceiving = false;
|
||
this.crud.toQuery()
|
||
this.crud.notify("入场成功", CRUD.NOTIFICATION_TYPE.SUCCESS);
|
||
}).catch(e => {
|
||
this.crud.notify("入场失败", CRUD.NOTIFICATION_TYPE.ERROR);
|
||
})
|
||
},
|
||
indexMethod(index) {
|
||
return index * 1 + 1;
|
||
},
|
||
// 物料数据
|
||
itemDataGet() {
|
||
getItemsList().then(res => {
|
||
this.itemListData = res;
|
||
}).catch(e => {
|
||
this.$message({
|
||
showClose: true,
|
||
message: '物料加载失败',
|
||
type: 'error'
|
||
});
|
||
})
|
||
},
|
||
// 解析RFID码
|
||
devan_rfid() {
|
||
console.log("解析RFID码")
|
||
devanRfid(this.fromManualReceiving.RFID,'ASN').then(res => {
|
||
if (res.status === 200) {
|
||
this.fromManualReceiving = res.data
|
||
this.getPoints(res.data.billCode);
|
||
}
|
||
})
|
||
},
|
||
getPoints(areaCode) {
|
||
getPoints(areaCode+"",this.AsnType).then(res => {
|
||
this.pointList= res.map(function(obj) {
|
||
if (obj.hasChildren) {
|
||
obj.children = null
|
||
}
|
||
return obj
|
||
})
|
||
})
|
||
},
|
||
manualReceiving(){
|
||
this.fromManualReceiving.agvFlag=this.agvFlag
|
||
crudTask.manualReceiving(this.fromManualReceiving).then(res => {
|
||
this.crud.notify(res.message, res.status)
|
||
this.crud.toQuery()
|
||
this.fromManualReceiving={}
|
||
})
|
||
},
|
||
putawaySync(){
|
||
this.fromSTputawayFlag=true;
|
||
this.AsnType='STORAGE';
|
||
this.getPoints('LX');
|
||
this.pointList.push(this.crud.selections[0].dstPoint);
|
||
this.fromSTputaway.pointId=this.crud.selections[0].dstPoint.id
|
||
},
|
||
ButSTputaway(){
|
||
this.fromSTputaway.taskId=this.crud.selections[0].id;
|
||
butSTputaway(this.fromSTputaway).then(res => {
|
||
this.crud.notify(res.message, res.status)
|
||
this.crud.toQuery()
|
||
this.fromSTputawayFlag=false;
|
||
})
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style scoped>
|
||
|
||
</style>
|
||
|