| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108 |
- <template>
- <uni-navbar-lite :showLeft="true" title="工单自评">
- <view class="back-icon" slot="left" @click="goBack">
- <text class="iconfont icon-back">{{ orderType == '1' ? '维修工单自评' : '维保工单自评' }}</text>
- </view>
- </uni-navbar-lite>
-
- <scroll-view class="container" :scroll-y="true">
- <view class="header">
- <text class="title"></text>
- </view>
-
- <view class="form">
- <!-- 工单基本信息 -->
- <view class="info-card">
- <view class="info-item">
- <text class="info-label">工单编码</text>
- <text class="info-value">{{ selfEvaluationForm.workOrderProjectNo }}</text>
- </view>
- <view class="info-item">
- <text class="info-label">风机编号</text>
- <text class="info-value">{{ selfEvaluationForm.pcsDeviceName }}</text>
- </view>
- <view class="info-item">
- <text class="info-label">场站</text>
- <text class="info-value">{{ selfEvaluationForm.pcsStationName }}</text>
- </view>
- </view>
- <!-- 工单类型相关字段 -->
- <view v-if="selfEvaluationForm.orderType == '1'" class="info-card">
- <view class="form-item">
- <text class="label">检修类型<text style="color: red;">*</text></text>
- <view class="form-picker" @click="showMaintenanceTypePicker = true">
- <view class="picker-display">
- <text v-if="selfEvaluationForm.maintenanceType" class="selected-value">{{ getMaintenanceTypeLabel(selfEvaluationForm.maintenanceType) }}</text>
- <text v-else class="placeholder">请选择检修类型</text>
- <text class="arrow">▼</text>
- </view>
- </view>
- </view>
- </view>
- <!-- 自定义选择器弹窗 -->
- <view v-if="showMaintenanceTypePicker" class="picker-modal">
- <view class="modal-mask" @click="showMaintenanceTypePicker = false"></view>
- <view class="modal-content">
- <view class="modal-header">
- <text class="modal-title">检修类型</text>
- <text class="modal-close" @click="showMaintenanceTypePicker = false">取消</text>
- </view>
- <scroll-view class="modal-body" scroll-y="true">
- <view
- v-for="(option, index) in maintenanceTypeOptions"
- :key="index"
- class="picker-option"
- :class="{ 'selected': index == selectedMaintenanceTypeIndex }"
- @click="selectMaintenanceType(index)"
- >
- <text class="option-text">{{ option.label }}</text>
- <text v-if="index == selectedMaintenanceTypeIndex" class="option-check">✓</text>
- </view>
- </scroll-view>
- </view>
- </view>
- <view v-if="selfEvaluationForm.orderType == '2'" class="info-card">
- <view class="info-item">
- <text class="info-label">维保类型</text>
-
- <text v-for="(type, index) in selfEvaluationForm.inspectionType" :key="index">
- {{ getInspectionTypeLabel(type) }}
- </text>
- </view>
- <view class="info-item">
- <text class="info-label">分项完成系数<text style="color: red;">*</text></text>
- <input
- class="info-input"
- type="digit"
- :value="getItemCompletionFactorDisplayValue()"
- @input="onItemCompletionFactorInput"
- @blur="formatItemCompletionFactor()"
- placeholder="请输入分项完成系数"
- />
- </view>
- <view class="info-item">
- <text class="info-label">分项完成系数和<text style="color: red;">*</text></text>
- <input
- class="info-input"
- type="digit"
- :value="getItemCompletionFactorSumDisplayValue()"
- @input="onItemCompletionFactorSumInput"
- @blur="formatItemCompletionFactorSum()"
- placeholder="请输入分项完成系数和"
- />
- </view>
- </view>
- <!-- 总结内容 -->
- <view class="info-card">
- <view class="form-item">
- <text class="label">{{ selfEvaluationForm.orderType == '1' ? '维修总结' : '维保总结' }}<text style="color: red;">*</text></text>
- <textarea
- class="textarea"
- :value="selfEvaluationForm.workSummary"
- @input="onWorkSummaryInput"
- placeholder="请输入总结内容"
- :maxlength="200"
- />
- </view>
-
- <!-- 额外工作总结 - 仅维修工单显示 -->
- <view v-if="selfEvaluationForm.orderType == '1'" class="form-item">
- <text class="label">额外工作总结</text>
- <textarea
- class="textarea"
- :value="selfEvaluationForm.extraWork"
- @input="onExtraWorkInput"
- @blur="onExtraWorkChange"
- placeholder="请输入额外工作总结"
- :maxlength="200"
- />
- </view>
- </view>
- <!-- 人员信息和得分明细 -->
- <!-- <view class="info-card">
- <view class="form-item">
- <text class="label">外委人员数(人)</text>
- <text class="value">{{ selfEvaluationForm.wwryNum }}</text>
- </view>
- <view class="form-item">
- <text class="label">外来人员数(人)</text>
- <text class="value">{{ selfEvaluationForm.wlryNum }}</text>
- </view>
- </view> -->
- <!-- 得分明细 -->
- <view class="info-card">
- <view class="form-item">
- <text class="label">得分明细 ({{ isMixedZeroNonZeroInspectionTypes() ? '最少可评总分: ' : '可自评总分: ' }}{{ getSelfEvaluationTotalScore() == 0 ? '未规定' : (getSelfEvaluationTotalScore() != null ? getSelfEvaluationTotalScore().toFixed(2) : '0.00') + '分' }}, 已自评总分: {{ selfEvaluatedTotalScore != null ? selfEvaluatedTotalScore.toFixed(2) : '0.00' }}分)</text>
- </view>
- <view v-for="(person, index) in selfEvaluationForm.scorePersonList as UTSJSONObject[]" :key="index" class="person-score-item">
- <view class="person-info">
- <text class="person-name">{{ (person as UTSJSONObject).get('nickName') }}<text v-if="(person as UTSJSONObject).get('isLeader') == 1"> (工作负责人)</text></text>
- </view>
- <view class="score-inputs">
- <view class="score-item">
- <text class="score-label">检修工分<text style="color: red;">*</text></text>
- <input
- class="score-input"
- type="digit"
- :value="getPersonScore(person, 'selfScore')"
- @input="onScoreInput($event, index, 'selfScore')"
- @blur="formatScoreInput(index, 'selfScore');onScoreChange"
- placeholder="0.00"
- />
- </view>
- <!-- 额外工分 - 仅当维修工单且有额外工作总结时显示 -->
- <view v-if="selfEvaluationForm.orderType == '1' && hasExtraWorkFlag" class="score-item">
- <text class="score-label">额外工分</text>
- <input
- class="score-input"
- type="digit"
- :value="getPersonScore(person, 'extraScore')"
- @input="onScoreInput($event, index, 'extraScore')"
- @blur="formatScoreInput(index, 'extraScore');onScoreChange"
- placeholder="0.00"
- />
- </view>
- <!-- 工单得分 - 仅当维修工单且有额外工作总结时显示 -->
- <view v-if="selfEvaluationForm.orderType == '1' && hasExtraWorkFlag" class="score-item">
- <text class="score-label">工单得分</text>
- <input
- class="score-input"
- type="digit"
- :value="getPersonScore(person, 'totalScore')"
- readonly
- disabled
- placeholder="自动计算"
- style="pointer-events: none;"
- />
- </view>
- <!-- 额外工分和工单得分 - 仅当维保工单且维保类型包含其他/其它时显示 -->
- <view v-if="selfEvaluationForm.orderType == '2' && hasOtherOrQitaInspectionType()" class="score-item">
- <text class="score-label">额外工分</text>
- <input
- class="score-input"
- type="digit"
- :value="getPersonScore(person, 'extraScore')"
- @input="onScoreInput($event, index, 'extraScore')"
- @blur="formatScoreInput(index, 'extraScore');onScoreChange"
- placeholder="0.00"
- />
- </view>
- <view v-if="selfEvaluationForm.orderType == '2' && hasOtherOrQitaInspectionType()" class="score-item">
- <text class="score-label">工单得分</text>
- <input
- class="score-input"
- type="digit"
- :value="getPersonScore(person, 'totalScore')"
- readonly
- disabled
- placeholder="自动计算"
- style="pointer-events: none;"
- />
- </view>
- </view>
- </view>
- </view>
-
- <!-- 提交按钮 -->
- <view class="submit-btn" @click="submitSelfEvaluationForm">
- <text class="submit-text">提交自评</text>
- </view>
- </view>
- </scroll-view>
- </template>
- <script setup lang="uts">
- import { ref, onMounted, onLoad, onUnload } from 'vue'
- import { getOrderScoreDetail, submitSelfEvaluation, getMaintenanceTypes, listInspectionTypesByFanType } from '@/api/score/index'
- import { getDictDataByType } from '@/api/dict/index'
- import type { UserInfo } from '@/types/user'
- import type { SysDictData } from '@/types/dict'
- /* // 定义事件类型
- // 定义事件类型
- interface InputEvent {
- detail: any
- target: any
- } */
- // 页面参数
- const id = ref<string>('')
- const orderType = ref<string>('')
- const showMaintenanceTypePicker = ref<boolean>(false)
- // 添加额外工作总结状态变量
- const hasExtraWorkFlag = ref<boolean>(false)
- // 验证规则 - 使用UTS兼容的简单对象定义
- const validationRules: any = {
- workSummary: [
- { required: true, message: "总结不能为空", trigger: "blur" }
- ],
- maintenanceType: [
- { required: true, message: "请选择检修类型", trigger: "change" }
- ],
- inspectionType: [
- { required: true, message: "请选择维保类型", trigger: "change" }
- ],
- itemCompletionFactor: [
- { required: true, message: "分项完成系数不能为空", trigger: "change" }
- ],
- itemCompletionFactorSum: [
- { required: true, message: "分项完成系数和不能为空", trigger: "change" }
- ]
- }
- // 自评表单数据
- type SelfEvaluationFormData = {
- orderType: string
- id: number
- workOrderProjectNo: string
- pcsDeviceName: string
- pcsStationName: string
- model: string | null // 风机型号,用于获取维保类型选项
- workSummary: string
- extraWork: string
- maintenanceType: string | null
- inspectionType: string[]
- itemCompletionFactor: number | null
- itemCompletionFactorSum: number | null
- scorePersonList: UTSJSONObject[]
- wwryNum: number
- wlryNum: number
- }
- // 用于input绑定的字符串中转
- let itemCompletionFactorStr = ref<string>('')
- let itemCompletionFactorSumStr = ref<string>('')
- // 临时存储分项完成系数的原始输入值
- const tempItemCompletionFactorInput = ref<string>('')
- const tempItemCompletionFactorSumInput = ref<string>('')
- // 添加响应式变量来跟踪已自评总分
- let selfEvaluatedTotalScore = ref<number>(0)
- const selfEvaluationForm = ref<SelfEvaluationFormData>({
- orderType: '',
- id: 0,
- workOrderProjectNo: '',
- pcsDeviceName: '',
- pcsStationName: '',
- model: null as string | null,
- workSummary: '',
- extraWork: '',
- maintenanceType: '',
- inspectionType: [],
- itemCompletionFactor: null,
- itemCompletionFactorSum: null,
- scorePersonList: [],
- wwryNum: 0,
- wlryNum: 0
- })
- type MaintenanceTypeOption = {
- value: string
- label: string
- }
- // 检修类型选项
- const maintenanceTypeOptions = ref<MaintenanceTypeOption[]>([])
- const selectedMaintenanceTypeIndex = ref<number>(-1)
- // 维保类型选项
- const inspectionTypeOptions = ref<UTSJSONObject[]>([])
- // 维保类型字典
- const inspectionTypeDictList = ref<SysDictData[]>([])
- // 获取已自评总分
- function getSelfEvaluatedTotalScore(): number {
- const scorePersonList = selfEvaluationForm.value.scorePersonList as UTSJSONObject[]
- if (scorePersonList == null || scorePersonList.length == 0) {
- return 0
- }
-
- let totalSelfScore = 0
-
- for (let i = 0; i < scorePersonList.length; i++) {
- const person = scorePersonList[i]
- const selfScoreVal = person.get('selfScore')
- if (selfScoreVal != null) {
- // 统一处理分数值,无论是number还是string类型
- const scoreValue = typeof selfScoreVal == 'number' ? selfScoreVal : (selfScoreVal != '' ? parseFloat(selfScoreVal as string) : 0);
- if (!isNaN(scoreValue) && scoreValue != 0) {
- totalSelfScore += scoreValue;
- }
- }
- }
- return totalSelfScore
- }
- // 更新已自评总分的响应式变量
- function updateSelfEvaluatedTotalScore(): void {
- selfEvaluatedTotalScore.value = getSelfEvaluatedTotalScore()
- }
- // 更新总分
- function updateTotalScores(): void {
- const scorePersonList = selfEvaluationForm.value.scorePersonList as UTSJSONObject[]
- if (scorePersonList == null || scorePersonList.length == 0) return
- for (let i = 0; i < scorePersonList.length; i++) {
- const person = scorePersonList[i]
- const selfScoreVal = person.get('selfScore')
- const extraScoreVal = person.get('extraScore')
- // 根据工单类型和条件决定是否计算总分
- // 检查当前工单类型并获取对应条件
- const isMaintenanceOrderWithExtraWork = selfEvaluationForm.value.orderType == '1' && hasExtraWorkFlag.value;
- const isMaintenanceOrderType = selfEvaluationForm.value.orderType == '2';
- // 手动实现hasOtherOrQitaInspectionType函数的逻辑
- let hasOtherOrQitaType = false;
- if (isMaintenanceOrderType) {
- if (selfEvaluationForm.value.orderType != '2') {
- hasOtherOrQitaType = false;
- } else if (!Array.isArray(selfEvaluationForm.value.inspectionType)) {
- hasOtherOrQitaType = false;
- } else {
- for (let i = 0; i < selfEvaluationForm.value.inspectionType.length; i++) {
- const typeId = selfEvaluationForm.value.inspectionType[i];
- // 内联getInspectionTypeLabel函数的逻辑
- let label = '';
- if (typeId == '') {
- label = '';
- } else {
- const list = inspectionTypeDictList.value;
- for (let j = 0; j < list.length; j++) {
- const item = list[j];
- if (item.dictValue == typeId) {
- label = (item.dictLabel != null ? item.dictLabel : typeId) as string;
- break;
- }
- }
- }
- if (label == '其他' || label == '其它') {
- hasOtherOrQitaType = true;
- break;
- }
- }
- }
- }
- if (isMaintenanceOrderWithExtraWork) {
- // 维修工单且有额外工作总结时,总分 = 自评分 + 额外工分
- if (selfScoreVal != null && extraScoreVal != null) {
- const selfScore = typeof selfScoreVal == 'number' ? selfScoreVal : (selfScoreVal != '' ? parseFloat(selfScoreVal as string) : 0)
- const extraScore = typeof extraScoreVal == 'number' ? extraScoreVal : (extraScoreVal != '' ? parseFloat(extraScoreVal as string) : 0)
- person.set('totalScore', (selfScore + extraScore).toFixed(2))
- } else if (selfScoreVal != null) {
- // 如果只有自评分,没有额外工分
- const selfScore = typeof selfScoreVal == 'number' ? selfScoreVal : (selfScoreVal != '' ? parseFloat(selfScoreVal as string) : 0)
- person.set('totalScore', selfScore.toFixed(2))
- }
- } else if (isMaintenanceOrderType && hasOtherOrQitaType) {
- // 维保工单且维保类型包含其他/其它时,总分 = 自评分 + 额外工分
- if (selfScoreVal != null && extraScoreVal != null) {
- const selfScore = typeof selfScoreVal == 'number' ? selfScoreVal : (selfScoreVal != '' ? parseFloat(selfScoreVal as string) : 0)
- const extraScore = typeof extraScoreVal == 'number' ? extraScoreVal : (extraScoreVal != '' ? parseFloat(extraScoreVal as string) : 0)
- person.set('totalScore', (selfScore + extraScore).toFixed(2))
- } else if (selfScoreVal != null) {
- // 如果只有自评分,没有额外工分
- const selfScore = typeof selfScoreVal == 'number' ? selfScoreVal : (selfScoreVal != '' ? parseFloat(selfScoreVal as string) : 0)
- person.set('totalScore', selfScore.toFixed(2))
- }
- } else {
- // 其他情况只显示自评分
- if (selfScoreVal != null) {
- const selfScore = typeof selfScoreVal == 'number' ? selfScoreVal : (selfScoreVal != '' ? parseFloat(selfScoreVal as string) : 0)
- if (!isNaN(selfScore)) {
- person.set('totalScore', selfScore.toFixed(2))
- }
- } else {
- person.set('totalScore', 0)
- }
- }
- }
- // 同步分项完成系数和显示
- itemCompletionFactorStr.value = selfEvaluationForm.value.itemCompletionFactor != null ? selfEvaluationForm.value.itemCompletionFactor.toFixed(2) : ''
- itemCompletionFactorSumStr.value = selfEvaluationForm.value.itemCompletionFactorSum != null ? selfEvaluationForm.value.itemCompletionFactorSum.toFixed(2) : ''
-
- // 更新已自评总分显示
- updateSelfEvaluatedTotalScore()
- }
- // 计算得分 - 实际上在自评中,这是手动输入的,不需要自动计算
- function calculateScores(): void {
- // 在自评阶段,分数是手动输入的,不需要自动计算
- // 但我们需要根据工单类型和配置来验证总分是否符合规则
- updateTotalScores()
-
- // 更新已自评总分显示
- updateSelfEvaluatedTotalScore()
- }
- // 根据值获取维保类型标签
- function getInspectionTypeLabel(value: string): string {
- if (value == '') return ''
- const list = inspectionTypeDictList.value
- for (let i = 0; i < list.length; i++) {
- const item = list[i]
- if (item.dictValue == value) {
- return (item.dictLabel != null ? item.dictLabel : value) as string
- }
- }
- return value
- }
- // 检查维保类型是否包含'其他'或'其它'选项
- function hasOtherOrQitaInspectionType(): boolean {
- if (selfEvaluationForm.value.orderType != '2') return false
- if (!Array.isArray(selfEvaluationForm.value.inspectionType)) return false
-
- for (let i = 0; i < selfEvaluationForm.value.inspectionType.length; i++) {
- const typeId = selfEvaluationForm.value.inspectionType[i]
- const label = getInspectionTypeLabel(typeId)
- if (label == '其他' || label == '其它') {
- return true
- }
- }
- return false
- }
- // 检查维保类型是否既有零分又有非零分的情况
- function isMixedZeroNonZeroInspectionTypes(): boolean {
- if (selfEvaluationForm.value.orderType != '2') return false
- if (!Array.isArray(selfEvaluationForm.value.inspectionType)) return false
- if (selfEvaluationForm.value.inspectionType.length <= 1) return false // 单选不会出现混合情况
-
- let hasZeroScore = false;
- let hasNonZeroScore = false;
-
- const selectedInspectionTypes: string[] = selfEvaluationForm.value.inspectionType;
-
- for (let i = 0; i < selectedInspectionTypes.length; i++) {
- const typeId = selectedInspectionTypes[i];
- for (let j = 0; j < inspectionTypeOptions.value.length; j++) {
- const selectedType = inspectionTypeOptions.value[j];
- // 使用inspectionTypeId进行匹配
- if (selectedType.get('inspectionTypeId').toString() == typeId) {
- // 从标签中提取分数
- const score = selectedType.get('score');
- if (score != null && typeof score == 'number') {
- if (score == 0) {
- hasZeroScore = true;
- } else if (score > 0) {
- hasNonZeroScore = true;
- }
- }
- }
- }
- }
-
- // 如果既有零分又有非零分,则返回true
- return hasZeroScore && hasNonZeroScore;
- }
- // 获取工单总分
- function getTotalScore(): number {
- let totalScore = 0;
-
- if (selfEvaluationForm.value.orderType == '1') {
- // 维修工单:根据检修类型获取总分
- for (let i = 0; i < maintenanceTypeOptions.value.length; i++) {
- const typeOption = maintenanceTypeOptions.value[i]
- if (typeOption.value == selfEvaluationForm.value.maintenanceType) {
- // 从标签中提取分数
- const regex = /\((\d+(\.\d+)?)分\)/
- const match = typeOption.label.match(regex)
- if (match != null && match.length > 1 && match[1] != null) {
- totalScore = parseFloat(match[1] as string);
- break;
- }
- }
- }
- } else if (selfEvaluationForm.value.orderType == '2') {
- // 维保工单:根据选中的维保类型和分项完成系数获取总分
- // 检查分项完成系数是否为null,如果是null则视为无效
- if (selfEvaluationForm.value.itemCompletionFactor == null) {
- return 0;
- }
-
- const completionFactor = selfEvaluationForm.value.itemCompletionFactor;
-
- // 获取选中的维保项目(现在是多选)
- const selectedInspectionTypes: string[] = selfEvaluationForm.value.inspectionType != null ? selfEvaluationForm.value.inspectionType : [];
-
- // 计算所有选中维保项目的总分值
- let totalScoreFromDB = 0; // 默认值
-
- if (Array.isArray(selectedInspectionTypes) && selectedInspectionTypes.length > 0) {
- for (let i = 0; i < selectedInspectionTypes.length; i++) {
- const typeId = selectedInspectionTypes[i];
- for (let j = 0; j < inspectionTypeOptions.value.length; j++) {
- const selectedType = inspectionTypeOptions.value[j];
- const inspectionTypeId = selectedType.get('inspectionTypeId');
- const score = selectedType.get('score');
- // 使用toString()方法确保类型一致进行匹配
- if ((inspectionTypeId as number).toString() == typeId) {
- if (score != null && typeof score == 'number') {
- totalScoreFromDB += score;
- }
- }
- }
- }
- }
-
- // 计算总分:总分 = 所有选中维保类型组合的总得分 * 分项完成系数
- totalScore = totalScoreFromDB * completionFactor;
- }
- return totalScore;
- }
- // 获取可自评总分
- function getSelfEvaluationTotalScore(): number {
- // 获取工单总分
- const totalScore = getTotalScore();
-
- // 如果总分为0,返回0
- if (totalScore == 0) {
-
- // 特殊处理:对于维保工单且多选维保类型的情况,如果存在零分和非零分的混合情况
- if (selfEvaluationForm.value.orderType == '2' && Array.isArray(selfEvaluationForm.value.inspectionType) && selfEvaluationForm.value.inspectionType.length > 1) {
- // 获取选中的维保类型
- const selectedInspectionTypes: string[] = selfEvaluationForm.value.inspectionType != null ? selfEvaluationForm.value.inspectionType : [];
- // 计算所有选中维保类型的非零分值
- let minScoreFromDB = 0; // 非零分值总和
- let hasZeroScore = false; // 是否存在零分
-
- if (Array.isArray(selectedInspectionTypes) && selectedInspectionTypes.length > 0) {
- for (let i = 0; i < selectedInspectionTypes.length; i++) {
- const typeId = selectedInspectionTypes[i];
- for (let j = 0; j < inspectionTypeOptions.value.length; j++) {
- const selectedType = inspectionTypeOptions.value[j];
- const inspectionTypeId = selectedType.get('inspectionTypeId');
- const score = selectedType.get('score');
- // 使用toString()方法确保类型一致进行匹配
- if ((inspectionTypeId as number).toString() == typeId) {
- if (score != null && typeof score == 'number') {
- if (score == 0) {
- hasZeroScore = true;
- } else if (score > 0) {
- minScoreFromDB += score;
- }
- }
- }
- }
- }
- }
-
- // 如果存在零分且存在非零分的情况,返回非零分的总和加上工作负责人的0.5分
- if (hasZeroScore && minScoreFromDB > 0) {
- const completionFactor = selfEvaluationForm.value.itemCompletionFactor != null ? selfEvaluationForm.value.itemCompletionFactor : 1;
- const result = (minScoreFromDB * completionFactor) + 0.5;
- return result;
- }
- }
- return 0;
- }
- // 检查是否存在工作负责人
- const scorePersonList = selfEvaluationForm.value.scorePersonList as UTSJSONObject[];
- for (let i = 0; i < scorePersonList.length; i++) {
- const person = scorePersonList[i];
- const isLeader = person.get('isLeader');
- if (isLeader != null && isLeader as number == 1) {
- // 如果存在工作负责人,可自评总分加0.5分
- const result = totalScore + 0.5;
- return result;
- }
- }
- return totalScore;
- }
- // 人员评分验证
- function validatePersonScore(score: string, fieldName: string): string | null {
- if (score == null || score == '') {
- if (fieldName == 'selfScore') {
- return '检修工分不能为空';
- }
- return null; // 额外工分可以为空
- }
-
- const numScore = parseFloat(score);
- if (isNaN(numScore)) {
- return `${fieldName == 'selfScore' ? '检修工分' : '额外工分'}必须为数字`;
- }
-
- if (numScore < 0) {
- return `${fieldName == 'selfScore' ? '检修工分' : '额外工分'}不能小于0`;
- }
-
- if (fieldName == 'selfScore' && numScore <= 0) {
- return '检修工分必须大于0';
- }
- return null;
- }
- // 字段验证函数
- function validateField(fieldName: string, value: any): string | null {
- console.log('验证字段:', fieldName, '值:', value, '类型:', typeof value);
- // 根据字段名称确定验证规则
- if (fieldName == 'workSummary') {
- // 验证工作/维保总结
- if (value == null || value == '') {
- const summaryType = selfEvaluationForm.value.orderType == '1' ? '维修' : '维保';
- return `${summaryType}总结不能为空`;
- }
- } else if (fieldName == 'maintenanceType') {
- // 验证检修类型
- if (value == null || value == '') {
- return "请选择检修类型";
- }
- } else if (fieldName == 'inspectionType') {
- // 验证维保类型
- if (value == null || (Array.isArray(value) && value.length == 0)) {
- return "请选择维保类型";
- }
- } else if (fieldName == 'itemCompletionFactor') {
- // 验证分项完成系数
- if (value == null || value == '') {
- return "分项完成系数不能为空";
- }
- // 验证数值范围
- let numValue: number;
- if (typeof value == 'string' && value != '') {
- numValue = parseFloat(value);
- } else if (typeof value == 'number') {
- numValue = value;
- } else {
- return "分项完成系数类型错误";
- }
-
- if (isNaN(numValue) || numValue < 0 || numValue > 1) {
- return '分项完成系数必须在0到1之间';
- }
- } else if (fieldName == 'itemCompletionFactorSum') {
- // 验证分项完成系数和
- if (value == null || value == '') {
- return "分项完成系数和不能为空";
- }
- // 验证数值范围
- let numValue: number;
- if (typeof value == 'string' && value != '') {
- numValue = parseFloat(value);
- } else if (typeof value == 'number') {
- numValue = value;
- } else {
- return "分项完成系数和类型错误";
- }
-
- if (isNaN(numValue) || numValue < 0 || numValue > 1) {
- return '分项完成系数和必须在0到1之间';
- }
- }
- return null;
- }
- // 验证评分规则
- function validateScoringRules(): any {
- // 获取工单总分
- const totalScore = getTotalScore()
- // 获取自评分总和
- const totalSelfScore = getSelfEvaluatedTotalScore()
- const scorePersonList = selfEvaluationForm.value.scorePersonList as UTSJSONObject[]
- if (scorePersonList == null || scorePersonList.length == 0) {
- const result = new UTSJSONObject();
- result.set('valid', true);
- result.set('message', '');
- return result;
- }
- // 检查每个人员的评分
- let hasEmptyScore = false;
- let leaderScore: number | null = null;
- for (let i = 0; i < scorePersonList.length; i++) {
- const person = scorePersonList[i];
- // 验证自评分
- const selfScore = person.get('selfScore');
- if (selfScore == null || selfScore == '' || (typeof selfScore == 'number' && isNaN(selfScore as number))) {
- hasEmptyScore = true;
- } else {
- const scoreStr = typeof selfScore == 'number' ? selfScore.toFixed(2) : selfScore as string;
- const validationError = validatePersonScore(scoreStr, 'selfScore');
- if (validationError != null) {
- const result = new UTSJSONObject();
- result.set('valid', false);
- result.set('message', `${person.get('nickName')}:${validationError}`);
- return result;
- }
- const score = typeof selfScore == 'number' ? selfScore : parseFloat(selfScore as string);
- if (person.get('isLeader') != null && person.get('isLeader') as number == 1) {
- leaderScore = score;
- }
- }
- // 验证额外工分(如果存在)
- const extraScore = person.get('extraScore');
- if (extraScore != null && extraScore != '' && !(typeof extraScore == 'number' && isNaN(extraScore as number))) {
- const extraScoreStr = typeof extraScore == 'number' ? extraScore.toFixed(2) : extraScore as string;
- const extraScoreError = validatePersonScore(extraScoreStr, 'extraScore');
- if (extraScoreError != null) {
- const result = new UTSJSONObject();
- result.set('valid', false);
- result.set('message', `${person.get('nickName')}:${extraScoreError}`);
- return result;
- }
- }
- }
- // 如果有人没评分,返回错误
- if (hasEmptyScore) {
- const result = new UTSJSONObject();
- result.set('valid', false);
- result.set('message', '部分人员未评分');
- return result;
- }
- // 检查工作负责人得分-0.5后是否小于等于0
- if (leaderScore != null) {
- const leaderScoreAfterReduction = leaderScore - 0.5
- if (leaderScoreAfterReduction <= 0) {
- const result = new UTSJSONObject();
- result.set('valid', false);
- result.set('message', `工作负责人得分减去0.5后不能小于等于0(当前:${leaderScore.toFixed(2)} - 0.5 = ${leaderScoreAfterReduction.toFixed(2)})`);
- return result;
- }
- }
- // 检查工单类型是否为维保工单且多选维保类型的情况,检查是否存在零分和非零分混合
- let isMultipleInspectionWithMixedScores = isMixedZeroNonZeroInspectionTypes();
- // 如果总分为0,则评分无上限
- if (totalScore == 0) {
- // 检查工作负责人得分-0.5后是否小于等于0
- if (leaderScore != null) {
- const leaderScoreAfterReduction = leaderScore - 0.5
- if (leaderScoreAfterReduction <= 0) {
- const result = new UTSJSONObject();
- result.set('valid', false);
- result.set('message', `工作负责人得分减去0.5后不能小于等于0(当前:${leaderScore.toFixed(2)} - 0.5 = ${leaderScoreAfterReduction.toFixed(2)})`);
- return result;
- }
- }
- const result = new UTSJSONObject();
- result.set('valid', true);
- result.set('message', '');
- return result;
- }
-
- // 检查自评分总和是否超过总分
- /* if (totalSelfScore > totalScore + 0.01) { // 使用0.01作为容差
- const result = new UTSJSONObject();
- result.set('valid', false);
- result.set('message', `检修工分总和不能超过工单总分 ${totalScore.toFixed(2)} 分(当前:${totalSelfScore.toFixed(2)} 分)`);
- return result;
- } */
-
- // 对于非零总分且非多选维保类型零分非零混合的情况,自评分总和必须小于等于总分+0.5
- if (totalScore > 0 && !isMultipleInspectionWithMixedScores) {
- // 计算理论总分(总分+0.5,因为工作负责人会额外加0.5分)
- const expectedTotal = totalScore + 0.5;
-
- // 总得分必须等于总分+0.5(使用容差比较)
- /* if (Math.abs(totalSelfScore - expectedTotal) > 0.01) {
- const result = new UTSJSONObject();
- result.set('valid', false);
- result.set('message', `总得分必须等于 ${expectedTotal.toFixed(2)} 分(当前:${totalSelfScore.toFixed(2)} 分)`);
- return result;
- } */
- if (totalSelfScore - expectedTotal > 0.01) {
- const result = new UTSJSONObject();
- result.set('valid', false);
- result.set('message', `总得分必须小于等于 ${expectedTotal.toFixed(2)} 分(当前:${totalSelfScore.toFixed(2)} 分)`);
- return result;
- }
- }
-
- // 如果是维保工单且多选维保类型且存在零分和非零分混合的情况,需要特殊处理
- if (isMultipleInspectionWithMixedScores) {
- // 在这种情况下,总分可能有最小值要求
- const completionFactor = selfEvaluationForm.value.itemCompletionFactor != null ? selfEvaluationForm.value.itemCompletionFactor : 1
- // 重新计算非零分项的总分
- let minScoreFromDB = 0;
- const selectedInspectionTypes: string[] = selfEvaluationForm.value.inspectionType != null ? selfEvaluationForm.value.inspectionType : []
-
- for (let i = 0; i < selectedInspectionTypes.length; i++) {
- const typeId = selectedInspectionTypes[i]
- for (let j = 0; j < inspectionTypeOptions.value.length; j++) {
- const selectedType = inspectionTypeOptions.value[j]
- // 使用inspectionTypeId进行匹配
- if (selectedType.get('inspectionTypeId').toString() == typeId) {
- const score = selectedType.get('score');
- if (score != null && typeof score == 'number' && score > 0) { // 只累加非零分
- minScoreFromDB += score;
- }
- }
- }
- }
-
- // 计算最低理论总分(非零项的总分 * 分项完成系数 + 0.5)
- const minExpectedTotal = (minScoreFromDB * completionFactor) + 0.5
-
- /* // 总得分不得低于最低理论总分
- if (totalSelfScore < minExpectedTotal - 0.01) { // 使用0.01作为容差
- const result = new UTSJSONObject();
- result.set('valid', false);
- result.set('message', `总得分不得低于 ${minExpectedTotal.toFixed(2)} 分(当前:${totalSelfScore.toFixed(2)} 分)`);
- return result;
- } */
- }
- const result = new UTSJSONObject();
- result.set('valid', true);
- result.set('message', '');
- return result;
- }
- // 验证整个表单
- function validateForm(): any {
- console.log('开始验证表单,工单类型:', selfEvaluationForm.value.orderType);
- console.log('当前检修类型值:', selfEvaluationForm.value.maintenanceType);
- // 首先验证必填字段,按优先级排序
- // 验证工单类型为1(维修工单)时的检修类型
- if (selfEvaluationForm.value.orderType == '1') {
- console.log('验证维修工单的检修类型');
- console.log('当前maintenanceType值:', selfEvaluationForm.value.maintenanceType, '类型:', typeof selfEvaluationForm.value.maintenanceType);
- let validationMessage: string | null = null;
- try {
- validationMessage = validateField('maintenanceType', selfEvaluationForm.value.maintenanceType as any);
- } catch (error: any) {
- console.error('检修类型验证过程中出现异常:', error);
- validationMessage = '请选择检修类型';
- }
- console.log('检修类型验证结果:', validationMessage);
- if (validationMessage != null) {
- console.log('检修类型验证失败:', validationMessage);
- const result = new UTSJSONObject();
- result.set('valid', false);
- result.set('message', validationMessage);
- return result;
- }
- }
- // 验证总结内容
- let summaryValidation: string | null = null;
- try {
- summaryValidation = validateField('workSummary', selfEvaluationForm.value.workSummary as any);
- } catch (error: any) {
- console.error('工作总结验证过程中出现异常:', error);
- summaryValidation = '工作总结验证失败';
- }
- if (summaryValidation != null) {
- const result = new UTSJSONObject();
- result.set('valid', false);
- result.set('message', summaryValidation);
- return result;
- }
- // 验证工单类型为2(维保工单)时的分项完成系数
- if (selfEvaluationForm.value.orderType == '2') {
- // 检查分项完成系数是否为空字符串(即用户清空了输入框)
- if (itemCompletionFactorStr.value == '') {
- const result = new UTSJSONObject();
- result.set('valid', false);
- result.set('message', '分项完成系数不能为空');
- return result;
- }
- let validationMessage: string | null = null;
- try {
- validationMessage = validateField('itemCompletionFactor', selfEvaluationForm.value.itemCompletionFactor as any);
- } catch (error: any) {
- validationMessage = '分项完成系数验证失败';
- }
- if (validationMessage != null) {
- const result = new UTSJSONObject();
- result.set('valid', false);
- result.set('message', validationMessage);
- return result;
- }
- // 验证分项完成系数和
- // 检查分项完成系数和是否为空字符串(即用户清空了输入框)
- if (itemCompletionFactorSumStr.value == '') {
- const result = new UTSJSONObject();
- result.set('valid', false);
- result.set('message', '分项完成系数和不能为空');
- return result;
- }
- validationMessage = null;
- try {
- validationMessage = validateField('itemCompletionFactorSum', selfEvaluationForm.value.itemCompletionFactorSum as any);
- } catch (error: any) {
- validationMessage = '分项完成系数和验证失败';
- }
- if (validationMessage != null) {
- const result = new UTSJSONObject();
- result.set('valid', false);
- result.set('message', validationMessage);
- return result;
- }
- }
- // 验证维保类型(仅适用于维保工单)
- if (selfEvaluationForm.value.orderType == '2') {
- let validationMessage: string | null = null;
- try {
- validationMessage = validateField('inspectionType', selfEvaluationForm.value.inspectionType as any);
- } catch (error: any) {
- console.error('维保类型验证过程中出现异常:', error);
- validationMessage = '维保类型验证失败';
- }
- if (validationMessage != null) {
- const result = new UTSJSONObject();
- result.set('valid', false);
- result.set('message', validationMessage);
- return result;
- }
- }
-
- // 验证评分规则
- let scoringValidation: UTSJSONObject;
- try {
- scoringValidation = validateScoringRules() as UTSJSONObject;
- } catch (error: any) {
- console.error('评分规则验证过程中出现异常:', error);
- const result = new UTSJSONObject();
- result.set('valid', false);
- result.set('message', '评分规则验证失败');
- return result;
- }
- if (!(scoringValidation.get('valid') as boolean)) {
- const result = new UTSJSONObject();
- result.set('valid', false);
- result.set('message', scoringValidation.get('message') as string);
- return result;
- }
-
- const result = new UTSJSONObject();
- result.set('valid', true);
- result.set('message', '');
- return result;
- }
- // 加载检修类型选项
- async function loadMaintenanceTypes() {
- try {
- /* uni.showLoading({
- title: '加载中...'
- }) */
-
- const response: any = await getMaintenanceTypes()
- const resultObj = response as UTSJSONObject
- const code = resultObj.get('code') as number
-
- if (code == 200) {
- const data = resultObj.get('rows') as UTSJSONObject[]
- if (data != null && Array.isArray(data)) {
- // 将后端返回的数据转换为页面需要的格式
- const options: MaintenanceTypeOption[] = []
- for (let i = 0; i < data.length; i++) {
- const item = data[i]
- const option: MaintenanceTypeOption = {
- value: (item.get('maintenanceType') as string | null) ?? '',
- label: `${(item.get('projectName') as string | null) ?? ''}(${(item.get('scorePerCompletion') as number | null) ?? 0}分)`
- }
- options.push(option)
- }
- maintenanceTypeOptions.value = options
-
- // 设置选中项索引
- const mt = selfEvaluationForm.value.maintenanceType
- if (mt != null && mt != '') {
- const index = maintenanceTypeOptions.value.findIndex(item => item.value == mt)
- if (index >= 0) {
- selectedMaintenanceTypeIndex.value = index
- }
- } else {
- // 如果maintenanceType为空,重置选中索引
- selectedMaintenanceTypeIndex.value = -1
- selfEvaluationForm.value.maintenanceType = null
- }
- }
- } else {
- const msg = resultObj.get('msg') as string | null
- console.error('加载检修类型失败:', msg ?? '未知错误')
- }
- } catch (error: any) {
- console.error('加载检修类型失败:', error)
- } finally {
- //uni.hideLoading()
- }
- }
- // 加载维保类型选项
- async function loadInspectionTypeOptions() {
- try {
- // 加载维保类型选项
- if (orderType.value == '2') {
- // 根据风机型号获取维保类型选项
- const fanType = selfEvaluationForm.value.model; // 使用风机型号
-
- if (fanType != null && fanType != '') {
- const response: any = await listInspectionTypesByFanType(fanType as string);
- const resultObj = response as UTSJSONObject;
- const code = resultObj.get('code') as number;
-
- if (code == 200) {
- const data = resultObj.get('data') as UTSJSONObject[];
-
- if (data != null && Array.isArray(data)) {
- inspectionTypeOptions.value = data;
- }
- } else {
- console.error('API返回错误码:', code);
- console.error('错误信息:', resultObj.get('msg'));
- }
- } else {
- console.warn('风机型号为空,无法加载维保类型选项');
- }
- }
- } catch (e: any) {
- console.error('获取维保类型选项失败:', e.message);
- //console.error('错误堆栈:', e.stack);
- }
- }
- // 加载工单详情
- async function loadOrderDetail() {
- try {
- uni.showLoading({
- title: '加载中...'
- })
-
- const response: any = await getOrderScoreDetail(orderType.value, id.value)
- const resultObj = response as UTSJSONObject
- const code = resultObj.get('code') as number
-
- if (code == 200) {
- const data = resultObj.get('data') as UTSJSONObject
-
- // 设置表单数据
- const formData: SelfEvaluationFormData = {
- orderType: orderType.value,
- id: (data.get('id') as number | null) ?? 0,
- workOrderProjectNo: (data.get('workOrderProjectNo') as string | null) ?? '',
- pcsDeviceName: (data.get('pcsDeviceName') as string | null) ?? '',
- pcsStationName: (data.get('pcsStationName') as string | null) ?? '',
- workSummary: orderType.value == '1' ? ((data.get('content') as string | null) ?? '') : ((data.get('realContent') as string | null) ?? ''),
- extraWork: orderType.value == '1' ? ((data.get('extraWork') as string | null) ?? '') : '',
- maintenanceType: (data.get('maintenanceType') as string | null) ?? '',
- model: (data.get('model') as string | null), // 风机型号
- inspectionType: orderType.value == '2' ?
- (Array.isArray(data.get('inspectionType')) ?
- data.get('inspectionType') as string[] :
- (((data.get('inspectionType') as string | null)?.split(',') ?? []) as string[])) : [],
- itemCompletionFactor: (data.get('itemCompletionFactor') as number | null),
- itemCompletionFactorSum: (data.get('itemCompletionFactorSum') as number | null),
- scorePersonList: orderType.value == '1' ?
- ((data.get('repairOrderPersonList') as UTSJSONObject[] | null) ?? []) :
- ((data.get('workOrderPersonList') as UTSJSONObject[] | null) ?? []),
- wwryNum: (data.get('wwryNum') as number | null) ?? 0,
- wlryNum: (data.get('wlryNum') as number | null) ?? 0
- }
- selfEvaluationForm.value = formData
-
- // 为人员列表设置初始分数
- /* const list = (formData.scorePersonList as UTSJSONObject[])
- for (let i = 0; i < list.length; i++) {
- const person = list[i]
- if (person.get('selfScore') == null) {
- person.set('selfScore', '')
- }
- if (person.get('extraScore') == null) {
- person.set('extraScore', '')
- }
- if (person.get('totalScore') == null) {
- person.set('totalScore', '')
- }
- } */
- // 初始化字符串中转值,处理可能为null的情况
- itemCompletionFactorStr.value = formData.itemCompletionFactor != null ? formData.itemCompletionFactor.toFixed(2) : ''
- itemCompletionFactorSumStr.value = formData.itemCompletionFactorSum != null ? formData.itemCompletionFactorSum.toFixed(2) : ''
-
- // 加载检修类型选项
- if (orderType.value == '1') {
- await loadMaintenanceTypes()
- }
-
- // 加载维保类型选项
- if (orderType.value == '2') {
- await loadInspectionTypeOptions()
- }
-
- // 计算初始分数
- calculateScores()
-
- // 设置额外工作总结状态标志
- hasExtraWorkFlag.value = formData.extraWork != null && formData.extraWork.trim() != '';
-
- // 初始化已自评总分
- updateSelfEvaluatedTotalScore()
- } else {
- const msg = resultObj.get('msg') as string | null
- uni.showToast({
- title: msg ?? '加载失败',
- icon: 'none'
- })
- }
- } catch (error: any) {
- console.error('加载工单详情失败:', error)
- uni.showToast({
- title: '加载失败',
- icon: 'none'
- })
- } finally {
- uni.hideLoading()
- }
- }
- // 加载字典数据
- async function loadDictData() {
- try {
- // 加载维保类型字典
- if (orderType.value == '2') {
- const result = await getDictDataByType('gxt_inspection_type')
- const resultObj = result as UTSJSONObject
- if (resultObj.get('code') == 200) {
- const data = resultObj.get('data') as any[]
- const dictData: SysDictData[] = []
- if (data != null && data.length > 0) {
- for (let i = 0; i < data.length; i++) {
- const item = data[i] as UTSJSONObject
- // 只提取需要的字段
- const dictItem: SysDictData = {
- dictValue: item.get('dictValue') as string | null,
- dictLabel: item.get('dictLabel') as string | null,
- dictCode: null,
- dictSort: null,
- dictType: null,
- cssClass: null,
- listClass: null,
- isDefault: null,
- status: null,
- default: null,
- createTime: null,
- remark: null
- }
- dictData.push(dictItem)
- }
- }
- inspectionTypeDictList.value = dictData
- }
- }
- } catch (e: any) {
- console.error('获取维保类型字典失败:', e.message)
- }
- }
- // 检修类型选择变化
- function selectMaintenanceType(index: number) {
- selectedMaintenanceTypeIndex.value = index
- if (index >= 0 && index < maintenanceTypeOptions.value.length) {
- selfEvaluationForm.value.maintenanceType = maintenanceTypeOptions.value[index].value
- }
- showMaintenanceTypePicker.value = false
-
- // 选择后立即触发验证
- const validationMessage = validateField('maintenanceType', selfEvaluationForm.value.maintenanceType as any);
- if (validationMessage != null) {
- uni.showToast({
- title: validationMessage,
- icon: 'none'
- });
- }
- }
- // 根据值获取检修类型标签
- function getMaintenanceTypeLabel(value: string | null): string {
- if (value == null || value == '') return ''
- const item = maintenanceTypeOptions.value.find(item => item.value == value)
- return item != null ? item.label : value
- }
- // 工作总结输入处理
- function onWorkSummaryInput(e: UniInputEvent) {
- const value = e.detail?.value as string
- selfEvaluationForm.value.workSummary = value
- }
- // 格式化分项完成系数输入值
- function formatItemCompletionFactor() {
- const tempValue = tempItemCompletionFactorInput.value;
- let finalValue: number | null = null; // 明确定义类型
-
- if (tempValue.endsWith('.')) {
- // 如果以点结尾,去除点号
- const processedValue = tempValue.slice(0, -1);
-
- if (processedValue != '') {
- const numValue = parseFloat(processedValue);
-
- if (!isNaN(numValue) && isFinite(numValue)) {
- if (numValue >= 0 && numValue <= 1) {
- finalValue = numValue;
- } else {
- finalValue = numValue > 1 ? 1 : 0; // 根据数值大小决定边界值
- }
- } else {
- finalValue = 1; // 默认值
- }
- } else {
- // 去掉点后为空,设为null
- finalValue = null;
- }
- } else {
- // 正常数值处理
- const currentValue = selfEvaluationForm.value.itemCompletionFactor;
- if (currentValue != null && typeof currentValue == 'number') {
- // 格式化小数位数
- const currentStr = currentValue.toString();
- const parts = currentStr.split('.');
- if (parts.length > 1 && parts[1] != null && parts[1].length > 2) {
- // 创建一个局部变量确保类型安全
- const valueToFormat: number = currentValue;
- finalValue = parseFloat(valueToFormat.toFixed(2));
- } else {
- finalValue = currentValue;
- }
- }
- }
-
- // 更新数值
- selfEvaluationForm.value.itemCompletionFactor = finalValue;
-
- // 同步更新临时输入值为格式化后的字符串显示
- if (finalValue != null) {
- tempItemCompletionFactorInput.value = finalValue.toString();
- } else {
- tempItemCompletionFactorInput.value = '';
- }
- }
- function onItemCompletionFactorInput(e: UniInputEvent) {
- const value = e.detail?.value as string;
- // 更新临时输入值
- tempItemCompletionFactorInput.value = value;
-
- // 检查输入值是否为空
- if (value == '') {
- selfEvaluationForm.value.itemCompletionFactor = null;
- } else {
- // 检查是否为中间输入状态(如 '0.' 等以点结尾的数字)
- if (value.endsWith('.')) {
- // 如果是中间输入状态,不更新数值,保持原有值
- return;
- }
-
- // 验证输入值是否为有效数字
- const numValue = parseFloat(value);
- if (!isNaN(numValue) && isFinite(numValue)) {
- if( numValue >= 0 && numValue <= 1){
- // 在input事件中直接使用解析后的数值
- selfEvaluationForm.value.itemCompletionFactor = numValue;
- } else {
- // 当超出范围时,设置实际值为边界值
- selfEvaluationForm.value.itemCompletionFactor = numValue > 1 ? 1 : 0;
- }
-
- // 更新可自评总分显示
- //updateSelfEvaluatedTotalScore();
- }
- }
- calculateScores();
- }
- // 获取分项完成系数显示值
- function getItemCompletionFactorDisplayValue(): string {
- // 优先返回临时输入值,确保输入过程中的显示与用户操作一致
- if (tempItemCompletionFactorInput.value != null && tempItemCompletionFactorInput.value != '') {
- return tempItemCompletionFactorInput.value;
- }
-
- // 否则返回格式化后的数值
- const value = selfEvaluationForm.value.itemCompletionFactor;
- if (value == null) {
- return '';
- }
-
- if (typeof value == 'number') {
- return value.toString();
- }
-
- return value as string;
- }
- // 格式化分项完成系数和输入值
- function formatItemCompletionFactorSum() {
- const tempValue = tempItemCompletionFactorSumInput.value;
- let finalValue: number | null = null; // 明确定义类型
-
- if (tempValue.endsWith('.')) {
- // 如果以点结尾,去除点号
- const processedValue = tempValue.slice(0, -1);
-
- if (processedValue != '') {
- const numValue = parseFloat(processedValue);
-
- if (!isNaN(numValue) && isFinite(numValue)) {
- if (numValue >= 0 && numValue <= 1) {
- finalValue = numValue;
- } else {
- finalValue = numValue > 1 ? 1 : 0; // 根据数值大小决定边界值
- }
- } else {
- finalValue = 1; // 默认值
- }
- } else {
- // 去掉点后为空,设为null
- finalValue = null;
- }
- } else {
- // 正常数值处理
- const currentValue = selfEvaluationForm.value.itemCompletionFactorSum;
- if (currentValue != null && typeof currentValue == 'number') {
- // 格式化小数位数
- const currentStr = currentValue.toString();
- const parts = currentStr.split('.');
- if (parts.length > 1 && parts[1] != null && parts[1].length > 2) {
- // 创建一个局部变量确保类型安全
- const valueToFormat: number = currentValue;
- finalValue = parseFloat(valueToFormat.toFixed(2));
- } else {
- finalValue = currentValue;
- }
- }
- }
-
- // 更新数值
- selfEvaluationForm.value.itemCompletionFactorSum = finalValue;
-
- // 同步更新临时输入值为格式化后的字符串显示
- if (finalValue != null) {
- tempItemCompletionFactorSumInput.value = finalValue.toString();
- } else {
- tempItemCompletionFactorSumInput.value = '';
- }
- }
- function onItemCompletionFactorSumInput(e: UniInputEvent) {
- const value = e.detail?.value as string;
- // 更新临时输入值
- tempItemCompletionFactorSumInput.value = value;
-
- // 检查输入值是否为空
- if (value == '') {
- selfEvaluationForm.value.itemCompletionFactorSum = null;
- } else {
- // 检查是否为中间输入状态(如 '0.' 等以点结尾的数字)
- if (value.endsWith('.')) {
- // 如果是中间输入状态,不更新数值,保持原有值
- return;
- }
-
- // 验证输入值是否为有效数字
- const numValue = parseFloat(value);
- if (!isNaN(numValue) && isFinite(numValue)) {
- if( numValue >= 0 && numValue <= 1){
- // 在input事件中直接使用解析后的数值
- selfEvaluationForm.value.itemCompletionFactorSum = numValue;
- } else {
- // 当超出范围时,设置实际值为边界值
- selfEvaluationForm.value.itemCompletionFactorSum = numValue > 1 ? 1 : 0;
- }
- }
- }
- }
- // 获取分项完成系数和显示值
- function getItemCompletionFactorSumDisplayValue(): string {
- // 优先返回临时输入值,确保输入过程中的显示与用户操作一致
- if (tempItemCompletionFactorSumInput.value != null && tempItemCompletionFactorSumInput.value != '') {
- return tempItemCompletionFactorSumInput.value;
- }
-
- // 否则返回格式化后的数值
- const value = selfEvaluationForm.value.itemCompletionFactorSum;
- if (value == null) {
- return '';
- }
-
- if (typeof value == 'number') {
- return value.toString();
- }
-
- return value as string;
- }
- // 额外工作总结变化
- function onExtraWorkChange() {
- // 更新额外工作总结状态标志
- // 使用更严格的检查,包括检查长度
- let extraWorkStr = '';
- if (selfEvaluationForm.value.extraWork != null) {
- extraWorkStr = selfEvaluationForm.value.extraWork;
- }
- const trimmedStr = extraWorkStr.trim();
- const newHasExtraWork = trimmedStr.length > 0;
- hasExtraWorkFlag.value = newHasExtraWork;
-
- // 如果额外工作总结为空,则清空额外工分和总分字段
- if (trimmedStr.length == 0) {
- // 清空所有人员的额外工分和总分
- const scorePersonList = selfEvaluationForm.value.scorePersonList as UTSJSONObject[]
- for (let i = 0; i < scorePersonList.length; i++) {
- const person = scorePersonList[i]
- person.set('extraScore', 0)
- // 重新计算总分(此时额外工分为空,所以总分等于自评分)
- const selfScoreVal = person.get('selfScore');
- if (selfScoreVal != null) {
- const selfScore = typeof selfScoreVal == 'number' ? selfScoreVal : (selfScoreVal != '' ? parseFloat(selfScoreVal as string) : 0);
- if (!isNaN(selfScore)) {
- person.set('totalScore', selfScore);
- } else {
- person.set('totalScore', 0);
- }
- } else {
- person.set('totalScore', 0);
- }
- }
- }
-
- // 更新已自评总分显示
- updateSelfEvaluatedTotalScore()
-
- // 当额外工作总结变化时,可能需要重新计算总分
- updateTotalScores()
- }
- // 额外工作总结输入处理
- function onExtraWorkInput(e: UniInputEvent) {
- const value = e.detail?.value;
- // 确保当值为null时设置为空字符串
- if (value == null) {
- selfEvaluationForm.value.extraWork = '';
- } else {
- selfEvaluationForm.value.extraWork = value.toString();
- }
- // 每次输入都触发变化处理
- onExtraWorkChange()
- }
- // 获取人员评分
- function getPersonScore(person: UTSJSONObject, field: string): string {
- const value = person.get(field as string)
- if (value == null || value == '' || (typeof value == 'number' && isNaN(value))) {
- return ''
- }
- // 统一处理为字符串返回给UI
- if (typeof value == 'number') {
- const stringValue = value.toString();
- return stringValue;
- //return value.toFixed(2);
- }
- return value as string
- }
- // 设置人员评分
- function setPersonScore(person: UTSJSONObject, field: string, value: string) {
- person.set(field as string, value)
- }
- // 通用评分输入处理
- function onScoreInput(e: UniInputEvent, index: number, field: string) {
- const value = e.detail?.value as string
-
- if (index >= 0 && index < selfEvaluationForm.value.scorePersonList.length) {
- const person = selfEvaluationForm.value.scorePersonList[index] as UTSJSONObject
- if (person != null) {
- // 将输入的字符串转换为数字存储
- const numericValue = value == '' ? null : parseFloat(value);
- person.set(field, (numericValue != null && isNaN(numericValue)) ? null : numericValue);
-
- // 实时验证评分
- if (value != '') {
- const validationError = validatePersonScore(value, field)
- if (validationError != null) { // 修复条件判断
- // 显示验证错误(在实际应用中,这里可以显示在界面上)
- console.warn(`评分验证错误: ${validationError}`)
- // 可以考虑用uni.showToast显示错误信息
- /* uni.showToast({
- title: validationError,
- icon: 'none',
- duration: 2000
- }) */
- }
- }
-
- updateTotalScores()
- updateSelfEvaluatedTotalScore()
- }
- }
- }
- // 格式化评分输入值
- function formatScoreInput(index: number, field: string) {
- if (index >= 0 && index < selfEvaluationForm.value.scorePersonList.length) {
- const person = selfEvaluationForm.value.scorePersonList[index] as UTSJSONObject
- if (person != null) {
- const value = person.get(field as string);
- if (typeof value == 'number') {
- // 检查数值的小数位数是否超过2位
- const parts = value.toString().split('.');
- if (parts.length > 1) { // 确保有小数部分
- const decimalPart = parts[1];
- if (decimalPart != null && decimalPart.length > 2) {
- // 如果小数位数超过2位,使用格式化后的值
- const formattedValue = parseFloat((value as number).toFixed(2));
- person.set(field as string, formattedValue);
- }
- }
- }
- }
- }
- }
- // 分数变化
- function onScoreChange() {
- updateTotalScores()
- updateSelfEvaluatedTotalScore() // 更新已自评总分显示
- }
- // 返回按钮事件
- function goBack() {
- uni.navigateBack()
- }
- // 提交自评
- async function submitSelfEvaluationForm(): Promise<void> {
- try {
- console.log('开始提交验证');
- // 使用完整的表单验证
- const validation = validateForm() as UTSJSONObject;
- const isValid = validation.get('valid') as boolean;
- const validationMsg = validation.get('message') as string;
- console.log('验证结果:', isValid, '消息:', validationMsg);
- console.log('验证结果类型:', typeof isValid, '是否为false:', isValid == false);
- if (!isValid) {
- console.log('验证失败,显示错误:', validationMsg);
- // 在iOS平台中,有时需要稍作延迟才能正确显示toast
- setTimeout(() => {
- uni.showToast({
- title: validationMsg,
- icon: 'none'
- });
- }, 50);
- return;
- }
-
- uni.showLoading({
- title: '提交中...'
- })
-
- // 创建新的UTSJSONObject来存储表单数据
- const formValue = new UTSJSONObject();
-
- // 复制基本字段
- formValue.set('id', selfEvaluationForm.value.id);
- formValue.set('orderType', selfEvaluationForm.value.orderType);
- formValue.set('workOrderProjectNo', selfEvaluationForm.value.workOrderProjectNo);
- formValue.set('pcsDeviceName', selfEvaluationForm.value.pcsDeviceName);
- formValue.set('pcsStationName', selfEvaluationForm.value.pcsStationName);
- formValue.set('workSummary', selfEvaluationForm.value.workSummary);
- formValue.set('extraWork', selfEvaluationForm.value.extraWork);
- formValue.set('maintenanceType', selfEvaluationForm.value.maintenanceType);
- formValue.set('itemCompletionFactor', selfEvaluationForm.value.itemCompletionFactor);
- formValue.set('itemCompletionFactorSum', selfEvaluationForm.value.itemCompletionFactorSum);
- formValue.set('wwryNum', selfEvaluationForm.value.wwryNum);
- formValue.set('wlryNum', selfEvaluationForm.value.wlryNum);
-
- // 处理inspectionType字段:如果是数组则转换为字符串
- if (Array.isArray(selfEvaluationForm.value.inspectionType)) {
- const strValue = (selfEvaluationForm.value.inspectionType as string[]).join(',');
- formValue.set('inspectionType', strValue);
- } else {
- formValue.set('inspectionType', selfEvaluationForm.value.inspectionType);
- }
-
- // 复制scorePersonList数组
- const scorePersonListArray: UTSJSONObject[] = [];
- for (let i = 0; i < selfEvaluationForm.value.scorePersonList.length; i++) {
- const person = selfEvaluationForm.value.scorePersonList[i];
- // 将UTSJSONObject添加到数组中
- scorePersonListArray.push(person);
- }
- formValue.set('scorePersonList', scorePersonListArray);
- const response: any = await submitSelfEvaluation(formValue);
-
- const resultObj = response as UTSJSONObject
- const code = resultObj.get('code' as string) as number
-
- if (code == 200) {
- uni.showToast({
- title: '自评提交成功',
- icon: 'success'
- })
-
- // 设置标记,通知上一个页面需要刷新数据
- uni.setStorageSync('needRefresh', true)
-
- // 延迟返回上一页
- setTimeout(() => {
- uni.navigateBack()
- }, 1000)
- } else {
- const msg = resultObj.get('msg' as string) as string | null
- uni.showToast({
- title: msg ?? '提交失败',
- icon: 'none'
- })
- }
- } catch (error: any) {
- console.error('提交自评失败:', error)
- let msg: string | null = null
- if (error instanceof Error) {
- msg = error.message
- } else if (error instanceof UTSJSONObject && error.get('message') != null) {
- msg = error.get('message') as string
- }
- uni.showToast({
- title: msg ?? '提交失败',
- icon: 'none'
- })
- } finally {
- uni.hideLoading()
- }
- }
- // 页面初始化
- onLoad((options: any) => {
- const params = options as UTSJSONObject
- id.value = (params.get('id') != null ? params.get('id') as string : '')
- orderType.value = (params.get('orderType') != null ? params.get('orderType') as string : '')
-
-
- console.log("id.value==",id.value)
- console.log("orderType.value==",orderType.value)
- // 加载字典数据
- loadDictData()
- // 加载工单详情
- loadOrderDetail()
- })
-
- </script>
- <style lang="scss">
- .container {
- flex: 1;
- background-color: #e8f0f9;
- //height: 100vh;
- }
- .header {
- padding: 30rpx;
- text-align: center;
- }
- .title {
- font-size: 36rpx;
- font-weight: bold;
- color: #333;
- }
- .form {
- padding: 0 30rpx 30rpx;
- }
- .info-card {
- background-color: #ffffff;
- border-radius: 16rpx;
- padding: 30rpx;
- margin-bottom: 20rpx;
- }
- .info-input {
- flex: 1;
- font-size: 28rpx;
- color: #333333;
- border: 1rpx solid #e0e0e0;
- border-radius: 8rpx;
- padding: 10rpx;
- text-align: right;
- /* iOS兼容性处理 */
- box-sizing: border-box;
- outline: none;
- appearance: none;
- /* #ifdef APP-IOS */
- -webkit-appearance: none;
- /* #endif */
- }
- .info-item {
- flex-direction: row;
- padding: 20rpx 0;
- border-bottom: 1rpx solid #f0f0f0;
- &:last-child {
- border-bottom: none;
- }
- .info-label {
- width: 240rpx;
- font-size: 28rpx;
- color: #666666;
- white-space: nowrap;
- }
- .info-value {
- flex: 1;
- font-size: 28rpx;
- color: #333333;
- text-align: right;
- }
- .info-input {
- flex: 1;
- font-size: 28rpx;
- color: #333333;
- border: 1rpx solid #e0e0e0;
- border-radius: 8rpx;
- padding: 10rpx;
- text-align: right;
- /* iOS兼容性处理 */
- box-sizing: border-box;
- outline: none;
- appearance: none;
- /* #ifdef APP-IOS */
- -webkit-appearance: none;
- /* #endif */
- }
- }
- .score-input {
- flex: 1;
- height: 60rpx;
- border: 1rpx solid #e0e0e0 !important;
- border-radius: 8rpx;
- padding: 0 15rpx;
- font-size: 26rpx;
- color: #333;
- text-align: right;
- /* iOS兼容性处理 */
- box-sizing: border-box !important;
- outline: none !important;
- appearance: none !important;
- /* #ifdef APP-IOS */
- -webkit-appearance: none !important;
- /* #endif */
- /* 确保在所有状态下都有边框 */
- -webkit-appearance: none !important;
- -moz-appearance: none !important;
- appearance: none !important;
- }
- /* 针对各种状态的输入框都要确保边框显示 */
- /*.score-input:not([disabled]):not([readonly]) {
- border: 1rpx solid #e0e0e0 !important;
- }
- .score-input[readonly] {
- border: 1rpx solid #e0e0e0 !important;
- box-sizing: border-box !important;
- pointer-events: none !important;
- }
- .score-input[disabled] {
- border: 1rpx solid #e0e0e0 !important;
- box-sizing: border-box !important;
- opacity: 0.8 !important;
- pointer-events: none !important;
- }
- .score-input:read-only {
- border: 1rpx solid #e0e0e0 !important;
- box-sizing: border-box !important;
- }
- .score-input:focus {
- border: 1rpx solid #165DFF !important;
- }*/
- .form-item {
- margin-bottom: 30rpx;
- display: flex;
- flex-direction: column;
- }
- .label {
- font-size: 28rpx;
- color: #666;
- margin-bottom: 10rpx;
- font-weight: bold;
- }
- .value {
- font-size: 28rpx;
- color: #333;
- }
- .textarea {
- width: 100%;
- height: 200rpx;
- border: 1rpx solid #e5e5e5;
- border-radius: 8rpx;
- padding: 20rpx;
- font-size: 28rpx;
- color: #333;
- /* iOS兼容性处理 */
- box-sizing: border-box;
- outline: none;
- appearance: none;
- /* #ifdef APP-IOS */
- -webkit-appearance: none;
- /* #endif */
- }
- .picker {
- width: 100%;
- }
- .picker-display {
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- min-height: 40rpx;
- border: 1rpx solid #e0e0e0;
- border-radius: 8rpx;
- padding: 10rpx;
- /* iOS兼容性处理 */
- box-sizing: border-box;
- outline: none;
- appearance: none;
- /* #ifdef APP-IOS */
- -webkit-appearance: none;
- /* #endif */
- }
- .selected-value {
- font-size: 28rpx;
- color: #333333;
- }
- .placeholder {
- font-size: 28rpx;
- color: #999999;
- }
- .arrow {
- font-size: 24rpx;
- color: #999999;
- margin-left: 12rpx;
- }
- .selected-values {
- display: flex;
- flex-wrap: wrap;
- //gap: 10rpx;
- }
- .selected-value-tag {
- background-color: #f0f0f0;
- padding: 8rpx 16rpx;
- border-radius: 20rpx;
- font-size: 24rpx;
- color: #666;
- }
- .person-score-item {
- margin-bottom: 30rpx;
- padding: 20rpx;
- background-color: #f8f9fa;
- border-radius: 12rpx;
- }
- .person-info {
- margin-bottom: 15rpx;
- }
- .person-name {
- font-size: 28rpx;
- font-weight: bold;
- color: #333;
- }
- .score-inputs {
- display: flex;
- flex-direction: column;
- //gap: 15rpx;
- }
- .score-item {
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: space-between;
- padding: 8rpx 0;
- }
- .score-label {
- font-size: 26rpx;
- color: #666;
- width: 120rpx;
- flex-shrink: 0;
- }
- .submit-btn {
- margin-top: 40rpx;
- height: 80rpx;
- background-color: #165DFF;
- border-radius: 10rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .submit-text {
- font-size: 32rpx;
- color: #fff;
- font-weight: bold;
- }
- /* 自定义选择器样式 */
- .picker-modal {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- z-index: 1000;
- }
- .modal-mask {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background-color: rgba(0, 0, 0, 0.5);
- }
- .modal-content {
- position: absolute;
- bottom: 0;
- left: 0;
- right: 0;
- background-color: #ffffff;
- border-top-left-radius: 16rpx;
- border-top-right-radius: 16rpx;
- min-height: 700rpx;
- }
- .modal-header {
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- padding: 30rpx;
- border-bottom: 1rpx solid #f0f0f0;
- }
- .modal-title {
- font-size: 32rpx;
- font-weight: bold;
- color: #333333;
- }
- .modal-close {
- font-size: 28rpx;
- color: #165DFF;
- }
- .modal-body {
- max-height: 600rpx;
- }
- .picker-option {
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- padding: 24rpx 30rpx;
- border-bottom: 1rpx solid #f0f0f0;
- }
- .picker-option.selected {
- background-color: #f8f9fa;
- }
- .option-text {
- font-size: 28rpx;
- color: #333333;
- }
- .option-check {
- font-size: 28rpx;
- color: #165DFF;
- }
- .form-picker {
- flex: 1;
- }
- .picker-display {
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- min-height: 40rpx;
- }
- .selected-value {
- font-size: 28rpx;
- color: #333333;
- }
- .placeholder {
- font-size: 28rpx;
- color: #999999;
- }
- .arrow {
- font-size: 24rpx;
- color: #999999;
- margin-left: 12rpx;
- }
- </style>
|