|
@@ -124,18 +124,29 @@ export const JEditableTableMixin = {
|
|
|
this.close()
|
|
|
},
|
|
|
/** 确定按钮点击事件 */
|
|
|
- handleOk() {
|
|
|
+ handleOk(data) {
|
|
|
/** 触发表单验证 */
|
|
|
this.getAllTable().then(tables => {
|
|
|
/** 一次性验证主表和所有的次表 */
|
|
|
return validateFormAndTables(this.form, tables)
|
|
|
}).then(allValues => {
|
|
|
+ var status = 'yes'
|
|
|
+ if(data=='GDZC'){
|
|
|
+ allValues.tablesValue[0].values.map(item=>{
|
|
|
+ if(isNaN(Number(item.quantity))){
|
|
|
+ this.$message.error('数量只可输入数字!');
|
|
|
+ status = 'no'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(status=='yes'){
|
|
|
if (typeof this.classifyIntoFormData !== 'function') {
|
|
|
throw this.throwNotFunction('classifyIntoFormData')
|
|
|
}
|
|
|
let formData = this.classifyIntoFormData(allValues)
|
|
|
// 发起请求
|
|
|
return this.request(formData)
|
|
|
+ }
|
|
|
}).catch(e => {
|
|
|
if (e.error === VALIDATE_NO_PASSED) {
|
|
|
// 如果有未通过表单验证的子表,就自动跳转到它所在的tab
|