assetInformation.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874
  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. @change="personIdChange"
  390. :disabled="isLock ? zcInfo.isPublic > 0 : false"
  391. filterable
  392. placeholder="请选择负责人"
  393. >
  394. <el-option
  395. v-for="item in userList"
  396. :key="item.id"
  397. :label="item.name"
  398. :value="item.id"
  399. >
  400. </el-option>
  401. </el-select>
  402. </el-form-item>
  403. </el-descriptions-item>
  404. </el-descriptions>
  405. <el-descriptions
  406. title=""
  407. :column="3"
  408. size="medium"
  409. border
  410. style="edit"
  411. :label-style="labelStyle"
  412. >
  413. <el-descriptions-item>
  414. <template slot="label"> 供应商 </template>
  415. <el-form-item label-width="0">
  416. <el-select
  417. v-model="zcInfo.supplierId"
  418. style="width: 100%"
  419. placeholder="请选择"
  420. >
  421. <el-option
  422. v-for="item in options.suppList"
  423. :key="item.id"
  424. :label="item.name"
  425. :value="item.id"
  426. >
  427. </el-option>
  428. </el-select>
  429. </el-form-item>
  430. </el-descriptions-item>
  431. <el-descriptions-item>
  432. <template slot="label"> 品牌 </template>
  433. <el-form-item label-width="0">
  434. <el-input v-model="zcInfo.brand" class="input"></el-input>
  435. </el-form-item>
  436. </el-descriptions-item>
  437. <el-descriptions-item>
  438. <template slot="label"> 设备用途 </template>
  439. <el-form-item label-width="0">
  440. <el-input v-model="zcInfo.purpose" class="input"></el-input>
  441. </el-form-item>
  442. </el-descriptions-item>
  443. <el-descriptions-item>
  444. <template slot="label"> 备注 </template>
  445. <el-form-item label-width="0">
  446. <el-input
  447. type="textarea"
  448. :rows="2"
  449. placeholder="请输入内容"
  450. v-model="zcInfo.remark"
  451. ></el-input>
  452. </el-form-item>
  453. </el-descriptions-item>
  454. </el-descriptions>
  455. </div>
  456. </el-form>
  457. </div>
  458. </template>
  459. <script>
  460. import {
  461. listWorkshopByParentId,
  462. listFactoryLine,
  463. getFactoryarea,
  464. listByProductionLineId,
  465. getByDeviceId
  466. } from '@/api/factoryModel';
  467. import DeptSelect from '@/components/CommomSelect/dept-select.vue';
  468. import WorkshopSelect from '@/components/CommomSelect/workshop-select.vue';
  469. import FactoryAreaSelect from '@/components/CommomSelect/factory-area-select.vue';
  470. import WorkingProcedureSelect from '@/components/CommomSelect/working-procedure-select.vue';
  471. import factorySelect from '@/components/CommomSelect/factory-select.vue';
  472. import fileUpload from '@/components/upload/fileUpload';
  473. import WithView from '@/components/upload/WithView';
  474. import imgUpload from '@/components/upload/imgUpload';
  475. import { cityDataLabel } from 'ele-admin/packages/utils/regions';
  476. import personSelect from '@/components/CommomSelect/person-select.vue';
  477. import { saveOrEdit, getAssetInfo } from '@/api/ledgerAssets';
  478. import { getUserPage } from '@/api/system/organization';
  479. import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
  480. import { getByCode } from '@/api/system/dictionary-data';
  481. import { data } from 'ele-admin/lib/ele-pro-table';
  482. export default {
  483. components: {
  484. WithView,
  485. WorkshopSelect,
  486. FactoryAreaSelect,
  487. WorkingProcedureSelect,
  488. fileUpload,
  489. imgUpload,
  490. factorySelect,
  491. DeptSelect,
  492. personSelect
  493. },
  494. props: {
  495. isEdit: {
  496. type: Boolean,
  497. default: true
  498. }
  499. },
  500. data() {
  501. return {
  502. factoryOptions: [],
  503. workshopOptions: [],
  504. productionLineOptions: [],
  505. stationOptions: [],
  506. userList: [], // 人员列表
  507. labelStyle: {
  508. 'min-width': '100px'
  509. },
  510. pageType: 'add',
  511. id: '', // 设备主键id
  512. rules: {
  513. name: [
  514. { required: true, message: '请输入设备名称', trigger: 'blur' }
  515. ],
  516. code: [{ required: true, message: '请输入设备编码', trigger: 'blur' }]
  517. },
  518. typeOptions: [
  519. {
  520. id: 0,
  521. name: '专用'
  522. },
  523. {
  524. id: 1,
  525. name: '公用'
  526. }
  527. ],
  528. // 资产信息
  529. // zcInfo: {
  530. // // 固定资产编码
  531. // fixCode: '',
  532. // // 颜色
  533. // color: '',
  534. // // 重量
  535. // weight: '',
  536. // // 维护部门
  537. // repairGroupId: '',
  538. // repairUserId: '',
  539. // // 设备用途
  540. // purpose: '',
  541. // // 设备位置
  542. // location: '',
  543. // //品牌
  544. // brand: '',
  545. // // 供应商code
  546. // supplierId: '',
  547. // // 编号
  548. // codeNumber: '',
  549. // // 使用人
  550. // usePersonId: '',
  551. // // 有效期开始
  552. // startTime: '',
  553. // // 有效结束
  554. // endTime: '',
  555. // // 级别
  556. // level: '',
  557. // // 状态
  558. // status: '',
  559. // // 负责人
  560. // chargePersonId: '',
  561. // // 入账日期
  562. // entryDate: '',
  563. // // 周期
  564. // cycle: '',
  565. // // 备注
  566. // remark: '',
  567. // // 使用岗位
  568. // postId: ''
  569. // },
  570. options: {
  571. ownershipUserId: [], // 权属人
  572. repairUserId: [], // 维护人
  573. supplierId: [], // 供应商
  574. cityDataLabel, // 设备位置
  575. assetLevel: [], // 资产级别
  576. deliveryCycle: [], // 送检周期
  577. suppList: [] // 供应商
  578. },
  579. zcInfo: {
  580. workstation: {}
  581. }
  582. };
  583. },
  584. props: {
  585. form: {
  586. type: Object,
  587. default: {
  588. workstation: {}
  589. }
  590. },
  591. isLock: {
  592. type: Boolean,
  593. default: false
  594. }
  595. },
  596. watch: {
  597. form: {
  598. //监听的对象
  599. deep: true, //深度监听设置为 true
  600. handler: function (newValue) {
  601. this.zcInfo = newValue;
  602. }
  603. }
  604. },
  605. async mounted() {
  606. // 获取资产级别下拉框
  607. await this.getAssetLevelOptions();
  608. // 获取送检周期下拉
  609. await this.getDeliveryCycleOptions();
  610. // 获取供应商下拉列表
  611. await this.getSuppliersList();
  612. // 获取厂房数据
  613. this.getFactoryareaList();
  614. // 初始化数据
  615. setTimeout(() => {
  616. this.initData();
  617. }, 500);
  618. },
  619. methods: {
  620. // 获取工厂数据
  621. getFactoryareaList() {
  622. getFactoryarea({
  623. type: 1,
  624. size: 9999,
  625. type: 2
  626. }).then((res) => {
  627. this.factoryOptions = res.list;
  628. });
  629. },
  630. change_factoryId(id) {
  631. this.zcInfo.workshopId = '';
  632. this.zcInfo.productionLineId = '';
  633. this.zcInfo.stationId = '';
  634. this.workshopOptions = [];
  635. this.productionLineOptions = [];
  636. this.stationOptions = [];
  637. this.zcInfo.factoryRoomId = id;
  638. this.zcInfo.factoryRoomName = this.factoryOptions.filter(
  639. (item) => item.id === id
  640. )[0].pathName;
  641. this.getListWorkshopByParentId(id);
  642. },
  643. // 获取车间
  644. getListWorkshopByParentId(id) {
  645. listWorkshopByParentId(id).then((res) => {
  646. this.workshopOptions = res;
  647. });
  648. },
  649. change_workshop(id) {
  650. this.zcInfo.productionLineId = '';
  651. this.zcInfo.stationId = '';
  652. this.productionLineOptions = [];
  653. this.stationOptions = [];
  654. this.zcInfo.workshopName = this.workshopOptions.filter(
  655. (item) => item.id === id
  656. )[0].name;
  657. this.getlistFactoryLineByParentId(id);
  658. },
  659. // 获取产线
  660. getlistFactoryLineByParentId(id) {
  661. listFactoryLine([id]).then((res) => {
  662. this.productionLineOptions = res;
  663. });
  664. },
  665. change_productionLineId(id) {
  666. this.zcInfo.stationId = '';
  667. this.stationOptions = [];
  668. this.zcInfo.productionLineName = this.productionLineOptions.filter(
  669. (item) => item.id === id
  670. )[0].name;
  671. this.getlistByProductionLineId(id);
  672. },
  673. // 获取工位
  674. getlistByProductionLineId(id) {
  675. listByProductionLineId(id).then((res) => {
  676. this.stationOptions = res;
  677. });
  678. },
  679. change_stationId(id) {
  680. this.$forceUpdate();
  681. this.zcInfo.stationName = this.stationOptions.filter(
  682. (item) => item.id === id
  683. )[0].name;
  684. },
  685. usePersonIdChange(val) {
  686. if (this.zcInfo.isPublic > 0 && this.isLock) {
  687. this.zcInfo.chargePersonId = val;
  688. }
  689. this.$forceUpdate();
  690. },
  691. personIdChange() {
  692. this.$forceUpdate();
  693. },
  694. // 限制结束时间
  695. endTimeRules() {
  696. if (this.zcInfo.startTime) {
  697. console.log(this.zcInfo.startTime);
  698. console.log(new Date(this.zcInfo.startTime).getTime());
  699. let differenceTime =
  700. new Date(this.zcInfo.endTime).getTime() -
  701. new Date(this.zcInfo.startTime).getTime();
  702. if (differenceTime <= 0) {
  703. this.$message.error('请选择正确的有效结束时间');
  704. this.zcInfo.endTime = '';
  705. }
  706. } else {
  707. this.$message.error('请选择有效开始时间');
  708. this.zcInfo.endTime = '';
  709. }
  710. },
  711. // 获取资产级别下拉
  712. async getAssetLevelOptions() {
  713. let { data } = await getByCode('asset_level');
  714. this.options.assetLevel =
  715. data.length > 0
  716. ? data.map((item) => {
  717. return {
  718. name: Object.keys(item)[0],
  719. id: item[Object.keys(item)[0]]
  720. };
  721. })
  722. : [];
  723. },
  724. // 获取送检周期下拉
  725. async getDeliveryCycleOptions() {
  726. let { data } = await getByCode('delivery_cycle');
  727. console.log(data);
  728. this.options.deliveryCycle =
  729. data.length > 0
  730. ? data.map((item) => {
  731. return {
  732. name: item[Object.keys(item)[0]],
  733. id: +Object.keys(item)[0]
  734. };
  735. })
  736. : [];
  737. },
  738. // 获取维护人下拉列表
  739. async geMaintainersList() {
  740. if (!this.zcInfo.repairGroupId) return;
  741. let data = await getUserPage({
  742. pageNum: 1,
  743. size: 9999,
  744. groupId: this.zcInfo.repairGroupId
  745. });
  746. this.options.repairUserId = data.list;
  747. },
  748. // 使用岗位点击事件
  749. async auditorDeptClick(data) {
  750. this.zcInfo.chargePersonId = '';
  751. this.zcInfo.usePersonId = '';
  752. this.userList = [];
  753. if (data) {
  754. this.getStaffList(data);
  755. }
  756. },
  757. // 获取供应商下拉列表
  758. async getSuppliersList() {
  759. const rep = await warehouseDefinition.eomContact({
  760. type: 2,
  761. status: 1,
  762. size: -1,
  763. pageNum: 1
  764. });
  765. this.options.suppList = rep.list;
  766. },
  767. // 通过部门岗位获取人员列表
  768. async getStaffList(id) {
  769. let res = await warehouseDefinition.getUserPage({
  770. groupId: id,
  771. size: 9999,
  772. page: 1
  773. });
  774. this.userList = res.list;
  775. },
  776. // 权属部门
  777. async getqsbm() {
  778. if (!this.zcInfo.ownershipGroupId) {
  779. this.options.ownershipUserId = [];
  780. this.zcInfo.ownershipUserId = '';
  781. } else {
  782. let data = await getUserPage({
  783. pageNum: 1,
  784. size: 9999,
  785. groupId: this.zcInfo.ownershipGroupId
  786. });
  787. this.options.ownershipUserId = data.list;
  788. }
  789. },
  790. // 维护部门
  791. async getwhbm() {
  792. if (!this.zcInfo.repairGroupId) return;
  793. let data = await getUserPage({
  794. pageNum: 1,
  795. size: 9999,
  796. groupId: this.zcInfo.repairGroupId
  797. });
  798. this.options.repairUserId = data.list;
  799. },
  800. // 初始化
  801. async initData() {
  802. console.log('this.zcInfo---------------------', this.zcInfo);
  803. // 填充使用岗位
  804. this.zcInfo.postId && this.getStaffList(this.zcInfo.postId);
  805. // 获取设备绑定信息
  806. this.geMaintainersList();
  807. }
  808. }
  809. };
  810. </script>
  811. <style lang="scss" scoped>
  812. ::v-deep .descriptions {
  813. margin-bottom: 10px;
  814. }
  815. .baseinfo-container .basic-details-title {
  816. font-size: 16px;
  817. margin: 15px 0;
  818. }
  819. .upload-container {
  820. display: flex;
  821. justify-content: flex-start;
  822. .file-list {
  823. margin-left: 50px;
  824. flex: 1;
  825. }
  826. }
  827. .equipment-container {
  828. // .content {
  829. // padding: 0 20px;
  830. // }
  831. .label-none {
  832. .el-form-item__content {
  833. margin-left: 0 !important;
  834. }
  835. }
  836. }
  837. .sbwz {
  838. .item {
  839. width: 120px !important;
  840. }
  841. .item + .item {
  842. margin-left: 10px;
  843. }
  844. .item-input {
  845. width: 350px !important;
  846. }
  847. }
  848. .input {
  849. width: 100%;
  850. }
  851. .kzzd {
  852. width: 500px;
  853. .add-col {
  854. display: flex;
  855. .col-input {
  856. & + .col-input {
  857. margin-left: 10px;
  858. }
  859. }
  860. .del {
  861. margin-left: 10px;
  862. }
  863. }
  864. }
  865. ::v-deep .el-descriptions {
  866. .el-form-item {
  867. margin-bottom: 0px;
  868. }
  869. }
  870. </style>