zhangherong
2 天以前 9e1c79907d54bad69ee70e06a5ee6379c838094e
art: 热处理外协入库、小内圈外协入库、物料调拨
已修改3个文件
148 ■■■■■ 文件已修改
src/views/lsw/LswMaterialInboundList.vue 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/lsw/LswMaterialInventoryList.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/lsw/modules/LswMaterialInboundForm.vue 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/lsw/LswMaterialInboundList.vue
@@ -20,20 +20,26 @@
              <j-input placeholder="请输入物料编码" v-model="queryParam.materialNumber"></j-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="物料名称">
              <j-input placeholder="请输入物料名称" v-model="queryParam.materialName"></j-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="批次号">
              <j-input placeholder="请输入批次号" v-model="queryParam.batchNumber"></j-input>
            </a-form-item>
          </a-col>
          <template v-if="toggleSearchStatus">
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="物料名称">
                <j-input placeholder="请输入物料名称" v-model="queryParam.materialName"></j-input>
              </a-form-item>
            </a-col>
            <a-col :xl="6" :lg="7" :md="8" :sm="24">
              <a-form-item label="批次号">
                <j-input placeholder="请输入批次号" v-model="queryParam.batchNumber"></j-input>
              </a-form-item>
            </a-col>
          </template>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
              </a>
            </span>
          </a-col>
        </a-row>
@@ -43,9 +49,9 @@
    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button @click="handleAdd('HEAT_TREATMENT_INBOUND')" type="primary" icon="plus">热处理入库</a-button>
      <a-button @click="handleAdd('SMALL_INNER_RING')" type="primary" icon="plus">小内圈入库</a-button>
      <a-button @click="handleAdd('MATERIAL_INNER_TRANSFER')" type="primary" icon="plus">钢球调拨</a-button>
      <a-button @click="handleAdd('HEAT_TREATMENT_INBOUND')" type="primary" icon="plus">热处理外协入库</a-button>
      <a-button @click="handleAdd('SMALL_INNER_RING')" type="primary" icon="plus">小内圈外协入库</a-button>
      <a-button @click="handleAdd('MATERIAL_INNER_TRANSFER')" type="primary" icon="plus">内部调拨</a-button>
    </div>
    <!-- table区域-begin -->
    <div>
@@ -66,11 +72,6 @@
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        class="j-table-force-nowrap"
        @change="handleTableChange">
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>
          <a-divider type="vertical" />
          <a @click="handleDetail(record)">详情</a>
        </span>
      </a-table>
    </div>
