Browse Source

社工和儿童主任有信息采集权限

“hanlingqiang 2 years ago
parent
commit
19d4809603

+ 370 - 0
src/utils/validate.js

@@ -0,0 +1,370 @@
+/**
+ * Created by PanJiaChen on 16/11/18.
+ */
+
+/**
+ * @param {string} path
+ * @returns {Boolean}
+ */
+export function isExternal(path) {
+  return /^(https?:|mailto:|tel:)/.test(path)
+}
+
+/**
+ * @param {string} str
+ * @returns {Boolean}
+ */
+export function validUsername(str) {
+  const valid_map = ['admin', 'editor']
+  return valid_map.indexOf(str.trim()) >= 0
+}
+
+/**
+ * @param {string} url
+ * @returns {Boolean}
+ */
+export function validURL(url) {
+  const reg = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/
+  return reg.test(url)
+}
+
+/**
+ * @param {string} str
+ * @returns {Boolean}
+ */
+export function validLowerCase(str) {
+  const reg = /^[a-z]+$/
+  return reg.test(str)
+}
+
+/**
+ * @param {string} str
+ * @returns {Boolean}
+ */
+export function validUpperCase(str) {
+  const reg = /^[A-Z]+$/
+  return reg.test(str)
+}
+
+/**
+ * @param {string} str
+ * @returns {Boolean}
+ */
+export function validAlphabets(str) {
+  const reg = /^[A-Za-z]+$/
+  return reg.test(str)
+}
+
+/**
+ * @param {string} email
+ * @returns {Boolean}
+ */
+export function validEmail(email) {
+  const reg = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
+  return reg.test(email)
+}
+
+/**
+ * @param {string} str
+ * @returns {Boolean}
+ */
+export function isString(str) {
+  if (typeof str === 'string' || str instanceof String) {
+    return true
+  }
+  return false
+}
+
+/**
+ * @param {Array} arg
+ * @returns {Boolean}
+ */
+export function isArray(arg) {
+  if (typeof Array.isArray === 'undefined') {
+    return Object.prototype.toString.call(arg) === '[object Array]'
+  }
+  return Array.isArray(arg)
+}
+
+/* 合法 uri */
+export function validateURI(rule, value, callback) {
+  const reg = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/
+  if (value !== null && value !== undefined && value !== '' && !reg.test(value)) {
+    callback(new Error('请输入正确的uri'))
+  } else {
+    callback()
+  }
+}
+
+/* 是否合法IP地址 */
+export function validateIP(rule, value, callback) {
+  const reg = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/
+  if (value !== null && value !== undefined && value !== '' && !reg.test(value)) {
+    callback(new Error('请输入正确的IP地址'))
+  } else {
+    callback()
+  }
+}
+
+/* 小写字母*/
+export function validateLowerCase(rule, value, callback) {
+  const reg = /^[a-z]+$/
+  if (value !== null && value !== undefined && value !== '' && !reg.test(value)) {
+    callback(new Error('请输入正确的小写字母'))
+  } else {
+    callback()
+  }
+}
+
+/* 大写字母*/
+export function validateUpperCase(rule, value, callback) {
+  const reg = /^[A-Z]+$/
+  if (value !== null && value !== undefined && value !== '' && !reg.test(value)) {
+    callback(new Error('请输入正确的大写字母'))
+  } else {
+    callback()
+  }
+}
+
+/* 大小写字母*/
+export function validateAlphabets(rule, value, callback) {
+  const reg = /^[A-Za-z]+$/
+  if (value !== null && value !== undefined && value !== '' && !reg.test(value)) {
+    callback(new Error('请输入正确的字母'))
+  } else {
+    callback()
+  }
+}
+
+/* 整数 */
+export function validateInteger(rule, value, callback) {
+  const reg = /^[0-9]+$/g
+  if (value !== null && value !== undefined && value !== '' && !reg.test(value)) {
+    callback(new Error('请输入正确的整数'))
+  } else {
+    callback()
+  }
+}
+
+/* 整数 首位非 0 */
+export function validateNonZero(rule, value, callback) {
+  const reg = /^[1-9][0-9]*$/g
+  if (value !== null && value !== undefined && value !== '' && !reg.test(value)) {
+    callback(new Error('请输入正确的首位非0的整数'))
+  } else {
+    callback()
+  }
+}
+
+/* 浮点数 */
+export function validateFloat(rule, value, callback) {
+  const reg = /^(-?\d+)(\.\d+)?$/g
+  if (value !== null && value !== undefined && value !== '' && !reg.test(value)) {
+    callback(new Error('请输入正确的浮点数'))
+  } else {
+    callback()
+  }
+}
+
+/* 邮箱验证 */
+export function validateEmail(rule, value, callback) {
+  const reg = /^([a-zA-Z0-9]{1,63}|[a-zA-Z0-9][a-zA-Z0-9-_.]{0,62}[a-zA-Z0-9])@(([a-zA-Z0-9]+|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.){0,3}((com)|(net)|(org)|(gov\.cn)|(info)|(cc)|(com\.cn)|(net\.cn)|(org\.cn)|(name)|(biz)|(tv)|(cn)|(mobi)|(name)|(sh)|(ac)|(io)|(tw)|(com\.tw)|(hk)|(com\.hk)|(ws)|(travel)|(us)|(tm)|(la)|(me\.uk)|(org\.uk)|(ltd\.uk)|(plc\.uk)|(in)|(eu)|(it)|(jp))$/
+  if (value !== null && value !== undefined && value !== '' && !reg.test(value)) {
+    callback(new Error('请输入正确的邮箱'))
+  } else {
+    callback()
+  }
+}
+
+/* 身份证正则 */
+export function validateIDcard(rule, value, callback) {
+  if (value !== null && value !== undefined && value !== '') {
+    value = value.toString().toUpperCase()
+    const city = {
+      11: '北京',
+      12: '天津',
+      13: '河北',
+      14: '山西',
+      15: '内蒙古',
+      21: '辽宁',
+      22: '吉林',
+      23: '黑龙江 ',
+      31: '上海',
+      32: '江苏',
+      33: '浙江',
+      34: '安徽',
+      35: '福建',
+      36: '江西',
+      37: '山东',
+      41: '河南',
+      42: '湖北 ',
+      43: '湖南',
+      44: '广东',
+      45: '广西',
+      46: '海南',
+      50: '重庆',
+      51: '四川',
+      52: '贵州',
+      53: '云南',
+      54: '西藏 ',
+      61: '陕西',
+      62: '甘肃',
+      63: '青海',
+      64: '宁夏',
+      65: '新疆',
+      71: '台湾',
+      81: '香港',
+      82: '澳门',
+      91: '国外 '
+    }
+    // 15位和18位身份证号码的基本校验
+    var check = /^\d{15}|(\d{17}(\d|x|X))$/.test(value)
+    if (!check) {
+      callback(false)
+    }
+    // 判断长度为15位或18位
+    if (value.length == 15) {
+      // 15位身份证号码的基本校验
+      var check = /^[1-9]\d{7}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}$/.test(value)
+      if (!check) {
+        // callback(new Error('身份证格式有误'))
+        callback(false)
+      }
+      // 校验地址码
+      var addressCode = value.substring(0, 6)
+      var check = /^[1-9]\d{5}$/.test(addressCode)
+      if (!check) {
+        // callback(new Error('身份证格式有误'))
+        callback(false)
+      }
+      if (!city[value.substr(0, 2)]) {
+        // callback(new Error('身份证格式有误'))
+        callback(false)
+      }
+    } else if (value.length == 18) {
+      if (!value || !/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[120])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(value)) {
+        // callback(new Error('身份证格式有误'))
+        callback(false)
+      } else if (!city[value.substr(0, 2)]) {
+        // callback(new Error('地址编码错误'))
+        callback(false)
+      } else {
+        // 18位身份证需要验证最后一位校验位
+        if (value.length == 18) {
+          value = value.split('')
+          // ∑(ai×Wi)(mod 11)
+          // 加权因子
+          var factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]
+          // 校验位
+          var parity = [1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2]
+          var sum = 0
+          var ai = 0
+          var wi = 0
+          for (var i = 0; i < 17; i++) {
+            ai = value[i]
+            wi = factor[i]
+            sum += ai * wi
+          }
+          var last = parity[sum % 11]
+          if (parity[sum % 11] != value[17]) {
+            // callback(new Error('校验位错误'))
+            callback(false)
+          }
+        }
+      }
+      callback(true)
+    } else {
+      // callback(new Error('身份证格式有误'))
+      callback(false)
+    }
+  } else {
+    //callback(new Error('请输入身份证号'))
+    callback(true)
+  }
+}
+// 检查手机号
+export function isCellPhone(val) {
+  if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(val)) {
+    return false
+  } else {
+    return true
+  }
+}
+
+/* 电话验证(包括手机号和带区号座机号码验证) */
+export function isvalidatePhone(rule, value, callback) {
+  const reg = /^(((0\d{2,3}-{0,1}){0,1}\d{7,8})|1[3-9]\d{9})$/
+  if (value !== null && value !== undefined && value !== '' && !reg.test(value)) {
+    callback(new Error('请输入正确的电话号码'))
+  } else {
+    callback()
+  }
+}
+
+// 验证input输入数字 保留两位小数
+export function checkoutInputNum(index, value) {
+  var regStrs = [
+    ['^0(\\d+)$', '$1'],
+    ['[^\\d\\.]+$', ''],
+    ['\\.(\\d?)\\.+', '.$1'],
+    ['^(\\d+\\.\\d{2}).+', '$1'],
+    ['^(\\.\\d+)', '$1'],
+    [/^\./g, '']
+  ]
+  // 禁止录入整数部分两位以上,但首位为0
+  // 禁止录入任何非数字和点
+  // 禁止录入两个以上的点
+  // 禁止录入小数点后两位以上
+  // 禁止输入情况下小数点出现在首位
+  // 必须保证第一个为数字而不是.
+  for (var i = 0; i < regStrs.length; i++) {
+    var reg = new RegExp(regStrs[i][0])
+    // value = value.replace(reg, regStrs[i][1]);
+    value = value.replace(reg, regStrs[i][1])
+    console.log(value)
+  }
+  return value
+}
+// 验证input输入数字
+export function checkoutInputNum2(index, value) {
+  var regStrs = [
+    ['^0(\\d+)$', '$1'],
+    ['[^\\d\]+$', '']
+  ]
+  // 禁止录入整数部分两位以上,但首位为0
+  // 禁止录入任何非数字和点
+  // 禁止录入两个以上的点
+  // 禁止录入小数点后两位以上
+  // 禁止输入情况下小数点出现在首位
+  for (var i = 0; i < regStrs.length; i++) {
+    var reg = new RegExp(regStrs[i][0])
+    // value = value.replace(reg, regStrs[i][1]);
+    value = value.replace(reg, regStrs[i][1])
+    console.log(value)
+  }
+  return value
+}
+// 只能输入数字验证input输入数字
+export function checkoutInputNum3(index, value) {
+  var regStrs = [
+    ['[^\\d\]+$', '']
+  ]
+  console.log(value)
+  for (var i = 0; i < regStrs.length; i++) {
+    var reg = new RegExp(regStrs[i][0])
+    // value = value.replace(reg, regStrs[i][1]);
+    value = value.replace(reg, regStrs[i][1])
+  }
+  console.log(value)
+  return value
+}
+// 判断为空
+export function isEmpty(obj) {
+  if (typeof obj === 'undefined' || obj == null || obj === '') {
+    return true
+  } else {
+    return false
+  }
+}
+
+// import { checkoutInput } from '@/utils/validate'

