|
@@ -88,6 +88,7 @@ export default {
|
|
|
tableOptions: {}, //表单数据下拉
|
|
|
labelWidth: '120px', //表单文字距离
|
|
|
fromDataReqCatch: [], //表单规则缓存
|
|
|
+ tableKey:null,//表格主键
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -183,6 +184,12 @@ export default {
|
|
|
const formItemCopy = _.cloneDeep(returnData).filter((item) => item.isdisplay == 2 || item.isdisplay == 3);
|
|
|
this.formItem = _.orderBy(formItemCopy, ['displaynumber'], ['asc']);
|
|
|
this.tableCols = tableColsCopyOrder;
|
|
|
+ const columncode = returnData.find(
|
|
|
+ (item) => item.isprimarykey == 1
|
|
|
+ );
|
|
|
+ if (columncode && Object.keys(columncode).length) {
|
|
|
+ this.tableKey = columncode['columncode']
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
this.$message.error("获取表头数据失败");
|
|
@@ -219,6 +226,9 @@ export default {
|
|
|
this.tableType = "add";
|
|
|
this.tableTitle = "新增";
|
|
|
this.tableForm = {};
|
|
|
+ for(let key in this.pageQuery){
|
|
|
+ this.tableForm[key] = this.pageQuery[key]
|
|
|
+ }
|
|
|
},
|
|
|
//表格-编辑
|
|
|
handleEdit (row) {
|
|
@@ -248,7 +258,7 @@ export default {
|
|
|
},
|
|
|
//表格-删除-确认
|
|
|
tableRemove () {
|
|
|
- this.generalDataReception(3, this.tableObj);
|
|
|
+ this.generalDataReception(3, this.tableObj,this.tableKey);
|
|
|
},
|
|
|
// 新增/编辑-取消
|
|
|
submitClickClose (formName) {
|
|
@@ -258,7 +268,7 @@ export default {
|
|
|
// 新增/编辑-确认
|
|
|
submitClickHandler () {
|
|
|
const flag = this.$refs["ruleForm"].submitClickHandler()
|
|
|
- if (flag) this.tableType == "add" ? this.generalDataReception(1, this.tableForm) : this.generalDataReception(2, this.tableForm)
|
|
|
+ if (flag) this.tableType == "add" ? this.generalDataReception(1, this.tableForm) : this.generalDataReception(2, this.tableForm,this.tableKey)
|
|
|
},
|
|
|
formatChange (data, event, key) {
|
|
|
const datas = []
|
|
@@ -527,4 +537,4 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|