index.vue 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
  4. <el-form-item label="资产条码" prop="code">
  5. <el-input
  6. v-model="queryParams.code"
  7. placeholder="请输入资产条码"
  8. clearable
  9. @keyup.enter.native="handleQuery"
  10. />
  11. </el-form-item>
  12. <el-form-item label="资产名称" prop="name">
  13. <el-input
  14. v-model="queryParams.name"
  15. placeholder="请输入资产名称"
  16. clearable
  17. @keyup.enter.native="handleQuery"
  18. />
  19. </el-form-item>
  20. <el-form-item label="资产编号" prop="number">
  21. <el-input
  22. v-model="queryParams.number"
  23. placeholder="请输入资产编号"
  24. clearable
  25. @keyup.enter.native="handleQuery"
  26. />
  27. </el-form-item>
  28. <el-form-item label="资产分类" prop="categoryNumber">
  29. <el-select v-model="queryParams.categoryNumber" placeholder="请选择资产分类">
  30. <el-option
  31. v-for="item in categoryList"
  32. :key="item.number"
  33. :label="item.name"
  34. :value="parseInt(item.number)"
  35. ></el-option>
  36. </el-select>
  37. </el-form-item>
  38. <el-form-item label="规格型号" prop="specificationsModel">
  39. <el-input
  40. v-model="queryParams.specificationsModel"
  41. placeholder="请输入规格型号"
  42. clearable
  43. @keyup.enter.native="handleQuery"
  44. />
  45. </el-form-item>
  46. <el-form-item label="ABC分类" prop="abcCategory">
  47. <el-input
  48. v-model="queryParams.abcCategory"
  49. placeholder="请输入ABC分类"
  50. clearable
  51. @keyup.enter.native="handleQuery"
  52. />
  53. </el-form-item>
  54. <el-form-item label="使用部门" prop="userDepartment">
  55. <el-input
  56. v-model="queryParams.userDepartment"
  57. placeholder="请输入使用部门"
  58. clearable
  59. @keyup.enter.native="handleQuery"
  60. />
  61. </el-form-item>
  62. <el-form-item label="管理部门" prop="department">
  63. <el-input
  64. v-model="queryParams.department"
  65. placeholder="请输入管理部门"
  66. clearable
  67. @keyup.enter.native="handleQuery"
  68. />
  69. </el-form-item>
  70. <el-form-item label="责任人" prop="responsiblePerson">
  71. <el-input
  72. v-model="queryParams.responsiblePerson"
  73. placeholder="请输入责任人"
  74. clearable
  75. @keyup.enter.native="handleQuery"
  76. />
  77. </el-form-item>
  78. <el-form-item label="所在位置" prop="locationNumber">
  79. <el-select v-model="queryParams.locationNumber" placeholder="请选择所在位置">
  80. <el-option
  81. v-for="item in locationList"
  82. :key="item.number"
  83. :label="item.name"
  84. :value="parseInt(item.number)"
  85. ></el-option>
  86. </el-select>
  87. </el-form-item>
  88. <el-form-item label="资产性质" prop="property">
  89. <el-input
  90. v-model="queryParams.property"
  91. placeholder="请输入资产性质"
  92. clearable
  93. @keyup.enter.native="handleQuery"
  94. />
  95. </el-form-item>
  96. <el-form-item label="购置日期" prop="purchaseDate">
  97. <el-date-picker clearable
  98. v-model="queryParams.purchaseDate"
  99. type="date"
  100. value-format="yyyy-MM-dd"
  101. placeholder="请选择购置日期">
  102. </el-date-picker>
  103. </el-form-item>
  104. <el-form-item label="启用日期" prop="commissioningDate">
  105. <el-date-picker clearable
  106. v-model="queryParams.commissioningDate"
  107. type="date"
  108. value-format="yyyy-MM-dd"
  109. placeholder="请选择启用日期">
  110. </el-date-picker>
  111. </el-form-item>
  112. <!-- <el-form-item label="原值" prop="originalValue">
  113. <el-input
  114. v-model="queryParams.originalValue"
  115. placeholder="请输入原值"
  116. clearable
  117. @keyup.enter.native="handleQuery"
  118. />
  119. </el-form-item> -->
  120. <el-form-item label="使用年限" prop="durableYears">
  121. <el-input
  122. v-model="queryParams.durableYears"
  123. placeholder="请输入使用年限"
  124. clearable
  125. @keyup.enter.native="handleQuery"
  126. />
  127. </el-form-item>
  128. <!-- <el-form-item label="净值" prop="netValue">
  129. <el-input
  130. v-model="queryParams.netValue"
  131. placeholder="请输入净值"
  132. clearable
  133. @keyup.enter.native="handleQuery"
  134. />
  135. </el-form-item> -->
  136. <!-- <el-form-item label="残值" prop="residualValue">
  137. <el-input
  138. v-model="queryParams.residualValue"
  139. placeholder="请输入残值"
  140. clearable
  141. @keyup.enter.native="handleQuery"
  142. />
  143. </el-form-item> -->
  144. <!-- <el-form-item label="累计折旧" prop="accumulatedDepreciation">
  145. <el-input
  146. v-model="queryParams.accumulatedDepreciation"
  147. placeholder="请输入累计折旧"
  148. clearable
  149. @keyup.enter.native="handleQuery"
  150. />
  151. </el-form-item> -->
  152. <el-form-item label="最近折旧日期" prop="lastDepreciationDate">
  153. <el-date-picker clearable
  154. v-model="queryParams.lastDepreciationDate"
  155. type="date"
  156. value-format="yyyy-MM-dd"
  157. placeholder="请选择最近折旧日期">
  158. </el-date-picker>
  159. </el-form-item>
  160. <el-form-item label="折旧方式" prop="depreciationMethod">
  161. <el-input
  162. v-model="queryParams.depreciationMethod"
  163. placeholder="请输入折旧方式"
  164. clearable
  165. @keyup.enter.native="handleQuery"
  166. />
  167. </el-form-item>
  168. <el-form-item label="合同编号" prop="contractNumber">
  169. <el-input
  170. v-model="queryParams.contractNumber"
  171. placeholder="请输入合同编号"
  172. clearable
  173. @keyup.enter.native="handleQuery"
  174. />
  175. </el-form-item>
  176. <el-form-item label="出厂编号" prop="factoryNumber">
  177. <el-input
  178. v-model="queryParams.factoryNumber"
  179. placeholder="请输入出厂编号"
  180. clearable
  181. @keyup.enter.native="handleQuery"
  182. />
  183. </el-form-item>
  184. <el-form-item label="制造商" prop="manufacturer">
  185. <el-input
  186. v-model="queryParams.manufacturer"
  187. placeholder="请输入制造商"
  188. clearable
  189. @keyup.enter.native="handleQuery"
  190. />
  191. </el-form-item>
  192. <el-form-item label="供应商" prop="supplier">
  193. <el-input
  194. v-model="queryParams.supplier"
  195. placeholder="请输入供应商"
  196. clearable
  197. @keyup.enter.native="handleQuery"
  198. />
  199. </el-form-item>
  200. <el-form-item label="维保到期日期" prop="maintenanceDate">
  201. <el-date-picker clearable
  202. v-model="queryParams.maintenanceDate"
  203. type="date"
  204. value-format="yyyy-MM-dd"
  205. placeholder="请选择维保到期日期">
  206. </el-date-picker>
  207. </el-form-item>
  208. <!-- <el-form-item label="维修电话" prop="maintenanceTel">
  209. <el-input
  210. v-model="queryParams.maintenanceTel"
  211. placeholder="请输入维修电话"
  212. clearable
  213. @keyup.enter.native="handleQuery"
  214. />
  215. </el-form-item> -->
  216. <!-- <el-form-item label="维修人员" prop="maintenanceUser">
  217. <el-input
  218. v-model="queryParams.maintenanceUser"
  219. placeholder="请输入维修人员"
  220. clearable
  221. @keyup.enter.native="handleQuery"
  222. />
  223. </el-form-item> -->
  224. <el-form-item label="所属公司" prop="corporation">
  225. <el-input
  226. v-model="queryParams.corporation"
  227. placeholder="请输入所属公司"
  228. clearable
  229. @keyup.enter.native="handleQuery"
  230. />
  231. </el-form-item>
  232. <el-form-item label="记录状态" prop="recordStatus">
  233. <el-select v-model="queryParams.recordStatus" placeholder="请选择记录状态" clearable>
  234. <el-option
  235. v-for="dict in dict.type.asset_record_status"
  236. :key="dict.value"
  237. :label="dict.label"
  238. :value="dict.value"
  239. />
  240. </el-select>
  241. </el-form-item>
  242. <!-- <el-form-item label="预留字段a" prop="reservedColumnA">
  243. <el-input
  244. v-model="queryParams.reservedColumnA"
  245. placeholder="请输入预留字段a"
  246. clearable
  247. @keyup.enter.native="handleQuery"
  248. />
  249. </el-form-item>
  250. <el-form-item label="预留字段b" prop="reservedColumnB">
  251. <el-input
  252. v-model="queryParams.reservedColumnB"
  253. placeholder="请输入预留字段b"
  254. clearable
  255. @keyup.enter.native="handleQuery"
  256. />
  257. </el-form-item>
  258. <el-form-item label="预留字段c" prop="reservedColumnC">
  259. <el-input
  260. v-model="queryParams.reservedColumnC"
  261. placeholder="请输入预留字段c"
  262. clearable
  263. @keyup.enter.native="handleQuery"
  264. />
  265. </el-form-item>
  266. <el-form-item label="预留字段d" prop="reservedColumnD">
  267. <el-input
  268. v-model="queryParams.reservedColumnD"
  269. placeholder="请输入预留字段d"
  270. clearable
  271. @keyup.enter.native="handleQuery"
  272. />
  273. </el-form-item>
  274. <el-form-item label="预留字段e" prop="reservedColumnE">
  275. <el-input
  276. v-model="queryParams.reservedColumnE"
  277. placeholder="请输入预留字段e"
  278. clearable
  279. @keyup.enter.native="handleQuery"
  280. />
  281. </el-form-item>
  282. <el-form-item label="预留字段f" prop="reservedColumnF">
  283. <el-input
  284. v-model="queryParams.reservedColumnF"
  285. placeholder="请输入预留字段f"
  286. clearable
  287. @keyup.enter.native="handleQuery"
  288. />
  289. </el-form-item>
  290. <el-form-item label="预留字段g" prop="reservedColumnG">
  291. <el-input
  292. v-model="queryParams.reservedColumnG"
  293. placeholder="请输入预留字段g"
  294. clearable
  295. @keyup.enter.native="handleQuery"
  296. />
  297. </el-form-item>
  298. <el-form-item label="预留字段h" prop="reservedColumnH">
  299. <el-input
  300. v-model="queryParams.reservedColumnH"
  301. placeholder="请输入预留字段h"
  302. clearable
  303. @keyup.enter.native="handleQuery"
  304. />
  305. </el-form-item>
  306. <el-form-item label="预留字段i" prop="reservedColumnI">
  307. <el-input
  308. v-model="queryParams.reservedColumnI"
  309. placeholder="请输入预留字段i"
  310. clearable
  311. @keyup.enter.native="handleQuery"
  312. />
  313. </el-form-item>
  314. <el-form-item label="预留字段j" prop="reservedColumnJ">
  315. <el-input
  316. v-model="queryParams.reservedColumnJ"
  317. placeholder="请输入预留字段j"
  318. clearable
  319. @keyup.enter.native="handleQuery"
  320. />
  321. </el-form-item> -->
  322. <el-form-item>
  323. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  324. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  325. </el-form-item>
  326. </el-form>
  327. <el-row :gutter="10" class="mb8">
  328. <el-col :span="1.5">
  329. <el-button
  330. type="primary"
  331. plain
  332. icon="el-icon-plus"
  333. size="mini"
  334. @click="handleAdd"
  335. v-hasPermi="['asset:information:add']"
  336. >新增</el-button>
  337. </el-col>
  338. <el-col :span="1.5">
  339. <el-button
  340. type="success"
  341. plain
  342. icon="el-icon-edit"
  343. size="mini"
  344. :disabled="single"
  345. @click="handleUpdate"
  346. v-hasPermi="['asset:information:edit']"
  347. >修改</el-button>
  348. </el-col>
  349. <el-col :span="1.5">
  350. <el-button
  351. type="danger"
  352. plain
  353. icon="el-icon-delete"
  354. size="mini"
  355. :disabled="multiple"
  356. @click="handleDelete"
  357. v-hasPermi="['asset:information:remove']"
  358. >删除</el-button>
  359. </el-col>
  360. <el-col :span="1.5">
  361. <el-button
  362. type="warning"
  363. plain
  364. icon="el-icon-download"
  365. size="mini"
  366. @click="handleExport"
  367. v-hasPermi="['asset:information:export']"
  368. >导出</el-button>
  369. </el-col>
  370. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  371. </el-row>
  372. <el-table v-loading="loading" :data="informationList" @selection-change="handleSelectionChange">
  373. <el-table-column type="selection" width="55" align="center" />
  374. <!-- <el-table-column label="编号" align="center" prop="id" /> -->
  375. <el-table-column label="资产条码" align="center" prop="code" />
  376. <el-table-column label="资产名称" align="center" prop="name" />
  377. <el-table-column label="资产编号" align="center" prop="number" />
  378. <el-table-column label="照片" align="center" prop="imageUrl" width="100" >
  379. <template slot-scope="scope">
  380. <image-preview :src="scope.row.imageUrl" :width="50" :height="50" v-show="(scope.row.imageUrl===''||scope.row.imageUrl==null)?false:true"/>
  381. </template>
  382. </el-table-column>
  383. <el-table-column label="资产分类" align="center" prop="categoryNumber" >
  384. <template slot-scope="scope">
  385. <span>{{ scope.row.categoryNumber != null ? categoryName(scope.row.categoryNumber) : ""}}</span>
  386. </template>
  387. </el-table-column>
  388. <el-table-column label="规格型号" align="center" prop="specificationsModel" />
  389. <el-table-column label="ABC分类" align="center" prop="abcCategory" />
  390. <el-table-column label="管理状态" align="center" prop="manageStatus" />
  391. <el-table-column label="使用部门" align="center" prop="userDepartment" >
  392. <template slot-scope="scope">
  393. <span>{{ scope.row.userDepartment != null ? companyName(scope.row.userDepartment) : ""}}</span>
  394. </template>
  395. </el-table-column>
  396. <el-table-column label="管理部门" align="center" prop="department">
  397. <template slot-scope="scope">
  398. <span>{{ scope.row.department != null ? companyName(scope.row.department) : ""}}</span>
  399. </template>
  400. </el-table-column>
  401. <el-table-column label="责任人" align="center" prop="responsiblePerson" />
  402. <el-table-column label="所在位置" align="center" prop="locationNumber" >
  403. <template slot-scope="scope">
  404. <span>{{ scope.row.locationNumber != null ? locationName(scope.row.locationNumber) : ""}}</span>
  405. </template>
  406. </el-table-column>
  407. <el-table-column label="资产性质" align="center" prop="property" />
  408. <el-table-column label="购置日期" align="center" prop="purchaseDate" width="180">
  409. <template slot-scope="scope">
  410. <span>{{ parseTime(scope.row.purchaseDate, '{y}-{m}-{d}') }}</span>
  411. </template>
  412. </el-table-column>
  413. <el-table-column label="启用日期" align="center" prop="commissioningDate" width="180">
  414. <template slot-scope="scope">
  415. <span>{{ parseTime(scope.row.commissioningDate, '{y}-{m}-{d}') }}</span>
  416. </template>
  417. </el-table-column>
  418. <el-table-column label="原值" align="center" prop="originalValue" />
  419. <el-table-column label="使用年限" align="center" prop="durableYears" />
  420. <el-table-column label="净值" align="center" prop="netValue" />
  421. <el-table-column label="残值" align="center" prop="residualValue" />
  422. <el-table-column label="累计折旧" align="center" prop="accumulatedDepreciation" />
  423. <el-table-column label="最近折旧日期" align="center" prop="lastDepreciationDate" width="180">
  424. <template slot-scope="scope">
  425. <span>{{ parseTime(scope.row.lastDepreciationDate, '{y}-{m}-{d}') }}</span>
  426. </template>
  427. </el-table-column>
  428. <el-table-column label="折旧方式" align="center" prop="depreciationMethod" />
  429. <el-table-column label="合同编号" align="center" prop="contractNumber" />
  430. <el-table-column label="出厂编号" align="center" prop="factoryNumber" />
  431. <el-table-column label="制造商" align="center" prop="manufacturer" />
  432. <el-table-column label="供应商" align="center" prop="supplier" />
  433. <el-table-column label="资产用途" align="center" prop="purpose" />
  434. <el-table-column label="维保到期日期" align="center" prop="maintenanceDate" width="180">
  435. <template slot-scope="scope">
  436. <span>{{ parseTime(scope.row.maintenanceDate, '{y}-{m}-{d}') }}</span>
  437. </template>
  438. </el-table-column>
  439. <el-table-column label="维修电话" align="center" prop="maintenanceTel" />
  440. <el-table-column label="维修人员" align="center" prop="maintenanceUser" />
  441. <el-table-column label="所属公司" align="center" prop="corporation" >
  442. <template slot-scope="scope">
  443. <span>{{ scope.row.corporation != null ? companyName(scope.row.corporation) : ""}}</span>
  444. </template>
  445. </el-table-column>
  446. <el-table-column label="记录状态" align="center" prop="recordStatus">
  447. <template slot-scope="scope">
  448. <dict-tag :options="dict.type.asset_record_status" :value="scope.row.recordStatus"/>
  449. </template>
  450. </el-table-column>
  451. <el-table-column label="备注" align="center" prop="remark" />
  452. <el-table-column label="预留字段a" align="center" prop="reservedColumnA" />
  453. <el-table-column label="预留字段b" align="center" prop="reservedColumnB" />
  454. <el-table-column label="预留字段c" align="center" prop="reservedColumnC" />
  455. <el-table-column label="预留字段d" align="center" prop="reservedColumnD" />
  456. <el-table-column label="预留字段e" align="center" prop="reservedColumnE" />
  457. <el-table-column label="预留字段f" align="center" prop="reservedColumnF" />
  458. <el-table-column label="预留字段g" align="center" prop="reservedColumnG" />
  459. <el-table-column label="预留字段h" align="center" prop="reservedColumnH" />
  460. <el-table-column label="预留字段i" align="center" prop="reservedColumnI" />
  461. <el-table-column label="预留字段j" align="center" prop="reservedColumnJ" />
  462. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  463. <template slot-scope="scope">
  464. <el-button
  465. size="mini"
  466. type="text"
  467. icon="el-icon-edit"
  468. @click="handleUpdate(scope.row)"
  469. v-hasPermi="['asset:information:edit']"
  470. >修改</el-button>
  471. <el-button
  472. size="mini"
  473. type="text"
  474. icon="el-icon-delete"
  475. @click="handleDelete(scope.row)"
  476. v-hasPermi="['asset:information:remove']"
  477. >删除</el-button>
  478. </template>
  479. </el-table-column>
  480. </el-table>
  481. <pagination
  482. v-show="total>0"
  483. :total="total"
  484. :page.sync="queryParams.pageNum"
  485. :limit.sync="queryParams.pageSize"
  486. @pagination="getList"
  487. />
  488. <!-- 添加或修改资产信息对话框 -->
  489. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
  490. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  491. <el-form-item label="资产条码" prop="code">
  492. <el-input v-model="form.code" placeholder="请输入资产条码" />
  493. </el-form-item>
  494. <el-form-item label="资产名称" prop="name">
  495. <el-input v-model="form.name" placeholder="请输入资产名称" />
  496. </el-form-item>
  497. <el-form-item label="资产编号" prop="number">
  498. <el-input v-model="form.number" placeholder="请输入资产编号" />
  499. </el-form-item>
  500. <el-form-item label="照片">
  501. <image-upload-temp v-model="form.imageUrl" :limit="1" />
  502. </el-form-item>
  503. <el-form-item label="资产分类" prop="categoryNumber">
  504. <el-select v-model="form.categoryNumber" placeholder="请选择资产分类">
  505. <el-option
  506. v-for="item in categoryList"
  507. :key="item.number"
  508. :label="item.name"
  509. :value="item.number"
  510. ></el-option>
  511. </el-select>
  512. </el-form-item>
  513. <el-form-item label="规格型号" prop="specificationsModel">
  514. <el-input v-model="form.specificationsModel" placeholder="请输入规格型号" />
  515. </el-form-item>
  516. <el-form-item label="ABC分类" prop="abcCategory">
  517. <el-input v-model="form.abcCategory" placeholder="请输入ABC分类" />
  518. </el-form-item>
  519. <el-form-item label="使用部门" prop="userDepartment">
  520. <treeselect
  521. v-model="form.userDepartment"
  522. :options="deptOptions"
  523. :normalizer="normalizer"
  524. placeholder="选择使用部门"
  525. />
  526. </el-form-item>
  527. <el-form-item label="管理部门" prop="department">
  528. <treeselect
  529. v-model="form.department"
  530. :options="deptOptions"
  531. :normalizer="normalizer"
  532. placeholder="选择管理部门"
  533. />
  534. </el-form-item>
  535. <el-form-item label="责任人" prop="responsiblePerson">
  536. <el-input v-model="form.responsiblePerson" placeholder="请输入责任人" />
  537. </el-form-item>
  538. <el-form-item label="所在位置" prop="locationNumber">
  539. <el-select v-model="form.locationNumber" placeholder="请选择所在位置">
  540. <el-option
  541. v-for="item in locationList"
  542. :key="item.number"
  543. :label="item.name"
  544. :value="item.number"
  545. ></el-option>
  546. </el-select>
  547. </el-form-item>
  548. <el-form-item label="资产性质" prop="property">
  549. <el-input v-model="form.property" placeholder="请输入资产性质" />
  550. </el-form-item>
  551. <el-form-item label="购置日期" prop="purchaseDate">
  552. <el-date-picker clearable
  553. v-model="form.purchaseDate"
  554. type="date"
  555. value-format="yyyy-MM-dd"
  556. placeholder="请选择购置日期">
  557. </el-date-picker>
  558. </el-form-item>
  559. <el-form-item label="启用日期" prop="commissioningDate">
  560. <el-date-picker clearable
  561. v-model="form.commissioningDate"
  562. type="date"
  563. value-format="yyyy-MM-dd"
  564. placeholder="请选择启用日期">
  565. </el-date-picker>
  566. </el-form-item>
  567. <el-form-item label="原值" prop="originalValue">
  568. <el-input v-model="form.originalValue" placeholder="请输入原值" />
  569. </el-form-item>
  570. <el-form-item label="使用年限" prop="durableYears">
  571. <el-input v-model="form.durableYears" placeholder="请输入使用年限" />
  572. </el-form-item>
  573. <el-form-item label="净值" prop="netValue">
  574. <el-input v-model="form.netValue" placeholder="请输入净值" />
  575. </el-form-item>
  576. <el-form-item label="残值" prop="residualValue">
  577. <el-input v-model="form.residualValue" placeholder="请输入残值" />
  578. </el-form-item>
  579. <el-form-item label="累计折旧" prop="accumulatedDepreciation">
  580. <el-input v-model="form.accumulatedDepreciation" placeholder="请输入累计折旧" />
  581. </el-form-item>
  582. <el-form-item label="最近折旧日期" prop="lastDepreciationDate">
  583. <el-date-picker clearable
  584. v-model="form.lastDepreciationDate"
  585. type="date"
  586. value-format="yyyy-MM-dd"
  587. placeholder="请选择最近折旧日期">
  588. </el-date-picker>
  589. </el-form-item>
  590. <el-form-item label="折旧方式" prop="depreciationMethod">
  591. <el-input v-model="form.depreciationMethod" placeholder="请输入折旧方式" />
  592. </el-form-item>
  593. <el-form-item label="合同编号" prop="contractNumber">
  594. <el-input v-model="form.contractNumber" placeholder="请输入合同编号" />
  595. </el-form-item>
  596. <el-form-item label="出厂编号" prop="factoryNumber">
  597. <el-input v-model="form.factoryNumber" placeholder="请输入出厂编号" />
  598. </el-form-item>
  599. <el-form-item label="制造商" prop="manufacturer">
  600. <el-input v-model="form.manufacturer" placeholder="请输入制造商" />
  601. </el-form-item>
  602. <el-form-item label="供应商" prop="supplier">
  603. <el-input v-model="form.supplier" placeholder="请输入供应商" />
  604. </el-form-item>
  605. <el-form-item label="资产用途" prop="purpose">
  606. <el-input v-model="form.purpose" type="textarea" placeholder="请输入内容" />
  607. </el-form-item>
  608. <el-form-item label="维保到期日期" prop="maintenanceDate">
  609. <el-date-picker clearable
  610. v-model="form.maintenanceDate"
  611. type="date"
  612. value-format="yyyy-MM-dd"
  613. placeholder="请选择维保到期日期">
  614. </el-date-picker>
  615. </el-form-item>
  616. <el-form-item label="维修电话" prop="maintenanceTel">
  617. <el-input v-model="form.maintenanceTel" placeholder="请输入维修电话" />
  618. </el-form-item>
  619. <el-form-item label="维修人员" prop="maintenanceUser">
  620. <el-input v-model="form.maintenanceUser" placeholder="请输入维修人员" />
  621. </el-form-item>
  622. <el-form-item label="所属公司" prop="corporation">
  623. <treeselect
  624. v-model="form.corporation"
  625. :options="deptOptions"
  626. :normalizer="normalizer"
  627. placeholder="选择所属公司"
  628. />
  629. </el-form-item>
  630. <el-form-item label="记录状态" prop="recordStatus">
  631. <el-select v-model="form.recordStatus" placeholder="请选择记录状态">
  632. <el-option
  633. v-for="dict in dict.type.asset_record_status"
  634. :key="dict.value"
  635. :label="dict.label"
  636. :value="parseInt(dict.value)"
  637. ></el-option>
  638. </el-select>
  639. </el-form-item>
  640. <el-form-item label="备注" prop="remark">
  641. <el-input v-model="form.remark" placeholder="请输入备注" />
  642. </el-form-item>
  643. <el-form-item label="预留字段a" prop="reservedColumnA">
  644. <el-input v-model="form.reservedColumnA" placeholder="请输入预留字段a" />
  645. </el-form-item>
  646. <el-form-item label="预留字段b" prop="reservedColumnB">
  647. <el-input v-model="form.reservedColumnB" placeholder="请输入预留字段b" />
  648. </el-form-item>
  649. <el-form-item label="预留字段c" prop="reservedColumnC">
  650. <el-input v-model="form.reservedColumnC" placeholder="请输入预留字段c" />
  651. </el-form-item>
  652. <el-form-item label="预留字段d" prop="reservedColumnD">
  653. <el-input v-model="form.reservedColumnD" placeholder="请输入预留字段d" />
  654. </el-form-item>
  655. <el-form-item label="预留字段e" prop="reservedColumnE">
  656. <el-input v-model="form.reservedColumnE" placeholder="请输入预留字段e" />
  657. </el-form-item>
  658. <el-form-item label="预留字段f" prop="reservedColumnF">
  659. <el-input v-model="form.reservedColumnF" placeholder="请输入预留字段f" />
  660. </el-form-item>
  661. <el-form-item label="预留字段g" prop="reservedColumnG">
  662. <el-input v-model="form.reservedColumnG" placeholder="请输入预留字段g" />
  663. </el-form-item>
  664. <el-form-item label="预留字段h" prop="reservedColumnH">
  665. <el-input v-model="form.reservedColumnH" placeholder="请输入预留字段h" />
  666. </el-form-item>
  667. <el-form-item label="预留字段i" prop="reservedColumnI">
  668. <el-input v-model="form.reservedColumnI" placeholder="请输入预留字段i" />
  669. </el-form-item>
  670. <el-form-item label="预留字段j" prop="reservedColumnJ">
  671. <el-input v-model="form.reservedColumnJ" placeholder="请输入预留字段j" />
  672. </el-form-item>
  673. </el-form>
  674. <div slot="footer" class="dialog-footer">
  675. <el-button type="primary" @click="submitForm">确 定</el-button>
  676. <el-button @click="cancel">取 消</el-button>
  677. </div>
  678. </el-dialog>
  679. </div>
  680. </template>
  681. <script>
  682. import { listInformation, getInformation, delInformation, addInformation, updateInformation } from "@/api/asset/information";
  683. import { listCategory } from "@/api/asset/category";
  684. import { listLocation } from "@/api/asset/location";
  685. import ImageUploadTemp from "@/components/ImageUploadTemp"
  686. import { listDept } from "@/api/system/dept";
  687. import Treeselect from "@riophae/vue-treeselect";
  688. export default {
  689. name: "Information",
  690. dicts: ['asset_record_status'],
  691. components:{
  692. ImageUploadTemp,Treeselect
  693. },
  694. data() {
  695. return {
  696. // 遮罩层
  697. loading: true,
  698. // 选中数组
  699. ids: [],
  700. // 非单个禁用
  701. single: true,
  702. // 非多个禁用
  703. multiple: true,
  704. // 显示搜索条件
  705. showSearch: true,
  706. // 总条数
  707. total: 0,
  708. arr: [],
  709. // 所属位置表格数据
  710. locationList: [],
  711. // 资产分类表格数据
  712. categoryList: [],
  713. // 资产信息表格数据
  714. informationList: [],
  715. // 部门树选项
  716. deptOptions: [],
  717. // 弹出层标题
  718. title: "",
  719. // 是否显示弹出层
  720. open: false,
  721. // 查询参数
  722. queryParams: {
  723. pageNum: 1,
  724. pageSize: 10,
  725. code: null,
  726. name: null,
  727. number: null,
  728. imageUrl: null,
  729. categoryNumber: null,
  730. specificationsModel: null,
  731. abcCategory: null,
  732. manageStatus: null,
  733. userDepartment: null,
  734. department: null,
  735. responsiblePerson: null,
  736. locationNumber: null,
  737. property: null,
  738. purchaseDate: null,
  739. commissioningDate: null,
  740. originalValue: null,
  741. durableYears: null,
  742. netValue: null,
  743. residualValue: null,
  744. accumulatedDepreciation: null,
  745. lastDepreciationDate: null,
  746. depreciationMethod: null,
  747. contractNumber: null,
  748. factoryNumber: null,
  749. manufacturer: null,
  750. supplier: null,
  751. purpose: null,
  752. maintenanceDate: null,
  753. maintenanceTel: null,
  754. maintenanceUser: null,
  755. corporation: null,
  756. recordStatus: null,
  757. reservedColumnA: null,
  758. reservedColumnB: null,
  759. reservedColumnC: null,
  760. reservedColumnD: null,
  761. reservedColumnE: null,
  762. reservedColumnF: null,
  763. reservedColumnG: null,
  764. reservedColumnH: null,
  765. reservedColumnI: null,
  766. reservedColumnJ: null
  767. },
  768. // 表单参数
  769. form: {},
  770. // 表单校验
  771. rules: {
  772. number: [
  773. { required: true, message: "资产编号不能为空", trigger: "blur" }
  774. ],
  775. specificationsModel: [
  776. { required: true, message: "规格型号不能为空", trigger: "blur" }
  777. ],
  778. manageStatus: [
  779. { required: true, message: "管理状态不能为空", trigger: "change" }
  780. ],
  781. recordStatus: [
  782. { required: true, message: "记录状态不能为空", trigger: "change" }
  783. ],
  784. }
  785. };
  786. },
  787. created() {
  788. this.getList();
  789. },
  790. methods: {
  791. /** 查询资产信息列表 */
  792. getList() {
  793. this.loading = true;
  794. listDept().then((response) => {
  795. this.deptOptions = this.handleTree(response.data, "deptId");
  796. this.arr = response.data
  797. });
  798. listCategory().then(response => {
  799. this.categoryList = response.rows;
  800. });
  801. listLocation().then((response) => {
  802. this.locationList = response.rows;
  803. });
  804. listInformation(this.queryParams).then(response => {
  805. this.informationList = response.rows;
  806. this.total = response.total;
  807. this.loading = false;
  808. });
  809. },
  810. /** 转换部门数据结构 */
  811. normalizer(node) {
  812. if (node.children && !node.children.length) {
  813. delete node.children;
  814. }
  815. return {
  816. id: node.deptId,
  817. label: node.deptName,
  818. children: node.children,
  819. };
  820. },
  821. //获取公司名
  822. companyName(val){
  823. let num = parseInt(val)
  824. let arr2 = this.arr.filter(item => item.deptId===num);
  825. return arr2[0].deptName
  826. },
  827. //获取资产分类名
  828. categoryName(val){
  829. //let num = parseInt(val)
  830. let arr2 = this.categoryList.filter(item => item.number===val);
  831. return arr2[0].name
  832. },
  833. //获取所在位置名
  834. locationName(val){
  835. //let num = parseInt(val)
  836. let arr2 = this.locationList.filter(item => item.number===val);
  837. return arr2[0].name
  838. },
  839. // 取消按钮
  840. cancel() {
  841. this.open = false;
  842. this.reset();
  843. },
  844. // 表单重置
  845. reset() {
  846. this.form = {
  847. id: null,
  848. code: null,
  849. name: null,
  850. number: null,
  851. imageUrl: null,
  852. categoryNumber: null,
  853. specificationsModel: null,
  854. abcCategory: null,
  855. manageStatus: null,
  856. userDepartment: null,
  857. department: null,
  858. responsiblePerson: null,
  859. locationNumber: null,
  860. property: null,
  861. purchaseDate: null,
  862. commissioningDate: null,
  863. originalValue: null,
  864. durableYears: null,
  865. netValue: null,
  866. residualValue: null,
  867. accumulatedDepreciation: null,
  868. lastDepreciationDate: null,
  869. depreciationMethod: null,
  870. contractNumber: null,
  871. factoryNumber: null,
  872. manufacturer: null,
  873. supplier: null,
  874. purpose: null,
  875. maintenanceDate: null,
  876. maintenanceTel: null,
  877. maintenanceUser: null,
  878. corporation: null,
  879. recordStatus: null,
  880. remark: null,
  881. createBy: null,
  882. createTime: null,
  883. updateBy: null,
  884. updateTime: null,
  885. reservedColumnA: null,
  886. reservedColumnB: null,
  887. reservedColumnC: null,
  888. reservedColumnD: null,
  889. reservedColumnE: null,
  890. reservedColumnF: null,
  891. reservedColumnG: null,
  892. reservedColumnH: null,
  893. reservedColumnI: null,
  894. reservedColumnJ: null
  895. };
  896. this.resetForm("form");
  897. },
  898. /** 搜索按钮操作 */
  899. handleQuery() {
  900. this.queryParams.pageNum = 1;
  901. this.getList();
  902. },
  903. /** 重置按钮操作 */
  904. resetQuery() {
  905. this.resetForm("queryForm");
  906. this.handleQuery();
  907. },
  908. // 多选框选中数据
  909. handleSelectionChange(selection) {
  910. this.ids = selection.map(item => item.id)
  911. this.single = selection.length!==1
  912. this.multiple = !selection.length
  913. },
  914. /** 新增按钮操作 */
  915. handleAdd(row) {
  916. this.reset();
  917. if (row != undefined) {
  918. this.form.parentId = row.deptId;
  919. }
  920. this.open = true;
  921. this.title = "添加资产信息";
  922. listDept().then(response => {
  923. this.deptOptions = this.handleTree(response.data, "deptId");
  924. });
  925. },
  926. /** 修改按钮操作 */
  927. handleUpdate(row) {
  928. this.reset();
  929. const id = row.id || this.ids
  930. getInformation(id).then(response => {
  931. this.form = response.data;
  932. this.open = true;
  933. this.title = "修改资产信息";
  934. });
  935. },
  936. /** 提交按钮 */
  937. submitForm() {
  938. this.$refs["form"].validate(valid => {
  939. if (valid) {
  940. if (this.form.id != null) {
  941. updateInformation(this.form).then(response => {
  942. this.$modal.msgSuccess("修改成功");
  943. this.open = false;
  944. this.getList();
  945. });
  946. } else {
  947. addInformation(this.form).then(response => {
  948. this.$modal.msgSuccess("新增成功");
  949. this.open = false;
  950. this.getList();
  951. });
  952. }
  953. }
  954. });
  955. },
  956. /** 删除按钮操作 */
  957. handleDelete(row) {
  958. const ids = row.id || this.ids;
  959. this.$modal.confirm('是否确认删除资产信息编号为"' + ids + '"的数据项?').then(function() {
  960. return delInformation(ids);
  961. }).then(() => {
  962. this.getList();
  963. this.$modal.msgSuccess("删除成功");
  964. }).catch(() => {});
  965. },
  966. /** 导出按钮操作 */
  967. handleExport() {
  968. this.download('asset/information/export', {
  969. ...this.queryParams
  970. }, `information_${new Date().getTime()}.xlsx`)
  971. }
  972. }
  973. };
  974. </script>