fix:工装夹具新增编码为空报错问题解决,采购入库执行入库中新增报错问题解决。

This commit is contained in:
zhangxuanming 2024-12-23 09:59:03 +08:00
parent 40b688b5c5
commit f434915779
4 changed files with 39 additions and 27 deletions

View File

@ -378,6 +378,9 @@ export default {
form: {},
//
rules: {
toolCode: [
{ required: true, message: "工装夹具编号不能为空", trigger: "blur" }
],
toolName: [
{ required: true, message: "工装夹具名称不能为空", trigger: "blur" }
],

View File

@ -55,7 +55,7 @@
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
@ -101,7 +101,7 @@
:options="warehouseOptions"
:props="warehouseProps"
@change="handleWarehouseChanged"
>
>
</el-cascader>
</el-form-item>
</el-col>
@ -222,6 +222,9 @@ export default {
],
warehouseId:[
{ required: true, message: "请选择入库的仓库" }
],
itemCode: [
{ required: true, message: "物料编码不能为空", trigger: "blur" }
]
}
};
@ -241,7 +244,7 @@ export default {
});
},
getWarehouseList(){
getTreeList().then( response =>{
getTreeList().then( response =>{
if(response.data){
this.warehouseOptions = response.data.filter((el) =>{
return el.warehouseCode.indexOf('VIR') == -1;
@ -250,12 +253,12 @@ export default {
this.warehouseOptions.map(w =>{
debugger;
w.children.map(l =>{
let lstr =JSON.stringify(l.children).replace(/locationId/g,'lId').replace(/areaId/g, 'pId').replace(/areaName/g,'pName');
let lstr =JSON.stringify(l.children).replace(/locationId/g,'lId').replace(/areaId/g, 'pId').replace(/areaName/g,'pName');
l.children = JSON.parse(lstr);
});
let wstr = JSON.stringify(w.children).replace(/warehouseId/g,'wId').replace(/locationId/g, 'pId').replace(/locationName/g,'pName');
w.children = JSON.parse(wstr);
let wstr = JSON.stringify(w.children).replace(/warehouseId/g,'wId').replace(/locationId/g, 'pId').replace(/locationName/g,'pName');
w.children = JSON.parse(wstr);
});
let ostr=JSON.stringify(this.warehouseOptions).replace(/warehouseId/g,'pId').replace(/warehouseName/g, 'pName');
@ -349,9 +352,9 @@ export default {
const lineId = row.lineId || this.ids
getItemrecptline(lineId).then(response => {
this.form = response.data;
this.warehouseInfo[0] = response.data.warehouseId;
this.warehouseInfo[1] = response.data.locationId;
this.warehouseInfo[2] = response.data.areaId;
this.warehouseInfo[0] = response.data.warehouseId;
this.warehouseInfo[1] = response.data.locationId;
this.warehouseInfo[2] = response.data.areaId;
this.open = true;
this.title = "修改物料入库单行";
});
@ -366,7 +369,7 @@ export default {
this.form.itemCode = obj.itemCode;
this.form.itemName = obj.itemName;
this.form.specification = obj.specification;
this.form.unitOfMeasure = obj.unitOfMeasure;
this.form.unitOfMeasure = obj.unitOfMeasure;
}
},
//
@ -380,7 +383,7 @@ export default {
this.form.itemCode = obj.itemCode;
this.form.itemName = obj.itemName;
this.form.specification = obj.specification;
this.form.unitOfMeasure = obj.unitOfMeasure;
this.form.unitOfMeasure = obj.unitOfMeasure;
this.form.quantityRecived = obj.quantityQuanlified;
}
},

View File

@ -26,7 +26,7 @@
</el-row>
<el-table v-loading="loading" :data="rtsalselineList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="产品编码" width="120" align="center" prop="itemCode" />
<el-table-column label="产品名称" width="150" align="center" prop="itemName" />
<el-table-column label="规格型号" width="150" align="center" prop="specification" :show-overflow-tooltip="true"/>
@ -61,7 +61,7 @@
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
@ -72,7 +72,7 @@
<!-- 添加或修改产品销售退货行对话框 -->
<el-dialog :title="title" :visible.sync="open" width="960px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row>
<el-col :span="8">
<el-form-item label="产品编码" prop="itemCode">
@ -92,7 +92,7 @@
<el-input v-model="form.unitOfMeasure" placeholder="请输入单位" />
</el-form-item>
</el-col>
</el-row>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="规格型号" prop="specification">
@ -117,7 +117,7 @@
:options="warehouseOptions"
:props="warehouseProps"
@change="handleWarehouseChanged"
>
>
</el-cascader>
</el-form-item>
</el-col>
@ -196,6 +196,9 @@ export default {
form: {},
//
rules: {
itemCode: [
{ required: true, message: "产品编码不能为空", trigger: "blur" }
],
itemId: [
{ required: true, message: "产品不能为空", trigger: "blur" }
],
@ -223,7 +226,7 @@ export default {
});
},
getWarehouseList(){
getTreeList().then( response =>{
getTreeList().then( response =>{
if(response.data){
this.warehouseOptions = response.data.filter((el) =>{
return el.warehouseCode.indexOf('VIR') == -1;
@ -231,12 +234,12 @@ export default {
}
this.warehouseOptions.map(w =>{
w.children.map(l =>{
let lstr =JSON.stringify(l.children).replace(/locationId/g,'lId').replace(/areaId/g, 'pId').replace(/areaName/g,'pName');
let lstr =JSON.stringify(l.children).replace(/locationId/g,'lId').replace(/areaId/g, 'pId').replace(/areaName/g,'pName');
l.children = JSON.parse(lstr);
});
let wstr = JSON.stringify(w.children).replace(/warehouseId/g,'wId').replace(/locationId/g, 'pId').replace(/locationName/g,'pName');
w.children = JSON.parse(wstr);
let wstr = JSON.stringify(w.children).replace(/warehouseId/g,'wId').replace(/locationId/g, 'pId').replace(/locationName/g,'pName');
w.children = JSON.parse(wstr);
});
let ostr=JSON.stringify(this.warehouseOptions).replace(/warehouseId/g,'pId').replace(/warehouseName/g, 'pName');
@ -244,7 +247,7 @@ export default {
});
},
//
handleWarehouseChanged(obj){
handleWarehouseChanged(obj){
if(obj !=null){
this.form.warehouseId = obj[0];
this.form.locationId = obj[1];
@ -262,7 +265,7 @@ export default {
this.form.itemCode = obj.itemCode;
this.form.itemName = obj.itemName;
this.form.specification = obj.specification;
this.form.unitOfMeasure = obj.unitOfMeasure;
this.form.unitOfMeasure = obj.unitOfMeasure;
}
},
//

View File

@ -56,7 +56,7 @@
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
@ -67,7 +67,7 @@
<!-- 添加或修改供应商退货行对话框 -->
<el-dialog :title="title" :visible.sync="open" width="960px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
<el-row>
<el-col :span="8">
<el-form-item label="产品物料编码" prop="itemCode">
@ -203,6 +203,9 @@ export default {
},
//
rules: {
itemCode: [
{ required: true, message: "产品物料编码不能为空", trigger: "blur" }
],
itemId: [
{ required: true, message: "产品物料不能为空", trigger: "blur" }
],
@ -337,7 +340,7 @@ export default {
this.form.itemCode = obj.itemCode;
this.form.itemName = obj.itemName;
this.form.specification = obj.specification;
this.form.unitOfMeasure = obj.unitOfMeasure;
this.form.unitOfMeasure = obj.unitOfMeasure;
this.form.batchCode = obj.batchCode;
this.form.warehouseId = obj.warehouseId;
this.form.warehouseCode = obj.warehouseCode;