Commit 206319da authored by Marcus's avatar Marcus

入仓补充、入仓修改功能完善

https://zentao.test.jdshangmen.com/bug-view-2710.html
parent 0e65e2d0
......@@ -12,12 +12,12 @@
<el-descriptions border :column="2">
<el-descriptions-item>
<template slot="label"><span style="color: red">*</span>{{ $t('中文品名') }}</template>
<product-selector v-if="!order.parentOrderId" v-model="form.prodId" @change="onProductChange"/>
<product-selector v-if="!order.parentOrderId && !isAdd" v-model="form.prodId" @change="onProductChange"/>
<span v-else>{{ warehousing.prodTitleZh }}</span>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label"><span style="color: red">*</span>{{ $t('英文品名') }}</template>
<product-selector v-if="!order.parentOrderId" lang="En" v-model="form.prodId" @change="onProductChange"/>
<product-selector v-if="!order.parentOrderId && !isAdd" lang="En" v-model="form.prodId" @change="onProductChange"/>
<span v-else>{{ warehousing.prodTitleEn }}</span>
</el-descriptions-item>
<el-descriptions-item :label="$t('品牌')">
......@@ -65,7 +65,7 @@
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>{{ $t('入仓记录') }}</span>
<el-button style="float: right;margin-left: 15px" size="mini" type="primary" icon="el-icon-minus" circle @click="handleDelete"></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>
</div>
<el-form ref="tableForm" :rules="tableFormRules" :model="form" size="mini">
......@@ -77,10 +77,10 @@
<span style="color: red">*</span>{{ $t('箱数') }}</template>
<template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.cartonsNum">
<el-input v-model="form.table[$index].cartonsNum" placeholder="" @blur="handleVolume($index)">
<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>
</el-input>
<dict-selector :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>
</template>
</el-table-column>
......@@ -89,7 +89,7 @@
<span style="color: red">*</span>{{ $t('包装类型') }}</template>
<template v-slot="{r,c,$index}">
<el-form-item>
<dict-selector :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>
</template>
</el-table-column>
......@@ -99,7 +99,7 @@
</template>
<template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.boxGauge1">
<el-input 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>
</template>
</el-table-column>
......@@ -109,7 +109,7 @@
</template>
<template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.boxGauge2">
<el-input 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>
</template>
</el-table-column>
......@@ -119,7 +119,7 @@
</template>
<template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.boxGauge3">
<el-input 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>
</template>
</el-table-column>
......@@ -129,7 +129,7 @@
</template>
<template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.volume">
<el-input 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>
</template>
</el-table-column>
......@@ -139,14 +139,14 @@
</template>
<template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.weight">
<el-input 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>
</template>
</el-table-column>
<el-table-column :label="$t('数量')" width="130px">
<template v-slot="{r,c,$index}">
<el-form-item :rules="tableFormRules.quantityAll">
<el-input 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>
</el-input>
</el-form-item>
......@@ -155,7 +155,7 @@
<el-table-column :label="$t('快递单号')">
<template v-slot="{r,c,$index}">
<el-form-item>
<el-input 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>
</template>
</el-table-column>
......@@ -442,6 +442,9 @@ export default {
},
computed: {
isAdd() {
return this.$route.path === "/order/warehousing-add"
},
warehousing(){
return {...this.orderItemA, ...this.orderItemB}
},
......@@ -573,7 +576,10 @@ export default {
// 入仓修改正在审核中
isEditing: false,
// 审批业务id
formId: ''
formId: '',
// 追加时被保护的行数
protectRowCount: -1
}
},
......@@ -608,6 +614,16 @@ export default {
}
})
if (this.isAdd) {
let protectRowCount = -1
this.protectRowCount = this.form.table.map(e => {
if (e.id){
protectRowCount++
}
})
this.protectRowCount = protectRowCount
}
if (!this.edit){
this.handleAdd()
this.handleAdd(1)
......@@ -769,7 +785,11 @@ export default {
})
},
handleDelete(val) {
(val === 1 ? this.form1 : this.form).table.pop()
if (val === 1) {
this.form1.table.pop()
} else if (this.form.table.length > this.protectRowCount) {
this.form.table.pop()
}
},
handleAdd(val = 0) {
let cartonsNum = ''
......
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