+ 41 - 0
src/views/weibao/api/index.js

@@ -272,4 +272,45 @@ export function homeData(data) {
         method: 'post',
         data
     })
+}
+
+// 儿童信息采集 地区获取
+export function listArea(data) {
+    return request({
+        url: '/pmadmin/web/area/listArea',
+        method: 'post',
+        data
+    })
+}
+// 儿童类型
+export function childType(data) {
+    return request({
+      url: '/pmadmin/web/childType/list',
+      method: 'post',
+      data
+    })
+}
+// 查询帮扶单位
+export function organization(data) {
+    return request({
+      url: '/pmadmin/web/organization/listAll',
+      method: 'post',
+      data
+    })
+}
+// 根据姓名查询员工
+export function listEmployeeByName(data) {
+    return request({
+      url: '/pmadmin/app/mini/listEmployeeByName',
+      method: 'post',
+      data
+    })
+}
+//创建儿童基本信息 
+export function createChildBaseInfo(data) {
+    return request({
+      url: '/pmadmin/app/mini/createChildBaseInfo',
+      method: 'post',
+      data
+    })
 }

+ 2 - 2
src/views/weibao/components/vanUploader.vue

@@ -4,7 +4,7 @@
       <van-col span="6">{{text}}:</van-col>
       <van-col span="18">
         <div class="box">
