liuying
2024-04-24 d86353384f4071a3cea77e6151e1a7bda4486501
iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabItem/WmsSubstituteGood/addForm.vue
@@ -1,24 +1,21 @@
<template>
 <a-modal
    title="新增替代品管理"
    :width="900"
    :visible="visible"
    :confirmLoading="confirmLoading"
    @ok="handleSubmit"
  <a-modal title="新增物料-替代品管理" :width="900" :visible="visible" :confirmLoading="confirmLoading" @ok="handleSubmit"
    @cancel="handleCancel">
    <a-spin :spinning="confirmLoading">
    </a-spin>    <a-form :form="form">
    </a-spin> <a-form :form="form">
      <a-form-item label="替代编号" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
        <a-input placeholder="请输入替代编号"
          v-decorator="['substituteCode', { rules: [{ required: true, message: '请输入替代编号!' }] }]" />
      </a-form-item>
      <a-form-item label="物料编号" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
        <a-input placeholder="请输入物料编号" v-decorator="['materialCode', { rules: [{ required: true, message: '请输入物料编号!' }] }]" />
      <!-- <a-form-item label="物料编号" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
        <a-input placeholder="请输入物料编号"
          v-decorator="['materialCode', { rules: [{ required: true, message: '请输入物料编号!' }] }]" />
      </a-form-item>
      <a-form-item label="物料名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
        <a-input placeholder="请输入物料名称" v-decorator="['materialName', { rules: [{ required: true, message: '请输入物料名称!' }] }]" />
      </a-form-item>
        <a-input placeholder="请输入物料名称"
          v-decorator="['materialName', { rules: [{ required: true, message: '请输入物料名称!' }] }]" />
      </a-form-item> -->
      <a-form-item label="替代品物料编号" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
        <a-input placeholder="请输入替代品物料编号"
          v-decorator="['substituteMaterialCode', { rules: [{ required: true, message: '请输入替代品物料编号!' }] }]" />
@@ -35,7 +32,7 @@
          <a-switch v-decorator="['isDisabled',{rules: [{ required: true, message: '请选择是否禁用!' }], valuePropName: 'checked'}]" />
        </a-form-item> -->
    </a-form>
  </a-modal>
  </a-modal>
</template>
<script>
@@ -64,9 +61,23 @@
    // 初始化方法
    add(record) {
      this.visible = true
      this.$nextTick(() => {
      });
      this.$nextTick(() => {
        this.form.setFieldsValue(
          {
            materialCode: record.materialCode,
            materialName: record.materialName,
            // id: record.id,
            substituteCode: "",
            substituteMaterialCode: "",
            substituteMaterialName: "",
            substituteIndex: "",
            isDisabled: ""
          }
        )
      })
    },
    /**
     * 提交表单
@@ -81,9 +92,9 @@
              values[key] = JSON.stringify(values[key])
            }
          }
              this.confirmLoading = false
              this.$emit('ok', values)
              this.handleCancel()
          this.confirmLoading = false
          this.$emit('ok', values)
          this.handleCancel()
          // WmsSubstituteGoodAdd(values).then((res) => {