|
@@ -18,7 +18,7 @@
|
|
|
:wrapper-col="formItemLayout.wrapperCol">
|
|
|
<a-form-model-item label="货架名称">{{ nowData&&nowData.shelfName || '--' }}</a-form-model-item>
|
|
|
<a-form-model-item label="货位号" prop="shelfPlaceCode">
|
|
|
- <a-input v-model="form.shelfPlaceCode" placeholder="请输入货位号"></a-input>
|
|
|
+ <a-input v-model="form.shelfPlaceCode" @input="placeCodeBlur" placeholder="请输入货位号(字母+数字格式)"></a-input>
|
|
|
</a-form-model-item>
|
|
|
<a-form-model-item label="绑定产品" v-if="type=='add'">
|
|
|
<productJqList ref="productJqList" :params="{customerSn:nowData&&nowData.customerSn}" @change="productJqChange"></productJqList>
|
|
@@ -118,7 +118,13 @@ export default {
|
|
|
maxQty: ''
|
|
|
},
|
|
|
rules: {
|
|
|
- shelfPlaceCode: [{ required: true, message: '请输入货位号', trigger: 'blur' }],
|
|
|
+ shelfPlaceCode: [
|
|
|
+ { required: true, message: '请输入货位号', trigger: 'blur' },
|
|
|
+ {
|
|
|
+ pattern: /^[a-zA-Z]{1}[0-9]{1,29}$/g,
|
|
|
+ message: '必需字母开头且后面紧跟数字'
|
|
|
+ }
|
|
|
+ ],
|
|
|
price: [{ required: true, message: '请输入销售价', trigger: 'blur' }],
|
|
|
cost: [{ required: true, message: '请输入结算价', trigger: 'blur' }],
|
|
|
maxQty: [{ required: true, message: '请输入最大库容', trigger: 'blur' }]
|
|
@@ -146,6 +152,11 @@ export default {
|
|
|
this.form.cost = obj && obj.row && obj.row.cost || ''
|
|
|
this.productName = obj && obj.row && obj.row.name || ''
|
|
|
},
|
|
|
+ placeCodeBlur (v) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.form.shelfPlaceCode = this.form.shelfPlaceCode.toLocaleUpperCase()
|
|
|
+ })
|
|
|
+ },
|
|
|
// 保存
|
|
|
handleSave () {
|
|
|
const _this = this
|
|
@@ -154,7 +165,7 @@ export default {
|
|
|
const params = {}
|
|
|
const form = JSON.parse(JSON.stringify(_this.form))
|
|
|
params.shelfSn = _this.nowData && _this.nowData.shelfSn
|
|
|
- params.shelfPlaceCode = form.shelfPlaceCode
|
|
|
+ params.shelfPlaceCode = form.shelfPlaceCode.toLocaleUpperCase()
|
|
|
if (this.type == 'edit') {
|
|
|
params.id = this.nowData.id
|
|
|
}
|