Browse Source

信件流程BUG修复

master
wxc 2 years ago
parent
commit
3a57abd92f
  1. 2
      .gitignore
  2. 8
      components.d.ts
  3. 3
      src/components/FilePreview.vue
  4. 4
      src/components/MailLevel.vue
  5. 7
      src/components/Upload.vue
  6. 97
      src/utils/util.ts
  7. 2
      src/views/home/components/DataStatistics.vue
  8. 2
      src/views/home/components/MailTable.vue
  9. 12
      src/views/work/Done.vue
  10. 13
      src/views/work/Fav.vue
  11. 4
      src/views/work/Todo.vue
  12. 25
      src/views/work/components/AddMail.vue
  13. 5
      src/views/work/components/MailDialog.vue
  14. 2
      src/views/work/components/templates/CoHandlingPoliceEdit.vue
  15. 11
      src/views/work/components/templates/ExtensionDetail.vue
  16. 2
      src/views/work/components/templates/MailApprovalDetail.vue
  17. 10
      src/views/work/components/templates/ThreeHandling.vue

2
.gitignore vendored

@ -11,3 +11,5 @@ dist
*.mjs
*.map
*.rar

8
components.d.ts vendored

@ -7,6 +7,7 @@ export {}
declare module 'vue' {
export interface GlobalComponents {
ElAutocomplete: typeof import('element-plus/es')['ElAutocomplete']
ElBadge: typeof import('element-plus/es')['ElBadge']
ElButton: typeof import('element-plus/es')['ElButton']
ElCard: typeof import('element-plus/es')['ElCard']
@ -23,7 +24,11 @@ declare module 'vue' {
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElInput: typeof import('element-plus/es')['ElInput']
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
ElOption: typeof import('element-plus/es')['ElOption']
ElPageHeader: typeof import('element-plus/es')['ElPageHeader']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElPopover: typeof import('element-plus/es')['ElPopover']
ElProgress: typeof import('element-plus/es')['ElProgress']
ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
@ -32,6 +37,7 @@ declare module 'vue' {
ElSelect: typeof import('element-plus/es')['ElSelect']
ElStep: typeof import('element-plus/es')['ElStep']
ElSteps: typeof import('element-plus/es')['ElSteps']
ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTabPane: typeof import('element-plus/es')['ElTabPane']
@ -39,6 +45,8 @@ declare module 'vue' {
ElTag: typeof import('element-plus/es')['ElTag']
ElTimeline: typeof import('element-plus/es')['ElTimeline']
ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTree: typeof import('element-plus/es')['ElTree']
ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
ElUpload: typeof import('element-plus/es')['ElUpload']
FilePreview: typeof import('./src/components/FilePreview.vue')['default']

3
src/components/FilePreview.vue

@ -33,12 +33,13 @@
<script setup>
const { VITE_API_URL } = process.env;
defineProps({
const props = defineProps({
files: {
type: Array,
default: () => [],
},
});
</script>
<style lang="scss" scoped>
.PhotoConsumer {

4
src/components/MailLevel.vue

@ -50,5 +50,9 @@ watch(() => props.value, (val) => {
background-color: #FF0000;
border-color: #FFBFBF;
}
&[type=warning]::before {
background-color: #FFA732;
border-color: #FFDA2C;
}
}
</style>

7
src/components/Upload.vue

@ -8,6 +8,7 @@
@progress="uploadProgress"
@success="handleSuccess"
:show-file-list="false"
:accept="accept"
>
<el-button
>上传
@ -42,7 +43,7 @@
</photo-consumer>
</div>
<div
class="relative item flex center v-center column"
class="relative item flex center v-center column text-center"
v-else
>
<icon name="el-icon-Document" :size="20" />
@ -68,6 +69,10 @@ const props = defineProps({
type: Array,
default: () => [],
},
accept: {
type: String,
default: "*",
}
});
const emit = defineEmits(["update:modelValue"]);

97
src/utils/util.ts

@ -228,3 +228,100 @@ export function getFlowTagType(flowName) {
}
return ''
}
/**
*
* @param { String } code
*/
export function validatorIdCard(rule: object, code: string, callback: any) {
// 身份证号前两位代表区域
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: '国外 ',
};
const idCardReg = /^[1-9]\d{5}(19|20)?\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i; // 身份证格式正则表达式
// 如果身份证不满足格式正则表达式
if (!code) {
return callback(new Error('请输入身份证号码'))
}
if (!code.match(idCardReg)) {
return callback(new Error('请输入正确的身份证号码'))
}
if (!city[code.substr(0, 2)]) {
// 区域数组中不包含需验证的身份证前两位
return callback(new Error('请输入正确的身份证号码'))
}
if (code.length === 18) {
// 18位身份证需要验证最后一位校验位
code = code.split('');
// ∑(ai×Wi)(mod 11)
// 加权因子
const factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
// 校验位
const parity = [1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2];
let sum = 0;
let ai = 0;
let wi = 0;
for (let i = 0; i < 17; i++) {
ai = parseInt(code[i]);
wi = factor[i];
sum += ai * wi; // 开始计算并相加
}
const last = parity[sum % 11]; // 求余
if (last.toString() !== code[17]) {
return callback(new Error('请输入正确的身份证号码'))
}
}
callback()
}
/**
*
* @param {*} phonenumber
* @returns
*/
export function validatorPhone(rule: object, phonenumber: string, callback: any) {
if (!phonenumber) {
return callback(new Error('请输入手机号码'))
}
if (phonenumber.length !== 11) {
return callback(new Error('请输入正确的手机号码'))
}
if (!/^1[3456789]\d{9}/.test(phonenumber)) {
return callback(new Error('请输入正确的手机号码'))
}
callback()
}

2
src/views/home/components/DataStatistics.vue

@ -138,7 +138,7 @@ mailTrend({
}
.bar-item {
--bar-height: 15px;
--lable-width: 50px;
--lable-width: 58px;
line-height: var(--bar-height);
margin-bottom: 10px;
margin-right: 38px;

2
src/views/home/components/MailTable.vue

@ -258,7 +258,7 @@ function highTodoList() {
}
const activeMailId = ref("");
const activeWorkId = ref("");
const activeWorkId = ref(0);
const activeWorkType = ref("");
function handleMail(row) {
showModel.value = true;

12
src/views/work/Done.vue

@ -193,7 +193,7 @@
<el-button
type="primary"
link
@click="handleMail(row.mailId)"
@click="handleMail(row)"
>详情</el-button
>
</template>
@ -202,14 +202,14 @@
</div>
<div class="flex mt-4 end">
<el-pagination @size-change="getList" @current-change="getList" :current-page="query.current"
:page-sizes="[10, 15, 20, 40, 50]" :page-size="query.size"
:page-sizes="[10, 20, 50]" :page-size="query.size" v-model:current-page="query.current"
layout="total,sizes, prev, pager, next, jumper" :total="totalSize.total">
</el-pagination>
</div>
</main>
</div>
<MailDialog v-model:show="showModel" :mail-id="activeMailId" :disabled="true" @update="getList" />
<MailDialog v-model:show="showModel" :mail-id="activeMailId" :work-id="activeWorkId" :disabled="true" @update="getList" />
</template>
<script setup>
import MailDialog from "./components/MailDialog.vue";
@ -236,10 +236,12 @@ const totalSize = reactive({
const dones = ref([]);
const showModel = ref(false);
const activeMailId = ref("");
const activeWorkId = ref(0)
function handleMail(mailId) {
function handleMail(row) {
showModel.value = true;
activeMailId.value = mailId;
activeMailId.value = row.mailId;
activeWorkId.value = row.id
}
function getList() {

13
src/views/work/Fav.vue

@ -221,12 +221,12 @@
</el-table-column>
<el-table-column label="操作">
<template #default="{ row }">
<el-button
<!-- <el-button
type="primary"
link
@click="handleMail(row)"
>立即处理</el-button
>
>详情</el-button
> -->
</template>
</el-table-column>
</el-table>
@ -242,6 +242,7 @@
</template>
<script setup>
import { listFav } from "@/api/work/fav";
import { useDictData } from "@/hooks/useDictOptions";
import useMailStore from "@/stores/modules/mail";
@ -268,12 +269,10 @@ const closeCreateMailSelf = () => {
const favs = ref([]);
const showModel = ref(false);
const activeMailId = ref("");
const activeWorkType = ref("")
function handleMail(row) {
showModel.value = true;
activeMailId.value = row.mailId;
activeWorkType.value = row.workType
}
function getList() {
@ -293,10 +292,6 @@ function reset() {
getList();
}
const createMail = () => {
showCreateMailSelf.value = true;
}
getList()
</script>

4
src/views/work/Todo.vue

@ -231,7 +231,7 @@
</div>
<div class="flex mt-4 end">
<el-pagination @size-change="getList" @current-change="getList" :current-page="query.current"
:page-sizes="[10, 15, 20, 40, 50]" :page-size="query.size" v-model:current-page="query.current"
:page-sizes="[10, 20, 50]" :page-size="query.size" v-model:current-page="query.current"
layout="total,sizes, prev, pager, next, jumper" :total="totalSize.total">
</el-pagination>
</div>
@ -269,7 +269,7 @@ const addMailShow = ref(false);
const todos = ref([]);
const showModel = ref(false);
const activeMailId = ref("");
const activeWorkId = ref("");
const activeWorkId = ref(0);
const activeWorkType = ref("")
function handleMail(row) {

25
src/views/work/components/AddMail.vue

@ -172,7 +172,7 @@
</el-row>
<el-row>
<el-form-item label="上传附件">
<Upload v-model="form.fileList" />
<Upload v-model="form.fileList" accept="image/*" />
</el-form-item>
</el-row>
<div
@ -202,6 +202,7 @@ import { listSecond } from "@/api/org/department";
import { useDictData } from "@/hooks/useDictOptions";
import { addMail } from "@/api/mail";
import feedback from "@/utils/feedback";
import { validatorIdCard, validatorPhone } from "@/utils/util";
const { dictData } = useDictData(["mail_source"]);
@ -253,24 +254,6 @@ const validateName = (rule: any, value: string, callback: any) => {
callback();
}
};
const validatePhone = (rule: any, value: string, callback: any) => {
if (!value) {
callback(new Error("请输入手机号码"));
} else if (!/^1[3-9]\d{9}$/.test(value)) {
callback(new Error("请输入正确的手机号码"));
} else {
callback();
}
};
const validateIdNumber = (rule: any, value: string, callback: any) => {
if (!value) {
callback(new Error("请输入身份证号码"));
} else if (!/^\d{15}|\d{18}$/.test(value)) {
callback(new Error("请输入正确的身份证号码"));
} else {
callback();
}
};
const rules = reactive<FormRules<FormData>>({
source: [{ required: true, message: "请选择途径来源" }],
contactName: [
@ -278,10 +261,10 @@ const rules = reactive<FormRules<FormData>>({
],
contactSex: [{ required: true, message: "请选择性别" }],
contactIdCard: [
{ required: true, validator: validateIdNumber },
{ required: true, validator: validatorIdCard },
],
contactPhone: [
{ required: true, validator: validatePhone },
{ required: true, validator: validatorPhone },
],
content: [
{

5
src/views/work/components/MailDialog.vue

@ -213,11 +213,10 @@
</template>
<ExtensionDetail
:mail="mail"
v-if="mail.extensionState === 'applying'"
v-if="mail.extensionState && mail.extensionState !== 'completion'"
/>
<template
v-if="webComponents.indexOf('ThreeHandling') > -1"
v-if="webComponents.indexOf('ThreeHandling') > -1 && workType !== 'extension_approval'"
>
<ThreeHandling
v-model:data="requestData"

2
src/views/work/components/templates/CoHandlingPoliceEdit.vue

@ -20,8 +20,6 @@
</template>
<script setup>
const arr = ref([])
const props = defineProps({
show: {
type: Boolean,

11
src/views/work/components/templates/ExtensionDetail.vue

@ -9,11 +9,11 @@
<span>延期申请</span>
</div>
<div class="step-item flex v-center">
<div class="number" active="">2</div>
<div class="number" :active="getActive(2)">2</div>
<span>二级专班审批</span>
</div>
<div class="step-item flex v-center">
<div class="number">3</div>
<div class="number" :active="getActive(1)">3</div>
<span>市局专班审批</span>
</div>
</header>
@ -37,6 +37,13 @@ const props = defineProps({
default: {},
},
});
function getActive(roleId) {
if (!props.mail.extensionApprovals) {
return false;
}
return props.mail.extensionApprovals.some(item => item.roleId === roleId);
}
</script>
<style lang="scss" scoped>
.card {

2
src/views/work/components/templates/MailApprovalDetail.vue

@ -161,7 +161,7 @@
</el-collapse-item>
<el-collapse-item title="办结佐证材料" name="8">
<div style="padding: 3px">
<file-preview :files="mail.verifyAttachments" />
<file-preview :files="mail.verifyAttachments || []" />
</div>
</el-collapse-item>
</el-collapse>

10
src/views/work/components/templates/ThreeHandling.vue

@ -3,7 +3,7 @@
<div class="flex gap-20">
<div
class="flex gap v-center"
v-for="item in contactWriteData.coHandingPolices"
v-for="item in data.coHandingPolices"
:key="item.empNo"
>
<icon name="local-icon-police" :size="20" />
@ -373,7 +373,7 @@
<CoHandlingPoliceEdit
v-model:show="coHandlingPoliceShow"
v-model:data="contactWriteData.coHandingPolices"
v-model:data="data.coHandingPolices"
/>
</template>
<script setup>
@ -394,9 +394,6 @@ const { dictData } = useDictData([
"verify_is_true",
]);
const contactWriteData = ref({
coHandingPolices: [],
});
const coHandlingPoliceShow = ref(false);
const rules = {
@ -660,9 +657,6 @@ function validate() {
form.value.verifyReportedPolices = JSON.stringify(
verifyReportedPolices
);
form.value.verifyFollowupPolice = JSON.stringify(
form.value.verifyFollowupPolice
);
const data = { ...props.data, ...form.value };
emits("update:data", data);
resolve(true);

Loading…
Cancel
Save