This commit is contained in:
ljx 2024-04-29 18:21:11 +08:00
parent d0b4ce581c
commit 0ad93999fc
3 changed files with 20 additions and 8 deletions

View File

@ -171,7 +171,7 @@ export default {
{field:'',title:'',span:24,isTitle:true,Htitle:'土质物料信息',itemRender:{}},//线
{field: 'code', title: '编码', span: 6, itemRender: {name: '$input'}},
{field: 'name', title: '品名', span: 6, itemRender: {name: '$input'}},
{field: 'price', title: '单价', span: 6, itemRender: {name: '$input'}},
{field: 'price', title: '单价', span: 6, itemRender: {name: '$input', props: {type: "number"}, events: { input: this.handleInputNumber }}},
{field: 'image', title: '图片', span: 24, itemRender: {name: 'MkFormCropper', props: {}}},
{field: 'description', title: '描述', span: 24, itemRender: {name: '$textarea'}},
{field: 'remark', title: '备注', span: 24, itemRender: {name: '$textarea'}},
@ -385,6 +385,13 @@ export default {
updateRow.customer_name =inv.customer[1];
Object.assign(row, updateRow);
},
handleInputNumber(e){
if(e.field){
this.formOptions.data[e.field] = Number(this.formOptions.data[e.field])
}else{
return
}
},
//
ok() {
let save = () => {
@ -438,14 +445,14 @@ export default {
});
};
};
//
this.$mk.validateForm({form: this.$refs.xForm}).then(() => { //
save(); //
}).catch(count => { //
this.$mk.error(`存在${count}项错误,请检查`);
});
//
this.$mk.validateForm({form: this.$refs.xForm}).then(() => { //
save(); //
}).catch(count => { //
this.$mk.error(`存在${count}项错误,请检查`);
});
},

View File

@ -180,6 +180,7 @@ export default {
{field: 'code', sortable: true, title: '编码', width: 150}, //
{field: 'name', sortable: true, title: '品名', width: 150}, //
{field: 'price', sortable: true, title: '单价', width: 150}, //
{field: 'description', title: '描述', width: 250}, //
{field: 'remark', title: '备注', minWidth: 200}, //

View File

@ -596,6 +596,8 @@ export default {
onDataChanged: ({value,data}) => {
console.log(value,data)
this.formOptions.data.soil_quality_material_id = data.id;
this.formOptions.data.buy_unit_price = data.price;
this.formOptions.data.unit_price = data.price;
}
}
}
@ -713,6 +715,8 @@ export default {
onDataChanged: ({value,data}) => {
console.log(value,data)
this.formOptions.data.train_number[this.nowIndex].soil_quality_material_id = data.id;
this.formOptions.data.train_number[this.nowIndex].buy_unit_price = data.price;
this.formOptions.data.train_number[this.nowIndex].unit_price = data.price;
}
}
}