deviceDialog.vue 73 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920
  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">建档部门11:</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. <el-date-picker
  448. v-if="!readonly"
  449. v-model="form.gouJinRiQi"
  450. style="width: 100%"
  451. type="date"
  452. placeholder="选择日期"
  453. :readonly="readonly"
  454. value-format="yyyy-MM-dd"
  455. size="mini"
  456. />
  457. <span v-else>{{ form.gouJinRiQi || '/' }}</span>
  458. </el-form-item>
  459. </el-col>
  460. </el-row>
  461. <el-row>
  462. <el-col>
  463. <el-form-item label="接收日期:">
  464. <el-date-picker
  465. v-if="!readonly"
  466. v-model="form.jieShouRiQi"
  467. style="width: 100%"
  468. type="date"
  469. placeholder="选择日期"
  470. :readonly="readonly"
  471. value-format="yyyy-MM-dd"
  472. size="mini"
  473. />
  474. <span v-else>{{ form.jieShouRiQi || '/' }}</span>
  475. </el-form-item>
  476. </el-col>
  477. </el-row>
  478. <el-row>
  479. <el-col>
  480. <el-form-item label="验收日期:" prop="yanShouRiQi">
  481. <template slot="label">
  482. <span
  483. :class="
  484. dynamicRequiredFields ? 'required' : ''
  485. "
  486. >验收日期:</span
  487. >
  488. </template>
  489. <el-date-picker
  490. v-if="!readonly"
  491. v-model="form.yanShouRiQi"
  492. style="width: 100%"
  493. type="date"
  494. placeholder="选择日期"
  495. :readonly="readonly"
  496. value-format="yyyy-MM-dd"
  497. size="mini"
  498. />
  499. <span v-else>{{ form.yanShouRiQi || '/' }}</span>
  500. </el-form-item>
  501. </el-col>
  502. </el-row>
  503. <el-row>
  504. <el-col>
  505. <el-form-item label="投入日期:" prop="qiYongRiQi">
  506. <template slot="label">
  507. <span
  508. :class="
  509. dynamicRequiredFields ? 'required' : ''
  510. "
  511. >投入日期:</span
  512. >
  513. </template>
  514. <el-date-picker
  515. v-if="!readonly"
  516. v-model="form.qiYongRiQi"
  517. style="width: 100%"
  518. type="date"
  519. placeholder="选择日期"
  520. :readonly="readonly"
  521. value-format="yyyy-MM-dd"
  522. size="mini"
  523. />
  524. <span v-else>{{ form.qiYongRiQi || '/' }}</span>
  525. </el-form-item>
  526. </el-col>
  527. </el-row>
  528. <el-row>
  529. <el-col>
  530. <el-form-item label="核查日期:">
  531. <el-date-picker
  532. v-if="!readonly"
  533. v-model="form.biXuSheShi"
  534. style="width: 100%"
  535. type="date"
  536. placeholder="选择日期"
  537. :readonly="readonly"
  538. value-format="yyyy-MM-dd"
  539. size="mini"
  540. />
  541. <span v-else>{{ form.biXuSheShi || '/' }}</span>
  542. </el-form-item>
  543. </el-col>
  544. </el-row>
  545. <el-row>
  546. <el-col>
  547. <el-form-item label="核查人:">
  548. <ibps-user-selector
  549. v-model="form.biXuDeHuanJin"
  550. type="user"
  551. readonly-text="text"
  552. :disabled="readonly"
  553. :multiple="false"
  554. size="mini"
  555. style="width: 100%"
  556. :filter="filter"
  557. filtrate
  558. />
  559. </el-form-item>
  560. </el-col>
  561. </el-row>
  562. <el-row>
  563. <el-col>
  564. <el-form-item label="电源要求:">
  565. <el-input
  566. v-if="!readonly"
  567. v-model="form.dianYuanYaoQiu"
  568. size="mini"
  569. />
  570. <span v-else>{{
  571. form.dianYuanYaoQiu || '/'
  572. }}</span>
  573. </el-form-item>
  574. </el-col>
  575. </el-row>
  576. <el-row>
  577. <el-col>
  578. <el-form-item label="环境要求:">
  579. <el-input
  580. v-if="!readonly"
  581. v-model="form.huanJingYaoQiu"
  582. size="mini"
  583. />
  584. <span v-else>{{
  585. form.huanJingYaoQiu || '/'
  586. }}</span>
  587. </el-form-item>
  588. </el-col>
  589. </el-row>
  590. <el-row>
  591. <el-col>
  592. <el-form-item label="使用年限(年):">
  593. <el-input
  594. v-if="!readonly"
  595. v-model="form.heChaXiaoZhun"
  596. size="mini"
  597. type="number"
  598. />
  599. <span v-else
  600. >{{ form.heChaXiaoZhun || '/' }}
  601. </span>
  602. </el-form-item>
  603. </el-col>
  604. </el-row>
  605. <el-row>
  606. <el-col>
  607. <el-form-item label="资产原值(元):">
  608. <el-input
  609. v-if="!readonly"
  610. v-model="form.ziChanYuanZhi"
  611. size="mini"
  612. type="number"
  613. />
  614. <span v-else
  615. >{{ form.ziChanYuanZhi || '/' }}
  616. </span>
  617. </el-form-item>
  618. </el-col>
  619. </el-row>
  620. </el-col>
  621. <!-- 第二列 -->
  622. <el-col :span="8">
  623. <el-row>
  624. <el-col>
  625. <el-form-item label="是否维护:">
  626. <el-select
  627. v-if="!readonly"
  628. v-model="form.shiFouWeiHu"
  629. placeholder="请选择"
  630. size="mini"
  631. style="width: 100%"
  632. >
  633. <el-option
  634. v-for="item in ['是', '否']"
  635. :key="item"
  636. :label="item"
  637. :value="item"
  638. />
  639. </el-select>
  640. <span v-else>{{ form.shiFouWeiHu || '/' }} </span>
  641. </el-form-item>
  642. </el-col>
  643. </el-row>
  644. <el-row>
  645. <el-col>
  646. <el-form-item label="岗位/分组:">
  647. <ibps-custom-dialog
  648. v-model="form.weiHuFangShi"
  649. size="mini"
  650. :template-key="
  651. config ? 'gwzzdhkrcwh' : 'sbbqdhk'
  652. "
  653. multiple
  654. :disabled="readonly"
  655. type="dialog"
  656. class="custom-dialog"
  657. placeholder="请选择"
  658. icon="el-icon-search"
  659. style="width: 100%"
  660. />
  661. </el-form-item>
  662. </el-col>
  663. </el-row>
  664. <el-row>
  665. <el-col>
  666. <el-form-item label="是否24H开机:">
  667. <el-select
  668. v-if="!readonly"
  669. v-model="form.jianKongYiJu"
  670. placeholder="请选择"
  671. size="mini"
  672. style="width: 100%"
  673. >
  674. <el-option
  675. v-for="item in ['是', '否']"
  676. :key="item"
  677. :label="item"
  678. :value="item"
  679. />
  680. </el-select>
  681. <span v-else
  682. >{{ form.jianKongYiJu || '/' }}
  683. </span>
  684. </el-form-item>
  685. </el-col>
  686. </el-row>
  687. <el-row v-if="form.jianKongYiJu === '否'">
  688. <el-col>
  689. <el-form-item label="开机时间:">
  690. <el-time-picker
  691. v-if="!readonly"
  692. v-model="form.kaiShiShiYong"
  693. placeholder="任意时间点"
  694. size="mini"
  695. style="width: 100%"
  696. value-format="HH:mm:ss"
  697. />
  698. <span v-else
  699. >{{ form.kaiShiShiYong || '/' }}
  700. </span>
  701. </el-form-item>
  702. </el-col>
  703. </el-row>
  704. <el-row v-if="form.jianKongYiJu === '否'">
  705. <el-col>
  706. <el-form-item label="关机时间:">
  707. <el-time-picker
  708. v-if="!readonly"
  709. v-model="form.shiJiShiYongF"
  710. placeholder="任意时间点"
  711. size="mini"
  712. style="width: 100%"
  713. value-format="HH:mm:ss"
  714. />
  715. <span v-else
  716. >{{ form.shiJiShiYongF || '/' }}
  717. </span></el-form-item
  718. >
  719. </el-col>
  720. </el-row>
  721. <!-- <el-row>
  722. <el-col>
  723. <el-form-item label="是否限用:">
  724. <el-select v-model="form.xiaoZhunWuCha" placeholder="请选择" size="mini" style="width:100%">
  725. <el-option
  726. v-for="item in ['是','否']"
  727. :key="item"
  728. :label="item"
  729. :value="item"
  730. />
  731. </el-select>
  732. </el-form-item>
  733. </el-col>
  734. </el-row>
  735. <el-row v-if="form.xiaoZhunWuCha==='是'">
  736. <el-col>
  737. <el-form-item label="限用范围:">
  738. <el-input v-model="form.caiGouHeTong" size="mini" />
  739. </el-form-item>
  740. </el-col>
  741. </el-row> -->
  742. <el-row>
  743. <!-- todo -->
  744. <el-col>
  745. <el-alert
  746. title="开关机时间配置说明"
  747. type="success"
  748. description="日保养、按需保养、这些周期,如果配置了开关机时间,在设备使用与维护时会自动带出"
  749. :closable="false"
  750. />
  751. </el-col>
  752. </el-row>
  753. <el-row>
  754. <el-col>
  755. <el-form-item
  756. :style="{ 'margin-top': '10px' }"
  757. label="备注:"
  758. >
  759. <el-input
  760. v-model="form.remark"
  761. size="mini"
  762. type="textarea"
  763. :autosize="{ maxRows: 4, minRows: 2 }"
  764. v-if="!readonly"
  765. />
  766. <span v-else>{{ form.remark }}</span>
  767. </el-form-item>
  768. </el-col>
  769. </el-row>
  770. </el-col>
  771. <!-- 第三列 -->
  772. <el-col :span="8">
  773. <el-row>
  774. <el-col>
  775. <el-form-item
  776. label="是否校准:"
  777. prop="shiFouXiaoZhun"
  778. label-width="140px"
  779. >
  780. <el-select
  781. v-if="!readonly"
  782. v-model="form.shiFouXiaoZhun"
  783. placeholder="请选择"
  784. size="mini"
  785. style="width: 100%"
  786. >
  787. <el-option
  788. v-for="item in ['是', '否']"
  789. :key="item"
  790. :label="item"
  791. :value="item"
  792. />
  793. </el-select>
  794. <span v-else
  795. >{{ form.shiFouXiaoZhun || '/' }}
  796. </span>
  797. </el-form-item>
  798. </el-col>
  799. </el-row>
  800. <el-row v-if="form.shiFouXiaoZhun === '是'">
  801. <el-col>
  802. <el-form-item
  803. label="检定/校准周期(月):"
  804. label-width="140px"
  805. prop="xiaoZhunZQ"
  806. >
  807. <template slot="label">
  808. <span
  809. :class="
  810. dynamicRequiredFields ? 'required' : ''
  811. "
  812. >检定/校准周期(月):</span
  813. >
  814. </template>
  815. <el-input
  816. v-if="!readonly"
  817. v-model="form.xiaoZhunZQ"
  818. size="mini"
  819. type="number"
  820. style="width: 100%"
  821. />
  822. <span v-else>{{ form.xiaoZhunZQ || '/' }} </span>
  823. </el-form-item>
  824. </el-col>
  825. </el-row>
  826. <el-row v-if="form.shiFouXiaoZhun === '是'">
  827. <el-col>
  828. <el-form-item
  829. label="检定/校准单位:"
  830. label-width="140px"
  831. >
  832. <ibps-custom-dialog
  833. v-model="form.shiYongKeShi"
  834. size="mini"
  835. template-key="gysxxdhk"
  836. :disabled="readonly"
  837. type="dialog"
  838. class="custom-dialog"
  839. placeholder="请选择"
  840. icon="el-icon-search"
  841. style="width: 100%"
  842. />
  843. </el-form-item>
  844. </el-col>
  845. </el-row>
  846. <el-row v-if="form.shiFouXiaoZhun === '是'">
  847. <el-col>
  848. <el-form-item
  849. label="最近校准时间:"
  850. label-width="140px"
  851. prop="yiXiaoRiQi"
  852. >
  853. <template slot="label">
  854. <span
  855. :class="
  856. dynamicRequiredFields ? 'required' : ''
  857. "
  858. >最近校准时间:</span
  859. >
  860. </template>
  861. <el-date-picker
  862. v-if="!readonly"
  863. v-model="form.yiXiaoRiQi"
  864. style="width: 100%"
  865. type="date"
  866. placeholder="选择日期"
  867. :readonly="readonly"
  868. value-format="yyyy-MM-dd"
  869. size="mini"
  870. />
  871. <span v-else>{{ form.yiXiaoRiQi || '/' }} </span>
  872. </el-form-item>
  873. </el-col>
  874. </el-row>
  875. <el-row v-if="form.shiFouXiaoZhun === '是'">
  876. <el-col>
  877. <el-form-item
  878. label="检定/校准有效期至:"
  879. label-width="140px"
  880. prop="xiaoZhunYouXia"
  881. >
  882. <template slot="label">
  883. <span
  884. :class="
  885. dynamicRequiredFields ? 'required' : ''
  886. "
  887. >检定/校准有效期至:</span
  888. >
  889. </template>
  890. <el-date-picker
  891. v-if="!readonly"
  892. v-model="form.xiaoZhunYouXia"
  893. style="width: 100%"
  894. type="date"
  895. placeholder="选择日期"
  896. :readonly="readonly"
  897. value-format="yyyy-MM-dd"
  898. size="mini"
  899. />
  900. <span v-else
  901. >{{ form.xiaoZhunYouXia || '/' }}
  902. </span>
  903. </el-form-item>
  904. </el-col>
  905. </el-row>
  906. <el-row v-if="form.shiFouXiaoZhun === '是'">
  907. <el-col>
  908. <el-form-item
  909. label="检定/校准证书编号:"
  910. label-width="140px"
  911. >
  912. <el-input
  913. v-if="!readonly"
  914. v-model="form.zhengShuBianHa"
  915. size="mini"
  916. />
  917. <span v-else
  918. >{{ form.zhengShuBianHa || '/' }}
  919. </span>
  920. </el-form-item>
  921. </el-col>
  922. </el-row>
  923. <el-row v-if="false">
  924. <el-col>
  925. <el-form-item label="校准机构:">
  926. <el-input
  927. v-if="!readonly"
  928. v-model="form.shiWuShuoMing"
  929. size="mini"
  930. />
  931. <span v-else
  932. >{{ form.shiWuShuoMing || '/' }}
  933. </span>
  934. </el-form-item>
  935. </el-col>
  936. </el-row>
  937. <el-row v-if="form.shiFouXiaoZhun === '是'">
  938. <el-col>
  939. <el-form-item
  940. label="检定/校准参数:"
  941. label-width="140px"
  942. >
  943. <el-input
  944. v-model="form.jianDingXiao"
  945. size="mini"
  946. type="textarea"
  947. :autosize="{ maxRows: 4, minRows: 2 }"
  948. v-if="!readonly"
  949. />
  950. <span v-else>{{ form.jianDingXiao }}</span>
  951. </el-form-item>
  952. </el-col>
  953. </el-row>
  954. <el-row v-if="form.shiFouXiaoZhun === '是'">
  955. <el-col>
  956. <el-form-item
  957. label="预期测量范围:"
  958. label-width="140px"
  959. >
  960. <el-input
  961. v-model="form.ceLiangGongZuo"
  962. type="textarea"
  963. size="mini"
  964. :autosize="{ maxRows: 4, minRows: 2 }"
  965. v-if="!readonly"
  966. />
  967. <span v-else>{{ form.ceLiangGongZuo }}</span>
  968. </el-form-item>
  969. </el-col>
  970. </el-row>
  971. <el-row v-if="form.shiFouXiaoZhun === '是'">
  972. <el-col>
  973. <el-form-item
  974. label="U/精确度/最大允差:"
  975. label-width="140px"
  976. >
  977. <el-input
  978. v-model="form.zuiDaYunCha"
  979. type="textarea"
  980. size="mini"
  981. style="width: 100%"
  982. :autosize="{ maxRows: 4, minRows: 2 }"
  983. v-if="!readonly"
  984. />
  985. <span v-else>{{ form.zuiDaYunCha }}</span>
  986. </el-form-item>
  987. </el-col>
  988. </el-row>
  989. <el-row v-if="form.shiFouXiaoZhun === '是'">
  990. <el-col>
  991. <el-form-item label="修正值:" label-width="140px">
  992. <el-input
  993. v-if="!readonly"
  994. v-model="form.xiuZhengZhiXiu"
  995. size="mini"
  996. />
  997. <span v-else
  998. >{{ form.xiuZhengZhiXiu || '/' }}
  999. </span>
  1000. </el-form-item>
  1001. </el-col>
  1002. </el-row>
  1003. </el-col>
  1004. </el-row>
  1005. <el-row :gutter="20">
  1006. <el-col :span="24">
  1007. <el-alert
  1008. :closable="false"
  1009. type="success"
  1010. style="margin-bottom: 20px"
  1011. >设备照片及相关附件</el-alert
  1012. >
  1013. </el-col>
  1014. <el-col :span="24">
  1015. <el-form-item label="设备图片:">
  1016. <ibps-image
  1017. v-model="form.beiZhu"
  1018. height="160"
  1019. width="160"
  1020. accept=".jpg,.jpeg,.png,.gif,.bmp,.webp"
  1021. multiple
  1022. download
  1023. :disabled="readonly"
  1024. size=""
  1025. />
  1026. </el-form-item>
  1027. </el-col>
  1028. <el-col :span="24">
  1029. <el-form-item label="附件上传:">
  1030. <ibps-attachment
  1031. v-model="form.yqzp"
  1032. :download="true"
  1033. multiple
  1034. accept="*"
  1035. :readonly="readonly"
  1036. style="width: 100%"
  1037. />
  1038. </el-form-item>
  1039. </el-col>
  1040. <el-col :span="24">
  1041. <el-form-item label="资质证书:">
  1042. <ibps-attachment
  1043. v-model="form.faPiao"
  1044. :download="true"
  1045. multiple
  1046. accept="*"
  1047. :readonly="readonly"
  1048. style="width: 100%"
  1049. />
  1050. </el-form-item>
  1051. </el-col>
  1052. <el-col :span="24">
  1053. <el-form-item
  1054. v-if="!hidefuJianShang"
  1055. label="设备说明书:"
  1056. >
  1057. <ibps-attachment
  1058. v-model="form.fuJianShang"
  1059. :download="true"
  1060. multiple
  1061. accept="*"
  1062. :readonly="readonly"
  1063. style="width: 100%"
  1064. />
  1065. </el-form-item>
  1066. </el-col>
  1067. <!-- <el-col :span="24">
  1068. <el-form-item label="说明书分类:">
  1069. <SelectType :field="{}" @change-data="changeData" />
  1070. </el-form-item>
  1071. </el-col>
  1072. <el-col :span="24">
  1073. <el-form-item label="文件路径:">
  1074. <span>{{ form.wenJianXiLei }}</span>
  1075. </el-form-item>
  1076. </el-col> -->
  1077. </el-row>
  1078. </el-form>
  1079. </el-tab-pane>
  1080. <el-tab-pane
  1081. v-for="item in tabItems"
  1082. :key="item.name"
  1083. :label="item.label"
  1084. :name="item.name"
  1085. :disabled="item.isKeepAlive && !isEdit"
  1086. >
  1087. <template v-if="item.isKeepAlive">
  1088. <!-- 使用 v-if 配合 keep-alive 实现按需加载 -->
  1089. <keep-alive>
  1090. <component
  1091. :is="item.component"
  1092. v-if="activeName === item.name"
  1093. :params="form"
  1094. :hideSysDeviceNo="hideSysDeviceNo"
  1095. />
  1096. </keep-alive>
  1097. </template>
  1098. <template v-else>
  1099. <component
  1100. :is="item.component"
  1101. v-if="activeName === item.name"
  1102. :ref="item.ref"
  1103. :readonly="readonly"
  1104. :list-data="form[item.data]"
  1105. />
  1106. </template>
  1107. </el-tab-pane>
  1108. </el-tabs>
  1109. </el-col>
  1110. </el-row>
  1111. </div>
  1112. </div>
  1113. </div>
  1114. </el-dialog>
  1115. </template>
  1116. <script>
  1117. import dayjs from 'dayjs'
  1118. import {
  1119. getequipmentCard,
  1120. saveEquipmentCard
  1121. } from '@/api/platform/device/device'
  1122. import { getImage } from '@/api/platform/file/attachment'
  1123. import { getSetting } from '@/utils/query'
  1124. export default {
  1125. components: {
  1126. IbpsUserSelector: () => ({
  1127. component: import('@/business/platform/org/selector'),
  1128. delay: 200
  1129. }),
  1130. Maintenance: () => import('./maintenance.vue'),
  1131. MoreDevices: () => import('./moreDevices.vue'),
  1132. ScrappedRecord: () => import('./scrappedRecord.vue'),
  1133. MaintenanceRecord: () => import('./maintenanceRecord.vue'),
  1134. RepairRecord: () => import('./repairRecord.vue'),
  1135. CalibrationCheckRecord: () => import('./calibrationCheckRecord.vue'),
  1136. ConfirmationRecord: () => import('./ConfirmationRecord.vue'),
  1137. performanceVerificationRecord: () => import('./performanceVerificationRecord.vue'),
  1138. PvRecord: () => import('./pvRecord.vue'),
  1139. SelectType: () => import('@/views/component/selectType.vue'),
  1140. IbpsCustomDialog: () => ({
  1141. component: import(
  1142. '@/business/platform/data/templaterender/custom-dialog'
  1143. ),
  1144. delay: 200
  1145. }),
  1146. IbpsAttachment: () => ({
  1147. component: import('@/business/platform/file/attachment/selector'),
  1148. delay: 200
  1149. }),
  1150. IbpsImage: () => ({
  1151. component: import('@/business/platform/file/image'),
  1152. delay: 200
  1153. })
  1154. },
  1155. props: {
  1156. readonly: {
  1157. type: Boolean,
  1158. default: false
  1159. },
  1160. actionDialog: {
  1161. type: String,
  1162. default: ''
  1163. },
  1164. params: {
  1165. type: Object,
  1166. default: function () {
  1167. return {}
  1168. }
  1169. },
  1170. stateList: {
  1171. type: Object,
  1172. default: function () {
  1173. return { 停用: '停用', 报废: '报废', 合格: '合格' }
  1174. }
  1175. },
  1176. hideSysDeviceNo: {
  1177. type: Boolean,
  1178. default: false
  1179. },
  1180. hidefuJianShang: {
  1181. type: Boolean,
  1182. default: false
  1183. },
  1184. tabList: {
  1185. type: Object,
  1186. default: function () {
  1187. return {}
  1188. }
  1189. },
  1190. typeList: {
  1191. type: Object,
  1192. default: function () {
  1193. return {
  1194. 检验系统: '检验系统',
  1195. 通用设备: '通用设备',
  1196. 软件: '软件',
  1197. 信息系统: '信息系统'
  1198. }
  1199. }
  1200. },
  1201. hasFuZeRenDianHua: {
  1202. type: Boolean,
  1203. default: false
  1204. },
  1205. hasChangJiaLianXiRen: {
  1206. type: Boolean,
  1207. default: false
  1208. }
  1209. },
  1210. data() {
  1211. const { userId, position, level, deptList, setting } = this.$store.getters
  1212. return {
  1213. config: setting?.postJob?.allocation || false,
  1214. tabItems: [
  1215. {
  1216. label: '维护项目',
  1217. name: 'two',
  1218. ref: 'MaintenanceRef',
  1219. data: 'maintenanceItemPoList',
  1220. component: 'Maintenance',
  1221. isKeepAlive: false
  1222. },
  1223. {
  1224. label: '附属设备及配件',
  1225. name: 'three',
  1226. ref: 'MoreDevicesRef',
  1227. data: 'accessoriesDevicePoList',
  1228. component: 'MoreDevices',
  1229. isKeepAlive: false
  1230. },
  1231. {
  1232. label: '使用与维护记录',
  1233. name: 'four',
  1234. component: 'MaintenanceRecord',
  1235. isKeepAlive: true
  1236. },
  1237. {
  1238. label: '校准记录',
  1239. name: 'five',
  1240. component: 'CalibrationCheckRecord',
  1241. isKeepAlive: true
  1242. },
  1243. {
  1244. label: '维修记录',
  1245. name: 'six',
  1246. component: 'RepairRecord',
  1247. isKeepAlive: true
  1248. },
  1249. {
  1250. label: '停用、报废记录',
  1251. name: 'seven',
  1252. component: 'ScrappedRecord',
  1253. isKeepAlive: true
  1254. },
  1255. {
  1256. label: '检验系统校准确认记录',
  1257. name: 'eight',
  1258. component: 'ConfirmationRecord',
  1259. isKeepAlive: true
  1260. },
  1261. // 修改性能验证记录:改为非 keep-alive 以支持编辑和数据同步
  1262. {
  1263. label: '性能验证记录',
  1264. name: 'night',
  1265. ref: 'PerfVerificationRef',
  1266. data: 'perfVerificationRecordPoList',
  1267. component: 'performanceVerificationRecord',
  1268. isKeepAlive: false
  1269. },
  1270. // 同步与深圳三院分支,后端暂未同步对应接口,不开放
  1271. // { label: '性能验证记录', name: 'nine', component: 'PvRecord', isKeepAlive: true }
  1272. ],
  1273. filter: [
  1274. {
  1275. descVal: '1',
  1276. includeSub: true,
  1277. old: 'position',
  1278. partyId: this.$store.getters.userInfo.employee.positions,
  1279. partyName: '',
  1280. scriptContent: '',
  1281. type: 'user',
  1282. userType: 'position'
  1283. }
  1284. ],
  1285. isFirstyiXiaoRiQi: true,
  1286. isFirstbianZhiBuMen: true,
  1287. isSheKou: false,
  1288. activeName: 'one',
  1289. dialogVisible: true,
  1290. userId: userId,
  1291. position: position,
  1292. deptList: deptList,
  1293. level: level.second || level.first,
  1294. org: level.first || '',
  1295. loading: false,
  1296. title: '设备档案卡',
  1297. toolbars: [
  1298. {
  1299. key: 'save',
  1300. label: '保存',
  1301. hidden: () => {
  1302. return this.readonly
  1303. }
  1304. },
  1305. {
  1306. key: 'cancel',
  1307. label: '退出',
  1308. type: 'danger',
  1309. icon: 'ibps-icon-close'
  1310. }
  1311. ],
  1312. initWidth: '1480px',
  1313. isEdit: false,
  1314. isFinished: false,
  1315. preParams: {},
  1316. Ids: [],
  1317. showzhuCeYouXiaoQi: false,
  1318. dynamicRequiredFields: false,
  1319. originalEditReadOnly: false,
  1320. form: {
  1321. gouJinRiQi: '', // 购进日期
  1322. changShang: '', // 厂家/品牌
  1323. guiGeXingHao: '', // 规格型号
  1324. jieShouRiQi: '', // 接收日期
  1325. qiYongRiQi: '', // 投入日期
  1326. cunFangDiDian: '',
  1327. cunFangWeiZhi: '', // 放置地点
  1328. jieShouZhuangTai: '', // 接收时状态
  1329. guanLiRen: '', // 保管人
  1330. weiHuFangShi: '', // 设备分组
  1331. bianZhiRen: '', // 建档人
  1332. bianZhiBuMen: '', // 建档部门
  1333. bianZhiShiJian: '', // 建档时间
  1334. shiFouGuoShen: '',
  1335. sheBeiLeiXing: '', // 设备类型
  1336. sheBeiZhuangTa: '', // 设备状态
  1337. sheBeiShiBieH: '', // 设备编号
  1338. shiFouXiaoZhun: '', // 是否校准
  1339. gongYingShang: '',
  1340. shiFouQiJianH: '', // 供应商id
  1341. lianXiFangShi: '', // 供应商电话
  1342. xiaoZhunYouXia: '', // 校准有效期至
  1343. chuChangRiQi: '', // 出厂日期
  1344. sheBeiMingCheng: '', // 设备名称
  1345. sheBeiMingChen: '', // 设备名称id
  1346. yiXiaoRiQi: '', // 最近校准时间
  1347. heChaXiaoZhun: '', // 使用年限
  1348. shiJiShiYongF: '', // 关机时间
  1349. kaiShiShiYong: '', // 开机时间
  1350. zhengShuBianHa: '', // 校准证书编号
  1351. xiaoZhunWuCha: '', // 是否限用
  1352. xiaoZhunZQ: '', // 检定/校准周期
  1353. shiYongKeShi: '', // 检定/校准单位
  1354. yuanSheBeiBian: '', // 原设备编号
  1355. jianKongYiJu: '', // 是否24H开机
  1356. biXuDeHuanJin: '', // 核查人
  1357. biXuSheShi: '', // 核查日期
  1358. ziChanYuanZhi: '', // 资产原值
  1359. ziChanBianHao: '', // 固定资产号
  1360. shiFouWeiHu: '', // 是否维护
  1361. jiShenXuHao: '', // 出厂编号
  1362. yanShouRiQi: '', // 验收日期
  1363. huanJingYaoQiu: '', // 环境要求
  1364. dianYuanYaoQiu: '', // 电源要求
  1365. zhuCeZhengHao: '', // 注册证号
  1366. zhuCeYouXiaoQi: '', // 注册证有效期
  1367. yqzp: '', // 附件上传
  1368. faPiao: '', // 资质证书
  1369. fuJianShang: '', // 设备使用说明书
  1370. beiZhu: '', // 设备图片
  1371. caiGouHeTong: '', // 限用范围
  1372. zhuanYeBuMen: '',
  1373. wenJianXiLei: '', // 附件细类
  1374. xiLeiId: '',
  1375. quanXianLeiXing: '',
  1376. diDian: '',
  1377. buMen: '', // 图片id
  1378. ceLiangGongZuo: '', // 测量范围
  1379. jianDingXiao: '', // 检定/校准参数
  1380. xiuZhengZhiXiu: '', // 修正值
  1381. zuiDaYunCha: '', // U/精确度/最大允差
  1382. shiWuShuoMing: '', // 校准机构
  1383. fuZeRenDianHua: '', // 负责人电话
  1384. changJiaLianXiRen: '', // 厂家联系人及电话
  1385. remark: '',
  1386. // 新增性能验证记录数组字段
  1387. perfVerificationRecordPoList: []
  1388. },
  1389. rules: {
  1390. sheBeiMingCheng: [
  1391. { required: true, message: '设备名称不能为空', trigger: 'blur' }
  1392. ],
  1393. yuanSheBeiBian: [
  1394. { required: true, message: '原设备编号不能为空', trigger: 'blur' }
  1395. ],
  1396. sheBeiLeiXing: [
  1397. { required: true, message: '设备类型不能为空', trigger: 'blur' }
  1398. ],
  1399. sheBeiZhuangTa: [
  1400. { required: true, message: '设备状态不能为空', trigger: 'blur' }
  1401. ],
  1402. guiGeXingHao: [
  1403. { required: true, message: '规格型号不能为空', trigger: 'blur' }
  1404. ],
  1405. bianZhiBuMen: [
  1406. { required: true, message: '建档部门不能为空', trigger: 'blur' }
  1407. ],
  1408. bianZhiRen: [
  1409. { required: true, message: '建档人不能为空', trigger: 'blur' }
  1410. ],
  1411. bianZhiShiJian: [
  1412. { required: true, message: '建档时间不能为空', trigger: 'blur' }
  1413. ],
  1414. jieShouZhuangTai: [
  1415. { required: true, message: '接收时状态不能为空', trigger: 'blur' }
  1416. ],
  1417. guanLiRen: [
  1418. { required: true, message: '保管人不能为空', trigger: 'blur' }
  1419. ],
  1420. cunFangWeiZhi: [
  1421. { required: true, message: '放置地点不能为空', trigger: 'blur' }
  1422. ],
  1423. shiFouXiaoZhun: [
  1424. { required: true, message: '是否校准不能为空', trigger: 'blur' }
  1425. ],
  1426. jiShenXuHao: [
  1427. { required: false, message: '出厂编号不能为空', trigger: 'blur' }
  1428. ],
  1429. shiFouQiJianH: [
  1430. { required: false, message: '供应商不能为空', trigger: 'blur' }
  1431. ],
  1432. xiaoZhunZQ: [
  1433. {
  1434. required: false,
  1435. message: '检定/校准周期(月)不能为空',
  1436. trigger: 'blur'
  1437. }
  1438. ],
  1439. yanShouRiQi: [
  1440. { required: false, message: '验收日期不能为空', trigger: 'blur' }
  1441. ],
  1442. qiYongRiQi: [
  1443. { required: false, message: '投入日期不能为空', trigger: 'blur' }
  1444. ],
  1445. yiXiaoRiQi: [
  1446. { required: false, message: '最近校准日期不能为空', trigger: 'blur' }
  1447. ],
  1448. xiaoZhunYouXia: [
  1449. {
  1450. required: false,
  1451. message: '检定校准有效期至不能为空',
  1452. trigger: 'blur'
  1453. }
  1454. ]
  1455. // chuChangRiQi: [
  1456. // { required: true, message: '出厂日期不能为空', trigger: 'blur' }
  1457. // ]
  1458. }
  1459. }
  1460. },
  1461. computed: {
  1462. photos() {
  1463. if (this.form.beiZhu) {
  1464. const photos = JSON.parse(this.form.beiZhu)
  1465. photos.forEach((item) => {
  1466. item.url = getImage(item.id)
  1467. })
  1468. return photos
  1469. }
  1470. return []
  1471. },
  1472. showState() {
  1473. return (
  1474. this.stateList[this.form.sheBeiZhuangTa] || this.form.sheBeiZhuangTa
  1475. )
  1476. }
  1477. },
  1478. watch: {
  1479. photos: {
  1480. handler(val) {
  1481. this.form.buMen = val.map((item) => item.id).join(',')
  1482. }
  1483. },
  1484. dynamicRequiredFields: {
  1485. handler(val) {
  1486. this.rules.jiShenXuHao[0].required = val
  1487. this.rules.shiFouQiJianH[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. 'form.shiFouXiaoZhun': {
  1544. handler(value) {
  1545. if (value !== '是') {
  1546. const arr = [
  1547. 'xiaoZhunZQ',
  1548. 'shiYongKeShi',
  1549. 'yiXiaoRiQi',
  1550. 'xiaoZhunYouXia',
  1551. 'zhengShuBianHa',
  1552. 'jianDingXiao',
  1553. 'zuiDaYunCha',
  1554. 'xiuZhengZhiXiu'
  1555. ]
  1556. arr.forEach((t) => (this.form[t] = ''))
  1557. }
  1558. }
  1559. }
  1560. },
  1561. mounted() {
  1562. this.init()
  1563. },
  1564. methods: {
  1565. changeGuanLiRen(key, data) {
  1566. this.form.fuZeRenDianHua = data?.mobile
  1567. },
  1568. sheBeiMingChenChange(key, data) {
  1569. this.form.sheBeiMingCheng = data.ming_cheng_str_
  1570. this.form.guiGeXingHao = data.xing_hao_gui_ge_
  1571. this.form.jiShenXuHao = data.chu_chang_bian_ha
  1572. this.form.changShang = data.sheng_chan_chang_
  1573. this.form.yuanSheBeiBian = data.she_bei_bian_hao_
  1574. },
  1575. // 根据供应商自动带出供应商名称和电话
  1576. shiFouQiJianHChange(key, data) {
  1577. this.form.lianXiFangShi = data.lian_xi_dian_hua_
  1578. this.form.gongYingShang = data.gong_ying_shang_m
  1579. },
  1580. changeData(...args) {
  1581. this.form[args[0]] = args[1]
  1582. },
  1583. handleClick() {},
  1584. handleActionEvent({ key }) {
  1585. switch (key) {
  1586. case 'cancel':
  1587. this.closeDialog(true)
  1588. break
  1589. case 'save':
  1590. this.goSave('close')
  1591. break
  1592. default:
  1593. break
  1594. }
  1595. },
  1596. // 获取人员部门
  1597. getPersonPosition(id) {
  1598. const userList = this.$store.getters.userList
  1599. const bianzhiUserid = userList.find((i) => i.userId === id)
  1600. if (bianzhiUserid) {
  1601. return bianzhiUserid.positionId
  1602. }
  1603. },
  1604. isDateMoreThenSecondDay(firstTime, secondTime) {
  1605. if (!firstTime || !secondTime) {
  1606. return false
  1607. }
  1608. return new Date(firstTime).getTime() > new Date(secondTime).getTime()
  1609. },
  1610. async checkRequired(flag) {
  1611. if (this.form.xiaoZhunWuCha === '是' && !this.form.caiGouHeTong) {
  1612. throw new Error('请填写限用范围!')
  1613. }
  1614. if (this.form.accessoriesDevicePoList.length > 0) {
  1615. for (let i = 0; i < this.form.accessoriesDevicePoList.length; i++) {
  1616. const item = this.form.accessoriesDevicePoList[i]
  1617. if (!item.mingCheng) {
  1618. throw new Error(`附属设备及配件第${i + 1}行名称缺失!`)
  1619. }
  1620. if (!item.guiGeXingHao1) {
  1621. throw new Error(`附属设备及配件第${i + 1}行规格型号缺失!`)
  1622. }
  1623. if (!item.danWei) {
  1624. throw new Error(`附属设备及配件第${i + 1}行单位缺失!`)
  1625. }
  1626. if (!item.shuLiang) {
  1627. throw new Error(`附属设备及配件第${i + 1}行数量缺失!`)
  1628. }
  1629. }
  1630. }
  1631. const sysDeviceNo = this.form.sheBeiShiBieH
  1632. const originalDeviceNo = this.form.yuanSheBeiBian
  1633. const position = this.form.diDian
  1634. // 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`
  1635. const result = await this.$common.request('query', {
  1636. key: 'getExistDeviceNo',
  1637. params: [originalDeviceNo, position, sysDeviceNo]
  1638. })
  1639. const { data = [] } = result.variables || {}
  1640. if (data[0].num > 0) {
  1641. throw new Error(
  1642. `系统当前已经存在此${
  1643. this.hideSysDeviceNo ? '设备编号' : '原设备编号'
  1644. },请更换另一个编号!`
  1645. )
  1646. }
  1647. const exFactoryTime = this.form.chuChangRiQi
  1648. const reviceTime = this.form.jieShouRiQi
  1649. const useTime = this.form.qiYongRiQi
  1650. // 如果有出厂日期,则接收日期必须在出厂日期之后,投入日期必须在出厂日期之后
  1651. // 校验接收日期是否在投入日期之前
  1652. if (exFactoryTime && reviceTime) {
  1653. if (this.isDateMoreThenSecondDay(exFactoryTime, reviceTime)) {
  1654. throw new Error(`该设备的接收日期不得早于出厂日期!`)
  1655. }
  1656. }
  1657. if (exFactoryTime && useTime) {
  1658. if (this.isDateMoreThenSecondDay(exFactoryTime, useTime)) {
  1659. throw new Error(`该设备的投入日期不得早于出厂日期!`)
  1660. }
  1661. }
  1662. if (reviceTime && useTime) {
  1663. if (this.isDateMoreThenSecondDay(reviceTime, useTime)) {
  1664. throw new Error(`该设备的投入日期不得早于接收日期!`)
  1665. }
  1666. }
  1667. },
  1668. async goAdd() {
  1669. try {
  1670. this.loading = true
  1671. this.form.sheBeiShiBieH = await this.getNextAlias()
  1672. await saveEquipmentCard(this.form)
  1673. this.$message.success('添加成功')
  1674. this.closeDialog(true)
  1675. this.loading = false
  1676. } catch (error) {
  1677. console.log(error)
  1678. this.$message.warning('添加失败')
  1679. this.loading = false
  1680. }
  1681. },
  1682. async goEdit(flag) {
  1683. try {
  1684. this.loading = true
  1685. await saveEquipmentCard(this.form)
  1686. this.$message.success('修改成功')
  1687. this.closeDialog(true)
  1688. this.loading = false
  1689. } catch (error) {
  1690. this.$message.warning(error.message)
  1691. this.loading = false
  1692. throw new Error(error.message)
  1693. }
  1694. },
  1695. goSave(flag) {
  1696. this.$refs.form.validate(async (valid) => {
  1697. this.$refs.formBase.validate(async (validBase) => {
  1698. if (valid && validBase) {
  1699. try {
  1700. // 维护项目
  1701. this.form.maintenanceItemPoList =
  1702. this.$refs.MaintenanceRef?.[0]?.listDataCopy ||
  1703. this.form.maintenanceItemPoList ||
  1704. []
  1705. // 附属设备及配件
  1706. this.form.accessoriesDevicePoList =
  1707. this.$refs.MoreDevicesRef?.[0]?.listDataCopy ||
  1708. this.form.accessoriesDevicePoList ||
  1709. []
  1710. // 新增:收集性能验证记录数据
  1711. this.form.perfVerificationRecordPoList =
  1712. this.$refs.PerfVerificationRef?.[0]?.listDataCopy ||
  1713. this.form.perfVerificationRecordPoList ||
  1714. []
  1715. await this.checkRequired()
  1716. if (this.isEdit) {
  1717. this.goEdit(flag)
  1718. } else {
  1719. this.goAdd()
  1720. }
  1721. } catch (error) {
  1722. this.$message.warning(error.message)
  1723. }
  1724. } else {
  1725. return this.$message.warning('请填写必填项!')
  1726. }
  1727. })
  1728. })
  1729. },
  1730. // 刷新
  1731. async goRefresh() {},
  1732. // 关闭当前窗口
  1733. closeDialog(needRefresh) {
  1734. this.dialogVisible = false
  1735. if (needRefresh) {
  1736. this.$emit('close')
  1737. }
  1738. },
  1739. generateRandomString() {
  1740. return `JYK-${Math.floor(Math.random() * 88888) + 10000}`
  1741. },
  1742. getNextAlias() {
  1743. return new Promise((resolve, reject) => {
  1744. this.$common
  1745. .getNextIdByAlias({
  1746. alias: 'sbbh'
  1747. })
  1748. .then((response) => {
  1749. resolve(response.data)
  1750. })
  1751. .catch((error) => {
  1752. reject(error)
  1753. })
  1754. })
  1755. },
  1756. async init() {
  1757. this.loading = true
  1758. const deviceres = await getSetting('device')
  1759. this.showzhuCeYouXiaoQi = deviceres?.showzhuCeYouXiaoQi || false
  1760. this.dynamicRequiredFields = deviceres?.requiredField || false
  1761. this.originalEditReadOnly = deviceres?.originalEditReadOnly || false
  1762. if (this.hideSysDeviceNo) {
  1763. this.rules.yuanSheBeiBian[0].message = '设备编号不能为空'
  1764. }
  1765. this.isEdit = !!(this.params && this.params.id)
  1766. this.isSheKou = this.deptList[0].positionId === '1166372468122714112' // 判断是否是蛇口医院
  1767. // 根据全局配置动态生成tab
  1768. const newTab = []
  1769. for (const key in this.tabList) {
  1770. if (Object.hasOwnProperty.call(this.tabList, key)) {
  1771. const newLabel = this.tabList[key]
  1772. const t = this.tabItems.find((i) => i.label === key)
  1773. if (t) {
  1774. t.label = newLabel
  1775. newTab.push(t)
  1776. }
  1777. }
  1778. }
  1779. if (newTab.length > 0) {
  1780. this.tabItems = newTab
  1781. }
  1782. if (this.isEdit) {
  1783. const { data } = await getequipmentCard({ id: this.params.id })
  1784. this.form = data
  1785. // 确保性能验证记录字段存在
  1786. if (!this.form.perfVerificationRecordPoList) {
  1787. this.$set(this.form, 'perfVerificationRecordPoList', [])
  1788. }
  1789. console.log(this.form.xiaoZhunZQ)
  1790. if (!this.form.xiaoZhunZQ) {
  1791. this.form.xiaoZhunYouXia = ''
  1792. }
  1793. } else {
  1794. this.isFirstbianZhiBuMen = false
  1795. this.isFirstyiXiaoRiQi = false
  1796. this.form.jieShouRiQi = dayjs().format('YYYY-MM-DD')
  1797. this.form.qiYongRiQi = dayjs().format('YYYY-MM-DD')
  1798. this.form.xiaoZhunWuCha = '否'
  1799. this.form.jieShouZhuangTai = '新设备'
  1800. this.form.bianZhiRen = this.userId
  1801. const pos = this.position.split(',')
  1802. this.form.bianZhiBuMen = pos[pos.length - 1]
  1803. this.form.bianZhiShiJian = dayjs().format('YYYY-MM-DD HH:mm')
  1804. this.form.shiFouGuoShen = '已完成'
  1805. this.form.sheBeiLeiXing = '检验系统'
  1806. this.form.sheBeiZhuangTa = '合格'
  1807. this.form.shiFouXiaoZhun = '是'
  1808. this.form.jianKongYiJu = '否'
  1809. this.form.shiFouWeiHu = '是'
  1810. this.form.diDian = this.level
  1811. }
  1812. const id = setTimeout(() => {
  1813. this.loading = false
  1814. clearTimeout(id)
  1815. }, 500)
  1816. }
  1817. }
  1818. }
  1819. </script>
  1820. <style lang="scss" scoped>
  1821. .paper-detail-dialog {
  1822. ::v-deep {
  1823. .el-dialog__header {
  1824. text-align: center;
  1825. }
  1826. }
  1827. .dialog-title {
  1828. display: flex;
  1829. align-items: center;
  1830. justify-content: center;
  1831. div {
  1832. z-index: 99999999;
  1833. position: absolute;
  1834. right: 8vw;
  1835. }
  1836. .dialogtitle {
  1837. font-size: 22px;
  1838. font-family: SimHei;
  1839. font-weight: bold;
  1840. color: #222;
  1841. }
  1842. }
  1843. .container {
  1844. display: flex;
  1845. width: 100%;
  1846. justify-content: center;
  1847. .el-row {
  1848. margin: 0 !important;
  1849. }
  1850. .required {
  1851. color: #606266 !important;
  1852. &::before {
  1853. content: '*';
  1854. margin: 0 4px 0 -7.5px;
  1855. color: #f56c6c;
  1856. }
  1857. }
  1858. .left {
  1859. height: calc(100vh - 100px);
  1860. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  1861. padding: 20px;
  1862. overflow-y: auto;
  1863. .form {
  1864. margin-left: -20px;
  1865. }
  1866. .item {
  1867. width: 100%;
  1868. }
  1869. .title {
  1870. margin: 16px 0 6px -16px;
  1871. }
  1872. .tabs {
  1873. margin-top: 40px;
  1874. }
  1875. .question-icon {
  1876. margin-left: 2px;
  1877. }
  1878. }
  1879. }
  1880. }
  1881. ::v-deep {
  1882. .el-form-item__label {
  1883. text-align: left;
  1884. font-size: 12px !important;
  1885. }
  1886. .el-form-item__content {
  1887. font-size: 12px !important;
  1888. display: flex;
  1889. }
  1890. .el-table th {
  1891. background-color: #f5f7fa !important;
  1892. }
  1893. .el-tabs__header {
  1894. margin: 0 0 30px !important;
  1895. }
  1896. .ibps-image {
  1897. width: 100%;
  1898. .ibps-p-0 {
  1899. width: 100%;
  1900. .list-group {
  1901. display: flex;
  1902. align-items: center;
  1903. gap: 20px;
  1904. flex-wrap: wrap;
  1905. }
  1906. }
  1907. }
  1908. }
  1909. </style>