12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658 |
- <template>
- <a-card :bordered="false" v-show="visible" class="card" :title="modalTitle">
- <a-row :gutter="48" slot="extra">
- <a-col :md="48" :sm="48">
- <span class="table-page-search-submitButtons" style="float: right">
- <a-button type="primary" @click="save()">提交</a-button>
- <a-button style="margin-left: 8px" @click="handleFresh()">刷新位置</a-button>
- <a-button style="margin-left: 8px" @click="handleCancel()">返回</a-button>
- </span>
- </a-col>
- </a-row>
- <title-divider title="基本信息" width="90px"></title-divider>
- <a-form :form="form">
- <a-form-item v-show="false" >
- <a-input v-decorator="['id']" type="hidden"/>
- <a-input v-decorator="['parentId']" type="hidden"/>
- </a-form-item>
- <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="设备编号"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- v-decorator="['no', {rules: [{required: true, message: '不能为空'}]}]" />
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="父设备"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- disabled
- style="width: 60%"
- v-decorator="['parentSbName']"/>
- <a-button type="primary" style="width: 20%" @click="handleSbSelect">选择</a-button>
- <a-button type="default" style="width: 20%" @click="clearParent">清空</a-button>
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="父位号"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- v-decorator="['ppNo']"/>
- </a-form-item>
- </a-col>
- <!-- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="是否子设备"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-select @change="childChange" v-decorator="['isChild', { rules: [{required: true, message: '是否子设备不能为空'}]}]" placeholder="请选择">
- <a-select-option
- v-for="(label,value) in isChildMap"
- :key="value"
- :label="label"
- :value="parseInt(value)">{{ label }}
- </a-select-option>
- </a-select>
- </a-form-item>
- </a-col>-->
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="设备位号"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- v-decorator="['positionNo', {rules: [{required: false, message: '不能为空'}]}]" />
- </a-form-item>
- </a-col>
- </a-row>
- <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="设备名称"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- v-decorator="['name', {rules: [{required: true, message: '设备名称不能为空'}]}]" />
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="设备型号"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- v-decorator="['model', {rules: [{required: true, message: '设备型号不能为空'}]}]" />
- </a-form-item>
- </a-col>
- </a-row>
- <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="是否固定资产"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-select v-decorator="['isFinancing', { rules: [{required: true, message: '是否显示不能为空'}]}]" placeholder="请选择">
- <a-select-option
- v-for="(label,value) in isFinancingMap"
- :key="value"
- :label="label"
- :value="parseInt(value)">{{ label }}
- </a-select-option>
- </a-select>
- </a-form-item>
- </a-col>
- </a-row>
- <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="设备等级"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-select v-decorator="['level', {initialValue:1, rules: [{required: true, message: '设备等级不能为空'}]}]" placeholder="请选择">
- <a-select-option
- v-for="(label,value) in levelMap"
- :key="value"
- :label="label"
- :value="parseInt(value)">{{ label }}
- </a-select-option>
- </a-select>
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="设备价格(原值)"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input-number
- style="width: 100%"
- :min="0"
- :step="0.01"
- :formatter="BaseTool.Amount.formatter"
- :parser="BaseTool.Amount.parser"
- v-decorator="['initialValue']" />
- </a-form-item>
- </a-col>
- </a-row>
- <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="设备类型"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-tree-select
- style="width: 100%"
- :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
- :treeData="sbTypeTreeData"
- :treeNodeFilterProp="'title'"
- :showSearch="true"
- v-decorator="['typeId', {rules: [{required: true, message: '设备类型不能为空'}]}]"
- placeholder="请选择"
- >
- </a-tree-select>
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="自定义类型"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-select @change="handleChange" v-decorator="['useType', {rules: [{required: true, message: '自定义类型不能为空'}]}]" placeholder="请选择">
- <a-select-option
- v-for="(label,value) in useTypeMap"
- :key="value"
- :label="label"
- :value="parseInt(value)">{{ label }}
- </a-select-option>
- </a-select>
- </a-form-item>
- </a-col>
- </a-row>
- <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="状态"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-select v-decorator="['status', {rules: [{required: true, message: '状态不能为空'}]}]" placeholder="请选择">
- <a-select-option
- v-for="(label,value) in statusMap"
- :key="value"
- :label="label"
- :value="parseInt(value)">{{ label }}
- </a-select-option>
- </a-select>
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24" v-if="useType===4">
- <a-form-item
- label="是否强检"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-select v-decorator="['checkType', {rules: [{required: true, message: '请选择'}]}]" placeholder="请选择">
- <a-select-option
- v-for="(label,value) in checkTypeMap"
- :key="value"
- :label="label"
- :value="parseInt(value)">{{ label }}
- </a-select-option>
- </a-select>
- </a-form-item>
- </a-col>
- </a-row>
- <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
- <!-- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="大小/尺寸"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- v-decorator="['zz']" />
- </a-form-item>
- </a-col>-->
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="出厂编号"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- v-decorator="['zzh']" />
- </a-form-item>
- </a-col>
- </a-row>
- <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="生产商"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- v-decorator="['producerId']" />
- </a-form-item>
- </a-col>
- </a-row>
- <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="设备位置"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-tree-select
- style="width: 100%"
- :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
- :treeData="treeData"
- :treeNodeFilterProp="'title'"
- :showSearch="true"
- v-decorator="['positionId', {rules: [{required: false, message: '上层位置不能为空'}]}]"
- placeholder="请选择"
- >
- </a-tree-select>
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="电力线路"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-select v-decorator="['baoyangTimes', {rules: [{required: false, message: '不能为空'}]}]" placeholder="请选择">
- <a-select-option
- v-for="(label,value) in lineMap"
- :key="value"
- :label="label"
- :value="parseInt(value)">{{ label }}
- </a-select-option>
- </a-select>
- </a-form-item>
- </a-col>
- <!-- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="是否显示"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-select v-decorator="['isShow', { rules: [{required: true, message: '是否显示不能为空'}]}]" placeholder="请选择">
- <a-select-option
- v-for="(label,value) in isShowMap"
- :key="value"
- :label="label"
- :value="parseInt(value)">{{ label }}
- </a-select-option>
- </a-select>
- </a-form-item>
- </a-col>-->
- </a-row>
- <!-- <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="水平位置"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input-number
- :step="1"
- :min="85"
- style="width:70%"
- v-decorator="['zjm']"
- placeholder="请输入离屏幕左上角的右方距离,最低85"/>
- <a-button style="width: 30%" type="primary" @click="handlePoint">设置预览</a-button>
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="垂直位置"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input-number
- :step="1"
- :min="340"
- style="width:70%"
- v-decorator="['jbdh']"
- placeholder="请输入离屏幕左上角的下方位置,最低340"/>
- <a-button style="width: 30%" type="primary" @click="handlePoint">设置预览</a-button>
- </a-form-item>
- </a-col>
- </a-row>-->
- <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="备注"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- v-decorator="['remark', {rules: [{required: false, message: '备注不能为空'}]}]" />
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="使用人员"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- v-decorator="['saveUser', {rules: [{required: false, message: '使用人员不能为空'}]}]" />
- </a-form-item>
- </a-col>
- </a-row>
- <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="设备识别码"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- v-decorator="['identifyNo', {rules: [{required: false, message: '设备识别码不能为空'}]}]" />
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="设备注册码"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- v-decorator="['sbRegisterNo', {rules: [{required: false, message: '设备注册码不能为空'}]}]" />
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="使用证号"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- v-decorator="['useNo', {rules: [{required: false, message: '使用证号不能为空'}]}]" />
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="设备代号"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- v-decorator="['sbCode', {rules: [{required: false, message: '设备代号不能为空'}]}]" />
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="安装单位"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- v-decorator="['installUnit', {rules: [{required: false, message: '安装单位不能为空'}]}]" />
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="检验结论"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- v-decorator="['examResult', {rules: [{required: false, message: '检验结论不能为空'}]}]" />
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="单位内部使用地点"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- v-decorator="['usePosition', {rules: [{required: false, message: '单位内部使用地点不能为空'}]}]" />
- </a-form-item>
- </a-col>
- </a-row>
- <!-- <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="所属区域"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-select @change="handleAreaChange" v-decorator="['useArea', {rules: [{required: true, message: '所属区域不能为空'}]}]" placeholder="请选择">
- <a-select-option
- v-for="({deptId, name}) in areaList"
- :key="deptId"
- :label="name"
- :value="deptId">{{ name }}
- </a-select-option>
- </a-select>
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="所属公司"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-select @change="handleCompanyChange" v-decorator="['useCompany', {rules: [{required: true, message: '所属公司不能为空'}]}]" placeholder="请选择">
- <a-select-option
- v-for="({deptId, name}) in companyList"
- :key="deptId"
- :label="name"
- :value="deptId">{{ name }}
- </a-select-option>
- </a-select>
- </a-form-item>
- </a-col>
- </a-row>
- <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="所属项目部"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-select @change="handleProjectChange" v-decorator="['useProject', {rules: [{required: true, message: '项目部不能为空'}]}]" placeholder="请选择">
- <a-select-option
- v-for="({deptId, name}) in projectList"
- :key="deptId"
- :label="name"
- :value="deptId">{{ name }}
- </a-select-option>
- </a-select>
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="所属部门"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-select @change="handleDeptChange" v-decorator="['useDept', {rules: [{required: true, message: '所属公司不能为空'}]}]" placeholder="请选择">
- <a-select-option
- v-for="({deptId, name}) in deptList"
- :key="deptId"
- :label="name"
- :value="deptId">{{ name }}
- </a-select-option>
- </a-select>
- </a-form-item>
- </a-col>
- </a-row>-->
- <!--<a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="所属班组"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-select @change="handleGroupChange" v-decorator="['useGroup', {rules: [{required: true, message: '项目部不能为空'}]}]" placeholder="请选择">
- <a-select-option
- v-for="({deptId, name}) in groupList"
- :key="deptId"
- :label="name"
- :value="deptId">{{ name }}
- </a-select-option>
- </a-select>
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="维修人"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-select v-decorator="['repairUser']" placeholder="请选择">
- <a-select-option
- v-for="({userId, realName}) in userList"
- :key="userId"
- :label="realName"
- :value="userId">{{ realName }}
- </a-select-option>
- </a-select>
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="第二维修人员"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-select v-decorator="['repairUserSecond']" placeholder="请选择">
- <a-select-option
- v-for="({userId, realName}) in userList"
- :key="userId"
- :label="realName"
- :value="userId">{{ realName }}
- </a-select-option>
- </a-select>
- </a-form-item>
- </a-col>
- </a-row>-->
- <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="购置日期"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-date-picker
- style="width: 100%"
- :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
- v-decorator="['buyDate']" />
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="投用日期"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-date-picker
- style="width: 100%"
- :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
- v-decorator="['startDate']" />
- </a-form-item>
- </a-col>
- </a-row>
- <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="使用寿命"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- style="width: 100%"
- suffix="年"
- :formatter="BaseTool.Amount.formatter"
- :parser="BaseTool.Amount.parser"
- v-decorator="['workYear', {rules: [{required: true, message: '不能为空'}]}]" />
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="资产编号(财务编码)"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- v-decorator="['financingNo']" />
- </a-form-item>
- </a-col>
- <!-- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="关联维修部门"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-select v-decorator="['repairDeptId']" placeholder="请选择">
- <a-select-option
- v-for="(label,value) in repairDeptMap"
- :key="value"
- :label="label"
- :value="value">{{ label }}
- </a-select-option>
- </a-select>
- </a-form-item>
- </a-col>-->
- </a-row>
- <title-divider title="自定义参数" width="120px"></title-divider>
- <div class="table-operator" style="margin-bottom: 8px;">
- <a-button type="primary" @click="handleParam">
- <a-icon type="plus"/>
- 添加
- </a-button>
- </div>
- <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
- <a-col :key="index" v-for="(item, index) in paramList" :lg="12" :md="24" :sm="24">
- <a-form-item
- :label="item.name"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- style="width: 70%"
- :defaultValue="item.content"
- disabled
- />
- <a-button style="width: 30%" type="primary" @click="handleDelParam(index)">删除</a-button>
- </a-form-item>
- </a-col>
- </a-row>
- <title-divider v-show="useType == 5" title="特种信息" width="90px"></title-divider>
- <div v-show="useType == 5" >
- <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="注册代码"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- v-decorator="['registerNo']" />
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="介质属性"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- v-decorator="['characterType']" />
- </a-form-item>
- </a-col>
- </a-row>
- <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="设备批号"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- v-decorator="['batchNo']" />
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="使用登记证编号"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- v-decorator="['usedNo']" />
- </a-form-item>
- </a-col>
- </a-row>
- <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="维护供应商"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- v-decorator="['supplier']" />
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="登记日期"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-date-picker
- style="width: 100%"
- :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
- v-decorator="['registerDate']" />
- </a-form-item>
- </a-col>
- </a-row>
- <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="设计到期年限"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-date-picker
- style="width: 100%"
- :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
- v-decorator="['retirementDate']" />
- </a-form-item>
- </a-col>
- </a-row>
- </div>
- <title-divider title="检定周期信息" width="90px"></title-divider>
- <div>
- <!-- <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="计量设备编号"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- v-decorator="['cardNo']" />
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="准确度等级"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- v-decorator="['fdjxh']" />
- </a-form-item>
- </a-col>
- </a-row>
- <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="检定单位"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- v-decorator="['dph']" />
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="检定人"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- v-decorator="['zaiz']" />
- </a-form-item>
- </a-col>
- </a-row>
- <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="检定结论"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-select v-decorator="['rlType']" placeholder="请选择">
- <a-select-option
- v-for="(label,value) in rlTypeMap"
- :key="value"
- :label="label"
- :value="parseInt(value)">{{ label }}
- </a-select-option>
- </a-select>
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="是否周检查"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-select v-decorator="['color']" placeholder="请选择">
- <a-select-option
- v-for="(label,value) in colorMap"
- :key="value"
- :label="label"
- :value="parseInt(value)">{{ label }}
- </a-select-option>
- </a-select>
- </a-form-item>
- </a-col>
- </a-row>
- <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="检定证书编号"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- v-decorator="['sbdh']" />
- </a-form-item>
- </a-col>
- </a-row>-->
- <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="上次检定日期"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-date-picker
- style="width: 100%"
- :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
- v-decorator="['checkDate', {rules: [{required: useType == 4, message: '上次检定日期不能为空'}]}]" />
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="检定周期"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- style="width: 100%"
- suffix="月"
- :formatter="BaseTool.Amount.formatter"
- :parser="BaseTool.Amount.parser"
- v-decorator="['checkPeriod']" />
- </a-form-item>
- </a-col>
- </a-row>
- <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="检定有效期至"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-date-picker
- style="width: 100%"
- :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
- v-decorator="['nextCheckDate']" />
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="预警天数"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input-number
- style="width: 100%"
- :min="30"
- :step="1"
- :formatter="BaseTool.Amount.formatter"
- :parser="BaseTool.Amount.parser"
- v-decorator="['seatNumber']" />
- </a-form-item>
- </a-col>
- </a-row>
- <a-row>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="检定单位"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-input
- v-decorator="['dph']" />
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="是否需要检定"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-select @change="isMeasureChange" v-decorator="['isMeasure', { rules: [{required: true, message: '是否需要检定不能为空'}]}]" placeholder="请选择">
- <a-select-option
- v-for="(label,value) in yesNoMap"
- :key="value"
- :label="label"
- :value="parseInt(value)">{{ label }}
- </a-select-option>
- </a-select>
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="是否自检"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-select v-decorator="['isSelf', { rules: [{required: isSelfRequired, message: '是否需要检定不能为空'}]}]" placeholder="请选择">
- <a-select-option
- v-for="(label,value) in yesNoMap"
- :key="value"
- :label="label"
- :value="parseInt(value)">{{ label }}
- </a-select-option>
- </a-select>
- </a-form-item>
- </a-col>
- </a-row>
- </div>
- <title-divider title="文件信息" width="90px"></title-divider>
- <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="维保手册"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-upload
- :action="uploadUrl"
- :multiple="true"
- :file-list="this.defaultRepairFileList"
- @change="handleRepairFileChange"
- :headers="headers"
- >
- <a-button> <a-icon type="upload" /> 选择上传文件 </a-button>
- </a-upload>
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="使用手册"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-upload
- :action="uploadUrl"
- :multiple="true"
- :file-list="this.defaultUseFileList"
- @change="handleUseFileChange"
- :headers="headers"
- >
- <a-button> <a-icon type="upload" /> 选择上传文件 </a-button>
- </a-upload>
- </a-form-item>
- </a-col>
- </a-row>
- <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="验收文件"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-upload
- :action="uploadUrl"
- :multiple="true"
- :file-list="this.defaultRecheckFileList"
- @change="handleRecheckFileChange"
- :headers="headers"
- >
- <a-button> <a-icon type="upload" /> 选择上传文件 </a-button>
- </a-upload>
- </a-form-item>
- </a-col>
- <a-col :lg="12" :md="24" :sm="24">
- <a-form-item
- label="设备图片"
- :labelCol="BaseTool.Constant.labelCol"
- :wrapperCol="BaseTool.Constant.wrapperCol"
- >
- <a-upload
- :action="uploadUrl"
- :multiple="false"
- list-type="picture"
- :file-list="this.defaultSbFileList"
- @change="handleSbFileChange"
- accept="image/*"
- :headers="headers"
- >
- <a-button> <a-icon type="upload" /> 选择上传文件 </a-button>
- </a-upload>
- </a-form-item>
- </a-col>
- </a-row>
- </a-form>
- <sb-model-select-modal ref="sbModelSelectModal" @selected="handleSbModelSelected"/>
- <sb-info-select-modal ref="sbInfoSelectModal" @selected="handleSbSelectd"/>
- <firm-producer-select-modal ref="producerSelectModal" @selected="handleProducerSelected"/>
- <param-form ref="paramForm" @ok="handleParamList" />
- </a-card>
- </template>
- <script>
- import pick from 'lodash.pick'
- import { addSbInfo, updateSbInfo, fetchSbInfo, copySbInfo } from '@/api/sb/info'
- import { fetchSbTypeTree } from '@/api/sb/type'
- import { getSbPositionTree, querySbPosition } from '@/api/sb/position'
- import FirmProducerSelectModal from '@/views/firm/producer/modules/FirmProducerSelectModal'
- import SbGuigeSelectModal from '@/views/sb/guige/modules/SbGuigeSelectModal'
- import SbModelSelectModal from '@/views/sb/model/modules/SbModelSelectModal'
- import BaseTool from '../../../../utils/tool'
- import { queryUserDeptByUserDeptId } from '@/api/upms/user-dept'
- import { ACCESS_TOKEN } from '@/store/mutation-types'
- import Vue from 'vue'
- import { uploadUrl } from '@/api/upms/file'
- import { queryDept, getDeptsAllByParentId } from '@/api/upms/dept'
- import { queryUser } from '@/api/upms/user'
- import DetailList from '@/components/tools/DetailList'
- import SbInfoSelectModal from '@/views/sb/info/modules/SbInfoSelectModal'
- import ParamForm from './ParamForm'
- import { queryFirmProducer } from '@/api/firm/producer'
- const DetailListItem = DetailList.Item
- export default {
- name: 'BaseSbInfo',
- components: {
- FirmProducerSelectModal,
- SbGuigeSelectModal,
- SbModelSelectModal,
- SbInfoSelectModal,
- ParamForm,
- DetailList,
- DetailListItem
- },
- data () {
- return {
- confirmLoading: false,
- modalTitle: null,
- form: this.$form.createForm(this),
- areaList: {},
- companyList: {},
- paramList: [],
- projectList: {},
- deptList: {},
- groupList: {},
- visible: false,
- sbTypeTreeData: [],
- sbPositionData: [],
- // sbInfoTreeData: [],
- // sourceSbInfoTreeData: [],
- // sbPositionTreeData: [],
- repairDeptMap: {},
- depreciationTypeMap: {},
- sourceTypeMap: {},
- levelMap: {},
- rlTypeMap: {},
- colorMap: {},
- useTypeMap: {},
- statusMap: {},
- checkTypeMap: {},
- isChildMap: {},
- isShowMap: {},
- yesNoMap: {},
- lineMap: {},
- treeData: [],
- isFinancingMap: {},
- producerList: {},
- userList: {},
- unitMap: {},
- sbInfoSelectType: null,
- repairFileList: [], // 维修手册
- defaultRepairFileList: [],
- defaultUseFileList: [],
- defaultRecheckFileList: [],
- defaultSbFileList: [],
- useFileList: [], // 使用手册
- recheckFileList: [], // 验收手册
- sbFileList: [], // 设备图片,
- isSelfRequired: false, // 是否自检,
- uploadUrl: uploadUrl,
- qrcodesrc: null,
- id: null,
- fileList: [],
- type: null,
- headers: {
- Authorization: 'Bearer ' + Vue.ls.get(ACCESS_TOKEN)
- }
- }
- },
- props: {
- useType: {
- type: Number,
- default: 3
- },
- parentId: {
- type: String,
- default: null
- },
- parentName: {
- type: String,
- default: null
- }
- },
- created () {
- this.depreciationTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_DEPRECIATIONTYPE)
- this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_LEVEL)
- this.colorMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_COLOR)
- this.rlTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.RANLIAO_TYPE)
- this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_INFO_STATUS)
- this.checkTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_TYPE)
- this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_UNIT)
- this.sourceTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBTYPE_SOURCETYPE)
- this.useTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_USE_TYPE)
- this.isChildMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_IS_CHILD)
- this.isShowMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_IS_SHOW)
- this.yesNoMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
- this.isFinancingMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_IS_FINANCING)
- this.repairDeptMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_DEPT_CATEGORY)
- this.lineMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REMOTE_LINE)
- queryFirmProducer({}).then(res => {
- this.producerList = res.data
- })
- getSbPositionTree().then(res => {
- this.treeData = res.data
- })
- },
- methods: {
- base (record, type) {
- if (this.parentId) {
- const { form: { setFieldsValue } } = this
- // 日期处理
- this.$nextTick(() => {
- setFieldsValue(Object.assign({
- 'parentId': this.parentId,
- 'parentSbName': this.parentName,
- 'isChild': this.BaseTool.Object.getField(this.isChildMap, this.DictCache.VALUE.SB_IS_CHILD.IS_CHILD)
- }))
- })
- }
- this.setTree(record)
- // 清除文件列表
- this.visible = true
- // 选择框查询条件
- // 如果是空标识添加
- if (this.BaseTool.Object.isBlank(record)) {
- this.qrcodesrc = null
- this.modalTitle = '添加'
- this.clearFileList()
- return
- }
- this.useType = record.useType
- this.modalTitle = '编辑'
- this.id = record.id
- this.qrcodesrc = record.qrCode
- this.repairFileList = record.repairFileList
- this.useFileList = record.useFileList
- this.recheckFileList = record.recheckFileList
- this.sbFileList = record.sbFileList
- this.defaultRepairFileList = this.BaseTool.UPLOAD.transImg(this.repairFileList)
- this.defaultUseFileList = this.BaseTool.UPLOAD.transImg(this.useFileList)
- this.defaultRecheckFileList = this.BaseTool.UPLOAD.transImg(this.recheckFileList)
- this.defaultSbFileList = this.BaseTool.UPLOAD.transImg(this.sbFileList)
- this.paramList = JSON.parse(record.paramList)
- if (type === 1) {
- this.type = type
- this.modalTitle = '复制'
- this.qrcodesrc = null
- record.no = null
- this.clearFileList()
- }
- const { form: { setFieldsValue } } = this
- // 日期处理
- // record.buyDate = this.BaseTool.Moment(record.buyDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
- // record.startDate = this.BaseTool.Moment(record.startDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
- // record.nextCheckDate = this.BaseTool.Moment(record.nextCheckDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
- // record.guaranteeDate = this.BaseTool.Moment(record.guaranteeDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
- // record.retirementDate = this.BaseTool.Moment(record.retirementDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
- // record.lastRepaireTime = this.BaseTool.Moment(record.lastRepaireTime, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
- // record.lastBaoyangTime = this.BaseTool.Moment(record.lastBaoyangTime, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
- if (record.buyDate != null) {
- record.buyDate = this.BaseTool.Moment(record.buyDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
- this.$nextTick(() => {
- setFieldsValue(Object.assign(pick(record, [
- 'buyDate'
- ])))
- })
- }
- if (record.startDate != null) {
- record.startDate = this.BaseTool.Moment(record.startDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
- this.$nextTick(() => {
- setFieldsValue(Object.assign(pick(record, [
- 'startDate'
- ])))
- })
- }
- if (record.checkDate != null) {
- record.checkDate = this.BaseTool.Moment(record.checkDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
- this.$nextTick(() => {
- setFieldsValue(Object.assign(pick(record, [
- 'checkDate'
- ])))
- })
- }
- if (record.nextCheckDate != null) {
- record.nextCheckDate = this.BaseTool.Moment(record.nextCheckDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
- this.$nextTick(() => {
- setFieldsValue(Object.assign(pick(record, [
- 'nextCheckDate'
- ])))
- })
- }
- if (record.retirementDate != null) {
- record.retirementDate = this.BaseTool.Moment(record.retirementDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
- this.$nextTick(() => {
- setFieldsValue(Object.assign(pick(record, [
- 'retirementDate'
- ])))
- })
- }
- if (record.registerDate != null) {
- record.registerDate = this.BaseTool.Moment(record.registerDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
- this.$nextTick(() => {
- setFieldsValue(Object.assign(pick(record, [
- 'registerDate'
- ])))
- })
- }
- record.unitName = this.BaseTool.Object.getField(this.unitMap, record.unit)
- record.useTypeName = this.BaseTool.Object.getField(this.useTypeMap, record.useType)
- this.$nextTick(() => {
- setFieldsValue(Object.assign(pick(record, [
- 'id',
- 'no',
- 'checkType',
- 'parentId',
- 'positionNo',
- 'ppNo',
- 'parentSbName',
- 'isChild',
- 'isShow',
- 'isFinancing',
- 'financingNo',
- 'financingNoTwo',
- 'financingNoThird',
- 'financingNoFour',
- 'financingNoFive',
- 'name',
- 'baoyangTimes',
- 'model',
- 'cph',
- 'isMeasure',
- 'isSelf',
- 'positionId',
- 'producerName',
- 'useArea',
- 'useCompany',
- 'useProject',
- 'useDept',
- 'saveUser',
- 'repairUser',
- 'useGroup',
- 'typeId',
- 'level',
- 'initialValue',
- // 'cutValue',
- 'producerId',
- // 'sourceType',
- 'unit',
- 'buyDate',
- 'startDate',
- 'zbh',
- // 'wbFile',
- // 'useFile',
- // 'checkFile',
- // 'sbImage',
- 'status',
- 'remark',
- 'zzh',
- 'zz',
- 'zjm',
- 'jbdh',
- 'useType',
- 'cardNo',
- 'fdjxh',
- 'checkDate',
- 'checkPeriod',
- 'nextCheckDate',
- 'dph',
- 'zaiz',
- 'rlType',
- 'color',
- 'sbdh',
- 'seatNumber',
- 'registerNo',
- 'characterType',
- 'usedNo',
- 'supplier',
- 'repairUserSecond',
- 'batchNo',
- 'workYear',
- 'retirementDate',
- 'registerDate',
- 'repairDeptId'
- ])))
- })
- },
- save () {
- const { form: { validateFieldsAndScroll } } = this
- this.confirmLoading = true
- validateFieldsAndScroll((errors, values) => {
- if (errors) {
- this.confirmLoading = false
- this.$message.error(errors)
- return
- }
- // 日期数据的处理
- values.buyDate = BaseTool.Date.formatter(values.buyDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
- values.startDate = BaseTool.Date.formatter(values.startDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
- values.checkDate = BaseTool.Date.formatter(values.checkDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
- values.nextCheckDate = BaseTool.Date.formatter(values.nextCheckDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
- values.guaranteeDate = BaseTool.Date.formatter(values.guaranteeDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
- values.retirementDate = BaseTool.Date.formatter(values.retirementDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
- if (values.registerDate != null) {
- values.registerDate = BaseTool.Date.formatter(values.registerDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
- }
- values.lastRepaireTime = this.BaseTool.Date.formatter(values.lastRepaireTime, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
- values.lastBaoyangTime = this.BaseTool.Date.formatter(values.lastBaoyangTime, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
- values.spDate = this.BaseTool.Date.formatter(values.spDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
- values.jbdDate = this.BaseTool.Date.formatter(values.jbdDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
- values.sbdDate = this.BaseTool.Date.formatter(values.sbdDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
- values.sbDate = this.BaseTool.Date.formatter(values.sbDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
- // 上传文件
- values.repairFileList = this.repairFileList
- values.useFileList = this.useFileList
- values.recheckFileList = this.recheckFileList
- values.sbFileList = this.sbFileList
- values.paramList = JSON.stringify(this.paramList)
- values.useType = this.useType
- if (values.isChild === '父设备') {
- values.isChild = 0
- } else if (values.isChild === '子设备') {
- values.isChild = 1
- }
- if (this.BaseTool.String.isBlank(values.id)) {
- addSbInfo(values)
- .then(() => {
- this.handleCancel(values)
- }).catch(() => {
- this.confirmLoading = false
- })
- } else {
- if (this.type == null) {
- updateSbInfo(values)
- .then(() => {
- this.handleCancel(values)
- }).catch(() => {
- this.confirmLoading = false
- })
- } else {
- copySbInfo(values)
- .then(() => {
- this.handleCancel(values)
- }).catch(() => {
- this.confirmLoading = false
- })
- }
- }
- })
- },
- getQrcodeSrc () {
- // console.log(111, 22)
- },
- handleCancel () {
- this.visible = false
- this.confirmLoading = false
- this.form.resetFields()
- this.$emit('ok')
- },
- handleFresh () {
- fetchSbInfo({ id: this.id }).then(res => {
- const { form: { setFieldsValue } } = this
- const record = res.data
- this.$nextTick(() => {
- setFieldsValue(Object.assign(pick(record, [
- 'zjm',
- 'jbdh'
- ])))
- })
- })
- },
- setTree (record = {}) {
- fetchSbTypeTree().then(res => {
- this.sbTypeTreeData = res.data
- })
- querySbPosition().then(res => {
- this.sbPositionData = res.data
- })
- // getSbInfoTree({ id: record.id }).then(res => {
- // this.sbInfoTreeData = res.data
- // this.sourceSbInfoTreeData = res.data
- // })
- // getSbPositionTree().then(res => {
- // this.sbPositionTreeData = res.data
- // })
- queryDept({ nature: this.DictCache.VALUE.SYS_DEPT_NATURE.JITUAN }).then(res => {
- this.areaList = res.data
- })
- if (record.useArea != null) {
- getDeptsAllByParentId({ deptId: record.useArea, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.FEN_GONG_SI }).then(res => {
- this.companyList = res.data
- })
- getDeptsAllByParentId({ deptId: record.useCompany, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.XIANG_MU_BU }).then(res => {
- this.projectList = res.data
- })
- getDeptsAllByParentId({ deptId: record.useProject, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.BU_MEN }).then(res => {
- this.deptList = res.data
- })
- getDeptsAllByParentId({ deptId: record.useDept, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.BAN_ZU }).then(res => {
- this.groupList = res.data
- })
- queryUser({ }).then(res => {
- this.userList = res.data
- })
- }
- queryUser({ }).then(res => {
- this.userList = res.data
- })
- },
- handleSbModelSelect () {
- const modal = this.$refs.sbModelSelectModal
- modal.base()
- },
- handleSbModelSelected (keys, rows) {
- const [ key ] = keys
- const [ row ] = rows
- const { form: { setFieldsValue } } = this
- this.$nextTick(() => {
- setFieldsValue({
- 'modelId': key,
- 'name': row.name,
- 'model': row.model,
- 'nameModel': row.nameModel,
- 'typeId': row.typeId,
- 'typeName': row.typeName,
- 'level': row.level,
- 'initialValue': row.value,
- 'useType': row.useType,
- 'useTypeName': this.BaseTool.Object.getField(this.useTypeMap, row.useType),
- 'producerId': row.producerId,
- 'producerName': row.producerName,
- 'unit': row.unit,
- 'unitName': this.BaseTool.Object.getField(this.unitMap, row.unit)
- })
- })
- },
- beforeRecheckFileListUpload (file) {
- const reg = /\.(xls|xlsx)(\?.*)?$/
- return new Promise((resolve, reject) => {
- if (reg.test(file.name)) {
- this.recheckFileList = [file]
- return true
- } else {
- this.$message.error(`请上传正确的xls|xlsx文件`)
- reject(new Error('请上传正确的xls|xlsx文件'))
- return false
- }
- })
- },
- beforeUploadPic (file) {
- const reg = /\.(jpg|jpeg|png)(\?.*)?$/
- return new Promise((resolve, reject) => {
- if (reg.test(file.name)) {
- this.sbFileList = [file]
- return true
- } else {
- this.$message.error(`请上传正确的jpg|jpeg|png文件`)
- reject(new Error('请上传正确的jpg|jpeg|png文件'))
- return false
- }
- })
- },
- clearFileList () {
- this.repairFileList = []
- this.useFileList = []
- this.recheckFileList = []
- this.sbFileList = []
- },
- handleRepairFileChange (info) {
- this.defaultRepairFileList = info.fileList
- this.repairFileList = this.setFileList(info, 1)
- },
- handleUseFileChange (info) {
- this.defaultUseFileList = info.fileList
- this.useFileList = this.setFileList(info, 2)
- },
- handleAreaChange (value) {
- getDeptsAllByParentId({ deptId: value, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.FEN_GONG_SI }).then(res => {
- this.companyList = res.data
- })
- },
- handleCompanyChange (value) {
- getDeptsAllByParentId({ deptId: value, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.XIANG_MU_BU }).then(res => {
- this.projectList = res.data
- })
- },
- handleProjectChange (value) {
- getDeptsAllByParentId({ deptId: value, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.BU_MEN }).then(res => {
- this.deptList = res.data
- })
- },
- handleDeptChange (value) {
- getDeptsAllByParentId({ deptId: value, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.BAN_ZU }).then(res => {
- this.groupList = res.data
- })
- },
- handleGroupChange (value) {
- queryUserDeptByUserDeptId({ deptId: value }).then(res => {
- this.userList = res.data
- })
- },
- handleRecheckFileChange (info) {
- this.defaultRecheckFileList = info.fileList
- this.recheckFileList = this.setFileList(info, 3)
- },
- handleSbFileChange (info) {
- this.defaultSbFileList = info.fileList
- this.sbFileList = this.setFileList(info, 4)
- },
- clearParent () {
- const { form: { setFieldsValue } } = this
- // 日期处理
- this.$nextTick(() => {
- setFieldsValue(Object.assign({
- 'parentId': null,
- 'parentSbName': null
- }))
- })
- },
- // 主子设备切换
- childChange (value) {
- if (value === this.DictCache.VALUE.SB_IS_CHILD.IS_PARENT || value === this.DictCache.VALUE.SB_IS_CHILD.IS_NORMAL) {
- const { form: { setFieldsValue } } = this
- // 日期处理
- this.$nextTick(() => {
- setFieldsValue(Object.assign({
- 'parentId': null,
- 'parentSbName': null
- }))
- })
- }
- },
- // 设置为需要检定的,是否自检也要设置
- isMeasureChange (value) {
- if (value === this.DictCache.VALUE.YES_NO.YES) {
- this.isSelfRequired = true
- } else {
- this.isSelfRequired = false
- }
- },
- handleSbSelect () {
- this.$refs.sbInfoSelectModal.base({}, { isChild: this.DictCache.VALUE.SB_IS_CHILD.IS_PARENT })
- },
- handleSbSelectd (keys, rows) {
- const [ key ] = keys
- const [ row ] = rows
- const { form: { setFieldsValue } } = this
- // 日期处理
- this.$nextTick(() => {
- setFieldsValue(Object.assign({
- 'parentId': key,
- 'parentSbName': row.name,
- 'ppNo': row.positionNo
- }))
- })
- },
- handleChange (value) {
- this.useType = value
- },
- handleProducerSelect () {
- const modal = this.$refs.producerSelectModal
- modal.base({}, { type: 1 })
- },
- handleProducerSelected (record, selectedRowKeys, selectedRow) {
- const { form: { setFieldsValue } } = this
- const [ key ] = selectedRowKeys
- const [ row ] = selectedRow
- setFieldsValue({
- 'producerId': key,
- 'producerName': row.name
- })
- },
- filterOptionProducer (input, option) {
- return (
- option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
- )
- },
- setFileList (info, type) {
- // { file, fileList }
- const file = info.file
- // console.log('file: ' + JSON.stringify(file))
- const fileList = info.fileList
- // fileList = fileList.slice(-2)
- // console.log(111, this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type))
- if (file.status === 'done') {
- return this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type)
- } else if (file.status === 'removed') {
- return this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type)
- } else if (file.status === 'error') {
- this.$message.error('上传失败')
- return null
- }
- },
- handlePoint () {
- const { form: { getFieldValue } } = this
- const zjm = getFieldValue('zjm')
- const jbdh = getFieldValue('jbdh')
- const a = document.createElement('a')
- a.href = '/hitch-screen/point.html?id=' + this.id + '&zjm=' + zjm + '&jbdh=' + jbdh
- a.target = '_blank'
- a.click()
- },
- handleParam () {
- const modal = this.$refs.paramForm
- modal.base(this.model)
- },
- handleParamList (values) {
- // console.log(values)
- if (this.paramList == null) {
- this.paramList = []
- }
- this.paramList.push(values)
- },
- handleDelParam (index) {
- // console.log(index)
- this.paramList.splice(index, 1)
- }
- }
- }
- </script>
|