|
@@ -30,7 +30,7 @@
|
|
|
</a-col>
|
|
|
<a-col :span="24" class="item-w">
|
|
|
<div class="item-label">地址:</div>
|
|
|
- <div class="item-cont">{{ storeInfo.addrProvinceName }} - {{ storeInfo.addrCityName }} - {{ storeInfo.addrDistrictName }} - {{ storeInfo.addrDetail }}</div>
|
|
|
+ <div class="item-cont">{{ storeInfo.addrProvinceName }}{{ storeInfo.addrCityName }}{{ storeInfo.addrDistrictName }}{{ storeInfo.addrDetail }}</div>
|
|
|
</a-col>
|
|
|
<a-col :span="8" class="item-w">
|
|
|
<div class="item-label">纬度:</div>
|
|
@@ -63,7 +63,8 @@
|
|
|
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
|
|
|
:tree-data="treeData"
|
|
|
placeholder="请选择组织归属"
|
|
|
- treeNodeFilterProp="title">
|
|
|
+ treeNodeFilterProp="title"
|
|
|
+ @change="treeChange">
|
|
|
</a-tree-select>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
@@ -107,6 +108,7 @@ export default {
|
|
|
orgCode: [{ required: true, message: '请选择所属组织归属', trigger: 'change' }]
|
|
|
},
|
|
|
treeData: [],
|
|
|
+ parentCodePaths: '', // 机构编码父路径
|
|
|
storeInfo: null // 门店详情
|
|
|
}
|
|
|
},
|
|
@@ -114,9 +116,9 @@ export default {
|
|
|
// 门店详情
|
|
|
getStoreInfo (id) {
|
|
|
findStoreDetail({ id: id }).then(res => {
|
|
|
- console.log(res, '————————')
|
|
|
if (res.status == 200) {
|
|
|
this.storeInfo = res.data
|
|
|
+ this.form.orgCode = res.data.orgCode
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -124,7 +126,7 @@ export default {
|
|
|
getOrgList () {
|
|
|
findOrgTree().then(res => {
|
|
|
if (res.status == 200) {
|
|
|
- this.treeData = this.recursionFun(res.data.list)
|
|
|
+ this.treeData = this.recursionFun(res.data)
|
|
|
} else {
|
|
|
this.treeData = []
|
|
|
}
|
|
@@ -132,28 +134,34 @@ export default {
|
|
|
},
|
|
|
// 递归函数
|
|
|
recursionFun (data) {
|
|
|
- data.map(item => {
|
|
|
- if (item.children && item.children.length == 0) {
|
|
|
- item.key = item.id ? 'org' + item.id : ''
|
|
|
- item.value = item.id ? item.id : ''
|
|
|
- item.title = item.name ? item.name : ''
|
|
|
- } else {
|
|
|
- item.key = item.id ? 'org' + item.id : ''
|
|
|
- item.value = item.id ? item.id : ''
|
|
|
- item.title = item.name ? item.name : ''
|
|
|
- this.recursionFun(item.children)
|
|
|
- }
|
|
|
- })
|
|
|
+ if (data) {
|
|
|
+ data.map(item => {
|
|
|
+ if (item.children && item.children.length == 0) {
|
|
|
+ item.key = item.id ? 'org' + item.id : ''
|
|
|
+ item.value = item.code ? item.code : ''
|
|
|
+ item.title = item.name ? item.name : ''
|
|
|
+ } else {
|
|
|
+ item.key = item.id ? 'org' + item.id : ''
|
|
|
+ item.value = item.code ? item.code : ''
|
|
|
+ item.title = item.name ? item.name : ''
|
|
|
+ this.recursionFun(item.children)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
return data
|
|
|
},
|
|
|
+ // 组织归属 change
|
|
|
+ treeChange (value, label, extra) {
|
|
|
+ this.parentCodePaths = extra.triggerNode.$options.propsData.dataRef.parentCodePaths
|
|
|
+ },
|
|
|
// 保存
|
|
|
onSubmit () {
|
|
|
const _this = this
|
|
|
_this.$refs.ruleForm.validate(valid => {
|
|
|
if (valid) {
|
|
|
const formData = JSON.parse(JSON.stringify(_this.form))
|
|
|
- formData.tenantId = this.storeId
|
|
|
- console.log(formData)
|
|
|
+ formData.id = this.storeId
|
|
|
+ formData.orgCodePaths = this.parentCodePaths
|
|
|
saveStoreOrg(formData).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
_this.$message.success(res.message)
|