index.vue 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141
  1. <template>
  2. <div class="app-container">
  3. <el-form
  4. :model="queryParams"
  5. ref="queryForm"
  6. size="small"
  7. :inline="true"
  8. v-show="showSearch"
  9. label-width="140px"
  10. class="queryForm"
  11. >
  12. <el-form-item label="单据类型" prop="orderType">
  13. <el-select
  14. v-model="queryParams.orderType"
  15. placeholder="请选择单据类型"
  16. @change="onQueryTypeChange"
  17. >
  18. <el-option
  19. v-for="dict in dict.type.asset_order_type"
  20. :key="dict.value"
  21. :label="dict.label"
  22. :value="dict.value"
  23. />
  24. </el-select>
  25. </el-form-item>
  26. <el-form-item label="单据编号" prop="orderNumber">
  27. <el-input
  28. v-model="queryParams.orderNumber"
  29. placeholder="请输入单据编号"
  30. clearable
  31. @keyup.enter.native="handleQuery"
  32. />
  33. </el-form-item>
  34. <el-form-item label="申请日期" prop="applicationDate">
  35. <el-date-picker
  36. clearable
  37. v-model="queryParams.applicationDate"
  38. type="date"
  39. value-format="yyyy-MM-dd"
  40. placeholder="请选择申请日期"
  41. >
  42. </el-date-picker>
  43. </el-form-item>
  44. <el-form-item label="申请部门" prop="applicationDepartment">
  45. <treeselect
  46. v-model="queryParams.applicationDepartment"
  47. :options="deptOptions"
  48. placeholder="请选择申请部门"
  49. @keyup.enter.native="handleQuery"
  50. />
  51. </el-form-item>
  52. <el-form-item
  53. v-if="queryParams.orderType === '1'"
  54. label="【调整】资产编号"
  55. prop="adjustmentAssetNumber"
  56. >
  57. <template>
  58. <el-select
  59. v-model="queryParams.adjustmentAssetNumber"
  60. filterable
  61. placeholder="请输入资产编号"
  62. >
  63. <el-option
  64. v-for="item in informationList"
  65. :key="item.number"
  66. :label="item.name"
  67. :value="item.number"
  68. >
  69. </el-option>
  70. </el-select>
  71. </template>
  72. </el-form-item>
  73. <el-form-item
  74. v-if="queryParams.orderType === '2'"
  75. label="【调拨】调出部门"
  76. prop="allocationCallOutDepartment"
  77. >
  78. <treeselect
  79. v-model="queryParams.allocationCallOutDepartment"
  80. :options="deptOptions"
  81. placeholder="请选择【调拨】调出部门"
  82. @keyup.enter.native="handleQuery"
  83. />
  84. </el-form-item>
  85. <el-form-item
  86. v-if="queryParams.orderType === '2'"
  87. label="【调拨】调出经办人"
  88. prop="allocationCallOutBy"
  89. >
  90. <el-input
  91. v-model="queryParams.allocationCallOutBy"
  92. placeholder="请输入【调拨】调出经办人"
  93. clearable
  94. @keyup.enter.native="handleQuery"
  95. />
  96. </el-form-item>
  97. <el-form-item
  98. v-if="queryParams.orderType === '2'"
  99. label="【调拨】调出日期"
  100. prop="allocationCallOutDate"
  101. >
  102. <el-date-picker
  103. clearable
  104. v-model="queryParams.allocationCallOutDate"
  105. type="date"
  106. value-format="yyyy-MM-dd"
  107. placeholder="请选择【调拨】调出日期"
  108. >
  109. </el-date-picker>
  110. </el-form-item>
  111. <el-form-item
  112. v-if="queryParams.orderType === '2'"
  113. label="【调拨】调入部门"
  114. prop="allocationCallInDepartment"
  115. >
  116. <treeselect
  117. v-model="queryParams.allocationCallInDepartment"
  118. :options="deptOptions"
  119. placeholder="请选择【调拨】调入部门"
  120. @keyup.enter.native="handleQuery"
  121. />
  122. </el-form-item>
  123. <el-form-item
  124. v-if="queryParams.orderType === '2'"
  125. label="【调拨】调入经办人"
  126. prop="allocationCallInBy"
  127. >
  128. <el-input
  129. v-model="queryParams.allocationCallInBy"
  130. placeholder="请输入【调拨】调入经办人"
  131. clearable
  132. @keyup.enter.native="handleQuery"
  133. />
  134. </el-form-item>
  135. <el-form-item
  136. v-if="queryParams.orderType === '2'"
  137. label="【调拨】调入日期"
  138. prop="allocationCallInDate"
  139. >
  140. <el-date-picker
  141. clearable
  142. v-model="queryParams.allocationCallInDate"
  143. type="date"
  144. value-format="yyyy-MM-dd"
  145. placeholder="请选择【调拨】调入日期"
  146. >
  147. </el-date-picker>
  148. </el-form-item>
  149. <el-form-item
  150. v-if="queryParams.orderType === '3'"
  151. label="【借出】借出部门"
  152. prop="lendDepartment"
  153. >
  154. <treeselect
  155. v-model="queryParams.lendDepartment"
  156. :options="deptOptions"
  157. placeholder="请选择【借出】借出部门"
  158. @keyup.enter.native="handleQuery"
  159. />
  160. </el-form-item>
  161. <el-form-item
  162. v-if="queryParams.orderType === '3'"
  163. label="【借出】经手人"
  164. prop="lendBySponsor"
  165. >
  166. <el-input
  167. v-model="queryParams.lendBySponsor"
  168. placeholder="请输入【借出】经手人"
  169. clearable
  170. @keyup.enter.native="handleQuery"
  171. />
  172. </el-form-item>
  173. <el-form-item
  174. v-if="queryParams.orderType === '3'"
  175. label="【借出】往来单位"
  176. prop="lendPassingUnit"
  177. >
  178. <el-input
  179. v-model="queryParams.lendPassingUnit"
  180. placeholder="请输入【借出】往来单位"
  181. clearable
  182. @keyup.enter.native="handleQuery"
  183. />
  184. </el-form-item>
  185. <!-- <el-form-item label="原因说明" prop="reason">
  186. <el-input
  187. v-model="queryParams.reason"
  188. placeholder="请输入原因说明"
  189. clearable
  190. @keyup.enter.native="handleQuery"
  191. />
  192. </el-form-item> -->
  193. <el-form-item label="制单人" prop="preparedBy">
  194. <el-input
  195. v-model="queryParams.preparedBy"
  196. placeholder="请输入制单人"
  197. clearable
  198. @keyup.enter.native="handleQuery"
  199. />
  200. </el-form-item>
  201. <el-form-item label="制单部门" prop="preparedDepartment">
  202. <treeselect
  203. v-model="queryParams.preparedDepartment"
  204. :options="deptOptions"
  205. placeholder="请选择制单部门"
  206. @keyup.enter.native="handleQuery"
  207. />
  208. </el-form-item>
  209. <el-form-item label="所属公司" prop="corporation">
  210. <treeselect
  211. v-model="queryParams.corporation"
  212. :options="deptOptions"
  213. placeholder="请选择所属公司"
  214. @keyup.enter.native="handleQuery"
  215. />
  216. </el-form-item>
  217. <el-form-item label="记录状态" prop="recordStatus">
  218. <el-select
  219. v-model="queryParams.recordStatus"
  220. placeholder="请选择记录状态"
  221. clearable
  222. >
  223. <el-option
  224. v-for="dict in dict.type.asset_record_status"
  225. :key="dict.value"
  226. :label="dict.label"
  227. :value="dict.value"
  228. />
  229. </el-select>
  230. </el-form-item>
  231. <el-form-item>
  232. <el-button
  233. type="primary"
  234. icon="el-icon-search"
  235. size="mini"
  236. @click="handleQuery"
  237. >搜索</el-button
  238. >
  239. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  240. >重置</el-button
  241. >
  242. </el-form-item>
  243. </el-form>
  244. <el-row :gutter="10" class="mb8">
  245. <el-col :span="1.5">
  246. <el-button
  247. type="primary"
  248. plain
  249. icon="el-icon-plus"
  250. size="mini"
  251. @click="handleAdd"
  252. v-hasPermi="['order:order:add']"
  253. >新增</el-button
  254. >
  255. </el-col>
  256. <el-col :span="1.5">
  257. <el-button
  258. type="success"
  259. plain
  260. icon="el-icon-edit"
  261. size="mini"
  262. :disabled="single"
  263. @click="handleUpdate"
  264. v-hasPermi="['order:order:edit']"
  265. >修改</el-button
  266. >
  267. </el-col>
  268. <el-col :span="1.5">
  269. <el-dropdown
  270. size="mini"
  271. split-button
  272. type="primary"
  273. @click="handleAudit"
  274. @command="handleCommand"
  275. v-hasPermi="['order:order:aduit']"
  276. >
  277. 审批
  278. <el-dropdown-menu slot="dropdown">
  279. <el-dropdown-item
  280. @click="handleWithdraw"
  281. v-hasPermi="['order:order:audit']"
  282. command="a"
  283. >撤回</el-dropdown-item
  284. >
  285. </el-dropdown-menu>
  286. </el-dropdown>
  287. </el-col>
  288. <el-col :span="1.5">
  289. <el-button
  290. type="danger"
  291. plain
  292. icon="el-icon-delete"
  293. size="mini"
  294. :disabled="multiple"
  295. @click="handleDelete"
  296. v-hasPermi="['order:order:remove']"
  297. >删除</el-button
  298. >
  299. </el-col>
  300. <el-col :span="1.5">
  301. <el-button
  302. type="warning"
  303. plain
  304. icon="el-icon-download"
  305. size="mini"
  306. @click="handleExport"
  307. v-hasPermi="['order:order:export']"
  308. >导出</el-button
  309. >
  310. </el-col>
  311. <right-toolbar
  312. :showSearch.sync="showSearch"
  313. @queryTable="getList"
  314. ></right-toolbar>
  315. </el-row>
  316. <el-table
  317. ref="table"
  318. v-loading="loading"
  319. :data="orderList"
  320. @selection-change="handleSelectionChange"
  321. >
  322. <el-table-column type="selection" width="55" align="center" />
  323. <el-table-column label="序号" type="index" width="50"> </el-table-column>
  324. <!-- <el-table-column label="编号" align="center" prop="id" /> -->
  325. <el-table-column label="单据编号" align="center" prop="orderNumber" />
  326. <el-table-column label="单据类型" align="center" prop="orderType">
  327. <template slot-scope="scope">
  328. <dict-tag
  329. :options="dict.type.asset_order_type"
  330. :value="scope.row.orderType"
  331. />
  332. </template>
  333. </el-table-column>
  334. <el-table-column
  335. label="申请日期"
  336. align="center"
  337. prop="applicationDate"
  338. width="180"
  339. >
  340. <template slot-scope="scope">
  341. <span>{{ parseTime(scope.row.applicationDate, "{y}-{m}-{d}") }}</span>
  342. </template>
  343. </el-table-column>
  344. <el-table-column
  345. label="申请部门"
  346. align="center"
  347. prop="applicationDepartmentName"
  348. />
  349. <el-table-column
  350. v-if="queryParams.orderType !== '1'"
  351. label="资产总原值"
  352. align="center"
  353. prop="assetTotalOriginalValue"
  354. >
  355. <template slot-scope="scope">
  356. <div>{{ scope.row.assetTotalOriginalValue }}</div>
  357. </template>
  358. </el-table-column>
  359. <el-table-column
  360. v-if="queryParams.orderType !== '1'"
  361. label="资产总净值"
  362. align="center"
  363. prop="assetTotalNetValue"
  364. >
  365. <template slot-scope="scope">
  366. <div>{{ scope.row.assetTotalNetValue }}</div>
  367. </template>
  368. </el-table-column>
  369. <el-table-column
  370. v-if="queryParams.orderType === '1'"
  371. label="【调整】资产编号"
  372. align="center"
  373. prop="adjustmentAssetNumber"
  374. >
  375. <template slot-scope="scope">
  376. <span>{{ scope.row.adjustmentAssetNumber != null ? getAssetName(scope.row.adjustmentAssetNumber) : ""}}</span>
  377. </template>
  378. </el-table-column>
  379. <el-table-column
  380. v-if="queryParams.orderType === '1'"
  381. label="【调整】资产原信息"
  382. align="center"
  383. prop="adjustmentOriginalAssetInfo"
  384. >
  385. <template slot-scope="scope">
  386. <el-button
  387. v-if="queryParams.orderType === '1'"
  388. type="text"
  389. icon="el-icon-search"
  390. @click="onSelectOriginalAssetInfo(scope.row)"
  391. >查看</el-button
  392. >
  393. </template>
  394. </el-table-column>
  395. <el-table-column
  396. v-if="queryParams.orderType === '2'"
  397. label="【调拨】调出部门"
  398. align="center"
  399. prop="allocationCallOutDepartmentName"
  400. />
  401. <el-table-column
  402. v-if="queryParams.orderType === '2'"
  403. label="【调拨】调出经办人"
  404. align="center"
  405. prop="allocationCallOutBy"
  406. />
  407. <el-table-column
  408. v-if="queryParams.orderType === '2'"
  409. label="【调拨】调出日期"
  410. align="center"
  411. prop="allocationCallOutDate"
  412. width="180"
  413. >
  414. <template slot-scope="scope">
  415. <span>{{
  416. parseTime(scope.row.allocationCallOutDate, "{y}-{m}-{d}")
  417. }}</span>
  418. </template>
  419. </el-table-column>
  420. <el-table-column
  421. v-if="queryParams.orderType === '2'"
  422. label="【调拨】调入部门"
  423. align="center"
  424. prop="allocationCallInDepartmentName"
  425. />
  426. <el-table-column
  427. v-if="queryParams.orderType === '2'"
  428. label="【调拨】调入经办人"
  429. align="center"
  430. prop="allocationCallInBy"
  431. />
  432. <el-table-column
  433. v-if="queryParams.orderType === '2'"
  434. label="【调拨】调入日期"
  435. align="center"
  436. prop="allocationCallInDate"
  437. width="180"
  438. >
  439. <template slot-scope="scope">
  440. <span>{{
  441. parseTime(scope.row.allocationCallInDate, "{y}-{m}-{d}")
  442. }}</span>
  443. </template>
  444. </el-table-column>
  445. <el-table-column
  446. v-if="queryParams.orderType === '3'"
  447. label="【借出】借出部门"
  448. align="center"
  449. prop="lendDepartmentName"
  450. />
  451. <el-table-column
  452. v-if="queryParams.orderType === '3'"
  453. label="【借出】经手人"
  454. align="center"
  455. prop="lendBySponsor"
  456. />
  457. <el-table-column
  458. v-if="queryParams.orderType === '3'"
  459. label="【借出】往来单位"
  460. align="center"
  461. prop="lendPassingUnitName"
  462. />
  463. <el-table-column label="原因说明" align="center" prop="reason" />
  464. <el-table-column label="制单人" align="center" prop="preparedBy" />
  465. <el-table-column
  466. label="制单部门"
  467. align="center"
  468. prop="preparedDepartmentName"
  469. />
  470. <el-table-column label="所属公司" align="center" prop="corporationName" />
  471. <el-table-column label="记录状态" align="center" prop="recordStatus">
  472. <template slot-scope="scope">
  473. <dict-tag
  474. :options="dict.type.asset_record_status"
  475. :value="scope.row.recordStatus"
  476. />
  477. </template>
  478. </el-table-column>
  479. <el-table-column
  480. label="操作"
  481. align="center"
  482. class-name="small-padding fixed-width"
  483. fixed="right"
  484. >
  485. <template slot-scope="scope">
  486. <el-button
  487. v-if="queryParams.orderType !== '1'"
  488. size="mini"
  489. type="text"
  490. icon="el-icon-document"
  491. @click="onSelectopenDetail(scope.row)"
  492. v-hasPermi="['order:order:edit']"
  493. >明细</el-button
  494. >
  495. <el-button
  496. :disabled="scope.row.recordStatus > 0"
  497. size="mini"
  498. type="text"
  499. icon="el-icon-edit"
  500. @click="handleUpdate(scope.row)"
  501. v-hasPermi="['order:order:edit']"
  502. >修改</el-button
  503. >
  504. <el-button
  505. :disabled="scope.row.recordStatus > 0"
  506. size="mini"
  507. type="text"
  508. icon="el-icon-delete"
  509. @click="handleDelete(scope.row)"
  510. v-hasPermi="['order:order:remove']"
  511. >删除</el-button
  512. >
  513. </template>
  514. </el-table-column>
  515. </el-table>
  516. <pagination
  517. v-show="total > 0"
  518. :total="total"
  519. :page.sync="queryParams.pageNum"
  520. :limit.sync="queryParams.pageSize"
  521. @pagination="getList"
  522. />
  523. <!-- 添加或修改资产单据对话框 -->
  524. <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
  525. <el-form ref="form" :model="form" :rules="rules" label-width="140px">
  526. <el-form-item label="单据编号" prop="orderNumber">
  527. <el-input
  528. v-model="form.orderNumber"
  529. placeholder="单据编号(系统自动生成)"
  530. disabled
  531. />
  532. </el-form-item>
  533. <el-form-item label="单据类型" prop="orderType">
  534. <el-select
  535. v-model="form.orderType"
  536. placeholder="请选择单据类型"
  537. @change="onFormTypeChange"
  538. >
  539. <el-option
  540. v-for="dict in dict.type.asset_order_type"
  541. :key="dict.value"
  542. :label="dict.label"
  543. :value="parseInt(dict.value)"
  544. ></el-option>
  545. </el-select>
  546. </el-form-item>
  547. <!-- <el-form-item v-if="form.orderType !== 1" label="资产总原值" prop="assetTotalOriginalValue">
  548. <el-input v-model="form.assetTotalOriginalValue" placeholder="资产总原值(系统自动补充)" disabled/>
  549. </el-form-item>
  550. <el-form-item v-if="form.orderType !== 1" label="资产总净值" prop="assetTotalNetValue">
  551. <el-input v-model="form.assetTotalNetValue" placeholder="资产总净值(系统自动补充)" disabled/>
  552. </el-form-item> -->
  553. <el-form-item label="申请日期" prop="applicationDate">
  554. <el-date-picker
  555. clearable
  556. v-model="form.applicationDate"
  557. type="date"
  558. value-format="yyyy-MM-dd"
  559. placeholder="请选择申请日期"
  560. >
  561. </el-date-picker>
  562. </el-form-item>
  563. <el-form-item label="申请部门" prop="applicationDepartment">
  564. <treeselect
  565. v-model="form.applicationDepartment"
  566. :options="deptOptions"
  567. placeholder="请选择申请部门"
  568. @keyup.enter.native="handleQuery"
  569. />
  570. </el-form-item>
  571. <el-form-item
  572. v-if="form.orderType === 1"
  573. label="【调整】资产编号"
  574. prop="adjustmentAssetNumber"
  575. >
  576. <template>
  577. <el-select
  578. v-model="form.adjustmentAssetNumber"
  579. filterable
  580. placeholder="请输入资产编号"
  581. >
  582. <el-option
  583. v-for="item in informationList"
  584. :key="item.number"
  585. :label="item.name"
  586. :value="item.number"
  587. >
  588. </el-option>
  589. </el-select>
  590. </template>
  591. </el-form-item>
  592. <el-form-item
  593. v-if="form.orderType === 1"
  594. label="【调整】资产原信息"
  595. prop="adjustmentOriginalAssetInfo"
  596. >
  597. <el-input
  598. v-model="form.adjustmentOriginalAssetInfo"
  599. type="textarea"
  600. placeholder="系统自动补充"
  601. disabled
  602. />
  603. </el-form-item>
  604. <el-form-item
  605. v-if="form.orderType === 2"
  606. label="【调拨】调出部门"
  607. prop="allocationCallOutDepartment"
  608. >
  609. <treeselect
  610. v-model="form.allocationCallOutDepartment"
  611. :options="deptOptions"
  612. placeholder="请选择【调拨】调出部门"
  613. @keyup.enter.native="handleQuery"
  614. />
  615. </el-form-item>
  616. <el-form-item
  617. v-if="form.orderType === 2"
  618. label="【调拨】调出经办人"
  619. prop="allocationCallOutBy"
  620. >
  621. <el-input
  622. v-model="form.allocationCallOutBy"
  623. placeholder="请输入【调拨】调出经办人"
  624. />
  625. </el-form-item>
  626. <el-form-item
  627. v-if="form.orderType === 2"
  628. label="【调拨】调出日期"
  629. prop="allocationCallOutDate"
  630. >
  631. <el-date-picker
  632. clearable
  633. v-model="form.allocationCallOutDate"
  634. type="date"
  635. value-format="yyyy-MM-dd"
  636. placeholder="请选择【调拨】调出日期"
  637. >
  638. </el-date-picker>
  639. </el-form-item>
  640. <el-form-item
  641. v-if="form.orderType === 2"
  642. label="【调拨】调入部门"
  643. prop="allocationCallInDepartment"
  644. >
  645. <treeselect
  646. v-model="form.allocationCallInDepartment"
  647. :options="deptOptions"
  648. placeholder="请选择【调拨】调入部门"
  649. @keyup.enter.native="handleQuery"
  650. />
  651. </el-form-item>
  652. <el-form-item
  653. v-if="form.orderType === 2"
  654. label="【调拨】调入经办人"
  655. prop="allocationCallInBy"
  656. >
  657. <el-input
  658. v-model="form.allocationCallInBy"
  659. placeholder="请输入【调拨】调入经办人"
  660. />
  661. </el-form-item>
  662. <el-form-item
  663. v-if="form.orderType === 2"
  664. label="【调拨】调入日期"
  665. prop="allocationCallInDate"
  666. >
  667. <el-date-picker
  668. clearable
  669. v-model="form.allocationCallInDate"
  670. type="date"
  671. value-format="yyyy-MM-dd"
  672. placeholder="请选择【调拨】调入日期"
  673. >
  674. </el-date-picker>
  675. </el-form-item>
  676. <el-form-item
  677. v-if="form.orderType === 3"
  678. label="【借出】借出部门"
  679. prop="lendDepartment"
  680. >
  681. <treeselect
  682. v-model="form.lendDepartment"
  683. :options="deptOptions"
  684. placeholder="请选择【借出】借出部门"
  685. @keyup.enter.native="handleQuery"
  686. />
  687. </el-form-item>
  688. <el-form-item
  689. v-if="form.orderType === 3"
  690. label="【借出】经手人"
  691. prop="lendBySponsor"
  692. >
  693. <el-input
  694. v-model="form.lendBySponsor"
  695. placeholder="请输入【借出】经手人"
  696. />
  697. </el-form-item>
  698. <el-form-item
  699. v-if="form.orderType === 3"
  700. label="【借出】往来单位"
  701. prop="lendPassingUnit"
  702. >
  703. <treeselect
  704. v-model="form.lendPassingUnit"
  705. :options="deptOptions"
  706. placeholder="请选择【调拨】调入部门"
  707. @keyup.enter.native="handleQuery"
  708. />
  709. </el-form-item>
  710. <el-form-item label="原因说明" prop="reason">
  711. <el-input v-model="form.reason" placeholder="请输入原因说明" />
  712. </el-form-item>
  713. <!-- <el-form-item label="制单人" prop="preparedBy">
  714. <el-input v-model="form.preparedBy" placeholder="系统自动补充" disabled />
  715. </el-form-item>
  716. <el-form-item label="制单部门" prop="preparedDepartment">
  717. <el-input v-model="form.preparedDepartment" placeholder="系统自动补充" disabled />
  718. </el-form-item>
  719. <el-form-item label="所属公司" prop="corporation">
  720. <el-input v-model="form.corporation" placeholder="系统自动补充" disabled />
  721. </el-form-item> -->
  722. <!-- <el-form-item label="记录状态" prop="recordStatus">
  723. <el-select v-model="form.recordStatus" placeholder="请选择记录状态">
  724. <el-option
  725. v-for="dict in dict.type.asset_record_status"
  726. :key="dict.value"
  727. :label="dict.label"
  728. :value="parseInt(dict.value)"
  729. ></el-option>
  730. </el-select>
  731. </el-form-item> -->
  732. </el-form>
  733. <p class="msg" v-if="form.orderType !== 1">
  734. <i class="el-icon-info"></i> 保存生成单据后,记得完善单据明细后再提交哦
  735. </p>
  736. <div slot="footer" class="dialog-footer">
  737. <el-button
  738. v-if="form.orderType === 1 || form.existDetail"
  739. type="warning"
  740. @click="submitForm(1)"
  741. >提 交</el-button
  742. >
  743. <el-button type="primary" @click="submitForm(0)">保 存</el-button>
  744. <el-button @click="cancel">取 消</el-button>
  745. </div>
  746. </el-dialog>
  747. <!-- 【调整】资产信息 -->
  748. <el-dialog
  749. title="资产调整信息"
  750. :visible.sync="openAdjustment"
  751. width="900px"
  752. append-to-body
  753. >
  754. <AssetInfo
  755. :title="'现资产信息'"
  756. :assetInfo="adjustmentAssetInformation"
  757. />
  758. <div style="height: 20px"></div>
  759. <AssetInfo
  760. :title="'资产原信息'"
  761. :assetInfo="adjustmentOriginalAssetInfo"
  762. />
  763. </el-dialog>
  764. <el-dialog
  765. title="单据详细信息"
  766. :visible.sync="openDetail"
  767. width="1300px"
  768. append-to-body
  769. >
  770. <OrderDetail v-if="openDetail" :orderInfo="orderInfo" />
  771. </el-dialog>
  772. </div>
  773. </template>
  774. <script>
  775. import {
  776. listOrder,
  777. getOrder,
  778. delOrder,
  779. addOrder,
  780. updateOrder,
  781. auditMoreOrder,
  782. withdrawMoreOrder
  783. } from "@/api/order/order";
  784. import { deptTreeSelect } from "@/api/system/user";
  785. import Treeselect from "@riophae/vue-treeselect";
  786. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  787. import { auditOrder } from "@/api/order/order";
  788. import { listInformation } from "@/api/asset/information";
  789. export default {
  790. name: "Order",
  791. dicts: ["asset_order_type", "asset_record_status"],
  792. components: {
  793. AssetInfo: () => import("@/components/asset/assetCard.vue"),
  794. OrderDetail: () => import("@/views/order/detail/index.vue"),
  795. Treeselect,
  796. },
  797. data() {
  798. return {
  799. // 遮罩层
  800. loading: true,
  801. // 选中数组
  802. ids: [],
  803. // 非单个禁用
  804. single: true,
  805. // 非多个禁用
  806. multiple: true,
  807. // 显示搜索条件
  808. showSearch: true,
  809. // 总条数
  810. total: 0,
  811. // 资产信息表格数据
  812. informationList: [],
  813. // 资产单据表格数据
  814. orderList: [],
  815. orderType: 1,
  816. // 资产原信息
  817. openAdjustment: false,
  818. adjustmentOriginalAssetInfo: null,
  819. adjustmentAssetInformation: null,
  820. // 单据详细
  821. openDetail: false,
  822. orderInfo: null,
  823. // 部门树选项
  824. deptOptions: [],
  825. // 弹出层标题
  826. title: "",
  827. // 是否显示弹出层
  828. open: false,
  829. // 查询参数
  830. queryParams: {
  831. pageNum: 1,
  832. pageSize: 10,
  833. orderNumber: null,
  834. orderType: "1",
  835. applicationDate: null,
  836. applicationDepartment: null,
  837. adjustmentAssetNumber: null,
  838. allocationCallOutDepartment: null,
  839. allocationCallOutBy: null,
  840. allocationCallOutDate: null,
  841. allocationCallInDepartment: null,
  842. allocationCallInBy: null,
  843. allocationCallInDate: null,
  844. lendDepartment: null,
  845. lendBySponsor: null,
  846. lendPassingUnit: null,
  847. reason: null,
  848. preparedBy: null,
  849. preparedDepartment: null,
  850. corporation: null,
  851. recordStatus: null,
  852. },
  853. orderType: null,
  854. // 表单参数
  855. form: {},
  856. // 表单校验
  857. rules: {
  858. // orderNumber: [
  859. // { required: true, message: "单据编号不能为空", trigger: "blur" }
  860. // ],
  861. orderType: [
  862. { required: true, message: "单据类型不能为空", trigger: "change" },
  863. ],
  864. // assetTotalOriginalValue: [
  865. // { required: true, message: "资产总原值不能为空", trigger: "blur" }
  866. // ],
  867. // assetTotalNetValue: [
  868. // { required: true, message: "资产总净值不能为空", trigger: "blur" }
  869. // ],
  870. // preparedBy: [
  871. // { required: true, message: "制单人不能为空", trigger: "blur" }
  872. // ],
  873. // preparedDepartment: [
  874. // { required: true, message: "制单部门不能为空", trigger: "blur" }
  875. // ],
  876. // corporation: [
  877. // { required: true, message: "所属公司不能为空", trigger: "blur" }
  878. // ],
  879. reason: [
  880. { required: true, message: "原因说明不能为空", trigger: "blur" },
  881. ],
  882. recordStatus: [
  883. { required: true, message: "记录状态不能为空", trigger: "change" },
  884. ],
  885. },
  886. };
  887. },
  888. created() {
  889. this.orderType = 1;
  890. this.getDeptTree();
  891. this.getList();
  892. },
  893. methods: {
  894. /** 查询资产单据列表 */
  895. getList() {
  896. this.loading = true;
  897. listInformation().then((response) => {
  898. this.informationList = response.rows;
  899. });
  900. listOrder(this.queryParams).then((response) => {
  901. this.orderList = response.rows;
  902. console.log("单据列表", this.orderList);
  903. this.total = response.total;
  904. this.loading = false;
  905. });
  906. },
  907. /** 查询部门下拉树结构 */
  908. getDeptTree() {
  909. deptTreeSelect().then((response) => {
  910. this.deptOptions = response.data;
  911. });
  912. },
  913. getAssetName(val){
  914. let arr = this.informationList.filter(item => item.number===val);
  915. return arr[0].name
  916. },
  917. // 取消按钮
  918. cancel() {
  919. this.open = false;
  920. this.reset();
  921. },
  922. onSelectOriginalAssetInfo(row) {
  923. this.adjustmentAssetInformation = row.adjustmentAssetInformation;
  924. const json = JSON.parse(row.adjustmentOriginalAssetInfo);
  925. this.adjustmentOriginalAssetInfo = json;
  926. this.openAdjustment = true;
  927. console.log("资产原信息:", json);
  928. },
  929. onSelectopenDetail(order) {
  930. this.orderInfo = order;
  931. console.log("单据信息:", order);
  932. this.openDetail = true;
  933. },
  934. onQueryTypeChange() {
  935. this.orderType = Number(this.queryParams.orderType);
  936. (this.queryParams.assetTotalOriginalValue = null),
  937. (this.queryParams.assetTotalNetValue = null),
  938. (this.queryParams.adjustmentAssetNumber = null),
  939. (this.queryParams.adjustmentOriginalAssetInfo = null),
  940. (this.queryParams.allocationCallOutDepartment = null),
  941. (this.queryParams.allocationCallOutBy = null),
  942. (this.queryParams.allocationCallOutDate = null),
  943. (this.queryParams.allocationCallInDepartment = null),
  944. (this.queryParams.allocationCallInBy = null),
  945. (this.queryParams.allocationCallInDate = null),
  946. (this.queryParams.allocationNewResponsiblePerson = null),
  947. (this.queryParams.allocationNewLocationNumber = null),
  948. (this.queryParams.lendDepartment = null),
  949. (this.queryParams.lendBySponsor = null),
  950. (this.queryParams.lendPassingUnit = null);
  951. this.handleQuery();
  952. },
  953. onFormTypeChange() {
  954. (this.form.assetTotalOriginalValue = null),
  955. (this.form.assetTotalNetValue = null),
  956. (this.form.adjustmentAssetNumber = null),
  957. (this.form.adjustmentOriginalAssetInfo = null),
  958. (this.form.allocationCallOutDepartment = null),
  959. (this.form.allocationCallOutBy = null),
  960. (this.form.allocationCallOutDate = null),
  961. (this.form.allocationCallInDepartment = null),
  962. (this.form.allocationCallInBy = null),
  963. (this.form.allocationCallInDate = null),
  964. (this.form.allocationNewResponsiblePerson = null),
  965. (this.form.allocationNewLocationNumber = null),
  966. (this.form.lendDepartment = null),
  967. (this.form.lendBySponsor = null),
  968. (this.form.lendPassingUnit = null);
  969. },
  970. // 表单重置
  971. reset() {
  972. this.form = {
  973. id: null,
  974. orderNumber: null,
  975. orderType: null,
  976. assetTotalOriginalValue: null,
  977. assetTotalNetValue: null,
  978. applicationDate: null,
  979. applicationDepartment: null,
  980. adjustmentAssetNumber: null,
  981. adjustmentOriginalAssetInfo: null,
  982. allocationCallOutDepartment: null,
  983. allocationCallOutBy: null,
  984. allocationCallOutDate: null,
  985. allocationCallInDepartment: null,
  986. allocationCallInBy: null,
  987. allocationCallInDate: null,
  988. allocationNewResponsiblePerson: null,
  989. allocationNewLocationNumber: null,
  990. lendDepartment: null,
  991. lendBySponsor: null,
  992. lendPassingUnit: null,
  993. reason: null,
  994. preparedBy: null,
  995. preparedDepartment: null,
  996. corporation: null,
  997. recordStatus: null,
  998. };
  999. this.resetForm("form");
  1000. },
  1001. /** 搜索按钮操作 */
  1002. handleQuery() {
  1003. this.queryParams.pageNum = 1;
  1004. this.getList();
  1005. },
  1006. /** 重置按钮操作 */
  1007. resetQuery() {
  1008. this.resetForm("queryForm");
  1009. this.handleQuery();
  1010. },
  1011. // 多选框选中数据
  1012. handleSelectionChange(selection) {
  1013. selection.forEach((item) => {
  1014. if (item.recordStatus > 0) {
  1015. this.$modal.msgWarning("已提交单据不可修改/删除");
  1016. //this.$refs.table.toggleRowSelection(item, false);
  1017. }
  1018. });
  1019. //selection = selection.filter((item) => item.recordStatus < 1);
  1020. this.ids = selection.map((item) => item.id);
  1021. this.single = selection.length !== 1;
  1022. this.multiple = !selection.length;
  1023. },
  1024. /** 新增按钮操作 */
  1025. handleAdd() {
  1026. this.reset();
  1027. this.form.orderType = this.orderType;
  1028. // 默认未提交
  1029. this.form.recordStatus = 0;
  1030. this.open = true;
  1031. this.title = "添加资产单据";
  1032. },
  1033. /** 修改按钮操作 */
  1034. handleUpdate(row) {
  1035. this.reset();
  1036. const id = row.id || this.ids;
  1037. getOrder(id).then((response) => {
  1038. this.form = response.data;
  1039. console.log("修改表单信息:", this.form);
  1040. if (response.data.recordStatus > 0) {
  1041. this.$modal.msgWarning("已提交单据不可修改");
  1042. return;
  1043. }
  1044. this.open = true;
  1045. this.title = "修改资产单据";
  1046. });
  1047. },
  1048. /**审批撤回按钮 */
  1049. handleAudit() {
  1050. this.reset();
  1051. console.log( this.ids)
  1052. auditMoreOrder(this.ids).then((response) => {
  1053. this.$modal.msgSuccess("审批通过");
  1054. this.getList();
  1055. });
  1056. },
  1057. handleWithdraw() {
  1058. this.reset();
  1059. console.log( this.ids)
  1060. withdrawMoreOrder(this.ids).then((response) => {
  1061. this.$modal.msgSuccess("撤回成功");
  1062. this.getList();
  1063. });
  1064. },
  1065. handleCommand(command){
  1066. if(command === 'a'){
  1067. this.handleWithdraw()
  1068. }
  1069. },
  1070. /** 提交按钮 */
  1071. submitForm(recordStatus) {
  1072. this.$refs["form"].validate((valid) => {
  1073. if (valid) {
  1074. if (this.form.id != null) {
  1075. this.form.recordStatus = recordStatus;
  1076. updateOrder(this.form).then((response) => {
  1077. this.$modal.msgSuccess("修改成功");
  1078. this.open = false;
  1079. this.getList();
  1080. });
  1081. } else {
  1082. this.form.recordStatus = recordStatus;
  1083. addOrder(this.form).then((response) => {
  1084. this.$modal.msgSuccess("新增成功");
  1085. this.open = false;
  1086. this.getList();
  1087. });
  1088. }
  1089. }
  1090. });
  1091. },
  1092. /** 删除按钮操作 */
  1093. handleDelete(row) {
  1094. const ids = row.id || this.ids;
  1095. this.$modal
  1096. .confirm('是否确认删除资产单据编号为"' + ids + '"的数据项?')
  1097. .then(function () {
  1098. return delOrder(ids);
  1099. })
  1100. .then(() => {
  1101. this.getList();
  1102. this.$modal.msgSuccess("删除成功");
  1103. })
  1104. .catch(() => {});
  1105. },
  1106. /** 导出按钮操作 */
  1107. handleExport() {
  1108. this.download(
  1109. "order/order/export",
  1110. {
  1111. ...this.queryParams,
  1112. },
  1113. `order_${new Date().getTime()}.xlsx`
  1114. );
  1115. },
  1116. },
  1117. };
  1118. </script>
  1119. <style lang="less" scoped>
  1120. /deep/ .vue-treeselect {
  1121. display: inline-block;
  1122. }
  1123. .queryForm {
  1124. /deep/ .vue-treeselect {
  1125. width: 205px;
  1126. height: 32px;
  1127. }
  1128. }
  1129. .msg {
  1130. text-align: center;
  1131. color: red;
  1132. }
  1133. </style>