Commit b51b7f63 authored by Marcus's avatar Marcus

1.入仓补充,打开多入仓记录,一共3行数据,一行空白数据,点击减号可以删除两行,包含空数据那行,剩余2行

2.保存提示入仓成功
3.重新点击追加,页面仍是3行
4.删除两行后,再点击加号,会将空数据行变为不可修改的行
https://zentao.test.jdshangmen.com/bug-view-2705.html
parent c6758962
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>{{ $t('入仓记录') }}</span> <span>{{ $t('入仓记录') }}</span>
<el-button style="float: right;margin-left: 15px" size="mini" type="primary" icon="el-icon-minus" circle @click="handleDelete" :disabled="form.table.length <= protectRowCount"></el-button> <el-button style="float: right;margin-left: 15px" size="mini" type="primary" icon="el-icon-minus" circle @click="handleDelete" :disabled="form.table.length < protectRowCount"></el-button>
<el-button style="float: right" size="mini" type="primary" icon="el-icon-plus" circle @click="handleAdd()"></el-button> <el-button style="float: right" size="mini" type="primary" icon="el-icon-plus" circle @click="handleAdd()"></el-button>
</div> </div>
<el-form ref="tableForm" :rules="tableFormRules" :model="form" size="mini"> <el-form ref="tableForm" :rules="tableFormRules" :model="form" size="mini">
...@@ -77,10 +77,10 @@ ...@@ -77,10 +77,10 @@
<span style="color: red">*</span>{{ $t('箱数') }}</template> <span style="color: red">*</span>{{ $t('箱数') }}</template>
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.cartonsNum"> <el-form-item :rules="tableFormRules.cartonsNum">
<el-input v-model="form.table[$index].cartonsNum" placeholder="" @blur="handleVolume($index)" :disabled="$index <= protectRowCount"> <el-input v-model="form.table[$index].cartonsNum" placeholder="" @blur="handleVolume($index)" :disabled="$index < protectRowCount">
<span slot="append">{{ getDictDataLabel(DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE, form.table[$index].specificationType) }}</span> <span slot="append">{{ getDictDataLabel(DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE, form.table[$index].specificationType) }}</span>
</el-input> </el-input>
<dict-selector :disabled="$index <= protectRowCount" :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" v-model="form.table[$index].specificationType" @change="handleVolume($index)"></dict-selector> <dict-selector :disabled="$index < protectRowCount" :type="DICT_TYPE.WAREHOUSING_SPECIFICATION_TYPE" v-model="form.table[$index].specificationType" @change="handleVolume($index)"></dict-selector>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
<span style="color: red">*</span>{{ $t('包装类型') }}</template> <span style="color: red">*</span>{{ $t('包装类型') }}</template>
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item> <el-form-item>
<dict-selector :disabled="$index <= protectRowCount" :type="DICT_TYPE.ECW_PACKAGING_TYPE" v-model="form.table[$index].unit"></dict-selector> <dict-selector :disabled="$index < protectRowCount" :type="DICT_TYPE.ECW_PACKAGING_TYPE" v-model="form.table[$index].unit"></dict-selector>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
</template> </template>
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.boxGauge1"> <el-form-item :rules="tableFormRules.boxGauge1">
<el-input :disabled="$index <= protectRowCount" type="number" v-model="form.table[$index].boxGauge1" placeholder="" @blur="handleVolume($index)"></el-input> <el-input :disabled="$index < protectRowCount" type="number" v-model="form.table[$index].boxGauge1" placeholder="" @blur="handleVolume($index)"></el-input>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
</template> </template>
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.boxGauge2"> <el-form-item :rules="tableFormRules.boxGauge2">
<el-input :disabled="$index <= protectRowCount" type="number" v-model="form.table[$index].boxGauge2" placeholder="" @blur="handleVolume($index)"></el-input> <el-input :disabled="$index < protectRowCount" type="number" v-model="form.table[$index].boxGauge2" placeholder="" @blur="handleVolume($index)"></el-input>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
</template> </template>
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.boxGauge3"> <el-form-item :rules="tableFormRules.boxGauge3">
<el-input :disabled="$index <= protectRowCount" type="number" v-model="form.table[$index].boxGauge3" placeholder="" @blur="handleVolume($index)"></el-input> <el-input :disabled="$index < protectRowCount" type="number" v-model="form.table[$index].boxGauge3" placeholder="" @blur="handleVolume($index)"></el-input>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
</template> </template>
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.volume"> <el-form-item :rules="tableFormRules.volume">
<el-input :disabled="$index <= protectRowCount" v-model="form.table[$index].volume" placeholder="" type="number"></el-input> <el-input :disabled="$index < protectRowCount" v-model="form.table[$index].volume" placeholder="" type="number"></el-input>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
...@@ -139,14 +139,14 @@ ...@@ -139,14 +139,14 @@
</template> </template>
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.weight"> <el-form-item :rules="tableFormRules.weight">
<el-input :disabled="$index <= protectRowCount" v-model="form.table[$index].weight" placeholder="" type="number"></el-input> <el-input :disabled="$index < protectRowCount" v-model="form.table[$index].weight" placeholder="" type="number"></el-input>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('数量')" width="130px"> <el-table-column :label="$t('数量')" width="130px">
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.quantityAll"> <el-form-item :rules="tableFormRules.quantityAll">
<el-input :disabled="$index <= protectRowCount" v-model.number="form.table[$index].quantityAll" placeholder=""> <el-input :disabled="$index < protectRowCount" v-model.number="form.table[$index].quantityAll" placeholder="">
<template slot="append">{{ $t('') }}</template> <template slot="append">{{ $t('') }}</template>
</el-input> </el-input>
</el-form-item> </el-form-item>
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
<el-table-column :label="$t('快递单号')"> <el-table-column :label="$t('快递单号')">
<template v-slot="{r,c,$index}"> <template v-slot="{r,c,$index}">
<el-form-item> <el-form-item>
<el-input :disabled="$index <= protectRowCount" v-model="form.table[$index].expressNo" placeholder=""></el-input> <el-input :disabled="$index < protectRowCount" v-model="form.table[$index].expressNo" placeholder=""></el-input>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
...@@ -617,7 +617,7 @@ export default { ...@@ -617,7 +617,7 @@ export default {
}) })
if (!this.edit){ if (!this.edit){
let protectRowCount = -1 let protectRowCount = 0
this.protectRowCount = this.form.table.map(e => { this.protectRowCount = this.form.table.map(e => {
if (e.id){ if (e.id){
protectRowCount++ protectRowCount++
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment