Merge branch 'dev' of http://git.sinoecare.com/sinoecare/digital_village_v2/dvcp_v2_wxcp_app into dev
@@ -1,5 +1,5 @@
|
||||
import dict from "./dict";
|
||||
import dayjs from './monent';
|
||||
import dict from "./dict"
|
||||
import dayjs from './monent'
|
||||
import qs from 'query-string'
|
||||
|
||||
const confirm = (content, title, config) => {
|
||||
@@ -87,146 +87,146 @@ const idCardNoUtil = {
|
||||
|
||||
/*校验地址码*/
|
||||
checkAddressCode: function (addressCode) {
|
||||
const check = /^[1-9]\d{5}$/.test(addressCode);
|
||||
if (!check) return false;
|
||||
return !!idCardNoUtil.provinceAndCitys[parseInt(addressCode.substring(0, 2))];
|
||||
const check = /^[1-9]\d{5}$/.test(addressCode)
|
||||
if (!check) return false
|
||||
return !!idCardNoUtil.provinceAndCitys[parseInt(addressCode.substring(0, 2))]
|
||||
},
|
||||
|
||||
/*校验日期码*/
|
||||
checkBirthDayCode: function (birDayCode) {
|
||||
const check = /^[1-9]\d{3}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))$/.test(birDayCode);
|
||||
if (!check) return false;
|
||||
const yyyy = parseInt(birDayCode.substring(0, 4), 10);
|
||||
const mm = parseInt(birDayCode.substring(4, 6), 10);
|
||||
const dd = parseInt(birDayCode.substring(6), 10);
|
||||
const xdata = new Date(yyyy, mm - 1, dd);
|
||||
const check = /^[1-9]\d{3}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))$/.test(birDayCode)
|
||||
if (!check) return false
|
||||
const yyyy = parseInt(birDayCode.substring(0, 4), 10)
|
||||
const mm = parseInt(birDayCode.substring(4, 6), 10)
|
||||
const dd = parseInt(birDayCode.substring(6), 10)
|
||||
const xdata = new Date(yyyy, mm - 1, dd)
|
||||
if (xdata > new Date()) {
|
||||
return false; //生日不能大于当前日期
|
||||
} else return (xdata.getFullYear() == yyyy) && (xdata.getMonth() == mm - 1) && (xdata.getDate() == dd);
|
||||
return false //生日不能大于当前日期
|
||||
} else return (xdata.getFullYear() == yyyy) && (xdata.getMonth() == mm - 1) && (xdata.getDate() == dd)
|
||||
},
|
||||
|
||||
/*计算校检码*/
|
||||
getParityBit: function (idCardNo) {
|
||||
const id17 = idCardNo.substring(0, 17);
|
||||
const id17 = idCardNo.substring(0, 17)
|
||||
/*加权 */
|
||||
let power = 0;
|
||||
let power = 0
|
||||
for (let i = 0; i < 17; i++) {
|
||||
power += parseInt(id17.charAt(i), 10) * parseInt(idCardNoUtil.powers[i]);
|
||||
power += parseInt(id17.charAt(i), 10) * parseInt(idCardNoUtil.powers[i])
|
||||
}
|
||||
/*取模*/
|
||||
const mod = power % 11;
|
||||
return idCardNoUtil.parityBit[mod];
|
||||
const mod = power % 11
|
||||
return idCardNoUtil.parityBit[mod]
|
||||
},
|
||||
|
||||
/*验证校检码*/
|
||||
checkParityBit: function (idCardNo) {
|
||||
const parityBit = idCardNo.charAt(17).toUpperCase();
|
||||
return idCardNoUtil.getParityBit(idCardNo) == parityBit;
|
||||
const parityBit = idCardNo.charAt(17).toUpperCase()
|
||||
return idCardNoUtil.getParityBit(idCardNo) == parityBit
|
||||
},
|
||||
|
||||
/*校验15位或18位的身份证号码*/
|
||||
checkIdCardNo: function (idCardNo) {
|
||||
//15位和18位身份证号码的基本校验
|
||||
const check = /^\d{15}|(\d{17}(\d|x|X))$/.test(idCardNo);
|
||||
if (!check) return false;
|
||||
const check = /^\d{15}|(\d{17}(\d|x|X))$/.test(idCardNo)
|
||||
if (!check) return false
|
||||
//判断长度为15位或18位
|
||||
if (idCardNo.length == 15) {
|
||||
return idCardNoUtil.check15IdCardNo(idCardNo);
|
||||
return idCardNoUtil.check15IdCardNo(idCardNo)
|
||||
} else if (idCardNo.length == 18) {
|
||||
return idCardNoUtil.check18IdCardNo(idCardNo);
|
||||
return idCardNoUtil.check18IdCardNo(idCardNo)
|
||||
} else {
|
||||
return false;
|
||||
return false
|
||||
}
|
||||
},
|
||||
|
||||
//校验15位的身份证号码
|
||||
check15IdCardNo: function (idCardNo) {
|
||||
//15位身份证号码的基本校验
|
||||
let check = /^[1-9]\d{7}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}$/.test(idCardNo);
|
||||
if (!check) return false;
|
||||
let check = /^[1-9]\d{7}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}$/.test(idCardNo)
|
||||
if (!check) return false
|
||||
//校验地址码
|
||||
const addressCode = idCardNo.substring(0, 6);
|
||||
check = idCardNoUtil.checkAddressCode(addressCode);
|
||||
if (!check) return false;
|
||||
const birDayCode = '19' + idCardNo.substring(6, 12);
|
||||
const addressCode = idCardNo.substring(0, 6)
|
||||
check = idCardNoUtil.checkAddressCode(addressCode)
|
||||
if (!check) return false
|
||||
const birDayCode = '19' + idCardNo.substring(6, 12)
|
||||
//校验日期码
|
||||
return idCardNoUtil.checkBirthDayCode(birDayCode);
|
||||
return idCardNoUtil.checkBirthDayCode(birDayCode)
|
||||
},
|
||||
|
||||
//校验18位的身份证号码
|
||||
check18IdCardNo: function (idCardNo) {
|
||||
//18位身份证号码的基本格式校验
|
||||
let check = /^[1-9]\d{5}[1-9]\d{3}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}(\d|x|X)$/.test(idCardNo);
|
||||
if (!check) return false;
|
||||
let check = /^[1-9]\d{5}[1-9]\d{3}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}(\d|x|X)$/.test(idCardNo)
|
||||
if (!check) return false
|
||||
//校验地址码
|
||||
const addressCode = idCardNo.substring(0, 6);
|
||||
check = idCardNoUtil.checkAddressCode(addressCode);
|
||||
if (!check) return false;
|
||||
const addressCode = idCardNo.substring(0, 6)
|
||||
check = idCardNoUtil.checkAddressCode(addressCode)
|
||||
if (!check) return false
|
||||
//校验日期码
|
||||
const birDayCode = idCardNo.substring(6, 14);
|
||||
check = idCardNoUtil.checkBirthDayCode(birDayCode);
|
||||
if (!check) return false;
|
||||
const birDayCode = idCardNo.substring(6, 14)
|
||||
check = idCardNoUtil.checkBirthDayCode(birDayCode)
|
||||
if (!check) return false
|
||||
//验证校检码
|
||||
return idCardNoUtil.checkParityBit(idCardNo);
|
||||
return idCardNoUtil.checkParityBit(idCardNo)
|
||||
},
|
||||
|
||||
formateDateCN: function (day) {
|
||||
const yyyy = day.substring(0, 4);
|
||||
const mm = day.substring(4, 6);
|
||||
const dd = day.substring(6);
|
||||
return yyyy + '-' + mm + '-' + dd;
|
||||
const yyyy = day.substring(0, 4)
|
||||
const mm = day.substring(4, 6)
|
||||
const dd = day.substring(6)
|
||||
return yyyy + '-' + mm + '-' + dd
|
||||
},
|
||||
|
||||
//获取信息
|
||||
getIdCardInfo: function (idCardNo) {
|
||||
let aday;
|
||||
let aday
|
||||
let idCardInfo = {
|
||||
gender: "", //性别
|
||||
birthday: "", // 出生日期(yyyy-mm-dd)
|
||||
sex: ""//系统性别码
|
||||
};
|
||||
}
|
||||
if (idCardNo.length == 15) {
|
||||
aday = '19' + idCardNo.substring(6, 12);
|
||||
idCardInfo.birthday = idCardNoUtil.formateDateCN(aday);
|
||||
aday = '19' + idCardNo.substring(6, 12)
|
||||
idCardInfo.birthday = idCardNoUtil.formateDateCN(aday)
|
||||
if (parseInt(idCardNo.charAt(14)) % 2 == 0) {
|
||||
idCardInfo.gender = idCardNoUtil.genders.female;
|
||||
idCardInfo.gender = idCardNoUtil.genders.female
|
||||
} else {
|
||||
idCardInfo.gender = idCardNoUtil.genders.male;
|
||||
idCardInfo.gender = idCardNoUtil.genders.male
|
||||
}
|
||||
} else if (idCardNo.length == 18) {
|
||||
aday = idCardNo.substring(6, 14);
|
||||
idCardInfo.birthday = idCardNoUtil.formateDateCN(aday);
|
||||
aday = idCardNo.substring(6, 14)
|
||||
idCardInfo.birthday = idCardNoUtil.formateDateCN(aday)
|
||||
if (parseInt(idCardNo.charAt(16)) % 2 == 0) {
|
||||
idCardInfo.gender = idCardNoUtil.genders.female;
|
||||
idCardInfo.gender = idCardNoUtil.genders.female
|
||||
} else {
|
||||
idCardInfo.gender = idCardNoUtil.genders.male;
|
||||
idCardInfo.gender = idCardNoUtil.genders.male
|
||||
}
|
||||
idCardInfo.sex = "" + Number(idCardNo.substring(16, 17)) % 2
|
||||
}
|
||||
return idCardInfo;
|
||||
return idCardInfo
|
||||
},
|
||||
|
||||
/*18位转15位*/
|
||||
getId15: function (idCardNo) {
|
||||
if (idCardNo.length == 15) {
|
||||
return idCardNo;
|
||||
return idCardNo
|
||||
} else if (idCardNo.length == 18) {
|
||||
return idCardNo.substring(0, 6) + idCardNo.substring(8, 17);
|
||||
return idCardNo.substring(0, 6) + idCardNo.substring(8, 17)
|
||||
} else {
|
||||
return null;
|
||||
return null
|
||||
}
|
||||
},
|
||||
|
||||
/*15位转18位*/
|
||||
getId18: function (idCardNo) {
|
||||
if (idCardNo.length == 15) {
|
||||
const id17 = idCardNo.substring(0, 6) + '19' + idCardNo.substring(6);
|
||||
const parityBit = idCardNoUtil.getParityBit(id17);
|
||||
return id17 + parityBit;
|
||||
const id17 = idCardNo.substring(0, 6) + '19' + idCardNo.substring(6)
|
||||
const parityBit = idCardNoUtil.getParityBit(id17)
|
||||
return id17 + parityBit
|
||||
} else if (idCardNo.length == 18) {
|
||||
return idCardNo;
|
||||
return idCardNo
|
||||
} else {
|
||||
return null;
|
||||
return null
|
||||
}
|
||||
},
|
||||
hideId(code) {
|
||||
@@ -255,11 +255,21 @@ export default {
|
||||
dict,
|
||||
confirm,
|
||||
calcAge,
|
||||
injectLib: (url, cb = () => 0) => {
|
||||
const scriptList = document.body.querySelectorAll('script')
|
||||
if (Object.values(scriptList || {}).findIndex(e => e.src == url) == -1) {
|
||||
const script = document.createElement('script')
|
||||
script.type = 'text/javascript'
|
||||
script.src = url
|
||||
script.addEventListener('load', () => cb())
|
||||
document.body.appendChild(script)
|
||||
} else cb()
|
||||
},
|
||||
dateFormat: (time, format) => {
|
||||
return dayjs(time).format(format || 'YYYY-MM-DD').replace("Invalid Date", "")
|
||||
},
|
||||
formatName: (name) => {
|
||||
return Array.from(name)?.slice(-2)?.toString() || "";
|
||||
return Array.from(name)?.slice(-2)?.toString() || ""
|
||||
},
|
||||
loading: title => {
|
||||
uni.showLoading({
|
||||
@@ -272,24 +282,24 @@ export default {
|
||||
},
|
||||
colorUtils: {
|
||||
Hex2RGBA(color, alpha = 1) {
|
||||
let hex = 0;
|
||||
let hex = 0
|
||||
if (color.charAt(0) == "#") {
|
||||
if (color.length == 4) {
|
||||
//检测诸如#FFF简写格式
|
||||
color = "#" + color.charAt(1).repeat(2) +
|
||||
color.charAt(2).repeat(2) +
|
||||
color.charAt(3).repeat(2);
|
||||
color.charAt(3).repeat(2)
|
||||
}
|
||||
hex = parseInt(color.slice(1), 16);
|
||||
hex = parseInt(color.slice(1), 16)
|
||||
}
|
||||
let r = hex >> 16 & 0xFF;
|
||||
let g = hex >> 8 & 0xFF;
|
||||
let b = hex & 0xFF;
|
||||
return `rgba(${r},${g},${b},${alpha})`;
|
||||
let r = hex >> 16 & 0xFF
|
||||
let g = hex >> 8 & 0xFF
|
||||
let b = hex & 0xFF
|
||||
return `rgba(${r},${g},${b},${alpha})`
|
||||
},
|
||||
RGBtoHex(r, g, b) {
|
||||
let hex = r << 16 | g << 8 | b;
|
||||
return "#" + hex.toString(16);
|
||||
let hex = r << 16 | g << 8 | b
|
||||
return "#" + hex.toString(16)
|
||||
}
|
||||
},
|
||||
dayjs,
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<script>
|
||||
import html2canvas from 'html2canvas'
|
||||
import RenderContent from './RenderContent.vue'
|
||||
import { mapFieldLable } from './../../config'
|
||||
import { mapFieldLable } from '../../config'
|
||||
export default {
|
||||
name: 'Daily',
|
||||
label: '日报',
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
<script>
|
||||
import html2canvas from 'html2canvas'
|
||||
import { mapFieldLable } from './../../config'
|
||||
import { mapFieldLable } from '../../config'
|
||||
import RenderContent from './RenderContent.vue'
|
||||
export default {
|
||||
name: 'InspectLog',
|
||||
@@ -232,7 +232,7 @@
|
||||
.top {
|
||||
width: 100%;
|
||||
height: 16px;
|
||||
background: url(./../../images/xc-icon.png) repeat;
|
||||
background: url(../../images/xc-icon.png) repeat;
|
||||
background-size: 16px 16px;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
<script>
|
||||
import html2canvas from 'html2canvas'
|
||||
import RenderContent from './RenderContent.vue'
|
||||
import { mapFieldLable } from './../../config'
|
||||
import { mapFieldLable } from '../../config'
|
||||
export default {
|
||||
name: 'MeetingMminutes',
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<script>
|
||||
import html2canvas from 'html2canvas'
|
||||
import RenderContent from './RenderContent.vue'
|
||||
import { mapFieldLable } from './../../config'
|
||||
import { mapFieldLable } from '../../config'
|
||||
|
||||
export default {
|
||||
name: 'WorkReport',
|
||||
|
Before Width: | Height: | Size: 667 B After Width: | Height: | Size: 667 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 288 B After Width: | Height: | Size: 288 B |
|
Before Width: | Height: | Size: 290 B After Width: | Height: | Size: 290 B |
|
Before Width: | Height: | Size: 288 B After Width: | Height: | Size: 288 B |
|
Before Width: | Height: | Size: 291 B After Width: | Height: | Size: 291 B |
|
Before Width: | Height: | Size: 543 B After Width: | Height: | Size: 543 B |
|
Before Width: | Height: | Size: 531 B After Width: | Height: | Size: 531 B |
|
Before Width: | Height: | Size: 685 B After Width: | Height: | Size: 685 B |
|
Before Width: | Height: | Size: 480 B After Width: | Height: | Size: 480 B |
|
Before Width: | Height: | Size: 267 B After Width: | Height: | Size: 267 B |
|
Before Width: | Height: | Size: 293 B After Width: | Height: | Size: 293 B |
|
Before Width: | Height: | Size: 119 B After Width: | Height: | Size: 119 B |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 796 B After Width: | Height: | Size: 796 B |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 972 B After Width: | Height: | Size: 972 B |
|
Before Width: | Height: | Size: 733 B After Width: | Height: | Size: 733 B |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1001 B After Width: | Height: | Size: 1001 B |
|
Before Width: | Height: | Size: 243 B After Width: | Height: | Size: 243 B |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 804 B After Width: | Height: | Size: 804 B |
|
Before Width: | Height: | Size: 427 B After Width: | Height: | Size: 427 B |
|
Before Width: | Height: | Size: 292 B After Width: | Height: | Size: 292 B |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 334 B After Width: | Height: | Size: 334 B |
|
Before Width: | Height: | Size: 560 B After Width: | Height: | Size: 560 B |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 288 B After Width: | Height: | Size: 288 B |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 854 B After Width: | Height: | Size: 854 B |
|
Before Width: | Height: | Size: 428 B After Width: | Height: | Size: 428 B |
|
Before Width: | Height: | Size: 715 B After Width: | Height: | Size: 715 B |
|
Before Width: | Height: | Size: 458 B After Width: | Height: | Size: 458 B |
|
Before Width: | Height: | Size: 826 B After Width: | Height: | Size: 826 B |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 699 B After Width: | Height: | Size: 699 B |
|
Before Width: | Height: | Size: 248 B After Width: | Height: | Size: 248 B |