|
|
@@ -180,9 +180,46 @@ export default {
|
|
|
message: '请确认无误提交?',
|
|
|
})
|
|
|
ld = this.$toast.loading({ message: '提交中...', duration: 0 })
|
|
|
- let result = this.data.result.map(item => ({ detail_id: item.detail_id, val: item.val }))
|
|
|
+ let result = this.data.result.map(item => {
|
|
|
+ return {
|
|
|
+ detail_id: item.detail_id,
|
|
|
+ val: item.val
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 表单类型为 iLeads活动 - 2,时,额外爬取参数 -----------
|
|
|
+ let patient = {}
|
|
|
+ if (this.data.topic.flag === 2) {
|
|
|
+ let config = {
|
|
|
+ patient_name: new RegExp('姓名'),
|
|
|
+ age: new RegExp('年龄'),
|
|
|
+ sex: new RegExp('性别')
|
|
|
+ }
|
|
|
+ let keys = Object.keys(config)
|
|
|
+ let objs = this.data.result.map(item => {
|
|
|
+ let rst = { key: '', val: '' }
|
|
|
+ keys.some(k => {
|
|
|
+ let reg = config[k]
|
|
|
+ if (reg.test(item.title)) {
|
|
|
+ rst.key = k
|
|
|
+ rst.val = item.val
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return rst
|
|
|
+ }).filter(it => it)
|
|
|
+
|
|
|
+ objs.forEach(({ key, val }) => {
|
|
|
+ if (!patient[key]) {
|
|
|
+ patient[key] = val
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // ---------------------------------
|
|
|
+
|
|
|
let query = {
|
|
|
...this.$route.query,
|
|
|
+ ...patient,
|
|
|
+ flag: this.data.topic.flag,
|
|
|
data: JSON.stringify(result)
|
|
|
}
|
|
|
await api.apiPostVolumeInfo(query)
|