| | |
| | | "@jridgewell/sourcemap-codec": "^1.5.0", |
| | | "@qiun/wx-ucharts": "2.5.0-20230101", |
| | | "@uview-plus/types": "^3.2.5", |
| | | "@vueup/vue-quill": "^1.2.0", |
| | | "axios": "^1.13.2", |
| | | "axios-adapter-uniapp": "^0.1.4", |
| | | "clipboard": "^2.0.11", |
| | | "dayjs": "^1.11.13", |
| | | "file-saver": "^2.0.5", |
| | | "mqtt": "4.1.0", |
| | | "pinia": "2.2.2", |
| | | "tslib": "^2.7.0", |
| | | "uview-plus": "^3.4.62", |
| | | "vue": "3.4.21", |
| | | "vue-i18n": "^9.14.2", |
| | | "@vueup/vue-quill": "^1.2.0" |
| | | "vue-i18n": "^9.14.2" |
| | | }, |
| | | "devDependencies": { |
| | | "@dcloudio/types": "^3.4.14", |
| | |
| | | "vite": "5.4.10", |
| | | "vue-tsc": "2.1.6" |
| | | } |
| | | } |
| | | } |
| | |
| | | data: data |
| | | }) |
| | | } |
| | | // å®¢æ·æè®¿ç¾å° |
| | | export function clientVisitUpdate(data) { |
| | | return request({ |
| | | url: '/customerVisits/update', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // è·åæè®¿è®°å½å表 |
| | | export function getVisitRecords(query) { |
| | |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // å é¤å®¢æ·æ¡£æ¡ |
| | | export function delCustomer(ids) { |
| | | return request({ |
| | | url: '/customerVisits/'+ids, |
| | | method: 'delete', |
| | | }) |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request'; |
| | | |
| | | // æ¥è¯¢è§ç« å¶åº¦å表 |
| | | export function listRuleManagement(page,query) { |
| | | return request({ |
| | | url: "/rulesRegulationsManagement/getList", |
| | | method: "get", |
| | | params: { |
| | | ...page, |
| | | ...query}, |
| | | }); |
| | | } |
| | | // æ¥è¯¢é
è¯»ç¶æå表 |
| | | export function getReadingStatusList(page,query) { |
| | | return request({ |
| | | url: "/rulesRegulationsManagement/getReadingStatusList", |
| | | method: "get", |
| | | params: { |
| | | ...page, |
| | | ...query}, |
| | | }); |
| | | } |
| | | |
| | | // æ ¹æ®è§åidæ¥è¯¢é
è¯»ç¶æå表 |
| | | export function getReadingStatusByRuleId(id) { |
| | | return request({ |
| | | url: "/rulesRegulationsManagement/getReadingStatusByRuleId/"+id, |
| | | method: "get" |
| | | }); |
| | | } |
| | | // ä¿®æ¹è§ç« å¶åº¦ |
| | | export function updateRuleManagement(data) { |
| | | return request({ |
| | | url: "/rulesRegulationsManagement/update", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | // æ°å¢è§ç« å¶åº¦ |
| | | export function addRuleManagement(data) { |
| | | return request({ |
| | | url: "/rulesRegulationsManagement/add", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // éä»¶å表 |
| | | export function listRuleFiles(query) { |
| | | return request({ |
| | | url: "/rulesRegulationsManagementFile/listPage", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æ°å¢éä»¶ |
| | | export function addRuleFile(data) { |
| | | return request({ |
| | | url: "/rulesRegulationsManagementFile/add", |
| | | method: "post", |
| | | data, |
| | | }); |
| | | } |
| | | |
| | | // å é¤éä»¶ï¼æ¯æä¼ é id æ°ç»ï¼ |
| | | export function delRuleFile(ids) { |
| | | return request({ |
| | | url: "/rulesRegulationsManagementFile/del", |
| | | method: "delete", |
| | | data: ids, |
| | | }); |
| | | } |
| | | // ä¸ä¼ éä»¶ |
| | | export function upload(query) { |
| | | return request({ |
| | | url: "/file/upload", |
| | | method: "post", |
| | | data: query, |
| | | responseType: "blob", |
| | | }); |
| | | } |
| | |
| | | <template> |
| | | <view class="editor-container"> |
| | | <div class="editor"> |
| | | <QuillEditor v-model:content="content" |
| | | <!-- <QuillEditor v-model:content="content" |
| | | contentType="html" |
| | | @textChange="(e) => emit('update:modelValue', content)" |
| | | :options="options" |
| | | :style="styles" /> |
| | | :style="styles" /> --> |
| | | </div> |
| | | </view> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, computed, watch } from "vue"; |
| | | import { QuillEditor } from "@vueup/vue-quill"; |
| | | // import { QuillEditor } from "@vueup/vue-quill"; |
| | | import "@vueup/vue-quill/dist/vue-quill.snow.css"; |
| | | import { getToken } from "@/utils/auth"; |
| | | |
| | |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/managementMeetings/rulesRegulationsManagement/index", |
| | | "style": { |
| | | "navigationBarTitleText": "è§ç« å¶åº¦ç®¡ç", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/managementMeetings/rulesRegulationsManagement/detail", |
| | | "style": { |
| | | "navigationBarTitleText": "è§ç« å¶åº¦è¯¦æ
", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/managementMeetings/rulesRegulationsManagement/fileList", |
| | | "style": { |
| | | "navigationBarTitleText": "è§ç« å¶åº¦æä»¶ç®¡ç", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/managementMeetings/knowledgeBase/detail", |
| | | "style": { |
| | | "navigationBarTitleText": "ç¥è¯åºè¯¦æ
", |
| | |
| | | <template> |
| | | <view class="client-visit-detail"> |
| | | <PageHeader title="å®¢æ·æè®¿è¯¦æ
" @back="goBack" /> |
| | | |
| | | <u-form @submit="handleSignIn" ref="formRef" label-width="90"> |
| | | <PageHeader title="å®¢æ·æè®¿è¯¦æ
" |
| | | @back="goBack" /> |
| | | <u-form @submit="handleSignIn" |
| | | ref="formRef" |
| | | label-width="90"> |
| | | <!-- 客æ·ä¿¡æ¯ --> |
| | | <u-cell-group title="客æ·ä¿¡æ¯"> |
| | | <u-form-item label="客æ·åç§°" prop="customerName" required border-bottom> |
| | | <u-input |
| | | v-model="form.customerName" |
| | | placeholder="请è¾å
¥å®¢æ·åç§°" |
| | | /> |
| | | <u-form-item label="客æ·åç§°" |
| | | prop="customerName" |
| | | required |
| | | border-bottom> |
| | | <u-input v-model="form.customerName" |
| | | placeholder="请è¾å
¥å®¢æ·åç§°" /> |
| | | </u-form-item> |
| | | <u-form-item label="è系人" prop="contact" border-bottom> |
| | | <u-input |
| | | v-model="form.contact" |
| | | placeholder="请è¾å
¥è系人" |
| | | /> |
| | | <u-form-item label="è系人" |
| | | prop="contact" |
| | | border-bottom> |
| | | <u-input v-model="form.contact" |
| | | placeholder="请è¾å
¥è系人" /> |
| | | </u-form-item> |
| | | <u-form-item label="èç³»çµè¯" prop="contactPhone" border-bottom> |
| | | <u-input |
| | | v-model="form.contactPhone" |
| | | placeholder="请è¾å
¥èç³»çµè¯" |
| | | /> |
| | | <u-form-item label="èç³»çµè¯" |
| | | prop="contactPhone" |
| | | border-bottom> |
| | | <u-input v-model="form.contactPhone" |
| | | placeholder="请è¾å
¥èç³»çµè¯" /> |
| | | </u-form-item> |
| | | </u-cell-group> |
| | | |
| | | <!-- æè®¿ä¿¡æ¯ --> |
| | | <u-cell-group title="æè®¿ä¿¡æ¯"> |
| | | <u-form-item label="æè®¿ç®ç" prop="purposeVisit" required border-bottom> |
| | | <u-input |
| | | v-model="form.purposeVisit" |
| | | placeholder="请è¾å
¥æè®¿ç®ç" |
| | | /> |
| | | <u-form-item label="æè®¿ç®ç" |
| | | prop="purposeVisit" |
| | | required |
| | | border-bottom> |
| | | <u-input v-model="form.purposeVisit" |
| | | placeholder="请è¾å
¥æè®¿ç®ç" /> |
| | | </u-form-item> |
| | | <u-form-item label="æè®¿æ¶é´" prop="purposeDate" required border-bottom> |
| | | <u-input |
| | | v-model="form.purposeDate" |
| | | placeholder="è¯·éæ©æè®¿æ¶é´" |
| | | @click="showTimePicker" |
| | | /> |
| | | <u-form-item label="æè®¿æ¶é´" |
| | | prop="purposeDate" |
| | | required |
| | | border-bottom> |
| | | <u-input v-model="form.purposeDate" |
| | | placeholder="è¯·éæ©æè®¿æ¶é´" |
| | | @click="showTimePicker" /> |
| | | <template #right> |
| | | <up-icon |
| | | name="arrow-right" |
| | | @click="showTimePicker" |
| | | ></up-icon> |
| | | </template> |
| | | <up-icon name="arrow-right" |
| | | @click="showTimePicker"></up-icon> |
| | | </template> |
| | | </u-form-item> |
| | | <u-form-item label="æè®¿å°ç¹" prop="visitAddress" required border-bottom> |
| | | <u-input |
| | | v-model="form.visitAddress" |
| | | placeholder="请è¾å
¥æè®¿å°ç¹" |
| | | > |
| | | <u-form-item label="æè®¿å°ç¹" |
| | | prop="visitAddress" |
| | | required |
| | | border-bottom> |
| | | <u-input v-model="form.visitAddress" |
| | | placeholder="请è¾å
¥æè®¿å°ç¹"> |
| | | <template #suffix> |
| | | <u-icon name="map" @click="getCurrentLocation" class="location-icon" /> |
| | | <u-icon name="map" |
| | | @click="getCurrentLocation" |
| | | class="location-icon" /> |
| | | </template> |
| | | </u-input> |
| | | </u-form-item> |
| | | </u-cell-group> |
| | | |
| | | <!-- 夿³¨ä¿¡æ¯ --> |
| | | <u-cell-group title="夿³¨ä¿¡æ¯"> |
| | | <u-form-item label="夿³¨" prop="remark" border-bottom> |
| | | <u-textarea |
| | | v-model="form.remark" |
| | | placeholder="请è¾å
¥å¤æ³¨ä¿¡æ¯" |
| | | :maxlength="200" |
| | | count |
| | | :autoHeight="true" |
| | | /> |
| | | <u-form-item label="夿³¨" |
| | | prop="remark" |
| | | border-bottom> |
| | | <u-textarea v-model="form.remark" |
| | | placeholder="请è¾å
¥å¤æ³¨ä¿¡æ¯" |
| | | :maxlength="200" |
| | | count |
| | | :autoHeight="true" /> |
| | | </u-form-item> |
| | | </u-cell-group> |
| | | |
| | | <!-- æäº¤æé® --> |
| | | <view class="footer-btns"> |
| | | <u-button class="cancel-btn" @click="goBack">åæ¶</u-button> |
| | | <u-button class="sign-btn" type="primary" @click="handleSignIn" :loading="loading">ç¾å°</u-button> |
| | | <u-button class="cancel-btn" |
| | | @click="goBack">åæ¶</u-button> |
| | | <u-button class="sign-btn" |
| | | type="primary" |
| | | @click="handleSignIn" |
| | | :loading="loading">ç¾å°</u-button> |
| | | </view> |
| | | </u-form> |
| | | |
| | | <!-- æ¶é´éæ©å¨ --> |
| | | <up-datetime-picker |
| | | :show="showTime" |
| | | v-model="currentTime" |
| | | @confirm="onTimeConfirm" |
| | | @cancel="showTime = false" |
| | | mode="datetime" |
| | | /> |
| | | <up-datetime-picker :show="showTime" |
| | | v-model="currentTime" |
| | | @confirm="onTimeConfirm" |
| | | @cancel="showTime = false" |
| | | mode="datetime" /> |
| | | </view> |
| | | </template> |
| | | |
| | | <script setup> |
| | | // æ¿æ¢ toast æ¹æ³ |
| | | defineOptions({name: 'client-visit-detail'}) |
| | | const showToast = (message) => { |
| | | uni.showToast({ |
| | | title: message, |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | // æ¿æ¢ toast æ¹æ³ |
| | | defineOptions({ name: "client-visit-detail" }); |
| | | const showToast = message => { |
| | | uni.showToast({ |
| | | title: message, |
| | | icon: "none", |
| | | }); |
| | | }; |
| | | |
| | | import { ref, onMounted } from 'vue' |
| | | import PageHeader from '@/components/PageHeader.vue' |
| | | import { clientVisitSignIn } from '@/api/cooperativeOffice/clientVisit' |
| | | import useUserStore from "@/store/modules/user" |
| | | import dayjs from "dayjs" |
| | | import { ref, onMounted } from "vue"; |
| | | import PageHeader from "@/components/PageHeader.vue"; |
| | | import { |
| | | clientVisitSignIn, |
| | | clientVisitUpdate, |
| | | } from "@/api/cooperativeOffice/clientVisit"; |
| | | import useUserStore from "@/store/modules/user"; |
| | | import dayjs from "dayjs"; |
| | | import { onLoad } from "@dcloudio/uni-app"; |
| | | |
| | | const userStore = useUserStore() |
| | | const userStore = useUserStore(); |
| | | |
| | | // è¡¨åæ°æ® |
| | | const form = ref({ |
| | | customerName: '', |
| | | contact: '', |
| | | contactPhone: '', |
| | | visitingPeople: '', |
| | | purposeVisit: '', |
| | | purposeDate: '', |
| | | visitAddress: '', |
| | | latitude: '', |
| | | longitude: '', |
| | | locationAddress: '', |
| | | remark: '' |
| | | }) |
| | | // è¡¨åæ°æ® |
| | | const form = ref({ |
| | | customerName: "", |
| | | contact: "", |
| | | contactPhone: "", |
| | | visitingPeople: "", |
| | | purposeVisit: "", |
| | | purposeDate: "", |
| | | visitAddress: "", |
| | | latitude: "", |
| | | longitude: "", |
| | | locationAddress: "", |
| | | remark: "", |
| | | }); |
| | | |
| | | // 页é¢ç¶æ |
| | | const loading = ref(false) |
| | | const formRef = ref(null) |
| | | // 页é¢ç¶æ |
| | | const loading = ref(false); |
| | | const formRef = ref(null); |
| | | |
| | | // æ¶é´ç¸å
³ |
| | | const currentTime = ref(Date.now()) |
| | | const showTime = ref(false) |
| | | // æ¶é´ç¸å
³ |
| | | const currentTime = ref(Date.now()); |
| | | const showTime = ref(false); |
| | | |
| | | // è¿åä¸ä¸é¡µ |
| | | const goBack = () => { |
| | | // è¿åæ¶æ¸
餿¬å°åå¨çID |
| | | uni.removeStorageSync('clientVisit') |
| | | uni.navigateBack() |
| | | } |
| | | // è¿åä¸ä¸é¡µ |
| | | const goBack = () => { |
| | | // è¿åæ¶æ¸
餿¬å°åå¨çID |
| | | uni.removeStorageSync("clientVisit"); |
| | | uni.navigateBack(); |
| | | }; |
| | | |
| | | // æ¾ç¤ºæ¶é´éæ©å¨ |
| | | const showTimePicker = () => { |
| | | showTime.value = true |
| | | } |
| | | // æ¾ç¤ºæ¶é´éæ©å¨ |
| | | const showTimePicker = () => { |
| | | showTime.value = true; |
| | | }; |
| | | |
| | | // 确认æ¶é´éæ© |
| | | const onTimeConfirm = (e) => { |
| | | console.log(e) |
| | | form.value.purposeDate = dayjs(e.value).format('YYYY-MM-DD HH:mm:ss') |
| | | currentTime.value = e.value |
| | | showTime.value = false; |
| | | } |
| | | // 确认æ¶é´éæ© |
| | | const onTimeConfirm = e => { |
| | | console.log(e); |
| | | form.value.purposeDate = dayjs(e.value).format("YYYY-MM-DD HH:mm:ss"); |
| | | currentTime.value = e.value; |
| | | showTime.value = false; |
| | | }; |
| | | |
| | | // è·åå½åä½ç½® |
| | | const getCurrentLocation = () => { |
| | | uni.showLoading({ title: 'è·åä½ç½®ä¸...' }) |
| | | |
| | | uni.getLocation({ |
| | | type: 'gcj02', |
| | | success: (res) => { |
| | | form.value.latitude = res.latitude |
| | | form.value.longitude = res.longitude |
| | | |
| | | // 使ç¨éå°çç¼ç è·åå°åä¿¡æ¯ |
| | | uni.request({ |
| | | url: `https://restapi.amap.com/v3/geocode/regeo?key=c120a5dc69a9f61839f7763e6057005f&location=${res.longitude},${res.latitude}&radius=1000&extensions=all`, |
| | | success: (geoRes) => { |
| | | uni.hideLoading() |
| | | if (geoRes.data.status === '1' && geoRes.data.regeocode) { |
| | | const regeocode = geoRes.data.regeocode |
| | | const address = regeocode.formatted_address |
| | | |
| | | // ä¼å
æ¾ç¤ºè¯¦ç»å°å |
| | | if (address) { |
| | | form.value.visitAddress = address |
| | | showToast('ä½ç½®è·åæå') |
| | | // è·åå½åä½ç½® |
| | | const getCurrentLocation = () => { |
| | | uni.showLoading({ title: "è·åä½ç½®ä¸..." }); |
| | | |
| | | uni.getLocation({ |
| | | type: "gcj02", |
| | | success: res => { |
| | | form.value.latitude = res.latitude; |
| | | form.value.longitude = res.longitude; |
| | | |
| | | // 使ç¨éå°çç¼ç è·åå°åä¿¡æ¯ |
| | | uni.request({ |
| | | url: `https://restapi.amap.com/v3/geocode/regeo?key=c120a5dc69a9f61839f7763e6057005f&location=${res.longitude},${res.latitude}&radius=1000&extensions=all`, |
| | | success: geoRes => { |
| | | uni.hideLoading(); |
| | | if (geoRes.data.status === "1" && geoRes.data.regeocode) { |
| | | const regeocode = geoRes.data.regeocode; |
| | | const address = regeocode.formatted_address; |
| | | |
| | | // ä¼å
æ¾ç¤ºè¯¦ç»å°å |
| | | if (address) { |
| | | form.value.visitAddress = address; |
| | | showToast("ä½ç½®è·åæå"); |
| | | } else { |
| | | // å¦ææ²¡æè¯¦ç»å°åï¼å°è¯ç»åå°åä¿¡æ¯ |
| | | const addressComponent = regeocode.addressComponent; |
| | | const combinedAddress = `${addressComponent.province}${addressComponent.city}${addressComponent.district}${addressComponent.township}`; |
| | | form.value.visitAddress = combinedAddress; |
| | | showToast("ä½ç½®è·åæå"); |
| | | } |
| | | } else { |
| | | // å¦ææ²¡æè¯¦ç»å°åï¼å°è¯ç»åå°åä¿¡æ¯ |
| | | const addressComponent = regeocode.addressComponent |
| | | const combinedAddress = `${addressComponent.province}${addressComponent.city}${addressComponent.district}${addressComponent.township}` |
| | | form.value.visitAddress = combinedAddress |
| | | showToast('ä½ç½®è·åæå') |
| | | // APIè°ç¨æå使²¡æè¿åå°åä¿¡æ¯ |
| | | const fallbackAddress = `ä½ç½®: ${res.latitude.toFixed( |
| | | 4 |
| | | )}, ${res.longitude.toFixed(4)}`; |
| | | form.value.visitAddress = fallbackAddress; |
| | | showToast("è·åå°ä½ç½®ï¼ä½å°åè§£æå¤±è´¥"); |
| | | } |
| | | } else { |
| | | // APIè°ç¨æå使²¡æè¿åå°åä¿¡æ¯ |
| | | const fallbackAddress = `ä½ç½®: ${res.latitude.toFixed(4)}, ${res.longitude.toFixed(4)}` |
| | | form.value.visitAddress = fallbackAddress |
| | | showToast('è·åå°ä½ç½®ï¼ä½å°åè§£æå¤±è´¥') |
| | | } |
| | | }, |
| | | fail: (err) => { |
| | | uni.hideLoading() |
| | | console.error('éå°çç¼ç 失败:', err) |
| | | |
| | | // éå°çç¼ç 失败æ¶ï¼æ¾ç¤ºç®åçä½ç½®ä¿¡æ¯ |
| | | const fallbackAddress = `ä½ç½®: ${res.latitude.toFixed(4)}, ${res.longitude.toFixed(4)}` |
| | | form.value.visitAddress = fallbackAddress |
| | | showToast('ä½ç½®è·åæåï¼ä½å°åè§£æå¤±è´¥') |
| | | }, |
| | | fail: err => { |
| | | uni.hideLoading(); |
| | | console.error("éå°çç¼ç 失败:", err); |
| | | |
| | | // éå°çç¼ç 失败æ¶ï¼æ¾ç¤ºç®åçä½ç½®ä¿¡æ¯ |
| | | const fallbackAddress = `ä½ç½®: ${res.latitude.toFixed( |
| | | 4 |
| | | )}, ${res.longitude.toFixed(4)}`; |
| | | form.value.visitAddress = fallbackAddress; |
| | | showToast("ä½ç½®è·åæåï¼ä½å°åè§£æå¤±è´¥"); |
| | | }, |
| | | }); |
| | | }, |
| | | fail: err => { |
| | | uni.hideLoading(); |
| | | showToast("è·åä½ç½®å¤±è´¥ï¼è¯·æ£æ¥å®ä½æé"); |
| | | console.error("è·åä½ç½®å¤±è´¥:", err); |
| | | |
| | | // å¤±è´¥æ¶æ¾ç¤ºéè¯¯ä¿¡æ¯ |
| | | form.value.visitAddress = "ä½ç½®è·å失败"; |
| | | }, |
| | | }); |
| | | }; |
| | | |
| | | // æäº¤ç¾å° |
| | | const handleSignIn = async () => { |
| | | if (!form.value.customerName) { |
| | | showToast("请è¾å
¥å®¢æ·åç§°"); |
| | | return; |
| | | } |
| | | |
| | | if (!form.value.purposeVisit) { |
| | | showToast("请è¾å
¥æè®¿ç®ç"); |
| | | return; |
| | | } |
| | | |
| | | if (!form.value.purposeDate) { |
| | | showToast("è¯·éæ©æè®¿æ¶é´"); |
| | | return; |
| | | } |
| | | if (!form.value.visitAddress) { |
| | | showToast("请è·åå½åä½ç½®"); |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | loading.value = true; |
| | | |
| | | // 使ç¨å®å
¨æµ
æ·è´ï¼é¿å
对象å±å¼å¨æäºè¿è¡æ¶æé |
| | | const source = |
| | | form.value && typeof form.value === "object" ? form.value : {}; |
| | | const submitData = {}; |
| | | Object.keys(source).forEach(k => { |
| | | submitData[k] = source[k]; |
| | | }); |
| | | console.log("submitData", submitData); |
| | | if (isEdit.value) { |
| | | const { code } = await clientVisitUpdate(submitData); |
| | | if (code === 200) { |
| | | showToast("ä¿®æ¹æå"); |
| | | setTimeout(() => { |
| | | goBack(); |
| | | }, 500); |
| | | } else { |
| | | loading.value = false; |
| | | showToast("ç¾å°å¤±è´¥ï¼è¯·éè¯"); |
| | | } |
| | | }) |
| | | }, |
| | | fail: (err) => { |
| | | uni.hideLoading() |
| | | showToast('è·åä½ç½®å¤±è´¥ï¼è¯·æ£æ¥å®ä½æé') |
| | | console.error('è·åä½ç½®å¤±è´¥:', err) |
| | | |
| | | // å¤±è´¥æ¶æ¾ç¤ºéè¯¯ä¿¡æ¯ |
| | | form.value.visitAddress = 'ä½ç½®è·å失败' |
| | | } else { |
| | | const { code } = await clientVisitSignUp(submitData); |
| | | if (code === 200) { |
| | | showToast("ç¾å°æå"); |
| | | setTimeout(() => { |
| | | goBack(); |
| | | }, 500); |
| | | } else { |
| | | loading.value = false; |
| | | showToast("ç¾å°å¤±è´¥ï¼è¯·éè¯"); |
| | | } |
| | | } |
| | | } catch (e) { |
| | | loading.value = false; |
| | | console.error("ç¾å°å¤±è´¥:", e); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // æäº¤ç¾å° |
| | | const handleSignIn = async () => { |
| | | if (!form.value.customerName) { |
| | | showToast('请è¾å
¥å®¢æ·åç§°') |
| | | return |
| | | } |
| | | |
| | | if (!form.value.purposeVisit) { |
| | | showToast('请è¾å
¥æè®¿ç®ç') |
| | | return |
| | | } |
| | | |
| | | if (!form.value.purposeDate) { |
| | | showToast('è¯·éæ©æè®¿æ¶é´') |
| | | return |
| | | } |
| | | if (!form.value.visitAddress) { |
| | | showToast('请è·åå½åä½ç½®') |
| | | return |
| | | } |
| | | |
| | | try { |
| | | loading.value = true |
| | | |
| | | // 使ç¨å®å
¨æµ
æ·è´ï¼é¿å
对象å±å¼å¨æäºè¿è¡æ¶æé |
| | | const source = (form.value && typeof form.value === 'object') ? form.value : {} |
| | | const submitData = {} |
| | | Object.keys(source).forEach((k) => { |
| | | submitData[k] = source[k] |
| | | }) |
| | | console.log('submitData', submitData) |
| | | |
| | | const { code } = await clientVisitSignIn(submitData) |
| | | |
| | | if (code === 200) { |
| | | showToast('ç¾å°æå') |
| | | setTimeout(() => { |
| | | goBack() |
| | | }, 500) |
| | | }; |
| | | const isEdit = ref(false); |
| | | onLoad(() => { |
| | | // ç¼è¾æè®¿æ¶ï¼ä»æ¬å°åå¨è·åæè®¿è®°å½ |
| | | const visit = uni.getStorageSync("clientVisit"); |
| | | if (visit) { |
| | | form.value = visit; |
| | | isEdit.value = true; |
| | | console.log("form.value", form.value); |
| | | } else { |
| | | loading.value = false |
| | | showToast('ç¾å°å¤±è´¥ï¼è¯·éè¯') |
| | | isEdit.value = false; |
| | | } |
| | | } catch (e) { |
| | | loading.value = false |
| | | console.error('ç¾å°å¤±è´¥:', e) |
| | | } |
| | | } |
| | | }); |
| | | |
| | | // åå§å页颿°æ® |
| | | const initPageData = () => { |
| | | // 设置é»è®¤æè®¿æ¶é´ä¸ºå½åæ¶é´ |
| | | form.value.purposeDate = dayjs().format('YYYY-MM-DD HH:mm:ss') |
| | | currentTime.value = Date.now() |
| | | |
| | | // 设置æè®¿äººä¸ºå½åç»å½ç¨æ·çæµç§° |
| | | form.value.visitingPeople = userStore.nickName || '' |
| | | } |
| | | // åå§å页颿°æ® |
| | | const initPageData = () => { |
| | | // 设置é»è®¤æè®¿æ¶é´ä¸ºå½åæ¶é´ |
| | | form.value.purposeDate = dayjs().format("YYYY-MM-DD HH:mm:ss"); |
| | | currentTime.value = Date.now(); |
| | | |
| | | onMounted(() => { |
| | | initPageData() |
| | | }) |
| | | // 设置æè®¿äººä¸ºå½åç»å½ç¨æ·çæµç§° |
| | | form.value.visitingPeople = userStore.nickName || ""; |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | initPageData(); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | @import '@/static/scss/form-common.scss'; |
| | | .client-visit { |
| | | min-height: 100vh; |
| | | background: #f8f9fa; |
| | | padding-bottom: 5rem; |
| | | } |
| | | @import "@/static/scss/form-common.scss"; |
| | | .client-visit { |
| | | min-height: 100vh; |
| | | background: #f8f9fa; |
| | | padding-bottom: 5rem; |
| | | } |
| | | |
| | | .footer-btns { |
| | | position: fixed; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | background: #fff; |
| | | display: flex; |
| | | justify-content: space-around; |
| | | align-items: center; |
| | | padding: 0.75rem 0; |
| | | box-shadow: 0 -0.125rem 0.5rem rgba(0,0,0,0.05); |
| | | z-index: 1000; |
| | | } |
| | | .footer-btns { |
| | | position: fixed; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | background: #fff; |
| | | display: flex; |
| | | justify-content: space-around; |
| | | align-items: center; |
| | | padding: 0.75rem 0; |
| | | box-shadow: 0 -0.125rem 0.5rem rgba(0, 0, 0, 0.05); |
| | | z-index: 1000; |
| | | } |
| | | |
| | | .cancel-btn { |
| | | font-weight: 400; |
| | | font-size: 1rem; |
| | | color: #666; |
| | | background: #f5f5f5; |
| | | border: 1px solid #ddd; |
| | | width: 45%; |
| | | height: 2.5rem; |
| | | border-radius: 2.5rem 2.5rem 2.5rem 2.5rem; |
| | | } |
| | | .cancel-btn { |
| | | font-weight: 400; |
| | | font-size: 1rem; |
| | | color: #666; |
| | | background: #f5f5f5; |
| | | border: 1px solid #ddd; |
| | | width: 45%; |
| | | height: 2.5rem; |
| | | border-radius: 2.5rem 2.5rem 2.5rem 2.5rem; |
| | | } |
| | | |
| | | .sign-btn { |
| | | font-weight: 500; |
| | | font-size: 1rem; |
| | | color: #fff; |
| | | background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); |
| | | border: none; |
| | | width: 45%; |
| | | height: 2.5rem; |
| | | border-radius: 2.5rem 2.5rem 2.5rem 2.5rem; |
| | | } |
| | | .sign-btn { |
| | | font-weight: 500; |
| | | font-size: 1rem; |
| | | color: #fff; |
| | | background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); |
| | | border: none; |
| | | width: 45%; |
| | | height: 2.5rem; |
| | | border-radius: 2.5rem 2.5rem 2.5rem 2.5rem; |
| | | } |
| | | |
| | | .location-icon { |
| | | color: #1989fa; |
| | | font-size: 1.2rem; |
| | | } |
| | | .location-icon { |
| | | color: #1989fa; |
| | | font-size: 1.2rem; |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <view class="sales-accoun"> |
| | | <!-- 使ç¨éç¨é¡µé¢å¤´é¨ç»ä»¶ --> |
| | | <PageHeader title="å®¢æ·æè®¿" @back="goBack" /> |
| | | |
| | | <PageHeader title="å®¢æ·æè®¿" |
| | | @back="goBack" /> |
| | | <!-- æç´¢åçéåºå --> |
| | | <view class="search-section"> |
| | | <view class="search-bar"> |
| | | <view class="search-input"> |
| | | <up-input |
| | | class="search-text" |
| | | placeholder="请è¾å
¥å®¢æ·åç§°" |
| | | v-model="customerName" |
| | | @blur="getList" |
| | | clearable |
| | | /> |
| | | <up-input class="search-text" |
| | | placeholder="请è¾å
¥å®¢æ·åç§°" |
| | | v-model="customerName" |
| | | @blur="getList" |
| | | clearable /> |
| | | </view> |
| | | <view class="filter-button" @click="getList"> |
| | | <u-icon name="search" size="24" color="#999"></u-icon> |
| | | <view class="filter-button" |
| | | @click="getList"> |
| | | <u-icon name="search" |
| | | size="24" |
| | | color="#999"></u-icon> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- æè®¿è®°å½å表 --> |
| | | <view class="ledger-list" v-if="visitList.length > 0"> |
| | | <view v-for="(item, index) in visitList" :key="index"> |
| | | <view class="ledger-list" |
| | | v-if="visitList.length > 0"> |
| | | <view v-for="(item, index) in visitList" |
| | | :key="index"> |
| | | <view class="ledger-item"> |
| | | <view class="item-header"> |
| | | <view class="item-left"> |
| | | <view class="document-icon"> |
| | | <up-icon name="file-text" size="16" color="#ffffff"></up-icon> |
| | | <up-icon name="file-text" |
| | | size="16" |
| | | color="#ffffff"></up-icon> |
| | | </view> |
| | | <text class="item-id">客æ·ï¼{{ item.customerName }}</text> |
| | | </view> |
| | | </view> |
| | | <up-divider></up-divider> |
| | | |
| | | <view class="item-details"> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">è系人</text> |
| | |
| | | <text class="detail-label">æè®¿äºº</text> |
| | | <text class="detail-value">{{ item.visitingPeople || '-' }}</text> |
| | | </view> |
| | | <view class="detail-row" v-if="item.remark"> |
| | | <view class="detail-row" |
| | | v-if="item.remark"> |
| | | <text class="detail-label">夿³¨</text> |
| | | <text class="detail-value">{{ item.remark }}</text> |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- æé®åºå --> |
| | | <view class="action-buttons"> |
| | | <u-button |
| | | type="primary" |
| | | size="small" |
| | | class="action-btn" |
| | | @click="viewDetail(item)" |
| | | > |
| | | <u-button type="info" |
| | | size="small" |
| | | class="action-btn" |
| | | @click="viewDetail(item)"> |
| | | æ¥ç详æ
|
| | | </u-button> |
| | | <u-button type="primary" |
| | | size="small" |
| | | class="action-btn" |
| | | @click="editVisit(item)"> |
| | | ç¼è¾ |
| | | </u-button> |
| | | <u-button type="error" |
| | | size="small" |
| | | class="action-btn" |
| | | @click="deleteVisit(item)"> |
| | | å é¤ |
| | | </u-button> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | <view v-else class="no-data"> |
| | | <view v-else |
| | | class="no-data"> |
| | | <text>ææ æè®¿è®°å½</text> |
| | | </view> |
| | | |
| | | <!-- æµ®å¨æ°å¢æé® --> |
| | | <view class="fab-button" @click="addVisit"> |
| | | <up-icon name="plus" size="24" color="#ffffff"></up-icon> |
| | | <view class="fab-button" |
| | | @click="addVisit"> |
| | | <up-icon name="plus" |
| | | size="24" |
| | | color="#ffffff"></up-icon> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, onMounted } from 'vue' |
| | | import { onShow } from '@dcloudio/uni-app' |
| | | import PageHeader from '@/components/PageHeader.vue' |
| | | import { getVisitRecords } from '@/api/cooperativeOffice/clientVisit' |
| | | import useUserStore from "@/store/modules/user" |
| | | // æ¿æ¢ toast æ¹æ³ |
| | | defineOptions({name: 'client-visit-index'}) |
| | | const showToast = (message) => { |
| | | uni.showToast({ |
| | | title: message, |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | import { ref, onMounted } from "vue"; |
| | | import { onShow } from "@dcloudio/uni-app"; |
| | | import PageHeader from "@/components/PageHeader.vue"; |
| | | import { |
| | | getVisitRecords, |
| | | delCustomer, |
| | | } from "@/api/cooperativeOffice/clientVisit"; |
| | | import useUserStore from "@/store/modules/user"; |
| | | // æ¿æ¢ toast æ¹æ³ |
| | | defineOptions({ name: "client-visit-index" }); |
| | | const showToast = message => { |
| | | uni.showToast({ |
| | | title: message, |
| | | icon: "none", |
| | | }); |
| | | }; |
| | | |
| | | import dayjs from "dayjs" |
| | | import dayjs from "dayjs"; |
| | | |
| | | const userStore = useUserStore() |
| | | const userStore = useUserStore(); |
| | | |
| | | // æç´¢å
³é®è¯ |
| | | const customerName = ref('') |
| | | // æç´¢å
³é®è¯ |
| | | const customerName = ref(""); |
| | | |
| | | // æè®¿è®°å½æ°æ® |
| | | const visitList = ref([]) |
| | | // æè®¿è®°å½æ°æ® |
| | | const visitList = ref([]); |
| | | |
| | | // è¿åä¸ä¸é¡µ |
| | | const goBack = () => { |
| | | uni.navigateBack() |
| | | } |
| | | // è¿åä¸ä¸é¡µ |
| | | const goBack = () => { |
| | | uni.navigateBack(); |
| | | }; |
| | | |
| | | // æ¥è¯¢å表 |
| | | const getList = () => { |
| | | showLoadingToast('å è½½ä¸...') |
| | | const params = { |
| | | current: -1, |
| | | size: -1, |
| | | customerName: customerName.value, |
| | | } |
| | | getVisitRecords(params) |
| | | .then((res) => { |
| | | visitList.value = res.records || res.data?.records || [] |
| | | closeToast() |
| | | }) |
| | | .catch(() => { |
| | | closeToast() |
| | | showToast('è·åæ°æ®å¤±è´¥') |
| | | }) |
| | | } |
| | | // æ¥è¯¢å表 |
| | | const getList = () => { |
| | | showLoadingToast("å è½½ä¸..."); |
| | | const params = { |
| | | current: -1, |
| | | size: -1, |
| | | customerName: customerName.value, |
| | | }; |
| | | getVisitRecords(params) |
| | | .then(res => { |
| | | visitList.value = res.records || res.data?.records || []; |
| | | closeToast(); |
| | | }) |
| | | .catch(() => { |
| | | closeToast(); |
| | | showToast("è·åæ°æ®å¤±è´¥"); |
| | | }); |
| | | }; |
| | | |
| | | // æ¾ç¤ºå è½½æç¤º |
| | | const showLoadingToast = (message) => { |
| | | uni.showLoading({ |
| | | title: message, |
| | | mask: true |
| | | // æ¾ç¤ºå è½½æç¤º |
| | | const showLoadingToast = message => { |
| | | uni.showLoading({ |
| | | title: message, |
| | | mask: true, |
| | | }); |
| | | }; |
| | | |
| | | // å
³éæç¤º |
| | | const closeToast = () => { |
| | | uni.hideLoading(); |
| | | }; |
| | | |
| | | // æ°å¢æè®¿ - 跳转å°ç»è®°é¡µé¢ |
| | | const addVisit = () => { |
| | | uni.navigateTo({ |
| | | url: "/pages/cooperativeOffice/clientVisit/detail", |
| | | }); |
| | | }; |
| | | // ç¼è¾æè®¿ - 跳转å°ç»è®°é¡µé¢ |
| | | const editVisit = item => { |
| | | uni.setStorageSync("clientVisit", item); |
| | | // ç¼è¾æè®¿è·³è½¬å°ç»è®°é¡µé¢ |
| | | uni.navigateTo({ |
| | | url: "/pages/cooperativeOffice/clientVisit/detail", |
| | | }); |
| | | }; |
| | | // å é¤æè®¿ |
| | | const deleteVisit = item => { |
| | | uni.showModal({ |
| | | title: "å é¤ç¡®è®¤", |
| | | content: `ç¡®å®è¦å é¤è¯¥æè®¿è®°å½åï¼`, |
| | | success: res => { |
| | | if (res.confirm) { |
| | | deleteClientVisit(item.id); |
| | | } |
| | | }, |
| | | }); |
| | | }; |
| | | // å é¤æè®¿è®°å½ |
| | | const deleteClientVisit = id => { |
| | | showLoadingToast("å é¤ä¸..."); |
| | | delCustomer(id) |
| | | .then(() => { |
| | | closeToast(); |
| | | showToast("å 餿å"); |
| | | getList(); |
| | | }) |
| | | .catch(() => { |
| | | closeToast(); |
| | | showToast("å é¤å¤±è´¥"); |
| | | }); |
| | | }; |
| | | // æ¥ç详æ
|
| | | const viewDetail = item => { |
| | | uni.setStorageSync("clientVisit", item); |
| | | // æ¥ç详æ
跳转å°åªè¯»å±ç¤ºé¡µé¢ |
| | | uni.navigateTo({ |
| | | url: "/pages/cooperativeOffice/clientVisit/view", |
| | | }); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |
| | | }; |
| | | |
| | | // å
³éæç¤º |
| | | const closeToast = () => { |
| | | uni.hideLoading(); |
| | | }; |
| | | |
| | | // æ°å¢æè®¿ - 跳转å°ç»è®°é¡µé¢ |
| | | const addVisit = () => { |
| | | uni.navigateTo({ |
| | | url: '/pages/cooperativeOffice/clientVisit/detail' |
| | | }) |
| | | } |
| | | |
| | | // æ¥ç详æ
|
| | | const viewDetail = (item) => { |
| | | uni.setStorageSync('clientVisit', item) |
| | | // æ¥ç详æ
跳转å°åªè¯»å±ç¤ºé¡µé¢ |
| | | uni.navigateTo({ |
| | | url: '/pages/cooperativeOffice/clientVisit/view' |
| | | }) |
| | | } |
| | | |
| | | onMounted(() => { |
| | | getList() |
| | | }) |
| | | |
| | | onShow(() => { |
| | | getList() |
| | | }) |
| | | onShow(() => { |
| | | getList(); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | @import "../../../styles/sales-common.scss"; |
| | | @import "../../../styles/sales-common.scss"; |
| | | |
| | | // 页é¢ç¹å®çæ ·å¼è¦ç |
| | | .sales-accoun { |
| | | min-height: 100vh; |
| | | background: #f8f9fa; |
| | | position: relative; |
| | | padding-bottom: 80px; |
| | | } |
| | | // 页é¢ç¹å®çæ ·å¼è¦ç |
| | | .sales-accoun { |
| | | min-height: 100vh; |
| | | background: #f8f9fa; |
| | | position: relative; |
| | | padding-bottom: 80px; |
| | | } |
| | | |
| | | // ç¹å®ç徿 æ ·å¼ |
| | | .document-icon { |
| | | background: #667eea; // ä¿æé¡µé¢ç¹æçèæ¯è² |
| | | } |
| | | // ç¹å®ç徿 æ ·å¼ |
| | | .document-icon { |
| | | background: #667eea; // ä¿æé¡µé¢ç¹æçèæ¯è² |
| | | } |
| | | |
| | | // ç¹ææ ·å¼ |
| | | .visit-status { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | // ç¹ææ ·å¼ |
| | | .visit-status { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .detail-value { |
| | | word-break: break-all; // ä¿ç页é¢ç¹æçææ¬æ¢è¡æ ·å¼ |
| | | } |
| | | .detail-value { |
| | | word-break: break-all; // ä¿ç页é¢ç¹æçææ¬æ¢è¡æ ·å¼ |
| | | } |
| | | |
| | | // ç¹å®çæµ®å¨æé®æ ·å¼ |
| | | .fab-button { |
| | | background: #667eea; // ä¿æé¡µé¢ç¹æçèæ¯è² |
| | | box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3); // ä¿æé¡µé¢ç¹æçé´å½±ææ |
| | | } |
| | | // ç¹å®çæµ®å¨æé®æ ·å¼ |
| | | .fab-button { |
| | | background: #667eea; // ä¿æé¡µé¢ç¹æçèæ¯è² |
| | | box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3); // ä¿æé¡µé¢ç¹æçé´å½±ææ |
| | | } |
| | | </style> |
| | | |
| | |
| | | <template> |
| | | <view class="client-visit-detail"> |
| | | <PageHeader title="å®¢æ·æè®¿è¯¦æ
" @back="goBack" /> |
| | | |
| | | <PageHeader title="å®¢æ·æè®¿è¯¦æ
" |
| | | @back="goBack" /> |
| | | <!-- å
å®¹å®¹å¨ --> |
| | | <view class="content-container"> |
| | | <!-- 客æ·ä¿¡æ¯ --> |
| | |
| | | <text class="info-value">{{ form.contactPhone || '-' }}</text> |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- æè®¿ä¿¡æ¯ --> |
| | | <view class="section"> |
| | | <view class="section-title">æè®¿ä¿¡æ¯</view> |
| | |
| | | <text class="info-label">æè®¿äºº</text> |
| | | <text class="info-value">{{ form.visitingPeople || '-' }}</text> |
| | | </view> |
| | | <view class="info-item" v-if="form.latitude && form.longitude"> |
| | | <view class="info-item" |
| | | v-if="form.latitude && form.longitude"> |
| | | <text class="info-label">ç»çº¬åº¦</text> |
| | | <text class="info-value">{{ form.latitude }}, {{ form.longitude }}</text> |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- 夿³¨ä¿¡æ¯ --> |
| | | <view class="section"> |
| | | <view class="section-title">夿³¨ä¿¡æ¯</view> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | // æ¿æ¢ toast æ¹æ³ |
| | | const showToast = (message) => { |
| | | uni.showToast({ |
| | | title: message, |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | // æ¿æ¢ toast æ¹æ³ |
| | | const showToast = message => { |
| | | uni.showToast({ |
| | | title: message, |
| | | icon: "none", |
| | | }); |
| | | }; |
| | | |
| | | import { ref, onMounted } from 'vue' |
| | | import PageHeader from '@/components/PageHeader.vue' |
| | | import useUserStore from "@/store/modules/user" |
| | | import { ref, onMounted } from "vue"; |
| | | import PageHeader from "@/components/PageHeader.vue"; |
| | | import useUserStore from "@/store/modules/user"; |
| | | |
| | | const userStore = useUserStore() |
| | | const userStore = useUserStore(); |
| | | |
| | | // è¡¨åæ°æ® |
| | | const form = ref({ |
| | | customerName: '', |
| | | contact: '', |
| | | contactPhone: '', |
| | | visitingPeople: '', |
| | | purposeVisit: '', |
| | | purposeDate: '', |
| | | visitAddress: '', |
| | | latitude: '', |
| | | longitude: '', |
| | | locationAddress: '', |
| | | remark: '' |
| | | }) |
| | | // è¡¨åæ°æ® |
| | | const form = ref({ |
| | | customerName: "", |
| | | contact: "", |
| | | contactPhone: "", |
| | | visitingPeople: "", |
| | | purposeVisit: "", |
| | | purposeDate: "", |
| | | visitAddress: "", |
| | | latitude: "", |
| | | longitude: "", |
| | | locationAddress: "", |
| | | remark: "", |
| | | }); |
| | | |
| | | // è¿åä¸ä¸é¡µ |
| | | const goBack = () => { |
| | | // è¿åæ¶æ¸
餿¬å°åå¨çID |
| | | uni.removeStorageSync('clientVisit') |
| | | uni.navigateBack() |
| | | } |
| | | // è¿åä¸ä¸é¡µ |
| | | const goBack = () => { |
| | | // è¿åæ¶æ¸
餿¬å°åå¨çID |
| | | uni.removeStorageSync("clientVisit"); |
| | | uni.navigateBack(); |
| | | }; |
| | | |
| | | // åå§å页颿°æ® |
| | | const initPageData = () => { |
| | | // 仿¬å°åå¨è·åæè®¿è®°å½è¯¦æ
|
| | | const row = uni.getStorageSync('clientVisit') |
| | | if (row) { |
| | | form.value = { ...row } |
| | | } else { |
| | | showToast('ææ æè®¿è®°å½æ°æ®') |
| | | } |
| | | } |
| | | // åå§å页颿°æ® |
| | | const initPageData = () => { |
| | | // 仿¬å°åå¨è·åæè®¿è®°å½è¯¦æ
|
| | | const row = uni.getStorageSync("clientVisit"); |
| | | if (row) { |
| | | form.value = { ...row }; |
| | | } else { |
| | | showToast("ææ æè®¿è®°å½æ°æ®"); |
| | | } |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | initPageData() |
| | | }) |
| | | onMounted(() => { |
| | | initPageData(); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | @import '@/static/scss/form-common.scss'; |
| | | @import "@/static/scss/form-common.scss"; |
| | | |
| | | .client-visit-detail { |
| | | min-height: 100vh; |
| | | background-color: #f8f9fa; |
| | | } |
| | | .client-visit-detail { |
| | | min-height: 100vh; |
| | | background-color: #f8f9fa; |
| | | } |
| | | |
| | | .content-container { |
| | | padding: 16px; |
| | | } |
| | | .content-container { |
| | | padding: 16px; |
| | | } |
| | | |
| | | .section { |
| | | background-color: #ffffff; |
| | | border-radius: 12px; |
| | | margin-bottom: 16px; |
| | | overflow: hidden; |
| | | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); |
| | | } |
| | | .section { |
| | | background-color: #ffffff; |
| | | border-radius: 12px; |
| | | margin-bottom: 16px; |
| | | overflow: hidden; |
| | | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); |
| | | } |
| | | |
| | | .section-title { |
| | | font-size: 16px; |
| | | font-weight: 600; |
| | | color: #333333; |
| | | padding: 16px 16px 12px; |
| | | border-bottom: 1px solid #f0f0f0; |
| | | } |
| | | .section-title { |
| | | font-size: 16px; |
| | | font-weight: 600; |
| | | color: #333333; |
| | | padding: 16px 16px 12px; |
| | | border-bottom: 1px solid #f0f0f0; |
| | | } |
| | | |
| | | .info-item { |
| | | display: flex; |
| | | padding: 14px 16px; |
| | | border-bottom: 1px solid #f8f8f8; |
| | | align-items: flex-start; |
| | | } |
| | | .info-item { |
| | | display: flex; |
| | | padding: 14px 16px; |
| | | border-bottom: 1px solid #f8f8f8; |
| | | align-items: flex-start; |
| | | } |
| | | |
| | | .info-item:last-child { |
| | | border-bottom: none; |
| | | } |
| | | .info-item:last-child { |
| | | border-bottom: none; |
| | | } |
| | | |
| | | .info-label { |
| | | font-size: 14px; |
| | | color: #666666; |
| | | min-width: 80px; |
| | | flex-shrink: 0; |
| | | line-height: 22px; |
| | | } |
| | | .info-label { |
| | | font-size: 14px; |
| | | color: #666666; |
| | | min-width: 80px; |
| | | flex-shrink: 0; |
| | | line-height: 22px; |
| | | } |
| | | |
| | | .info-value { |
| | | font-size: 14px; |
| | | color: #333333; |
| | | flex: 1; |
| | | line-height: 22px; |
| | | text-align: right; |
| | | } |
| | | .info-value { |
| | | font-size: 14px; |
| | | color: #333333; |
| | | flex: 1; |
| | | line-height: 22px; |
| | | text-align: right; |
| | | } |
| | | |
| | | .multi-line { |
| | | text-align: left; |
| | | word-break: break-all; |
| | | line-height: 1.6; |
| | | } |
| | | .multi-line { |
| | | text-align: left; |
| | | word-break: break-all; |
| | | line-height: 1.6; |
| | | } |
| | | |
| | | .remark-item { |
| | | padding-bottom: 16px; |
| | | } |
| | | .remark-item { |
| | | padding-bottom: 16px; |
| | | } |
| | | </style> |
| | |
| | | icon: "/static/images/icon/qingjiaguanli@2x.png", |
| | | label: "ç¨å°ç®¡ç", |
| | | }, |
| | | { |
| | | icon: "/static/images/icon/qingjiaguanli@2x.png", |
| | | label: "è§ç« å¶åº¦", |
| | | }, |
| | | // { |
| | | // icon: "/static/images/icon/xietongshenpi@2x.png", |
| | | // label: "åå审æ¹", |
| | |
| | | url: "/pages/managementMeetings/sealManagement/index", |
| | | }); |
| | | break; |
| | | case "è§ç« å¶åº¦": |
| | | uni.navigateTo({ |
| | | url: "/pages/managementMeetings/rulesRegulationsManagement/index", |
| | | }); |
| | | break; |
| | | |
| | | case "åå审æ¹": |
| | | uni.navigateTo({ |
| | | url: "/pages/cooperativeOffice/collaborativeApproval/index", |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <view class="client-visit-detail"> |
| | | <PageHeader :title="detailType === 1 ? 'åå¸å¶åº¦' : 'å¶åº¦è¯¦æ
'" |
| | | @back="goBack" /> |
| | | <u-form ref="formRef" |
| | | label-width="90"> |
| | | <!-- 客æ·ä¿¡æ¯ --> |
| | | <!-- <u-cell-group title="ç¥è¯ä¿¡æ¯"> --> |
| | | <u-form-item label="å¶åº¦ç¼å·" |
| | | prop="regulationNum" |
| | | required |
| | | border-bottom> |
| | | <u-input v-model="form.regulationNum" |
| | | :readonly="readonly" |
| | | placeholder="请è¾å
¥å¶åº¦ç¼å·" /> |
| | | </u-form-item> |
| | | <u-form-item label="å¶åº¦æ é¢" |
| | | prop="title" |
| | | required |
| | | border-bottom> |
| | | <u-input v-model="form.title" |
| | | :readonly="readonly" |
| | | placeholder="请è¾å
¥å¶åº¦æ é¢" /> |
| | | </u-form-item> |
| | | <u-form-item label="å¶åº¦åç±»" |
| | | prop="type" |
| | | required |
| | | border-bottom> |
| | | <u-input v-model="equipmentname" |
| | | readonly |
| | | placeholder="è¯·éæ©å¶åº¦åç±»" |
| | | @click="showEquipmentSheet = true" /> |
| | | <template v-if="!readonly" |
| | | #right> |
| | | <up-icon name="arrow-right" |
| | | @click="openEquipmentSheet"></up-icon> |
| | | </template> |
| | | </u-form-item> |
| | | <u-form-item label="å¶åº¦å
容" |
| | | prop="scenario" |
| | | required |
| | | border-bottom> |
| | | <u-textarea v-model="form.content" |
| | | type="textarea" |
| | | rows="4" |
| | | :disabled="readonly" |
| | | placeholder="请è¾å
¥å¶åº¦å
容" /> |
| | | </u-form-item> |
| | | <u-form-item label="å¶åº¦çæ¬" |
| | | prop="title" |
| | | border-bottom> |
| | | <u-input v-model="form.version" |
| | | :readonly="readonly" |
| | | placeholder="请è¾å
¥å¶åº¦çæ¬" /> |
| | | </u-form-item> |
| | | <u-form-item label="çææ¶é´" |
| | | prop="status" |
| | | required |
| | | border-bottom> |
| | | <u-input v-model="form.effectiveTime" |
| | | readonly |
| | | placeholder="è¯·éæ©çææ¶é´" |
| | | @click="showEffectiveTimeSheet = true" /> |
| | | <template v-if="!readonly" |
| | | #right> |
| | | <up-icon name="arrow-right" |
| | | @click="showEffectiveTimeSheet = true"></up-icon> |
| | | </template> |
| | | </u-form-item> |
| | | <u-form-item label="éç¨èå´" |
| | | required |
| | | prop="remark" |
| | | border-bottom> |
| | | <up-checkbox-group v-model="form.scope" |
| | | :disabled="readonly" |
| | | placement="column" |
| | | @change="checkboxChange"> |
| | | <up-checkbox :customStyle="{marginBottom: '8px'}" |
| | | v-for="(item, index) in checkboxList1" |
| | | :key="index" |
| | | :label="item.name" |
| | | :name="item.value"> |
| | | </up-checkbox> |
| | | </up-checkbox-group> |
| | | </u-form-item> |
| | | <u-form-item label="éè¦ç¡®è®¤" |
| | | prop="solution" |
| | | border-bottom> |
| | | <up-switch :disabled="readonly" |
| | | v-model="form.requireConfirm"></up-switch> |
| | | </u-form-item> |
| | | <!-- </u-cell-group> --> |
| | | <!-- æäº¤æé® --> |
| | | <view v-if="!readonly" |
| | | class="footer-btns"> |
| | | <u-button class="cancel-btn" |
| | | @click="goBack">åæ¶</u-button> |
| | | <u-button class="sign-btn" |
| | | type="primary" |
| | | @click="handleSubmit" |
| | | :loading="loading">ä¿å</u-button> |
| | | </view> |
| | | </u-form> |
| | | <!-- 设å¤é
ç½®éæ©å¨ --> |
| | | <up-action-sheet :show="showEquipmentSheet" |
| | | :actions="equipmentOptions" |
| | | @select="handleEquipmentChange" |
| | | @close="showEquipmentSheet = false" /> |
| | | <!-- ç¶æéæ©å¨ --> |
| | | <up-action-sheet :show="showStatusSheet" |
| | | :actions="statusOptions" |
| | | @select="onStatusSelect" |
| | | @close="showStatusSheet = false" /> |
| | | <up-datetime-picker :show="showEffectiveTimeSheet" |
| | | @confirm="handleEffectiveTimeConfirm" |
| | | @cancel="showEffectiveTimeSheet = false" |
| | | v-model="effectiveTime" |
| | | mode="datetime"></up-datetime-picker> |
| | | </view> |
| | | </template> |
| | | |
| | | <script setup> |
| | | // æ¿æ¢ toast æ¹æ³ |
| | | defineOptions({ name: "meeting-settings-detail" }); |
| | | const showToast = message => { |
| | | uni.showToast({ |
| | | title: message, |
| | | icon: "none", |
| | | }); |
| | | }; |
| | | |
| | | import { ref, onMounted, computed } from "vue"; |
| | | import PageHeader from "@/components/PageHeader.vue"; |
| | | import useUserStore from "@/store/modules/user"; |
| | | import { onLoad } from "@dcloudio/uni-app"; |
| | | import { |
| | | addRuleManagement, |
| | | updateRuleManagement, |
| | | } from "@/api/managementMeetings/rulesRegulationsManagement"; |
| | | import dayjs from "dayjs"; |
| | | const userStore = useUserStore(); |
| | | const showEffectiveTimeSheet = ref(false); |
| | | const effectiveTime = ref(new Date()); |
| | | // è¡¨åæ°æ® |
| | | const form = ref({ |
| | | id: "", |
| | | regulationNum: "", |
| | | title: "", |
| | | category: "", |
| | | content: "", |
| | | version: "", |
| | | status: "active", |
| | | readCount: 0, |
| | | effectiveTime: "", |
| | | scope: [], |
| | | requireConfirm: false, |
| | | }); |
| | | const checkboxList1 = ref([ |
| | | { name: "å
¨ä½åå·¥", value: "all" }, |
| | | { name: "管çå±", value: "manager" }, |
| | | { name: "人äºé¨é¨", value: "hr" }, |
| | | { name: "è´¢å¡é¨é¨", value: "finance" }, |
| | | { name: "ææ¯é¨é¨", value: "tech" }, |
| | | ]); |
| | | const equipmentOptions = ref([ |
| | | { value: "hr", name: "人äºå¶åº¦" }, |
| | | { value: "finance", name: "è´¢å¡å¶åº¦" }, |
| | | { value: "safety", name: "å®å
¨å¶åº¦" }, |
| | | { value: "tech", name: "ææ¯å¶åº¦" }, |
| | | ]); |
| | | const statusOptions = ref([ |
| | | { value: "high", name: "æ¾èæå" }, |
| | | { value: "medium", name: "ä¸è¬æå" }, |
| | | { value: "low", name: "轻微æå" }, |
| | | ]); |
| | | //// 页é¢ç¶æ |
| | | const loading = ref(false); |
| | | const formRef = ref(null); |
| | | const showEquipmentSheet = ref(false); |
| | | const showStatusSheet = ref(false); |
| | | const openEquipmentSheet = () => { |
| | | showEquipmentSheet.value = true; |
| | | }; |
| | | // è¿åä¸ä¸é¡µ |
| | | const goBack = () => { |
| | | uni.navigateBack(); |
| | | }; |
| | | const statusname = ref(""); |
| | | // ç¶æéæ© |
| | | const onStatusSelect = action => { |
| | | form.value.efficiency = action.value; |
| | | statusname.value = action.name; |
| | | showStatusSheet.value = false; |
| | | }; |
| | | const equipmentname = ref(""); |
| | | const handleEffectiveTimeConfirm = () => { |
| | | form.value.effectiveTime = dayjs(effectiveTime.value).format( |
| | | "YYYY-MM-DD HH:mm:ss" |
| | | ); |
| | | showEffectiveTimeSheet.value = false; |
| | | }; |
| | | // å¶åº¦åç±»éæ© |
| | | const handleEquipmentChange = val => { |
| | | form.value.category = val.value; |
| | | equipmentname.value = val.name; |
| | | showEquipmentSheet.value = false; |
| | | }; |
| | | // æäº¤è¡¨å |
| | | const handleSubmit = async () => { |
| | | if (!form.value.regulationNum) { |
| | | showToast("请è¾å
¥å¶åº¦ç¼å·"); |
| | | return; |
| | | } |
| | | |
| | | if (!form.value.title) { |
| | | showToast("请è¾å
¥å¶åº¦æ é¢"); |
| | | return; |
| | | } |
| | | |
| | | if (!form.value.category) { |
| | | showToast("è¯·éæ©å¶åº¦åç±»"); |
| | | return; |
| | | } |
| | | if (!form.value.content) { |
| | | showToast("请è¾å
¥å¶åº¦å
容"); |
| | | return; |
| | | } |
| | | if (!form.value.effectiveTime) { |
| | | showToast("è¯·éæ©çææ¶é´"); |
| | | return; |
| | | } |
| | | if (!form.value.scope.length) { |
| | | showToast("è¯·éæ©çæèå´"); |
| | | return; |
| | | } |
| | | try { |
| | | loading.value = true; |
| | | if (detailType.value === 1) { |
| | | addRuleManagement(form.value).then(res => { |
| | | if (res.code !== 200) { |
| | | showToast("ä¿å失败ï¼è¯·éè¯"); |
| | | return; |
| | | } |
| | | loading.value = false; |
| | | showToast("ä¿åæå"); |
| | | setTimeout(() => { |
| | | goBack(); |
| | | }, 500); |
| | | }); |
| | | } else if (detailType.value === 2) { |
| | | updateRuleManagement(form.value).then(res => { |
| | | if (res.code !== 200) { |
| | | showToast("ä¿å失败ï¼è¯·éè¯"); |
| | | return; |
| | | } |
| | | loading.value = false; |
| | | showToast("ä¿åæå"); |
| | | setTimeout(() => { |
| | | goBack(); |
| | | }, 500); |
| | | }); |
| | | } |
| | | } catch (e) { |
| | | loading.value = false; |
| | | console.error("ä¿å失败:", e); |
| | | showToast("ä¿å失败ï¼è¯·éè¯"); |
| | | } |
| | | }; |
| | | |
| | | // åå§å页颿°æ® |
| | | const initPageData = () => { |
| | | // 仿¬å°åå¨ä¸è·åä¼è®® room æ°æ® |
| | | const meetingRoom = uni.getStorageSync("meetingRoom"); |
| | | if (meetingRoom) { |
| | | form.value = JSON.parse(JSON.stringify(meetingRoom)); |
| | | if (meetingRoom.equipment) { |
| | | if (Array.isArray(meetingRoom.equipment)) { |
| | | form.value.equipment = meetingRoom.equipment; |
| | | } else { |
| | | form.value.equipment = meetingRoom.equipment.split(","); |
| | | } |
| | | } |
| | | statusname.value = meetingRoom.status === 1 ? "å¯ç¨" : "ç¦ç¨"; |
| | | |
| | | // æ¸
餿¬å°åå¨ä¸çæ°æ®ï¼é¿å
䏿¬¡æå¼æ¶ä»ç¶æ¾ç¤º |
| | | uni.removeStorageSync("meetingRoom"); |
| | | } |
| | | }; |
| | | const readonly = ref(false); |
| | | const detailType = ref(1); |
| | | const knowledgeId = ref(""); |
| | | |
| | | onLoad(options => { |
| | | detailType.value = Number(options.detailType); |
| | | knowledgeId.value = options.id || ""; |
| | | |
| | | // æ¥ç模å¼è®¾ç½®åªè¯» |
| | | if (detailType.value === 3) { |
| | | readonly.value = true; |
| | | } |
| | | }); |
| | | // é置表å |
| | | const resetForm = () => { |
| | | form.value = { |
| | | id: "", |
| | | regulationNum: "", |
| | | title: "", |
| | | category: "", |
| | | content: "", |
| | | version: "", |
| | | status: "active", |
| | | readCount: 0, |
| | | effectiveTime: "", |
| | | scope: [], |
| | | requireConfirm: false, |
| | | }; |
| | | equipmentname.value = ""; |
| | | statusname.value = ""; |
| | | }; |
| | | onMounted(() => { |
| | | console.log(effectiveTime.value, "çææ¶é´"); |
| | | |
| | | // 仿¬å°åå¨ä¸è·åç¥è¯æ°æ® |
| | | const rulesRegulations = uni.getStorageSync("rulesRegulations"); |
| | | initPageData(); |
| | | if (rulesRegulations) { |
| | | form.value = JSON.parse(JSON.stringify(rulesRegulations)); |
| | | } |
| | | |
| | | if (detailType.value === 1) { |
| | | resetForm(); |
| | | } |
| | | |
| | | if (detailType.value != 1) { |
| | | equipmentname.value = |
| | | equipmentOptions.value.find(item => item.value == form.value.category) |
| | | ?.name || ""; |
| | | } |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | @import "@/static/scss/form-common.scss"; |
| | | .client-visit { |
| | | min-height: 100vh; |
| | | background: #f8f9fa; |
| | | padding-bottom: 5rem; |
| | | } |
| | | |
| | | .footer-btns { |
| | | position: fixed; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | background: #fff; |
| | | display: flex; |
| | | justify-content: space-around; |
| | | align-items: center; |
| | | padding: 0.75rem 0; |
| | | box-shadow: 0 -0.125rem 0.5rem rgba(0, 0, 0, 0.05); |
| | | z-index: 1000; |
| | | } |
| | | |
| | | .cancel-btn { |
| | | font-weight: 400; |
| | | font-size: 1rem; |
| | | color: #666; |
| | | background: #f5f5f5; |
| | | border: 1px solid #ddd; |
| | | width: 45%; |
| | | height: 2.5rem; |
| | | border-radius: 2.5rem 2.5rem 2.5rem 2.5rem; |
| | | } |
| | | |
| | | .sign-btn { |
| | | font-weight: 500; |
| | | font-size: 1rem; |
| | | color: #fff; |
| | | background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); |
| | | border: none; |
| | | width: 45%; |
| | | height: 2.5rem; |
| | | border-radius: 2.5rem 2.5rem 2.5rem 2.5rem; |
| | | } |
| | | |
| | | .location-icon { |
| | | color: #1989fa; |
| | | font-size: 1.2rem; |
| | | } |
| | | |
| | | .selector-container { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | |
| | | .selector-text { |
| | | font-size: 14px; |
| | | color: #333; |
| | | } |
| | | |
| | | .popup-content { |
| | | padding: 20rpx; |
| | | } |
| | | |
| | | .popup-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | margin-bottom: 20rpx; |
| | | } |
| | | |
| | | .popup-title { |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | color: #333; |
| | | } |
| | | |
| | | .close-icon { |
| | | font-size: 20px; |
| | | color: #999; |
| | | } |
| | | |
| | | .popup-body { |
| | | max-height: 60vh; |
| | | overflow-y: auto; |
| | | margin-bottom: 20rpx; |
| | | } |
| | | |
| | | .checkbox-item { |
| | | margin-bottom: 15rpx; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .popup-footer { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | gap: 15rpx; |
| | | } |
| | | |
| | | .cancel-btn-popup { |
| | | flex: 1; |
| | | border-radius: 8rpx; |
| | | } |
| | | |
| | | .confirm-btn-popup { |
| | | flex: 1; |
| | | border-radius: 8rpx; |
| | | } |
| | | .checkbox-item { |
| | | margin-top: 40rpx; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <view class="file-list-page"> |
| | | <!-- 页é¢å¤´é¨ --> |
| | | <PageHeader title="é件管ç" |
| | | @back="goBack" /> |
| | | <!-- éä»¶å表 --> |
| | | <view class="file-list-container"> |
| | | <view v-if="fileList.length > 0" |
| | | class="file-list"> |
| | | <view v-for="(file, index) in fileList" |
| | | :key="file.id || index" |
| | | class="file-item"> |
| | | <!-- æä»¶å¾æ --> |
| | | <!-- <view class="file-icon" |
| | | :class="getFileIconClass(file.fileType)"> |
| | | <up-icon :name="getFileIcon(file.fileType)" |
| | | size="24" |
| | | color="#ffffff" /> |
| | | </view> --> |
| | | <!-- æä»¶ä¿¡æ¯ --> |
| | | <view class="file-info"> |
| | | <text class="file-name">{{ file.name }}</text> |
| | | <!-- <text class="file-meta">{{ formatFileSize(file.fileSize) }} · {{ file.uploadTime || file.createTime }}</text> --> |
| | | </view> |
| | | <!-- æä½æé® --> |
| | | <view class="file-actions"> |
| | | <!-- <u-button size="small" |
| | | type="primary" |
| | | plain |
| | | @click="previewFile(file)">é¢è§</u-button> --> |
| | | <u-button size="small" |
| | | type="info" |
| | | plain |
| | | @click="downloadFile(file)">ä¸è½½</u-button> |
| | | <u-button size="small" |
| | | type="error" |
| | | plain |
| | | @click="confirmDelete(file, index)">å é¤</u-button> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <!-- ç©ºç¶æ --> |
| | | <view v-else |
| | | class="empty-state"> |
| | | <up-icon name="document" |
| | | size="64" |
| | | color="#c0c4cc" /> |
| | | <text class="empty-text">ææ éä»¶</text> |
| | | </view> |
| | | </view> |
| | | <a rel="nofollow" |
| | | id="downloadLink" |
| | | href="#" |
| | | style="display:none;">ä¸è½½ææ¬æä»¶</a> |
| | | <!-- ä¸ä¼ æé® --> |
| | | <view class="upload-button" |
| | | @click="chooseFile"> |
| | | <up-icon name="plus" |
| | | size="24" |
| | | color="#ffffff" /> |
| | | <text class="upload-text">ä¸ä¼ éä»¶</text> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, onMounted } from "vue"; |
| | | import PageHeader from "@/components/PageHeader.vue"; |
| | | import config from "@/config"; |
| | | import { getToken } from "@/utils/auth"; |
| | | import axios from "axios"; |
| | | import requestApp from "@/utils/requestApp"; |
| | | // import { saveAs } from "file-saver"; |
| | | import { |
| | | listRuleFiles, |
| | | addRuleFile, |
| | | delRuleFile, |
| | | upload, |
| | | } from "@/api/managementMeetings/rulesRegulationsManagement"; |
| | | import { blobValidate } from "@/utils/ruoyi"; |
| | | |
| | | // éä»¶å表 |
| | | const fileList = ref([]); |
| | | |
| | | // è¿åä¸ä¸é¡µ |
| | | const goBack = () => { |
| | | uni.navigateBack(); |
| | | }; |
| | | // const request = axios.create({ |
| | | // baseURL: "URL.com", |
| | | // adapter: axiosAdapterUniapp, |
| | | // }); |
| | | // è·åæä»¶å¾æ |
| | | const getFileIcon = fileType => { |
| | | const iconMap = { |
| | | doc: "document", |
| | | docx: "document", |
| | | xls: "grid", |
| | | xlsx: "grid", |
| | | pdf: "document", |
| | | ppt: "copy", |
| | | pptx: "copy", |
| | | txt: "document", |
| | | jpg: "image", |
| | | jpeg: "image", |
| | | png: "image", |
| | | gif: "image", |
| | | zip: "folder", |
| | | rar: "folder", |
| | | }; |
| | | return iconMap[fileType.toLowerCase()] || "document"; |
| | | }; |
| | | |
| | | // è·åæä»¶å¾æ æ ·å¼ç±» |
| | | const getFileIconClass = fileType => { |
| | | const colorMap = { |
| | | doc: "blue", |
| | | docx: "blue", |
| | | xls: "green", |
| | | xlsx: "green", |
| | | pdf: "red", |
| | | ppt: "orange", |
| | | pptx: "orange", |
| | | txt: "gray", |
| | | jpg: "purple", |
| | | jpeg: "purple", |
| | | png: "purple", |
| | | gif: "purple", |
| | | zip: "yellow", |
| | | rar: "yellow", |
| | | }; |
| | | return colorMap[fileType.toLowerCase()] || "gray"; |
| | | }; |
| | | |
| | | // æ ¼å¼åæä»¶å¤§å° |
| | | const formatFileSize = bytes => { |
| | | if (bytes === 0) return "0 B"; |
| | | const k = 1024; |
| | | const sizes = ["B", "KB", "MB", "GB"]; |
| | | const i = Math.floor(Math.log(bytes) / Math.log(k)); |
| | | return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i]; |
| | | }; |
| | | |
| | | // éæ©æä»¶ |
| | | const chooseFile = () => { |
| | | // uni.chooseImage({ |
| | | // count: 9, |
| | | // sizeType: ["original", "compressed"], |
| | | // sourceType: ["album", "camera"], |
| | | // success: res => { |
| | | // uploadFiles(res.tempFiles); |
| | | // }, |
| | | // fail: err => { |
| | | // console.error("éæ©å¾ç失败:", err); |
| | | // showToast("éæ©æä»¶å¤±è´¥"); |
| | | // }, |
| | | // }); |
| | | // uni.chooseFile({ |
| | | // count: 9, |
| | | // extension: [ |
| | | // ".doc", |
| | | // ".docx", |
| | | // ".xls", |
| | | // ".xlsx", |
| | | // ".pdf", |
| | | // ".ppt", |
| | | // ".pptx", |
| | | // ".txt", |
| | | // ".jpg", |
| | | // ".jpeg", |
| | | // ".png", |
| | | // ".gif", |
| | | // ".zip", |
| | | // ".rar", |
| | | // ], |
| | | // success: res => { |
| | | // uploadFiles(res.tempFiles); |
| | | // }, |
| | | // fail: err => { |
| | | // showToast("éæ©æä»¶å¤±è´¥"); |
| | | // }, |
| | | // }); |
| | | }; |
| | | |
| | | // ä¸ä¼ æä»¶ |
| | | const uploadFiles = tempFiles => { |
| | | tempFiles.forEach((tempFile, index) => { |
| | | // æ¾ç¤ºä¸ä¼ ä¸æç¤º |
| | | uni.showLoading({ |
| | | title: "ä¸ä¼ ä¸...", |
| | | mask: true, |
| | | }); |
| | | console.log(tempFile, "ä¸ä¼ æä»¶"); |
| | | // 1. ç´æ¥ä½¿ç¨ uni.uploadFile ä¸ä¼ æä»¶ |
| | | uni.uploadFile({ |
| | | url: config.baseUrl + "/file/upload", |
| | | filePath: tempFile.path, |
| | | name: "file", |
| | | header: { |
| | | Authorization: "Bearer " + getToken(), |
| | | }, |
| | | success: uploadRes => { |
| | | uni.hideLoading(); |
| | | try { |
| | | const res = JSON.parse(uploadRes.data); |
| | | if (res.code === 200) { |
| | | // 2. æåæä»¶ä¿¡æ¯ |
| | | const fileName = tempFile.name; |
| | | const fileType = fileName.split(".").pop(); |
| | | // 3. æé ä¿åæä»¶ä¿¡æ¯çåæ° |
| | | const saveData = { |
| | | name: fileName, |
| | | rulesRegulationsManagementId: rulesRegulationsManagementId.value, |
| | | url: res.data.tempPath || "", |
| | | }; |
| | | console.log(saveData, "ä¿åæä»¶ä¿¡æ¯åæ°"); |
| | | // 4. è°ç¨ addRuleFile æ¥å£ä¿åæä»¶ä¿¡æ¯ |
| | | addRuleFile(saveData) |
| | | .then(addRes => { |
| | | if (addRes.code === 200) { |
| | | // 5. æ·»å å°æä»¶å表 |
| | | const newFile = { |
| | | ...addRes.data, |
| | | uploadTime: new Date().toLocaleString(), |
| | | }; |
| | | // fileList.value.push(newFile); |
| | | getFileList(); |
| | | showToast("ä¸ä¼ æå"); |
| | | } else { |
| | | showToast("ä¿åæä»¶ä¿¡æ¯å¤±è´¥"); |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | console.error("ä¿åæä»¶ä¿¡æ¯å¤±è´¥:", err); |
| | | showToast("ä¿åæä»¶ä¿¡æ¯å¤±è´¥"); |
| | | }); |
| | | } else { |
| | | showToast("æä»¶ä¸ä¼ 失败"); |
| | | } |
| | | } catch (e) { |
| | | console.error("è§£æä¸ä¼ ç»æå¤±è´¥:", e); |
| | | showToast("ä¸ä¼ 失败"); |
| | | } |
| | | }, |
| | | fail: err => { |
| | | uni.hideLoading(); |
| | | console.error("ä¸ä¼ 失败:", err); |
| | | showToast("ä¸ä¼ 失败"); |
| | | }, |
| | | }); |
| | | }); |
| | | }; |
| | | |
| | | // ä¸è½½æä»¶ |
| | | const downloadFile = file => { |
| | | var url = |
| | | config.baseUrl + |
| | | "/common/download?fileName=" + |
| | | encodeURIComponent(file.url) + |
| | | "&delete=true"; |
| | | console.log(url, "url"); |
| | | |
| | | uni |
| | | .downloadFile({ |
| | | url: url, |
| | | responseType: "blob", |
| | | header: { Authorization: "Bearer " + getToken() }, |
| | | }) |
| | | .then(res => { |
| | | console.log(res, "res"); |
| | | const isBlob = blobValidate(res.data); |
| | | console.log(isBlob, "isBlob"); |
| | | if (isBlob) { |
| | | const blob = new Blob([res.data], { type: "text/plain" }); |
| | | const url = URL.createObjectURL(blob); |
| | | const downloadLink = document.getElementById("downloadLink"); |
| | | downloadLink.href = url; |
| | | downloadLink.download = file.name; |
| | | downloadLink.click(); |
| | | // downloadLink.style.display = "block"; |
| | | showToast("ä¸è½½æå"); |
| | | } else { |
| | | showToast("ä¸è½½å¤±è´¥"); |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | console.error("ä¸è½½å¤±è´¥:", err); |
| | | showToast("ä¸è½½å¤±è´¥"); |
| | | }); |
| | | }; |
| | | |
| | | // 确认å é¤ |
| | | const confirmDelete = (file, index) => { |
| | | uni.showModal({ |
| | | title: "å é¤ç¡®è®¤", |
| | | content: `ç¡®å®è¦å é¤éä»¶ "${file.name}" åï¼`, |
| | | success: res => { |
| | | if (res.confirm) { |
| | | deleteFile(file.id, index); |
| | | } |
| | | }, |
| | | }); |
| | | }; |
| | | |
| | | // å 餿件 |
| | | const deleteFile = (fileId, index) => { |
| | | uni.showLoading({ |
| | | title: "å é¤ä¸...", |
| | | mask: true, |
| | | }); |
| | | |
| | | delRuleFile([fileId]) |
| | | .then(res => { |
| | | uni.hideLoading(); |
| | | if (res.code === 200) { |
| | | // fileList.value.splice(index, 1); |
| | | getFileList(); |
| | | showToast("å 餿å"); |
| | | } else { |
| | | showToast("å é¤å¤±è´¥"); |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | uni.hideLoading(); |
| | | showToast("å é¤å¤±è´¥"); |
| | | }); |
| | | }; |
| | | |
| | | // æ¾ç¤ºæç¤º |
| | | const showToast = message => { |
| | | uni.showToast({ |
| | | title: message, |
| | | icon: "none", |
| | | }); |
| | | }; |
| | | const rulesRegulationsManagementId = ref(""); |
| | | // 页é¢å è½½æ¶ |
| | | onMounted(() => { |
| | | // ä» API è·åéä»¶å表 |
| | | getFileList(); |
| | | // 仿¬å°åå¨è·å rulesRegulationsManagementId |
| | | rulesRegulationsManagementId.value = uni.getStorageSync( |
| | | "rulesRegulationsManagement" |
| | | ); |
| | | }); |
| | | |
| | | // è·åéä»¶å表 |
| | | const getFileList = () => { |
| | | uni.showLoading({ |
| | | title: "å è½½ä¸...", |
| | | mask: true, |
| | | }); |
| | | |
| | | listRuleFiles() |
| | | .then(res => { |
| | | uni.hideLoading(); |
| | | if (res.code === 200) { |
| | | fileList.value = res.data.records || []; |
| | | } else { |
| | | showToast("è·åéä»¶å表失败"); |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | uni.hideLoading(); |
| | | showToast("è·åéä»¶å表失败"); |
| | | }); |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | @import "../../../styles/sales-common.scss"; |
| | | |
| | | .file-list-page { |
| | | min-height: 100vh; |
| | | background: #f8f9fa; |
| | | padding-bottom: 100rpx; |
| | | } |
| | | |
| | | .file-list-container { |
| | | padding: 20rpx; |
| | | } |
| | | |
| | | .file-list { |
| | | background: #ffffff; |
| | | border-radius: 8rpx; |
| | | overflow: hidden; |
| | | box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05); |
| | | } |
| | | |
| | | .file-item { |
| | | display: flex; |
| | | align-items: center; |
| | | padding: 20rpx; |
| | | border-bottom: 1rpx solid #f0f0f0; |
| | | |
| | | &:last-child { |
| | | border-bottom: none; |
| | | } |
| | | } |
| | | |
| | | .file-icon { |
| | | width: 56rpx; |
| | | height: 56rpx; |
| | | border-radius: 8rpx; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | margin-right: 20rpx; |
| | | |
| | | &.blue { |
| | | background: #409eff; |
| | | } |
| | | |
| | | &.green { |
| | | background: #67c23a; |
| | | } |
| | | |
| | | &.red { |
| | | background: #f56c6c; |
| | | } |
| | | |
| | | &.orange { |
| | | background: #e6a23c; |
| | | } |
| | | |
| | | &.gray { |
| | | background: #909399; |
| | | } |
| | | |
| | | &.purple { |
| | | background: #909399; |
| | | } |
| | | |
| | | &.yellow { |
| | | background: #e6a23c; |
| | | } |
| | | } |
| | | |
| | | .file-info { |
| | | flex: 1; |
| | | min-width: 0; |
| | | } |
| | | |
| | | .file-name { |
| | | display: block; |
| | | font-size: 16px; |
| | | color: #303133; |
| | | margin-bottom: 8rpx; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | white-space: nowrap; |
| | | } |
| | | |
| | | .file-meta { |
| | | display: block; |
| | | font-size: 12px; |
| | | color: #909399; |
| | | } |
| | | |
| | | .file-actions { |
| | | display: flex; |
| | | gap: 12rpx; |
| | | } |
| | | |
| | | .empty-state { |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | justify-content: center; |
| | | padding: 100rpx 0; |
| | | background: #ffffff; |
| | | border-radius: 8rpx; |
| | | box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05); |
| | | } |
| | | |
| | | .empty-text { |
| | | font-size: 14px; |
| | | color: #909399; |
| | | margin-top: 20rpx; |
| | | } |
| | | |
| | | .upload-button { |
| | | position: fixed; |
| | | bottom: 40rpx; |
| | | right: 40rpx; |
| | | width: 80rpx; |
| | | height: 80rpx; |
| | | border-radius: 50%; |
| | | background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); |
| | | display: flex; |
| | | flex-direction: column; |
| | | justify-content: center; |
| | | align-items: center; |
| | | box-shadow: 0 4rpx 16rpx rgba(102, 126, 234, 0.4); |
| | | z-index: 1000; |
| | | } |
| | | |
| | | .upload-text { |
| | | font-size: 10px; |
| | | color: #ffffff; |
| | | margin-top: 4rpx; |
| | | } |
| | | |
| | | .upload-progress { |
| | | padding: 40rpx 0; |
| | | } |
| | | |
| | | .upload-progress-text { |
| | | display: block; |
| | | text-align: center; |
| | | margin-top: 20rpx; |
| | | font-size: 14px; |
| | | color: #606266; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <view class="sales-accoun"> |
| | | <!-- 使ç¨éç¨é¡µé¢å¤´é¨ç»ä»¶ --> |
| | | <PageHeader title="è§ç« å¶åº¦ç®¡ç" |
| | | @back="goBack" /> |
| | | <!-- æç´¢åçéåºå --> |
| | | <view class="search-section"> |
| | | <view class="search-bar"> |
| | | <view class="search-input"> |
| | | <up-input class="search-text" |
| | | placeholder="请è¾å
¥å¶åº¦æ é¢" |
| | | v-model="name" |
| | | @blur="getList" |
| | | clearable /> |
| | | </view> |
| | | <view class="filter-button" |
| | | @click="getList"> |
| | | <u-icon name="search" |
| | | size="24" |
| | | color="#999"></u-icon> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <!-- æè®¿è®°å½å表 --> |
| | | <view class="ledger-list" |
| | | v-if="visitList.length > 0"> |
| | | <view v-for="(item, index) in visitList" |
| | | :key="index"> |
| | | <view class="ledger-item"> |
| | | <view class="item-header"> |
| | | <view class="item-left"> |
| | | <view class="document-icon"> |
| | | <up-icon name="file-text" |
| | | size="16" |
| | | color="#ffffff"></up-icon> |
| | | </view> |
| | | <text class="item-id">å¶åº¦æ é¢ï¼{{ item.title || '-' }}</text> |
| | | </view> |
| | | </view> |
| | | <up-divider></up-divider> |
| | | <view class="item-details"> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">å¶åº¦ç¼å·</text> |
| | | <text class="detail-value">{{ item.regulationNum || '-' }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">åç±»</text> |
| | | <u-tag size="mini">{{ formatReceiptType(item.category) }}</u-tag> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">çæ¬</text> |
| | | <text class="detail-value">{{ item.version || '-' }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">åå¸äºº</text> |
| | | <text class="detail-value">{{ item.createUserName || '-' }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">å叿¶é´</text> |
| | | <text class="detail-value">{{ item.createTime || '-' }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">ç¶æ</text> |
| | | <u-tag size="mini" |
| | | :type="item.status === 'active' ? 'success' : 'info'"> |
| | | {{ item.status === "active" ? 'çæä¸' : 'å·²åºæ¢' }} |
| | | </u-tag> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">已读人æ°</text> |
| | | <text class="detail-value">{{ item.readCount || '-' }}</text> |
| | | </view> |
| | | <u-collapse border="false" |
| | | accordion |
| | | @open="(value) => handleOpen(value, index)"> |
| | | <u-collapse-item title="çæ¬åå²" |
| | | border="false" |
| | | :name="item.category"> |
| | | <view class="table-container"> |
| | | <u-table2 :data="item.tableData1" |
| | | :columns="columns" |
| | | stripe |
| | | border /> |
| | | </view> |
| | | </u-collapse-item> |
| | | <!-- <u-collapse-item title="é
è¯»ç¶æ" |
| | | border="false" |
| | | :name="item.id"> |
| | | <view class="table-container"> |
| | | <u-table2 :data="item.tableData2" |
| | | :columns="columns2" |
| | | stripe |
| | | border /> |
| | | </view> |
| | | </u-collapse-item> --> |
| | | </u-collapse> |
| | | </view> |
| | | <!-- æé®åºå --> |
| | | <view class="action-buttons"> |
| | | <u-button type="info" |
| | | size="small" |
| | | class="action-btn" |
| | | @click="viewDetail(item,3)"> |
| | | æ¥ç |
| | | </u-button> |
| | | <u-button type="error" |
| | | size="small" |
| | | class="action-btn" |
| | | @click="handleAbrogate(item)"> |
| | | åºå¼ |
| | | </u-button> |
| | | <u-button type="primary" |
| | | size="small" |
| | | class="action-btn" |
| | | @click="viewDetail(item,2)"> |
| | | ç¼è¾ |
| | | </u-button> |
| | | <u-button type="primary" |
| | | size="small" |
| | | class="action-btn" |
| | | @click="fileList(item)"> |
| | | éä»¶ |
| | | </u-button> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view v-else |
| | | class="no-data"> |
| | | <text>ææ ä¼è®®å®¤è®°å½</text> |
| | | </view> |
| | | <!-- æµ®å¨æ°å¢æé® --> |
| | | <view class="fab-button" |
| | | @click="addVisit"> |
| | | <up-icon name="plus" |
| | | size="24" |
| | | color="#ffffff"></up-icon> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, onMounted, computed } from "vue"; |
| | | import { onShow } from "@dcloudio/uni-app"; |
| | | import { useDict } from "@/utils/dict"; |
| | | import PageHeader from "@/components/PageHeader.vue"; |
| | | import { |
| | | listRuleManagement, |
| | | getReadingStatusList, |
| | | getReadingStatusByRuleId, |
| | | updateRuleManagement, |
| | | // delKnowledgeBase, |
| | | } from "@/api/managementMeetings/rulesRegulationsManagement"; |
| | | import useUserStore from "@/store/modules/user"; |
| | | // æ¿æ¢ toast æ¹æ³ |
| | | defineOptions({ name: "client-visit-index" }); |
| | | const showToast = message => { |
| | | uni.showToast({ |
| | | title: message, |
| | | icon: "none", |
| | | }); |
| | | }; |
| | | |
| | | import dayjs from "dayjs"; |
| | | |
| | | const userStore = useUserStore(); |
| | | // åºå¼è§ç« å¶åº¦ |
| | | const handleAbrogate = item => { |
| | | uni.showModal({ |
| | | title: "åºå¼ç¡®è®¤", |
| | | content: `ç¡®å®è¦åºå¼è¯¥è§ç« å¶åº¦åï¼`, |
| | | success: res => { |
| | | if (res.confirm) { |
| | | item.status = "repealed"; |
| | | updateRuleManagement(item).then(() => { |
| | | showToast("åºå¼æå"); |
| | | getList(); |
| | | }); |
| | | } |
| | | }, |
| | | }); |
| | | }; |
| | | // éä»¶å表 |
| | | const fileList = item => { |
| | | console.log(item.id, "item"); |
| | | uni.setStorageSync("rulesRegulationsManagement", item.id); |
| | | // // éä»¶å表跳转å°è¯¦æ
é¡µé¢ |
| | | uni.navigateTo({ |
| | | url: "/pages/managementMeetings/rulesRegulationsManagement/fileList", |
| | | }); |
| | | }; |
| | | const columns = ref([ |
| | | { title: "çæ¬å·", key: "version", width: 100 }, |
| | | { title: "æ´æ°æ¶é´", key: "updateTime", width: 200 }, |
| | | { title: "æ´æ°äºº", key: "createUserName", width: 150 }, |
| | | { title: "åæ´è¯´æ", key: "status", width: 100 }, |
| | | ]); |
| | | const columns2 = ref([ |
| | | { title: "åå·¥å§å", key: "employee", width: 150 }, |
| | | { title: "æå±é¨é¨", key: "department", width: 150 }, |
| | | { title: "é
读æ¶é´", key: "createTime", width: 200 }, |
| | | { title: "确认æ¶é´", key: "confirmTime", width: 200 }, |
| | | { title: "ç¶æ", key: "status", width: 100 }, |
| | | ]); |
| | | // æç´¢å
³é®è¯ |
| | | const name = ref(""); |
| | | |
| | | // æè®¿è®°å½æ°æ® |
| | | const visitList = ref([]); |
| | | |
| | | // è¿åä¸ä¸é¡µ |
| | | const goBack = () => { |
| | | uni.navigateBack(); |
| | | }; |
| | | const { knowledge_type } = useDict("knowledge_type"); |
| | | // æ ¼å¼å忬¾æ¹å¼ |
| | | const formatReceiptType = params => { |
| | | if (params == "hr") { |
| | | return "人äºå¶åº¦"; |
| | | } else if (params == "finance") { |
| | | return "è´¢å¡å¶åº¦"; |
| | | } else if (params == "safety") { |
| | | return "å®å
¨å¶åº¦"; |
| | | } else if (params == "tech") { |
| | | return "ææ¯å¶åº¦"; |
| | | } else { |
| | | return "æªç¥"; |
| | | } |
| | | }; |
| | | const getTagClass = type => { |
| | | if (type == "high") { |
| | | return "success"; |
| | | } else if (type == "medium") { |
| | | return "warning"; |
| | | } else if (type == "low") { |
| | | return "info"; |
| | | } else { |
| | | return "info"; |
| | | } |
| | | }; |
| | | const knowledgeTypeOptions = computed(() => knowledge_type?.value || []); |
| | | // è·åç¥è¯ç±»åæ ç¾ |
| | | const getKnowledgeTypeLabel = val => { |
| | | console.log(knowledgeTypeOptions, "knowledgeTypeOptions"); |
| | | const item = knowledgeTypeOptions.value.find( |
| | | i => String(i.value) === String(val) |
| | | ); |
| | | return item ? item.label : val; |
| | | }; |
| | | const handleOpen = (value, index) => { |
| | | if ( |
| | | value == "hr" || |
| | | value == "finance" || |
| | | value == "safety" || |
| | | value == "tech" |
| | | ) { |
| | | // åå²çæ¬ |
| | | const params = { |
| | | current: -1, |
| | | size: -1, |
| | | category: value, |
| | | }; |
| | | listRuleManagement(params) |
| | | .then(res => { |
| | | visitList.value[index].tableData1 = res.data.records; |
| | | visitList.value[index].tableData1.forEach(item => { |
| | | item.status = item.status == "active" ? "çæä¸" : "å·²åºæ¢"; |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | closeToast(); |
| | | showToast("è·åæ°æ®å¤±è´¥"); |
| | | }); |
| | | } else { |
| | | // é
è¯»ç¶æ |
| | | getReadingStatusByRuleId(value) |
| | | .then(res => { |
| | | visitList.value[index].tableData2 = res.data; |
| | | visitList.value[index].tableData2.forEach(item => { |
| | | item.status = item.status == "confirmed" ? "已确认" : "æªç¡®è®¤"; |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | closeToast(); |
| | | showToast("è·åæ°æ®å¤±è´¥"); |
| | | }); |
| | | } |
| | | }; |
| | | // æ¥è¯¢å表 |
| | | const getList = () => { |
| | | showLoadingToast("å è½½ä¸..."); |
| | | const params = { |
| | | current: -1, |
| | | size: -1, |
| | | title: name.value, |
| | | }; |
| | | listRuleManagement(params) |
| | | .then(res => { |
| | | visitList.value = res.data.records; |
| | | closeToast(); |
| | | }) |
| | | .catch(() => { |
| | | closeToast(); |
| | | showToast("è·åæ°æ®å¤±è´¥"); |
| | | }); |
| | | }; |
| | | |
| | | // æ¾ç¤ºå è½½æç¤º |
| | | const showLoadingToast = message => { |
| | | uni.showLoading({ |
| | | title: message, |
| | | mask: true, |
| | | }); |
| | | }; |
| | | |
| | | // å
³éæç¤º |
| | | const closeToast = () => { |
| | | uni.hideLoading(); |
| | | }; |
| | | |
| | | // æ°å¢æè®¿ - 跳转å°ç»è®°é¡µé¢ |
| | | const addVisit = () => { |
| | | uni.navigateTo({ |
| | | url: "/pages/managementMeetings/rulesRegulationsManagement/detail?detailType=1", |
| | | }); |
| | | }; |
| | | |
| | | // ç¼è¾ |
| | | const viewDetail = (item, detailType) => { |
| | | uni.setStorageSync("rulesRegulations", item); |
| | | uni.navigateTo({ |
| | | url: |
| | | "/pages/managementMeetings/rulesRegulationsManagement/detail?detailType=" + |
| | | detailType + |
| | | "&id=" + |
| | | item.id, |
| | | }); |
| | | }; |
| | | |
| | | // å é¤ç¡®è®¤ |
| | | const confirmDelete = item => { |
| | | uni.showModal({ |
| | | title: "å é¤ç¡®è®¤", |
| | | content: `ç¡®å®è¦å é¤ç¥è¯ "${item.title}" åï¼`, |
| | | success: res => { |
| | | if (res.confirm) { |
| | | deleteKnowledge(item.id); |
| | | } |
| | | }, |
| | | }); |
| | | }; |
| | | |
| | | // æ§è¡å é¤ |
| | | const deleteKnowledge = id => { |
| | | showLoadingToast("å é¤ä¸..."); |
| | | delKnowledgeBase([id]) |
| | | .then(res => { |
| | | closeToast(); |
| | | if (res.code === 200) { |
| | | showToast("å 餿å"); |
| | | getList(); // éæ°è·åå表 |
| | | } else { |
| | | showToast("å é¤å¤±è´¥"); |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | closeToast(); |
| | | showToast("å é¤å¤±è´¥"); |
| | | }); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |
| | | |
| | | onShow(() => { |
| | | getList(); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | @import "../../../styles/sales-common.scss"; |
| | | |
| | | // 页é¢ç¹å®çæ ·å¼è¦ç |
| | | .sales-accoun { |
| | | min-height: 100vh; |
| | | background: #f8f9fa; |
| | | position: relative; |
| | | padding-bottom: 80px; |
| | | } |
| | | |
| | | // ç¹å®ç徿 æ ·å¼ |
| | | .document-icon { |
| | | background: #667eea; // ä¿æé¡µé¢ç¹æçèæ¯è² |
| | | } |
| | | |
| | | // ç¹ææ ·å¼ |
| | | .visit-status { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .detail-value { |
| | | word-break: break-all; // ä¿ç页é¢ç¹æçææ¬æ¢è¡æ ·å¼ |
| | | color: #333; // ä¿æé¡µé¢ç¹æçææ¬é¢è² |
| | | } |
| | | |
| | | // ç¶ææ ·å¼ |
| | | .status-enabled { |
| | | color: #28a745; // ä¿æé¡µé¢ç¹æçæåé¢è² |
| | | } |
| | | |
| | | .status-disabled { |
| | | color: #dc3545; // ä¿æé¡µé¢ç¹æçé误é¢è² |
| | | } |
| | | |
| | | // ç¹å®çæµ®å¨æé®æ ·å¼ |
| | | .fab-button { |
| | | background: #667eea; // ä¿æé¡µé¢ç¹æçèæ¯è² |
| | | box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3); // ä¿æé¡µé¢ç¹æçé´å½±ææ |
| | | } |
| | | |
| | | // è¡¨æ ¼å®¹å¨ï¼å®ç°æ¨ªåæ»å¨ |
| | | .table-container { |
| | | overflow-x: auto; |
| | | margin: 0 -20rpx; |
| | | padding: 0 20rpx; |
| | | } |
| | | |
| | | .table-container::-webkit-scrollbar { |
| | | height: 6rpx; |
| | | } |
| | | |
| | | .table-container::-webkit-scrollbar-track { |
| | | background: #f1f1f1; |
| | | border-radius: 3rpx; |
| | | } |
| | | |
| | | .table-container::-webkit-scrollbar-thumb { |
| | | background: #c1c1c1; |
| | | border-radius: 3rpx; |
| | | } |
| | | |
| | | .table-container::-webkit-scrollbar-thumb:hover { |
| | | background: #a8a8a8; |
| | | } |
| | | // .u-table2 { |
| | | // width: 500px; |
| | | // } |
| | | </style> |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | import axios from 'axios'; |
| | | import adapter from 'axios-adapter-uniapp'; |
| | | import config from '@/config'; |
| | | |
| | | const service = axios.create({ |
| | | baseURL: config.baseUrl, // æ¿æ¢ä¸ºå®é
å端å°å |
| | | timeout: 10000, |
| | | adapter: adapter // æ ¸å¿éé
å¨é
ç½® |
| | | }); |
| | | |
| | | // è¯·æ±æ¦æªå¨ |
| | | service.interceptors.request.use( |
| | | config => { |
| | | const token = uni.getStorageSync('token'); |
| | | if (token) { |
| | | config.headers.Authorization = `Bearer ${token}`; |
| | | } |
| | | return config; |
| | | }, |
| | | error => Promise.reject(error) |
| | | ); |
| | | |
| | | // ååºæ¦æªå¨ |
| | | service.interceptors.response.use( |
| | | response => { |
| | | const res = response.data; |
| | | if (res.code !== 200) { |
| | | uni.showToast({ title: res.message, icon: 'none' }); |
| | | return Promise.reject(res); |
| | | } |
| | | return res; |
| | | }, |
| | | error => { |
| | | uni.showToast({ title: 'ç½ç»é误', icon: 'none' }); |
| | | return Promise.reject(error); |
| | | } |
| | | ); |
| | | |
| | | export default service; |