deviceDialog.vue 107 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007
  1. <template>
  2. <el-dialog
  3. v-loading="loading"
  4. :title="title"
  5. :visible.sync="dialogVisible"
  6. :close-on-click-modal="false"
  7. :close-on-press-escape="false"
  8. :show-close="false"
  9. append-to-body
  10. fullscreen
  11. class="dialog paper-detail-dialog"
  12. top="0"
  13. >
  14. <div slot="title" class="dialog-title">
  15. <span class="dialogtitle">{{ title }}</span>
  16. <div>
  17. <ibps-toolbar
  18. :actions="toolbars"
  19. @action-event="handleActionEvent"
  20. />
  21. </div>
  22. </div>
  23. <div class="container">
  24. <div class="left" :style="{ width: initWidth }">
  25. <div class="form">
  26. <el-form
  27. ref="form"
  28. label-width="100px"
  29. :model="form"
  30. :rules="rules"
  31. :hide-required-asterisk="true"
  32. >
  33. <el-row type="flex" justify="center" :gutter="20">
  34. <el-col :span="16">
  35. <el-row :gutter="20">
  36. <el-col :span="8">
  37. <el-form-item
  38. label="设备验收记录:"
  39. prop="sheBeiMingChen"
  40. >
  41. <ibps-custom-dialog
  42. v-model="form.sheBeiMingChen"
  43. size="mini"
  44. template-key="sbysdhk"
  45. :disabled="false"
  46. type="dialog"
  47. class="custom-dialog"
  48. placeholder="请选择"
  49. icon="el-icon-search"
  50. style="width: 100%"
  51. @change-link-data="
  52. sheBeiMingChenChange
  53. "
  54. />
  55. </el-form-item>
  56. </el-col>
  57. <el-col :span="8">
  58. <el-form-item
  59. label="设备名称:"
  60. prop="sheBeiMingCheng"
  61. >
  62. <template slot="label">
  63. <span class="required"
  64. >设备名称:</span
  65. >
  66. </template>
  67. <el-input
  68. v-model="form.sheBeiMingCheng"
  69. size="mini"
  70. />
  71. </el-form-item>
  72. </el-col>
  73. </el-row>
  74. <el-row :gutter="20">
  75. <el-col :span="8">
  76. <el-form-item
  77. label="建档部门:"
  78. prop="bianZhiBuMen"
  79. >
  80. <template slot="label">
  81. <span class="required"
  82. >建档部门:</span
  83. >
  84. </template>
  85. <ibps-user-selector
  86. v-model="form.bianZhiBuMen"
  87. type="org"
  88. readonly-text="text"
  89. :disabled="false"
  90. :multiple="false"
  91. size="mini"
  92. :filter="filter"
  93. filtrate
  94. style="width: 100%"
  95. />
  96. </el-form-item>
  97. </el-col>
  98. <el-col :span="8">
  99. <el-form-item
  100. label="建档人:"
  101. prop="bianZhiRen"
  102. >
  103. <ibps-user-selector
  104. v-model="form.bianZhiRen"
  105. type="user"
  106. readonly-text="text"
  107. :disabled="true"
  108. :multiple="false"
  109. size="mini"
  110. style="width: 100%"
  111. :filter="filter"
  112. filtrate
  113. />
  114. </el-form-item>
  115. </el-col>
  116. <el-col :span="8">
  117. <el-form-item
  118. label="建档时间:"
  119. prop="bianZhiShiJian"
  120. >
  121. <template slot="label">
  122. <span class="required"
  123. >建档时间:</span
  124. >
  125. </template>
  126. <el-date-picker
  127. v-model="form.bianZhiShiJian"
  128. style="width: 100%"
  129. type="datetime"
  130. placeholder="选择日期时间"
  131. default-time="12:00:00"
  132. :readonly="readonly"
  133. value-format="yyyy-MM-dd HH:mm"
  134. format="yyyy-MM-dd HH:mm"
  135. size="mini"
  136. />
  137. </el-form-item>
  138. </el-col>
  139. </el-row>
  140. <el-row :gutter="20">
  141. <el-col :span="8" v-show="false">
  142. <el-form-item
  143. label="设备编号:"
  144. prop="sheBeiShiBieH"
  145. >
  146. <template slot="label">
  147. <span>设备编号</span>
  148. <el-tooltip
  149. effect="dark"
  150. content="设备编号由系统自动生成。"
  151. placement="top"
  152. >
  153. <i
  154. class="el-icon-question question-icon"
  155. >:</i
  156. >
  157. </el-tooltip>
  158. </template>
  159. <span>{{
  160. form.sheBeiShiBieH
  161. }}</span>
  162. </el-form-item>
  163. </el-col>
  164. <el-col :span="8">
  165. <el-form-item
  166. label="设备编号:"
  167. prop="yuanSheBeiBian"
  168. >
  169. <template slot="label">
  170. <span class="required"
  171. >设备编号:</span
  172. >
  173. </template>
  174. <el-input
  175. v-model="form.yuanSheBeiBian"
  176. size="mini"
  177. />
  178. </el-form-item>
  179. </el-col>
  180. <el-col :span="8">
  181. <el-form-item
  182. label="设备状态:"
  183. prop="sheBeiZhuangTa"
  184. >
  185. <span>{{ showState }}</span>
  186. </el-form-item>
  187. </el-col>
  188. </el-row>
  189. <el-row :gutter="20">
  190. <el-col :span="8">
  191. <el-form-item
  192. label="设备类型:"
  193. prop="sheBeiLeiXing"
  194. >
  195. <el-select
  196. v-model="form.sheBeiLeiXing"
  197. placeholder="请选择"
  198. size="mini"
  199. style="width: 100%"
  200. >
  201. <el-option
  202. v-for="item in [
  203. '检验系统',
  204. '通用设备',
  205. '软件',
  206. '信息系统',
  207. ]"
  208. :key="item"
  209. :label="item"
  210. :value="item"
  211. />
  212. </el-select>
  213. </el-form-item>
  214. </el-col>
  215. <el-col :span="8">
  216. <el-form-item
  217. label="规格型号:"
  218. prop="guiGeXingHao"
  219. >
  220. <template slot="label">
  221. <span class="required"
  222. >规格型号:</span
  223. >
  224. </template>
  225. <el-input
  226. v-model="form.guiGeXingHao"
  227. size="mini"
  228. />
  229. </el-form-item>
  230. </el-col>
  231. <el-col :span="8">
  232. <el-form-item
  233. label="接收时状态:"
  234. prop="jieShouZhuangTai"
  235. >
  236. <template slot="label">
  237. <span class="required"
  238. >接收时状态:</span
  239. >
  240. </template>
  241. <el-select
  242. v-model="form.jieShouZhuangTai"
  243. placeholder="请选择"
  244. size="mini"
  245. style="width: 100%"
  246. >
  247. <el-option
  248. v-for="item in [
  249. '新设备',
  250. '二手或翻新设备',
  251. ]"
  252. :key="item"
  253. :label="item"
  254. :value="item"
  255. />
  256. </el-select>
  257. </el-form-item>
  258. </el-col>
  259. </el-row>
  260. <el-row :gutter="20">
  261. <el-col :span="8">
  262. <el-form-item
  263. label="负责人:"
  264. prop="guanLiRen"
  265. >
  266. <template slot="label">
  267. <span class="required"
  268. >负责人:</span
  269. >
  270. </template>
  271. <ibps-user-selector
  272. v-model="form.guanLiRen"
  273. type="user"
  274. readonly-text="text"
  275. :disabled="false"
  276. :multiple="false"
  277. size="mini"
  278. :filter="filter"
  279. filtrate
  280. style="width: 100%"
  281. />
  282. </el-form-item>
  283. </el-col>
  284. <el-col :span="8">
  285. <el-form-item
  286. label="放置地点:"
  287. prop="cunFangWeiZhi"
  288. >
  289. <template slot="label">
  290. <span class="required"
  291. >放置地点:</span
  292. >
  293. </template>
  294. <ibps-custom-dialog
  295. v-model="form.cunFangWeiZhi"
  296. size="mini"
  297. template-key="fjwzdhk"
  298. :disabled="false"
  299. type="dialog"
  300. class="custom-dialog"
  301. placeholder="请选择"
  302. icon="el-icon-search"
  303. style="width: 100%"
  304. />
  305. </el-form-item>
  306. </el-col>
  307. <el-col :span="8">
  308. <el-form-item label="资产编号:">
  309. <el-input
  310. v-model="form.ziChanBianHao"
  311. size="mini"
  312. />
  313. </el-form-item>
  314. </el-col>
  315. </el-row>
  316. <el-row :gutter="20">
  317. <el-col :span="8">
  318. <el-form-item label="厂家/品牌:">
  319. <el-input
  320. v-model="form.changShang"
  321. size="mini"
  322. />
  323. </el-form-item>
  324. </el-col>
  325. <el-col :span="8">
  326. <el-form-item
  327. label="出厂日期:"
  328. prop="chuChangRiQi"
  329. >
  330. <template slot="label">
  331. <span class="required"
  332. >出厂日期</span
  333. >
  334. </template>
  335. <el-date-picker
  336. v-model="form.chuChangRiQi"
  337. style="width: 100%"
  338. type="date"
  339. placeholder="选择日期"
  340. :readonly="readonly"
  341. value-format="yyyy-MM-dd"
  342. size="mini"
  343. />
  344. </el-form-item>
  345. </el-col>
  346. <el-col :span="8">
  347. <el-form-item label="出厂编号:">
  348. <el-input
  349. v-model="form.jiShenXuHao"
  350. size="mini"
  351. />
  352. </el-form-item>
  353. </el-col>
  354. </el-row>
  355. <el-row :gutter="20">
  356. <el-col :span="8">
  357. <el-form-item label="供应商:">
  358. <!-- <ibps-custom-dialog
  359. v-model="form.shiFouQiJianH"
  360. size="mini"
  361. template-key="mjsbxzgysdhk"
  362. :disabled="false"
  363. type="dialog"
  364. class="custom-dialog"
  365. placeholder="请选择"
  366. icon="el-icon-search"
  367. style="width:100%"
  368. @change-link-data="shiFouQiJianHChange"
  369. /> -->
  370. <el-input
  371. v-model="form.shiFouQiJianH"
  372. size="mini"
  373. />
  374. </el-form-item>
  375. </el-col>
  376. <el-col :span="8">
  377. <el-form-item label="供应商电话:">
  378. <el-input
  379. v-model="form.lianXiFangShi"
  380. size="mini"
  381. />
  382. </el-form-item>
  383. </el-col>
  384. <el-col :span="8">
  385. <el-form-item label="注册证号:">
  386. <el-input
  387. v-model="form.zhuCeZhengHao"
  388. size="mini"
  389. />
  390. </el-form-item>
  391. </el-col>
  392. </el-row>
  393. </el-col>
  394. <el-col :span="8">
  395. <el-row v-if="photos.length > 0">
  396. <el-col>
  397. <el-carousel
  398. trigger="click"
  399. height="250px"
  400. indicator-position="none"
  401. >
  402. <el-carousel-item
  403. v-if="photos.length == 0"
  404. >
  405. <el-empty
  406. description="暂无图片"
  407. />
  408. </el-carousel-item>
  409. <template v-else>
  410. <el-carousel-item
  411. v-for="item in photos"
  412. :key="item.id"
  413. >
  414. <el-image
  415. style="
  416. width: 100%;
  417. height: 100%;
  418. "
  419. :src="item.url"
  420. fit="contain"
  421. :preview-src-list="
  422. photos.map(
  423. (item) =>
  424. item.url
  425. )
  426. "
  427. />
  428. </el-carousel-item>
  429. </template>
  430. </el-carousel>
  431. </el-col>
  432. </el-row>
  433. </el-col>
  434. </el-row>
  435. </el-form>
  436. </div>
  437. <div class="tabs">
  438. <el-row>
  439. <el-col>
  440. <el-tabs
  441. v-model="activeName"
  442. @tab-click="handleClick"
  443. >
  444. <el-tab-pane label="基本信息" name="one">
  445. <el-form
  446. label-width="100px"
  447. :model="form"
  448. :hide-required-asterisk="true"
  449. >
  450. <el-row :gutter="20">
  451. <!-- 第一列 -->
  452. <el-col :span="8">
  453. <el-row>
  454. <el-col>
  455. <el-form-item
  456. label="购进日期:"
  457. >
  458. <el-date-picker
  459. v-model="
  460. form.gouJinRiQi
  461. "
  462. style="
  463. width: 100%;
  464. "
  465. type="date"
  466. placeholder="选择日期"
  467. :readonly="
  468. readonly
  469. "
  470. value-format="yyyy-MM-dd"
  471. size="mini"
  472. />
  473. </el-form-item>
  474. </el-col>
  475. </el-row>
  476. <el-row>
  477. <el-col>
  478. <el-form-item
  479. label="接收日期:"
  480. >
  481. <el-date-picker
  482. v-model="
  483. form.jieShouRiQi
  484. "
  485. style="
  486. width: 100%;
  487. "
  488. type="date"
  489. placeholder="选择日期"
  490. :readonly="
  491. readonly
  492. "
  493. value-format="yyyy-MM-dd"
  494. size="mini"
  495. />
  496. </el-form-item>
  497. </el-col>
  498. </el-row>
  499. <el-row>
  500. <el-col>
  501. <el-form-item
  502. label="验收日期:"
  503. >
  504. <el-date-picker
  505. v-model="
  506. form.yanShouRiQi
  507. "
  508. style="
  509. width: 100%;
  510. "
  511. type="date"
  512. placeholder="选择日期"
  513. :readonly="
  514. readonly
  515. "
  516. value-format="yyyy-MM-dd"
  517. size="mini"
  518. />
  519. </el-form-item>
  520. </el-col>
  521. </el-row>
  522. <el-row>
  523. <el-col>
  524. <el-form-item
  525. label="投入日期:"
  526. >
  527. <el-date-picker
  528. v-model="
  529. form.qiYongRiQi
  530. "
  531. style="
  532. width: 100%;
  533. "
  534. type="date"
  535. placeholder="选择日期"
  536. :readonly="
  537. readonly
  538. "
  539. value-format="yyyy-MM-dd"
  540. size="mini"
  541. />
  542. </el-form-item>
  543. </el-col>
  544. </el-row>
  545. <el-row>
  546. <el-col>
  547. <el-form-item
  548. label="是否期间核查:"
  549. >
  550. <el-select
  551. v-model="
  552. form.shiFouHeCha
  553. "
  554. placeholder="请选择"
  555. size="mini"
  556. style="
  557. width: 100%;
  558. "
  559. >
  560. <el-option
  561. v-for="item in [
  562. '是',
  563. '否',
  564. ]"
  565. :key="item"
  566. :label="
  567. item
  568. "
  569. :value="
  570. item
  571. "
  572. />
  573. </el-select>
  574. </el-form-item>
  575. </el-col>
  576. </el-row>
  577. <el-row>
  578. <el-col>
  579. <el-form-item
  580. label="核查日期:"
  581. >
  582. <el-date-picker
  583. v-model="
  584. form.biXuSheShi
  585. "
  586. style="
  587. width: 100%;
  588. "
  589. type="date"
  590. placeholder="选择日期"
  591. :readonly="
  592. readonly
  593. "
  594. value-format="yyyy-MM-dd"
  595. size="mini"
  596. />
  597. </el-form-item>
  598. </el-col>
  599. </el-row>
  600. <el-row>
  601. <el-col>
  602. <el-form-item
  603. label="核查人:"
  604. >
  605. <ibps-user-selector
  606. v-model="
  607. form.biXuDeHuanJin
  608. "
  609. type="user"
  610. readonly-text="text"
  611. :disabled="
  612. false
  613. "
  614. :multiple="
  615. false
  616. "
  617. size="mini"
  618. style="
  619. width: 100%;
  620. "
  621. :filter="filter"
  622. filtrate
  623. />
  624. </el-form-item>
  625. </el-col>
  626. </el-row>
  627. <el-row>
  628. <el-col>
  629. <el-form-item
  630. label="电源要求:"
  631. >
  632. <el-input
  633. v-model="
  634. form.dianYuanYaoQiu
  635. "
  636. size="mini"
  637. />
  638. </el-form-item>
  639. </el-col>
  640. </el-row>
  641. <el-row>
  642. <el-col>
  643. <el-form-item
  644. label="环境要求:"
  645. >
  646. <el-input
  647. v-model="
  648. form.huanJingYaoQiu
  649. "
  650. size="mini"
  651. />
  652. </el-form-item>
  653. </el-col>
  654. </el-row>
  655. <el-row>
  656. <el-col>
  657. <el-form-item
  658. label="使用年限(年):"
  659. >
  660. <el-input
  661. v-model="
  662. form.heChaXiaoZhun
  663. "
  664. size="mini"
  665. type="number"
  666. />
  667. </el-form-item>
  668. </el-col>
  669. </el-row>
  670. <el-row>
  671. <el-col>
  672. <el-form-item
  673. label="资产原值(元):"
  674. >
  675. <el-input
  676. v-model="
  677. form.ziChanYuanZhi
  678. "
  679. size="mini"
  680. type="number"
  681. />
  682. </el-form-item>
  683. </el-col>
  684. </el-row>
  685. </el-col>
  686. <!-- 第二列 -->
  687. <el-col :span="8">
  688. <el-row>
  689. <el-col>
  690. <el-form-item
  691. label="是否维护:"
  692. >
  693. <el-select
  694. v-model="
  695. form.shiFouWeiHu
  696. "
  697. placeholder="请选择"
  698. size="mini"
  699. style="
  700. width: 100%;
  701. "
  702. >
  703. <el-option
  704. v-for="item in [
  705. '是',
  706. '否',
  707. ]"
  708. :key="item"
  709. :label="
  710. item
  711. "
  712. :value="
  713. item
  714. "
  715. />
  716. </el-select>
  717. </el-form-item>
  718. </el-col>
  719. </el-row>
  720. <el-row>
  721. <el-col>
  722. <el-form-item
  723. label="设备分组:"
  724. >
  725. <ibps-custom-dialog
  726. v-model="
  727. form.weiHuFangShi
  728. "
  729. size="mini"
  730. template-key="lhgwdhk"
  731. multiple
  732. :disabled="
  733. false
  734. "
  735. type="dialog"
  736. class="custom-dialog"
  737. placeholder="请选择"
  738. icon="el-icon-search"
  739. style="
  740. width: 100%;
  741. "
  742. />
  743. </el-form-item>
  744. </el-col>
  745. </el-row>
  746. <el-row>
  747. <el-col>
  748. <el-form-item
  749. label="是否24H开机:"
  750. >
  751. <el-select
  752. v-model="
  753. form.jianKongYiJu
  754. "
  755. placeholder="请选择"
  756. size="mini"
  757. style="
  758. width: 100%;
  759. "
  760. >
  761. <el-option
  762. v-for="item in [
  763. '是',
  764. '否',
  765. ]"
  766. :key="item"
  767. :label="
  768. item
  769. "
  770. :value="
  771. item
  772. "
  773. />
  774. </el-select>
  775. </el-form-item>
  776. </el-col>
  777. </el-row>
  778. <el-row
  779. v-if="
  780. form.jianKongYiJu ===
  781. '否'
  782. "
  783. >
  784. <el-col>
  785. <el-form-item
  786. label="开机时间:"
  787. >
  788. <el-time-picker
  789. v-model="
  790. form.kaiShiShiYong
  791. "
  792. placeholder="任意时间点"
  793. size="mini"
  794. style="
  795. width: 100%;
  796. "
  797. value-format="HH:mm:ss"
  798. />
  799. </el-form-item>
  800. </el-col>
  801. </el-row>
  802. <el-row
  803. v-if="
  804. form.jianKongYiJu ===
  805. '否'
  806. "
  807. >
  808. <el-col>
  809. <el-form-item
  810. label="关机时间:"
  811. >
  812. <el-time-picker
  813. v-model="
  814. form.shiJiShiYongF
  815. "
  816. placeholder="任意时间点"
  817. size="mini"
  818. style="
  819. width: 100%;
  820. "
  821. value-format="HH:mm:ss"
  822. />
  823. </el-form-item>
  824. </el-col>
  825. </el-row>
  826. <!-- <el-row>
  827. <el-col>
  828. <el-form-item label="是否限用:">
  829. <el-select v-model="form.xiaoZhunWuCha" placeholder="请选择" size="mini" style="width:100%">
  830. <el-option
  831. v-for="item in ['是','否']"
  832. :key="item"
  833. :label="item"
  834. :value="item"
  835. />
  836. </el-select>
  837. </el-form-item>
  838. </el-col>
  839. </el-row>
  840. <el-row v-if="form.xiaoZhunWuCha==='是'">
  841. <el-col>
  842. <el-form-item label="限用范围:">
  843. <el-input v-model="form.caiGouHeTong" size="mini" />
  844. </el-form-item>
  845. </el-col>
  846. </el-row> -->
  847. <el-row>
  848. <!-- todo -->
  849. <el-col>
  850. <el-alert
  851. title="开关机时间配置说明"
  852. type="success"
  853. description="日保养、按需保养、这些周期,如果配置了开关机时间,在设备使用与维护时会自动带出"
  854. :closable="false"
  855. />
  856. </el-col>
  857. </el-row>
  858. </el-col>
  859. <!-- 第三列 -->
  860. <el-col :span="8">
  861. <el-row>
  862. <el-col>
  863. <el-form-item
  864. label="是否校准:"
  865. prop="shiFouXiaoZhun"
  866. >
  867. <el-select
  868. v-model="
  869. form.shiFouXiaoZhun
  870. "
  871. placeholder="请选择"
  872. size="mini"
  873. style="
  874. width: 100%;
  875. "
  876. >
  877. <el-option
  878. v-for="item in [
  879. '是',
  880. '否',
  881. ]"
  882. :key="item"
  883. :label="
  884. item
  885. "
  886. :value="
  887. item
  888. "
  889. />
  890. </el-select>
  891. </el-form-item>
  892. </el-col>
  893. </el-row>
  894. <el-row
  895. v-if="
  896. form.shiFouXiaoZhun ===
  897. '是'
  898. "
  899. >
  900. <el-col>
  901. <el-form-item
  902. label="检定/校准周期(月):"
  903. label-width="140"
  904. >
  905. <el-input
  906. v-model="
  907. form.xiaoZhunZQ
  908. "
  909. size="mini"
  910. type="number"
  911. style="
  912. width: 100%;
  913. "
  914. />
  915. </el-form-item>
  916. </el-col>
  917. </el-row>
  918. <el-row
  919. v-if="
  920. form.shiFouXiaoZhun ===
  921. '是'
  922. "
  923. >
  924. <el-col>
  925. <el-form-item
  926. label="检定/校准单位:"
  927. >
  928. <!-- <ibps-custom-dialog
  929. v-model="form.shiYongKeShi"
  930. size="mini"
  931. template-key="mjsbxzgysdhk"
  932. :disabled="false"
  933. type="dialog"
  934. class="custom-dialog"
  935. placeholder="请选择"
  936. icon="el-icon-search"
  937. style="width:100%"
  938. /> -->
  939. <el-input
  940. v-model="
  941. form.shiYongKeShi
  942. "
  943. size="mini"
  944. />
  945. </el-form-item>
  946. </el-col>
  947. </el-row>
  948. <el-row
  949. v-if="
  950. form.shiFouXiaoZhun ===
  951. '是'
  952. "
  953. >
  954. <el-col>
  955. <el-form-item
  956. label="上次校准日期:"
  957. >
  958. <el-date-picker
  959. v-model="
  960. form.yiXiaoRiQi
  961. "
  962. style="
  963. width: 100%;
  964. "
  965. type="date"
  966. placeholder="选择日期"
  967. :readonly="
  968. readonly
  969. "
  970. value-format="yyyy-MM-dd"
  971. size="mini"
  972. />
  973. </el-form-item>
  974. </el-col>
  975. </el-row>
  976. <el-row
  977. v-if="
  978. form.shiFouXiaoZhun ===
  979. '是'
  980. "
  981. >
  982. <el-col>
  983. <el-form-item
  984. label="校准有效期至:"
  985. >
  986. <el-date-picker
  987. v-model="
  988. form.xiaoZhunYouXia
  989. "
  990. style="
  991. width: 100%;
  992. "
  993. type="date"
  994. placeholder="选择日期"
  995. :readonly="
  996. readonly
  997. "
  998. value-format="yyyy-MM-dd"
  999. size="mini"
  1000. />
  1001. </el-form-item>
  1002. </el-col>
  1003. </el-row>
  1004. <el-row
  1005. v-if="
  1006. form.shiFouXiaoZhun ===
  1007. '是'
  1008. "
  1009. >
  1010. <el-col>
  1011. <el-form-item
  1012. label="校准证书编号:"
  1013. >
  1014. <el-input
  1015. v-model="
  1016. form.zhengShuBianHa
  1017. "
  1018. size="mini"
  1019. />
  1020. </el-form-item>
  1021. </el-col>
  1022. </el-row>
  1023. <el-row v-if="false">
  1024. <el-col>
  1025. <el-form-item
  1026. label="校准机构:"
  1027. >
  1028. <el-input
  1029. v-model="
  1030. form.shiWuShuoMing
  1031. "
  1032. size="mini"
  1033. />
  1034. </el-form-item>
  1035. </el-col>
  1036. </el-row>
  1037. <el-row
  1038. v-if="
  1039. form.shiFouXiaoZhun ===
  1040. '是' && !isSheKou
  1041. "
  1042. >
  1043. <el-col>
  1044. <el-form-item
  1045. label="检定/校准参数:"
  1046. >
  1047. <el-input
  1048. v-model="
  1049. form.jianDingXiao
  1050. "
  1051. size="mini"
  1052. />
  1053. </el-form-item>
  1054. </el-col>
  1055. </el-row>
  1056. <el-row>
  1057. <el-col>
  1058. <el-form-item
  1059. label="检定/校准参数:"
  1060. >
  1061. <el-input
  1062. v-model="
  1063. form.jiShuCanShu
  1064. "
  1065. size="mini"
  1066. />
  1067. </el-form-item>
  1068. </el-col>
  1069. </el-row>
  1070. <el-row
  1071. v-if="
  1072. form.shiFouXiaoZhun ===
  1073. '是' && !isSheKou
  1074. "
  1075. >
  1076. <el-col>
  1077. <el-form-item
  1078. label="预期测量范围:"
  1079. >
  1080. <el-input
  1081. v-model="
  1082. form.ceLiangGongZuo
  1083. "
  1084. size="mini"
  1085. />
  1086. </el-form-item>
  1087. </el-col>
  1088. </el-row>
  1089. <el-row
  1090. v-if="
  1091. form.shiFouXiaoZhun ===
  1092. '是' && !isSheKou
  1093. "
  1094. >
  1095. <el-col>
  1096. <el-form-item
  1097. label="U/准确度/最大允差:"
  1098. label-width="130"
  1099. >
  1100. <el-input
  1101. v-model="
  1102. form.zuiDaYunCha
  1103. "
  1104. size="mini"
  1105. style="
  1106. width: 100%;
  1107. "
  1108. />
  1109. </el-form-item>
  1110. </el-col>
  1111. </el-row>
  1112. <el-row
  1113. v-if="
  1114. form.shiFouXiaoZhun ===
  1115. '是' && !isSheKou
  1116. "
  1117. >
  1118. <el-col>
  1119. <el-form-item
  1120. label="校准点/标准值等:"
  1121. >
  1122. <el-input
  1123. v-model="
  1124. form.xiuZhengZhiXiu
  1125. "
  1126. size="mini"
  1127. />
  1128. </el-form-item>
  1129. </el-col>
  1130. </el-row>
  1131. </el-col>
  1132. </el-row>
  1133. <el-row :gutter="20">
  1134. <el-col :span="24">
  1135. <el-alert
  1136. :closable="false"
  1137. type="success"
  1138. style="margin-bottom: 20px"
  1139. >设备照片及相关附件</el-alert
  1140. >
  1141. </el-col>
  1142. <el-col :span="24">
  1143. <el-form-item
  1144. label="设备图片:"
  1145. >
  1146. <ibps-image
  1147. v-model="form.beiZhu"
  1148. height="160"
  1149. width="160"
  1150. accept=".jpg,.jpeg,.png,.gif,.bmp,.webp"
  1151. multiple
  1152. download
  1153. :disabled="readonly"
  1154. size=""
  1155. />
  1156. </el-form-item>
  1157. </el-col>
  1158. <el-col :span="24">
  1159. <el-form-item
  1160. label="附件上传:"
  1161. >
  1162. <ibps-attachment
  1163. v-model="form.yqzp"
  1164. :download="true"
  1165. multiple
  1166. accept="*"
  1167. :readonly="false"
  1168. style="width: 100%"
  1169. />
  1170. </el-form-item>
  1171. </el-col>
  1172. <el-col :span="24">
  1173. <el-form-item
  1174. label="资质证书:"
  1175. >
  1176. <ibps-attachment
  1177. v-model="form.faPiao"
  1178. :download="true"
  1179. multiple
  1180. accept="*"
  1181. :readonly="false"
  1182. style="width: 100%"
  1183. />
  1184. </el-form-item>
  1185. </el-col>
  1186. <el-col :span="24">
  1187. <el-form-item
  1188. label="设备说明书:"
  1189. >
  1190. <ibps-attachment
  1191. v-model="
  1192. form.fuJianShang
  1193. "
  1194. :download="true"
  1195. multiple
  1196. accept="*"
  1197. :readonly="false"
  1198. style="width: 100%"
  1199. />
  1200. </el-form-item>
  1201. </el-col>
  1202. <!-- <el-col :span="24">
  1203. <el-form-item label="说明书分类:">
  1204. <SelectType :field="{}" @change-data="changeData" />
  1205. </el-form-item>
  1206. </el-col>
  1207. <el-col :span="24">
  1208. <el-form-item label="文件路径:">
  1209. <span>{{ form.wenJianXiLei }}</span>
  1210. </el-form-item>
  1211. </el-col> -->
  1212. </el-row>
  1213. </el-form>
  1214. </el-tab-pane>
  1215. <el-tab-pane
  1216. v-for="item in tabItems"
  1217. :key="item.name"
  1218. :label="item.label"
  1219. :name="item.name"
  1220. :disabled="item.isKeepAlive && !isEdit"
  1221. >
  1222. <template v-if="item.isKeepAlive">
  1223. <!-- 使用 v-if 配合 keep-alive 实现按需加载 -->
  1224. <keep-alive>
  1225. <component
  1226. :is="item.component"
  1227. v-if="activeName === item.name"
  1228. :params="form"
  1229. />
  1230. </keep-alive>
  1231. </template>
  1232. <template v-else>
  1233. <component
  1234. :is="item.component"
  1235. :ref="item.ref"
  1236. :list-data="form[item.data]"
  1237. />
  1238. </template>
  1239. </el-tab-pane>
  1240. </el-tabs>
  1241. </el-col>
  1242. </el-row>
  1243. </div>
  1244. </div>
  1245. </div>
  1246. </el-dialog>
  1247. </template>
  1248. <script>
  1249. import { getSetting } from "@/utils/query";
  1250. import dayjs from "dayjs";
  1251. import ibpsUserSelector from "@/business/platform/org/selector";
  1252. import {
  1253. getequipmentCard,
  1254. saveEquipmentCard,
  1255. } from "@/api/platform/device/device";
  1256. import Maintenance from "./maintenance.vue";
  1257. import MoreDevices from "./moreDevices.vue";
  1258. import ScrappedRecord from "./scrappedRecord.vue";
  1259. import MaintenanceRecord from "./maintenanceRecord.vue";
  1260. import RepairRecord from "./repairRecord.vue";
  1261. import CalibrationCheckRecord from "./calibrationCheckRecord.vue";
  1262. import IbpsAttachment from "@/business/platform/file/attachment/selector";
  1263. import SelectType from "@/views/component/selectType.vue";
  1264. import { getImage } from "@/api/platform/file/attachment";
  1265. export default {
  1266. components: {
  1267. ibpsUserSelector,
  1268. Maintenance,
  1269. MoreDevices,
  1270. ScrappedRecord,
  1271. MaintenanceRecord,
  1272. RepairRecord,
  1273. CalibrationCheckRecord,
  1274. IbpsAttachment,
  1275. SelectType,
  1276. IbpsCustomDialog: () =>
  1277. import("@/business/platform/data/templaterender/custom-dialog"),
  1278. IbpsImage: () => import("@/business/platform/file/image"),
  1279. },
  1280. props: {
  1281. params: {
  1282. type: Object,
  1283. default: function () {
  1284. return {};
  1285. },
  1286. },
  1287. stateList: {
  1288. type: Object,
  1289. default: function () {
  1290. return { 停用: "停用", 报废: "报废", 正常: "正常" };
  1291. },
  1292. },
  1293. },
  1294. data() {
  1295. const { userId, org, position, deptList } = this.$store.getters;
  1296. return {
  1297. tabItems: [
  1298. {
  1299. label: "维护项目",
  1300. name: "two",
  1301. ref: "MaintenanceRef",
  1302. data: "maintenanceItemPoList",
  1303. component: "Maintenance",
  1304. isKeepAlive: false,
  1305. },
  1306. {
  1307. label: "附属设备及配件",
  1308. name: "three",
  1309. ref: "MoreDevicesRef",
  1310. data: "accessoriesDevicePoList",
  1311. component: "MoreDevices",
  1312. isKeepAlive: false,
  1313. },
  1314. {
  1315. label: "使用与维护记录",
  1316. name: "four",
  1317. component: "MaintenanceRecord",
  1318. isKeepAlive: true,
  1319. },
  1320. {
  1321. label: "校准记录",
  1322. name: "five",
  1323. component: "CalibrationCheckRecord",
  1324. isKeepAlive: true,
  1325. },
  1326. {
  1327. label: "维修记录",
  1328. name: "six",
  1329. component: "RepairRecord",
  1330. isKeepAlive: true,
  1331. },
  1332. {
  1333. label: "停用、报废记录",
  1334. name: "seven",
  1335. component: "ScrappedRecord",
  1336. isKeepAlive: true,
  1337. },
  1338. ],
  1339. tabList: {},
  1340. filter: [
  1341. {
  1342. descVal: "1",
  1343. includeSub: true,
  1344. old: "org",
  1345. partyId: this.$store.getters.userInfo.employee.org,
  1346. partyName: "",
  1347. scriptContent: "",
  1348. type: "user",
  1349. userType: "org",
  1350. },
  1351. ],
  1352. isFirstyiXiaoRiQi: true,
  1353. isFirstbianZhiBuMen: true,
  1354. isSheKou: false,
  1355. readonly: false,
  1356. activeName: "one",
  1357. dialogVisible: true,
  1358. userId: userId,
  1359. position: position,
  1360. deptList: deptList,
  1361. orgId: org.id,
  1362. loading: false,
  1363. title: "设备档案卡",
  1364. toolbars: [
  1365. { key: "save", label: "保存" },
  1366. {
  1367. key: "cancel",
  1368. label: "退出",
  1369. type: "danger",
  1370. icon: "ibps-icon-close",
  1371. },
  1372. ],
  1373. initWidth: "1480px",
  1374. isEdit: false,
  1375. isFinished: false,
  1376. preParams: {},
  1377. Ids: [],
  1378. form: {
  1379. gouJinRiQi: "", // 购进日期
  1380. changShang: "", // 厂家/品牌
  1381. guiGeXingHao: "", // 规格型号
  1382. jieShouRiQi: "", // 接收日期
  1383. qiYongRiQi: "", // 投入日期
  1384. cunFangDiDian: "",
  1385. cunFangWeiZhi: "", // 放置地点
  1386. jieShouZhuangTai: "", // 接收时状态
  1387. guanLiRen: "", // 负责人
  1388. weiHuFangShi: "", // 设备分组
  1389. bianZhiRen: "", // 建档人
  1390. bianZhiBuMen: "", // 建档部门
  1391. bianZhiShiJian: "", // 建档时间
  1392. shiFouGuoShen: "",
  1393. sheBeiLeiXing: "", // 设备类型
  1394. sheBeiZhuangTa: "", // 设备状态
  1395. sheBeiShiBieH: "", // 设备编号
  1396. shiFouXiaoZhun: "", // 是否校准
  1397. gongYingShang: "",
  1398. shiFouQiJianH: "", // 供应商id
  1399. lianXiFangShi: "", // 供应商电话
  1400. xiaoZhunYouXia: "", // 校准有效期至
  1401. chuChangRiQi: "", // 出厂日期
  1402. sheBeiMingCheng: "", // 设备名称
  1403. sheBeiMingChen: "", // 设备名称id
  1404. yiXiaoRiQi: "", // 最近校准时间
  1405. heChaXiaoZhun: "", // 使用年限
  1406. shiJiShiYongF: "", // 关机时间
  1407. kaiShiShiYong: "", // 开机时间
  1408. zhengShuBianHa: "", // 校准证书编号
  1409. xiaoZhunWuCha: "", // 是否限用
  1410. xiaoZhunZQ: "", // 检定/校准周期
  1411. shiYongKeShi: "", // 检定/校准单位
  1412. yuanSheBeiBian: "", // 设备编号
  1413. jianKongYiJu: "", // 是否24H开机
  1414. biXuDeHuanJin: "", // 核查人
  1415. biXuSheShi: "", // 核查日期
  1416. ziChanYuanZhi: "", // 资产原值
  1417. ziChanBianHao: "", // 资产编号
  1418. shiFouWeiHu: "", // 是否维护
  1419. jiShenXuHao: "", // 出厂编号
  1420. yanShouRiQi: "", // 验收日期
  1421. huanJingYaoQiu: "", // 环境要求
  1422. dianYuanYaoQiu: "", // 电源要求
  1423. zhuCeZhengHao: "", // 注册证号
  1424. yqzp: "", // 附件上传
  1425. faPiao: "", // 资质证书
  1426. fuJianShang: "", // 设备使用说明书
  1427. beiZhu: "", // 设备图片
  1428. caiGouHeTong: "", // 限用范围
  1429. zhuanYeBuMen: "",
  1430. wenJianXiLei: "", // 附件细类
  1431. xiLeiId: "",
  1432. quanXianLeiXing: "",
  1433. diDian: "",
  1434. buMen: "", // 图片id
  1435. ceLiangGongZuo: "", // 测量范围
  1436. jianDingXiao: "", // 检定/校准参数
  1437. xiuZhengZhiXiu: "", // 修正值
  1438. zuiDaYunCha: "", // U/精确度/最大允差
  1439. shiWuShuoMing: "", // 校准机构
  1440. shiFouHeCha: "", // 是否期间核查
  1441. jiShuCanShu: "", //技术参数
  1442. },
  1443. rules: {
  1444. sheBeiMingCheng: [
  1445. {
  1446. required: true,
  1447. message: "设备名称不能为空",
  1448. trigger: "blur",
  1449. },
  1450. ],
  1451. sheBeiShiBieH: [
  1452. {
  1453. required: true,
  1454. message: "设备编号不能为空",
  1455. trigger: "blur",
  1456. },
  1457. ],
  1458. yuanSheBeiBian: [
  1459. {
  1460. required: true,
  1461. message: "设备编号不能为空",
  1462. trigger: "blur",
  1463. },
  1464. ],
  1465. // sheBeiLeiXing: [
  1466. // {
  1467. // required: true,
  1468. // message: "设备类型不能为空",
  1469. // trigger: "blur",
  1470. // },
  1471. // ],
  1472. sheBeiZhuangTa: [
  1473. {
  1474. required: true,
  1475. message: "设备状态不能为空",
  1476. trigger: "blur",
  1477. },
  1478. ],
  1479. guiGeXingHao: [
  1480. {
  1481. required: true,
  1482. message: "规格型号不能为空",
  1483. trigger: "blur",
  1484. },
  1485. ],
  1486. bianZhiBuMen: [
  1487. {
  1488. required: true,
  1489. message: "建档部门不能为空",
  1490. trigger: "blur",
  1491. },
  1492. ],
  1493. bianZhiRen: [
  1494. {
  1495. required: true,
  1496. message: "建档人不能为空",
  1497. trigger: "blur",
  1498. },
  1499. ],
  1500. bianZhiShiJian: [
  1501. {
  1502. required: true,
  1503. message: "建档时间不能为空",
  1504. trigger: "blur",
  1505. },
  1506. ],
  1507. jieShouZhuangTai: [
  1508. {
  1509. required: true,
  1510. message: "接收时状态不能为空",
  1511. trigger: "blur",
  1512. },
  1513. ],
  1514. guanLiRen: [
  1515. {
  1516. required: true,
  1517. message: "负责人不能为空",
  1518. trigger: "blur",
  1519. },
  1520. ],
  1521. cunFangWeiZhi: [
  1522. {
  1523. required: true,
  1524. message: "放置地点不能为空",
  1525. trigger: "blur",
  1526. },
  1527. ],
  1528. shiFouXiaoZhun: [
  1529. {
  1530. required: true,
  1531. message: "是否校准不能为空",
  1532. trigger: "blur",
  1533. },
  1534. ],
  1535. chuChangRiQi: [
  1536. {
  1537. required: true,
  1538. message: "出厂日期不能为空",
  1539. trigger: "blur",
  1540. },
  1541. ],
  1542. },
  1543. };
  1544. },
  1545. computed: {
  1546. photos() {
  1547. if (this.form.beiZhu) {
  1548. const photos = JSON.parse(this.form.beiZhu);
  1549. photos.forEach((item) => {
  1550. item.url = getImage(item.id);
  1551. });
  1552. return photos;
  1553. }
  1554. return [];
  1555. },
  1556. showState() {
  1557. return (
  1558. this.stateList[this.form.sheBeiZhuangTa] ||
  1559. this.form.sheBeiZhuangTa
  1560. );
  1561. },
  1562. },
  1563. watch: {
  1564. photos: {
  1565. handler(val) {
  1566. this.form.buMen = val.map((item) => item.id).join(",");
  1567. },
  1568. },
  1569. "form.xiaoZhunWuCha": {
  1570. handler(val, old) {
  1571. if (!old) return;
  1572. if (val === "否") {
  1573. this.form.sheBeiZhuangTa = "正常";
  1574. } else if (val === "是") {
  1575. this.form.caiGouHeTong = "";
  1576. this.form.sheBeiZhuangTa = "限用";
  1577. }
  1578. },
  1579. },
  1580. "form.cunFangWeiZhi": {
  1581. async handler(val) {
  1582. if (!val) return;
  1583. const sql = `select fang_jian_ming_ha from t_jjqfjb where id_='${val}'`;
  1584. const {
  1585. variables: { data },
  1586. } = await this.$common.request("sql", sql);
  1587. this.form.cunFangDiDian = data[0].fang_jian_ming_ha;
  1588. },
  1589. },
  1590. // 根据编制部门动态获取对应文件存放处数据
  1591. // 'form.bianZhiBuMen': {
  1592. // handler (value) {
  1593. // if (value) {
  1594. // if (this.isFirstbianZhiBuMen) {
  1595. // this.isFirstbianZhiBuMen = false
  1596. // return
  1597. // }
  1598. // this.handleData(value)
  1599. // }
  1600. // }
  1601. // },
  1602. // 根据最近检定时间动态计算对应有效期至
  1603. "form.yiXiaoRiQi": {
  1604. handler(value) {
  1605. if (value) {
  1606. if (this.isFirstyiXiaoRiQi) {
  1607. this.isFirstyiXiaoRiQi = false;
  1608. return;
  1609. }
  1610. const zhouQi = this.form.xiaoZhunZQ || 0;
  1611. const result = this.$common.getFormatDate(
  1612. "string",
  1613. 10,
  1614. this.$common.getDate("month", Number(zhouQi), value)
  1615. );
  1616. this.form.xiaoZhunYouXia = result;
  1617. }
  1618. },
  1619. },
  1620. },
  1621. async mounted() {
  1622. const tabList = await getSetting("device", "tabList");
  1623. if (tabList) {
  1624. console.debug(tabList);
  1625. this.tabList = tabList;
  1626. }
  1627. this.init();
  1628. },
  1629. methods: {
  1630. sheBeiMingChenChange(key, data) {
  1631. this.form.sheBeiMingCheng = data.ming_cheng_str_;
  1632. this.form.guiGeXingHao = data.xing_hao_gui_ge_;
  1633. this.form.jiShenXuHao = data.chu_chang_bian_ha;
  1634. this.form.changShang = data.sheng_chan_chang_;
  1635. this.form.yuanSheBeiBian = data.she_bei_bian_hao_;
  1636. },
  1637. // 根据供应商自动带出供应商名称和电话
  1638. shiFouQiJianHChange(key, data) {
  1639. this.form.lianXiFangShi = data.lian_xi_dian_hua_;
  1640. this.form.gongYingShang = data.gong_ying_shang_m;
  1641. },
  1642. changeData(...args) {
  1643. this.form[args[0]] = args[1];
  1644. },
  1645. handleData(departmentId) {
  1646. // JSON_UNQUOTE( JSON_EXTRACT( AUTHORITY_NAME, '$.chaYue' ) )
  1647. const sql = `select
  1648. id_ AS leiXingId,
  1649. AUTHORITY_NAME AS chaYueValue
  1650. FROM
  1651. ibps_cat_type
  1652. WHERE
  1653. category_key_ = 'FILE_TYPE'
  1654. AND AUTHORITY_NAME LIKE '%"${departmentId}"%'
  1655. AND name_ = '设备使用说明书'`;
  1656. // console.log(sql)
  1657. const { deptList = [] } = this.$store.getters || {};
  1658. const dept = deptList.find((i) => i.positionId === departmentId);
  1659. this.$common.request("sql", sql).then((res) => {
  1660. const { data = [] } = res.variables || {};
  1661. this.form.wenJianXiLei = `外部文件 / ${dept?.positionName} / 设备使用说明书`;
  1662. if (!data.length) {
  1663. return;
  1664. }
  1665. const { leiXingId, chaYueValue } = data[0] || {};
  1666. this.form.xiLeiId = leiXingId;
  1667. this.form.quanXianLeiXing = JSON.parse(chaYueValue).chaYue;
  1668. this.form.zhuanYeBuMen = departmentId;
  1669. });
  1670. },
  1671. handleClick() {},
  1672. handleActionEvent({ key }) {
  1673. switch (key) {
  1674. case "cancel":
  1675. this.closeDialog(true);
  1676. break;
  1677. case "save":
  1678. this.goSave("close");
  1679. break;
  1680. default:
  1681. break;
  1682. }
  1683. },
  1684. // 获取人员部门
  1685. getPersonPosition(id) {
  1686. const userList = this.$store.getters.userList;
  1687. const bianzhiUserid = userList.find((i) => i.userId === id);
  1688. if (bianzhiUserid) {
  1689. return bianzhiUserid.positionId;
  1690. }
  1691. },
  1692. isDateMoreThenSecondDay(firstTime, secondTime) {
  1693. if (!firstTime || !secondTime) {
  1694. return false;
  1695. }
  1696. return (
  1697. new Date(firstTime).getTime() > new Date(secondTime).getTime()
  1698. );
  1699. },
  1700. async checkRequired(flag) {
  1701. if (this.form.xiaoZhunWuCha === "是" && !this.form.caiGouHeTong) {
  1702. throw new Error("请填写限用范围!");
  1703. }
  1704. if (this.form.accessoriesDevicePoList.length > 0) {
  1705. for (
  1706. let i = 0;
  1707. i < this.form.accessoriesDevicePoList.length;
  1708. i++
  1709. ) {
  1710. const item = this.form.accessoriesDevicePoList[i];
  1711. if (!item.mingCheng) {
  1712. throw new Error(`附属设备及配件第${i + 1}行名称缺失!`);
  1713. }
  1714. if (!item.guiGeXingHao1) {
  1715. throw new Error(
  1716. `附属设备及配件第${i + 1}行规格型号缺失!`
  1717. );
  1718. }
  1719. if (!item.danWei) {
  1720. throw new Error(`附属设备及配件第${i + 1}行单位缺失!`);
  1721. }
  1722. if (!item.shuLiang) {
  1723. throw new Error(`附属设备及配件第${i + 1}行数量缺失!`);
  1724. }
  1725. }
  1726. }
  1727. const sysDeviceNo = this.form.sheBeiShiBieH;
  1728. const originalDeviceNo = this.form.yuanSheBeiBian;
  1729. const position = this.form.diDian;
  1730. 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`;
  1731. const result = await this.$common.request("sql", sql);
  1732. const { data = [] } = result.variables || {};
  1733. if (data[0].num > 0) {
  1734. throw new Error(
  1735. `系统当前已经存在此设备编号,请更换另一个编号!`
  1736. );
  1737. }
  1738. const exFactoryTime = this.form.chuChangRiQi;
  1739. const reviceTime = this.form.jieShouRiQi;
  1740. const useTime = this.form.qiYongRiQi;
  1741. // 如果有出厂日期,则接收日期必须在出厂日期之后,投入日期必须在出厂日期之后
  1742. // 校验接收日期是否在投入日期之前
  1743. if (exFactoryTime && reviceTime) {
  1744. if (this.isDateMoreThenSecondDay(exFactoryTime, reviceTime)) {
  1745. throw new Error(`该设备的接收日期不得早于出厂日期!`);
  1746. }
  1747. }
  1748. if (exFactoryTime && useTime) {
  1749. if (this.isDateMoreThenSecondDay(exFactoryTime, useTime)) {
  1750. throw new Error(`该设备的投入日期不得早于出厂日期!`);
  1751. }
  1752. }
  1753. if (reviceTime && useTime) {
  1754. if (this.isDateMoreThenSecondDay(reviceTime, useTime)) {
  1755. throw new Error(`该设备的投入日期不得早于接收日期!`);
  1756. }
  1757. }
  1758. },
  1759. async goAdd() {
  1760. try {
  1761. this.loading = true;
  1762. await saveEquipmentCard(this.form);
  1763. this.$message.success("添加成功");
  1764. this.closeDialog(true);
  1765. this.loading = false;
  1766. } catch (error) {
  1767. console.log(error);
  1768. this.$message.warning("添加失败");
  1769. this.loading = false;
  1770. }
  1771. },
  1772. async subForm(id, table, parentData) {
  1773. const sql1 = `select id_ from ${table} where parent_id_='${id}'`;
  1774. const {
  1775. variables: { data },
  1776. } = await this.$common.request("sql", sql1);
  1777. const pre_list =
  1778. data.length > 0 ? data.map((item) => item.id_) : [];
  1779. const update_list = [];
  1780. const add_list = [];
  1781. parentData.forEach((item) => {
  1782. if (item.id) {
  1783. update_list.push(item);
  1784. } else {
  1785. add_list.push(item);
  1786. }
  1787. });
  1788. const delete_list = pre_list.filter(
  1789. (id) => !update_list.map((item) => item.id).includes(id)
  1790. );
  1791. return {
  1792. add_list,
  1793. update_list,
  1794. delete_list,
  1795. };
  1796. },
  1797. async goEdit(flag) {
  1798. try {
  1799. this.loading = true;
  1800. await saveEquipmentCard(this.form);
  1801. this.$message.success("修改成功");
  1802. this.closeDialog(true);
  1803. this.loading = false;
  1804. } catch (error) {
  1805. this.$message.warning(error.message);
  1806. this.loading = false;
  1807. throw new Error(error.message);
  1808. }
  1809. },
  1810. goSave(flag) {
  1811. this.$refs.form.validate(async (valid) => {
  1812. if (valid) {
  1813. try {
  1814. // 维护项目
  1815. this.form.maintenanceItemPoList =
  1816. this.$refs.MaintenanceRef?.[0]?.listDataCopy ||
  1817. this.form.maintenanceItemPoList ||
  1818. [];
  1819. // 附属设备及配件
  1820. this.form.accessoriesDevicePoList =
  1821. this.$refs.MoreDevicesRef?.[0]?.listDataCopy ||
  1822. this.form.accessoriesDevicePoList ||
  1823. [];
  1824. await this.checkRequired();
  1825. if (this.isEdit) {
  1826. this.goEdit(flag);
  1827. } else {
  1828. this.goAdd();
  1829. }
  1830. } catch (error) {
  1831. this.$message.warning(error.message);
  1832. }
  1833. } else {
  1834. return this.$message.warning("请填写必填项!");
  1835. }
  1836. });
  1837. },
  1838. // 刷新
  1839. async goRefresh() {},
  1840. // 关闭当前窗口
  1841. closeDialog(needRefresh) {
  1842. this.dialogVisible = false;
  1843. if (needRefresh) {
  1844. this.$emit("close");
  1845. }
  1846. },
  1847. // 检查设备编号是否重复
  1848. async checkIsRepeat(id) {
  1849. const sql = `select id_ from t_sbdj where she_bei_shi_bie_h='${id}' limit 1`;
  1850. const {
  1851. variables: { data },
  1852. } = await this.$common.request("sql", sql);
  1853. return data.length > 0;
  1854. },
  1855. generateRandomString() {
  1856. return `JYXT-${Math.floor(Math.random() * 88888) + 10000}`;
  1857. },
  1858. async init() {
  1859. this.loading = true;
  1860. this.isEdit = !!(this.params && this.params.id);
  1861. this.isSheKou =
  1862. this.deptList[0].positionId === "1166372468122714112"; // 判断是否是蛇口医院
  1863. // 根据全局配置动态生成tab
  1864. const newTab = [];
  1865. for (const key in this.tabList) {
  1866. if (Object.hasOwnProperty.call(this.tabList, key)) {
  1867. const newLabel = this.tabList[key];
  1868. const t = this.tabItems.find((i) => i.label === key);
  1869. if (t) {
  1870. t.label = newLabel;
  1871. newTab.push(t);
  1872. }
  1873. }
  1874. }
  1875. if (newTab.length > 0) {
  1876. this.tabItems = newTab;
  1877. }
  1878. if (this.isEdit) {
  1879. const { data } = await getequipmentCard({ id: this.params.id });
  1880. this.form = data;
  1881. } else {
  1882. this.isFirstbianZhiBuMen = false;
  1883. this.isFirstyiXiaoRiQi = false;
  1884. // 随机生成一个不重复的设备编号
  1885. this.form.sheBeiShiBieH = this.generateRandomString();
  1886. for (; await this.checkIsRepeat(this.form.sheBeiShiBieH); ) {
  1887. this.form.sheBeiShiBieH = this.generateRandomString();
  1888. }
  1889. this.form.jieShouRiQi = dayjs().format("YYYY-MM-DD");
  1890. this.form.qiYongRiQi = dayjs().format("YYYY-MM-DD");
  1891. this.form.xiaoZhunWuCha = "否";
  1892. this.form.jieShouZhuangTai = "新设备";
  1893. this.form.bianZhiRen = this.userId;
  1894. this.form.bianZhiBuMen = this.orgId;
  1895. this.form.bianZhiShiJian = dayjs().format("YYYY-MM-DD HH:mm");
  1896. this.form.shiFouGuoShen = "已完成";
  1897. this.form.sheBeiLeiXing = "检验系统";
  1898. this.form.sheBeiZhuangTa = "正常";
  1899. this.form.shiFouXiaoZhun = "是";
  1900. this.form.jianKongYiJu = "否";
  1901. this.form.shiFouWeiHu = "是";
  1902. this.form.shiFouHeCha = "是";
  1903. }
  1904. this.loading = false;
  1905. },
  1906. },
  1907. };
  1908. </script>
  1909. <style lang="scss" scoped>
  1910. .paper-detail-dialog {
  1911. ::v-deep {
  1912. .el-dialog__header {
  1913. text-align: center;
  1914. }
  1915. }
  1916. .dialog-title {
  1917. display: flex;
  1918. align-items: center;
  1919. justify-content: center;
  1920. div {
  1921. z-index: 99999999;
  1922. position: absolute;
  1923. right: 8vw;
  1924. }
  1925. .dialogtitle {
  1926. font-size: 22px;
  1927. font-family: SimHei;
  1928. font-weight: bold;
  1929. color: #222;
  1930. }
  1931. }
  1932. .container {
  1933. display: flex;
  1934. width: 100%;
  1935. justify-content: center;
  1936. .el-row {
  1937. margin: 0 !important;
  1938. }
  1939. .required {
  1940. color: #606266 !important;
  1941. &::before {
  1942. content: "*";
  1943. margin: 0 4px 0 -7.5px;
  1944. color: #f56c6c;
  1945. }
  1946. }
  1947. .left {
  1948. height: calc(100vh - 100px);
  1949. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  1950. padding: 20px;
  1951. overflow-y: auto;
  1952. .form {
  1953. margin-left: -20px;
  1954. }
  1955. .item {
  1956. width: 100%;
  1957. }
  1958. .title {
  1959. margin: 16px 0 6px -16px;
  1960. }
  1961. .tabs {
  1962. margin-top: 40px;
  1963. }
  1964. .question-icon {
  1965. margin-left: 2px;
  1966. }
  1967. }
  1968. }
  1969. }
  1970. ::v-deep {
  1971. .el-form-item__label {
  1972. text-align: left;
  1973. font-size: 12px !important;
  1974. }
  1975. .el-form-item__content {
  1976. font-size: 12px !important;
  1977. display: flex;
  1978. }
  1979. .el-table th {
  1980. background-color: #f5f7fa !important;
  1981. }
  1982. .el-tabs__header {
  1983. margin: 0 0 30px !important;
  1984. }
  1985. .ibps-image {
  1986. width: 100%;
  1987. .ibps-p-0 {
  1988. width: 100%;
  1989. .list-group {
  1990. display: flex;
  1991. align-items: center;
  1992. gap: 20px;
  1993. flex-wrap: wrap;
  1994. }
  1995. }
  1996. }
  1997. }
  1998. </style>