From 54b5fa2047324b81b6d2ee7f830693267f946c0a Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期三, 10 一月 2024 17:45:54 +0800 Subject: [PATCH] 1. 编写数据源检查模块 --- src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue | 68 ++++++++++++++++++---- src/api/index.js | 2 src/views/fysp/evaluation/components/precheck/components/CompCheckArea.vue | 25 ++++++- src/components.d.ts | 2 src/views/fysp/evaluation/components/CompQuickSet.vue | 12 ++-- src/api/fysp/problemApi.js | 7 ++ src/api/fysp/userMapApi.js | 10 +++ src/api/fytz/complaintApi.js | 20 ++++++ 8 files changed, 118 insertions(+), 28 deletions(-) diff --git a/src/api/fysp/problemApi.js b/src/api/fysp/problemApi.js index 5bb2b72..b543b7e 100644 --- a/src/api/fysp/problemApi.js +++ b/src/api/fysp/problemApi.js @@ -5,11 +5,16 @@ export default { /** - * 鑾峰彇瀛愪换鍔$粺璁′俊鎭� + * 闂瀹℃牳 * @param {Number} action 0锛氶棶棰橀�氳繃锛�1锛氶棶棰樹笉閫氳繃锛�2锛氭暣鏀归�氳繃锛�3鏁存敼涓嶉�氳繃 */ checkProblem({ pId, action, remark = '', userId = id, userName = name }) { const params = `?pId=${pId}&action=${action}&remark=${remark}&userId=${userId}&userName=${userName}`; return $fysp.post(`problemlist/check${params}`).then((res) => res.data); }, + + fetchProblemType({ cityCode, districtCode, sceneTypeId }) { + const params = `?taskTypeId=1&cityCode=${cityCode}&districtCode=${districtCode}&sceneTypeId=${sceneTypeId}`; + return $fysp.get(`problemtype/search${params}`).then((res) => res.data); + } }; diff --git a/src/api/fysp/userMapApi.js b/src/api/fysp/userMapApi.js new file mode 100644 index 0000000..57d107a --- /dev/null +++ b/src/api/fysp/userMapApi.js @@ -0,0 +1,10 @@ +import { $fysp } from '../index'; + +export default { + /** + * 鑾峰彇鍖哄煙鐢ㄦ埛鐨勭洃娴嬭澶囧拰椋炵窘鐩戠绯荤粺銆侀缇界幆澧冪郴缁熺殑鍖归厤璁板綍 + */ + fetchDeviceMap(param) { + return $fysp.post(`usermap/device`, param).then((res) => res.data); + } +}; diff --git a/src/api/fytz/complaintApi.js b/src/api/fytz/complaintApi.js new file mode 100644 index 0000000..d14a4e7 --- /dev/null +++ b/src/api/fytz/complaintApi.js @@ -0,0 +1,20 @@ +import { $fytz } from '../index'; + +/** + * 淇¤鎶曡瘔鍙婅鏀垮缃氱浉鍏矨PI鎺ュ彛 + */ +export default { + /** + * 鑾峰彇淇¤鎶曡瘔淇℃伅 + */ + fetchComplaints(param) { + return $fytz.post(`complaint/find`, param).then((res) => res.data); + }, + + /** + * 鑾峰彇琛屾斂澶勭綒淇℃伅 + */ + fetchPunishment(param) { + return $fytz.post(`punishment/find`, param).then((res) => res.data); + } +}; diff --git a/src/api/index.js b/src/api/index.js index 27fb8ac..4140d17 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -15,8 +15,6 @@ // ip2_file = 'https://fyami.com.cn/'; } -// const ip2 = 'http://192.168.0.123:8080/'; - //椋炵窘鐩戠 const $fysp = axios.create({ baseURL: ip1, diff --git a/src/components.d.ts b/src/components.d.ts index 4a308bb..50e6853 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -46,6 +46,8 @@ ElPageHeader: typeof import('element-plus/es')['ElPageHeader'] ElPagination: typeof import('element-plus/es')['ElPagination'] ElPopover: typeof import('element-plus/es')['ElPopover'] + ElRadioButton: typeof import('element-plus/es')['ElRadioButton'] + ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup'] ElRow: typeof import('element-plus/es')['ElRow'] ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] ElSelect: typeof import('element-plus/es')['ElSelect'] diff --git a/src/views/fysp/evaluation/components/CompQuickSet.vue b/src/views/fysp/evaluation/components/CompQuickSet.vue index 2cd420b..4e91557 100644 --- a/src/views/fysp/evaluation/components/CompQuickSet.vue +++ b/src/views/fysp/evaluation/components/CompQuickSet.vue @@ -33,7 +33,7 @@ dName: '闈欏畨鍖�', }, scenetype: { label: '宸ュ湴', value: '1' }, - sourcetype: false, + sourceType: 2, }, { name: '寰愭眹椁愰ギ', @@ -46,7 +46,7 @@ dName: '寰愭眹鍖�' }, scenetype: { label: '椁愰ギ', value: '5' }, - sourcetype: false, + sourceType: 2, }, { name: '閲戝北宸ュ湴', @@ -59,7 +59,7 @@ dName: '閲戝北鍖�' }, scenetype: { label: '宸ュ湴', value: '1' }, - sourcetype: false, + sourceType: 2, }, { name: '閲戝北鐮佸ご', @@ -72,7 +72,7 @@ dName: '閲戝北鍖�' }, scenetype: { label: '鐮佸ご', value: '2' }, - sourcetype: false, + sourceType: 2, }, { name: '閲戝北鎼呮媽绔�', @@ -85,7 +85,7 @@ dName: '閲戝北鍖�' }, scenetype: { label: '鎼呮媽绔�', value: '3' }, - sourcetype: false, + sourceType: 2, }, { name: '寰愭眹姹戒慨', @@ -98,7 +98,7 @@ dName: '寰愭眹鍖�' }, scenetype: { label: '姹戒慨', value: '7' }, - sourcetype: true, + sourceType: 1, } ] } diff --git a/src/views/fysp/evaluation/components/precheck/components/CompCheckArea.vue b/src/views/fysp/evaluation/components/precheck/components/CompCheckArea.vue index 3aea097..457a050 100644 --- a/src/views/fysp/evaluation/components/precheck/components/CompCheckArea.vue +++ b/src/views/fysp/evaluation/components/precheck/components/CompCheckArea.vue @@ -21,7 +21,7 @@ :allOption="false" :initValue="false" :sourceInit="sceneOptionSourceInit" - :type="formObj.sourcetype ? 1 : 2" + :type="formObj.sourceType" v-model:value="formObj._scenetype" ></FYOptionScene> <!-- 鏃堕棿 --> @@ -31,9 +31,17 @@ type="month" v-model:value="formObj.time" ></FYOptionTime> - <el-form-item label="涓绘暟鎹簮" prop="sourcetype"> - <el-switch v-model="formObj.sourcetype" @change="sceneOptionSourceInit = true" /> - <span class="m-l-16">{{ formObj.sourcetype ? '瀹堟硶鏈嶅姟璁板綍' : '鐜板満宸℃煡璁板綍' }}</span> + <el-form-item label="涓绘暟鎹簮" prop="sourceType"> + <!-- <el-switch v-model="formObj.sourceType" @change="sceneOptionSourceInit = true" /> --> + <el-radio-group + v-model="formObj.sourceType" + size="small" + @change="sceneOptionSourceInit = true" + > + <el-radio-button label="1">瀹堟硶鏈嶅姟璁板綍</el-radio-button> + <el-radio-button label="2">鐜板満宸℃煡璁板綍</el-radio-button> + </el-radio-group> + <!-- <span class="m-l-16">{{ formObj.sourceType ? '瀹堟硶鏈嶅姟璁板綍' : '鐜板満宸℃煡璁板綍' }}</span> --> <el-tooltip placement="bottom-start" effect="light"> <template #content> <!-- <el-text tag="b" size="default">璇存槑</el-text><br /> --> @@ -92,6 +100,13 @@ message: '鏃堕棿涓嶈兘涓虹┖', trigger: 'change' } + ], + sourceType: [ + { + required: true, + message: '涓绘暟鎹簮蹇呴』閫夋嫨', + trigger: 'change' + } ] }, // 褰撳満鏅�夐」鍒囨崲鏁版嵁婧愭椂锛屾槸鍚︽竻绌哄綋鍓嶉�夐」鍊� @@ -103,7 +118,7 @@ this.sceneOptionSourceInit = false; this.$refs.formRef.formObj._locations = param.locations; this.$refs.formRef.formObj._scenetype = param.scenetype; - this.$refs.formRef.formObj.sourcetype = param.sourcetype; + this.$refs.formRef.formObj.sourceType = param.sourceType; }, submit() { this.$refs.formRef.onSubmit(false); diff --git a/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue b/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue index 9217bc3..3456d9c 100644 --- a/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue +++ b/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue @@ -62,6 +62,9 @@ <script> import evaluateApi from '@/api/fysp/evaluateApi'; import taskApi from '@/api/fysp/taskApi'; +import userMapApi from '@/api/fysp/userMapApi'; +import problemApi from '@/api/fysp/problemApi'; +import complaintApi from '@/api/fytz/complaintApi'; /** * 鐢熸垚涓�椤规暟鎹簮妫�鏌ヨ褰� @@ -98,21 +101,17 @@ emits: ['update:modelValue'], data() { return { - areaInfo: { - _locations: '', - _scenetype: '', - time: '', - sourcetype: '' - }, + areaInfo: {}, // 鏁版嵁婧愭鏌ヨ褰� checkResults: [ + // 鍖哄煙鑼冨洿鍐呯殑鑷姩璇勪及瑙勫垯琛ㄦ槸鍚﹀瓨鍦� baseCheckItem( '鑷姩璇勪及瑙勫垯琛�', '', () => { const param = { taskTypeId: 99, - scensetypeid: this.areaInfo._scenetype.value + ...this.areaInfo }; return evaluateApi.fetchEvaluationRule(param).then((res) => { return res.data.length > 0; @@ -120,12 +119,39 @@ }, true ), - baseCheckItem('鐜板満鐩戠宸℃煡鎬讳换鍔�', '', () => {}), + // 鍖哄煙鑼冨洿鍐呯殑鐩戠浠诲姟鏄惁瀛樺湪 + baseCheckItem('鐜板満鐩戠宸℃煡鎬讳换鍔�', '', () => { + return taskApi.fetchTopTasks(this.areaInfo).then((res) => { + return res.data.length > 0; + }); + }), + // 鍖哄煙鑼冨洿鍐呯殑鐩戞祴鏁版嵁鏄惁瀛樺湪銆佹暟鎹椂闂磋法搴︽槸鍚﹀畬鏁淬�佹暟鎹殑鍒濇鍒嗘瀽鏄惁瀹屾垚 baseCheckItem('鐜板満鐩戞祴鏁版嵁', '', () => {}), - baseCheckItem('鐩戠鐐逛綅涓庣洃娴嬬偣鍖归厤', '', () => {}), - baseCheckItem('鐜板満鐩戠闂绫诲瀷', '', () => {}), - baseCheckItem('淇¤鎶曡瘔', '', () => {}), - baseCheckItem('琛屾斂澶勭綒', '', () => {}) + // 鍖哄煙鑼冨洿鍐呯殑姣忎釜鐩戠鐐逛綅涓庣洃娴嬩华鍣ㄧ殑鍖归厤璁板綍鏄惁瀛樺湪锛岀己澶辨儏鍐电瓑 + baseCheckItem('鐩戠鐐逛綅涓庣洃娴嬬偣鍖归厤', '', () => { + userMapApi.fetchDeviceMap(this.areaInfo).then((res) => { + return res.data.length > 0; + }); + }), + // 鍖哄煙鑼冨洿鍐呯殑鐩戠闂閰嶇疆琛ㄦ槸鍚﹀瓨鍦� + baseCheckItem('鐜板満鐩戠闂绫诲瀷', '', () => { + const param = { + cityCode: this.areaInfo.citycode, + districtCode: this.areaInfo.districtcode, + sceneTypeId: this.areaInfo.scensetypeid + } + problemApi.fetchProblemType(param).then((res) => { + return res.length > 0; + }); + }), + // 鍖哄煙鑼冨洿鍐呯殑淇¤鎶曡瘔璁板綍鏄惁瀛樺湪锛屽彲闅忔椂琛ュ厖 + baseCheckItem('淇¤鎶曡瘔', '', () => { + complaintApi.fetchComplaints(); + }), + // 鍖哄煙鑼冨洿鍐呯殑琛屾斂澶勭綒璁板綍鏄惁瀛樺湪锛屽彲闅忔椂琛ュ厖 + baseCheckItem('琛屾斂澶勭綒', '', () => { + complaintApi.fetchPunishment(); + }) ] }; }, @@ -162,8 +188,22 @@ } }, // 寮�濮嬫鏌ヤ换鍔� - startCheck(v) { - this.areaInfo = v; + startCheck(value) { + const v = value.value + this.areaInfo = { + provincecode: v._locations.pCode, + provincename: v._locations.pName, + citycode: v._locations.cCode, + cityname: v._locations.cName, + districtcode: v._locations.dCode, + districtname: v._locations.dName, + towncode: v._locations.tCode, + townname: v._locations.tName, + starttime: v.time, + scensetypeid: v._scenetype.value, + online: true, + sourceType: v.sourceType, + }; this.checkResults.forEach((e) => { e.fetch(); }); -- Gitblit v1.9.3