|
@@ -26,9 +26,9 @@
|
|
placeholder="请输入仓位名称(最多30个字符)"
|
|
placeholder="请输入仓位名称(最多30个字符)"
|
|
allowClear />
|
|
allowClear />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
- <a-form-model-item label="所属仓库" prop="whId">
|
|
|
|
- <a-select id="storingLocationEdit-whId" disabled placeholder="请选择所属仓库" allowClear v-model="form.whId">
|
|
|
|
- <a-select-option v-for="item in warehouseList" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
|
|
|
|
|
|
+ <a-form-model-item label="所属仓库" prop="warehouseSn">
|
|
|
|
+ <a-select id="storingLocationEdit-warehouseSn" disabled placeholder="请选择所属仓库" allowClear v-model="form.warehouseSn">
|
|
|
|
+ <a-select-option v-for="item in warehouseList" :key="item.id" :value="item.warehouseSn">{{ item.name }}</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
<a-form-model-item label="排序" prop="sort">
|
|
<a-form-model-item label="排序" prop="sort">
|
|
@@ -84,14 +84,14 @@ export default {
|
|
},
|
|
},
|
|
form: {
|
|
form: {
|
|
name: '', // 仓位名称
|
|
name: '', // 仓位名称
|
|
- whId: undefined, // 所属仓库
|
|
|
|
|
|
+ warehouseSn: undefined, // 所属仓库
|
|
sort: '' // 排序
|
|
sort: '' // 排序
|
|
},
|
|
},
|
|
rules: {
|
|
rules: {
|
|
name: [
|
|
name: [
|
|
{ required: true, message: '请输入仓位名称', trigger: 'blur' }
|
|
{ required: true, message: '请输入仓位名称', trigger: 'blur' }
|
|
],
|
|
],
|
|
- whId: [
|
|
|
|
|
|
+ warehouseSn: [
|
|
{ required: true, message: '请选择所属仓库', trigger: 'change' }
|
|
{ required: true, message: '请选择所属仓库', trigger: 'change' }
|
|
]
|
|
]
|
|
},
|
|
},
|
|
@@ -113,8 +113,8 @@ export default {
|
|
getDetail () {
|
|
getDetail () {
|
|
this.form = {
|
|
this.form = {
|
|
name: this.nowData && this.nowData.name ? this.nowData.name : '',
|
|
name: this.nowData && this.nowData.name ? this.nowData.name : '',
|
|
- whId: this.nowData && this.nowData.whId ? this.nowData.whId : '',
|
|
|
|
- sort: this.nowData && this.nowData.sort ? this.nowData.sort : ''
|
|
|
|
|
|
+ warehouseSn: this.nowData && this.nowData.warehouseSn ? this.nowData.warehouseSn : '',
|
|
|
|
+ sort: this.nowData && (this.nowData.sort || this.nowData.sort == 0) ? this.nowData.sort : ''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 保存
|
|
// 保存
|
|
@@ -124,10 +124,9 @@ export default {
|
|
if (valid) {
|
|
if (valid) {
|
|
const params = {
|
|
const params = {
|
|
id: this.itemId ? this.itemId : undefined,
|
|
id: this.itemId ? this.itemId : undefined,
|
|
- whId: this.form.whId, // 所属仓库
|
|
|
|
|
|
+ warehouseSn: this.form.warehouseSn, // 所属仓库
|
|
name: this.form.name, // 仓库名称
|
|
name: this.form.name, // 仓库名称
|
|
- sort: this.form.sort, // 排序
|
|
|
|
- isDefault: 0 // 是否为默认仓位 0为非默认,1为默认
|
|
|
|
|
|
+ sort: this.form.sort // 排序
|
|
}
|
|
}
|
|
warehouseLocSave(params).then(res => {
|
|
warehouseLocSave(params).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
@@ -157,12 +156,17 @@ export default {
|
|
isShow (newValue, oldValue) {
|
|
isShow (newValue, oldValue) {
|
|
if (!newValue) {
|
|
if (!newValue) {
|
|
this.$refs.ruleForm.resetFields()
|
|
this.$refs.ruleForm.resetFields()
|
|
|
|
+ this.form = {
|
|
|
|
+ name: '',
|
|
|
|
+ warehouseSn: '',
|
|
|
|
+ sort: ''
|
|
|
|
+ }
|
|
this.$emit('close')
|
|
this.$emit('close')
|
|
} else {
|
|
} else {
|
|
this.getWarehouseList()
|
|
this.getWarehouseList()
|
|
this.form = {
|
|
this.form = {
|
|
name: '',
|
|
name: '',
|
|
- whId: this.nowData && this.nowData.whId ? this.nowData.whId : '',
|
|
|
|
|
|
+ warehouseSn: this.nowData && this.nowData.warehouseSn ? this.nowData.warehouseSn : '',
|
|
sort: ''
|
|
sort: ''
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -179,11 +183,11 @@ export default {
|
|
<style lang="less">
|
|
<style lang="less">
|
|
.storingLocationEdit-modal{
|
|
.storingLocationEdit-modal{
|
|
.ant-modal-body {
|
|
.ant-modal-body {
|
|
- padding: 40px 40px 24px;
|
|
|
|
|
|
+ padding: 40px 40px 24px;
|
|
}
|
|
}
|
|
.btn-cont {
|
|
.btn-cont {
|
|
- text-align: center;
|
|
|
|
- margin: 35px 0 10px;
|
|
|
|
|
|
+ text-align: center;
|
|
|
|
+ margin: 35px 0 10px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|