@@ -149,21 +150,13 @@
          {
            title:'入库人',
            align:"center",
            dataIndex: 'receiver'
            dataIndex: 'receiver_dictText'
          },
          {
            title:'入库时间',
            align:"center",
            dataIndex: 'receiveTime'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/lsw/materialInbound/list",
src/views/lsw/LswMaterialInventoryList.vue
@@ -77,6 +77,11 @@
          align: 'center',
          dataIndex: 'inventoryStatus_dictText'
        },
        {
          title: '热处理标记',
          align: 'center',
          dataIndex: 'warehouseId_dictText'
        },
      ],
      url: {
        list: '/lsw/materialInventory/list',
src/views/lsw/modules/LswMaterialInboundForm.vue
@@ -4,8 +4,15 @@
      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
        <a-row>
          <a-col :span="12">
            <a-form-model-item label="来源编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="originalCode">
            <a-form-model-item label="来源编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="originalCode"
                               v-if="model.inboundCategory !== 'MATERIAL_INNER_TRANSFER'">
              <a-input v-model="model.originalCode" placeholder="请输入来源编码"></a-input>
            </a-form-model-item>
            <a-form-model-item label="来源线边库" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="originalCode"
                               v-else>
              <j-search-select-tag v-model="model.originalCode" placeholder="请选择线边库"
                                   :dict-options="originalCodeDictOptions"
                                   @change="originalCodeSelectChange"></j-search-select-tag>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
@@ -16,12 +23,14 @@
          <a-col :span="12">
            <a-form-model-item label="线边库" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="warehouseId">
              <j-search-select-tag v-model="model.warehouseId" placeholder="请选择线边库"
                                   :dict-options="warehouseDictOptions" @change="warehouseSelectChange"></j-search-select-tag>
                                   :dict-options="warehouseDictOptions"
                                   @change="warehouseSelectChange"></j-search-select-tag>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="物料编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialNumber">
              <j-search-select-tag :dict-options="materialDictOptions" v-model="model.materialNumber" placeholder="请选择物料编码" @change="materialSelectChange"></j-search-select-tag>
              <j-search-select-tag :dict-options="materialDictOptions" v-model="model.materialNumber"
                                   placeholder="请选择物料编码" @change="materialSelectChange"></j-search-select-tag>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
@@ -47,7 +56,8 @@
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="入库类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inboundCategory">
              <j-search-select-tag v-model="model.inboundCategory" dict="material_inbound_category"></j-search-select-tag>
              <j-search-select-tag v-model="model.inboundCategory"
                                   dict="material_inbound_category"></j-search-select-tag>
            </a-form-model-item>
          </a-col>
        </a-row>
@@ -62,8 +72,7 @@
export default {
  name: 'LswMaterialInboundForm',
  components: {
  },
  components: {},
  props: {
    //表单禁用
    disabled: {
@@ -107,20 +116,27 @@
        ],
        quantity: [
          { required: true, message: '入库数量是必选项', trigger: 'change' }
        ],
        ]
      },
      url: {
        add: '/lsw/materialInbound/add',
        edit: '/lsw/materialInbound/edit',
        queryById: '/lsw/materialInbound/queryById',
        queryByProductionType: '/base/lineSideWarehouse/queryByProductionType',
        queryByMaterialCategory: '/lsw/lswMaterial/queryByMaterialCategory',
        queryByMaterialCategory: '/lsw/lswMaterial/queryByMaterialCategory'
      }
    }
  },
  computed: {
    formDisabled() {
      return this.disabled
    },
    originalCodeDictOptions() {
      return this.warehouseDictOptions.map(warehouse => ({
        ...warehouse,
        value: warehouse.warehouseCode,
        text: warehouse.warehouseName + '(' + warehouse.warehouseCode + ')'
      }))
    }
  },
  created() {
@@ -129,19 +145,19 @@
  },
  methods: {
    add(inboundCategory) {
      this.warehouseDictOptions = [];
      this.materialDictOptions = [];
      if(inboundCategory === 'HEAT_TREATMENT_INBOUND') {
        this.loadWarehouseDictOptions('OUTERFLANGE,INNERFLANGE');
        this.loadMaterialDictOptions('BLANK');
      }else if(inboundCategory === 'SMALL_INNER_RING') {
        this.loadWarehouseDictOptions('ASSEMBLE');
        this.loadMaterialDictOptions('SMALL_INNER_RING');
      } else if(inboundCategory === 'MATERIAL_INNER_TRANSFER') {
        this.loadWarehouseDictOptions('ASSEMBLE');
        this.loadMaterialDictOptions('STEEL_BALL');
      this.warehouseDictOptions = []
      this.materialDictOptions = []
      if (inboundCategory === 'HEAT_TREATMENT_INBOUND') {
        this.loadWarehouseDictOptions('OUTERFLANGE,INNERFLANGE')
        this.loadMaterialDictOptions('BLANK')
      } else if (inboundCategory === 'SMALL_INNER_RING') {
        this.loadWarehouseDictOptions('ASSEMBLE')
        this.loadMaterialDictOptions('SMALL_INNER_RING')
      } else if (inboundCategory === 'MATERIAL_INNER_TRANSFER') {
        this.loadWarehouseDictOptions('ASSEMBLE,OUTERFLANGE,INNERFLANG,HEATTREATMENT')
        this.loadMaterialDictOptions('OUTER_FLANGE,INNER_FLANGE,STEEL_BALL,BLANK,COMPONENTS')
      }
      this.modelDefault.inboundCategory = inboundCategory;
      this.modelDefault.inboundCategory = inboundCategory
      this.edit(this.modelDefault)
    },
    edit(record) {
@@ -178,35 +194,51 @@
      })
    },
    loadWarehouseDictOptions(productionType) {
      let params = {productionType : productionType}
      let params = { productionType: productionType }
      getAction(this.url.queryByProductionType, params).then(res => {
        if(res.success) {
          this.warehouseDictOptions = res.result.map(warehouse => ({...warehouse, value : warehouse.id, text: warehouse.warehouseName + '(' + warehouse.warehouseCode+')'}));
        if (res.success) {
          this.warehouseDictOptions = res.result.map(warehouse => ({
            ...warehouse,
            value: warehouse.id,
            text: warehouse.warehouseName + '(' + warehouse.warehouseCode + ')'
          }))
        }
      })
    },
    loadMaterialDictOptions(materialCategory) {
      let params = {materialCategory : materialCategory}
      let params = { materialCategory: materialCategory }
      getAction(this.url.queryByMaterialCategory, params).then(res => {
        if(res.success) {
          this.materialDictOptions = res.result.map(material => ({...material, value : material.materialNumber, text: material.materialNumber}));
        if (res.success) {
          this.materialDictOptions = res.result.map(material => ({
            ...material,
            value: material.materialNumber,
            text: material.materialNumber + '(' + material.materialName + ')'
          }))
        }
      })
    },
    warehouseSelectChange(value) {
      let warehouse = this.warehouseDictOptions.find(option => option.value === value)
      if(warehouse) {
      if (warehouse) {
        this.model.factoryId = warehouse.factoryId
      }else {
        this.model.factoryId = undefined;
      } else {
        this.model.factoryId = undefined
      }
    },
    materialSelectChange(value) {
      let material = this.materialDictOptions.find(option => option.value === value)
      if(material) {
      if (material) {
        this.model.materialName = material.materialName
      }else {
        this.model.materialName = undefined;
      } else {
        this.model.materialName = undefined
      }
    },
    originalCodeSelectChange(value) {
      let warehouse = this.originalCodeDictOptions.find(option => option.value === value)
      if (warehouse) {
        this.model.originalName = warehouse.warehouseName
      } else {
        this.model.originalName = undefined
      }
    }
  }