css
liuying
2024-04-25 264795ac21be1ef5e36ec431005acb84777dad79
iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabForm.vue
@@ -125,13 +125,16 @@
</template>
<script>
import { WmsMaterialAdd, GetAreas, GetStations, materialTypeDataList } from '@/api/modular/main/WmsMaterialManage'
import {
  WmsMaterialAdd, WmsMaterialEdit, WmsMaterialDetailList,materialTypeDataList
} from '@/api/modular/main/WmsBase/WmsMaterialManage'
import addForm from './tabItem/addForm.vue'
import addFormBaseCustomer from './tabItem/addFormBaseCustomer/addFormBaseCustomer.vue'
import addFormContainerPackaging from './tabItem/WmsContainerPackaging/addFormContainerPackaging.vue'
import addFormSub from './tabItem/WmsSubstituteGood/addFormWmsSubstituteGood.vue'
import addControlRule from './tabItem/WmsControlRule/addForm.vue'
import { WmsUnitPage, WmsUnitDelete, WmsUnitToExcel } from '@/api/modular/main/WmsBase/WmsUnitManage'
import { WmsUnitPage} from '@/api/modular/main/WmsBase/WmsUnitManage'
export default {
  components: {
    addForm,
@@ -165,7 +168,9 @@
      visible: false,
      confirmLoading: false,
      form: this.$form.createForm(this),
      materialTypeData2:[]
      materialTypeData2: [],
      selectTypeData2:[],
      selectTypeData1:[]
    }
  },
  methods: {
@@ -210,20 +215,43 @@
    },
    handleOk() { },
    // 初始化方法
    add(record) {
    add(record, type) {
      this.visible = true
      if (record) {//编辑
        if (type == '详情') {
          this.title = '详情物料信息详情';// 详情
        } else {
        this.title = '编辑基础物料信息';
        }
        this.$nextTick(() => {
          this.form.setFieldsValue({
            ...record
          })
        })
        WmsMaterialDetailList({
          id: record.id
        })
          .then(res => {
            if (res.success) {
              console.log("666666666666")
              console.log(res)
              this.$refs.WmsControlRule.list = res.data.baseCustomerList || []
              this.$refs.addFormBaseCustomer.list = res.data.controlRuleDetailList || []
              this.$refs.addFormWmsSubstituteGoodRef.list = res.data.substituteGoodList || []
              // 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
          })
     
      } else { // 新增
        this.title = '新增基础物料信息';
      } else {
        this.title = '新增基础物料信息';// 新增
      }
    },
    getSelects() {
@@ -297,6 +325,7 @@
            // ContainerPackagingList: this.$refs.addFormContainerPackagingRef.list //包装关系
          }
          this.confirmLoading = true
          if (this.title == '新增基础物料信息') {
          WmsMaterialAdd(param)
            .then(res => {
              if (res.success) {
@@ -312,6 +341,23 @@
              this.confirmLoading = false
            })
        } else {
            WmsMaterialEdit(param)
              .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
              })
          }
        } else {
          this.confirmLoading = false
        }
      })