liuying
2024-04-24 24dbf4b349d8f966689d8e7b5cc59eebaa934277
iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabItem/addForm.vue
@@ -97,6 +97,42 @@
        });
      },
    handleSubmit2(){
      alert(this.form)
      console.log( 99999999999999)
      console.log( this.data)
      const { form: { validateFields } } = this
      this.confirmLoading = true
      validateFields((errors, values) => {
        if (!errors) {
          for (const key in values) {
            if (typeof (values[key]) === 'object') {
              values[key] = JSON.stringify(values[key])
            }
          }
          console.log(22222222222222222)
          console.log(values )
          this.confirmLoading = false
          // WmsMaterialAdd(values).then((res) => {
          //   if (res.success) {
          //     this.$message.success('新增成功')
          //     this.confirmLoading = false
          //     this.$emit('ok', values)
          //     this.handleCancel()
          //   } else {
          //     this.$message.error('新增失败:' + JSON.stringify(res.message))
          //   }
          // }).finally((res) => {
          //   this.confirmLoading = false
          // })
          // return values
        } else {
          this.confirmLoading = false
        }
      })
    },
      /**
       * 提交表单
       */
@@ -110,6 +146,7 @@
                values[key] = JSON.stringify(values[key])
              }
            }
            WmsMaterialAdd(values).then((res) => {
              if (res.success) {
                this.$message.success('新增成功')
@@ -122,6 +159,9 @@
            }).finally((res) => {
              this.confirmLoading = false
            })
          // return values
          } else {
            this.confirmLoading = false
          }