|
@@ -28,7 +28,7 @@
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
<el-form-item label="仓库档案名称">
|
|
|
- <el-select size="small" v-model="basicForm.warehouseCode" :disabled="disable" @focus="chooseRefer('WAREHOUSE_PARAM', true, '仓库档案名称')" style="width: 200px">
|
|
|
+ <el-select size="small" v-model="basicForm.warehouse" :disabled="disable" @focus="chooseRefer('WAREHOUSE_PARAM', true, '仓库档案名称')" style="width: 200px">
|
|
|
<el-option v-for="item in houseOptions" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
@@ -57,8 +57,8 @@
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
<el-form-item label="联系人">
|
|
|
- <el-select size="small" v-model="basicForm.contactsName" :disabled="disable" @focus="chooseRefer('CONTACTS_PARAM', true, '联系人')" style="width: 200px">
|
|
|
- <el-option v-for="item in contactsOptions" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
+ <el-select size="small" v-model="basicForm.contacts" :disabled="disable" @focus="chooseRefer('CONTACTS_PARAM', true, '联系人')" style="width: 200px">
|
|
|
+ <el-option v-for="item in contactsOptions" :key="item.id" :label="item.name" :value="item.code" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -105,9 +105,9 @@
|
|
|
|
|
|
<el-col :span="1.5">
|
|
|
<el-form-item label="同步状态">
|
|
|
- <el-select v-model="basicForm.sendStatus" size="small" style="width: 200px" clearable :disabled="disable">
|
|
|
+ <el-select disabled v-model="basicForm.sendStatus" size="small" style="width: 200px">
|
|
|
<el-option
|
|
|
- v-for="item in options"
|
|
|
+ v-for="item in options2"
|
|
|
:key="item.value"
|
|
|
:label="item.label"
|
|
|
:value="item.value">
|
|
@@ -153,6 +153,8 @@
|
|
|
import Refers from '@/components/Refers/refers.vue'
|
|
|
import TreeRefers from '@/components/Refers/treeRefer.vue'
|
|
|
import {addAddress, getAddressDetail, editAddress} from '@/api/purchase/deliveryAddress.js'
|
|
|
+// 用于回显参照框数据
|
|
|
+import { getRefer } from '@/api/purchase/basic.js'
|
|
|
export default {
|
|
|
name: 'addAddress',
|
|
|
dicts: ['sys_warehouse_attribute'],
|
|
@@ -171,7 +173,7 @@ export default {
|
|
|
code: '',
|
|
|
name: '',
|
|
|
warehouse: '',
|
|
|
- warehouseCode: '',
|
|
|
+ warehouseName: '',
|
|
|
warehouseProperty: '',
|
|
|
address: '',
|
|
|
contacts: '',
|
|
@@ -180,7 +182,7 @@ export default {
|
|
|
materialClassify: '',
|
|
|
materialClassifyName: '',
|
|
|
status: '',
|
|
|
- sendStatus: '',
|
|
|
+ sendStatus: '2',
|
|
|
remark: '',
|
|
|
},
|
|
|
referCondition: {
|
|
@@ -189,9 +191,14 @@ export default {
|
|
|
title: ''
|
|
|
},
|
|
|
options: [{
|
|
|
- value: '1', label: '是',
|
|
|
+ value: '0', label: '启用',
|
|
|
+ }, {
|
|
|
+ value: '2', label: '停用'
|
|
|
+ }],
|
|
|
+ options2: [{
|
|
|
+ value: '0', label: '已同步',
|
|
|
}, {
|
|
|
- value: '0', label: '否'
|
|
|
+ value: '2', label: '未同步'
|
|
|
}],
|
|
|
houseOptions: [],
|
|
|
contactsOptions: [],
|
|
@@ -239,6 +246,9 @@ export default {
|
|
|
getAddressDetail(row.id).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.basicForm = res.data
|
|
|
+ if (this.basicForm.warehouse) { this.reBackRefer('WAREHOUSE_PARAM', this.basicForm.warehouse) }
|
|
|
+ if (this.basicForm.contacts) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.contacts) }
|
|
|
+ if (this.basicForm.materialClassify) { this.reBackRefer('MATERIALCLASSIFY_PARAM', this.basicForm.materialClassify) }
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -251,11 +261,13 @@ export default {
|
|
|
selectionsToInput(selection) {
|
|
|
if (this.referCondition.type == 'WAREHOUSE_PARAM') {
|
|
|
this.houseOptions = selection
|
|
|
- this.basicForm.warehouseCode = selection[0].id
|
|
|
+ this.basicForm.warehouseName = selection[0].name
|
|
|
+ this.basicForm.warehouse = selection[0].id
|
|
|
}
|
|
|
if (this.referCondition.type == 'CONTACTS_PARAM') {
|
|
|
this.contactsOptions = selection
|
|
|
- this.basicForm.contactsName = selection[0].id
|
|
|
+ this.basicForm.contactsName = selection[0].name
|
|
|
+ this.basicForm.contacts = selection[0].code
|
|
|
}
|
|
|
},
|
|
|
chooseTreeRefer(type, isPage, title) {
|
|
@@ -267,6 +279,21 @@ export default {
|
|
|
selectionsToInput2(selection) {
|
|
|
this.classOptions.push(selection)
|
|
|
this.basicForm.materialClassify = selection.id
|
|
|
+ this.basicForm.materialClassifyName = selection.name
|
|
|
+ },
|
|
|
+ // 回显参照框 加title解决判断重复提交问题
|
|
|
+ reBackRefer(type, id, title) {
|
|
|
+ getRefer({ type: type, id: id, title: title }).then(res => {
|
|
|
+ if (type == 'WAREHOUSE_PARAM') {
|
|
|
+ this.houseOptions = res.rows
|
|
|
+ }
|
|
|
+ if (type == 'CONTACTS_PARAM') {
|
|
|
+ this.contactsOptions = res.rows
|
|
|
+ }
|
|
|
+ if (type == 'MATERIALCLASSIFY_PARAM') {
|
|
|
+ this.classOptions = res.rows
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
}
|
|
|
}
|