deviceDialog.vue 72 KB

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