Compare commits

...

10 Commits

5 changed files with 231 additions and 81 deletions

View File

@ -71,8 +71,8 @@ export default {
return {
codeUrl: "",
loginForm: {
username: "admin",
password: "admin123",
username: "",
password: "",
rememberMe: false,
code: "",
uuid: ""

View File

@ -231,11 +231,23 @@
<!-- </el-col>-->
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="物料名称" prop="itemName">
<el-input v-model="form.itemName" maxlength="255" readonly="readonly" v-if="optType=='view'"/>
<el-input v-model="form.itemName" placeholder="请输入物料名称" maxlength="255" v-else/>
</el-form-item>
<el-col :span="24">
<el-col :span="16">
<el-form-item label="物料名称" prop="itemName">
<el-input v-model="form.itemName" maxlength="255" readonly="readonly" v-if="optType=='view'"/>
<el-input v-model="form.itemName" placeholder="请输入物料名称" maxlength="255" v-else/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label-width="80">
<el-switch v-model="form.attr3"
active-color="#13ce66"
active-text="大号物料"
:active-value="1"
:inactive-value="0">
</el-switch>
</el-form-item>
</el-col>
</el-col>
</el-row>
<el-row>
@ -381,6 +393,35 @@
<!-- </el-form-item>-->
<!-- </el-col>-->
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="长度" prop="length">
<el-input-number v-model="form.length" :min="0" :percision="0" :step="1" disabled
v-if="optType=='view'"/>
<el-input-number v-model="form.length" :min="0" :percision="0" :step="1"
placeholder="请输入长度"
v-else/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="宽度" prop="width">
<el-input-number v-model="form.width" :min="0" :percision="0" :step="1" disabled
v-if="optType=='view'"/>
<el-input-number v-model="form.width" :min="0" :percision="0" :step="1"
placeholder="请输入宽度"
v-else/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="高度" prop="height">
<el-input-number v-model="form.height" :min="0" :percision="0" :step="1" disabled
v-if="optType=='view'"/>
<el-input-number v-model="form.height" :min="0" :percision="0" :step="1"
placeholder="请输入高度"
v-else/>
</el-form-item>
</el-col>
</el-row>
<!-- <el-row v-if="form.safeStockFlag == 'Y'">-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="最小库存量">-->
@ -669,7 +710,8 @@ export default {
minStock: 0,
maxStock: 0,
optType: undefined,
remark: undefined
remark: undefined,
attr3: 0
};
this.autoGenFlag = false;
this.resetForm("form");

View File

@ -78,7 +78,8 @@
size="mini"
@click="handleAdd"
v-hasPermi="['mes:wm:area:add']"
>新增</el-button>
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
@ -89,7 +90,8 @@
:disabled="single"
@click="handleUpdate"
v-hasPermi="['mes:wm:area:edit']"
>修改</el-button>
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
@ -100,28 +102,30 @@
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['mes:wm:area:remove']"
>删除</el-button>
>删除
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="areaList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="库位编码" align="center" prop="areaCode" >
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="库位编码" align="center" prop="areaCode">
<template slot-scope="scope">
<el-button
type="text"
@click="handleView(scope.row)"
v-hasPermi="['mes:wm:area:query']"
>{{scope.row.areaCode}}</el-button>
>{{ scope.row.areaCode }}
</el-button>
</template>
</el-table-column>
<el-table-column label="库位名称" align="center" prop="areaName" />
<el-table-column label="所属库区" align="center" prop="locationName" />
<el-table-column label="上级库位" align="center" prop="superiorName" />
<el-table-column label="X" align="center" prop="positionX" />
<el-table-column label="y" align="center" prop="positionY" />
<el-table-column label="z" align="center" prop="positionZ" />
<el-table-column label="库位名称" align="center" prop="areaName"/>
<el-table-column label="所属库区" align="center" prop="locationName"/>
<el-table-column label="上级库位" align="center" prop="superiorName"/>
<el-table-column label="X" align="center" prop="positionX"/>
<el-table-column label="y" align="center" prop="positionY"/>
<el-table-column label="z" align="center" prop="positionZ"/>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
@ -131,14 +135,16 @@
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['mes:wm:area:edit']"
>修改</el-button>
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['mes:wm:area:remove']"
>删除</el-button>
>删除
</el-button>
</template>
</el-table-column>
</el-table>
@ -163,26 +169,38 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label-width="80">
<el-form-item label-width="80">
<el-switch v-model="autoGenFlag"
active-color="#13ce66"
active-text="自动生成"
@change="handleAutoGenChange(autoGenFlag)" v-if="optType != 'view'">
active-color="#13ce66"
active-text="自动生成"
@change="handleAutoGenChange(autoGenFlag)" v-if="optType != 'view'">
</el-switch>
</el-form-item>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="库位名称" prop="areaName">
<el-input v-model="form.areaName" placeholder="请输入库位名称" />
</el-form-item>
<el-col :span="16">
<el-form-item label="库位名称" prop="areaName">
<el-input v-model="form.areaName" placeholder="请输入库位名称"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label-width="80">
<el-switch v-model="form.attr3"
active-color="#13ce66"
active-text="大号库位"
:active-value="1"
:inactive-value="0">
</el-switch>
</el-form-item>
</el-col>
</el-col>
<el-col :span="24">
<div style="display: flex">
<el-form-item label="库区" prop="locationId">
<div style="display: flex">
<el-input v-model="form.locationName" placeholder="请选择库区名称" />
<el-input v-model="form.locationName" placeholder="请选择库区名称"/>
<el-button @click="selecocationVisible=true" icon="el-icon-search"></el-button>
</div>
</el-form-item>
@ -190,40 +208,52 @@
</el-col>
</el-row>
<el-row>
<!-- <el-col :span="24">-->
<!-- <div style="display: flex">-->
<!-- <el-form-item label="上级库位" prop="attr1">-->
<!-- <div style="display: flex">-->
<!-- <el-input v-model="form.superiorName" placeholder="请选择上级库位" />-->
<!-- <el-button @click="selecareaVisible=true" icon="el-icon-search"></el-button>-->
<!-- </div>-->
<!-- </el-form-item>-->
<!-- </div>-->
<!-- </el-col>-->
<el-col :span="24">
<el-form-item label="是否禁用">
<el-switch v-model="form.attr4"
active-color="#13ce66"
active-text="禁用"
:active-value="1"
:inactive-value="0">
</el-switch>
</el-form-item>
</el-col>
</el-row>
<el-row>
<!-- <el-col :span="24">-->
<!-- <div style="display: flex">-->
<!-- <el-form-item label="上级库位" prop="attr1">-->
<!-- <div style="display: flex">-->
<!-- <el-input v-model="form.superiorName" placeholder="请选择上级库位" />-->
<!-- <el-button @click="selecareaVisible=true" icon="el-icon-search"></el-button>-->
<!-- </div>-->
<!-- </el-form-item>-->
<!-- </div>-->
<!-- </el-col>-->
</el-row>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="库位位置X" prop="positionX">
<el-input-number :min="0" :step="1" v-model="form.positionX" placeholder="请输入库位位置X" />
<el-input-number :min="0" :step="1" v-model="form.positionX" placeholder="请输入库位位置X"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="库位位置y" prop="positionY">
<el-input-number :min="0" :step="1" v-model="form.positionY" placeholder="请输入库位位置y" />
<el-input-number :min="0" :step="1" v-model="form.positionY" placeholder="请输入库位位置y"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="库位位置z" prop="positionZ">
<el-input-number :min="0" :step="1" v-model="form.positionZ" placeholder="请输入库位位置z" />
<el-input-number :min="0" :step="1" v-model="form.positionZ" placeholder="请输入库位位置z"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
</el-form-item>
</el-col>
</el-row>
@ -255,15 +285,15 @@ import SelecAreaCmps from "@/components/wm/SelecAreaCmps.vue";
export default {
name: "Area",
dicts: ['sys_yes_no'],
components: {SelecLocationCmps, BarcodeImg,SelecAreaCmps } ,
components: {SelecLocationCmps, BarcodeImg, SelecAreaCmps},
data() {
return {
//
selecareaVisible:false,
selecareaVisible: false,
//
selecocationVisible:false,
selecocationVisible: false,
//
autoGenFlag:false,
autoGenFlag: false,
optType: undefined,
locationId: undefined,
//
@ -302,16 +332,16 @@ export default {
//
rules: {
areaCode: [
{ required: true, message: "库位编码不能为空", trigger: "blur" }
{required: true, message: "库位编码不能为空", trigger: "blur"}
],
areaName: [
{ required: true, message: "库位名称不能为空", trigger: "blur" }
{required: true, message: "库位名称不能为空", trigger: "blur"}
],
locationId: [
{ required: true, message: "库区不能为空", trigger: "blur" }
{required: true, message: "库区不能为空", trigger: "blur"}
],
attr1: [
{ required: true, message: "上级库位名称不能为空", trigger: "blur" }
{required: true, message: "上级库位名称不能为空", trigger: "blur"}
]
}
};
@ -389,7 +419,7 @@ export default {
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.areaId)
this.single = selection.length!==1
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
@ -400,7 +430,7 @@ export default {
this.optType = "add";
},
//
handleView(row){
handleView(row) {
this.reset();
const areaId = row.areaId || this.ids
getArea(areaId).then(response => {
@ -445,25 +475,26 @@ export default {
* 冻结状态变更
* @param row
*/
handleFrozenChange(row){
handleFrozenChange(row) {
let text = row.frozenFlag === "Y" ? "冻结" : "解冻";
this.$modal.confirm('确认要"' + text + '""' + row.areaName + '"库位吗?').then(function() {
return changeFrozenState(row.areaId,row.frozenFlag);
this.$modal.confirm('确认要"' + text + '""' + row.areaName + '"库位吗?').then(function () {
return changeFrozenState(row.areaId, row.frozenFlag);
}).then(() => {
this.$modal.msgSuccess(text + "成功");
}).catch(function() {
}).catch(function () {
row.frozenFlag = row.frozenFlag === "N" ? "Y" : "N";
});
},
/** 删除按钮操作 */
handleDelete(row) {
const areaIds = row.areaId || this.ids;
this.$modal.confirm('是否确认删除库位设置编号为"' + areaIds + '"的数据项?').then(function() {
this.$modal.confirm('是否确认删除库位设置编号为"' + areaIds + '"的数据项?').then(function () {
return delArea(areaIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}).catch(() => {
});
},
/** 导出按钮操作 */
handleExport() {
@ -472,12 +503,12 @@ export default {
}, `area_${new Date().getTime()}.xlsx`)
},
//
handleAutoGenChange(autoGenFlag){
if(autoGenFlag){
genCode('AREA_CODE').then(response =>{
handleAutoGenChange(autoGenFlag) {
if (autoGenFlag) {
genCode('AREA_CODE').then(response => {
this.form.areaCode = response;
});
}else{
} else {
this.form.areaCode = null;
}
}

View File

@ -204,7 +204,7 @@
<el-table-column label="库位" prop="cellId" width="190">
<template slot-scope="scope">
<el-select v-model="scope.row.cellId" placeholder="请选择库位" filterable remote
:remote-method="getMdItemList" clearable>
:remote-method="getAreaList" clearable>
<el-option :label="item.areaName" :value="item.areaId.toString()" v-for="item in areaList"
:key="item.areaId">
<span style="float: left">{{ item.areaName }}</span>
@ -405,8 +405,10 @@ export default {
const params = {
pageNum: 1,
pageSize: 100,
//
itemName: areaName
//
areaName: areaName,
// ID
locationId: 222
}
listArea(params).then(response => {
this.areaList = response.rows;
@ -515,6 +517,21 @@ export default {
/** 新增按钮操作 */
handleAdd(planTypeCode) {
this.reset();
//
switch (planTypeCode) {
case "DBRK":
this.form.locationCode = null;
break;
case "DPRK":
this.form.locationCode = null;
break;
case "ZDHK":
this.form.locationCode = 'L055';
break;
case "CDHK":
this.form.locationCode = null;
break;
}
//
const filter = this.inPlanTypeList.filter(item => item.code === planTypeCode);
if (filter.length) {
@ -522,7 +539,7 @@ export default {
this.form.planTypeCode = filter[0].code;
this.form.planTypeName = filter[0].name;
} else {
this.$message.error("系统错误,请联系管理员");
this.$message.error("计划类型查找失败");
console.error("计划类型查找失败")
return;
}

View File

@ -4,10 +4,11 @@ import WmsInPlanDetailEntityTableCmps from "@/views/mes/wm/inPlan/wmsInPlanDetai
import {addPLAN, updatePLAN} from "@/api/wm/PLAN";
import {listMdItem} from "@/api/mes/md/mdItem";
import {listTYPE} from "@/api/md/TYPE";
import {isDuplicateRfid} from "@/api/mes/md/baseKnife";
import {isDuplicateRfid, listBaseKnife} from "@/api/mes/md/baseKnife";
export default {
name: "wmsInPlanKnifeBackFormCmps",
dicts: ['sys_yes_no', 'mes_item_product', 'is_locked', 'knife_fine_status', 'plan_source_type', 'in_plan_state'],
components: {WmsInPlanDetailEntityTableCmps},
props: {
dataForm: {
@ -25,6 +26,8 @@ export default {
wmsInPlanDetailForm: {},
//
areaList: [],
BaseKnifeList: [],
total: 0,
//
wmsInPlanDetailEntityList: [],
//
@ -34,7 +37,12 @@ export default {
localVisible: this.visible,
//
inPlanTypeList: [],
mdItemList: []
mdItemList: [],
queryParams: {
pageNum: 1,
pageSize: 10,
areaCode: ""
}
}
},
computed: {
@ -43,14 +51,18 @@ export default {
},
},
methods: {
/** 获取库位列表 */
/**
* 获取库位列表
* @param areaName
*/
getAreaList(areaName = "") {
this.loading = true;
const params = {
pageNum: 1,
pageSize: 100,
//
itemName: areaName
//
areaName: areaName,
// ID
locationId: 222
}
listArea(params).then(response => {
this.areaList = response.rows;
@ -124,6 +136,15 @@ export default {
this.inPlanTypeList = response.rows;
});
},
handleAreaSelectChange() {
let result = this.areaList.filter(item => item.areaId == this.wmsInPlanDetailForm.cellId)
this.queryParams.areaCode = result[0].areaCode
listBaseKnife(this.queryParams).then(response => {
this.BaseKnifeList = response.rows;
this.total = response.total;
});
},
handlePlanTypeSelectChange(typeId) {
this.$emit("planTypeSelectChange", typeId)
},
@ -194,20 +215,17 @@ export default {
</script>
<template>
<el-dialog :title="title" :visible="visible" width="50%" append-to-body @close="handleClose"
<el-dialog :title="title" :visible="visible" width="60%" append-to-body @close="handleClose"
:close-on-click-modal="false">
<!--状态为1已执行 则禁用-->
<el-form ref="form" :model="localDataForm" :rules="rules" label-width="80px" inline
:disabled="localDataForm.state === '1'">
<!-- <el-form-item label="计划编码" prop="planCode">-->
<!-- <el-input v-model="localDataForm.planCode" 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="cellId">
<el-form-item label="库位" prop="cellId" v-if="localDataForm.planTypeCode!=='ZDHK'">
<el-select v-model="wmsInPlanDetailForm.cellId" placeholder="请选择库位" filterable remote
:remote-method="getAreaList" clearable>
:remote-method="getAreaList" clearable @change="handleAreaSelectChange">
<el-option :label="item.areaName" :value="item.areaId.toString()" v-for="item in areaList"
:key="item.areaId">
<span style="float: left">{{ item.areaName }}</span>
@ -232,6 +250,48 @@ export default {
:planTypeId="localDataForm.planTypeId"
:planTypeCode="localDataForm.planTypeCode"
></wms-in-plan-detail-entity-table-cmps>
<el-divider content-position="center" v-if="localDataForm.planTypeCode!=='ZDHK'">库位包含物料</el-divider>
<el-table :data="BaseKnifeList" v-if="localDataForm.planTypeCode!=='ZDHK'">
<el-table-column label="台账ID" align="center" prop="baseKnifeId" min-width="60" :show-overflow-tooltip="true"/>
<el-table-column label="rfid" align="center" prop="rfid"/>
<el-table-column label="刀具编码" align="center" prop="knifeCode" min-width="135"
:show-overflow-tooltip="true"/>
<el-table-column label="刀具名称" align="center" prop="knifeName" min-width="135"
:show-overflow-tooltip="true"/>
<el-table-column label="物料类型" align="center" key="itemOrProduct" prop="itemOrProduct"
:show-overflow-tooltip="true">
<template slot-scope="scope">
<dict-tag :options="dict.type.mes_item_product" :value="scope.row.itemOrProduct"/>
</template>
</el-table-column>
<el-table-column label="刀具寿命" align="center" prop="knifeLife" min-width="100"
:show-overflow-tooltip="true"/>
<el-table-column label="刀具状态" align="center" prop="knifeFineState" min-width="100"
:show-overflow-tooltip="true">
<template slot-scope="scope">
<dict-tag :options="dict.type.knife_fine_status" :value="scope.row.knifeFineState"/>
</template>
</el-table-column>
<el-table-column label="是否锁定" align="center" prop="isLocked" min-width="100" :show-overflow-tooltip="true">
<template slot-scope="scope">
<dict-tag :options="dict.type.is_locked" :value="scope.row.isLocked"/>
</template>
</el-table-column>
<el-table-column label="归属计划单" align="center" prop="planSheet" min-width="120"/>
<el-table-column label="重置次数" align="center" prop="resetCount" min-width="100">
<template slot-scope="scope">
<span v-if="scope.row.itemOrProduct == 'PRODUCT'">{{ scope.row.resetCount }}</span>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="handleAreaSelectChange"
/>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>