Browse Source

人员选择查询修改

dev-V1.0.6
wangmingyong@163.com 3 months ago
parent
commit
d41edbb264
  1. 3
      zdxt-web-client/zdxt-admin-plus-ui/src/views/efcode/report/registration/indexList.vue
  2. 35
      zdxt-web-client/zdxt-efcode-enforcement-app/src/components/enforcement/nos/RegisterPopups.vue
  3. 29
      zdxt-web-client/zdxt-efcode-enforcement-app/src/components/enforcement/register/RegisterPopups.vue
  4. 112
      zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/my/notice/cp_notice_edit.vue
  5. 80
      zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/my/plan/cp_plan_edit.vue
  6. 4
      zdxt-web-client/zdxt-efcode-enforcement-app/vite-env/.env.enforcement-dev-wmy
  7. 2
      zdxt-web-client/zdxt-efcode-enterprise-app/src/views/enterprise/enforcement/enforcementChat.vue
  8. 4
      zdxt-web-client/zdxt-efcode-enterprise-app/vite-env/.env.enterprise-dev-wmy

3
zdxt-web-client/zdxt-admin-plus-ui/src/views/efcode/report/registration/indexList.vue

@ -550,9 +550,8 @@ const closeDetailDialog = () => {
<el-descriptions-item label="未扫码原因">{{ noScanReasonOptions.find(d => d.dictValue === detailRow.checkCss)?.dictLabel || '-' }}</el-descriptions-item>
<el-descriptions-item label="其他原因描述">{{ detailRow.otherReasons || '-' }}</el-descriptions-item>
<el-descriptions-item label="是否投诉">{{ detailRow.isComplaint === 1 ? '是' : '否' }}</el-descriptions-item>
<el-descriptions-item width="150" label="创建时间">{{ detailRow.createTime ? formatDate(detailRow) : '-' }}</el-descriptions-item>
<el-descriptions-item width="150" label="创建时间">{{ (detailRow.createTime) }}</el-descriptions-item>
</el-descriptions>
</el-dialog>
</div>
</template>

35
zdxt-web-client/zdxt-efcode-enforcement-app/src/components/enforcement/nos/RegisterPopups.vue

@ -40,18 +40,18 @@
<van-icon name="cross" class="close-icon" @click="localPersonPopup = false" />
</div>
<div class="search-bar">
<van-search v-model="personSearchKeyword" placeholder="请输入姓名/执法证件号搜索" @search="handlePersonSearch"
<van-search v-model="personSearchKeyword" placeholder="请输入至少1个字搜索" @search="handlePersonSearch"
@clear="clearPersonSearch" />
<van-button class="search-btn" type="primary" @click="handlePersonSearch">搜索</van-button>
</div>
<van-list v-model:loading="personLoading" :finished="personFinished" :immediate-check="false"
finished-text="没有更多了" @load="loadPersonList" class="person-list">
:finished-text="personFinishedText" @load="loadPersonList" class="person-list">
<div v-for="(person, index) in personList" :key="index" class="person-list-item"
@click="handleSelectPerson(person)">
<div class="person-name">{{ person.userName }}</div>
<div class="person-id">执法证件号:{{ person.lawCertificateNum || person.phonenumber || person.mobileNumber }}</div>
</div>
<van-empty v-if="personList.length === 0 && !personLoading" description="暂无数据" />
<van-empty v-if="personList.length === 0 && !personLoading" :description="personEmptyText" />
</van-list>
</div>
</van-popup>
@ -278,8 +278,17 @@ const personLoading = ref(false)
const personFinished = ref(false)
const personPageNum = ref(1)
const personPageSize = ref(10)
const personSearched = ref(false)
const personEmptyText = computed(() => personSearched.value ? "暂无数据" : "请输入至少1个字搜索")
const personFinishedText = computed(() => personList.value.length > 0 ? "没有更多了" : "")
const loadPersonList = () => {
if ((personSearchKeyword.value || "").trim().length < 1) {
personFinished.value = true
personLoading.value = false
return
}
if (personFinished.value) return
personLoading.value = true
@ -335,11 +344,11 @@ const loadPersonList = () => {
}
const initPersonList = () => {
personFinished.value = false
personFinished.value = true
personPageNum.value = 1
personList.value = []
personLoading.value = false
loadPersonList()
personSearched.value = false
}
const handleSelectPerson = (person) => {
@ -347,12 +356,24 @@ const handleSelectPerson = (person) => {
}
const handlePersonSearch = () => {
initPersonList()
const keyword = (personSearchKeyword.value || "").trim()
if (keyword.length < 1) {
showToast("请输入至少1个字搜索")
return
}
personFinished.value = false
personPageNum.value = 1
personList.value = []
personSearched.value = true
loadPersonList()
}
const clearPersonSearch = () => {
personSearchKeyword.value = ""
initPersonList()
personFinished.value = true
personPageNum.value = 1
personList.value = []
personSearched.value = false
}
watch(localPersonPopup, (val) => {

29
zdxt-web-client/zdxt-efcode-enforcement-app/src/components/enforcement/register/RegisterPopups.vue

@ -49,18 +49,18 @@
<van-icon name="cross" class="close-icon" @click="localPersonPopup = false" />
</div>
<div class="search-bar">
<van-search v-model="personSearchKeyword" placeholder="请输入姓名/执法证件号搜索" @search="handlePersonSearch"
<van-search v-model="personSearchKeyword" placeholder="请输入至少1个字搜索" @search="handlePersonSearch"
@clear="clearPersonSearch" />
<van-button class="search-btn" type="primary" @click="handlePersonSearch">搜索</van-button>
</div>
<van-list v-model:loading="personLoading" :finished="personFinished" :immediate-check="false"
finished-text="没有更多了" @load="loadPersonList" class="person-list">
:finished-text="personFinishedText" @load="loadPersonList" class="person-list">
<div v-for="(person, index) in personList" :key="index" class="person-list-item"
@click="handleSelectPerson(person)">
<div class="person-name">{{ person.userName }}</div>
<div class="person-id"><span class="id-label">{{person.lawCertificateNum?'执法证件号:':'联系电话:'}}</span>{{ person.lawCertificateNum || person.phonenumber || person.mobileNumber }}</div>
</div>
<van-empty v-if="personList.length === 0 && !personLoading" description="暂无数据" />
<van-empty v-if="personList.length === 0 && !personLoading" :description="personEmptyText" />
</van-list>
</div>
</van-popup>
@ -229,16 +229,25 @@ const personPageNum = ref(1);
const personPageSize = ref(10);
const personLoading = ref(false);
const personFinished = ref(false);
const personSearched = ref(false);
const personEmptyText = computed(() => personSearched.value ? '暂无数据' : '请输入至少1个字搜索');
const personFinishedText = computed(() => personList.value.length > 0 ? '没有更多了' : '');
const initPersonList = () => {
personFinished.value = false;
personFinished.value = true;
personPageNum.value = 1;
personList.value = [];
personLoading.value = false;
loadPersonList();
personSearched.value = false;
};
const loadPersonList = () => {
if ((personSearchKeyword.value || '').trim().length < 1) {
personFinished.value = true;
personLoading.value = false;
return;
}
personLoading.value = true;
const selectedIds = props.selectedPersons.map(p => p.userId).filter(Boolean);
@ -288,18 +297,24 @@ const loadPersonList = () => {
};
const handlePersonSearch = () => {
const keyword = (personSearchKeyword.value || '').trim();
if (keyword.length < 1) {
showToast('请输入至少1个字搜索');
return;
}
personFinished.value = false;
personPageNum.value = 1;
personList.value = [];
personSearched.value = true;
loadPersonList();
};
const clearPersonSearch = () => {
personSearchKeyword.value = '';
personFinished.value = false;
personFinished.value = true;
personPageNum.value = 1;
personList.value = [];
loadPersonList();
personSearched.value = false;
};
const handleSelectPerson = (person) => {

112
zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/my/notice/cp_notice_edit.vue

@ -170,7 +170,7 @@
<!-- 时段选择 -->
<van-popup v-model:show="showTimePicker" position="bottom" round>
<van-picker
:columns="timeColumns"
:columns="availableTimeColumns"
@confirm="onTimeConfirm"
@cancel="showTimePicker = false"
/>
@ -217,17 +217,16 @@
<span class="person-picker-title">选择执法人员</span>
<van-icon name="cross" @click="showPersonPicker = false" />
</div>
<van-search
v-model="personSearchKeyword"
placeholder="输入姓名/账号检索单位人员"
shape="round"
@update:model-value="onPersonSearchInput"
/>
<div class="search-bar">
<van-search v-model="personSearchKeyword" placeholder="请输入至少1个字搜索"
@search="handlePersonSearch" @clear="clearPersonSearch" />
<van-button class="search-btn" type="primary" @click="handlePersonSearch">搜索</van-button>
</div>
<div class="person-picker-body">
<van-list
v-model:loading="personLoading"
:finished="personFinished"
finished-text=""
:finished-text="personFinishedText"
:offset="50"
@load="onPersonLoad"
>
@ -243,7 +242,7 @@
<!-- <span v-if="user.loginName" class="person-item-login">@{{ user.loginName }}</span> -->
</div>
</div>
<van-empty v-if="!personLoading && !personSearchResult.length" description="未检索到人员" image-size="80" />
<van-empty v-if="!personLoading && !personSearchResult.length" :description="personEmptyText" image-size="80" />
</van-list>
</div>
</div>
@ -357,6 +356,38 @@ const timeColumns = [
{ text: '其他(18:00-21:00)', value: 3 },
];
// 可选时段:执法日期为今天时过滤已过去的时段
const availableTimeColumns = computed(() => {
// 依赖弹窗显隐,打开时重新计算获取最新时间
void showTimePicker.value;
const dateStr = form.value.enforceDate;
if (!dateStr) return timeColumns;
const todayStr = `${today.getFullYear()}-${String(today.getMonth() + 1).padStart(2, '0')}-${String(today.getDate()).padStart(2, '0')}`;
if (dateStr !== todayStr) return timeColumns;
const now = new Date();
const nowMinutes = now.getHours() * 60 + now.getMinutes();
const periodEnds = { 1: 12 * 60, 2: 18 * 60, 3: 21 * 60 };
return timeColumns.filter(item => nowMinutes < periodEnds[item.value]);
});
// 默认时段设为当前可选的第一个
const syncDefaultEnforceTime = () => {
const available = availableTimeColumns.value;
if (available.length === 0) return;
const dateStr = form.value.enforceDate;
const todayStr = `${today.getFullYear()}-${String(today.getMonth() + 1).padStart(2, '0')}-${String(today.getDate()).padStart(2, '0')}`;
// 非今天(未来日期)默认取第一个(上午)
if (dateStr !== todayStr) {
form.value.enforceTime = available[0].value;
return;
}
// 今天:当前值不可用时取第一个
const currentValid = available.some(item => item.value === form.value.enforceTime);
if (!currentValid) {
form.value.enforceTime = available[0].value;
}
};
// 日期+时段展示
const enforceTimeDisplay = computed(() => {
const timeText = { 1: '上午(9:00-12:00)', 2: '下午(14:00-18:00)', 3: '其他(18:00-21:00)' };
@ -385,9 +416,12 @@ const personLoading = ref(false);
const personFinished = ref(false);
const personPageNum = ref(1);
const personPageSize = 10;
let personSearchTimer = null;
const personSearched = ref(false);
let personSearchSeq = 0;
const personEmptyText = computed(() => personSearched.value ? '未检索到人员' : '请输入至少1个字搜索');
const personFinishedText = computed(() => personSearchResult.value.length > 0 ? '没有更多了' : '');
// 计划列表
const planOptions = ref([]);
const planLoading = ref(false);
@ -402,6 +436,8 @@ onMounted(() => {
form.value.deptName = useCommon.deptName || '';
// 默认绑定当前用户为首位执法人员
bindCurrentUserAsDefaultPerson();
// 默认时段设为当前可选的第一个
syncDefaultEnforceTime();
if (isEdit.value) {
loadDetail(route.query.id);
@ -454,6 +490,7 @@ const loadDetail = (id, isReinitiateMode = false) => {
const onDateConfirm = ({ selectedValues }) => {
form.value.enforceDate = selectedValues.join('-');
showDatePicker.value = false;
syncDefaultEnforceTime();
};
// 时段确认
@ -526,22 +563,33 @@ const onAddPerson = () => {
personSearchKeyword.value = '';
personSearchResult.value = [];
personPageNum.value = 1;
personFinished.value = false;
personFinished.value = true;
personLoading.value = false;
personSearched.value = false;
showPersonPicker.value = true;
// van-list 挂载后自动触发 @load 加载第一页
};
const onPersonSearchInput = (val) => {
if (personSearchTimer) clearTimeout(personSearchTimer);
const keyword = (val || '').trim();
personSearchTimer = setTimeout(() => {
personPageNum.value = 1;
personFinished.value = false;
personSearchResult.value = [];
personLoading.value = true;
fetchPersonList(keyword);
}, 300);
const handlePersonSearch = () => {
const keyword = (personSearchKeyword.value || '').trim();
if (keyword.length < 1) {
showToast('请输入至少1个字搜索');
return;
}
personPageNum.value = 1;
personFinished.value = false;
personSearchResult.value = [];
personLoading.value = true;
personSearched.value = true;
fetchPersonList(keyword);
};
const clearPersonSearch = () => {
personSearchKeyword.value = '';
personPageNum.value = 1;
personFinished.value = true;
personSearchResult.value = [];
personLoading.value = false;
personSearched.value = false;
};
// van-list 触底加载
@ -551,6 +599,11 @@ const onPersonLoad = () => {
// 实际发起人员检索(分页追加)
const fetchPersonList = (keyword) => {
if ((keyword || '').trim().length < 1) {
personFinished.value = true;
personLoading.value = false;
return;
}
const seq = ++personSearchSeq;
personLoading.value = true;
searchBureauUnitUsers(
@ -610,7 +663,6 @@ const removePerson = (index) => {
};
const syncPersonData = () => {
console.log(personList.value);
form.value.enforceUserNames = personList.value.map(p => p.name).join(',');
form.value.enforceUserIds = personList.value.map(p => p.id || '').join(',');
form.value.enforceUserTels = personList.value.map(p => p.phone || '').join(',');
@ -902,6 +954,20 @@ const doSubmit = (isDraft) => {
display: flex;
flex-direction: column;
height: 100%;
.search-bar {
display: flex;
align-items: center;
margin: 0.3rem;
:deep(.van-search) {
padding-right: 0px;
flex: 1;
height: 34px;
}
.search-btn {
flex: none;
height: 34px;
}
}
.person-picker-header {
display: flex;
justify-content: space-between;

80
zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/my/plan/cp_plan_edit.vue

@ -175,17 +175,16 @@
<span class="person-picker-title">选择执法人员</span>
<van-icon name="cross" @click="showPersonPicker = false" />
</div>
<van-search
v-model="personSearchKeyword"
placeholder="输入姓名/账号检索单位人员"
shape="round"
@update:model-value="onPersonSearchInput"
/>
<div class="search-bar">
<van-search v-model="personSearchKeyword" placeholder="请输入至少1个字搜索"
@search="handlePersonSearch" @clear="clearPersonSearch" />
<van-button class="search-btn" type="primary" @click="handlePersonSearch">搜索</van-button>
</div>
<div class="person-picker-body">
<van-list
v-model:loading="personLoading"
:finished="personFinished"
finished-text=""
:finished-text="personFinishedText"
:offset="50"
@load="onPersonLoad"
>
@ -203,7 +202,7 @@
</div>
<van-empty
v-if="!personLoading && !personSearchResult.length"
description="未检索到人员"
:description="personEmptyText"
image-size="80"
/>
</van-list>
@ -358,9 +357,12 @@ const personLoading = ref(false);
const personFinished = ref(false);
const personPageNum = ref(1);
const personPageSize = 10;
let personSearchTimer = null;
const personSearched = ref(false);
let personSearchSeq = 0;
const personEmptyText = computed(() => personSearched.value ? '未检索到人员' : '请输入至少1个字搜索');
const personFinishedText = computed(() => personSearchResult.value.length > 0 ? '没有更多了' : '');
// 日期选择值
const datePickerValue = ref([
String(new Date().getFullYear()),
@ -601,23 +603,35 @@ const onAddPerson = () => {
personSearchKeyword.value = '';
personSearchResult.value = [];
personPageNum.value = 1;
personFinished.value = false;
personFinished.value = true;
personLoading.value = false;
personSearched.value = false;
showPersonPicker.value = true;
// van-list 挂载后自动触发 @load 加载第一页
};
// 人员检索输入(防抖)
const onPersonSearchInput = (val) => {
if (personSearchTimer) clearTimeout(personSearchTimer);
const keyword = (val || '').trim();
personSearchTimer = setTimeout(() => {
personPageNum.value = 1;
personFinished.value = false;
personSearchResult.value = [];
personLoading.value = true;
fetchPersonList(keyword);
}, 300);
// 人员检索(搜索按钮/回车)
const handlePersonSearch = () => {
const keyword = (personSearchKeyword.value || '').trim();
if (keyword.length <1) {
showToast('请输入至少1个字搜索');
return;
}
personPageNum.value = 1;
personFinished.value = false;
personSearchResult.value = [];
personLoading.value = true;
personSearched.value = true;
fetchPersonList(keyword);
};
// 清除搜索
const clearPersonSearch = () => {
personSearchKeyword.value = '';
personPageNum.value = 1;
personFinished.value = true;
personSearchResult.value = [];
personLoading.value = false;
personSearched.value = false;
};
// van-list 触底加载
@ -627,6 +641,11 @@ const onPersonLoad = () => {
// 实际发起人员检索(分页追加)
const fetchPersonList = (keyword) => {
if ((keyword || '').trim().length < 1) {
personFinished.value = true;
personLoading.value = false;
return;
}
const seq = ++personSearchSeq;
personLoading.value = true;
searchBureauUnitUsers(
@ -1033,6 +1052,23 @@ const doSubmit = () => {
flex-direction: column;
height: 100%;
.search-bar {
display: flex;
align-items: center;
margin: 0.3rem;
:deep(.van-search) {
padding-right: 0px;
flex: 1;
height: 34px;
}
.search-btn {
flex: none;
height: 34px;
}
}
.person-picker-header {
display: flex;
justify-content: space-between;

4
zdxt-web-client/zdxt-efcode-enforcement-app/vite-env/.env.enforcement-dev-wmy

@ -4,9 +4,9 @@ VITE_BASE_URL = '/efcode20-enf-app/api'
VITE_CONTEXT_PATH = '/efcode20-enf-app/'
# VITE_PROXY_TARGET = 'http://139.186.148.21:8080'
# VITE_API_URL = 'http://192.168.1.17:8080'
VITE_PROXY_TARGET = 'http://172.16.21.213:8080'
# VITE_PROXY_TARGET = 'http://172.16.21.213:8080'
# VITE_PROXY_TARGET = 'http://172.16.21.93:8080'
# VITE_PROXY_TARGET = 'http://172.16.20.72:8080'
VITE_PROXY_TARGET = 'http://172.16.20.72:8080'
VITE_DEFAULT_LOGIN = '/enforcement/loginByPassword'
VITE_APP_ENV = 'dev'
VITE_FILE_URL = ''

2
zdxt-web-client/zdxt-efcode-enterprise-app/src/views/enterprise/enforcement/enforcementChat.vue

@ -57,7 +57,7 @@
@touchmove="onTouchMove"
>
<div class="msg-sender">{{ msg.msgFrom === 0 ? (msg.bureauDeptName || useCommon.bureauUnitName || '执法单位') : msg.userName }}</div>
<span>{{ msg.content }}</span>
<span v-html="msg.content"></span>
</div>
</div>

4
zdxt-web-client/zdxt-efcode-enterprise-app/vite-env/.env.enterprise-dev-wmy

@ -1,8 +1,8 @@
# 企业端开发环境
VITE_PORT = 12001
# VITE_PROXY_TARGET = 'http://139.186.148.21:8080'
# VITE_PROXY_TARGET = 'http://172.16.21.213:8080'
VITE_PROXY_TARGET = 'http://172.16.21.93:8080'
VITE_PROXY_TARGET = 'http://172.16.21.213:8080'
# VITE_PROXY_TARGET = 'http://172.16.21.93:8080'
VITE_BASE_URL = '/efcode20-ent-app/api'
VITE_CONTEXT_PATH = '/efcode20-ent-app/'
VITE_DEFAULT_LOGIN = '/enterprise/loginByPassword'

Loading…
Cancel
Save