index.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993
  1. <template>
  2. <div class="mainContentBox">
  3. <avue-crud
  4. ref="crudRef"
  5. v-model:search="search"
  6. v-model="form"
  7. :data="data"
  8. :option="option"
  9. v-model:page="page"
  10. @row-save="createRow"
  11. @row-update="updateRow"
  12. @row-del="deleteRow"
  13. @search-change="searchChange"
  14. @search-reset="resetChange"
  15. @size-change="dataList"
  16. @current-change="dataList"
  17. @selection-change="selectionChange"
  18. >
  19. <template #menu-left="{ size }">
  20. <el-button
  21. :disabled="toDeleteIds.length < 1"
  22. type="danger"
  23. icon="el-icon-delete"
  24. :size="size"
  25. v-hasPerm="[ButtonPermKeys.DEVICE.BTNS.allocate_del]"
  26. @click="multipleDelete"
  27. >删除</el-button
  28. >
  29. </template>
  30. <template #menu="{ size, row, index }">
  31. <el-button
  32. @click="maintenance(row, 0, false)"
  33. icon="el-icon-check"
  34. text
  35. v-hasPerm="[ButtonPermKeys.DEVICE.BTNS.allocate_audit]"
  36. type="primary"
  37. :size="size"
  38. >流程</el-button
  39. >
  40. <el-button
  41. @click="maintenance(row, 1, true)"
  42. icon="el-icon-fold"
  43. text
  44. type="primary"
  45. :size="size"
  46. >记录</el-button
  47. >
  48. <el-button
  49. @click="handleExport(row)"
  50. icon="el-icon-download"
  51. text
  52. v-hasPerm="[ButtonPermKeys.DEVICE.BTNS.allocate_export]"
  53. type="primary"
  54. :size="size"
  55. >导出履历</el-button
  56. >
  57. </template>
  58. </avue-crud>
  59. <el-dialog
  60. v-model="dialog.visible"
  61. :title="dialog.title"
  62. width="850px"
  63. @close="dialog.visible = false"
  64. >
  65. <device-page @device-info="deviceInfo" />
  66. </el-dialog>
  67. <el-dialog
  68. v-model="dialog1.visible"
  69. :title="dialog1.title"
  70. width="750px"
  71. height="80%"
  72. @close="dialog1.visible = false"
  73. >
  74. <el-timeline style="max-width: 500px; margin-left: 100px">
  75. <el-timeline-item center type="success" placement="top">
  76. <el-card>
  77. <h4>调拨申请</h4>
  78. <p>设备编号: {{ maintenanceInfo.deviceNo }}</p>
  79. <p>设备名称: {{ maintenanceInfo.deviceName }}</p>
  80. <p>新责任人: {{ maintenanceInfo.newHead }}</p>
  81. <p>申请人员: {{ maintenanceInfo.creator }}</p>
  82. <!-- <p>调拨周期: {{maintenanceInfo.allocateCycle}}天</p>-->
  83. <p>调拨目标位置: {{ maintenanceInfo.deviceToPosition }}</p>
  84. <p>申请时间: {{ maintenanceInfo.created }}</p>
  85. <el-form-item label="是否需要公司分管领导审批">
  86. <el-radio-group
  87. :disabled="
  88. maintenanceInfo.state > 8 || maintenanceInfo.disabled == true
  89. "
  90. v-model="maintenanceInfo.isApprove"
  91. class="ml-4"
  92. @change="showCard"
  93. >
  94. <el-radio :value="0">否</el-radio>
  95. <el-radio :value="1">是</el-radio>
  96. </el-radio-group>
  97. </el-form-item>
  98. </el-card>
  99. </el-timeline-item>
  100. <el-timeline-item
  101. center
  102. placement="top"
  103. :type="
  104. maintenanceInfo.state === 0
  105. ? 'primary'
  106. : maintenanceInfo.state === 0
  107. ? 'info'
  108. : 'success'
  109. "
  110. >
  111. <el-card v-if="viewPage">
  112. <h4>调出部门领导</h4>
  113. <p>审批人员: {{ maintenanceInfo.auditUser }}</p>
  114. <p>审批意见: {{ maintenanceInfo.auditOpinion }}</p>
  115. <p>
  116. 审批结果:
  117. {{
  118. maintenanceInfo.auditUser
  119. ? maintenanceInfo.auditResult === 0
  120. ? "通过"
  121. : "不通过"
  122. : ""
  123. }}
  124. </p>
  125. <p>审批时间: {{ maintenanceInfo.auditTime }}</p>
  126. </el-card>
  127. <el-card v-if="!viewPage">
  128. <h4>调出部门领导</h4>
  129. <el-form
  130. ref="maintenanceInfoForm"
  131. :model="maintenanceInfo"
  132. label-width="auto"
  133. style="max-width: 400px"
  134. :rules="rules"
  135. >
  136. <el-form-item label="审批意见" prop="auditOpinion">
  137. <el-input
  138. :disabled="maintenanceInfo.state !== 0"
  139. type="textarea"
  140. :rows="2"
  141. v-model="maintenanceInfo.auditOpinion"
  142. />
  143. </el-form-item>
  144. <el-form-item label="审批人员" prop="auditUser">
  145. <el-select
  146. :disabled="maintenanceInfo.state !== 0"
  147. v-model="maintenanceInfo.auditUser"
  148. filterable
  149. placeholder="审批人员"
  150. >
  151. <el-option
  152. v-for="item in userList"
  153. :key="item.userName"
  154. :label="item.userName"
  155. :value="item.userName"
  156. />
  157. </el-select>
  158. </el-form-item>
  159. <el-form-item label="审批结果">
  160. <el-radio-group
  161. :disabled="maintenanceInfo.state !== 0"
  162. v-model="maintenanceInfo.auditResult"
  163. class="ml-4"
  164. >
  165. <el-radio :value="0">通过</el-radio>
  166. <el-radio :value="1">驳回</el-radio>
  167. </el-radio-group>
  168. </el-form-item>
  169. <el-form-item style="margin-left: 45%">
  170. <el-button
  171. type="primary"
  172. v-if="maintenanceInfo.state === 0"
  173. @click="maintenanceSubmit"
  174. >保存</el-button
  175. >
  176. </el-form-item>
  177. </el-form>
  178. </el-card>
  179. </el-timeline-item>
  180. <el-timeline-item
  181. center
  182. placement="top"
  183. :type="
  184. maintenanceInfo.state === 2
  185. ? 'primary'
  186. : maintenanceInfo.state < 2
  187. ? 'info'
  188. : 'success'
  189. "
  190. >
  191. <el-card v-if="viewPage">
  192. <h4>调入部门领导</h4>
  193. <p>审批人员: {{ maintenanceInfo.auditUser1 }}</p>
  194. <p>
  195. 审批结果:
  196. {{
  197. maintenanceInfo.auditUser1
  198. ? maintenanceInfo.auditResult1 === 0
  199. ? "通过"
  200. : "不通过"
  201. : ""
  202. }}
  203. </p>
  204. <p>审批意见: {{ maintenanceInfo.auditOpinion1 }}</p>
  205. <p>审批时间: {{ maintenanceInfo.auditTime1 }}</p>
  206. </el-card>
  207. <el-card v-if="!viewPage">
  208. <h4>调入部门领导</h4>
  209. <el-form
  210. ref="maintenanceInfoForm1"
  211. v-if="maintenanceInfo.state >= 2"
  212. :model="maintenanceInfo"
  213. label-width="auto"
  214. style="max-width: 400px"
  215. :rules="rules"
  216. >
  217. <el-form-item label="审批意见" prop="auditOpinion1">
  218. <el-input
  219. :disabled="maintenanceInfo.state !== 2"
  220. type="textarea"
  221. :rows="2"
  222. v-model="maintenanceInfo.auditOpinion1"
  223. />
  224. </el-form-item>
  225. <el-form-item label="审批人员" prop="auditUser1">
  226. <el-select
  227. :disabled="maintenanceInfo.state !== 2"
  228. v-model="maintenanceInfo.auditUser1"
  229. filterable
  230. placeholder="审批人员"
  231. >
  232. <el-option
  233. v-for="item in userList"
  234. :key="item.userName"
  235. :label="item.userName"
  236. :value="item.userName"
  237. />
  238. </el-select>
  239. </el-form-item>
  240. <el-form-item label="审批结果">
  241. <el-radio-group
  242. :disabled="maintenanceInfo.state !== 2"
  243. v-model="maintenanceInfo.auditResult1"
  244. class="ml-4"
  245. >
  246. <el-radio :value="0">通过</el-radio>
  247. <el-radio :value="1">驳回</el-radio>
  248. </el-radio-group>
  249. </el-form-item>
  250. <el-form-item style="margin-left: 45%">
  251. <el-button
  252. type="primary"
  253. v-if="maintenanceInfo.state === 2"
  254. @click="maintenanceSubmit1"
  255. >保存</el-button
  256. >
  257. </el-form-item>
  258. </el-form>
  259. </el-card>
  260. </el-timeline-item>
  261. <el-timeline-item
  262. center
  263. placement="top"
  264. :type="
  265. maintenanceInfo.state === 4
  266. ? 'primary'
  267. : maintenanceInfo.state < 4
  268. ? 'info'
  269. : 'success'
  270. "
  271. >
  272. <el-card v-if="viewPage">
  273. <h4>科研生产部设备管理员</h4>
  274. <p>审批人员: {{ maintenanceInfo.auditUser2 }}</p>
  275. <p>审批意见: {{ maintenanceInfo.auditOpinion2 }}</p>
  276. <p>
  277. 审批结果:
  278. {{
  279. maintenanceInfo.auditUser2
  280. ? maintenanceInfo.auditResult2 === 0
  281. ? "通过"
  282. : "不通过"
  283. : ""
  284. }}
  285. </p>
  286. <p>审批时间: {{ maintenanceInfo.auditTime2 }}</p>
  287. </el-card>
  288. <el-card v-if="!viewPage">
  289. <h4>科研生产部设备管理员</h4>
  290. <el-form
  291. ref="maintenanceInfoForm2"
  292. v-if="maintenanceInfo.state >= 4"
  293. :model="maintenanceInfo"
  294. label-width="auto"
  295. style="max-width: 400px"
  296. :rules="rules"
  297. >
  298. <el-form-item label="审批意见" prop="auditOpinion2">
  299. <el-input
  300. :disabled="maintenanceInfo.state !== 4"
  301. type="textarea"
  302. :rows="2"
  303. v-model="maintenanceInfo.auditOpinion2"
  304. />
  305. </el-form-item>
  306. <el-form-item label="审批人员" prop="auditUser2">
  307. <el-select
  308. :disabled="maintenanceInfo.state !== 4"
  309. v-model="maintenanceInfo.auditUser2"
  310. filterable
  311. placeholder="审批人员"
  312. >
  313. <el-option
  314. v-for="item in userList"
  315. :key="item.userName"
  316. :label="item.userName"
  317. :value="item.userName"
  318. />
  319. </el-select>
  320. </el-form-item>
  321. <el-form-item label="审批结果">
  322. <el-radio-group
  323. :disabled="maintenanceInfo.state !== 4"
  324. v-model="maintenanceInfo.auditResult2"
  325. class="ml-4"
  326. >
  327. <el-radio :value="0">通过</el-radio>
  328. <el-radio :value="1">驳回</el-radio>
  329. </el-radio-group>
  330. </el-form-item>
  331. <el-form-item style="margin-left: 45%">
  332. <el-button
  333. type="primary"
  334. v-if="maintenanceInfo.state === 4"
  335. @click="maintenanceSubmit2"
  336. >保存</el-button
  337. >
  338. </el-form-item>
  339. </el-form>
  340. </el-card>
  341. </el-timeline-item>
  342. <el-timeline-item
  343. center
  344. placement="top"
  345. :type="
  346. maintenanceInfo.state === 6
  347. ? 'primary'
  348. : maintenanceInfo.state < 6
  349. ? 'info'
  350. : 'success'
  351. "
  352. >
  353. <el-card v-if="viewPage">
  354. <h4>科研生产部负责人</h4>
  355. <p>审批人员: {{ maintenanceInfo.auditUser3 }}</p>
  356. <p>审批意见: {{ maintenanceInfo.auditOpinion3 }}</p>
  357. <p>
  358. 审批结果:
  359. {{
  360. maintenanceInfo.auditUser3
  361. ? maintenanceInfo.auditResult3 === 0
  362. ? "通过"
  363. : "不通过"
  364. : ""
  365. }}
  366. </p>
  367. <p>审批时间: {{ maintenanceInfo.auditTime3 }}</p>
  368. </el-card>
  369. <el-card v-if="!viewPage">
  370. <h4>科研生产部负责人</h4>
  371. <el-form
  372. ref="maintenanceInfoForm3"
  373. v-if="maintenanceInfo.state >= 6"
  374. :model="maintenanceInfo"
  375. label-width="auto"
  376. style="max-width: 400px"
  377. :rules="rules"
  378. >
  379. <el-form-item label="审批意见" prop="auditOpinion3">
  380. <el-input
  381. :disabled="maintenanceInfo.state !== 6"
  382. type="textarea"
  383. :rows="2"
  384. v-model="maintenanceInfo.auditOpinion3"
  385. />
  386. </el-form-item>
  387. <el-form-item label="审批人员" prop="auditUser3">
  388. <el-select
  389. :disabled="maintenanceInfo.state !== 6"
  390. v-model="maintenanceInfo.auditUser3"
  391. filterable
  392. placeholder="审批人员"
  393. >
  394. <el-option
  395. v-for="item in userList"
  396. :key="item.userName"
  397. :label="item.userName"
  398. :value="item.userName"
  399. />
  400. </el-select>
  401. </el-form-item>
  402. <el-form-item label="审批结果">
  403. <el-radio-group
  404. :disabled="maintenanceInfo.state !== 6"
  405. v-model="maintenanceInfo.auditResult3"
  406. class="ml-4"
  407. >
  408. <el-radio :value="0">通过</el-radio>
  409. <el-radio :value="1">驳回</el-radio>
  410. </el-radio-group>
  411. </el-form-item>
  412. <el-form-item style="margin-left: 45%">
  413. <el-button
  414. type="primary"
  415. v-if="maintenanceInfo.state === 6"
  416. @click="maintenanceSubmit3"
  417. >保存</el-button
  418. >
  419. </el-form-item>
  420. </el-form>
  421. </el-card>
  422. </el-timeline-item>
  423. <el-timeline-item
  424. center
  425. placement="top"
  426. v-show="showItem"
  427. :type="
  428. maintenanceInfo.state === 8
  429. ? 'primary'
  430. : maintenanceInfo.state < 8
  431. ? 'info'
  432. : 'success'
  433. "
  434. >
  435. <el-card v-if="viewPage">
  436. <h4>公司分管领导</h4>
  437. <p>审批人员: {{ maintenanceInfo.auditUser4 }}</p>
  438. <p>审批意见: {{ maintenanceInfo.auditOpinion4 }}</p>
  439. <p>
  440. 审批结果:
  441. {{
  442. maintenanceInfo.auditUser4
  443. ? maintenanceInfo.auditResult4 === 0
  444. ? "通过"
  445. : "不通过"
  446. : ""
  447. }}
  448. </p>
  449. <p>审批时间: {{ maintenanceInfo.auditTime4 }}</p>
  450. </el-card>
  451. <el-card v-if="!viewPage">
  452. <h4>公司分管领导</h4>
  453. <el-form
  454. ref="maintenanceInfoForm4"
  455. v-if="maintenanceInfo.state >= 8"
  456. :model="maintenanceInfo"
  457. label-width="auto"
  458. style="max-width: 400px"
  459. :rules="rules"
  460. >
  461. <el-form-item label="审批意见" prop="auditOpinion4">
  462. <el-input
  463. :disabled="maintenanceInfo.state !== 8"
  464. type="textarea"
  465. :rows="2"
  466. v-model="maintenanceInfo.auditOpinion4"
  467. />
  468. </el-form-item>
  469. <el-form-item label="审批人员" prop="auditUser4">
  470. <el-select
  471. :disabled="maintenanceInfo.state !== 8"
  472. v-model="maintenanceInfo.auditUser4"
  473. filterable
  474. placeholder="审批人员"
  475. >
  476. <el-option
  477. v-for="item in userList"
  478. :key="item.userName"
  479. :label="item.userName"
  480. :value="item.userName"
  481. />
  482. </el-select>
  483. </el-form-item>
  484. <el-form-item label="审批结果">
  485. <el-radio-group
  486. :disabled="maintenanceInfo.state !== 8"
  487. v-model="maintenanceInfo.auditResult4"
  488. class="ml-4"
  489. >
  490. <el-radio :value="0">通过</el-radio>
  491. <el-radio :value="1">驳回</el-radio>
  492. </el-radio-group>
  493. </el-form-item>
  494. <el-form-item style="margin-left: 45%">
  495. <el-button
  496. type="primary"
  497. v-if="maintenanceInfo.state === 8"
  498. @click="maintenanceSubmit4"
  499. >保存</el-button
  500. >
  501. </el-form-item>
  502. </el-form>
  503. </el-card>
  504. </el-timeline-item>
  505. </el-timeline>
  506. </el-dialog>
  507. </div>
  508. </template>
  509. <script setup>
  510. import { ref, getCurrentInstance } from "vue";
  511. import { useCrud } from "@/hooks/userCrud";
  512. import ButtonPermKeys from "@/common/configs/buttonPermission";
  513. import { checkPerm } from "@/directive/permission";
  514. import { getUserList } from "@/api/system/user";
  515. import { allocateAudit, allocateExport } from "@/api/device/index";
  516. import { useCommonStoreHook } from "@/store";
  517. import dictDataUtil from "@/common/configs/dictDataUtil";
  518. const { isShowTable, tableType } = toRefs(useCommonStoreHook());
  519. const showItem = ref(false);
  520. const test = () => {
  521. isShowTable.value = true;
  522. tableType.value = tableType.value == 1 ? 2 : 1;
  523. };
  524. const permission = reactive({
  525. delBtn: checkPerm(ButtonPermKeys.DEVICE.BTNS.allocate_del),
  526. addBtn: checkPerm(ButtonPermKeys.DEVICE.BTNS.allocate_add),
  527. editBtn: checkPerm(ButtonPermKeys.DEVICE.BTNS.allocate_edit),
  528. menu: true,
  529. });
  530. const viewPage = ref(true);
  531. const dialog = reactive({
  532. title: "设备选择",
  533. visible: false,
  534. });
  535. const dialog1 = reactive({
  536. title: "调拨详情",
  537. visible: false,
  538. });
  539. const userList = ref([]);
  540. // 传入一个url,后面不带/
  541. const { form, data, option, search, page, toDeleteIds, Methords, Utils } =
  542. useCrud({
  543. src: "/api/v1/device/allocate",
  544. });
  545. const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
  546. Methords; //增删改查
  547. const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
  548. const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
  549. const crudRef = ref(null); //crudRef.value 获取avue-crud对象
  550. const deviceInfo = (value) => {
  551. form.value.deviceNo = value.deviceNo;
  552. form.value.deviceName = value.deviceName;
  553. form.value.deviceType = value.deviceType;
  554. form.value.devicePosition = value.devicePosition;
  555. form.value.oldHead = value.head;
  556. form.value.devicePosition = value.devicePosition;
  557. form.value.oldDept = value.deptId;
  558. dialog.visible = false;
  559. form.value.serialNumber = value.serialNumber;
  560. form.value.originalValue = value.originalValue;
  561. form.value.specifications = value.specifications;
  562. };
  563. const showCard = () => {
  564. if (maintenanceInfo.value.isApprove === 1) {
  565. showItem.value = true;
  566. }
  567. if (maintenanceInfo.value.isApprove === 0) {
  568. showItem.value = false;
  569. }
  570. };
  571. const maintenanceInfo = ref({});
  572. const maintenance = (row, type, status) => {
  573. viewPage.value = type === 0 ? false : true;
  574. maintenanceInfo.value = row;
  575. maintenanceInfo.value.disabled = status;
  576. dialog1.visible = true;
  577. if (null == maintenanceInfo.value.auditResult) {
  578. maintenanceInfo.value.auditResult = 0;
  579. }
  580. if (null == maintenanceInfo.value.isApprove) {
  581. maintenanceInfo.value.isApprove = 0;
  582. }
  583. if (null == maintenanceInfo.value.auditResult1) {
  584. maintenanceInfo.value.auditResult1 = 0;
  585. }
  586. if (null == maintenanceInfo.value.auditResult2) {
  587. maintenanceInfo.value.auditResult2 = 0;
  588. }
  589. if (null == maintenanceInfo.value.auditResult3) {
  590. maintenanceInfo.value.auditResult3 = 0;
  591. }
  592. if (null == maintenanceInfo.value.auditResult4) {
  593. maintenanceInfo.value.auditResult4 = 0;
  594. }
  595. };
  596. const queryUserList = () => {
  597. getUserList({}).then((data) => {
  598. userList.value = data.data;
  599. });
  600. };
  601. const handleExport = (row) => {
  602. allocateExport(row.deviceNo).then((response) => {
  603. downFile(response);
  604. });
  605. };
  606. /** 文件下载 */
  607. const downFile = (response) => {
  608. const fileData = response.data;
  609. const fileName = decodeURI(
  610. response.headers["content-disposition"].split(";")[1].split("=")[1]
  611. );
  612. const fileType =
  613. "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8";
  614. const blob = new Blob([fileData], { type: fileType });
  615. const downloadUrl = window.URL.createObjectURL(blob);
  616. const downloadLink = document.createElement("a");
  617. downloadLink.href = downloadUrl;
  618. downloadLink.download = fileName;
  619. document.body.appendChild(downloadLink);
  620. downloadLink.click();
  621. document.body.removeChild(downloadLink);
  622. window.URL.revokeObjectURL(downloadUrl);
  623. };
  624. const maintenanceInfoForm = ref("maintenanceInfoForm");
  625. const maintenanceInfoForms = ref("maintenanceInfoForms");
  626. const maintenanceInfoForm1 = ref("maintenanceInfoForm1");
  627. const maintenanceInfoForm2 = ref("maintenanceInfoForm2");
  628. const maintenanceInfoForm3 = ref("maintenanceInfoForm3");
  629. const maintenanceInfoForm4 = ref("maintenanceInfoForm4");
  630. const maintenanceSubmit = () => {
  631. //alert(JSON.stringify(maintenanceInfo.value))
  632. maintenanceInfoForm.value.validate((isValid, invalidFields) => {
  633. if (isValid) {
  634. allocateAudit(maintenanceInfo.value).then((data) => {
  635. ElMessage({
  636. message: data.msg,
  637. type: "success",
  638. });
  639. dialog1.visible = false;
  640. dataList();
  641. });
  642. }
  643. });
  644. };
  645. const maintenanceSubmit1 = () => {
  646. //alert(JSON.stringify(maintenanceInfo.value))
  647. maintenanceInfoForm1.value.validate((isValid, invalidFields) => {
  648. if (isValid) {
  649. maintenanceInfo.value.auditResult = maintenanceInfo.value.auditResult1;
  650. maintenanceInfo.value.auditOpinion = maintenanceInfo.value.auditOpinion1;
  651. maintenanceInfo.value.auditUser = maintenanceInfo.value.auditUser1;
  652. maintenanceInfo.value.auditOpinion = maintenanceInfo.value.auditOpinion1;
  653. allocateAudit(maintenanceInfo.value).then((data) => {
  654. ElMessage({
  655. message: data.msg,
  656. type: "success",
  657. });
  658. dialog1.visible = false;
  659. dataList();
  660. });
  661. }
  662. });
  663. };
  664. const maintenanceSubmit2 = () => {
  665. //alert(JSON.stringify(maintenanceInfo.value))
  666. maintenanceInfoForm2.value.validate((isValid, invalidFields) => {
  667. if (isValid) {
  668. maintenanceInfo.value.auditResult = maintenanceInfo.value.auditResult2;
  669. maintenanceInfo.value.auditOpinion = maintenanceInfo.value.auditOpinion2;
  670. maintenanceInfo.value.auditUser = maintenanceInfo.value.auditUser2;
  671. maintenanceInfo.value.auditOpinion = maintenanceInfo.value.auditOpinion2;
  672. allocateAudit(maintenanceInfo.value).then((data) => {
  673. ElMessage({
  674. message: data.msg,
  675. type: "success",
  676. });
  677. dialog1.visible = false;
  678. dataList();
  679. });
  680. }
  681. });
  682. };
  683. const maintenanceSubmit3 = () => {
  684. //alert(JSON.stringify(maintenanceInfo.value))
  685. maintenanceInfoForm3.value.validate((isValid, invalidFields) => {
  686. if (isValid) {
  687. maintenanceInfo.value.auditResult = maintenanceInfo.value.auditResult3;
  688. maintenanceInfo.value.auditOpinion = maintenanceInfo.value.auditOpinion3;
  689. maintenanceInfo.value.auditUser = maintenanceInfo.value.auditUser3;
  690. maintenanceInfo.value.auditOpinion = maintenanceInfo.value.auditOpinion3;
  691. allocateAudit(maintenanceInfo.value).then((data) => {
  692. ElMessage({
  693. message: data.msg,
  694. type: "success",
  695. });
  696. dialog1.visible = false;
  697. dataList();
  698. });
  699. }
  700. });
  701. };
  702. const maintenanceSubmit4 = () => {
  703. //alert(JSON.stringify(maintenanceInfo.value))
  704. maintenanceInfoForm4.value.validate((isValid, invalidFields) => {
  705. if (isValid) {
  706. maintenanceInfo.value.auditResult = maintenanceInfo.value.auditResult4;
  707. maintenanceInfo.value.auditOpinion = maintenanceInfo.value.auditOpinion4;
  708. maintenanceInfo.value.auditUser = maintenanceInfo.value.auditUser4;
  709. maintenanceInfo.value.auditOpinion = maintenanceInfo.value.auditOpinion4;
  710. allocateAudit(maintenanceInfo.value).then((data) => {
  711. ElMessage({
  712. message: data.msg,
  713. type: "success",
  714. });
  715. dialog1.visible = false;
  716. dataList();
  717. });
  718. }
  719. });
  720. };
  721. const rules = reactive({
  722. auditUser: [{ required: true, message: "审核人员不能为空", trigger: "blur" }],
  723. auditOpinion: [
  724. { required: true, message: "审批意见不能为空", trigger: "blur" },
  725. ],
  726. auditUser1: [
  727. { required: true, message: "审核人员不能为空", trigger: "blur" },
  728. ],
  729. auditOpinion1: [
  730. { required: true, message: "审批意见不能为空", trigger: "blur" },
  731. ],
  732. auditUser2: [
  733. { required: true, message: "审核人员不能为空", trigger: "blur" },
  734. ],
  735. auditOpinion2: [
  736. { required: true, message: "审批意见不能为空", trigger: "blur" },
  737. ],
  738. auditUser3: [
  739. { required: true, message: "审核人员不能为空", trigger: "blur" },
  740. ],
  741. auditOpinion3: [
  742. { required: true, message: "审批意见不能为空", trigger: "blur" },
  743. ],
  744. auditUser4: [
  745. { required: true, message: "审核人员不能为空", trigger: "blur" },
  746. ],
  747. auditOpinion4: [
  748. { required: true, message: "审批意见不能为空", trigger: "blur" },
  749. ],
  750. });
  751. // 设置表格列或者其他自定义的option
  752. option.value = Object.assign(option.value, {
  753. delBtn: false,
  754. selection: true,
  755. labelWidth: 150,
  756. menuWidth: 300,
  757. viewBtn: false,
  758. editBtn: false,
  759. selectable: (row, index) => {
  760. return row.state === 0;
  761. },
  762. column: [
  763. /*{
  764. label: "调拨单号",
  765. prop: "allocateNo",
  766. display: false,
  767. width: 130,
  768. overHidden: true,
  769. },*/
  770. {
  771. label: "资产编号",
  772. prop: "deviceNo",
  773. width: 130,
  774. overHidden: true,
  775. search: true,
  776. rules: [
  777. {
  778. required: true,
  779. message: "公司资产号不能为空",
  780. trigger: "trigger",
  781. },
  782. ],
  783. click: ({ value, column }) => {
  784. if (column.boxType) {
  785. dialog.visible = true;
  786. }
  787. },
  788. change: ({ value, column }) => {
  789. if (column.boxType) {
  790. if (value != form.value.deviceNo) {
  791. if (column.boxType) {
  792. dialog.visible = true;
  793. }
  794. }
  795. }
  796. },
  797. },
  798. {
  799. label: "名称",
  800. prop: "deviceName",
  801. addDisabled: true,
  802. width: 130,
  803. overHidden: true,
  804. search: true,
  805. },
  806. {
  807. label: "型号",
  808. prop: "specifications",
  809. addDisabled: true,
  810. width: 130,
  811. overHidden: true,
  812. search: true,
  813. },
  814. {
  815. label: "出厂编号",
  816. prop: "serialNumber",
  817. addDisabled: true,
  818. width: 130,
  819. overHidden: true,
  820. search: true,
  821. },
  822. {
  823. label: "原值",
  824. prop: "originalValue",
  825. addDisabled: true,
  826. width: 130,
  827. overHidden: true,
  828. },
  829. {
  830. label: "设备类型",
  831. prop: "deviceType",
  832. type: "select",
  833. width: 100,
  834. overHidden: true,
  835. addDisabled: true,
  836. display: false,
  837. hide: true,
  838. search: true,
  839. dicUrl: dictDataUtil.request_url + dictDataUtil.TYPE_CODE.device_type,
  840. props: {
  841. label: "dictLabel",
  842. value: "dictValue",
  843. },
  844. rules: [
  845. {
  846. required: true,
  847. message: "设备类型不能为空",
  848. trigger: "trigger",
  849. },
  850. ],
  851. },
  852. {
  853. label: "调出部门",
  854. prop: "oldDept",
  855. type: "tree",
  856. width: 130,
  857. overHidden: true,
  858. addDisabled: true,
  859. dicUrl: dictDataUtil.dept_tree_url,
  860. props: {
  861. label: "deptName",
  862. value: "id",
  863. },
  864. },
  865. {
  866. label: "调入部门",
  867. prop: "applyDept",
  868. type: "tree",
  869. width: 130,
  870. overHidden: true,
  871. dicUrl: dictDataUtil.dept_tree_url,
  872. props: {
  873. label: "deptName",
  874. value: "id",
  875. },
  876. rules: [
  877. {
  878. required: true,
  879. message: "调入部门不能为空",
  880. trigger: "trigger",
  881. },
  882. ],
  883. },
  884. {
  885. label: "原负责人",
  886. prop: "oldHead",
  887. overHidden: true,
  888. addDisabled: true,
  889. display: false,
  890. hide: true,
  891. },
  892. {
  893. label: "新责任人",
  894. prop: "newHead",
  895. overHidden: true,
  896. rules: [
  897. {
  898. required: true,
  899. message: "新责任人不能为空",
  900. trigger: "trigger",
  901. },
  902. ],
  903. },
  904. {
  905. label: "设备原位置",
  906. addDisabled: true,
  907. prop: "devicePosition",
  908. overHidden: true,
  909. display: false,
  910. hide: true,
  911. },
  912. {
  913. label: "新安置地点",
  914. prop: "deviceToPosition",
  915. overHidden: true,
  916. rules: [
  917. {
  918. required: true,
  919. message: "新安置地点不能为空",
  920. trigger: "trigger",
  921. },
  922. ],
  923. },
  924. /*{
  925. label: "调拨周期(天)",
  926. prop: "allocateCycle",
  927. type: "number",
  928. width: "105",
  929. min: 0,
  930. max: 999,
  931. rules: [
  932. {
  933. required: true,
  934. message: "调拨周期不能为空",
  935. trigger: "trigger",
  936. },
  937. ],
  938. },*/
  939. {
  940. label: "状态",
  941. prop: "state",
  942. display: false,
  943. overHidden: true,
  944. width: 160,
  945. type: "select",
  946. dicData: [
  947. { label: "待调出部门领导审核", value: 0 },
  948. { label: "驳回", value: 1 },
  949. { label: "待调入部门领导审核", value: 2 },
  950. { label: "驳回", value: 3 },
  951. { label: "待设备管理员审核", value: 4 },
  952. { label: "驳回", value: 5 },
  953. { label: "待科研生产部负责人审核", value: 6 },
  954. { label: "驳回", value: 7 },
  955. { label: "待公司分管领导审核", value: 8 },
  956. { label: "驳回", value: 9 },
  957. { label: "完成", value: 10 },
  958. ],
  959. },
  960. {
  961. label: "申请人",
  962. prop: "applyUser",
  963. width: 130,
  964. overHidden: true,
  965. display: false,
  966. },
  967. {
  968. label: "申请时间",
  969. prop: "created",
  970. overHidden: true,
  971. display: false,
  972. },
  973. ],
  974. });
  975. onMounted(() => {
  976. dataList();
  977. queryUserList();
  978. });
  979. </script>