|
@@ -1197,22 +1197,35 @@ export default {
|
|
|
that.getTableData(1);
|
|
|
},
|
|
|
handleCurrentChange (currentRow) {
|
|
|
- let that = this;
|
|
|
- that.currentData = currentRow;
|
|
|
+ let that = this;
|
|
|
+ if (currentRow !== null) {
|
|
|
+ that.currentData = currentRow;
|
|
|
+ } else {
|
|
|
+ that.currentData.itemid = '';
|
|
|
+ that.currentData.itemname = '';
|
|
|
+ that.currentData.itemdesc = '';
|
|
|
+ that.currentData.energyid = '';
|
|
|
+ that.currentData.workprocid = '';
|
|
|
+ that.currentData.unitid = unitid;
|
|
|
+ that.currentData.fid = '';
|
|
|
+ that.currentData.isup = '1';
|
|
|
+ that.currentData.mintimegranid = '';
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
but_add () {
|
|
|
let that = this;
|
|
|
- let unitid = that.nameObj.unitid.defaults ? that.nameObj.unitid.defaults : '';
|
|
|
- that.dialog.editorBox.form.data.itemid = that.currentData.itemid === undefined ? '' : that.currentData.itemid;
|
|
|
- that.dialog.editorBox.form.data.itemname = that.currentData.itemname === undefined ? '' : that.currentData.itemname;
|
|
|
- that.dialog.editorBox.form.data.itemdesc = that.currentData.itemdesc === undefined ? '' : that.currentData.itemdesc;
|
|
|
- that.dialog.editorBox.form.data.energyid = that.currentData.energyid === undefined ? '' : that.currentData.energyid;
|
|
|
- that.dialog.editorBox.form.data.workprocid = that.currentData.workprocid === undefined ? '' : that.currentData.workprocid;
|
|
|
- that.dialog.editorBox.form.data.propertyid = that.currentData.propertyid === undefined ? '' : that.currentData.propertyid;
|
|
|
- that.dialog.editorBox.form.data.unitid = that.currentData.unitid === undefined ? unitid : that.currentData.unitid;
|
|
|
- that.dialog.editorBox.form.data.fid = that.currentData.fid === undefined ? '' : that.currentData.fid;
|
|
|
- that.dialog.editorBox.form.data.isup = that.currentData.isup === undefined ? '1' : that.currentData.isup;
|
|
|
- that.dialog.editorBox.form.data.mintimegranid = that.currentData.mintimegranid === undefined ? '' : that.currentData.mintimegranid;
|
|
|
+ let unitid = that.nameObj.unitid.defaults ? that.nameObj.unitid.defaults : '';
|
|
|
+ that.dialog.editorBox.form.data.itemid = that.currentData.itemid || that.currentData.itemid === undefined ? '' : that.currentData.itemid;
|
|
|
+ that.dialog.editorBox.form.data.itemname = that.currentData.itemname === undefined ? '' : that.currentData.itemname;
|
|
|
+ that.dialog.editorBox.form.data.itemdesc = that.currentData.itemdesc === undefined ? '' : that.currentData.itemdesc;
|
|
|
+ that.dialog.editorBox.form.data.energyid = that.currentData.energyid === undefined ? '' : that.currentData.energyid;
|
|
|
+ that.dialog.editorBox.form.data.workprocid = that.currentData.workprocid === undefined ? '' : that.currentData.workprocid;
|
|
|
+ that.dialog.editorBox.form.data.propertyid = that.currentData.propertyid === undefined ? '' : that.currentData.propertyid;
|
|
|
+ that.dialog.editorBox.form.data.unitid = that.currentData.unitid === undefined ? unitid : that.currentData.unitid;
|
|
|
+ that.dialog.editorBox.form.data.fid = that.currentData.fid === undefined ? '' : that.currentData.fid;
|
|
|
+ that.dialog.editorBox.form.data.isup = that.currentData.isup === undefined ? '1' : that.currentData.isup;
|
|
|
+ that.dialog.editorBox.form.data.mintimegranid = that.currentData.mintimegranid === undefined ? '' : that.currentData.mintimegranid;
|
|
|
that.dialog.editorBox.type = 'add';
|
|
|
that.dialog.editorBox.show = true;
|
|
|
console.log(that.dialog.editorBox.form.data.unitid)
|