-          <van-uploader v-if="text=='图片'" :before-read="beforeRead" v-model="imgUrl" accept="image/png,image/jpeg,image/jpg" :after-read="afterRead" @delete='deleteUploader'>
+          <van-uploader v-if="text=='图片'" :before-read="beforeRead" v-model="imgUrl" accept="image/png,image/jpeg,image/jpg" :after-read="afterRead" @delete='deleteUploader' :max-count="maxCount">
           </van-uploader>
           <van-uploader v-else v-model="multiMediaUrl" accept="video/*" :before-read="beforeRead2" :after-read="afterRead" @delete='deleteUploader'>
             <template #preview-cover="{ file }">
@@ -36,7 +36,7 @@
 import { uploadImage } from '../api/index.js'
 import { compressAccurately } from 'image-conversion'
 export default {
-  props: ['text', 'showimg'],
+  props: ['text', 'showimg','maxCount'],
   data() {
     return {
       multiMediaUrl: [],

+ 5 - 0
src/views/weibao/router/router.js

@@ -18,6 +18,11 @@ const routes = [{
         },
         component: () => import('../views/home/index.vue')
     },
+    {
+        path: '/collect/index',
+        name: 'collect',
+        component: () => import('../views/collect/index.vue')
+    },
     {
         path: '/text',
         name: 'Home',

+ 611 - 0
src/views/weibao/views/collect/index.vue

@@ -0,0 +1,611 @@
+<template>
+    <div>
+        <van-nav-bar title="信息采集" @click-left="$router.back()" left-arrow fixed placeholder safe-area-inset-top />
+        <van-form @submit="saveFollowUp">
+            <div class="main">
+                <vanUploader :text="'图片'" :maxCount="1" @getfileList="getfileList"></vanUploader>
+                <van-row class="cell">
+                    <van-col span="6">姓名<span>*</span>:</van-col>
+                    <van-col span="18">
+                        <van-field name="name" v-model="form.name"  :rules="[{ required: true }]" placeholder="请输入姓名" />
+                    </van-col>
+                </van-row>
+                <van-row class="cell">
+                    <van-col span="6">性别<span>*</span>:</van-col>
+                    <van-col span="18">
+                        <van-field name="gender" v-model="modelValue.genderValue" :rules="[{ required: true }]" placeholder="请选择性别" @click="modelValue.genderShow = true" disabled />
+                        <van-popup v-model="modelValue.genderShow" position="bottom" :style="{ height: '40%' }">
+                            <van-picker default-index="0" visible-item-count="6" show-toolbar :columns="genderList"
+                            value-key="text" @cancel="modelValue.genderShow = false" @confirm="onGenderShow"/>
+                        </van-popup>
+                    </van-col>
+                </van-row>
+                <van-row class="cell">
+                    <van-col span="6">民族:</van-col>
+                    <van-col span="18">
+                        <van-field name="nation" v-model="form.nation" :rules="[{ required: false }]" placeholder="请选择民族" @click="modelValue.nationShow = true" disabled />
+                        <van-popup v-model="modelValue.nationShow" position="bottom" :style="{ height: '40%' }">
+                            <van-picker visible-item-count="6" show-toolbar :columns="mzlist"
+                            value-key="label" @cancel="modelValue.nationShow = false" @confirm="onNationShow"/>
+                        </van-popup>
+                    </van-col>
+                </van-row>
+                <van-row class="cell">
+                    <van-col span="6">身份证号<span>*</span>:</van-col>
+                    <van-col span="18">
+                        <van-field name="idcard" type="number" v-model="form.idCard" :rules="[{ validator, required: true, message: '请输入正确身份证号'}]" placeholder="请输入身份证号" />
+                    </van-col>
+                </van-row>
+                <van-row class="cell">
+                    <van-col span="6">出生日期:</van-col>
+                    <van-col span="18">
+                        <van-field name="birthday" v-model="form.birthday" :rules="[{ required: false }]" placeholder="出生日期" readonly />
+                    </van-col>
+                </van-row>
+                <van-row class="cell">
+                    <van-col span="6">户籍地址<span>*</span>:</van-col>
+                    <van-col span="18">
+                        <van-field name="region" v-model="modelValue.regionValue" :rules="[{ required: true }]"
+                        placeholder="请选择" disabled @click="modelValue.regionShow = true" />
+                    </van-col>
+                    <van-popup v-model="modelValue.regionShow" round position="bottom">
+                        <van-cascader
+                            v-model="modelValue.sigleRegionValue"
+                            title="请选择所在地区"
+                            :options="regionList"
+                            :field-names="regionFieldNames"
+                            @close="modelValue.regionShow = false"
+                            @change="onRegionChange"
+                            @finish="onRegionFinish"
+                        />
+                    </van-popup>
+                </van-row>
+                <van-row class="cell">
+                    <van-field name="address" v-model="form.address"  :rules="[{ required: true }]" placeholder="请输入详细地址" />
+                </van-row>
+                <van-row class="cell">
+                    <van-col span="6">儿童类型<span>*</span>:</van-col>
+                    <van-col span="18">
+                        <van-field name="child" v-model="form.typeDesc"  @click="modelValue.childShow = true" :rules="[{ required: true }]"
+                            placeholder="请选择" disabled />
+                    </van-col>
+                    <van-popup v-model="modelValue.childShow" position="bottom" :style="{ height: '50%' }">
+                        <van-picker :visible-item-count="6" show-toolbar :columns="childList"
+                            @confirm="onChildShow" @cancel="modelValue.childShow = false" value-key="name" />
+                    </van-popup>
+                </van-row>
+               
+                <van-row class="cell">
+                    <van-col span="6">帮扶单位:</van-col>
+                    <van-col span="18">
+                        <van-field name="assist" v-model="form.stationDesc" @click="modelValue.assistShow = true" :rules="[{ required: true }]"
+                            placeholder="请选择" disabled />
+                    </van-col>
+                    <van-popup v-model="modelValue.assistShow" position="bottom" :style="{ height: '50%' }">
+                        <van-picker :visible-item-count="8" show-toolbar :columns="assistList"
+                            @confirm="onAssistShow" @cancel="modelValue.assistShow = false" value-key="name" />
+                    </van-popup>
+                </van-row>
+                
+                <van-row class="cell">
+                    <van-col span="6">儿童主任<span>*</span>:</van-col>
+                    <van-col span="15">
+                        <van-field name="director" v-model="modelValue.directorTvalue" @input="onDirectorChange"  :rules="[{ required: true }]" placeholder="请输入姓名" :disabled="!directorLink">
+                        </van-field>
+                        <van-popup v-model="modelValue.directorShow" position="bottom" :style="{ height: '40%' }">
+                            <van-picker visible-item-count="6" show-toolbar :columns="directorList"
+                            value-key="name" @cancel="modelValue.directorShow = false" @confirm="onDirectorShow"/>
+                        </van-popup>
+                    </van-col> 
+                    <van-col span="3" v-if="directorLink">
+                        <van-button size="small" @click="onDirectorSearch">搜索</van-button>
+                    </van-col>
+                </van-row>
+                <van-row class="cell">
+                    <van-col span="6">联系电话<span>*</span>:</van-col>
+                    <van-col span="18">
+                        <van-field  name="phone" v-model="form.mobile" :rules="[{ required: true }]" placeholder="联系电话" disabled />
+                    </van-col>
+                </van-row>
+               
+                <van-row class="cell">
+                    <van-col span="6">健康状况<span>*</span>:</van-col>
+                    <van-col span="18">
+                        <van-field name="health" v-model="modelValue.healthValue"  :rules="[{  required: true }]"
+                            placeholder="请选择健康状况" @click="modelValue.healthShow = true" disabled />
+                         <van-popup v-model="modelValue.healthShow" position="bottom" :style="{ height: '40%' }">
+                            <van-picker visible-item-count="6" show-toolbar :columns="healthList"
+                            value-key="text" @cancel="modelValue.healthShow = false" @confirm="onHealthShow"/>
+                        </van-popup>
+                    </van-col>
+                </van-row>
+                <van-row class="cell">
+                    <van-col span="6">患病情况:</van-col>
+                    <van-col span="18">
+                        <van-field name="disease" v-model="form.illness" type="textarea" rows="1" :rules="[{ required: false }]"
+                            placeholder="请输入" />
+                    </van-col>
+                </van-row>
+                
+                <van-row class="cell">
+                    <van-col span="6">身高:</van-col>
+                    <van-col span="18">
+                        <van-field name="height" v-model="form.height"  :rules="[{ required: false }]"
+                            placeholder="请输入" />
+                    </van-col>
+                </van-row>
+                
+                <van-row class="cell">
+                    <van-col span="6">体重:</van-col>
+                    <van-col span="18">
+                        <van-field name="weight" v-model="form.weight"  :rules="[{required: false}]"
+                            placeholder="请输入" />
+                    </van-col>
+                </van-row>
+                
+                <van-row class="cell">
+                    <van-col span="6">就读学校:</van-col>
+                    <van-col span="18">
+                        <van-field name="school" v-model="form.school" :rules="[{ required: false }]"
+                            placeholder="请输入" />
+                    </van-col>
+                </van-row>
+                <van-row class="cell">
+                    <van-col span="6">年级:</van-col>
+                    <van-col span="18">
+                        <van-field name="grade" v-model="form.grades"  :rules="[{ required: false }]"
+                            placeholder="请输入" />
+                    </van-col>
+                </van-row>
+                
+                <van-row class="cell">
+                    <van-col span="6">家庭情况:</van-col>
+                    <van-col span="18">
+                        <van-field name="family" v-model="form.familyDesc" type="textarea" rows="1" :rules="[{ required: false }]"
+                            placeholder="请输入" />
+                    </van-col>
+                </van-row>
+                
+                <van-row class="cell">
+                    <van-col span="6">残疾等级:</van-col>
+                    <van-col span="18">
+                        <van-field name="disability" v-model="modelValue.disabilityValue"  :rules="[{  required: false }]"
+                            placeholder="请选择残疾等级" @click="modelValue.disabilityShow = true" disabled />
+                         <van-popup v-model="modelValue.disabilityShow" position="bottom" :style="{ height: '40%' }">
+                            <van-picker visible-item-count="6" show-toolbar :columns="disabilityList"
+                            value-key="label" @cancel="modelValue.disabilityShow = false" @confirm="onDisabilityShow"/>
+                        </van-popup>
+                    </van-col>
+                </van-row>
+                
+                <van-row class="cell">
+                    <van-col span="6">残疾证书号:</van-col>
+                    <van-col span="18">
+                        <van-field name="disabilityID" v-model="form.disabilityCertificate" :rules="[{ required: false}]"
+                            placeholder="请输入" />
+                    </van-col>
+                </van-row>
+                
+                <van-row class="cell">
+                    <van-col span="6">是否享受低保:</van-col>
+                    <van-col span="18">
+                        <van-field name="basic">
+                            <template #input>
+                                <van-radio-group v-model="form.subsistence" direction="horizontal">
+                                    <van-radio name='1' shape="square" icon-size="16px">是</van-radio>
+                                    <van-radio name='0'  shape="square" icon-size="16px">否</van-radio>
+                                </van-radio-group>
+                            </template>
+                           
+                        </van-field>
+                    </van-col>
+                </van-row>
+                
+                <van-row class="cell">
+                    <van-col span="6">是否享受重度残疾人护理补贴:</van-col>
+                    <van-col span="18">
+                        <van-field name="nurse">
+                            <template #input>
+                                <van-radio-group v-model="form.disabledSerious" direction="horizontal">
+                                    <van-radio name="1" shape="square" icon-size="16px">是</van-radio>
+                                    <van-radio name="0"  shape="square" icon-size="16px">否</van-radio>
+                                </van-radio-group>
+                            </template>
+                        </van-field>
+                    </van-col>
+                </van-row>
+               
+                <van-row class="cell">
+                    <van-col span="6">是否享受残疾人补贴:</van-col>
+                    <van-col span="18">
+                        <van-field name="subsidize">
+                            <template #input>
+                                <van-radio-group v-model="form.disabled" direction="horizontal">
+                                    <van-radio name="1" shape="square" icon-size="16px">是</van-radio>
+                                    <van-radio name="0"  shape="square" icon-size="16px">否</van-radio>
+                                </van-radio-group>
+                            </template>
+                        </van-field>
+                    </van-col>
+                </van-row>
+                <!-- <van-row class="cell">
+                    <van-col span="6">随访记录:</van-col>
+                    <van-col span="18">
+                        <van-field class="textarea" :rules="[{ required: true }]" v-model="form.remark" rows="1"
+                            type="textarea" placeholder="请输入随访记录" />
+                    </van-col>
+                </van-row> -->
+            </div>
+            <div class="but">
+                <van-button native-type="submit" :disabled="disabled">确 定</van-button>
+            </div>
+        </van-form>
+    </div>
+</template>
+<script>
+import {mzlist} from './mzlist.js'
+import {validateIDcard} from '@/utils/validate.js'
+import { listArea, childType, organization, listEmployeeByName, createChildBaseInfo} from '../../api/index.js'
+import vanUploader from '../../components/vanUploader.vue'
+export default {
+    components: { vanUploader },
+    data() {
+        return {
+            userInfo:{},
+            directorLink:'',
+            form:{
+                childId:'133',
+                photoImgUrl:'',//头像图片URL
+                name:'',//姓名
+                gender:'',//性别
+                nation:'',//民族
+                nationType:'',//民族ID
+                idCard:'',//身份证号
+                birthday:'',//出生日期
+                provinceName:'',//省份名称
+                provinceId:'',//省份ID
+                cityName:'',//市名称
+                cityId:'',//市ID
+                countryName:'',//区名称
+                countryId:'',//区ID
+                streetName:'',//街道名称
+                streetId:'',//街道ID
+                communityName:'',//社区名称
+                communityId:'',//社区ID
+                address:'',//详细地址
+                typeDesc:'',//儿童类型
+                type:'',//儿童类型 id
+                stationDesc:'',//帮扶单位
+                stationId:'',//帮扶单位id
+                tutelageId:'',//儿童主任ID
+                mobile:'',//联系电话
+                healthStatus:'',//健康状况
+                illness:'',//患病情况
+                height:'',//身高
+                weight:'',//体重
+                school:'',//就读学校
+                grades:'',//年级
+                familyDesc:'',//家庭情况
+                disabilityLevel:'',//残疾等级
+                disabilityCertificate:'',//残疾证书号
+                subsistence:'',//低保状态 0 否 1 是
+                disabledSerious:'',//重度残疾状态 0 否 1 是
+                disabled:'',//残疾状态 0 否 1 是
+
+            },
+            modelValue:{
+                nationShow:false,
+                genderShow:false,
+                genderValue:'',
+                regionShow:false,
+                regionValue:'',
+                sigleRegionValue:'',
+                childShow:false,
+                assistShow:false,
+                directorShow:false,
+                directorTvalue:'',
+                healthShow:false,
+                healthValue:'',
+                disabilityShow:false,
+                disabilityValue:'',
+            },
+            genderList:[
+                {
+                    text:'男',
+                    value:'1'
+                },
+                {
+                    text:'女',
+                    value:'0'
+                },
+            ], //性别
+            mzlist:mzlist,//民族
+            regionList:[],//地区
+            regionFieldNames:{
+                text: 'name',
+                value: 'id',
+                children: 'items',
+            },
+            directorList:[],//儿童主任
+            childList:[],//儿童类型
+            assistList:[],//帮扶单位
+            healthList:[
+                {
+                    text:'健康',
+                    value:'1'
+                },
+                {
+                    text:'患病',
+                    value:'2'
+                },
+                {
+                    text:'残疾',
+                    value:'3'
+                }
+            ],
+
+            disabilityList: [
+                { value: 1, label: '一级' },
+                { value: 2, label: '二级' },
+                { value: 3, label: '三级' },
+                { value: 4, label: '四级' },
+                { value: 5, label: '五级' },
+                { value: 6, label: '六级' },
+                { value: 7, label: '七级' },
+                { value: 8, label: '八级' },
+                { value: 9, label: '九级' },
+                { value: 10, label: '十级' },
+            ],
+
+            show: false,
+            disabled: false,
+            minDate: new Date(2020, 0, 1),
+            maxDate: new Date(),
+            customFieldName: {
+                text: 'name',
+                id: 'id',
+            },
+        }
+    },
+    created() {
+        this.userInfo = JSON.parse(sessionStorage.getItem('userInfo'))
+        this.directorLink = this.userInfo.roleIdStr == '14' ? false : true
+        this.modelValue.directorTvalue = this.userInfo.roleIdStr == '14' ? this.userInfo.name :''
+        this.form.mobile = this.userInfo.roleIdStr == '14' ? this.userInfo.phone :''
+        this.listAreaF()
+        this.childTypeF()
+        this.organizationF()
+    },
+    methods: {
+        async listAreaF() {
+            let res = await listArea({ parentId: '' })
+            res.data.forEach(item => {
+                item.items = null
+                this.regionList.push(item)
+            })
+        },
+        async childTypeF() {
+            let res = await childType()
+            this.childList = res.data
+        },
+        async organizationF() {
+            let res = await organization()
+            this.assistList = res.data
+        },
+
+        onGenderShow(e) {
+            this.modelValue.genderShow = false
+            this.modelValue.genderValue = e.text
+            this.form.gender = e.value
+        },
+        onNationShow(e) {
+            this.modelValue.nationShow = false
+            this.form.nation = e.label
+            this.form.nationType = e.value
+        },
+        onChildShow(e) {
+            this.modelValue.childShow = false
+            this.form.typeDesc = e.name
+            this.form.type = e.id
+        },
+        onAssistShow(e) {
+            this.modelValue.assistShow = false
+            this.form.stationDesc = e.name
+            this.form.stationId = e.id
+        },
+        onHealthShow(e) {
+            this.modelValue.healthShow = false
+            this.modelValue.healthValue = e.text
+            this.form.healthStatus = e.value
+        },
+        onDisabilityShow(e) {
+            this.modelValue.disabilityShow = false
+            this.modelValue.disabilityValue = e.label
+            this.form.disabilityLevel = e.value
+            
+        },
+        onDirectorShow(e) {
+            console.log(e)
+            this.modelValue.directorShow = false
+            this.form.tutelageId = e.id
+            this.form.mobile = e.mobile
+            this.modelValue.directorTvalue = e.name
+        },
+        onDirectorChange(e) {
+            // 儿童主任输入值变化
+            console.log('儿童主任输入值变化')
+            console.log(e)
+            this.form.mobile = ''
+        },
+        // 儿童主任
+        async onDirectorSearch() {
+            console.log(this.modelValue.directorTvalue)
+            if(this.modelValue.directorTvalue) {
+                let employee = await listEmployeeByName({ name: this.modelValue.directorTvalue, roleId: '14', status: 1 })
+                this.directorList = employee.data
+                this.modelValue.directorShow = true
+            }
+          
+        },
+        async onRegionChange({ value, selectedOptions, tabIndex }) {
+            let res = await listArea({ parentId: value })
+            if(res.data.length>0) {
+                res.data.forEach((item,index) => {
+                    res.data[index].items = item.children || null
+                })
+                this.addTree(selectedOptions, res.data, value)
+            }
+        },
+        addTree(selectedOptions, children, id) {
+            selectedOptions.forEach(item => {
+                if (item.id == id) {
+                    item.items = children
+                }
+            })
+        },
+        onRegionFinish({ selectedOptions, tabIndex }) {
+            console.log('结束:')
+            console.log(selectedOptions)
+            if(tabIndex>3) {
+                this.form.provinceName = selectedOptions[0].name
+                this.form.provinceId = selectedOptions[0].id
+                this.form.cityName = selectedOptions[1].name
+                this.form.cityId = selectedOptions[1].id
+                this.form.countryName = selectedOptions[2].name
+                this.form.countryId = selectedOptions[2].id
+                this.form.streetName = selectedOptions[3].name
+                this.form.streetId = selectedOptions[3].id
+                this.form.communityName = selectedOptions[4].name
+                this.form.communityId = selectedOptions[4].id
+                this.modelValue.regionValue = selectedOptions.map(option => option.name).join('')
+                this.modelValue.regionShow = false
+            }
+        },
+
+        validator(value) {
+            console.log(value)
+            let type
+            let self = this
+            validateIDcard(null,value, function(e){
+                if(e) {
+                    self.form.birthday =
+                    value.substring(6, 10) +
+                    '-' +
+                    value.substring(10, 12) +
+                    '-' +
+                    value.substring(12, 14)
+                }else {
+                    self.form.birthday =''
+                }
+                type = e
+            })
+            return type
+        },
+       
+        timeFormat(time) {
+            // 时间格式化 2019-09-08
+            let year = time.getFullYear()
+            let month = time.getMonth() + 1
+            if (month < 10) {
+                month = '0' + month
+            }
+
+            let day = time.getDate()
+            if (day < 10) {
+                day = '0' + day
+            }
+            return year + '-' + month + '-' + day
+        },
+        async saveFollowUp(e) {
+            console.log(this.form)
+            console.log(e)
+            console.log('请选择一张图片')
+            console.log(this.form.photoImgUrl)
+            if (!this.form.photoImgUrl) {
+                this.$toast.fail('请选择一张图片')
+                return
+            }
+            var data = JSON.parse(JSON.stringify(this.form))
+            data.birthday = ''
+            const res = await createChildBaseInfo(data)
+            if (res.code == '0000') {
+                this.$toast.success('成功')
+                // this.$router.go(-1)
+            }
+        },
+        getfileList(v, index) {
+            console.log(v)
+            console.log(index)
+            if (index == undefined) {
+                if (
+                    v.indexOf('.png') != -1 ||
+                    v.indexOf('.jpg') != -1 ||
+                    v.indexOf('.jpeg') != -1
+                ){
+                    this.form.photoImgUrl = v
+                }
+            }
+        },
+    },
+}
+</script>
+<style lang="scss" scoped>
+
+.van-row {
+    font-size: 30px;
+    text-align: left;
+}
+
+.row {
+    .van-col {
+        line-height: 60px;
+    }
+}
+
+.main {
+    padding: 0 20px;
+}
+
+.cell {
+    border-bottom: 1px solid #eee;
+    padding: 5px 0;
+    box-sizing: border-box;
+    display: flex;
+    align-items: center;
+    .van-col {
+        min-height: 80px;
+        display: flex;
+        align-items: center;
+        span {
+            color: #f62a59;
+        }
+        .van-button {
+            font-size: 25px;
+            background-color: #1677ff;
+            .van-button__text {
+                color: #ffffff;
+            }
+        }
+    }
+}
+
+.but {
+    text-align: center;
+    .van-button {
+        width: 620px;
+        margin: 24px auto;
+        color: #fff;
+        background-color: #1677ff;
+        border-radius: 12px;
+        font-size: 30px;
+    }
+}
+
+::v-deep .van-field__control {
+    color: #333;
+}
+
+::v-deep .van-field__control:disabled {
+    color: #333;
+    -webkit-text-fill-color: unset;
+}</style>

+ 236 - 0
src/views/weibao/views/collect/mzlist.js

@@ -0,0 +1,236 @@
+const mzlist = [{
+    value: 0,
+    label: '汉族'
+  },
+  {
+    value: 1,
+    label: '蒙古族'
+  },
+  {
+    value: 2,
+    label: '回族'
+  },
+  {
+    value: 3,
+    label: '藏族'
+  },
+  {
+    value: 4,
+    label: '维吾尔族'
+  },
+  {
+    value: 5,
+    label: '苗族'
+  },
+  {
+    value: 6,
+    label: '彝族'
+  },
+  {
+    value: 7,
+    label: '壮族'
+  },
+  {
+    value: 8,
+    label: '布依族'
+  },
+  {
+    value: 9,
+    label: '朝鲜族'
+  },
+  {
+    value: 10,
+    label: '满族'
+  },
+  {
+    value: 11,
+    label: '侗族'
+  },
+  {
+    value: 12,
+    label: '瑶族'
+  },
+  {
+    value: 13,
+    label: '白族'
+  },
+  {
+    value: 14,
+    label: '土家族'
+  },
+  {
+    value: 15,
+    label: '哈尼族'
+  },
+  {
+    value: 16,
+    label: '哈萨克族'
+  },
+  {
+    value: 17,
+    label: '傣族'
+  },
+  {
+    value: 18,
+    label: '黎族'
+  },
+  {
+    value: 19,
+    label: '傈僳族'
+  },
+  {
+    value: 20,
+    label: '佤族'
+  },
+  {
+    value: 21,
+    label: '畲族'
+  },
+  {
+    value: 22,
+    label: '高山族'
+  },
+  {
+    value: 23,
+    label: '拉祜族'
+  },
+  {
+    value: 24,
+    label: '水族'
+  },
+  {
+    value: 25,
+    label: '东乡族'
+  },
+  {
+    value: 26,
+    label: '纳西族'
+  },
+  {
+    value: 27,
+    label: '景颇族'
+  },
+  {
+    value: 28,
+    label: '柯尔克孜族'
+  },
+  {
+    value: 29,
+    label: '土族'
+  },
+  {
+    value: 30,
+    label: '达斡尔族'
+  },
+  {
+    value: 31,
+    label: '仫佬族'
+  },
+  {
+    value: 32,
+    label: '羌族'
+  },
+  {
+    value: 33,
+    label: '布朗族'
+  },
+  {
+    value: 34,
+    label: '撒拉族'
+  },
+  {
+    value: 35,
+    label: '毛南族'
+  },
+  {
+    value: 36,
+    label: '仡佬族'
+  },
+  {
+    value: 37,
+    label: '锡伯族'
+  },
+  {
+    value: 38,
+    label: '阿昌族'
+  },
+  {
+    value: 39,
+    label: '普米族'
+  },
+  {
+    value: 40,
+    label: '塔吉克族'
+  },
+  {
+    value: 41,
+    label: '怒族'
+  },
+  {
+    value: 42,
+    label: '乌兹别克族'
+  },
+  {
+    value: 43,
+    label: '俄罗斯族'
+  },
+  {
+    value: 44,
+    label: '鄂温克族'
+  },
+  {
+    value: 45,
+    label: '德昂族'
+  },
+  {
+    value: 46,
+    label: '保安族'
+  },
+  {
+    value: 47,
+    label: '裕固族'
+  },
+  {
+    value: 48,
+    label: '京族'
+  },
+  {
+    value: 49,
+    label: '塔塔尔族'
+  },
+  {
+    value: 50,
+    label: '独龙族'
+  },
+  {
+    value: 51,
+    label: '鄂伦春族'
+  },
+  {
+    value: 52,
+    label: '赫哲族'
+  },
+  {
+    value: 53,
+    label: '门巴族'
+  },
+  {
+    value: 54,
+    label: '珞巴族'
+  },
+  {
+    value: 55,
+    label: '基诺族'
+  },
+  {
+    value: 56,
+    label: '其他'
+  },
+  {
+    value: 57,
+    label: '外国血统中国籍人士'
+  },
+]
+export {
+  mzlist
+}

+ 1 - 1
src/views/weibao/views/followUp/director.vue

@@ -7,7 +7,7 @@
         <van-tab title="历史随访"></van-tab>
       </van-tabs>
       <div class="search_bg">
-        <van-search v-if="roleId ==21" v-show="active==0" v-model="followUpform.name" shape="round" show-action placeholder="儿童姓名" @search="onSearchPlan">
+        <van-search v-if="roleId ==21 || roleId ==11" v-show="active==0" v-model="followUpform.name" shape="round" show-action placeholder="儿童姓名" @search="onSearchPlan">
           <template #action>
             <div @click="onSearchPlan">搜索</div>
           </template>

+ 1 - 1
src/views/weibao/views/followUp/history.vue

@@ -1,5 +1,5 @@
 <template>
-  <div :class="roleIdStr==14 || roleIdStr==21?'mt':''">
+  <div :class="roleIdStr==14 || roleIdStr==21|| roleIdStr==11?'mt':''">
     <div class="list" v-for="item in historyList" :key="item.id" @click="$router.push({path:'/followUp/details',query:{id:item.id}})">
       <div class="img">
         <img class="tx" :src="item.url?item.url:require('../../assets/tx.png')" alt="">

+ 1 - 1
src/views/weibao/views/followUp/plan.vue

@@ -1,5 +1,5 @@
 <template>
-  <div :class="roleIdStr==21?'mt':''">
+  <div :class="roleIdStr==21 || roleIdStr==11?'mt':''">
     <div class="list" v-for="item in planList" :key="item.id">
       <div class="img">
         <img class="tx" :src="item.photoImgUrl?item.photoImgUrl:require('../../assets/tx.png')" alt="">

+ 14 - 7
src/views/weibao/views/home/index.vue

@@ -10,13 +10,18 @@
       <van-swipe-item><img src="../../assets/swiper3.jpg" alt=""></van-swipe-item> -->
     </van-swipe>
     <div class="category">
-      <!-- roleIdStr: 14:儿童主任, 15:儿童督导员, 21:社工员工 -->
+      <!-- roleIdStr: 14:儿童主任, 15:儿童督导员, 21:社工员工 11: 社工负责人-->
+      <!-- 儿童主任 社工组织 -->
+      <div v-if="roleIdStr==14 || roleIdStr==11" class="" @click="$router.push({path:'/collect/index'})">
+        <img src="../../assets/icon2.png" alt="">
+        <div>信息采集</div>
+      </div>
       <!-- 其它 -->
-      <div v-if="roleIdStr!=14 && roleIdStr!=21" @click="$router.push({path:'/followUp/historySupervisor'})">
+      <div v-if="roleIdStr!=14 && roleIdStr!=21 && roleIdStr!=11" @click="$router.push({path:'/followUp/historySupervisor'})">
         <img src="../../assets/icon1.png" alt="">
         <div>随访关爱</div>
       </div>
-      <!-- 主任 社工员工 -->
+      <!-- 主任 社工员工 社工负责人-->
       <div v-else class="" @click="$router.push({path:'/followUp/director'})">
         <img src="../../assets/icon1.png" alt="">
         <div>随访关爱</div>
@@ -198,12 +203,14 @@ export default {
   border-radius: 8px;
 }
 .category {
-  margin: 24px 5px;
+  margin: 24px 5px 0 5px;
   display: flex;
-  justify-content: center;
+  justify-content: start;
+  flex-wrap: wrap;
   > div {
-    flex: 1;
+    width: 33.33%;
     text-align: center;
+    margin-bottom: 25px;
     img {
       width: 80px;
       height: 80px;
@@ -217,7 +224,7 @@ export default {
   }
 }
 .main {
-  margin-top: 24px;
+  margin-top: 5px;
 }
 .van-tabs {
   border-bottom: 1px solid #eee;

+ 1 - 0
src/views/weibao/views/login/index.vue

@@ -50,6 +50,7 @@ export default {
       })
       if (res.data.jwtToken) {
         // this.$toast.success("登录成功");
+        res.data.phone = this.username
         sessionStorage.setItem('userInfo', JSON.stringify(res.data))
         sessionStorage.setItem('x-token', res.data.jwtToken)
         this.$router.replace('/home')