assetInformation.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869
  1. <template>
  2. <div id="assetInformation" class="baseinfo-container">
  3. <el-form label-width="120px" :model="{ ...zcInfo }" ref="form">
  4. <div class="content">
  5. <div class="basic-details-title border-none">
  6. <span class="border-span">资产信息</span>
  7. </div>
  8. <el-descriptions
  9. title=""
  10. :column="4"
  11. size="medium"
  12. border
  13. style="edit"
  14. :label-style="labelStyle"
  15. class="descriptions"
  16. >
  17. <el-descriptions-item>
  18. <template slot="label"> 固资编码 </template>
  19. <el-form-item label-width="0">
  20. <el-input class="input" v-model="zcInfo.fixCode"></el-input>
  21. </el-form-item>
  22. </el-descriptions-item>
  23. <el-descriptions-item>
  24. <template slot="label"> 编号 </template>
  25. <el-form-item label-width="0">
  26. <el-input class="input" v-model="zcInfo.codeNumber"></el-input>
  27. </el-form-item>
  28. </el-descriptions-item>
  29. <el-descriptions-item>
  30. <template slot="label"> 颜色 </template>
  31. <el-form-item label-width="0">
  32. <el-input class="input" v-model="zcInfo.color"></el-input>
  33. </el-form-item>
  34. </el-descriptions-item>
  35. <el-descriptions-item>
  36. <template slot="label"> 级别 </template>
  37. <el-form-item label-width="0">
  38. <el-select
  39. style="width: 100%"
  40. v-model="zcInfo.level"
  41. placeholder="请选择"
  42. >
  43. <el-option
  44. v-for="item in options.assetLevel"
  45. :key="item.id"
  46. :label="item.name"
  47. :value="item.id"
  48. >
  49. </el-option>
  50. </el-select>
  51. </el-form-item>
  52. </el-descriptions-item>
  53. <el-descriptions-item>
  54. <template slot="label"> 有效期开始 </template>
  55. <el-form-item label-width="0">
  56. <el-date-picker
  57. style="width: 100%"
  58. v-model="zcInfo.startTime"
  59. type="month"
  60. value-format="yyyy-MM"
  61. placeholder="选择有效期开始"
  62. >
  63. </el-date-picker>
  64. </el-form-item>
  65. </el-descriptions-item>
  66. <el-descriptions-item>
  67. <template slot="label"> 有效期结束 </template>
  68. <el-form-item label-width="0">
  69. <el-date-picker
  70. style="width: 100%"
  71. v-model="zcInfo.endTime"
  72. @change="endTimeRules"
  73. value-format="yyyy-MM"
  74. type="month"
  75. placeholder="选择有效期结束"
  76. >
  77. </el-date-picker>
  78. </el-form-item>
  79. </el-descriptions-item>
  80. <!-- <el-descriptions-item>
  81. <template slot="label"> 状态 </template>
  82. <el-form-item label-width="0">
  83. <el-input
  84. v-model="zcInfo.status"
  85. placeholder="请输入状态"
  86. ></el-input>
  87. </el-form-item>
  88. </el-descriptions-item> -->
  89. <el-descriptions-item>
  90. <template slot="label"> 入账日期 </template>
  91. <el-form-item label-width="0">
  92. <el-date-picker
  93. style="width: 100%"
  94. v-model="zcInfo.entryDate"
  95. type="date"
  96. placeholder="选择入账日期"
  97. value-format="yyyy-MM-dd"
  98. >
  99. </el-date-picker>
  100. </el-form-item>
  101. </el-descriptions-item>
  102. <el-descriptions-item>
  103. <template slot="label"> 周期 </template>
  104. <el-form-item label-width="0">
  105. <el-select
  106. style="width: 100%"
  107. v-model="zcInfo.cycle"
  108. placeholder="请选择"
  109. >
  110. <el-option
  111. v-for="item in options.deliveryCycle"
  112. :key="item.id"
  113. :label="item.name"
  114. :value="item.id"
  115. >
  116. </el-option>
  117. </el-select>
  118. </el-form-item>
  119. </el-descriptions-item>
  120. </el-descriptions>
  121. <el-descriptions
  122. title=""
  123. :column="3"
  124. size="medium"
  125. border
  126. style="edit"
  127. :label-style="labelStyle"
  128. class="descriptions"
  129. >
  130. <el-descriptions-item>
  131. <template slot="label"> 权属部门 </template>
  132. <el-form-item label-width="0">
  133. <div class="input">
  134. <el-input
  135. v-model="zcInfo.workstation.groupName"
  136. disabled
  137. placeholder="请输入内容"
  138. ></el-input>
  139. <!-- <DeptSelect
  140. v-model="zcInfo.ownershipGroupId"
  141. @input="getqsbm"
  142. /> -->
  143. </div>
  144. </el-form-item>
  145. </el-descriptions-item>
  146. <el-descriptions-item>
  147. <template slot="label"> 权属人 </template>
  148. <el-form-item label-width="0">
  149. <el-input
  150. v-model="zcInfo.workstation.leaderName"
  151. disabled
  152. placeholder="请输入内容"
  153. ></el-input>
  154. <!-- <el-select
  155. style="width: 100%"
  156. v-model="zcInfo.ownershipUserId"
  157. placeholder="请选择"
  158. >
  159. <el-option
  160. v-for="item in options.ownershipUserId"
  161. :key="item.id"
  162. :label="item.name"
  163. :value="item.id"
  164. >
  165. </el-option>
  166. </el-select> -->
  167. </el-form-item>
  168. </el-descriptions-item>
  169. <el-descriptions-item :span="3">
  170. <template slot="label"> 所属厂房 </template>
  171. <el-form-item label-width="0">
  172. <!-- <el-select
  173. v-model="zcInfo.factoryRoomId"
  174. placeholder="请选择"
  175. @change="change_factoryId"
  176. style="width: 24%; margin-right: 1%"
  177. >
  178. <el-option
  179. v-for="item in factoryOptions"
  180. :key="item.id"
  181. :label="item.pathName"
  182. :value="item.id"
  183. >
  184. </el-option>
  185. </el-select>
  186. <el-select
  187. v-model="zcInfo.workshopId"
  188. placeholder="请选择"
  189. style="width: 24%; margin-right: 1%"
  190. @change="change_workshop"
  191. >
  192. <el-option
  193. v-for="item in workshopOptions"
  194. :key="item.id"
  195. :label="item.name"
  196. :value="item.id"
  197. >
  198. </el-option>
  199. </el-select>
  200. <el-select
  201. v-model="zcInfo.productionLineId"
  202. placeholder="请选择"
  203. style="width: 24%; margin-right: 1%"
  204. @change="change_productionLineId"
  205. >
  206. <el-option
  207. v-for="item in productionLineOptions"
  208. :key="item.id"
  209. :label="item.name"
  210. :value="item.id"
  211. >
  212. </el-option>
  213. </el-select>
  214. <el-select
  215. v-model="zcInfo.stationId"
  216. placeholder="请选择"
  217. style="width: 24%; margin-right: 1%"
  218. @change="change_stationId"
  219. >
  220. <el-option
  221. v-for="item in stationOptions"
  222. :key="item.id"
  223. :label="item.name"
  224. :value="item.id"
  225. >
  226. </el-option>
  227. </el-select> -->
  228. <el-input
  229. style="margin-right: 10px; width: 20%"
  230. v-model="zcInfo.workstation.workshopPlanName"
  231. disabled
  232. placeholder="请输入内容"
  233. ></el-input>
  234. <el-input
  235. style="margin-right: 10px; width: 20%"
  236. v-model="zcInfo.workstation.workshopName"
  237. disabled
  238. placeholder="请输入内容"
  239. ></el-input>
  240. <el-input
  241. style="margin-right: 10px; width: 20%"
  242. v-model="zcInfo.workstation.productionLineName"
  243. disabled
  244. placeholder="请输入内容"
  245. ></el-input>
  246. <el-input
  247. style="margin-right: 10px; width: 20%"
  248. v-model="zcInfo.workstation.name"
  249. disabled
  250. placeholder="请输入内容"
  251. ></el-input>
  252. </el-form-item>
  253. </el-descriptions-item>
  254. <el-descriptions-item>
  255. <template slot="label"> 所属工序 </template>
  256. <el-form-item label-width="0">
  257. <el-input
  258. v-model="zcInfo.workstation.taskNames"
  259. disabled
  260. placeholder="请输入内容"
  261. ></el-input>
  262. </el-form-item>
  263. </el-descriptions-item>
  264. <el-descriptions-item>
  265. <template slot="label"> 设备位置 </template>
  266. <el-form-item label-width="0" prop="location">
  267. <div style="display: flex">
  268. <el-cascader
  269. clearable
  270. v-model="zcInfo.location"
  271. :options="options.cityDataLabel"
  272. ></el-cascader>
  273. <el-input
  274. style="width: 60%; margin-left: 10px"
  275. placeholder="详细地址"
  276. v-model="zcInfo.deviceDetailAddress"
  277. ></el-input>
  278. </div>
  279. </el-form-item>
  280. </el-descriptions-item>
  281. </el-descriptions>
  282. <el-descriptions
  283. title=""
  284. :column="5"
  285. size="medium"
  286. border
  287. style="edit"
  288. :label-style="labelStyle"
  289. class="descriptions"
  290. >
  291. <el-descriptions-item>
  292. <template slot="label"> 片区负责人部门 </template>
  293. <el-form-item label-width="0">
  294. <div class="input">
  295. <DeptSelect v-model="zcInfo.repairGroupId" @input="getwhbm" />
  296. </div>
  297. </el-form-item>
  298. </el-descriptions-item>
  299. <el-descriptions-item>
  300. <template slot="label"> 片区负责人 </template>
  301. <el-form-item label-width="0">
  302. <el-select
  303. style="width: 100%"
  304. v-model="zcInfo.repairUserId"
  305. placeholder="请选择"
  306. >
  307. <el-option
  308. v-for="item in options.repairUserId"
  309. :key="item.id"
  310. :label="item.name"
  311. :value="item.id"
  312. >
  313. </el-option>
  314. </el-select>
  315. </el-form-item>
  316. </el-descriptions-item>
  317. <el-descriptions-item>
  318. <template slot="label"> 片区负责人电话 </template>
  319. <el-form-item label-width="0">
  320. <el-input
  321. v-model="zcInfo.repairsDeptPhone"
  322. disabled
  323. placeholder="请输入内容"
  324. ></el-input>
  325. </el-form-item>
  326. </el-descriptions-item>
  327. </el-descriptions>
  328. <el-descriptions
  329. title=""
  330. :column="5"
  331. size="medium"
  332. border
  333. style="edit"
  334. :label-style="labelStyle"
  335. class="descriptions"
  336. >
  337. <el-descriptions-item>
  338. <template slot="label"> 类型 </template>
  339. <el-form-item label-width="0">
  340. <el-select
  341. style="width: 100%"
  342. v-model="zcInfo.isPublic"
  343. filterable
  344. placeholder="请选择使用人"
  345. >
  346. <el-option
  347. v-for="item in typeOptions"
  348. :key="item.id"
  349. :label="item.name"
  350. :value="item.id"
  351. >
  352. </el-option>
  353. </el-select>
  354. </el-form-item>
  355. </el-descriptions-item>
  356. <el-descriptions-item>
  357. <template slot="label"> 使用岗位 </template>
  358. <el-form-item label-width="0">
  359. <DeptSelect v-model="zcInfo.postId" @input="auditorDeptClick" />
  360. </el-form-item>
  361. </el-descriptions-item>
  362. <el-descriptions-item>
  363. <template slot="label"> 使用人 </template>
  364. <el-form-item label-width="0">
  365. <el-select
  366. style="width: 100%"
  367. v-model="zcInfo.usePersonId"
  368. @change="usePersonIdChange"
  369. filterable
  370. placeholder="请选择使用人"
  371. >
  372. <el-option
  373. v-for="item in userList"
  374. :key="item.id"
  375. :label="item.name"
  376. :value="item.id"
  377. >
  378. </el-option>
  379. </el-select>
  380. </el-form-item>
  381. </el-descriptions-item>
  382. <el-descriptions-item>
  383. <template slot="label"> 负责人 </template>
  384. <el-form-item label-width="0">
  385. <!-- -->
  386. <el-select
  387. style="width: 100%"
  388. v-model="zcInfo.chargePersonId"
  389. :disabled="isLock ? zcInfo.isPublic > 0 : false"
  390. filterable
  391. placeholder="请选择负责人"
  392. >
  393. <el-option
  394. v-for="item in userList"
  395. :key="item.id"
  396. :label="item.name"
  397. :value="item.id"
  398. >
  399. </el-option>
  400. </el-select>
  401. </el-form-item>
  402. </el-descriptions-item>
  403. </el-descriptions>
  404. <el-descriptions
  405. title=""
  406. :column="3"
  407. size="medium"
  408. border
  409. style="edit"
  410. :label-style="labelStyle"
  411. >
  412. <el-descriptions-item>
  413. <template slot="label"> 供应商 </template>
  414. <el-form-item label-width="0">
  415. <el-select
  416. v-model="zcInfo.supplierId"
  417. style="width: 100%"
  418. placeholder="请选择"
  419. >
  420. <el-option
  421. v-for="item in options.suppList"
  422. :key="item.id"
  423. :label="item.name"
  424. :value="item.id"
  425. >
  426. </el-option>
  427. </el-select>
  428. </el-form-item>
  429. </el-descriptions-item>
  430. <el-descriptions-item>
  431. <template slot="label"> 品牌 </template>
  432. <el-form-item label-width="0">
  433. <el-input v-model="zcInfo.brand" class="input"></el-input>
  434. </el-form-item>
  435. </el-descriptions-item>
  436. <el-descriptions-item>
  437. <template slot="label"> 设备用途 </template>
  438. <el-form-item label-width="0">
  439. <el-input v-model="zcInfo.purpose" class="input"></el-input>
  440. </el-form-item>
  441. </el-descriptions-item>
  442. <el-descriptions-item>
  443. <template slot="label"> 备注 </template>
  444. <el-form-item label-width="0">
  445. <el-input
  446. type="textarea"
  447. :rows="2"
  448. placeholder="请输入内容"
  449. v-model="zcInfo.remark"
  450. ></el-input>
  451. </el-form-item>
  452. </el-descriptions-item>
  453. </el-descriptions>
  454. </div>
  455. </el-form>
  456. </div>
  457. </template>
  458. <script>
  459. import {
  460. listWorkshopByParentId,
  461. listFactoryLine,
  462. getFactoryarea,
  463. listByProductionLineId,
  464. getByDeviceId
  465. } from '@/api/factoryModel';
  466. import DeptSelect from '@/components/CommomSelect/dept-select.vue';
  467. import WorkshopSelect from '@/components/CommomSelect/workshop-select.vue';
  468. import FactoryAreaSelect from '@/components/CommomSelect/factory-area-select.vue';
  469. import WorkingProcedureSelect from '@/components/CommomSelect/working-procedure-select.vue';
  470. import factorySelect from '@/components/CommomSelect/factory-select.vue';
  471. import fileUpload from '@/components/upload/fileUpload';
  472. import WithView from '@/components/upload/WithView';
  473. import imgUpload from '@/components/upload/imgUpload';
  474. import { cityDataLabel } from 'ele-admin/packages/utils/regions';
  475. import personSelect from '@/components/CommomSelect/person-select.vue';
  476. import { saveOrEdit, getAssetInfo } from '@/api/ledgerAssets';
  477. import { getUserPage } from '@/api/system/organization';
  478. import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
  479. import { getByCode } from '@/api/system/dictionary-data';
  480. import { data } from 'ele-admin/lib/ele-pro-table';
  481. export default {
  482. components: {
  483. WithView,
  484. WorkshopSelect,
  485. FactoryAreaSelect,
  486. WorkingProcedureSelect,
  487. fileUpload,
  488. imgUpload,
  489. factorySelect,
  490. DeptSelect,
  491. personSelect
  492. },
  493. props: {
  494. isEdit: {
  495. type: Boolean,
  496. default: true
  497. }
  498. },
  499. data() {
  500. return {
  501. factoryOptions: [],
  502. workshopOptions: [],
  503. productionLineOptions: [],
  504. stationOptions: [],
  505. userList: [], // 人员列表
  506. labelStyle: {
  507. 'min-width': '100px'
  508. },
  509. pageType: 'add',
  510. id: '', // 设备主键id
  511. rules: {
  512. name: [
  513. { required: true, message: '请输入设备名称', trigger: 'blur' }
  514. ],
  515. code: [{ required: true, message: '请输入设备编码', trigger: 'blur' }]
  516. },
  517. typeOptions: [
  518. {
  519. id: 0,
  520. name: '专用'
  521. },
  522. {
  523. id: 1,
  524. name: '公用'
  525. }
  526. ],
  527. // 资产信息
  528. // zcInfo: {
  529. // // 固定资产编码
  530. // fixCode: '',
  531. // // 颜色
  532. // color: '',
  533. // // 重量
  534. // weight: '',
  535. // // 维护部门
  536. // repairGroupId: '',
  537. // repairUserId: '',
  538. // // 设备用途
  539. // purpose: '',
  540. // // 设备位置
  541. // location: '',
  542. // //品牌
  543. // brand: '',
  544. // // 供应商code
  545. // supplierId: '',
  546. // // 编号
  547. // codeNumber: '',
  548. // // 使用人
  549. // usePersonId: '',
  550. // // 有效期开始
  551. // startTime: '',
  552. // // 有效结束
  553. // endTime: '',
  554. // // 级别
  555. // level: '',
  556. // // 状态
  557. // status: '',
  558. // // 负责人
  559. // chargePersonId: '',
  560. // // 入账日期
  561. // entryDate: '',
  562. // // 周期
  563. // cycle: '',
  564. // // 备注
  565. // remark: '',
  566. // // 使用岗位
  567. // postId: ''
  568. // },
  569. options: {
  570. ownershipUserId: [], // 权属人
  571. repairUserId: [], // 维护人
  572. supplierId: [], // 供应商
  573. cityDataLabel, // 设备位置
  574. assetLevel: [], // 资产级别
  575. deliveryCycle: [], // 送检周期
  576. suppList: [] // 供应商
  577. },
  578. zcInfo: {
  579. workstation: {}
  580. }
  581. };
  582. },
  583. props: {
  584. form: {
  585. type: Object,
  586. default: {
  587. workstation: {}
  588. }
  589. },
  590. isLock: {
  591. type: Boolean,
  592. default: false
  593. }
  594. },
  595. watch: {
  596. form: {
  597. //监听的对象
  598. deep: true, //深度监听设置为 true
  599. handler: function (newValue) {
  600. this.zcInfo = newValue;
  601. }
  602. }
  603. },
  604. async mounted() {
  605. // 获取资产级别下拉框
  606. await this.getAssetLevelOptions();
  607. // 获取送检周期下拉
  608. await this.getDeliveryCycleOptions();
  609. // 获取供应商下拉列表
  610. await this.getSuppliersList();
  611. // 获取厂房数据
  612. this.getFactoryareaList();
  613. // 初始化数据
  614. setTimeout(() => {
  615. this.initData();
  616. }, 500);
  617. },
  618. methods: {
  619. // 获取工厂数据
  620. getFactoryareaList() {
  621. getFactoryarea({
  622. type: 1,
  623. size: 9999,
  624. type: 2
  625. }).then((res) => {
  626. this.factoryOptions = res.list;
  627. });
  628. },
  629. change_factoryId(id) {
  630. this.zcInfo.workshopId = '';
  631. this.zcInfo.productionLineId = '';
  632. this.zcInfo.stationId = '';
  633. this.workshopOptions = [];
  634. this.productionLineOptions = [];
  635. this.stationOptions = [];
  636. this.zcInfo.factoryRoomId = id;
  637. this.zcInfo.factoryRoomName = this.factoryOptions.filter(
  638. (item) => item.id === id
  639. )[0].pathName;
  640. this.getListWorkshopByParentId(id);
  641. },
  642. // 获取车间
  643. getListWorkshopByParentId(id) {
  644. listWorkshopByParentId(id).then((res) => {
  645. this.workshopOptions = res;
  646. });
  647. },
  648. change_workshop(id) {
  649. this.zcInfo.productionLineId = '';
  650. this.zcInfo.stationId = '';
  651. this.productionLineOptions = [];
  652. this.stationOptions = [];
  653. this.zcInfo.workshopName = this.workshopOptions.filter(
  654. (item) => item.id === id
  655. )[0].name;
  656. this.getlistFactoryLineByParentId(id);
  657. },
  658. // 获取产线
  659. getlistFactoryLineByParentId(id) {
  660. listFactoryLine([id]).then((res) => {
  661. this.productionLineOptions = res;
  662. });
  663. },
  664. change_productionLineId(id) {
  665. this.zcInfo.stationId = '';
  666. this.stationOptions = [];
  667. this.zcInfo.productionLineName = this.productionLineOptions.filter(
  668. (item) => item.id === id
  669. )[0].name;
  670. this.getlistByProductionLineId(id);
  671. },
  672. // 获取工位
  673. getlistByProductionLineId(id) {
  674. listByProductionLineId(id).then((res) => {
  675. this.stationOptions = res;
  676. });
  677. },
  678. change_stationId(id) {
  679. this.$forceUpdate();
  680. this.zcInfo.stationName = this.stationOptions.filter(
  681. (item) => item.id === id
  682. )[0].name;
  683. },
  684. usePersonIdChange(val) {
  685. if (this.zcInfo.isPublic > 0 && this.isLock) {
  686. this.zcInfo.chargePersonId = val;
  687. }
  688. },
  689. // 限制结束时间
  690. endTimeRules() {
  691. if (this.zcInfo.startTime) {
  692. console.log(this.zcInfo.startTime);
  693. console.log(new Date(this.zcInfo.startTime).getTime());
  694. let differenceTime =
  695. new Date(this.zcInfo.endTime).getTime() -
  696. new Date(this.zcInfo.startTime).getTime();
  697. if (differenceTime <= 0) {
  698. this.$message.error('请选择正确的有效结束时间');
  699. this.zcInfo.endTime = '';
  700. }
  701. } else {
  702. this.$message.error('请选择有效开始时间');
  703. this.zcInfo.endTime = '';
  704. }
  705. },
  706. // 获取资产级别下拉
  707. async getAssetLevelOptions() {
  708. let { data } = await getByCode('asset_level');
  709. this.options.assetLevel =
  710. data.length > 0
  711. ? data.map((item) => {
  712. return {
  713. name: Object.keys(item)[0],
  714. id: item[Object.keys(item)[0]]
  715. };
  716. })
  717. : [];
  718. },
  719. // 获取送检周期下拉
  720. async getDeliveryCycleOptions() {
  721. let { data } = await getByCode('delivery_cycle');
  722. console.log(data);
  723. this.options.deliveryCycle =
  724. data.length > 0
  725. ? data.map((item) => {
  726. return {
  727. name: item[Object.keys(item)[0]],
  728. id: +Object.keys(item)[0]
  729. };
  730. })
  731. : [];
  732. },
  733. // 获取维护人下拉列表
  734. async geMaintainersList() {
  735. if (!this.zcInfo.repairGroupId) return;
  736. let data = await getUserPage({
  737. pageNum: 1,
  738. size: 9999,
  739. groupId: this.zcInfo.repairGroupId
  740. });
  741. this.options.repairUserId = data.list;
  742. },
  743. // 使用岗位点击事件
  744. async auditorDeptClick(data) {
  745. this.zcInfo.chargePersonId = '';
  746. this.zcInfo.usePersonId = '';
  747. this.userList = [];
  748. if (data) {
  749. this.getStaffList(data);
  750. }
  751. },
  752. // 获取供应商下拉列表
  753. async getSuppliersList() {
  754. const rep = await warehouseDefinition.eomContact({
  755. type: 2,
  756. status: 1,
  757. size: -1,
  758. pageNum: 1
  759. });
  760. this.options.suppList = rep.list;
  761. },
  762. // 通过部门岗位获取人员列表
  763. async getStaffList(id) {
  764. let res = await warehouseDefinition.getUserPage({
  765. groupId: id,
  766. size: 9999,
  767. page: 1
  768. });
  769. this.userList = res.list;
  770. },
  771. // 权属部门
  772. async getqsbm() {
  773. if (!this.zcInfo.ownershipGroupId) {
  774. this.options.ownershipUserId = [];
  775. this.zcInfo.ownershipUserId = '';
  776. } else {
  777. let data = await getUserPage({
  778. pageNum: 1,
  779. size: 9999,
  780. groupId: this.zcInfo.ownershipGroupId
  781. });
  782. this.options.ownershipUserId = data.list;
  783. }
  784. },
  785. // 维护部门
  786. async getwhbm() {
  787. if (!this.zcInfo.repairGroupId) return;
  788. let data = await getUserPage({
  789. pageNum: 1,
  790. size: 9999,
  791. groupId: this.zcInfo.repairGroupId
  792. });
  793. this.options.repairUserId = data.list;
  794. },
  795. // 初始化
  796. async initData() {
  797. console.log('this.zcInfo---------------------', this.zcInfo);
  798. // 填充使用岗位
  799. this.zcInfo.postId && this.getStaffList(this.zcInfo.postId);
  800. // 获取设备绑定信息
  801. this.geMaintainersList();
  802. }
  803. }
  804. };
  805. </script>
  806. <style lang="scss" scoped>
  807. ::v-deep .descriptions {
  808. margin-bottom: 10px;
  809. }
  810. .baseinfo-container .basic-details-title {
  811. font-size: 16px;
  812. margin: 15px 0;
  813. }
  814. .upload-container {
  815. display: flex;
  816. justify-content: flex-start;
  817. .file-list {
  818. margin-left: 50px;
  819. flex: 1;
  820. }
  821. }
  822. .equipment-container {
  823. // .content {
  824. // padding: 0 20px;
  825. // }
  826. .label-none {
  827. .el-form-item__content {
  828. margin-left: 0 !important;
  829. }
  830. }
  831. }
  832. .sbwz {
  833. .item {
  834. width: 120px !important;
  835. }
  836. .item + .item {
  837. margin-left: 10px;
  838. }
  839. .item-input {
  840. width: 350px !important;
  841. }
  842. }
  843. .input {
  844. width: 100%;
  845. }
  846. .kzzd {
  847. width: 500px;
  848. .add-col {
  849. display: flex;
  850. .col-input {
  851. & + .col-input {
  852. margin-left: 10px;
  853. }
  854. }
  855. .del {
  856. margin-left: 10px;
  857. }
  858. }
  859. }
  860. ::v-deep .el-descriptions {
  861. .el-form-item {
  862. margin-bottom: 0px;
  863. }
  864. }
  865. </style>