Compare commits

..

No commits in common. "a53fa45c9a76ea414600a60ee545c445c0b74ca1" and "e336643b5adee206a3a0c01bb31fdea831d3cf8d" have entirely different histories.

3 changed files with 254 additions and 220 deletions

View File

@ -24,42 +24,53 @@
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd('DBRK')"
>刀柄入库
@click="handleAdd"
v-hasPermi="['wm:PLAN:add']"
>新增
</el-button>
<!-- <el-button-->
<!-- type="primary"-->
<!-- plain-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="knifeBackVisible=true"-->
<!-- >整刀回库-->
<!-- </el-button>-->
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd('DPRK')"
>刀片入库
</el-button>
<!-- <el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['wm:PLAN:edit']"-->
<!-- >修改-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['wm:PLAN:remove']"-->
<!-- >删除-->
<!-- </el-button>-->
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd('ZDHK')"
>整刀回库
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd('CDHK')"
>拆刀回库
</el-button>
</el-col>
<el-col :span="1.5">
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="handleExport"-->
<!-- v-hasPermi="['wm:PLAN:export']"-->
<!-- >导出-->
<!-- </el-button>-->
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -134,12 +145,19 @@
/>
<!-- 添加或修改入库计划对话框 -->
<el-dialog :title="dialogTitle" :visible.sync="open" width="50%" append-to-body :close-on-click-modal="false">
<!--状态为 1 已执行 则禁用表单-->
<div v-if="!isKnifeBack">
<el-dialog :title="title" :visible.sync="open" width="50%" append-to-body :close-on-click-modal="false">
<!--状态为1已执行 则禁用-->
<el-form ref="form" :model="form" :rules="rules" label-width="80px" inline :disabled="form.state === '1'">
<el-form-item label="计划编码" prop="planCode">
<el-input v-model="form.planCode" placeholder="请输入计划编码"></el-input>
</el-form-item>
<el-form-item label="入库类型" prop="planTypeId">
<el-select v-model="form.planTypeId" placeholder="请选择入库类型" @change="handlePlanTypeSelectChange">
<el-option :label="item.name" :value="item.typeId" v-for="item in inPlanTypeList"
:key="item.typeId"/>
</el-select>
</el-form-item>
<el-form-item label="源头单据" prop="relBillCode">
<el-input v-model="form.relBillCode" placeholder="请输入源头单据"></el-input>
</el-form-item>
@ -160,7 +178,7 @@
<div>
<el-table :data="wmsInPlanDetailsList" :row-class-name="rowWmsInPlanDetailsIndex"
@selection-change="handleWmsInPlanDetailsSelectionChange" ref="wmsInPlanDetails"
@current-change="handleWmsInPlanDetailsCurrentChange">
:highlight-current-row="isKnifeBack" @current-change="handleWmsInPlanDetailsCurrentChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="序号" align="center" prop="index" width="50"/>
<el-table-column label="物品" prop="materialId" width="170">
@ -180,18 +198,18 @@
<el-input v-model="scope.row.batch" plcaeholder="请输入批次"></el-input>
</template>
</el-table-column>
<!-- <el-table-column label="计划数量" prop="quantity" width="150">-->
<!-- <template slot-scope="scope">-->
<!-- <el-input v-model="scope.row.quantity" plcaeholder="请输入计划数量" type="number" :min="0"></el-input>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="计划数量" prop="quantity" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.quantity" plcaeholder="请输入计划数量" type="number" :min="0"></el-input>
</template>
</el-table-column>
<el-table-column label="入库数量" prop="quantityIn" width="150">
<template slot-scope="scope">
<el-input v-model="scope.row.quantityIn" plcaeholder="请输入入库数量" type="number" :min="0"
@change="handleQuantityIn($event,scope.row)"></el-input>
@change="handleQuantityIn($event,scope.row)" :disabled="isKnifeBack"></el-input>
</template>
</el-table-column>
<el-table-column label="库位" prop="cellId" width="190">
<el-table-column label="库位" prop="cellId" width="150">
<template slot-scope="scope">
<el-select v-model="scope.row.cellId" placeholder="请选择库位" filterable remote
:remote-method="getMdItemList" clearable>
@ -223,13 +241,14 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
<!-- 添加或修改入库计划对话框 整刀回库 -->
<wms-in-plan-knife-back-form-cmps v-if="knifeBackVisible" :data-form.sync="form" :visible.sync="knifeBackVisible"
@confirm="getList"
<div v-if="isKnifeBack">
<wms-in-plan-knife-back-form-cmps :data-form.sync="form" :visible.sync="open" @confirm="getList"
@planTypeSelectChange="handlePlanTypeSelectChange"
></wms-in-plan-knife-back-form-cmps>
</div>
</div>
</template>
@ -242,7 +261,6 @@ import {listArea} from "@/api/mes/wm/area"
import {addWmsInTask} from "@/api/mes/wm/wmsInTask"
import WmsInPlanDetailEntityTableCmps from "@/views/mes/wm/inPlan/wmsInPlanDetailEntityTableCmps.vue";
import WmsInPlanKnifeBackFormCmps from "@/views/mes/wm/inPlan/wmsInPlanKnifeBackFormCmps.vue";
import plan from "@/views/mes/cal/plan/index.vue";
//
const planCodeValidator = (rule, value, callback) => {
@ -289,7 +307,7 @@ export default {
//
areaList: [],
//
dialogTitle: "",
title: "",
//
open: false,
//
@ -342,7 +360,12 @@ export default {
}
};
},
computed: {},
computed: {
/** 控制弹窗类型 */
isKnifeBack() {
return this.form.planTypeId == 9 || this.form.planTypeId == 7 || this.form.planTypeId == 15;
}
},
created() {
this.getList();
},
@ -478,7 +501,6 @@ export default {
isDelete: null,
planCode: null,
planTypeId: null,
planTypeCode: null,
wmsInPlanDetailsList: []
};
this.wmsInPlanDetailsList = [];
@ -501,25 +523,10 @@ export default {
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd(planTypeCode) {
handleAdd() {
this.reset();
//
const filter = this.inPlanTypeList.filter(item => item.code === planTypeCode);
if (filter.length) {
this.form.planTypeId = filter[0].typeId;
this.form.planTypeCode = filter[0].code;
this.form.planTypeName = filter[0].name;
} else {
this.$message.error("系统错误,请联系管理员");
console.error("计划类型查找失败")
return;
}
if (planTypeCode === "DPRK") {
this.open = true;
} else {
this.knifeBackVisible = true;
}
this.dialogTitle = "新增" + filter[0].name;
this.title = "添加入库计划";
},
/** 执行按钮操作 */
async handleIssue(row) {
@ -554,7 +561,6 @@ export default {
materialId: planForm.materialId,
materialCode: material[0].itemCode,
planTypeId: planForm.planTypeId,
planTypeCode: planForm.planTypeCode,
//
planInStatus: 0,
// ID
@ -593,7 +599,7 @@ export default {
this.form = response.data;
this.wmsInPlanDetailsList = response.data.wmsInPlanDetailsList;
this.open = true;
this.dialogTitle = "修改入库计划";
this.title = "修改入库计划";
});
},
/** 提交按钮 */

View File

@ -40,7 +40,7 @@ export default {
},
computed: {
title() {
return (this.localDataForm.planId ? "修改" : "新增") + this.dataForm.planTypeName
return this.localDataForm.planId ? "修改入库计划" : "新增入库计划"
},
},
methods: {
@ -206,9 +206,21 @@ export default {
<el-form-item label="计划编码" prop="planCode">
<el-input v-model="localDataForm.planCode" placeholder="请输入计划编码"></el-input>
</el-form-item>
<el-form-item label="入库类型" prop="planTypeId">
<el-select v-model="localDataForm.planTypeId" placeholder="请选择入库类型" @change="handlePlanTypeSelectChange">
<el-option :label="item.name" :value="item.typeId" v-for="item in inPlanTypeList"
:key="item.typeId"/>
</el-select>
</el-form-item>
<el-form-item label="源头单据" prop="relBillCode">
<el-input v-model="localDataForm.relBillCode" placeholder="请输入源头单据"></el-input>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="localDataForm.remark" placeholder="请输入备注"></el-input>
</el-form-item>
<el-form-item label="批次" prop="batch">
<el-input v-model="wmsInPlanDetailForm.batch" plcaeholder="请输入批次"></el-input>
</el-form-item>
<el-form-item label="库位" prop="cellId">
<el-select v-model="wmsInPlanDetailForm.cellId" placeholder="请选择库位" filterable remote
:remote-method="getAreaList" clearable>
@ -219,7 +231,7 @@ export default {
</el-option>
</el-select>
</el-form-item>
<el-form-item label="物品" prop="materialId" v-if="localDataForm.planTypeCode==='DBRK'">
<el-form-item label="物品" prop="materialId" v-if="localDataForm.planTypeId==7">
<el-select v-model="wmsInPlanDetailForm.materialId" placeholder="请选择物料" filterable remote
:remote-method="getMdItemList" clearable>
<el-option :label="item.itemName" :value="item.itemId.toString()" v-for="item in mdItemList"
@ -230,7 +242,7 @@ export default {
</el-select>
</el-form-item>
<el-divider content-position="center">台账实例</el-divider>
<el-divider content-position="center">整刀实例</el-divider>
<wms-in-plan-detail-entity-table-cmps
:entityList.sync="wmsInPlanDetailEntityList"
:planTypeId="localDataForm.planTypeId"

View File

@ -18,6 +18,52 @@
</el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- plain-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- v-hasPermi="['wm:wmsInTask:add']"-->
<!-- >新增-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['wm:wmsInTask:edit']"-->
<!-- >修改-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['wm:wmsInTask:remove']"-->
<!-- >删除-->
<!-- </el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="handleExport"-->
<!-- v-hasPermi="['wm:wmsInTask:export']"-->
<!-- >导出-->
<!-- </el-button>-->
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -44,37 +90,29 @@
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope">
<template v-if="scope.row.planInStatus !== '1' && scope.row.planTypeCode !== 'ZDHK'">
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-edit"-->
<!-- @click="openTaskDetailDialog(scope.row)"-->
<!-- >详情-->
<!-- </el-button>-->
<el-button
size="mini"
type="text"
v-if="scope.row.planInStatus !== 'YTC'"
@click="handleIssueWcs(scope.row,'CK')"
>推出库位
</el-button>
<el-button
size="mini"
type="text"
v-if="scope.row.planInStatus !== 'YTR' && scope.row.planInStatus !== '0'"
@click="handleIssueWcs(scope.row,'RK')"
>推入库位
</el-button>
</template>
<template v-if="scope.row.planInStatus !== '1'">
<el-button
size="mini"
type="text"
@click="handleIssueWcs(scope.row,'CK')"
icon="el-icon-edit"
:disabled="scope.row.planInStatus === '1'"
@click="handleIssue(scope.row)"
>下发
</el-button>
</template>
<el-button
size="mini"
type="text"
:disabled="scope.row.planInStatus === '1'"
@click="manualIssue(scope.row)"
>手动入库
</el-button>
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['wm:wmsInTask:remove']"-->
<!-- >删除-->
<!-- </el-button>-->
</template>
</el-table-column>
</el-table>
@ -131,7 +169,7 @@ import {
delWmsInTask,
addWmsInTask,
updateWmsInTask,
issueBatchWmsInTask, issueInTaskWcsLTK, issueInTaskWcsDJ
issueBatchWmsInTask, issueWmsInTaskToWcs
} from "@/api/mes/wm/wmsInTask";
import {listTYPE} from "@/api/md/TYPE";
import {listWmsInPlanDetailsEntity} from "@/api/mes/wm/wmsInPlanDetailsEntity";
@ -180,7 +218,7 @@ export default {
createTime: null,
updateBy: null,
updateTime: null,
isActive: null,
isActivy: null,
isDelete: null,
batch: null,
materialId: null,
@ -234,12 +272,13 @@ export default {
}
return id
},
/**
* 下发任务至 WCS
* @param task
* @param type 出库或入库
*/
handleIssueWcs(task, type = "RK") {
// WCS
handleIssue(task) {
let warehouseTypeCode = ""
//
if (task.planTypeId === "8") {
warehouseTypeCode = "LTK"
}
const param = {
// ID
planId: task.planInId,
@ -248,48 +287,25 @@ export default {
//
cellCode: task.cellCode,
//
warehouseTypeCode: "",
warehouseTypeCode,
//
materialId: task.materialId,
materialCode: task.materialCode,
materialName: task.materialName,
materialCount: task.actualInQuantity,
rfid: "123456789AAA",
rfid: "",
// OR
type,
type: "RK",
}
/** 刀片入库|刀柄入库|拆刀回库 入 立体库 */
if (["DPRK", "DBRK", "CDHK"].includes(task.planTypeCode)) {
param.warehouseTypeCode = "LTK"
issueInTaskWcsLTK(param).then(res => {
if (type === "RK") {
task.planInStatus = "YTR"
this.$modal.msgSuccess("推入库位");
} else if (type === "CK") {
task.planInStatus = "YTC"
this.$modal.msgSuccess("推出库位");
}
//
updateWmsInTask(task).then(res => {
this.getList();
})
})
} else if (["ZDHK", "ZDRK"].includes(task.planTypeCode)) {
/** 整刀回库|组刀入库 入 刀具库 */
param.warehouseTypeCode = "DJ"
issueInTaskWcsDJ(param).then(res => {
console.log(task)
issueWmsInTaskToWcs(param).then(res => {
console.log(res)
this.$modal.msgSuccess("下发成功");
})
}
},
/**
* 手动执行入库任务
*/
manualIssue(task) {
issueBatchWmsInTask([task.id.toString()]).then(response => {
this.$modal.msgSuccess("执行成功");
this.getList();
});
// issueBatchWmsInTask([task.id.toString()]).then(response => {
// this.$modal.msgSuccess("");
// this.getList();
// });
},
//
cancel() {