<el-form
ref="form"
:inline="true"
:model="form"
size="small"
:rules="rules"
>
<el-table
ref="table"
:data="form.stockList"
style="width: 100%"
max-height="500"
row-key="id"
border
:header-cell-style="{
background: '#F2F6FA',
color: '#555555',
'text-align': 'center',
}"
>
<el-table-column label="库位编号" align="center" width="200">
<template slot-scope="scope">
<el-form-item
:rules="rules.positionNo"
:prop="'stockList.' + scope.$index + '.positionNo'"
>
<el-input
size="mini"
v-model="scope.row.positionNo"
placeholder="请输入库位编号"
maxlength="20"
show-word-limit
></el-input>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="库位类型" align="center">
<template slot-scope="scope">
<el-form-item
:rules="rules.positionType"
:prop="'stockList.' + scope.$index + '.positionType'"
>
<el-select
size="mini"
v-model="scope.row.positionType"
placeholder="请选择"
>
<el-option label="地堆" :value="1"></el-option>
<el-option label="货架" :value="2"></el-option>
</el-select>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="仓库名称" align="center">
<template slot-scope="scope">
<el-form-item
:rules="rules.houseId"
:prop="'stockList.' + scope.$index + '.houseId'"
>
<el-select
v-model="scope.row.houseId"
filterable
remote
reserve-keyword
placeholder="请输入仓库名称"
:remote-method="getProductHouseItemList"
:loading="romoteLoading"
@change="
(id) => {
houseChange(scope.$index, id);
}
"
>
<el-option
v-for="item in productHouseList"
:key="item.id"
:label="item.houseName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="库区名称" align="center">
<template slot-scope="scope">
<el-form-item
:rules="rules.stockAreaId"
:prop="'stockList.' + scope.$index + '.stockAreaId'"
>
<el-select
size="mini"
v-model="scope.row.stockAreaId"
placeholder="请选择"
>
<el-option
:label="item.areaName"
:value="item.id"
v-for="item in areaList"
:key="item.id"
></el-option>
</el-select>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="操作" width="160" align="center">
<template slot-scope="scope">
<el-row class="handle-table-box">
<el-button
size="mini"
type="primary"
@click="handleAdd(scope.$index, scope.row)"
>
添加
</el-button>
<el-button
v-if="scope.$index > 0"
size="mini"
type="danger"
@click="handleDelete(scope.$index, scope.row)"
>删除
</el-button>
</el-row>
</template>
</el-table-column>
</el-table>
</el-form>