| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890 |
- <template>
- <el-dialog
- v-loading="loading"
- :title="title"
- :visible.sync="dialogVisible"
- :close-on-click-modal="false"
- :close-on-press-escape="false"
- :show-close="false"
- append-to-body
- fullscreen
- class="dialog paper-detail-dialog"
- top="0"
- >
- <div slot="title" class="dialog-title">
- <span class="dialogtitle">{{ title }}</span>
- <div>
- <ibps-toolbar :actions="toolbars" @action-event="handleActionEvent" />
- </div>
- </div>
- <div class="container">
- <div class="left" :style="{ width: initWidth }">
- <div class="form">
- <el-form
- ref="form"
- label-width="120px"
- :model="form"
- :rules="rules"
- :hide-required-asterisk="true"
- >
- <el-row type="flex" justify="center" :gutter="20">
- <el-col :span="16">
- <el-row :gutter="20">
- <el-col :span="8">
- <el-form-item label="设备验收记录:" prop="sheBeiMingChen">
- <ibps-custom-dialog
- v-model="form.sheBeiMingChen"
- size="mini"
- template-key="sbysdhk"
- :disabled="readonly"
- type="dialog"
- class="custom-dialog"
- placeholder="请选择"
- icon="el-icon-search"
- style="width: 100%"
- @change-link-data="sheBeiMingChenChange"
- />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="设备名称:" prop="sheBeiMingCheng">
- <template slot="label">
- <span class="required">设备名称:</span>
- </template>
- <el-input
- v-if="!readonly"
- v-model="form.sheBeiMingCheng"
- size="mini"
- />
- <span v-else>{{ form.sheBeiMingCheng || '/' }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="8">
- <el-form-item label="建档部门:" prop="bianZhiBuMen">
- <template slot="label">
- <span class="required">建档部门:</span>
- </template>
- <ibps-user-selector
- v-model="form.bianZhiBuMen"
- type="position"
- readonly-text="text"
- :disabled="readonly"
- :multiple="false"
- size="mini"
- :filter="filter"
- filtrate
- style="width: 100%"
- />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="建档人:" prop="bianZhiRen">
- <ibps-user-selector
- v-model="form.bianZhiRen"
- type="user"
- readonly-text="text"
- :disabled="true"
- :multiple="false"
- size="mini"
- style="width: 100%"
- :filter="filter"
- filtrate
- />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="建档时间:" prop="bianZhiShiJian">
- <template slot="label">
- <span class="required">建档时间:</span>
- </template>
- <el-date-picker
- v-if="!readonly"
- v-model="form.bianZhiShiJian"
- style="width: 100%"
- type="datetime"
- placeholder="选择日期时间"
- default-time="12:00:00"
- :readonly="readonly"
- value-format="yyyy-MM-dd HH:mm"
- size="mini"
- />
- <span v-else>{{ form.bianZhiShiJian || '/' }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col v-if="!hideSysDeviceNo" :span="8">
- <el-form-item label="设备编号:" prop="sheBeiShiBieH">
- <template slot="label">
- <span>设备编号</span>
- <el-tooltip effect="dark" placement="top">
- <div slot="content">设备编号由系统自动生成。</div>
- <i class="el-icon-question question-icon">:</i>
- </el-tooltip>
- </template>
- <span>{{ form.sheBeiShiBieH || '/' }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="原设备编号:" prop="yuanSheBeiBian">
- <template slot="label">
- <span class="required"
- >{{
- hideSysDeviceNo ? '设备编号' : '原设备编号'
- }}:</span
- >
- </template>
- <el-input
- v-if="
- !readonly &&
- (!originalEditReadOnly ||
- actionDialog === 'customAdd')
- "
- v-model="form.yuanSheBeiBian"
- size="mini"
- />
- <span v-else>{{ form.yuanSheBeiBian || '/' }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="设备状态:" prop="sheBeiZhuangTa">
- <span>{{ showState || '/' }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="8">
- <el-form-item label="设备类型:" prop="sheBeiLeiXing">
- <el-select
- v-if="!readonly"
- v-model="form.sheBeiLeiXing"
- placeholder="请选择"
- size="mini"
- style="width: 100%"
- >
- <el-option
- v-for="(v, k) in typeList"
- :key="k"
- :label="v"
- :value="k"
- />
- </el-select>
- <span v-else>{{
- typeList[form.sheBeiLeiXing] ||
- form.sheBeiLeiXing ||
- '/'
- }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="规格型号:" prop="guiGeXingHao">
- <template slot="label">
- <span class="required">规格型号:</span>
- </template>
- <el-input
- v-if="!readonly"
- v-model="form.guiGeXingHao"
- size="mini"
- />
- <span v-else>{{ form.guiGeXingHao || '/' }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="接收时状态:" prop="jieShouZhuangTai">
- <template slot="label">
- <span class="required">接收时状态:</span>
- </template>
- <el-select
- v-if="!readonly"
- v-model="form.jieShouZhuangTai"
- placeholder="请选择"
- size="mini"
- style="width: 100%"
- >
- <el-option
- v-for="item in ['新设备', '二手或翻新设备']"
- :key="item"
- :label="item"
- :value="item"
- />
- </el-select>
- <span v-else>{{ form.jieShouZhuangTai || '/' }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="8">
- <el-form-item label="保管人:" prop="guanLiRen">
- <template slot="label">
- <span class="required">保管人:</span>
- </template>
- <ibps-user-selector
- v-model="form.guanLiRen"
- type="user"
- readonly-text="text"
- :disabled="readonly"
- :multiple="false"
- size="mini"
- :filter="filter"
- filtrate
- style="width: 100%"
- @change-link-data="changeGuanLiRen"
- />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="放置地点:" prop="cunFangWeiZhi">
- <template slot="label">
- <span class="required">放置地点:</span>
- </template>
- <ibps-custom-dialog
- v-model="form.cunFangWeiZhi"
- size="mini"
- template-key="fjxzkdd"
- :disabled="readonly"
- type="dialog"
- class="custom-dialog"
- placeholder="请选择"
- icon="el-icon-search"
- style="width: 100%"
- />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="固定资产号:">
- <el-input
- v-if="!readonly"
- v-model="form.ziChanBianHao"
- size="mini"
- />
- <span v-else>{{ form.ziChanBianHao || '/' }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="8">
- <el-form-item label="厂家/品牌:">
- <el-input
- v-if="!readonly"
- v-model="form.changShang"
- size="mini"
- />
- <span v-else>{{ form.changShang || '/' }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item prop="chuChangRiQi">
- <template slot="label">
- <span>出厂日期</span>
- <el-tooltip
- effect="dark"
- content="根据使用年限,提前一个月推送提醒"
- placement="top"
- >
- <i class="el-icon-question question-icon">:</i>
- </el-tooltip>
- </template>
- <el-date-picker
- v-if="!readonly"
- v-model="form.chuChangRiQi"
- style="width: 100%"
- type="date"
- placeholder="选择日期"
- :readonly="readonly"
- value-format="yyyy-MM-dd"
- size="mini"
- />
- <span v-else>{{ form.chuChangRiQi || '/' }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="出厂编号:" prop="jiShenXuHao">
- <template slot="label">
- <span :class="dynamicRequiredFields ? 'required' : ''"
- >出厂编号:</span
- >
- </template>
- <el-input
- v-if="!readonly"
- v-model="form.jiShenXuHao"
- size="mini"
- />
- <span v-else>{{ form.jiShenXuHao || '/' }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="8">
- <el-form-item label="供应商:" prop="shiFouQiJianH">
- <template slot="label">
- <span :class="dynamicRequiredFields ? 'required' : ''"
- >供应商:</span
- >
- </template>
- <ibps-custom-dialog
- v-model="form.shiFouQiJianH"
- size="mini"
- template-key="gysxxdhk"
- :disabled="readonly"
- type="dialog"
- class="custom-dialog"
- placeholder="请选择"
- icon="el-icon-search"
- style="width: 100%"
- @change-link-data="shiFouQiJianHChange"
- />
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="供应商电话:">
- <el-input
- v-if="!readonly"
- v-model="form.lianXiFangShi"
- size="mini"
- />
- <span v-else>{{ form.lianXiFangShi || '/' }}</span>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="注册证号:">
- <el-input
- v-if="!readonly"
- v-model="form.zhuCeZhengHao"
- size="mini"
- />
- <span v-else>{{ form.zhuCeZhengHao || '/' }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20" v-if="showzhuCeYouXiaoQi">
- <el-col :span="8">
- <el-form-item label="注册证有效期:">
- <el-date-picker
- v-if="!readonly"
- v-model="form.zhuCeYouXiaoQi"
- style="width: 100%"
- type="date"
- placeholder="选择日期"
- :readonly="readonly"
- value-format="yyyy-MM-dd"
- size="mini"
- />
- <span v-else>{{ form.zhuCeYouXiaoQi || '/' }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col v-if="hasFuZeRenDianHua" :span="8">
- <el-form-item label="负责人电话:">
- <el-input
- v-if="!readonly"
- v-model="form.fuZeRenDianHua"
- size="mini"
- />
- <span v-else>{{ form.fuZeRenDianHua || '/' }}</span>
- </el-form-item>
- </el-col>
- <el-col v-if="hasChangJiaLianXiRen" :span="10">
- <el-form-item label="厂家联系人及电话:">
- <el-input
- v-if="!readonly"
- v-model="form.changJiaLianXiRen"
- size="mini"
- />
- <span v-else>{{ form.changJiaLianXiRen || '/' }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- </el-col>
- <el-col :span="8">
- <el-row v-if="photos.length > 0">
- <el-col>
- <el-carousel
- trigger="click"
- height="250px"
- indicator-position="none"
- >
- <el-carousel-item v-if="photos.length == 0">
- <el-empty description="暂无图片" />
- </el-carousel-item>
- <template v-else>
- <el-carousel-item v-for="item in photos" :key="item.id">
- <el-image
- style="width: 100%; height: 100%"
- :src="item.url"
- fit="contain"
- :preview-src-list="photos.map((item) => item.url)"
- />
- </el-carousel-item>
- </template>
- </el-carousel>
- </el-col>
- </el-row>
- </el-col>
- </el-row>
- </el-form>
- </div>
- <div class="tabs">
- <el-row>
- <el-col>
- <el-tabs v-model="activeName" @tab-click="handleClick">
- <el-tab-pane label="基本信息" name="one">
- <el-form
- ref="formBase"
- label-width="100px"
- :model="form"
- :rules="rules"
- :hide-required-asterisk="true"
- >
- <el-row :gutter="20">
- <!-- 第一列 -->
- <el-col :span="8">
- <el-row>
- <el-col>
- <el-form-item label="购进日期:" prop="gouJinRiQi">
- <template slot="label">
- <span
- :class="
- dynamicRequiredFields ? 'required' : ''
- "
- >购进日期:</span
- >
- </template>
- <el-date-picker
- v-if="!readonly"
- v-model="form.gouJinRiQi"
- style="width: 100%"
- type="date"
- placeholder="选择日期"
- :readonly="readonly"
- value-format="yyyy-MM-dd"
- size="mini"
- />
- <span v-else>{{ form.gouJinRiQi || '/' }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col>
- <el-form-item label="接收日期:">
- <el-date-picker
- v-if="!readonly"
- v-model="form.jieShouRiQi"
- style="width: 100%"
- type="date"
- placeholder="选择日期"
- :readonly="readonly"
- value-format="yyyy-MM-dd"
- size="mini"
- />
- <span v-else>{{ form.jieShouRiQi || '/' }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col>
- <el-form-item label="验收日期:" prop="yanShouRiQi">
- <template slot="label">
- <span
- :class="
- dynamicRequiredFields ? 'required' : ''
- "
- >验收日期:</span
- >
- </template>
- <el-date-picker
- v-if="!readonly"
- v-model="form.yanShouRiQi"
- style="width: 100%"
- type="date"
- placeholder="选择日期"
- :readonly="readonly"
- value-format="yyyy-MM-dd"
- size="mini"
- />
- <span v-else>{{ form.yanShouRiQi || '/' }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col>
- <el-form-item label="投入日期:" prop="qiYongRiQi">
- <template slot="label">
- <span
- :class="
- dynamicRequiredFields ? 'required' : ''
- "
- >投入日期:</span
- >
- </template>
- <el-date-picker
- v-if="!readonly"
- v-model="form.qiYongRiQi"
- style="width: 100%"
- type="date"
- placeholder="选择日期"
- :readonly="readonly"
- value-format="yyyy-MM-dd"
- size="mini"
- />
- <span v-else>{{ form.qiYongRiQi || '/' }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col>
- <el-form-item label="核查日期:">
- <el-date-picker
- v-if="!readonly"
- v-model="form.biXuSheShi"
- style="width: 100%"
- type="date"
- placeholder="选择日期"
- :readonly="readonly"
- value-format="yyyy-MM-dd"
- size="mini"
- />
- <span v-else>{{ form.biXuSheShi || '/' }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col>
- <el-form-item label="核查人:">
- <ibps-user-selector
- v-model="form.biXuDeHuanJin"
- type="user"
- readonly-text="text"
- :disabled="readonly"
- :multiple="false"
- size="mini"
- style="width: 100%"
- :filter="filter"
- filtrate
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col>
- <el-form-item label="电源要求:">
- <el-input
- v-if="!readonly"
- v-model="form.dianYuanYaoQiu"
- size="mini"
- />
- <span v-else>{{
- form.dianYuanYaoQiu || '/'
- }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col>
- <el-form-item label="环境要求:">
- <el-input
- v-if="!readonly"
- v-model="form.huanJingYaoQiu"
- size="mini"
- />
- <span v-else>{{
- form.huanJingYaoQiu || '/'
- }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col>
- <el-form-item label="使用年限(年):">
- <el-input
- v-if="!readonly"
- v-model="form.heChaXiaoZhun"
- size="mini"
- type="number"
- />
- <span v-else
- >{{ form.heChaXiaoZhun || '/' }}
- </span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col>
- <el-form-item label="资产原值(元):">
- <el-input
- v-if="!readonly"
- v-model="form.ziChanYuanZhi"
- size="mini"
- type="number"
- />
- <span v-else
- >{{ form.ziChanYuanZhi || '/' }}
- </span>
- </el-form-item>
- </el-col>
- </el-row>
- </el-col>
- <!-- 第二列 -->
- <el-col :span="8">
- <el-row>
- <el-col>
- <el-form-item label="是否维护:">
- <el-select
- v-if="!readonly"
- v-model="form.shiFouWeiHu"
- placeholder="请选择"
- size="mini"
- style="width: 100%"
- >
- <el-option
- v-for="item in ['是', '否']"
- :key="item"
- :label="item"
- :value="item"
- />
- </el-select>
- <span v-else>{{ form.shiFouWeiHu || '/' }} </span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col>
- <el-form-item label="岗位/分组:">
- <ibps-custom-dialog
- v-model="form.weiHuFangShi"
- size="mini"
- :template-key="
- config ? 'gwzzdhkrcwh' : 'sbbqdhk'
- "
- multiple
- :disabled="readonly"
- type="dialog"
- class="custom-dialog"
- placeholder="请选择"
- icon="el-icon-search"
- style="width: 100%"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col>
- <el-form-item label="是否24H开机:">
- <el-select
- v-if="!readonly"
- v-model="form.jianKongYiJu"
- placeholder="请选择"
- size="mini"
- style="width: 100%"
- >
- <el-option
- v-for="item in ['是', '否']"
- :key="item"
- :label="item"
- :value="item"
- />
- </el-select>
- <span v-else
- >{{ form.jianKongYiJu || '/' }}
- </span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row v-if="form.jianKongYiJu === '否'">
- <el-col>
- <el-form-item label="开机时间:">
- <el-time-picker
- v-if="!readonly"
- v-model="form.kaiShiShiYong"
- placeholder="任意时间点"
- size="mini"
- style="width: 100%"
- value-format="HH:mm:ss"
- />
- <span v-else
- >{{ form.kaiShiShiYong || '/' }}
- </span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row v-if="form.jianKongYiJu === '否'">
- <el-col>
- <el-form-item label="关机时间:">
- <el-time-picker
- v-if="!readonly"
- v-model="form.shiJiShiYongF"
- placeholder="任意时间点"
- size="mini"
- style="width: 100%"
- value-format="HH:mm:ss"
- />
- <span v-else
- >{{ form.shiJiShiYongF || '/' }}
- </span></el-form-item
- >
- </el-col>
- </el-row>
- <!-- <el-row>
- <el-col>
- <el-form-item label="是否限用:">
- <el-select v-model="form.xiaoZhunWuCha" placeholder="请选择" size="mini" style="width:100%">
- <el-option
- v-for="item in ['是','否']"
- :key="item"
- :label="item"
- :value="item"
- />
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row v-if="form.xiaoZhunWuCha==='是'">
- <el-col>
- <el-form-item label="限用范围:">
- <el-input v-model="form.caiGouHeTong" size="mini" />
- </el-form-item>
- </el-col>
- </el-row> -->
- <el-row>
- <!-- todo -->
- <el-col>
- <el-alert
- title="开关机时间配置说明"
- type="success"
- description="日保养、按需保养、这些周期,如果配置了开关机时间,在设备使用与维护时会自动带出"
- :closable="false"
- />
- </el-col>
- </el-row>
- <el-row>
- <el-col>
- <el-form-item
- :style="{ 'margin-top': '10px' }"
- label="备注:"
- >
- <el-input
- v-model="form.remark"
- size="mini"
- type="textarea"
- :autosize="{ maxRows: 4, minRows: 2 }"
- v-if="!readonly"
- />
- <span v-else>{{ form.remark }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- </el-col>
- <!-- 第三列 -->
- <el-col :span="8">
- <el-row>
- <el-col>
- <el-form-item
- label="是否校准:"
- prop="shiFouXiaoZhun"
- label-width="140px"
- >
- <el-select
- v-if="!readonly"
- v-model="form.shiFouXiaoZhun"
- placeholder="请选择"
- size="mini"
- style="width: 100%"
- >
- <el-option
- v-for="item in ['是', '否']"
- :key="item"
- :label="item"
- :value="item"
- />
- </el-select>
- <span v-else
- >{{ form.shiFouXiaoZhun || '/' }}
- </span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row v-if="form.shiFouXiaoZhun === '是'">
- <el-col>
- <el-form-item
- label="检定/校准周期(月):"
- label-width="140px"
- prop="xiaoZhunZQ"
- >
- <template slot="label">
- <span
- :class="
- dynamicRequiredFields ? 'required' : ''
- "
- >检定/校准周期(月):</span
- >
- </template>
- <el-input
- v-if="!readonly"
- v-model="form.xiaoZhunZQ"
- size="mini"
- type="number"
- style="width: 100%"
- />
- <span v-else>{{ form.xiaoZhunZQ || '/' }} </span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row v-if="form.shiFouXiaoZhun === '是'">
- <el-col>
- <el-form-item
- label="检定/校准单位:"
- label-width="140px"
- >
- <ibps-custom-dialog
- v-model="form.shiYongKeShi"
- size="mini"
- template-key="gysxxdhk"
- :disabled="readonly"
- type="dialog"
- class="custom-dialog"
- placeholder="请选择"
- icon="el-icon-search"
- style="width: 100%"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row v-if="form.shiFouXiaoZhun === '是'">
- <el-col>
- <el-form-item
- label="最近校准时间:"
- label-width="140px"
- prop="yiXiaoRiQi"
- >
- <template slot="label">
- <span
- :class="
- dynamicRequiredFields ? 'required' : ''
- "
- >最近校准时间:</span
- >
- </template>
- <el-date-picker
- v-if="!readonly"
- v-model="form.yiXiaoRiQi"
- style="width: 100%"
- type="date"
- placeholder="选择日期"
- :readonly="readonly"
- value-format="yyyy-MM-dd"
- size="mini"
- />
- <span v-else>{{ form.yiXiaoRiQi || '/' }} </span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row v-if="form.shiFouXiaoZhun === '是'">
- <el-col>
- <el-form-item
- label="检定/校准有效期至:"
- label-width="140px"
- prop="xiaoZhunYouXia"
- >
- <template slot="label">
- <span
- :class="
- dynamicRequiredFields ? 'required' : ''
- "
- >检定/校准有效期至:</span
- >
- </template>
- <el-date-picker
- v-if="!readonly"
- v-model="form.xiaoZhunYouXia"
- style="width: 100%"
- type="date"
- placeholder="选择日期"
- :readonly="readonly"
- value-format="yyyy-MM-dd"
- size="mini"
- />
- <span v-else
- >{{ form.xiaoZhunYouXia || '/' }}
- </span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row v-if="form.shiFouXiaoZhun === '是'">
- <el-col>
- <el-form-item
- label="检定/校准证书编号:"
- label-width="140px"
- >
- <el-input
- v-if="!readonly"
- v-model="form.zhengShuBianHa"
- size="mini"
- />
- <span v-else
- >{{ form.zhengShuBianHa || '/' }}
- </span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row v-if="false">
- <el-col>
- <el-form-item label="校准机构:">
- <el-input
- v-if="!readonly"
- v-model="form.shiWuShuoMing"
- size="mini"
- />
- <span v-else
- >{{ form.shiWuShuoMing || '/' }}
- </span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row v-if="form.shiFouXiaoZhun === '是'">
- <el-col>
- <el-form-item
- label="检定/校准参数:"
- label-width="140px"
- >
- <el-input
- v-model="form.jianDingXiao"
- size="mini"
- type="textarea"
- :autosize="{ maxRows: 4, minRows: 2 }"
- v-if="!readonly"
- />
- <span v-else>{{ form.jianDingXiao }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row v-if="form.shiFouXiaoZhun === '是'">
- <el-col>
- <el-form-item
- label="预期测量范围:"
- label-width="140px"
- >
- <el-input
- v-model="form.ceLiangGongZuo"
- type="textarea"
- size="mini"
- :autosize="{ maxRows: 4, minRows: 2 }"
- v-if="!readonly"
- />
- <span v-else>{{ form.ceLiangGongZuo }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row v-if="form.shiFouXiaoZhun === '是'">
- <el-col>
- <el-form-item
- label="U/精确度/最大允差:"
- label-width="140px"
- >
- <el-input
- v-model="form.zuiDaYunCha"
- type="textarea"
- size="mini"
- style="width: 100%"
- :autosize="{ maxRows: 4, minRows: 2 }"
- v-if="!readonly"
- />
- <span v-else>{{ form.zuiDaYunCha }}</span>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row v-if="form.shiFouXiaoZhun === '是'">
- <el-col>
- <el-form-item label="修正值:" label-width="140px">
- <el-input
- v-if="!readonly"
- v-model="form.xiuZhengZhiXiu"
- size="mini"
- />
- <span v-else
- >{{ form.xiuZhengZhiXiu || '/' }}
- </span>
- </el-form-item>
- </el-col>
- </el-row>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :span="24">
- <el-alert
- :closable="false"
- type="success"
- style="margin-bottom: 20px"
- >设备照片及相关附件</el-alert
- >
- </el-col>
- <el-col :span="24">
- <el-form-item label="设备图片:">
- <ibps-image
- v-model="form.beiZhu"
- height="160"
- width="160"
- accept=".jpg,.jpeg,.png,.gif,.bmp,.webp"
- multiple
- download
- :disabled="readonly"
- size=""
- />
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <el-form-item label="附件上传:">
- <ibps-attachment
- v-model="form.yqzp"
- :download="true"
- multiple
- accept="*"
- :readonly="readonly"
- style="width: 100%"
- />
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <el-form-item label="资质证书:">
- <ibps-attachment
- v-model="form.faPiao"
- :download="true"
- multiple
- accept="*"
- :readonly="readonly"
- style="width: 100%"
- />
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <el-form-item
- v-if="!hidefuJianShang"
- label="设备说明书:"
- >
- <ibps-attachment
- v-model="form.fuJianShang"
- :download="true"
- multiple
- accept="*"
- :readonly="readonly"
- style="width: 100%"
- />
- </el-form-item>
- </el-col>
- <!-- <el-col :span="24">
- <el-form-item label="说明书分类:">
- <SelectType :field="{}" @change-data="changeData" />
- </el-form-item>
- </el-col>
- <el-col :span="24">
- <el-form-item label="文件路径:">
- <span>{{ form.wenJianXiLei }}</span>
- </el-form-item>
- </el-col> -->
- </el-row>
- </el-form>
- </el-tab-pane>
- <el-tab-pane
- v-for="item in tabItems"
- :key="item.name"
- :label="item.label"
- :name="item.name"
- :disabled="item.isKeepAlive && !isEdit"
- >
- <template v-if="item.isKeepAlive">
- <!-- 使用 v-if 配合 keep-alive 实现按需加载 -->
- <keep-alive>
- <component
- :is="item.component"
- v-if="activeName === item.name"
- :params="form"
- :hideSysDeviceNo="hideSysDeviceNo"
- />
- </keep-alive>
- </template>
- <template v-else>
- <component
- :is="item.component"
- v-if="activeName === item.name"
- :ref="item.ref"
- :readonly="readonly"
- :list-data="form[item.data]"
- />
- </template>
- </el-tab-pane>
- </el-tabs>
- </el-col>
- </el-row>
- </div>
- </div>
- </div>
- </el-dialog>
- </template>
- <script>
- import dayjs from 'dayjs'
- import {
- getequipmentCard,
- saveEquipmentCard
- } from '@/api/platform/device/device'
- import { getImage } from '@/api/platform/file/attachment'
- import { getSetting } from '@/utils/query'
- export default {
- components: {
- IbpsUserSelector: () => ({
- component: import('@/business/platform/org/selector'),
- delay: 200
- }),
- Maintenance: () => import('./maintenance.vue'),
- MoreDevices: () => import('./moreDevices.vue'),
- ScrappedRecord: () => import('./scrappedRecord.vue'),
- MaintenanceRecord: () => import('./maintenanceRecord.vue'),
- RepairRecord: () => import('./repairRecord.vue'),
- CalibrationCheckRecord: () => import('./calibrationCheckRecord.vue'),
- ConfirmationRecord: () => import('./ConfirmationRecord.vue'),
- PvRecord: () => import('./pvRecord.vue'),
- SelectType: () => import('@/views/component/selectType.vue'),
- IbpsCustomDialog: () => ({
- component: import(
- '@/business/platform/data/templaterender/custom-dialog'
- ),
- delay: 200
- }),
- IbpsAttachment: () => ({
- component: import('@/business/platform/file/attachment/selector'),
- delay: 200
- }),
- IbpsImage: () => ({
- component: import('@/business/platform/file/image'),
- delay: 200
- })
- },
- props: {
- readonly: {
- type: Boolean,
- default: false
- },
- actionDialog: {
- type: String,
- default: ''
- },
- params: {
- type: Object,
- default: function () {
- return {}
- }
- },
- stateList: {
- type: Object,
- default: function () {
- return { 停用: '停用', 报废: '报废', 合格: '合格' }
- }
- },
- hideSysDeviceNo: {
- type: Boolean,
- default: false
- },
- hidefuJianShang: {
- type: Boolean,
- default: false
- },
- tabList: {
- type: Object,
- default: function () {
- return {}
- }
- },
- typeList: {
- type: Object,
- default: function () {
- return {
- 检验系统: '检验系统',
- 通用设备: '通用设备',
- 软件: '软件',
- 信息系统: '信息系统'
- }
- }
- },
- hasFuZeRenDianHua: {
- type: Boolean,
- default: false
- },
- hasChangJiaLianXiRen: {
- type: Boolean,
- default: false
- }
- },
- data() {
- const { userId, position, level, deptList, setting } = this.$store.getters
- return {
- config: setting?.postJob?.allocation || false,
- tabItems: [
- {
- label: '维护项目',
- name: 'two',
- ref: 'MaintenanceRef',
- data: 'maintenanceItemPoList',
- component: 'Maintenance',
- isKeepAlive: false
- },
- {
- label: '附属设备及配件',
- name: 'three',
- ref: 'MoreDevicesRef',
- data: 'accessoriesDevicePoList',
- component: 'MoreDevices',
- isKeepAlive: false
- },
- {
- label: '使用与维护记录',
- name: 'four',
- component: 'MaintenanceRecord',
- isKeepAlive: true
- },
- {
- label: '校准记录',
- name: 'five',
- component: 'CalibrationCheckRecord',
- isKeepAlive: true
- },
- {
- label: '维修记录',
- name: 'six',
- component: 'RepairRecord',
- isKeepAlive: true
- },
- {
- label: '停用、报废记录',
- name: 'seven',
- component: 'ScrappedRecord',
- isKeepAlive: true
- },
- {
- label: '检验系统校准确认记录',
- name: 'eight',
- component: 'ConfirmationRecord',
- isKeepAlive: true
- }
- // 同步与深圳三院分支,后端暂未同步对应接口,不开放
- // { label: '性能验证记录', name: 'nine', component: 'PvRecord', isKeepAlive: true }
- ],
- filter: [
- {
- descVal: '1',
- includeSub: true,
- old: 'position',
- partyId: this.$store.getters.userInfo.employee.positions,
- partyName: '',
- scriptContent: '',
- type: 'user',
- userType: 'position'
- }
- ],
- isFirstyiXiaoRiQi: true,
- isFirstbianZhiBuMen: true,
- isSheKou: false,
- activeName: 'one',
- dialogVisible: true,
- userId: userId,
- position: position,
- deptList: deptList,
- level: level.second || level.first,
- org: level.first || '',
- loading: false,
- title: '设备档案卡',
- toolbars: [
- {
- key: 'save',
- label: '保存',
- hidden: () => {
- return this.readonly
- }
- },
- {
- key: 'cancel',
- label: '退出',
- type: 'danger',
- icon: 'ibps-icon-close'
- }
- ],
- initWidth: '1480px',
- isEdit: false,
- isFinished: false,
- preParams: {},
- Ids: [],
- showzhuCeYouXiaoQi: false,
- dynamicRequiredFields: false,
- originalEditReadOnly: false,
- form: {
- gouJinRiQi: '', // 购进日期
- changShang: '', // 厂家/品牌
- guiGeXingHao: '', // 规格型号
- jieShouRiQi: '', // 接收日期
- qiYongRiQi: '', // 投入日期
- cunFangDiDian: '',
- cunFangWeiZhi: '', // 放置地点
- jieShouZhuangTai: '', // 接收时状态
- guanLiRen: '', // 保管人
- weiHuFangShi: '', // 设备分组
- bianZhiRen: '', // 建档人
- bianZhiBuMen: '', // 建档部门
- bianZhiShiJian: '', // 建档时间
- shiFouGuoShen: '',
- sheBeiLeiXing: '', // 设备类型
- sheBeiZhuangTa: '', // 设备状态
- sheBeiShiBieH: '', // 设备编号
- shiFouXiaoZhun: '', // 是否校准
- gongYingShang: '',
- shiFouQiJianH: '', // 供应商id
- lianXiFangShi: '', // 供应商电话
- xiaoZhunYouXia: '', // 校准有效期至
- chuChangRiQi: '', // 出厂日期
- sheBeiMingCheng: '', // 设备名称
- sheBeiMingChen: '', // 设备名称id
- yiXiaoRiQi: '', // 最近校准时间
- heChaXiaoZhun: '', // 使用年限
- shiJiShiYongF: '', // 关机时间
- kaiShiShiYong: '', // 开机时间
- zhengShuBianHa: '', // 校准证书编号
- xiaoZhunWuCha: '', // 是否限用
- xiaoZhunZQ: '', // 检定/校准周期
- shiYongKeShi: '', // 检定/校准单位
- yuanSheBeiBian: '', // 原设备编号
- jianKongYiJu: '', // 是否24H开机
- biXuDeHuanJin: '', // 核查人
- biXuSheShi: '', // 核查日期
- ziChanYuanZhi: '', // 资产原值
- ziChanBianHao: '', // 固定资产号
- shiFouWeiHu: '', // 是否维护
- jiShenXuHao: '', // 出厂编号
- yanShouRiQi: '', // 验收日期
- huanJingYaoQiu: '', // 环境要求
- dianYuanYaoQiu: '', // 电源要求
- zhuCeZhengHao: '', // 注册证号
- zhuCeYouXiaoQi: '', // 注册证有效期
- yqzp: '', // 附件上传
- faPiao: '', // 资质证书
- fuJianShang: '', // 设备使用说明书
- beiZhu: '', // 设备图片
- caiGouHeTong: '', // 限用范围
- zhuanYeBuMen: '',
- wenJianXiLei: '', // 附件细类
- xiLeiId: '',
- quanXianLeiXing: '',
- diDian: '',
- buMen: '', // 图片id
- ceLiangGongZuo: '', // 测量范围
- jianDingXiao: '', // 检定/校准参数
- xiuZhengZhiXiu: '', // 修正值
- zuiDaYunCha: '', // U/精确度/最大允差
- shiWuShuoMing: '', // 校准机构
- fuZeRenDianHua: '', // 负责人电话
- changJiaLianXiRen: '', // 厂家联系人及电话
- remark: ''
- },
- rules: {
- sheBeiMingCheng: [
- { required: true, message: '设备名称不能为空', trigger: 'blur' }
- ],
- yuanSheBeiBian: [
- { required: true, message: '原设备编号不能为空', trigger: 'blur' }
- ],
- sheBeiLeiXing: [
- { required: true, message: '设备类型不能为空', trigger: 'blur' }
- ],
- sheBeiZhuangTa: [
- { required: true, message: '设备状态不能为空', trigger: 'blur' }
- ],
- guiGeXingHao: [
- { required: true, message: '规格型号不能为空', trigger: 'blur' }
- ],
- bianZhiBuMen: [
- { required: true, message: '建档部门不能为空', trigger: 'blur' }
- ],
- bianZhiRen: [
- { required: true, message: '建档人不能为空', trigger: 'blur' }
- ],
- bianZhiShiJian: [
- { required: true, message: '建档时间不能为空', trigger: 'blur' }
- ],
- jieShouZhuangTai: [
- { required: true, message: '接收时状态不能为空', trigger: 'blur' }
- ],
- guanLiRen: [
- { required: true, message: '保管人不能为空', trigger: 'blur' }
- ],
- cunFangWeiZhi: [
- { required: true, message: '放置地点不能为空', trigger: 'blur' }
- ],
- shiFouXiaoZhun: [
- { required: true, message: '是否校准不能为空', trigger: 'blur' }
- ],
- jiShenXuHao: [
- { required: false, message: '出厂编号不能为空', trigger: 'blur' }
- ],
- shiFouQiJianH: [
- { required: false, message: '供应商不能为空', trigger: 'blur' }
- ],
- gouJinRiQi: [
- { required: false, message: '购进日期不能为空', trigger: 'blur' }
- ],
- xiaoZhunZQ: [
- {
- required: false,
- message: '检定/校准周期(月)不能为空',
- trigger: 'blur'
- }
- ],
- yanShouRiQi: [
- { required: false, message: '验收日期不能为空', trigger: 'blur' }
- ],
- qiYongRiQi: [
- { required: false, message: '投入日期不能为空', trigger: 'blur' }
- ],
- yiXiaoRiQi: [
- { required: false, message: '最近校准日期不能为空', trigger: 'blur' }
- ],
- xiaoZhunYouXia: [
- {
- required: false,
- message: '检定校准有效期至不能为空',
- trigger: 'blur'
- }
- ]
- // chuChangRiQi: [
- // { required: true, message: '出厂日期不能为空', trigger: 'blur' }
- // ]
- }
- }
- },
- computed: {
- photos() {
- if (this.form.beiZhu) {
- const photos = JSON.parse(this.form.beiZhu)
- photos.forEach((item) => {
- item.url = getImage(item.id)
- })
- return photos
- }
- return []
- },
- showState() {
- return (
- this.stateList[this.form.sheBeiZhuangTa] || this.form.sheBeiZhuangTa
- )
- }
- },
- watch: {
- photos: {
- handler(val) {
- this.form.buMen = val.map((item) => item.id).join(',')
- }
- },
- dynamicRequiredFields: {
- handler(val) {
- this.rules.jiShenXuHao[0].required = val
- this.rules.shiFouQiJianH[0].required = val
- this.rules.gouJinRiQi[0].required = val
- this.rules.xiaoZhunZQ[0].required = val
- this.rules.yanShouRiQi[0].required = val
- this.rules.qiYongRiQi[0].required = val
- this.rules.yiXiaoRiQi[0].required = val
- this.rules.xiaoZhunYouXia[0].required = val
- this.$refs.form.clearValidate()
- }
- },
- 'form.xiaoZhunWuCha': {
- handler(val, old) {
- if (!old) return
- if (val === '否') {
- this.form.sheBeiZhuangTa = '合格'
- } else if (val === '是') {
- this.form.caiGouHeTong = ''
- this.form.sheBeiZhuangTa = '限用'
- }
- }
- },
- 'form.cunFangWeiZhi': {
- async handler(val) {
- if (!val) return
- // const sql = `select fang_jian_ming_ha from t_jjqfjb where id_='${val}'`
- const {
- variables: { data }
- } = await this.$common.request('query', {
- key: 'getRoomDataById',
- params: [val]
- })
- this.form.cunFangDiDian =
- data && data[0] ? data[0].fang_jian_ming_ha : ''
- }
- },
- // 根据最近检定时间动态计算对应有效期至
- 'form.yiXiaoRiQi': {
- handler(value) {
- if (value) {
- if (this.isFirstyiXiaoRiQi) {
- this.isFirstyiXiaoRiQi = false
- return
- }
- const cycle = this.form.xiaoZhunZQ || 0
- const expiredDate = this.$common.getFormatDate(
- 'string',
- 10,
- this.$common.getDate('month', parseInt(cycle), value)
- )
- this.form.xiaoZhunYouXia = this.$common.getFormatDate(
- 'string',
- 10,
- this.$common.getDate('day', -1, expiredDate)
- )
- }
- }
- }
- },
- mounted() {
- this.init()
- },
- methods: {
- changeGuanLiRen(key, data) {
- this.form.fuZeRenDianHua = data?.mobile
- },
- sheBeiMingChenChange(key, data) {
- this.form.sheBeiMingCheng = data.ming_cheng_str_
- this.form.guiGeXingHao = data.xing_hao_gui_ge_
- this.form.jiShenXuHao = data.chu_chang_bian_ha
- this.form.changShang = data.sheng_chan_chang_
- this.form.yuanSheBeiBian = data.she_bei_bian_hao_
- },
- // 根据供应商自动带出供应商名称和电话
- shiFouQiJianHChange(key, data) {
- this.form.lianXiFangShi = data.lian_xi_dian_hua_
- this.form.gongYingShang = data.gong_ying_shang_m
- },
- changeData(...args) {
- this.form[args[0]] = args[1]
- },
- handleClick() {},
- handleActionEvent({ key }) {
- switch (key) {
- case 'cancel':
- this.closeDialog(true)
- break
- case 'save':
- this.goSave('close')
- break
- default:
- break
- }
- },
- // 获取人员部门
- getPersonPosition(id) {
- const userList = this.$store.getters.userList
- const bianzhiUserid = userList.find((i) => i.userId === id)
- if (bianzhiUserid) {
- return bianzhiUserid.positionId
- }
- },
- isDateMoreThenSecondDay(firstTime, secondTime) {
- if (!firstTime || !secondTime) {
- return false
- }
- return new Date(firstTime).getTime() > new Date(secondTime).getTime()
- },
- async checkRequired(flag) {
- if (this.form.xiaoZhunWuCha === '是' && !this.form.caiGouHeTong) {
- throw new Error('请填写限用范围!')
- }
- if (this.form.accessoriesDevicePoList.length > 0) {
- for (let i = 0; i < this.form.accessoriesDevicePoList.length; i++) {
- const item = this.form.accessoriesDevicePoList[i]
- if (!item.mingCheng) {
- throw new Error(`附属设备及配件第${i + 1}行名称缺失!`)
- }
- if (!item.guiGeXingHao1) {
- throw new Error(`附属设备及配件第${i + 1}行规格型号缺失!`)
- }
- if (!item.danWei) {
- throw new Error(`附属设备及配件第${i + 1}行单位缺失!`)
- }
- if (!item.shuLiang) {
- throw new Error(`附属设备及配件第${i + 1}行数量缺失!`)
- }
- }
- }
- const sysDeviceNo = this.form.sheBeiShiBieH
- const originalDeviceNo = this.form.yuanSheBeiBian
- const position = this.form.diDian
- // const sql = `select count(1) as num from t_sbdj where yuan_she_bei_bian = '${originalDeviceNo}' and di_dian_ = '${position}' and she_bei_shi_bie_h <> '${sysDeviceNo}' limit 1`
- const result = await this.$common.request('query', {
- key: 'getExistDeviceNo',
- params: [originalDeviceNo, position, sysDeviceNo]
- })
- const { data = [] } = result.variables || {}
- if (data[0].num > 0) {
- throw new Error(
- `系统当前已经存在此${
- this.hideSysDeviceNo ? '设备编号' : '原设备编号'
- },请更换另一个编号!`
- )
- }
- const exFactoryTime = this.form.chuChangRiQi
- const reviceTime = this.form.jieShouRiQi
- const useTime = this.form.qiYongRiQi
- // 如果有出厂日期,则接收日期必须在出厂日期之后,投入日期必须在出厂日期之后
- // 校验接收日期是否在投入日期之前
- if (exFactoryTime && reviceTime) {
- if (this.isDateMoreThenSecondDay(exFactoryTime, reviceTime)) {
- throw new Error(`该设备的接收日期不得早于出厂日期!`)
- }
- }
- if (exFactoryTime && useTime) {
- if (this.isDateMoreThenSecondDay(exFactoryTime, useTime)) {
- throw new Error(`该设备的投入日期不得早于出厂日期!`)
- }
- }
- if (reviceTime && useTime) {
- if (this.isDateMoreThenSecondDay(reviceTime, useTime)) {
- throw new Error(`该设备的投入日期不得早于接收日期!`)
- }
- }
- },
- async goAdd() {
- try {
- this.loading = true
- this.form.sheBeiShiBieH = await this.getNextAlias()
- await saveEquipmentCard(this.form)
- this.$message.success('添加成功')
- this.closeDialog(true)
- this.loading = false
- } catch (error) {
- console.log(error)
- this.$message.warning('添加失败')
- this.loading = false
- }
- },
- async goEdit(flag) {
- try {
- this.loading = true
- await saveEquipmentCard(this.form)
- this.$message.success('修改成功')
- this.closeDialog(true)
- this.loading = false
- } catch (error) {
- this.$message.warning(error.message)
- this.loading = false
- throw new Error(error.message)
- }
- },
- goSave(flag) {
- this.$refs.form.validate(async (valid) => {
- this.$refs.formBase.validate(async (validBase) => {
- if (valid && validBase) {
- try {
- // 维护项目
- this.form.maintenanceItemPoList =
- this.$refs.MaintenanceRef?.[0]?.listDataCopy ||
- this.form.maintenanceItemPoList ||
- []
- // 附属设备及配件
- this.form.accessoriesDevicePoList =
- this.$refs.MoreDevicesRef?.[0]?.listDataCopy ||
- this.form.accessoriesDevicePoList ||
- []
- await this.checkRequired()
- if (this.isEdit) {
- this.goEdit(flag)
- } else {
- this.goAdd()
- }
- } catch (error) {
- this.$message.warning(error.message)
- }
- } else {
- return this.$message.warning('请填写必填项!')
- }
- })
- })
- },
- // 刷新
- async goRefresh() {},
- // 关闭当前窗口
- closeDialog(needRefresh) {
- this.dialogVisible = false
- if (needRefresh) {
- this.$emit('close')
- }
- },
- generateRandomString() {
- return `JYK-${Math.floor(Math.random() * 88888) + 10000}`
- },
- getNextAlias() {
- return new Promise((resolve, reject) => {
- this.$common
- .getNextIdByAlias({
- alias: 'sbbh'
- })
- .then((response) => {
- resolve(response.data)
- })
- .catch((error) => {
- reject(error)
- })
- })
- },
- async init() {
- this.loading = true
- const deviceres = await getSetting('device')
- this.showzhuCeYouXiaoQi = deviceres?.showzhuCeYouXiaoQi || false
- this.dynamicRequiredFields = deviceres?.requiredField || false
- this.originalEditReadOnly = deviceres?.originalEditReadOnly || false
- if (this.hideSysDeviceNo) {
- this.rules.yuanSheBeiBian[0].message = '设备编号不能为空'
- }
- this.isEdit = !!(this.params && this.params.id)
- this.isSheKou = this.deptList[0].positionId === '1166372468122714112' // 判断是否是蛇口医院
- // 根据全局配置动态生成tab
- const newTab = []
- for (const key in this.tabList) {
- if (Object.hasOwnProperty.call(this.tabList, key)) {
- const newLabel = this.tabList[key]
- const t = this.tabItems.find((i) => i.label === key)
- if (t) {
- t.label = newLabel
- newTab.push(t)
- }
- }
- }
- if (newTab.length > 0) {
- this.tabItems = newTab
- }
- if (this.isEdit) {
- const { data } = await getequipmentCard({ id: this.params.id })
- this.form = data
- } else {
- this.isFirstbianZhiBuMen = false
- this.isFirstyiXiaoRiQi = false
- this.form.jieShouRiQi = dayjs().format('YYYY-MM-DD')
- this.form.qiYongRiQi = dayjs().format('YYYY-MM-DD')
- this.form.xiaoZhunWuCha = '否'
- this.form.jieShouZhuangTai = '新设备'
- this.form.bianZhiRen = this.userId
- const pos = this.position.split(',')
- this.form.bianZhiBuMen = pos[pos.length - 1]
- this.form.bianZhiShiJian = dayjs().format('YYYY-MM-DD HH:mm')
- this.form.shiFouGuoShen = '已完成'
- this.form.sheBeiLeiXing = '检验系统'
- this.form.sheBeiZhuangTa = '合格'
- this.form.shiFouXiaoZhun = '是'
- this.form.jianKongYiJu = '否'
- this.form.shiFouWeiHu = '是'
- this.form.diDian = this.level
- }
- const id = setTimeout(() => {
- this.loading = false
- clearTimeout(id)
- }, 500)
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .paper-detail-dialog {
- ::v-deep {
- .el-dialog__header {
- text-align: center;
- }
- }
- .dialog-title {
- display: flex;
- align-items: center;
- justify-content: center;
- div {
- z-index: 99999999;
- position: absolute;
- right: 8vw;
- }
- .dialogtitle {
- font-size: 22px;
- font-family: SimHei;
- font-weight: bold;
- color: #222;
- }
- }
- .container {
- display: flex;
- width: 100%;
- justify-content: center;
- .el-row {
- margin: 0 !important;
- }
- .required {
- color: #606266 !important;
- &::before {
- content: '*';
- margin: 0 4px 0 -7.5px;
- color: #f56c6c;
- }
- }
- .left {
- height: calc(100vh - 100px);
- box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
- padding: 20px;
- overflow-y: auto;
- .form {
- margin-left: -20px;
- }
- .item {
- width: 100%;
- }
- .title {
- margin: 16px 0 6px -16px;
- }
- .tabs {
- margin-top: 40px;
- }
- .question-icon {
- margin-left: 2px;
- }
- }
- }
- }
- ::v-deep {
- .el-form-item__label {
- text-align: left;
- font-size: 12px !important;
- }
- .el-form-item__content {
- font-size: 12px !important;
- display: flex;
- }
- .el-table th {
- background-color: #f5f7fa !important;
- }
- .el-tabs__header {
- margin: 0 0 30px !important;
- }
- .ibps-image {
- width: 100%;
- .ibps-p-0 {
- width: 100%;
- .list-group {
- display: flex;
- align-items: center;
- gap: 20px;
- flex-wrap: wrap;
- }
- }
- }
- }
- </style>
|