liuying
2024-04-24 0c525ecf57809add2b988f331e22a74022ad1070
iWare_RawMaterialWarehouse_Web/src/views/main/WmsBase/WmsMaterial/tabItem/WmsSubstituteGood/addFormWmsSubstituteGood.vue
@@ -1,5 +1,5 @@
<template>
  <!-- 替代品管理 -->
  <!-- 替代品管理 -表格内容 -->
  <div style="background-color: white">
    <!-- <a-spin :spinning="loading"> -->
    <div class="wms-task-management-detail-div">
@@ -7,6 +7,8 @@
        <!-- <span style="font-weight:bold;cursor:default;">
          <a style="cursor:default;">{{ row.no }}</a>单据详情
        </span> -->
        <!-- 物料编号: {{  materialCode }}
        物料名称: {{    materialName }} -->
        <div style="margin-top: 10px;">
          <a-table :columns="columns" :data-source="list" row-key="id" :pagination="false" :scroll="{ x: true }">
            <template slot="index" slot-scope="text, record, index">{{ index + 1 }}</template>
@@ -24,21 +26,15 @@
          </a-table>
        </div>
      </div>
      <p @click="visible = true">新增行</p>
      <a-modal title="替代品列表" :width="900" :visible="visible" :confirmLoading="confirmLoading" @ok="handleSubmit"
        @cancel="handleCancel">
        <show-list ref="showList" @ok="handleOk" />
        <!-- <a-spin :spinning="confirmLoading"></a-spin> -->
      </a-modal>
      <p @click="$refs.showList.add()">新增行</p>
      <show-list ref="showList" @ok="handleSubmit" />
    </div>
  </div>
</template>
<script>
import { WmsOrderRukuDetail } from '@/api/modular/main/WmsOrderManage'
import showList from './index.vue'
import showList from './addForm.vue'
export default {
  name: 'wmsOrderRukuManagementDetailDrawer',
@@ -72,66 +68,66 @@
          scopedSlots: { customRender: 'index' },
          align: 'center'
        },
        {
               title: '替代编号',
               align: 'center',
               customHeaderCell: () => {
                  return {
                     style: {
                        'min-width': '120px'//最小列宽设置
                     }
                  }
               },
               customCell: () => {
                  return {
                     style: {
                        'min-width': '120px'//最小列宽设置
                     }
                  }
               },
               sorter: true,
               dataIndex: 'substituteCode'
            },
            {
               title: '物料编号',
               align: 'center',
               customHeaderCell: () => {
                  return {
                     style: {
                        'min-width': '120px'//最小列宽设置
                     }
                  }
               },
               customCell: () => {
                  return {
                     style: {
                        'min-width': '120px'//最小列宽设置
                     }
                  }
               },
               sorter: true,
               dataIndex: 'materialCode'
            },
            {
               title: '物料名称',
               align: 'center',
               customHeaderCell: () => {
                  return {
                     style: {
                        'min-width': '120px'//最小列宽设置
                     }
                  }
               },
               customCell: () => {
                  return {
                     style: {
                        'min-width': '120px'//最小列宽设置
                     }
                  }
               },
               sorter: true,
               dataIndex: 'materialName'
            },
        // {
            //    title: '替代编号',
            //    align: 'center',
            //    customHeaderCell: () => {
            //       return {
            //          style: {
            //             'min-width': '120px'//最小列宽设置
            //          }
            //       }
            //    },
            //    customCell: () => {
            //       return {
            //          style: {
            //             'min-width': '120px'//最小列宽设置
            //          }
            //       }
            //    },
            //    sorter: true,
            //    dataIndex: 'substituteCode'
            // },
            // {
            //    title: '物料编号',
            //    align: 'center',
            //    customHeaderCell: () => {
            //       return {
            //          style: {
            //             'min-width': '120px'//最小列宽设置
            //          }
            //       }
            //    },
            //    customCell: () => {
            //       return {
            //          style: {
            //             'min-width': '120px'//最小列宽设置
            //          }
            //       }
            //    },
            //    sorter: true,
            //    dataIndex: 'materialCode'
            // },
            // {
            //    title: '物料名称',
            //    align: 'center',
            //    customHeaderCell: () => {
            //       return {
            //          style: {
            //             'min-width': '120px'//最小列宽设置
            //          }
            //       }
            //    },
            //    customCell: () => {
            //       return {
            //          style: {
            //             'min-width': '120px'//最小列宽设置
            //          }
            //       }
            //    },
            //    sorter: true,
            //    dataIndex: 'materialName'
            // },
            {
               title: '替代品物料编号',
               align: 'center',
@@ -152,26 +148,26 @@
               sorter: true,
               dataIndex: 'substituteMaterialCode'
            },
            {
               title: '替代品物料名称',
               align: 'center',
               customHeaderCell: () => {
                  return {
                     style: {
                        'min-width': '140px'//最小列宽设置
                     }
                  }
               },
               customCell: () => {
                  return {
                     style: {
                        'min-width': '140px'//最小列宽设置
                     }
                  }
               },
               sorter: true,
               dataIndex: 'substituteMaterialName'
            },
            // {
            //    title: '替代品物料名称',
            //    align: 'center',
            //    customHeaderCell: () => {
            //       return {
            //          style: {
            //             'min-width': '140px'//最小列宽设置
            //          }
            //       }
            //    },
            //    customCell: () => {
            //       return {
            //          style: {
            //             'min-width': '140px'//最小列宽设置
            //          }
            //       }
            //    },
            //    sorter: true,
            //    dataIndex: 'substituteMaterialName'
            // },
            {
               title: '替代次序',
               align: 'center',
@@ -234,11 +230,14 @@
        this.afterClsoe()
      }
    },
    initShow() {
      this.loading = true
      this.getList(() => {
        this.loading = false
      })
    initShowSubstituteGood() {
      // this.materialCode = materialCode
      // this.materialName = materialName
      // this.loading = true
      // this.getList(() => {
      //   this.loading = false
      // })
    },
    getList(row) {
      let params = { id: row.id }
@@ -258,9 +257,15 @@
      this.list = []
    },
    handleOk(param) {
      this.list = param
    },
    handleSubmit() {
    handleSubmit(item) {
      var arr1 = this.list.filter(key => key.substituteMaterialCode === item.substituteMaterialCode)
      if(arr1.length>0){
        this.$message.warning("已存在相同物料")
        return
      }
      this.list.push(item)
      this.visible = false
    },
    handleCancel() {