vue2-client 1.14.78 → 1.14.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.history/public/his/editor/editor_20250606134713.html +51 -0
- package/.history/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox_20250527173925.vue +509 -0
- package/.history/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox_20250527174316.vue +524 -0
- package/.history/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox_20250527174419.vue +524 -0
- package/.history/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox_20250527174422.vue +524 -0
- package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611172825.vue +207 -0
- package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611172945.vue +211 -0
- package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611172949.vue +212 -0
- package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611173010.vue +212 -0
- package/.history/src/base-client/components/common/XForm/XFormItem_20250508134122.vue +1320 -0
- package/.history/src/base-client/components/common/XForm/XFormItem_20250527171604.vue +1332 -0
- package/.history/src/base-client/components/common/XForm/XFormItem_20250527171613.vue +1331 -0
- package/.history/src/base-client/components/common/XForm/XFormItem_20250527171703.vue +1331 -0
- package/.history/src/base-client/components/common/XForm/XFormItem_20250527171720.vue +1331 -0
- package/.history/src/base-client/components/common/XForm/XFormItem_20250527174327.vue +1339 -0
- package/.history/src/base-client/components/common/XReportGrid/XReportTrGroup_20250612092804.vue +731 -0
- package/.history/src/base-client/components/common/XReportGrid/XReportTrGroup_20250612112546.vue +748 -0
- package/.history/src/base-client/components/common/XReportGrid/XReportTrGroup_20250612113808.vue +748 -0
- package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115237.vue +1071 -0
- package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115346.vue +1078 -0
- package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115350.vue +1077 -0
- package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115415.vue +1077 -0
- package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115429.vue +1077 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611091619.vue +442 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092547.vue +442 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092552.vue +442 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092744.vue +475 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092955.vue +475 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092957.vue +475 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611095652.vue +477 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611095701.vue +477 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611095704.vue +477 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100005.vue +473 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100011.vue +473 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100014.vue +473 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100833.vue +473 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100853.vue +473 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100940.vue +473 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101011.vue +473 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101013.vue +473 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101014.vue +473 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101159.vue +473 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101238.vue +474 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101240.vue +474 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101242.vue +474 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101404.vue +472 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101410.vue +472 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101459.vue +472 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101500.vue +472 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101502.vue +472 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101504.vue +472 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101610.vue +501 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101700.vue +501 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101702.vue +501 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101741.vue +504 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101749.vue +504 -0
- package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101759.vue +504 -0
- package/.history/src/base-client/components/his/XHisEditor/dome_20250611091349.vue +131 -0
- package/.history/src/base-client/components/his/XHisEditor/dome_20250611105854.vue +160 -0
- package/.history/src/base-client/components/his/XHisEditor/dome_20250611105902.vue +160 -0
- package/.history/src/base-client/components/his/XHisEditor/dome_20250611105924.vue +160 -0
- package/.history/src/base-client/components/his/XHisEditor/dome_20250611105932.vue +158 -0
- package/.history/src/base-client/components/his/XList/XList_20250609135848.vue +173 -0
- package/.history/src/base-client/components/his/XList/XList_20250609141026.vue +222 -0
- package/.history/src/base-client/components/his/XList/XList_20250609141035.vue +229 -0
- package/.history/src/base-client/components/his/XList/XList_20250609141103.vue +229 -0
- package/.history/src/base-client/components/his/XList/XList_20250609141105.vue +229 -0
- package/.history/src/base-client/components/his/XList/XList_20250609141334.vue +241 -0
- package/.history/src/base-client/components/his/XList/XList_20250609141404.vue +241 -0
- package/.history/src/base-client/components/his/XList/XList_20250609141406.vue +241 -0
- package/.history/src/base-client/components/his/XList/XList_20250609141801.vue +245 -0
- package/.history/src/base-client/components/his/XList/XList_20250609142033.vue +245 -0
- package/.history/src/base-client/components/his/XList/XList_20250609142038.vue +245 -0
- package/.history/src/base-client/components/his/XList/XList_20250609142435.vue +255 -0
- package/.history/src/base-client/components/his/XList/XList_20250609142503.vue +255 -0
- package/.history/src/base-client/components/his/XList/XList_20250609142504.vue +255 -0
- package/.history/src/base-client/components/his/XList/XList_20250609143012.vue +270 -0
- package/.history/src/base-client/components/his/XList/XList_20250609143044.vue +270 -0
- package/.history/src/base-client/components/his/XList/XList_20250609143046.vue +270 -0
- package/.history/src/base-client/components/his/XList/XList_20250609143210.vue +270 -0
- package/.history/src/base-client/components/his/XList/XList_20250609144339.vue +294 -0
- package/.history/src/base-client/components/his/XList/XList_20250609144410.vue +294 -0
- package/.history/src/base-client/components/his/XList/XList_20250609144412.vue +294 -0
- package/.history/src/base-client/components/his/XList/XList_20250609144647.vue +303 -0
- package/.history/src/base-client/components/his/XList/XList_20250609144716.vue +303 -0
- package/.history/src/base-client/components/his/XList/XList_20250609144729.vue +303 -0
- package/.history/src/base-client/components/his/XList/XList_20250609151232.vue +288 -0
- package/.history/src/base-client/components/his/XList/XList_20250609151247.vue +288 -0
- package/.history/src/base-client/components/his/XList/XList_20250609151252.vue +288 -0
- package/.history/src/base-client/components/his/XList/XList_20250609161220.vue +317 -0
- package/.history/src/base-client/components/his/XList/XList_20250609161258.vue +306 -0
- package/.history/src/base-client/components/his/XList/XList_20250609161319.vue +306 -0
- package/.history/src/base-client/components/his/XList/XList_20250609161320.vue +306 -0
- package/Users/objecrt/af-vue2-client/src/base-client/components/his/XShiftSchedule/XShiftSchedule.vue +36 -0
- package/docs/Logic/345/207/275/346/225/260/344/275/277/347/224/250/347/233/270/345/205/263.md +1 -0
- package/docs//345/207/275/346/225/260/344/275/277/347/224/250/347/233/270/345/205/263.md +2 -1
- package/package.json +1 -1
- package/src/base-client/components/TreeList/TreeList.vue +91 -0
- package/src/base-client/components/TreeList/TreeNode.vue +81 -0
- package/src/base-client/components/common/XAddReport/XAddReport.vue +6 -1
- package/src/base-client/components/common/XCardSet/XTiltle.vue +191 -0
- package/src/base-client/components/common/XReportGrid/XReport.vue +28 -5
- package/src/base-client/components/common/XReportGrid/XReportTrGroup.vue +1 -1
- package/src/base-client/components/his/XHisEditor/XHisEditor.vue +2 -2
- package/src/base-client/components/his/XQuestionnaire/XQuestionnaire.json +9 -4
- package/src/base-client/components/his/XQuestionnaire/XQuestionnaire.vue +70 -21
- package/src/base-client/components/his/XQuestionnaire/XQuestionnaireDemo.vue +15 -4
- package/src/base-client/components/his/XTextCard/XTextCard.vue +207 -207
- package/src/base-client/components/his/XTreeRows/TreeNode.vue +100 -100
- package/src/base-client/components/his/XTreeRows/XTreeRows.vue +197 -197
- package/src/base-client/components/his/threeTestOrders/editor.vue +111 -111
- package/src/pages/addressSelect/addressDemo.vue +24 -24
- package/src/pages/addressSelect/index.vue +259 -259
|
@@ -1,259 +1,259 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import XFormTable from '@vue2-client/base-client/components/common/XFormTable'
|
|
3
|
-
import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
|
|
4
|
-
import { mapState } from 'vuex'
|
|
5
|
-
export default {
|
|
6
|
-
components: {
|
|
7
|
-
XFormTable
|
|
8
|
-
},
|
|
9
|
-
props: {
|
|
10
|
-
addressShow: {
|
|
11
|
-
required: true,
|
|
12
|
-
type: Boolean,
|
|
13
|
-
default: false
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
watch: {
|
|
17
|
-
addressShow (val) {
|
|
18
|
-
this.selectAddressVisible = val
|
|
19
|
-
},
|
|
20
|
-
'form.f_address_type' (newVal, oldVal) {
|
|
21
|
-
this.onAddressTypeChange(newVal, oldVal)
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
data () {
|
|
25
|
-
return {
|
|
26
|
-
selectAddressVisible: false,
|
|
27
|
-
addAddressFlag: false,
|
|
28
|
-
form: {
|
|
29
|
-
f_address_type: '',
|
|
30
|
-
f_residential_area_id: '',
|
|
31
|
-
f_residential_area: '',
|
|
32
|
-
f_iscity: ''
|
|
33
|
-
},
|
|
34
|
-
addressModel: [
|
|
35
|
-
{
|
|
36
|
-
expression: '{f_building}楼号{f_unit}单元{f_floor}楼层{f_room}门牌号',
|
|
37
|
-
label: '城市',
|
|
38
|
-
value: '城市'
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
expression: '{f_building}组{f_unit}号',
|
|
42
|
-
label: '乡镇',
|
|
43
|
-
value: '乡镇'
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
expression: '{f_address}',
|
|
47
|
-
label: '自定义',
|
|
48
|
-
value: '自定义'
|
|
49
|
-
}
|
|
50
|
-
],
|
|
51
|
-
labelCol: { span: 4 },
|
|
52
|
-
wrapperCol: { span: 20 },
|
|
53
|
-
formItems: [],
|
|
54
|
-
areaList: [],
|
|
55
|
-
signContractVisible: false
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
methods: {
|
|
59
|
-
selAddress (record) {
|
|
60
|
-
// 给表单赋值
|
|
61
|
-
const form = {
|
|
62
|
-
f_address: record.tua_f_address,
|
|
63
|
-
f_address_id: record.tua_id
|
|
64
|
-
}
|
|
65
|
-
console.log('选择了地址是', form)
|
|
66
|
-
this.$emit('selAddress', form)
|
|
67
|
-
this.selectAddressVisible = false
|
|
68
|
-
},
|
|
69
|
-
addAddress () {
|
|
70
|
-
// 获取地址模式配置
|
|
71
|
-
getConfigByName('addressTypeDic', 'af-revenue', (res) => {
|
|
72
|
-
// 地址模式赋值
|
|
73
|
-
if (res.value?.length) {
|
|
74
|
-
this.addressModel = res.value
|
|
75
|
-
}
|
|
76
|
-
// 赋值默认地址模式
|
|
77
|
-
this.form = { f_address_type: this.addressModel[0].value }
|
|
78
|
-
this.addAddressFlag = true
|
|
79
|
-
this.addAddressMsg = '添加地址'
|
|
80
|
-
this.onAddressTypeChange()
|
|
81
|
-
})
|
|
82
|
-
},
|
|
83
|
-
onAddressTypeChange (newVal, oldVal) {
|
|
84
|
-
const selectedModel = this.addressModel.find(item => item.value === this.form.f_address_type)
|
|
85
|
-
Object.keys(this.form).forEach(key => {
|
|
86
|
-
if (key.endsWith('_suffix')) {
|
|
87
|
-
this.form[key] = ''
|
|
88
|
-
}
|
|
89
|
-
})
|
|
90
|
-
if (selectedModel) {
|
|
91
|
-
const matches = selectedModel.expression.match(/{(.*?)}([^{}]*)(?={|$)/g)
|
|
92
|
-
this.formItems = matches.map(item => {
|
|
93
|
-
const value = item.match(/{(.*?)}/)[1]
|
|
94
|
-
const label = item.replace(/{.*?}/, '').trim()
|
|
95
|
-
// 处理后缀
|
|
96
|
-
this.form[`${value}_suffix`] = label
|
|
97
|
-
return {
|
|
98
|
-
label: label || (value === 'f_address' ? '' : value), // 如果存在后面的文字,就使用后面的文字作为 label,否则使用原来的值
|
|
99
|
-
value: `${value}`
|
|
100
|
-
}
|
|
101
|
-
})
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
handleSearch (value) {
|
|
105
|
-
this.getAreaList(value)
|
|
106
|
-
},
|
|
107
|
-
getAreaList (value) {
|
|
108
|
-
console.log('搜索小区', this.currUser.orgid)
|
|
109
|
-
runLogic('getAreaListByName', {
|
|
110
|
-
orgId: this.currUser.orgid,
|
|
111
|
-
name: value
|
|
112
|
-
}, 'af-revenue').then(res => {
|
|
113
|
-
console.log(res)
|
|
114
|
-
this.areaList = res
|
|
115
|
-
})
|
|
116
|
-
},
|
|
117
|
-
handleChange (value) {
|
|
118
|
-
this.form.f_residential_area = this.areaList.find(item => item.value === value).label
|
|
119
|
-
console.log(this.form.f_residential_area)
|
|
120
|
-
},
|
|
121
|
-
addressSubmit () {
|
|
122
|
-
if (!this.form.f_residential_area) {
|
|
123
|
-
this.$message.warning('请选择小区')
|
|
124
|
-
return
|
|
125
|
-
}
|
|
126
|
-
this.deleteAddressData()
|
|
127
|
-
runLogic('addAddress', Object.assign({}, this.form, {
|
|
128
|
-
f_address: this.generateAddressString()
|
|
129
|
-
}, {
|
|
130
|
-
orgid: this.currUser.orgid,
|
|
131
|
-
f_orgid: this.currUser.orgid,
|
|
132
|
-
f_orgname: this.currUser.orgs,
|
|
133
|
-
f_depid: this.currUser.depids,
|
|
134
|
-
f_depname: this.currUser.deps,
|
|
135
|
-
f_operatorid: this.currUser.id,
|
|
136
|
-
f_operator: this.currUser.name,
|
|
137
|
-
f_filialeid: this.currUser.orgid
|
|
138
|
-
}), 'af-revenue').then(res => {
|
|
139
|
-
if (res) {
|
|
140
|
-
this.$message.success(`${this.addAddressMsg}成功`)
|
|
141
|
-
this.addAddressFlag = false
|
|
142
|
-
this.refresh()
|
|
143
|
-
}
|
|
144
|
-
})
|
|
145
|
-
},
|
|
146
|
-
// 删除 addressData 中存在 addressModel 不存在的字段
|
|
147
|
-
deleteAddressData () {
|
|
148
|
-
// 目前只需要检查这几个key
|
|
149
|
-
const keys = ['f_building', 'f_unit', 'f_floor', 'f_room']
|
|
150
|
-
Object.keys(this.form).forEach(key => {
|
|
151
|
-
if (keys.includes(key) && !this.formItems.some(item => item.value === key)) {
|
|
152
|
-
this.form[key] = ''
|
|
153
|
-
this.form[`${key}_suffix`] = ''
|
|
154
|
-
}
|
|
155
|
-
})
|
|
156
|
-
},
|
|
157
|
-
generateAddressString () {
|
|
158
|
-
const selectedModel = this.addressModel.find(item => item.value === this.form.f_address_type)
|
|
159
|
-
if (selectedModel) {
|
|
160
|
-
let addressString = selectedModel.expression
|
|
161
|
-
this.formItems.forEach(item => {
|
|
162
|
-
const value = this.form[item.value]
|
|
163
|
-
addressString = addressString.replace(`{${item.value}}`, value)
|
|
164
|
-
})
|
|
165
|
-
return addressString
|
|
166
|
-
}
|
|
167
|
-
return ''
|
|
168
|
-
},
|
|
169
|
-
},
|
|
170
|
-
computed: {
|
|
171
|
-
inputWidth () {
|
|
172
|
-
if (this.formItems.length === 1) {
|
|
173
|
-
return '85%'
|
|
174
|
-
}
|
|
175
|
-
return this.formItems.length ? `${65 / this.formItems.length}%` : '85%'
|
|
176
|
-
},
|
|
177
|
-
...mapState('account', { currUser: 'user' }),
|
|
178
|
-
...mapState('setting', { isMobile: 'isMobile' })
|
|
179
|
-
},
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
</script>
|
|
183
|
-
|
|
184
|
-
<template>
|
|
185
|
-
<div>
|
|
186
|
-
<!-- 地址弹出框 -->
|
|
187
|
-
<a-modal
|
|
188
|
-
v-model="selectAddressVisible"
|
|
189
|
-
:dialog-style="{ top: '30px' }"
|
|
190
|
-
:bodyStyle="{height:'70vh',overflowY:'scroll'}"
|
|
191
|
-
:destroy-on-close="true"
|
|
192
|
-
:z-index="1002"
|
|
193
|
-
title="选择地址"
|
|
194
|
-
:footer="null"
|
|
195
|
-
width="80vw">
|
|
196
|
-
<x-form-table
|
|
197
|
-
title="选择地址"
|
|
198
|
-
queryParamsName="userfiles_sel_address"
|
|
199
|
-
@action="selAddress"
|
|
200
|
-
serviceName="af-revenue"
|
|
201
|
-
:extraHeight="225"
|
|
202
|
-
ref="selAddressXFormTable">
|
|
203
|
-
<template #leftButton="{selectedRows}">
|
|
204
|
-
<a-button
|
|
205
|
-
type="primary"
|
|
206
|
-
:disabled="selectedRows?.length !== 1"
|
|
207
|
-
@click="selAddress(selectedRows[0])"> 选择地址</a-button>
|
|
208
|
-
<a-button
|
|
209
|
-
type="primary"
|
|
210
|
-
@click="addAddress"> 新建地址
|
|
211
|
-
</a-button>
|
|
212
|
-
</template>
|
|
213
|
-
</x-form-table>
|
|
214
|
-
</a-modal>
|
|
215
|
-
<!-- 添加地址 -->
|
|
216
|
-
<a-modal
|
|
217
|
-
v-model="addAddressFlag"
|
|
218
|
-
:dialog-style="{ top: '30px' }"
|
|
219
|
-
:z-index="1005"
|
|
220
|
-
@ok="addressSubmit"
|
|
221
|
-
@cancel="addAddressFlag = false"
|
|
222
|
-
title="新增地址信息"
|
|
223
|
-
:destroyOnClose="true">
|
|
224
|
-
<a-form-model :model="form" :label-col="labelCol" :wrapper-col="wrapperCol">
|
|
225
|
-
<a-form-model-item label="小区">
|
|
226
|
-
<a-select
|
|
227
|
-
show-search
|
|
228
|
-
placeholder="请选择小区"
|
|
229
|
-
option-filter-prop="children"
|
|
230
|
-
@search="handleSearch"
|
|
231
|
-
style="width: 200px"
|
|
232
|
-
@change="handleChange"
|
|
233
|
-
>
|
|
234
|
-
<a-select-option v-for="item in areaList" :value="item.value" :key="item">
|
|
235
|
-
{{ item.label }}
|
|
236
|
-
</a-select-option>
|
|
237
|
-
</a-select>
|
|
238
|
-
</a-form-model-item>
|
|
239
|
-
<a-form-model-item label="地址类型">
|
|
240
|
-
<a-radio-group v-model="form.f_address_type">
|
|
241
|
-
<a-radio :value="item.value" v-for="(item, index) in addressModel" :key="index">
|
|
242
|
-
{{ item.label }}
|
|
243
|
-
</a-radio>
|
|
244
|
-
</a-radio-group>
|
|
245
|
-
</a-form-model-item>
|
|
246
|
-
<a-form-model-item label="详细地址">
|
|
247
|
-
<div v-for="(item, index) in formItems" :key="index" style="display: inline;white-space: nowrap">
|
|
248
|
-
<a-input v-model="form[item.value]" style="display: inline;" :style="{ width: inputWidth }"/>
|
|
249
|
-
<span>{{ item.label }}</span>
|
|
250
|
-
</div>
|
|
251
|
-
</a-form-model-item>
|
|
252
|
-
</a-form-model>
|
|
253
|
-
</a-modal>
|
|
254
|
-
</div>
|
|
255
|
-
</template>
|
|
256
|
-
|
|
257
|
-
<style>
|
|
258
|
-
|
|
259
|
-
</style>
|
|
1
|
+
<script>
|
|
2
|
+
import XFormTable from '@vue2-client/base-client/components/common/XFormTable'
|
|
3
|
+
import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
|
|
4
|
+
import { mapState } from 'vuex'
|
|
5
|
+
export default {
|
|
6
|
+
components: {
|
|
7
|
+
XFormTable
|
|
8
|
+
},
|
|
9
|
+
props: {
|
|
10
|
+
addressShow: {
|
|
11
|
+
required: true,
|
|
12
|
+
type: Boolean,
|
|
13
|
+
default: false
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
watch: {
|
|
17
|
+
addressShow (val) {
|
|
18
|
+
this.selectAddressVisible = val
|
|
19
|
+
},
|
|
20
|
+
'form.f_address_type' (newVal, oldVal) {
|
|
21
|
+
this.onAddressTypeChange(newVal, oldVal)
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
data () {
|
|
25
|
+
return {
|
|
26
|
+
selectAddressVisible: false,
|
|
27
|
+
addAddressFlag: false,
|
|
28
|
+
form: {
|
|
29
|
+
f_address_type: '',
|
|
30
|
+
f_residential_area_id: '',
|
|
31
|
+
f_residential_area: '',
|
|
32
|
+
f_iscity: ''
|
|
33
|
+
},
|
|
34
|
+
addressModel: [
|
|
35
|
+
{
|
|
36
|
+
expression: '{f_building}楼号{f_unit}单元{f_floor}楼层{f_room}门牌号',
|
|
37
|
+
label: '城市',
|
|
38
|
+
value: '城市'
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
expression: '{f_building}组{f_unit}号',
|
|
42
|
+
label: '乡镇',
|
|
43
|
+
value: '乡镇'
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
expression: '{f_address}',
|
|
47
|
+
label: '自定义',
|
|
48
|
+
value: '自定义'
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
labelCol: { span: 4 },
|
|
52
|
+
wrapperCol: { span: 20 },
|
|
53
|
+
formItems: [],
|
|
54
|
+
areaList: [],
|
|
55
|
+
signContractVisible: false
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
methods: {
|
|
59
|
+
selAddress (record) {
|
|
60
|
+
// 给表单赋值
|
|
61
|
+
const form = {
|
|
62
|
+
f_address: record.tua_f_address,
|
|
63
|
+
f_address_id: record.tua_id
|
|
64
|
+
}
|
|
65
|
+
console.log('选择了地址是', form)
|
|
66
|
+
this.$emit('selAddress', form)
|
|
67
|
+
this.selectAddressVisible = false
|
|
68
|
+
},
|
|
69
|
+
addAddress () {
|
|
70
|
+
// 获取地址模式配置
|
|
71
|
+
getConfigByName('addressTypeDic', 'af-revenue', (res) => {
|
|
72
|
+
// 地址模式赋值
|
|
73
|
+
if (res.value?.length) {
|
|
74
|
+
this.addressModel = res.value
|
|
75
|
+
}
|
|
76
|
+
// 赋值默认地址模式
|
|
77
|
+
this.form = { f_address_type: this.addressModel[0].value }
|
|
78
|
+
this.addAddressFlag = true
|
|
79
|
+
this.addAddressMsg = '添加地址'
|
|
80
|
+
this.onAddressTypeChange()
|
|
81
|
+
})
|
|
82
|
+
},
|
|
83
|
+
onAddressTypeChange (newVal, oldVal) {
|
|
84
|
+
const selectedModel = this.addressModel.find(item => item.value === this.form.f_address_type)
|
|
85
|
+
Object.keys(this.form).forEach(key => {
|
|
86
|
+
if (key.endsWith('_suffix')) {
|
|
87
|
+
this.form[key] = ''
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
if (selectedModel) {
|
|
91
|
+
const matches = selectedModel.expression.match(/{(.*?)}([^{}]*)(?={|$)/g)
|
|
92
|
+
this.formItems = matches.map(item => {
|
|
93
|
+
const value = item.match(/{(.*?)}/)[1]
|
|
94
|
+
const label = item.replace(/{.*?}/, '').trim()
|
|
95
|
+
// 处理后缀
|
|
96
|
+
this.form[`${value}_suffix`] = label
|
|
97
|
+
return {
|
|
98
|
+
label: label || (value === 'f_address' ? '' : value), // 如果存在后面的文字,就使用后面的文字作为 label,否则使用原来的值
|
|
99
|
+
value: `${value}`
|
|
100
|
+
}
|
|
101
|
+
})
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
handleSearch (value) {
|
|
105
|
+
this.getAreaList(value)
|
|
106
|
+
},
|
|
107
|
+
getAreaList (value) {
|
|
108
|
+
console.log('搜索小区', this.currUser.orgid)
|
|
109
|
+
runLogic('getAreaListByName', {
|
|
110
|
+
orgId: this.currUser.orgid,
|
|
111
|
+
name: value
|
|
112
|
+
}, 'af-revenue').then(res => {
|
|
113
|
+
console.log(res)
|
|
114
|
+
this.areaList = res
|
|
115
|
+
})
|
|
116
|
+
},
|
|
117
|
+
handleChange (value) {
|
|
118
|
+
this.form.f_residential_area = this.areaList.find(item => item.value === value).label
|
|
119
|
+
console.log(this.form.f_residential_area)
|
|
120
|
+
},
|
|
121
|
+
addressSubmit () {
|
|
122
|
+
if (!this.form.f_residential_area) {
|
|
123
|
+
this.$message.warning('请选择小区')
|
|
124
|
+
return
|
|
125
|
+
}
|
|
126
|
+
this.deleteAddressData()
|
|
127
|
+
runLogic('addAddress', Object.assign({}, this.form, {
|
|
128
|
+
f_address: this.generateAddressString()
|
|
129
|
+
}, {
|
|
130
|
+
orgid: this.currUser.orgid,
|
|
131
|
+
f_orgid: this.currUser.orgid,
|
|
132
|
+
f_orgname: this.currUser.orgs,
|
|
133
|
+
f_depid: this.currUser.depids,
|
|
134
|
+
f_depname: this.currUser.deps,
|
|
135
|
+
f_operatorid: this.currUser.id,
|
|
136
|
+
f_operator: this.currUser.name,
|
|
137
|
+
f_filialeid: this.currUser.orgid
|
|
138
|
+
}), 'af-revenue').then(res => {
|
|
139
|
+
if (res) {
|
|
140
|
+
this.$message.success(`${this.addAddressMsg}成功`)
|
|
141
|
+
this.addAddressFlag = false
|
|
142
|
+
this.refresh()
|
|
143
|
+
}
|
|
144
|
+
})
|
|
145
|
+
},
|
|
146
|
+
// 删除 addressData 中存在 addressModel 不存在的字段
|
|
147
|
+
deleteAddressData () {
|
|
148
|
+
// 目前只需要检查这几个key
|
|
149
|
+
const keys = ['f_building', 'f_unit', 'f_floor', 'f_room']
|
|
150
|
+
Object.keys(this.form).forEach(key => {
|
|
151
|
+
if (keys.includes(key) && !this.formItems.some(item => item.value === key)) {
|
|
152
|
+
this.form[key] = ''
|
|
153
|
+
this.form[`${key}_suffix`] = ''
|
|
154
|
+
}
|
|
155
|
+
})
|
|
156
|
+
},
|
|
157
|
+
generateAddressString () {
|
|
158
|
+
const selectedModel = this.addressModel.find(item => item.value === this.form.f_address_type)
|
|
159
|
+
if (selectedModel) {
|
|
160
|
+
let addressString = selectedModel.expression
|
|
161
|
+
this.formItems.forEach(item => {
|
|
162
|
+
const value = this.form[item.value]
|
|
163
|
+
addressString = addressString.replace(`{${item.value}}`, value)
|
|
164
|
+
})
|
|
165
|
+
return addressString
|
|
166
|
+
}
|
|
167
|
+
return ''
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
computed: {
|
|
171
|
+
inputWidth () {
|
|
172
|
+
if (this.formItems.length === 1) {
|
|
173
|
+
return '85%'
|
|
174
|
+
}
|
|
175
|
+
return this.formItems.length ? `${65 / this.formItems.length}%` : '85%'
|
|
176
|
+
},
|
|
177
|
+
...mapState('account', { currUser: 'user' }),
|
|
178
|
+
...mapState('setting', { isMobile: 'isMobile' })
|
|
179
|
+
},
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
</script>
|
|
183
|
+
|
|
184
|
+
<template>
|
|
185
|
+
<div>
|
|
186
|
+
<!-- 地址弹出框 -->
|
|
187
|
+
<a-modal
|
|
188
|
+
v-model="selectAddressVisible"
|
|
189
|
+
:dialog-style="{ top: '30px' }"
|
|
190
|
+
:bodyStyle="{height:'70vh',overflowY:'scroll'}"
|
|
191
|
+
:destroy-on-close="true"
|
|
192
|
+
:z-index="1002"
|
|
193
|
+
title="选择地址"
|
|
194
|
+
:footer="null"
|
|
195
|
+
width="80vw">
|
|
196
|
+
<x-form-table
|
|
197
|
+
title="选择地址"
|
|
198
|
+
queryParamsName="userfiles_sel_address"
|
|
199
|
+
@action="selAddress"
|
|
200
|
+
serviceName="af-revenue"
|
|
201
|
+
:extraHeight="225"
|
|
202
|
+
ref="selAddressXFormTable">
|
|
203
|
+
<template #leftButton="{selectedRows}">
|
|
204
|
+
<a-button
|
|
205
|
+
type="primary"
|
|
206
|
+
:disabled="selectedRows?.length !== 1"
|
|
207
|
+
@click="selAddress(selectedRows[0])"> 选择地址</a-button>
|
|
208
|
+
<a-button
|
|
209
|
+
type="primary"
|
|
210
|
+
@click="addAddress"> 新建地址
|
|
211
|
+
</a-button>
|
|
212
|
+
</template>
|
|
213
|
+
</x-form-table>
|
|
214
|
+
</a-modal>
|
|
215
|
+
<!-- 添加地址 -->
|
|
216
|
+
<a-modal
|
|
217
|
+
v-model="addAddressFlag"
|
|
218
|
+
:dialog-style="{ top: '30px' }"
|
|
219
|
+
:z-index="1005"
|
|
220
|
+
@ok="addressSubmit"
|
|
221
|
+
@cancel="addAddressFlag = false"
|
|
222
|
+
title="新增地址信息"
|
|
223
|
+
:destroyOnClose="true">
|
|
224
|
+
<a-form-model :model="form" :label-col="labelCol" :wrapper-col="wrapperCol">
|
|
225
|
+
<a-form-model-item label="小区">
|
|
226
|
+
<a-select
|
|
227
|
+
show-search
|
|
228
|
+
placeholder="请选择小区"
|
|
229
|
+
option-filter-prop="children"
|
|
230
|
+
@search="handleSearch"
|
|
231
|
+
style="width: 200px"
|
|
232
|
+
@change="handleChange"
|
|
233
|
+
>
|
|
234
|
+
<a-select-option v-for="item in areaList" :value="item.value" :key="item">
|
|
235
|
+
{{ item.label }}
|
|
236
|
+
</a-select-option>
|
|
237
|
+
</a-select>
|
|
238
|
+
</a-form-model-item>
|
|
239
|
+
<a-form-model-item label="地址类型">
|
|
240
|
+
<a-radio-group v-model="form.f_address_type">
|
|
241
|
+
<a-radio :value="item.value" v-for="(item, index) in addressModel" :key="index">
|
|
242
|
+
{{ item.label }}
|
|
243
|
+
</a-radio>
|
|
244
|
+
</a-radio-group>
|
|
245
|
+
</a-form-model-item>
|
|
246
|
+
<a-form-model-item label="详细地址">
|
|
247
|
+
<div v-for="(item, index) in formItems" :key="index" style="display: inline;white-space: nowrap">
|
|
248
|
+
<a-input v-model="form[item.value]" style="display: inline;" :style="{ width: inputWidth }"/>
|
|
249
|
+
<span>{{ item.label }}</span>
|
|
250
|
+
</div>
|
|
251
|
+
</a-form-model-item>
|
|
252
|
+
</a-form-model>
|
|
253
|
+
</a-modal>
|
|
254
|
+
</div>
|
|
255
|
+
</template>
|
|
256
|
+
|
|
257
|
+
<style>
|
|
258
|
+
|
|
259
|
+
</style>
|