|
@@ -119,52 +119,34 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view v-else-if="active==2">
|
|
|
- <button type="primary" size="mini" @click="addFamily" style="width: 160rpx;">新增</button>
|
|
|
- <uni-table>
|
|
|
- <uni-tr>
|
|
|
- <uni-th width="100" align="center">与老人关系</uni-th>
|
|
|
- <uni-th width="48" align="center">姓名</uni-th>
|
|
|
- <uni-th width="48" align="center">性别</uni-th>
|
|
|
- <uni-th width="100" align="center">联系电话</uni-th>
|
|
|
- <uni-th width="48" align="center">设置</uni-th>
|
|
|
- </uni-tr>
|
|
|
- <uni-tr v-for="(item, index) in tableData" :key="index">
|
|
|
- <uni-td>{{ item.jtcygx }}</uni-td>
|
|
|
- <uni-td>
|
|
|
- <view>{{ item.jtcyxm }}</view>
|
|
|
- </uni-td>
|
|
|
- <uni-td align="center">{{ item.jtcyxb }}</uni-td>
|
|
|
- <uni-td align="center">{{ item.jtcylxdh }}</uni-td>
|
|
|
- <uni-td>
|
|
|
- <view class="uni-group">
|
|
|
- <button class="uni-button" size="mini" type="primary">修改</button>
|
|
|
- <button class="uni-button" size="mini" type="warn">删除</button>
|
|
|
- </view>
|
|
|
- </uni-td>
|
|
|
- </uni-tr>
|
|
|
- </uni-table>
|
|
|
+ <button type="primary" size="mini" @click="editFamily"
|
|
|
+ style="width: 100rpx;padding: 0 5px;line-height: 2;">新增</button>
|
|
|
+ <uni-list>
|
|
|
+ <uni-list-item :title="item.jtcyxm" :note="item.jtcylxdh"
|
|
|
+ :rightText="transDictLabel(dicts.C0032,item.jtcygx)" v-for="(item,idx) in familyList" :key="idx"
|
|
|
+ showArrow clickable @click="editFamily(item)" />
|
|
|
+ </uni-list>
|
|
|
|
|
|
<!-- 输入框示例 -->
|
|
|
<uni-popup ref="inputDialog" type="dialog">
|
|
|
<uni-popup-dialog ref="inputClose" mode="input" title="添加家庭成员信息" before-close="true"
|
|
|
- @confirm="dialogInputConfirm" @close="cance">
|
|
|
+ @confirm="submitFamilyForm" @close="cance">
|
|
|
|
|
|
- <uni-forms ref="familyForm" :modelValue="familyFormData" :rules="familyRules" label-align="right"
|
|
|
- padding>
|
|
|
+ <uni-forms ref="familyForm" :modelValue="familyForm" :rules="familyRules" label-align="right" padding>
|
|
|
<uni-forms-item label="关系" required name="jtcygx">
|
|
|
- <uni-data-select v-model="familyFormData.jtcygx" placeholder="请选择与老人关系" :localdata="dicts.C0032" />
|
|
|
+ <uni-data-select v-model="familyForm.jtcygx" placeholder="请选择与老人关系" :localdata="dicts.C0032" />
|
|
|
</uni-forms-item>
|
|
|
<uni-forms-item label="姓名" required name="jtcyxm">
|
|
|
- <uni-easyinput v-model="familyFormData.jtcyxm" placeholder="请输入姓名" />
|
|
|
+ <uni-easyinput v-model="familyForm.jtcyxm" placeholder="请输入姓名" />
|
|
|
</uni-forms-item>
|
|
|
<uni-forms-item label="性别" required name="jtcyxb">
|
|
|
- <uni-data-select v-model="familyFormData.jtcyxb" placeholder="请选择性别" :localdata="dicts.C0007" />
|
|
|
+ <uni-data-select v-model="familyForm.jtcyxb" placeholder="请选择性别" :localdata="dicts.C0007" />
|
|
|
</uni-forms-item>
|
|
|
<uni-forms-item label="手机号" required name="jtcylxdh">
|
|
|
- <uni-easyinput v-model="familyFormData.jtcylxdh" placeholder="请输入手机号" />
|
|
|
+ <uni-easyinput v-model="familyForm.jtcylxdh" placeholder="请输入手机号" />
|
|
|
</uni-forms-item>
|
|
|
<uni-forms-item label="地址" required name="jtcyjzd">
|
|
|
- <uni-easyinput v-model="familyFormData.jtcyjzd" placeholder="请输入居住地址" />
|
|
|
+ <uni-easyinput v-model="familyForm.jtcyjzd" placeholder="请输入居住地址" />
|
|
|
</uni-forms-item>
|
|
|
</uni-forms>
|
|
|
|
|
@@ -175,7 +157,7 @@
|
|
|
</view>
|
|
|
<view v-else-if="active==3">
|
|
|
<navigator url="/pages/lr/bhAdd">
|
|
|
- <button type="primary" size="mini" style="width: 160rpx;">新增</button>
|
|
|
+ <button type="primary" size="mini" style="width: 100rpx;padding: 0 5px;line-height: 2;">新增</button>
|
|
|
</navigator>
|
|
|
<uni-table>
|
|
|
<uni-tr>
|
|
@@ -211,7 +193,8 @@
|
|
|
import amapFile from "@/libs/amap-wx.130.js";
|
|
|
import config from "../../config.js";
|
|
|
import { UploadOne } from '@/api/upload.js';
|
|
|
- import { addKhjbxx, listJtxx, addJtxx, updateJtxx, updateKhjbxx } from '@/api/lr.js'
|
|
|
+ import { addKhjbxx, updateKhjbxx, listJtxx, addJtxx, updateJtxx, } from '@/api/lr.js'
|
|
|
+ import { decryptRowData_ECB } from '@/common/sm4.js'
|
|
|
import { decimalToBinary } from '@/common/num.js'
|
|
|
|
|
|
export default {
|
|
@@ -280,47 +263,6 @@
|
|
|
]
|
|
|
}
|
|
|
},
|
|
|
- familyRules: {
|
|
|
- jtcygx: {
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- errorMessage: '请选择与老年人关系'
|
|
|
- }]
|
|
|
- },
|
|
|
- jtcyxb: {
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- errorMessage: '请选择性别'
|
|
|
- }]
|
|
|
- },
|
|
|
- jtcyxm: {
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- errorMessage: '请输入姓名'
|
|
|
- }]
|
|
|
- },
|
|
|
- jtcyjzd: {
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- errorMessage: '请输入地址'
|
|
|
- }]
|
|
|
- },
|
|
|
- jtcylxdh: {
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- errorMessage: '请输入手机号'
|
|
|
- },
|
|
|
- {
|
|
|
- format: 'number',
|
|
|
- errorMessage: '请输入正确的手机号',
|
|
|
- },
|
|
|
- {
|
|
|
- pattern: '^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1}))+\\d{8})$',
|
|
|
- errorMessage: '请输入正确的手机号',
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- },
|
|
|
baseData: {},
|
|
|
baseFormData: {
|
|
|
xm: '',
|
|
@@ -572,7 +514,7 @@
|
|
|
text: "痛风病史"
|
|
|
}
|
|
|
],
|
|
|
- tableData: [],
|
|
|
+
|
|
|
bhList: [],
|
|
|
myAmapFunT: '',
|
|
|
startPoint: {
|
|
@@ -580,25 +522,73 @@
|
|
|
longitude: 125.289036
|
|
|
},
|
|
|
|
|
|
-
|
|
|
// 家庭信息列表请求参数
|
|
|
- jtxxParams: {
|
|
|
+ familyParams: {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
- }
|
|
|
+ khId: null,
|
|
|
+ },
|
|
|
+ familyList: [],
|
|
|
+ familyForm: {
|
|
|
+ jtcygx: null,
|
|
|
+ jtcyxm: null,
|
|
|
+ jtcyxb: null,
|
|
|
+ jtcylxdh: null,
|
|
|
+ jtcyjzd: null,
|
|
|
+ },
|
|
|
+ familyRules: {
|
|
|
+ jtcygx: {
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ errorMessage: '请选择与老年人关系'
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ jtcyxb: {
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ errorMessage: '请选择性别'
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ jtcyxm: {
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ errorMessage: '请输入姓名'
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ jtcyjzd: {
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ errorMessage: '请输入地址'
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ jtcylxdh: {
|
|
|
+ rules: [{
|
|
|
+ required: true,
|
|
|
+ errorMessage: '请输入手机号'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ format: 'number',
|
|
|
+ errorMessage: '请输入正确的手机号',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ pattern: '^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1}))+\\d{8})$',
|
|
|
+ errorMessage: '请输入正确的手机号',
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ },
|
|
|
}
|
|
|
|
|
|
},
|
|
|
created() {
|
|
|
this.getDictList(Object.keys(this.dicts), this.dicts)
|
|
|
- listJtxx(this.jtxxParams).then(res => {
|
|
|
-
|
|
|
- })
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
if (Object.keys(option).length !== 0) {
|
|
|
this.baseFormData = JSON.parse(option.item)
|
|
|
if (this.baseFormData.xm) {
|
|
|
+ this.familyParams.khId = this.baseFormData.id
|
|
|
+ this.getFamilyList()
|
|
|
uni.setNavigationBarTitle({
|
|
|
title: '修改客户信息'
|
|
|
});
|
|
@@ -618,16 +608,56 @@
|
|
|
addbhxx() {
|
|
|
|
|
|
},
|
|
|
- addFamily() {
|
|
|
+ getFamilyList() {
|
|
|
+ listJtxx(this.familyParams).then(res => {
|
|
|
+ if (res.code !== 200) return
|
|
|
+ this.familyList = decryptRowData_ECB(res.rows, ['jtcyxm', 'jtcyzjhm', 'jtcylxdh', 'jtcyjzd'], [1, 2, 3,
|
|
|
+ 4])
|
|
|
+ })
|
|
|
+ },
|
|
|
+ editFamily(data = {}) {
|
|
|
+ if (data) {
|
|
|
+ this.familyForm = data
|
|
|
+ }
|
|
|
this.$refs.inputDialog.open()
|
|
|
},
|
|
|
- dialogInputConfirm(val) {
|
|
|
+ submitFamilyForm(val) {
|
|
|
this.$refs['familyForm'].validate().then(() => {
|
|
|
- addJtxx(this.familyFormData).then(res => {
|
|
|
- console.log('success', res);
|
|
|
- // 关闭窗口后,恢复默认内容
|
|
|
- this.$refs.inputDialog.close()
|
|
|
- })
|
|
|
+ const submitForm = {
|
|
|
+ ...this.familyForm,
|
|
|
+ khId: this.familyParams.khId,
|
|
|
+ // 接口补充数据,不添加无法提交
|
|
|
+ jtcyzjhm: "420101196302161908",
|
|
|
+ jtcyzjlx: "01"
|
|
|
+ };
|
|
|
+ if (this.familyForm.id) {
|
|
|
+ updateJtxx(submitForm).then(res => {
|
|
|
+ if (res.code !== 200) return
|
|
|
+ // 关闭窗口后,恢复默认内容
|
|
|
+ uni.showToast({
|
|
|
+ title: `修改成功!`,
|
|
|
+ duration: 2000,
|
|
|
+ success: (res) => {
|
|
|
+ this.$refs.inputDialog.close()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ addJtxx(submitForm).then(res => {
|
|
|
+ if (res.code !== 200) return
|
|
|
+ // 关闭窗口后,恢复默认内容
|
|
|
+ uni.showToast({
|
|
|
+ title: `新增成功!`,
|
|
|
+ duration: 2000,
|
|
|
+ success: (res) => {
|
|
|
+ this.getFamilyList()
|
|
|
+ this.$refs.inputDialog.close()
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
}).catch(err => {
|
|
|
console.log('err', err);
|
|
|
})
|
|
@@ -642,6 +672,66 @@
|
|
|
this.active = this.list.indexOf(e.tab)
|
|
|
this.activeName = e.tab
|
|
|
},
|
|
|
+ next(isSave) {
|
|
|
+ this.$refs['baseForm'].validate().then(res => {
|
|
|
+ if (isSave) {
|
|
|
+ this.bsFormatFrom()
|
|
|
+ if (this.baseFormData.id) {
|
|
|
+ // 修改
|
|
|
+ updateKhjbxx(this.baseFormData).then(r => {
|
|
|
+ if (r.code !== 200) return
|
|
|
+ uni.showToast({
|
|
|
+ title: `修改成功!`,
|
|
|
+ duration: 2000,
|
|
|
+ success: function(res) {
|
|
|
+ setTimeout(function() {
|
|
|
+ uni.switchTab({
|
|
|
+ url: '/pages/index/index'
|
|
|
+ });
|
|
|
+ }, 2000)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ // 新增
|
|
|
+ addKhjbxx(this.baseFormData).then(r => {
|
|
|
+ if (r.code !== 200) return
|
|
|
+ uni.showToast({
|
|
|
+ title: `新增成功!`,
|
|
|
+ duration: 2000,
|
|
|
+ success: function(res) {
|
|
|
+ setTimeout(function() {
|
|
|
+ uni.switchTab({
|
|
|
+ url: '/pages/index/index'
|
|
|
+ });
|
|
|
+ }, 2000)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.active = 1
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.log("err", err)
|
|
|
+ uni.showModal({
|
|
|
+ title: '错误提示',
|
|
|
+ content: err[0].errorMessage,
|
|
|
+ showCancel: false,
|
|
|
+ success: function(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ console.log('用户点击确定');
|
|
|
+ } else if (res.cancel) {
|
|
|
+ console.log('用户点击取消');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
// 地图弹出
|
|
|
async openChooseLocation(opt) {
|
|
|
let that = this
|
|
@@ -650,11 +740,6 @@
|
|
|
longitude: opt?.longitude || that.startPoint.longitude,
|
|
|
success: function(res) {
|
|
|
// console.log(res)
|
|
|
- // console.log('位置名称:' + res.name);
|
|
|
- // console.log('详细地址:' + res.address);
|
|
|
- // console.log('纬度:' + res.latitude);
|
|
|
- // console.log('经度:' + res.longitude);
|
|
|
-
|
|
|
that.baseFormData.dw = res.name
|
|
|
that.baseFormData.lng = res.longitude
|
|
|
that.baseFormData.lat = res.latitude
|
|
@@ -710,64 +795,7 @@
|
|
|
}
|
|
|
return result
|
|
|
},
|
|
|
- next(isSave) {
|
|
|
- this.$refs['baseForm'].validate().then(res => {
|
|
|
- if (isSave) {
|
|
|
- this.bsFormatFrom()
|
|
|
- if (this.baseFormData.id) {
|
|
|
- // 修改
|
|
|
- updateKhjbxx(this.baseFormData).then(r => {
|
|
|
- if (r.code !== 200) return
|
|
|
- uni.showToast({
|
|
|
- title: `修改成功!`,
|
|
|
- duration: 2000,
|
|
|
- success: function(res) {
|
|
|
- setTimeout(function() {
|
|
|
- uni.switchTab({
|
|
|
- url: '/pages/index/index'
|
|
|
- });
|
|
|
- }, 2000)
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- } else {
|
|
|
- // 新增
|
|
|
- addKhjbxx(this.baseFormData).then(r => {
|
|
|
- if (r.code !== 200) return
|
|
|
- uni.showToast({
|
|
|
- title: `新增成功!`,
|
|
|
- duration: 2000,
|
|
|
- success: function(res) {
|
|
|
- setTimeout(function() {
|
|
|
- uni.switchTab({
|
|
|
- url: '/pages/index/index'
|
|
|
- });
|
|
|
- }, 2000)
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- } else {
|
|
|
- this.active = 1
|
|
|
- }
|
|
|
- }).catch(err => {
|
|
|
- console.log("err", err)
|
|
|
- uni.showModal({
|
|
|
- title: '错误提示',
|
|
|
- content: err[0].errorMessage,
|
|
|
- showCancel: false,
|
|
|
- success: function(res) {
|
|
|
- if (res.confirm) {
|
|
|
- console.log('用户点击确定');
|
|
|
- } else if (res.cancel) {
|
|
|
- console.log('用户点击取消');
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
|
|
|
- })
|
|
|
- },
|
|
|
bsFormatFrom() {
|
|
|
this.baseFormData.tkfl = this.formatInt10(this.baseFormData.tkflData, '00000000')
|
|
|
this.baseFormData.xqah = this.formatInt10(this.baseFormData.xqahData, '000000000')
|
|
@@ -869,9 +897,6 @@
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
<style lang="scss" scoped>
|
|
|
.line {
|
|
|
border-bottom: 10px solid #f0f0f0;
|
|
@@ -905,4 +930,8 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /deep/ .uni-section .uni-section-header {
|
|
|
+ padding: 0;
|
|
|
+ }
|
|
|
</style>
|