Table单元格保存
效果图
<el-table-column property="ypph" label="出厂编号" align="right" width="auto" header-align="right">
<template slot-scope="scope">
<el-input type="text" v-bind:maxlength="19" v-model="scope.row.ypph" size="mini" name="ypph"
@keydown.native="inputRealYpph(scope,$event,'down')"
@keyup.native="inputRealYpph(scope,$event,'up')"
//单元格失去焦点
@blur="saveDetail(scope)"
//单元格得到焦点
@focus="focusInput($event)">
</el-input>
</template>
</el-table-column>
saveDetail(data){
this.updataDataGoodsD.id = data.row.id;
this.updataDataGoodsD.ypph = data.row.ypph;
this.updataDataGoodsD.modifier = getCookieUserId();
this.updataDataGoodsD.modifyTime = formatDate(new Date());
this.$resource(contextPath + '/api/hrpAssetsGoodsOutD/updateGoodsD'
).save(
this.updataDataGoodsD
).then(function (response) {
}).catch(function (error) {
this.showMsgError(error.data.errMsg)
});
},
focusInput(event) {
event.currentTarget.select();
},