Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
2b3be91747
|
@ -1,2 +1,2 @@
|
||||||
TARO_APP_ID="wx8902ddbfddb820d1"
|
TARO_APP_ID="wx0acd1c4fcf94bdd3"
|
||||||
TARO_APP_BASE_API="http://172.10.10.93:8765"
|
TARO_APP_BASE_API="http://172.10.10.93:8765"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"name": "collect_information",
|
"name": "collect_information",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "智慧派出所信息采集小程序",
|
"description": "警保联勤联动小程序",
|
||||||
"templateInfo": {
|
"templateInfo": {
|
||||||
"name": "default",
|
"name": "default",
|
||||||
"typescript": true,
|
"typescript": true,
|
||||||
|
@ -71,6 +71,7 @@
|
||||||
"@tarojs/webpack5-runner": "3.6.25",
|
"@tarojs/webpack5-runner": "3.6.25",
|
||||||
"@types/jest": "^29.3.1",
|
"@types/jest": "^29.3.1",
|
||||||
"@types/node": "^18.15.11",
|
"@types/node": "^18.15.11",
|
||||||
|
"@types/qrcode": "^1.5.5",
|
||||||
"@types/webpack-env": "^1.13.6",
|
"@types/webpack-env": "^1.13.6",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.2.0",
|
"@typescript-eslint/eslint-plugin": "^6.2.0",
|
||||||
"@typescript-eslint/parser": "^6.2.0",
|
"@typescript-eslint/parser": "^6.2.0",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"miniprogramRoot": "dist/",
|
"miniprogramRoot": "dist/",
|
||||||
"projectname": "collect_information",
|
"projectname": "collect_information",
|
||||||
"description": "智慧派出所信息采集小程序",
|
"description": "警保联勤联动小程序",
|
||||||
"setting": {
|
"setting": {
|
||||||
"urlCheck": false,
|
"urlCheck": false,
|
||||||
"es6": false,
|
"es6": false,
|
||||||
|
|
|
@ -19,7 +19,6 @@ export default defineAppConfig({
|
||||||
pages: [
|
pages: [
|
||||||
'pages/policeManager/index',
|
'pages/policeManager/index',
|
||||||
'pages/policeDetails/index',
|
'pages/policeDetails/index',
|
||||||
|
|
||||||
'pages/myProject/myProject',
|
'pages/myProject/myProject',
|
||||||
'pages/projectDetails/projectDetails',
|
'pages/projectDetails/projectDetails',
|
||||||
'pages/form/form'
|
'pages/form/form'
|
||||||
|
|
|
@ -10,25 +10,25 @@ const pinia = createPinia()
|
||||||
// pinia.use(piniaPluginPersistedstate)
|
// pinia.use(piniaPluginPersistedstate)
|
||||||
const App = createApp({
|
const App = createApp({
|
||||||
onShow(options) {
|
onShow(options) {
|
||||||
try {
|
// try {
|
||||||
const store = useCounterStore()
|
// const store = useCounterStore()
|
||||||
const token = Taro.getStorageSync('token')
|
// const token = Taro.getStorageSync('token')
|
||||||
console.log(token)
|
// console.log(token)
|
||||||
if (token) {
|
// if (token) {
|
||||||
Taro.switchTab({
|
// Taro.switchTab({
|
||||||
url: '/pages/mine/mine'
|
// url: '/pages/mine/mine'
|
||||||
// url: '/pages/projectManager/index/index'
|
// // url: '/pages/projectManager/index/index'
|
||||||
|
//
|
||||||
})
|
// })
|
||||||
store.setSelected(2)
|
// store.setSelected(2)
|
||||||
} else {
|
// } else {
|
||||||
console.log(2222)
|
// console.log(2222)
|
||||||
}
|
// }
|
||||||
console.log('App onShow.')
|
// console.log('App onShow.')
|
||||||
} catch (err) {
|
// } catch (err) {
|
||||||
console.log(err)
|
// console.log(err)
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
|
|
||||||
},
|
},
|
||||||
// 入口组件不需要实现 render 方法,即使实现了也会被 taro 所覆盖
|
// 入口组件不需要实现 render 方法,即使实现了也会被 taro 所覆盖
|
||||||
|
|
|
@ -1,225 +0,0 @@
|
||||||
<template>
|
|
||||||
<view>
|
|
||||||
<nut-form ref="formRef" :model-value="formParams" :rules="rules">
|
|
||||||
<nut-form-item label="街道/社区:" prop="streetCommunity">
|
|
||||||
<view @click="streetCommunitySmallCommunityVisible = true">
|
|
||||||
{{ streetCommunitySmallCommunityLabel || "请选择街道/小区" }}
|
|
||||||
</view>
|
|
||||||
</nut-form-item>
|
|
||||||
<nut-form-item label="楼栋/门户:" prop="residentialDivision">
|
|
||||||
<view @click="buildingFloorHouseVisible = true">
|
|
||||||
{{ buildingFloorHouseLabel || "请选择楼栋/门户" }}
|
|
||||||
</view>
|
|
||||||
</nut-form-item>
|
|
||||||
<nut-form-item label="姓名:" prop="name">
|
|
||||||
<nut-input
|
|
||||||
v-model="formParams.name"
|
|
||||||
placeholder="请输入姓名"
|
|
||||||
type="text"
|
|
||||||
/>
|
|
||||||
</nut-form-item>
|
|
||||||
<nut-form-item label="性别:" prop="sex">
|
|
||||||
<nut-radio-group v-model="formParams.sex" direction="horizontal">
|
|
||||||
<nut-radio v-for="item in SEX" :key="item.value" :label="item.value"
|
|
||||||
>{{ item.label }}
|
|
||||||
</nut-radio>
|
|
||||||
</nut-radio-group>
|
|
||||||
</nut-form-item>
|
|
||||||
<nut-form-item label="出生日期:" prop="dataOfBirth">
|
|
||||||
<view @click="dataOfBirthVisible = true">
|
|
||||||
{{
|
|
||||||
dayjs(formParams.dataOfBirth).format("YYYY-MM-DD") ||
|
|
||||||
"请选择出生日期"
|
|
||||||
}}
|
|
||||||
</view>
|
|
||||||
</nut-form-item>
|
|
||||||
<nut-form-item label="身份证:" prop="idCard">
|
|
||||||
<nut-input
|
|
||||||
v-model="formParams.idCard"
|
|
||||||
placeholder="请输入身份证"
|
|
||||||
type="text"
|
|
||||||
/>
|
|
||||||
</nut-form-item>
|
|
||||||
<nut-form-item label="手机号:" prop="phone">
|
|
||||||
<nut-input
|
|
||||||
v-model="formParams.phone"
|
|
||||||
placeholder="请输入手机号码"
|
|
||||||
type="text"
|
|
||||||
/>
|
|
||||||
</nut-form-item>
|
|
||||||
<nut-form-item label="户籍地:" prop="householdRegistrationAddress">
|
|
||||||
<nut-input
|
|
||||||
v-model="formParams.householdRegistrationAddress"
|
|
||||||
placeholder="请输入户籍地"
|
|
||||||
type="text"
|
|
||||||
/>
|
|
||||||
</nut-form-item>
|
|
||||||
</nut-form>
|
|
||||||
<nut-cascader
|
|
||||||
v-model:visible="streetCommunitySmallCommunityVisible"
|
|
||||||
v-model="formParams.streetCommunitySmallCommunityIds"
|
|
||||||
:options="streetCommunitySmallCommunityTreeData"
|
|
||||||
title="选择街道/社区"
|
|
||||||
text-key="label"
|
|
||||||
@change="streetCommunitySmallCommunityChange"
|
|
||||||
></nut-cascader>
|
|
||||||
<nut-cascader
|
|
||||||
v-model:visible="buildingFloorHouseVisible"
|
|
||||||
v-model="formParams.buildingFloorHouseIds"
|
|
||||||
:options="buildingFloorHouseTreeData"
|
|
||||||
title="选择楼栋/门户"
|
|
||||||
text-key="label"
|
|
||||||
@change="buildingFloorHouseChange"
|
|
||||||
></nut-cascader>
|
|
||||||
<nut-popup v-model:visible="dataOfBirthVisible" position="bottom">
|
|
||||||
<nut-date-picker
|
|
||||||
v-model="formParams.dataOfBirth"
|
|
||||||
:min-date="min"
|
|
||||||
:max-date="max"
|
|
||||||
:three-dimensional="false"
|
|
||||||
@confirm="dataOfBirthVisible = false"
|
|
||||||
></nut-date-picker>
|
|
||||||
</nut-popup>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { SEX } from "@/enums";
|
|
||||||
import dayjs from "dayjs";
|
|
||||||
import { ref, watch } from "vue";
|
|
||||||
import type { FormRules } from "@nutui/nutui-taro/dist/types/__VUE/form/types";
|
|
||||||
import api from "@/request";
|
|
||||||
import type { FormInstance } from "@nutui/nutui-taro";
|
|
||||||
import { useLoad } from "@tarojs/taro";
|
|
||||||
|
|
||||||
const emits = defineEmits(["update:modelValue"]);
|
|
||||||
const props = withDefaults(
|
|
||||||
defineProps<{
|
|
||||||
modelValue: PersonnelInformation;
|
|
||||||
}>(),
|
|
||||||
{
|
|
||||||
modelValue: () => {
|
|
||||||
return {
|
|
||||||
name: "",
|
|
||||||
sex: 0,
|
|
||||||
dataOfBirth: new Date(),
|
|
||||||
idCard: "",
|
|
||||||
phone: "",
|
|
||||||
householdRegistrationAddress: "",
|
|
||||||
streetCommunitySmallCommunityIds: [],
|
|
||||||
buildingFloorHouseIds: [],
|
|
||||||
} as PersonnelInformation;
|
|
||||||
},
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
const defaultParams = { ...props.modelValue };
|
|
||||||
|
|
||||||
const formRef = ref<FormInstance>();
|
|
||||||
const formParams = ref<PersonnelInformation>({
|
|
||||||
...props.modelValue,
|
|
||||||
});
|
|
||||||
const rules: FormRules = {
|
|
||||||
name: [
|
|
||||||
{ required: true, message: "请输入姓名" },
|
|
||||||
{
|
|
||||||
validator: (value) => {
|
|
||||||
return !(value.length < 2 || value.length >= 20);
|
|
||||||
},
|
|
||||||
message: "名字在2~20字符之间",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
sex: [{ required: true, message: "请选择性别" }],
|
|
||||||
idCard: [
|
|
||||||
{ required: true, message: "请输入身份证" },
|
|
||||||
{
|
|
||||||
regex:
|
|
||||||
/^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
|
|
||||||
message: "身份证格式错误",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
phone: [
|
|
||||||
{ required: true, message: "请输入手机号码" },
|
|
||||||
{
|
|
||||||
regex: /^400(-?)[0-9]{7}$|^1\d{10}$|^0[0-9]{2,3}-[0-9]{7,8}$/,
|
|
||||||
message: "手机格式错误",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
watch(formParams.value, (n) => {
|
|
||||||
emits("update:modelValue", n);
|
|
||||||
});
|
|
||||||
|
|
||||||
const dataOfBirthVisible = ref(false);
|
|
||||||
const min = new Date(1920, 0, 1);
|
|
||||||
const max = new Date(2025, 10, 1);
|
|
||||||
|
|
||||||
defineExpose<{
|
|
||||||
validate: () => Promise<unknown>;
|
|
||||||
resetForm: () => void;
|
|
||||||
}>({
|
|
||||||
validate: async (): Promise<unknown> => {
|
|
||||||
const result = (await formRef.value?.validate()) as any;
|
|
||||||
if (result.valid) {
|
|
||||||
return Promise.resolve("校验通过");
|
|
||||||
}
|
|
||||||
return Promise.reject("校验不通过");
|
|
||||||
},
|
|
||||||
resetForm: () => {
|
|
||||||
for (let key in defaultParams) {
|
|
||||||
formParams.value[key] = defaultParams[key];
|
|
||||||
}
|
|
||||||
streetCommunitySmallCommunityLabel.value = "";
|
|
||||||
buildingFloorHouseLabel.value = "";
|
|
||||||
buildingFloorHouseTreeData.value = [];
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const streetCommunitySmallCommunityTreeData = ref<TreeNode<string>[]>([]);
|
|
||||||
const streetCommunitySmallCommunityVisible = ref<boolean>(false);
|
|
||||||
const streetCommunitySmallCommunityLabel = ref<string>("");
|
|
||||||
const streetCommunitySmallCommunityChange = (
|
|
||||||
value: string,
|
|
||||||
pathNodes: Record<string, any>[]
|
|
||||||
) => {
|
|
||||||
buildingFloorHouseLabel.value = "";
|
|
||||||
formParams.value.buildingFloorHouseIds = [];
|
|
||||||
buildingFloorHouseTreeData.value = [];
|
|
||||||
streetCommunitySmallCommunityLabel.value = pathNodes
|
|
||||||
.map((e) => e.text)
|
|
||||||
.join(",");
|
|
||||||
getBuildingFloorHouseTreeBySmallCommunityId(value[value.length - 1]);
|
|
||||||
};
|
|
||||||
|
|
||||||
const buildingFloorHouseVisible = ref<boolean>(false);
|
|
||||||
const buildingFloorHouseLabel = ref<string>("");
|
|
||||||
const buildingFloorHouseChange = (
|
|
||||||
value: string,
|
|
||||||
pathNodes: Record<string, any>[]
|
|
||||||
) => (buildingFloorHouseLabel.value = pathNodes.map((e) => e.text).join(","));
|
|
||||||
const buildingFloorHouseTreeData = ref<TreeNode<string>[]>([]);
|
|
||||||
|
|
||||||
const getBuildingFloorHouseTreeBySmallCommunityId = (
|
|
||||||
smallCommunityId: string
|
|
||||||
) => {
|
|
||||||
api
|
|
||||||
.get<TreeNode<string>[]>(
|
|
||||||
"/residentialDivision/getBuildingFloorHouseTreeBySmallCommunityId",
|
|
||||||
{ smallCommunityId }
|
|
||||||
)
|
|
||||||
.then((resp) => {
|
|
||||||
buildingFloorHouseTreeData.value = resp.data as TreeNode<string>[];
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
useLoad(() => {
|
|
||||||
api
|
|
||||||
.get<TreeNode<string>[]>(
|
|
||||||
"/residentialDivision/streetCommunitySmallCommunityTree"
|
|
||||||
)
|
|
||||||
.then((resp) => {
|
|
||||||
streetCommunitySmallCommunityTreeData.value =
|
|
||||||
resp.data as TreeNode<string>[];
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
|
@ -1,6 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="form">
|
<view class="form">
|
||||||
{{ formData }}
|
|
||||||
<nut-form ref="formRef" :model-value="formData" :rules="rules">
|
<nut-form ref="formRef" :model-value="formData" :rules="rules">
|
||||||
<nut-form-item label="姓名" prop="name">
|
<nut-form-item label="姓名" prop="name">
|
||||||
<nut-input v-model="formData.name" placeholder="请输入姓名" type="text"/>
|
<nut-input v-model="formData.name" placeholder="请输入姓名" type="text"/>
|
||||||
|
@ -25,6 +24,10 @@
|
||||||
<nut-form-item label="工作岗位" prop="workPost">
|
<nut-form-item label="工作岗位" prop="workPost">
|
||||||
<nut-input v-model="formData.workPost" placeholder="请输入工作岗位" type="text"/>
|
<nut-input v-model="formData.workPost" placeholder="请输入工作岗位" type="text"/>
|
||||||
</nut-form-item>
|
</nut-form-item>
|
||||||
|
|
||||||
|
<nut-form-item label="手机号" prop="telephone">
|
||||||
|
<nut-input v-model="formData.telephone" placeholder="请输入手机号" type="text"/>
|
||||||
|
</nut-form-item>
|
||||||
<nut-form-item label="籍贯" prop="nativePlace">
|
<nut-form-item label="籍贯" prop="nativePlace">
|
||||||
<nut-input v-model="formData.nativePlace" placeholder="请输入籍贯" type="text"/>
|
<nut-input v-model="formData.nativePlace" placeholder="请输入籍贯" type="text"/>
|
||||||
</nut-form-item>
|
</nut-form-item>
|
||||||
|
@ -68,6 +71,8 @@ const showPicker = ref(false)
|
||||||
const formData = ref<formDate>({} as any)
|
const formData = ref<formDate>({} as any)
|
||||||
const formRef = ref(null)
|
const formRef = ref(null)
|
||||||
|
|
||||||
|
const qrcodeId = ref()
|
||||||
|
|
||||||
const rules: FormRules = {
|
const rules: FormRules = {
|
||||||
name: [
|
name: [
|
||||||
{required: true, message: "请输入姓名"},
|
{required: true, message: "请输入姓名"},
|
||||||
|
@ -79,11 +84,33 @@ const rules: FormRules = {
|
||||||
regex: /^(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))((0[1-9])|([12][0-9])|(30|31))\d{3}(\d|X)$)/,
|
regex: /^(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))((0[1-9])|([12][0-9])|(30|31))\d{3}(\d|X)$)/,
|
||||||
message: "身份证格式错误",
|
message: "身份证格式错误",
|
||||||
},
|
},
|
||||||
|
],
|
||||||
|
telephone:[
|
||||||
|
{required: true, message: "请输入手机号"},
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
useLoad((options) => {
|
useLoad((options) => {
|
||||||
|
qrcodeId.value = options
|
||||||
|
console.log(JSON.parse(options.item))
|
||||||
|
if(options.id === '2'){
|
||||||
|
formData.value = {
|
||||||
|
serviceProjectId: JSON.parse(options.item).serviceProjectId,
|
||||||
|
securityUnitId:JSON.parse(options.item).securityUnitId,
|
||||||
|
name: '',
|
||||||
|
workPost: '',
|
||||||
|
sex: 0,
|
||||||
|
nativePlace: '',
|
||||||
|
idCard: '',
|
||||||
|
dateOfBirth: null,
|
||||||
|
securityNumber: '',
|
||||||
|
remark: '',
|
||||||
|
homeAddress: '',
|
||||||
|
telephone:''
|
||||||
|
}
|
||||||
|
}else{
|
||||||
formData.value = JSON.parse(options.item)
|
formData.value = JSON.parse(options.item)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const idCardBlur = (e: any) => {
|
const idCardBlur = (e: any) => {
|
||||||
|
@ -99,10 +126,17 @@ const idCardBlur = (e: any) => {
|
||||||
formData.value.dateOfBirth = new Date(parseInt(year), parseInt(month) - 1, parseInt(day))
|
formData.value.dateOfBirth = new Date(parseInt(year), parseInt(month) - 1, parseInt(day))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const url = ref('')
|
||||||
const submit = () => {
|
const submit = () => {
|
||||||
formRef.value?.validate().then(async ({valid}) => {
|
formRef.value?.validate().then(async ({valid}) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const resp = await api.post('/projectManageIndex/saveOrUpdateSecurityUser', formData.value)
|
if( qrcodeId.value.id === '1'){
|
||||||
|
url.value = '/projectManageIndex/saveOrUpdateSecurityUser'
|
||||||
|
}else{
|
||||||
|
url.value = '/miniProgramUser/qrCodeFormInputSecurityUser'
|
||||||
|
}
|
||||||
|
console.log(formData.value)
|
||||||
|
const resp = await api.post(`${ url.value}`, formData.value)
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: resp.message,
|
title: resp.message,
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
|
@ -112,6 +146,7 @@ const submit = () => {
|
||||||
formData.value = {
|
formData.value = {
|
||||||
snowFlakeId: undefined,
|
snowFlakeId: undefined,
|
||||||
serviceProjectId: formData.value.serviceProjectId,
|
serviceProjectId: formData.value.serviceProjectId,
|
||||||
|
securityUnitId:formData.value.securityUnitId,
|
||||||
name: '',
|
name: '',
|
||||||
workPost: '',
|
workPost: '',
|
||||||
telephone: '',
|
telephone: '',
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="myProject">
|
<view class="myProject">
|
||||||
|
<view v-if="number !== 0">
|
||||||
<view class="myProjectItem" v-for="(item,index) in myProjectList" :key="index">
|
<view class="myProjectItem" v-for="(item,index) in myProjectList" :key="index">
|
||||||
<view style="display: flex;justify-content: space-between">
|
<view style="display: flex;justify-content: space-between">
|
||||||
<text>{{ item?.name }}</text>
|
<text>{{ item?.name }}</text>
|
||||||
|
@ -19,6 +20,13 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-else class="myProject" >
|
||||||
|
<nut-empty image="empty" description="暂无项目">
|
||||||
|
<div style="margin-top: 10px">
|
||||||
|
</div>
|
||||||
|
</nut-empty>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
@ -28,12 +36,16 @@ import Taro from "@tarojs/taro";
|
||||||
import './myproject.scss'
|
import './myproject.scss'
|
||||||
|
|
||||||
const myProjectList = ref<MyProjectList[]>()
|
const myProjectList = ref<MyProjectList[]>()
|
||||||
|
|
||||||
|
const number = ref(0)
|
||||||
const getMyServiceProject = async () => {
|
const getMyServiceProject = async () => {
|
||||||
const resp = await api.get<MyProjectList[]>(`/projectManageIndex/getMyServiceProject`)
|
const resp = await api.get<MyProjectList[]>(`/projectManageIndex/getMyServiceProject`)
|
||||||
myProjectList.value = resp.data
|
myProjectList.value = resp.data
|
||||||
|
number.value = resp.data.length
|
||||||
}
|
}
|
||||||
|
|
||||||
const projectClick = (items: ServiceProjectList, name: string) => {
|
const projectClick = (items: ServiceProjectList, name: string) => {
|
||||||
|
console.log(items)
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: `/subPages/pages/projectDetails/projectDetails?name=${name}&item=${JSON.stringify(items)}`,
|
url: `/subPages/pages/projectDetails/projectDetails?name=${name}&item=${JSON.stringify(items)}`,
|
||||||
})
|
})
|
||||||
|
|
|
@ -5,8 +5,7 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
.projectDetailsItem{
|
.projectDetailsItem{
|
||||||
height: 18%;
|
margin: 10px 20px 10px 20px;
|
||||||
margin: 20px;
|
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
|
@ -14,6 +13,10 @@
|
||||||
line-height: 65px;
|
line-height: 65px;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
.projectDetailsIndex{
|
.projectDetailsIndex{
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
line-height: 44rpx;
|
||||||
|
margin-bottom: 20px;
|
||||||
.content{
|
.content{
|
||||||
color: #9b9b9f;
|
color: #9b9b9f;
|
||||||
}
|
}
|
||||||
|
@ -35,7 +38,16 @@
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
margin-bottom: 15px
|
margin-bottom: 15px;
|
||||||
|
.projectDetailsTableIndex{
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
text-align: center;
|
||||||
|
view{
|
||||||
|
width: 70px;
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,6 +60,12 @@
|
||||||
right: 0;
|
right: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
.nutPopup{
|
||||||
|
width: 300px;
|
||||||
|
height: 100px;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,26 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="projectDetails">
|
<view class="projectDetails">
|
||||||
<view class="projectDetailsItem">
|
<view class="projectDetailsItem" style="line-height: 50rpx">
|
||||||
|
<view>
|
||||||
<view style="display: flex;justify-content: space-between">
|
<view style="display: flex;justify-content: space-between">
|
||||||
<text style="font-size: 18px">{{ nameValue ? nameValue : '' }}{{ '-----' + detailsList?.name }}项目</text>
|
<text style="font-size: 18px">{{ nameValue ? nameValue : '' }}{{ '-----' + detailsList?.name }}项目</text>
|
||||||
<!-- <text>进行中</text>-->
|
<!-- <text>进行中</text>-->
|
||||||
</view>
|
</view>
|
||||||
|
<view>
|
||||||
|
<view style="float: left;width: 50%;" class="content">
|
||||||
|
经理名称:{{ detailsList?.projectManagerMiniProgramUserInfo.name }}
|
||||||
|
</view>
|
||||||
|
<view class="content">手机号:{{ detailsList?.projectManagerMiniProgramUserInfo.telephone }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="projectDetailsItem">
|
||||||
<view class="projectDetailsIndex">
|
<view class="projectDetailsIndex">
|
||||||
|
<nut-row>
|
||||||
|
<nut-col :span="24">
|
||||||
|
<view class="content">保安证件号:{{ detailsList?.idNumber }}</view>
|
||||||
|
</nut-col>
|
||||||
|
</nut-row>
|
||||||
<nut-row>
|
<nut-row>
|
||||||
<nut-col :span="12">
|
<nut-col :span="12">
|
||||||
<view class="content">工作人员数量:{{ detailsList?.staffTotal }}</view>
|
<view class="content">工作人员数量:{{ detailsList?.staffTotal }}</view>
|
||||||
|
@ -23,10 +38,7 @@
|
||||||
</nut-col>
|
</nut-col>
|
||||||
</nut-row>
|
</nut-row>
|
||||||
<nut-row>
|
<nut-row>
|
||||||
<nut-col :span="16">
|
<nut-col :span="4">
|
||||||
<view class="content">证件号:{{ detailsList?.idNumber }}</view>
|
|
||||||
</nut-col>
|
|
||||||
<nut-col :span="8">
|
|
||||||
<view class="content">户数:{{ detailsList?.houseTotal }}</view>
|
<view class="content">户数:{{ detailsList?.houseTotal }}</view>
|
||||||
</nut-col>
|
</nut-col>
|
||||||
</nut-row>
|
</nut-row>
|
||||||
|
|
|
@ -66,6 +66,27 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
.qrcodeVisibleUrl{
|
||||||
|
margin-bottom: 5px;
|
||||||
|
image {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.warp{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100vh;
|
||||||
|
.warpItem{
|
||||||
|
width: 90%;
|
||||||
|
height: 50%;
|
||||||
|
text-align: center;
|
||||||
|
.rect{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -85,9 +85,8 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="projectDetailsButton">
|
<view class="projectDetailsButton">
|
||||||
<nut-button style="width: 45%" type="info" @click="formAdd">项目人员录入</nut-button>
|
<nut-button style="width: 45%" type="info" @click="formAdd">项目人员录入</nut-button>
|
||||||
<nut-button style="width: 45%" type="info">二维码录入</nut-button>
|
<nut-button style="width: 45%" type="info" @click="generateMiniProgramQRCode">二维码录入</nut-button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view>
|
<view>
|
||||||
<nut-dialog
|
<nut-dialog
|
||||||
content="是否确认删除该用户?"
|
content="是否确认删除该用户?"
|
||||||
|
@ -107,10 +106,31 @@
|
||||||
</slot>
|
</slot>
|
||||||
</nut-dialog>
|
</nut-dialog>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 二维码-->
|
||||||
|
<view>
|
||||||
|
<nut-dialog no-cancel-btn content="二维码" v-model:visible="qrcodeVisible">
|
||||||
|
<slot>
|
||||||
|
<view class="qrcodeVisibleUrl" @click="showImage">
|
||||||
|
<image style="width: 100%" show-menu-by-longpress='1' :lazy-load="true" :src="qrCodeImage" mode="aspectFit" />
|
||||||
|
</view>
|
||||||
|
</slot>
|
||||||
|
</nut-dialog>
|
||||||
|
</view>
|
||||||
|
<nut-overlay v-model:visible="showOverlay">
|
||||||
|
<view class="warp">
|
||||||
|
<view class="warpItem">
|
||||||
|
<movable-area :scale-area="true">
|
||||||
|
<movable-view direction="all" style="width: 348px; height: 300px;" :scale="true" :scale-min="1" :scale-max="4" :scale-value="1" :x="2" :y="10">
|
||||||
|
<image class="rect" show-menu-by-longpress='1' :src="qrCodeImage" mode="widthFix" />
|
||||||
|
</movable-view>
|
||||||
|
</movable-area>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</nut-overlay>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Taro, {useLoad, useDidShow} from "@tarojs/taro";
|
import Taro, {useDidShow, useLoad} from "@tarojs/taro";
|
||||||
import './projectDetails.scss'
|
import './projectDetails.scss'
|
||||||
import {ref} from "vue";
|
import {ref} from "vue";
|
||||||
import api from "@/request/index";
|
import api from "@/request/index";
|
||||||
|
@ -119,12 +139,13 @@ import * as dayjs from 'dayjs'
|
||||||
const serviceProjectDetails = ref()
|
const serviceProjectDetails = ref()
|
||||||
const nameValue = ref('')
|
const nameValue = ref('')
|
||||||
const projectData = ref<Records[]>([])
|
const projectData = ref<Records[]>([])
|
||||||
|
|
||||||
|
|
||||||
const content = ref<Records>({} as any)
|
const content = ref<Records>({} as any)
|
||||||
// 控制模态框的显示状态
|
// 控制模态框的显示状态
|
||||||
const confirmVisible = ref(false);
|
const confirmVisible = ref(false);
|
||||||
const detailVisible = ref(false)
|
const detailVisible = ref(false)
|
||||||
|
const qrcodeVisible = ref(false)
|
||||||
|
const showOverlay = ref(false)
|
||||||
|
|
||||||
useLoad(async (options: MyProjectList) => {
|
useLoad(async (options: MyProjectList) => {
|
||||||
nameValue.value = options.name
|
nameValue.value = options.name
|
||||||
serviceProjectDetails.value = await JSON.parse(options.item)
|
serviceProjectDetails.value = await JSON.parse(options.item)
|
||||||
|
@ -154,6 +175,7 @@ const projectDetailsTable = async () => {
|
||||||
const formAdd = () => {
|
const formAdd = () => {
|
||||||
const params = {
|
const params = {
|
||||||
serviceProjectId: serviceProjectDetails.value.snowFlakeId,
|
serviceProjectId: serviceProjectDetails.value.snowFlakeId,
|
||||||
|
securityUnitId:serviceProjectDetails.value.securityUnitId,
|
||||||
snowFlakeId: undefined,
|
snowFlakeId: undefined,
|
||||||
name: '',
|
name: '',
|
||||||
workPost: '',
|
workPost: '',
|
||||||
|
@ -163,9 +185,10 @@ const formAdd = () => {
|
||||||
dateOfBirth: null,
|
dateOfBirth: null,
|
||||||
securityNumber: '',
|
securityNumber: '',
|
||||||
remark: '',
|
remark: '',
|
||||||
homeAddress: ''
|
homeAddress: '',
|
||||||
|
telephone:''
|
||||||
}
|
}
|
||||||
Taro.navigateTo({url: `/subPages/pages/form/form?item=${JSON.stringify(params)}`})
|
Taro.navigateTo({url: `/subPages/pages/form/form?item=${JSON.stringify(params)}&&id=${1}`})
|
||||||
}
|
}
|
||||||
const total = ref<any>(null)
|
const total = ref<any>(null)
|
||||||
const current = ref(1)
|
const current = ref(1)
|
||||||
|
@ -209,7 +232,6 @@ const dialogOk = async () => {
|
||||||
})
|
})
|
||||||
initServiceProjectSecurityUserList()
|
initServiceProjectSecurityUserList()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 详情
|
// 详情
|
||||||
const detail = (item) => {
|
const detail = (item) => {
|
||||||
detailVisible.value = true
|
detailVisible.value = true
|
||||||
|
@ -220,6 +242,36 @@ const projectEdit = (item) => {
|
||||||
Taro.navigateTo({url: `/subPages/pages/form/form?item=${JSON.stringify(params)}`})
|
Taro.navigateTo({url: `/subPages/pages/form/form?item=${JSON.stringify(params)}`})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const qrCodeImage = ref('')
|
||||||
|
const generateMiniProgramQRCode = ()=>{
|
||||||
|
const params = {
|
||||||
|
securityUnitId:serviceProjectDetails.value.securityUnitId,
|
||||||
|
serviceProjectId:serviceProjectDetails.value.snowFlakeId
|
||||||
|
}
|
||||||
|
const value = JSON.stringify(params)
|
||||||
|
const paramsData = {
|
||||||
|
path:`/subPages/pages/form/form?item=${value}&id=${2}`,
|
||||||
|
width:200,
|
||||||
|
}
|
||||||
|
qrcodeVisible.value = true
|
||||||
|
Taro.request({
|
||||||
|
url: 'http://172.10.10.93:8765/projectManageIndex/shareForm_QR_Code',
|
||||||
|
method:'GET',
|
||||||
|
data:paramsData,
|
||||||
|
responseType: 'arraybuffer',
|
||||||
|
success(res) {
|
||||||
|
const base64 = Taro.arrayBufferToBase64(res.data);
|
||||||
|
qrCodeImage.value = 'data:image/jpeg;base64,' + base64
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const showImage = ()=>{
|
||||||
|
showOverlay.value = true
|
||||||
|
qrcodeVisible.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
||||||
|
|
|
@ -60,3 +60,19 @@ interface TreeNode<T> {
|
||||||
extData?: Record<string, any>,
|
extData?: Record<string, any>,
|
||||||
children?: TreeNode<T>[]
|
children?: TreeNode<T>[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
interface TokenInfo<T = Record<string, any>> {
|
||||||
|
name: string;
|
||||||
|
value: string;
|
||||||
|
extData?: T
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基本枚举类型
|
||||||
|
*/
|
||||||
|
interface BaseEnum<T, E = Record<string, any>> {
|
||||||
|
value: T;
|
||||||
|
label: string;
|
||||||
|
extData: E;
|
||||||
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
interface formDate {
|
interface formDate {
|
||||||
snowFlakeId?: string;
|
snowFlakeId?: string;
|
||||||
|
securityUnitId:string;
|
||||||
serviceProjectId: string;
|
serviceProjectId: string;
|
||||||
name?: string;
|
name?: string;
|
||||||
workPost?: string;
|
workPost?: string;
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
remark?: string;
|
remark?: string;
|
||||||
serviceProjectList: ServiceProjectList[];
|
serviceProjectList: ServiceProjectList[];
|
||||||
snowFlakeId?: string;
|
snowFlakeId?: string;
|
||||||
|
securityUnitId:string;
|
||||||
street?: string;
|
street?: string;
|
||||||
streetName?:string;
|
streetName?:string;
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,7 +113,8 @@ const columns: TableProps['columns'] = [
|
||||||
dataIndex: 'enterprisesUnitName',
|
dataIndex: 'enterprisesUnitName',
|
||||||
title: '企事业单位名称',
|
title: '企事业单位名称',
|
||||||
width: 150,
|
width: 150,
|
||||||
ellipsis: true
|
ellipsis: true,
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
dataIndex:'type',
|
dataIndex:'type',
|
||||||
|
@ -192,7 +193,7 @@ const columns: TableProps['columns'] = [
|
||||||
<a-button type="primary" danger>删除</a-button>
|
<a-button type="primary" danger>删除</a-button>
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
<a-button type="primary" onClick={ async ()=>{
|
<a-button type="primary" onClick={ async ()=>{
|
||||||
console.log(record)
|
// console.log(record)
|
||||||
visible.value = true
|
visible.value = true
|
||||||
serviceTitle.value = '编辑服务项目'
|
serviceTitle.value = '编辑服务项目'
|
||||||
if(record.isRecruitSecurity === null ){
|
if(record.isRecruitSecurity === null ){
|
||||||
|
@ -207,7 +208,7 @@ const columns: TableProps['columns'] = [
|
||||||
idNumberDisabled.value = true
|
idNumberDisabled.value = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
formParams.value.projectManagerMiniProgramUserId = record.projectManagerMiniProgramUserName
|
formParams.value.projectManagerMiniProgramUserId = record.projectManagerMiniProgramUserId
|
||||||
formParams.value.snowFlakeId = record.snowFlakeId
|
formParams.value.snowFlakeId = record.snowFlakeId
|
||||||
formParams.value.name = record.name
|
formParams.value.name = record.name
|
||||||
formParams.value.type = record.type.value
|
formParams.value.type = record.type.value
|
||||||
|
@ -218,9 +219,7 @@ const columns: TableProps['columns'] = [
|
||||||
formParams.value.houseTotal = record.houseTotal
|
formParams.value.houseTotal = record.houseTotal
|
||||||
formParams.value.staffTotal = record.staffTotal
|
formParams.value.staffTotal = record.staffTotal
|
||||||
formParams.value. securityUserTotal = record.securityUserTotal
|
formParams.value. securityUserTotal = record.securityUserTotal
|
||||||
|
|
||||||
formParams.value.enterprisesUnitId = record.enterprisesUnitName
|
formParams.value.enterprisesUnitId = record.enterprisesUnitName
|
||||||
enterprisesUnitId.value = record.enterprisesUnitId
|
|
||||||
formParams.value.administrativeDivisionCodes = record.enterprisesUnitAdministrativeDivisionCodes
|
formParams.value.administrativeDivisionCodes = record.enterprisesUnitAdministrativeDivisionCodes
|
||||||
}}>编辑</a-button>
|
}}>编辑</a-button>
|
||||||
</a-space>
|
</a-space>
|
||||||
|
@ -278,7 +277,11 @@ const formItemOptions = ref<FormProMaxItemOptions<serviceProjectSaveOrUpdatePara
|
||||||
label:'企事业单位',
|
label:'企事业单位',
|
||||||
options:enterprisesUnitIdList,
|
options:enterprisesUnitIdList,
|
||||||
componentsProps:{
|
componentsProps:{
|
||||||
allowClear:true
|
allowClear:true,
|
||||||
|
onChange:async (value:string)=>{
|
||||||
|
console.log(value)
|
||||||
|
enterprisesUnitId.value = value
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
type: {
|
type: {
|
||||||
|
@ -368,10 +371,10 @@ const formItemOptions = ref<FormProMaxItemOptions<serviceProjectSaveOrUpdatePara
|
||||||
label: '备注',
|
label: '备注',
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
const UnitId = ref('')
|
||||||
const submit = async()=>{
|
const submit = async()=>{
|
||||||
await formRef.value.validate()
|
await formRef.value.validate()
|
||||||
const snowFlakeId = ref('')
|
const snowFlakeId = ref('')
|
||||||
const UnitId = ref('')
|
|
||||||
if (serviceTitle.value === '新增服务项目') {
|
if (serviceTitle.value === '新增服务项目') {
|
||||||
snowFlakeId.value = ''
|
snowFlakeId.value = ''
|
||||||
UnitId.value = formParams.value.enterprisesUnitId
|
UnitId.value = formParams.value.enterprisesUnitId
|
||||||
|
|
Loading…
Reference in New Issue