//此处是对表单的方法,组件,权限操作按钮等进行任意扩展(方法扩展可参照SellOrder.js)
|
let extension = {
|
components: {//动态扩充组件或组件路径
|
//表单header、content、footer对应位置扩充的组件
|
gridHeader: '',//{ template: "<div>扩展组xx件</div>" },
|
gridBody: '',
|
gridFooter: '',
|
//弹出框(修改、编辑、查看)header、content、footer对应位置扩充的组件
|
modelHeader: '',
|
modelBody: '',
|
modelFooter: ''
|
},
|
buttons: { view: [], box: [], detail: [] },//扩展的按钮
|
methods: {//事件扩展
|
onInit() {
|
let materiel_modelno = this.getOption("weighing_materiel_id");
|
let confignameselect = this.getOption("weighing_bearing_id");
|
let manufacturerselect = this.getOption("weighing_manufacturer");
|
materiel_modelno.onChange = (val, options) => {
|
let params = {
|
MainData: { "materielId": val },
|
}
|
this.editFormFields.weighing_bearing_id = '';
|
this.editFormFields.weighing_manufacturer = '';
|
confignameselect.data = [];
|
manufacturerselect.data = [];
|
this.http.post("api/Dt_materiel_zc_info/GetZCInfoByMateriel", params, "").then(x => {
|
confignameselect.data = x.data;
|
});
|
};
|
confignameselect.onChange = (val, options) => {
|
let params = {
|
MainData: { "materielId": this.editFormFields.weighing_materiel_id, 'materielModel': val },
|
}
|
manufacturerselect.data = [];
|
this.editFormFields.weighing_manufacturer = '';
|
this.http.post("api/Dt_materiel_zc_info/GetManufacturerByMateriel", params, "").then(x => {
|
manufacturerselect.data = x.data;
|
});
|
};
|
},
|
getOption(field) {
|
let option;
|
this.editFormOptions.forEach(x => {
|
let col = x.find(r => r.field == field);
|
if (null != col) {
|
option = col;
|
return;
|
}
|
});
|
return option;
|
}, modelOpenAfter(row) {
|
let isEDIT = this.currentAction == this.const.ADD;
|
this.editFormOptions.forEach(item => {
|
item.forEach(x => {
|
if (x.field == "weighing_materiel_id" || x.field == "weighing_bearing_id" || x.field == "weighing_manufacturer" || x.field == "weighing_type") {
|
x.disabled = !isEDIT;
|
}
|
});
|
})
|
}
|
}
|
};
|
export default extension;
|