index.vue 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" class="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="userDepartment">
  39. <div style="display:inline-block; width: 183px;">
  40. <treeselect
  41. v-model="queryParams.userDepartment"
  42. :options="deptOptions"
  43. :normalizer="normalizer"
  44. placeholder="选择使用部门"
  45. />
  46. </div>
  47. </el-form-item>
  48. <el-form-item label="管理部门" prop="department">
  49. <div style="display:inline-block; width: 183px;">
  50. <treeselect
  51. v-model="queryParams.department"
  52. :options="deptOptions"
  53. :normalizer="normalizer"
  54. placeholder="选择管理部门"
  55. />
  56. </div>
  57. </el-form-item>
  58. <el-form-item label="所在位置" prop="locationNumber">
  59. <treeselect v-model="queryParams.locationNumber" :options="locationList" :normalizer="tenantIdnormalizer" placeholder="选择位置" />
  60. </el-form-item>
  61. <el-form-item label="所属公司" prop="corporation">
  62. <div style="display:inline-block; width: 183px;">
  63. <treeselect
  64. v-model="queryParams.corporation"
  65. :options="deptOptions"
  66. :normalizer="normalizer"
  67. placeholder="选择所属公司"
  68. />
  69. </div>
  70. </el-form-item>
  71. <el-form-item v-if="isExist('管理状态')" label="管理状态" prop="manageStatus">
  72. <el-select v-model="queryParams.manageStatus" placeholder="请选择管理状态" clearable>
  73. <el-option
  74. v-for="dict in dict.type.sys_manger_status"
  75. :key="dict.value"
  76. :label="dict.label"
  77. :value="dict.value"
  78. />
  79. </el-select>
  80. </el-form-item>
  81. <el-form-item v-if="isExist('资产性质')" label="资产性质" prop="property">
  82. <el-select v-model="queryParams.property" placeholder="请选择资产性质" clearable>
  83. <el-option
  84. v-for="dict in dict.type.sys_asset_property"
  85. :key="dict.value"
  86. :label="dict.label"
  87. :value="dict.value"
  88. />
  89. </el-select>
  90. </el-form-item>
  91. <el-form-item v-if="isExist('规格型号')" label="规格型号" prop="specificationsModel">
  92. <el-input
  93. v-model="queryParams.specificationsModel"
  94. placeholder="请输入规格型号"
  95. clearable
  96. @keyup.enter.native="handleQuery"
  97. />
  98. </el-form-item>
  99. <el-form-item v-if="isExist('ABC分类')" label="ABC分类" prop="abcCategory">
  100. <el-input
  101. v-model="queryParams.abcCategory"
  102. placeholder="请输入ABC分类"
  103. clearable
  104. @keyup.enter.native="handleQuery"
  105. />
  106. </el-form-item>
  107. <el-form-item v-if="isExist('责任人')" label="责任人" prop="responsiblePerson">
  108. <el-input
  109. v-model="queryParams.responsiblePerson"
  110. placeholder="请输入责任人"
  111. clearable
  112. @keyup.enter.native="handleQuery"
  113. />
  114. </el-form-item>
  115. <el-form-item v-if="isExist('购置日期')" label="购置日期" prop="purchaseDate">
  116. <el-date-picker clearable
  117. v-model="queryParams.purchaseDate"
  118. type="date"
  119. value-format="yyyy-MM-dd"
  120. placeholder="请选择购置日期">
  121. </el-date-picker>
  122. </el-form-item>
  123. <el-form-item v-if="isExist('启用日期')" label="启用日期" prop="commissioningDate">
  124. <el-date-picker clearable
  125. v-model="queryParams.commissioningDate"
  126. type="date"
  127. value-format="yyyy-MM-dd"
  128. placeholder="请选择启用日期">
  129. </el-date-picker>
  130. </el-form-item>
  131. <el-form-item v-if="isExist('原值')" label="原值" prop="originalValue">
  132. <el-input
  133. v-model="queryParams.originalValue"
  134. placeholder="请输入原值"
  135. clearable
  136. @keyup.enter.native="handleQuery"
  137. />
  138. </el-form-item>
  139. <el-form-item v-if="isExist('使用年限')" label="使用年限" prop="durableYears">
  140. <el-input
  141. v-model="queryParams.durableYears"
  142. placeholder="请输入使用年限"
  143. clearable
  144. @keyup.enter.native="handleQuery"
  145. />
  146. </el-form-item>
  147. <el-form-item v-if="isExist('净值')" label="净值" prop="netValue">
  148. <el-input
  149. v-model="queryParams.netValue"
  150. placeholder="请输入净值"
  151. clearable
  152. @keyup.enter.native="handleQuery"
  153. />
  154. </el-form-item>
  155. <el-form-item v-if="isExist('残值')" label="残值" prop="residualValue">
  156. <el-input
  157. v-model="queryParams.residualValue"
  158. placeholder="请输入残值"
  159. clearable
  160. @keyup.enter.native="handleQuery"
  161. />
  162. </el-form-item>
  163. <el-form-item v-if="isExist('累计折旧')" label="累计折旧" prop="accumulatedDepreciation">
  164. <el-input
  165. v-model="queryParams.accumulatedDepreciation"
  166. placeholder="请输入累计折旧"
  167. clearable
  168. @keyup.enter.native="handleQuery"
  169. />
  170. </el-form-item>
  171. <el-form-item v-if="isExist('最近折旧日期')" label="最近折旧日期" prop="lastDepreciationDate">
  172. <el-date-picker clearable
  173. v-model="queryParams.lastDepreciationDate"
  174. type="date"
  175. value-format="yyyy-MM-dd"
  176. placeholder="请选择最近折旧日期">
  177. </el-date-picker>
  178. </el-form-item>
  179. <el-form-item v-if="isExist('折旧方式')" label="折旧方式" prop="depreciationMethod">
  180. <el-input
  181. v-model="queryParams.depreciationMethod"
  182. placeholder="请输入折旧方式"
  183. clearable
  184. @keyup.enter.native="handleQuery"
  185. />
  186. </el-form-item>
  187. <el-form-item v-if="isExist('合同编号')" label="合同编号" prop="contractNumber">
  188. <el-input
  189. v-model="queryParams.contractNumber"
  190. placeholder="请输入合同编号"
  191. clearable
  192. @keyup.enter.native="handleQuery"
  193. />
  194. </el-form-item>
  195. <el-form-item v-if="isExist('出厂编号')" label="出厂编号" prop="factoryNumber">
  196. <el-input
  197. v-model="queryParams.factoryNumber"
  198. placeholder="请输入出厂编号"
  199. clearable
  200. @keyup.enter.native="handleQuery"
  201. />
  202. </el-form-item>
  203. <el-form-item v-if="isExist('制造商')" label="制造商" prop="manufacturer">
  204. <el-input
  205. v-model="queryParams.manufacturer"
  206. placeholder="请输入制造商"
  207. clearable
  208. @keyup.enter.native="handleQuery"
  209. />
  210. </el-form-item>
  211. <el-form-item v-if="isExist('供应商')" label="供应商" prop="supplier">
  212. <el-input
  213. v-model="queryParams.supplier"
  214. placeholder="请输入供应商"
  215. clearable
  216. @keyup.enter.native="handleQuery"
  217. />
  218. </el-form-item>
  219. <el-form-item v-if="isExist('维保到期日期')" label="维保到期日期" prop="maintenanceDate">
  220. <el-date-picker clearable
  221. v-model="queryParams.maintenanceDate"
  222. type="date"
  223. value-format="yyyy-MM-dd"
  224. placeholder="请选择维保到期日期">
  225. </el-date-picker>
  226. </el-form-item>
  227. <el-form-item v-if="isExist('维修电话')" label="维修电话" prop="maintenanceTel">
  228. <el-input
  229. v-model="queryParams.maintenanceTel"
  230. placeholder="请输入维修电话"
  231. clearable
  232. @keyup.enter.native="handleQuery"
  233. />
  234. </el-form-item>
  235. <el-form-item v-if="isExist('维修人员')" label="维修人员" prop="maintenanceUser">
  236. <el-input
  237. v-model="queryParams.maintenanceUser"
  238. placeholder="请输入维修人员"
  239. clearable
  240. @keyup.enter.native="handleQuery"
  241. />
  242. </el-form-item>
  243. <el-form-item v-if="isExist('记录状态')" label="记录状态" prop="recordStatus">
  244. <el-select v-model="queryParams.recordStatus" placeholder="请选择记录状态" clearable>
  245. <el-option
  246. v-for="dict in dict.type.asset_record_status"
  247. :key="dict.value"
  248. :label="dict.label"
  249. :value="dict.value"
  250. />
  251. </el-select>
  252. </el-form-item>
  253. <el-form-item v-if="isExist('是否白名单')" label="是否白名单" prop="isWhitelist">
  254. <el-select v-model="queryParams.isWhitelist" placeholder="请选择是否白名单" clearable>
  255. <el-option
  256. v-for="dict in dict.type.sys_yes_no"
  257. :key="dict.value"
  258. :label="dict.label"
  259. :value="dict.value"
  260. />
  261. </el-select>
  262. </el-form-item>
  263. <el-form-item label="数量" prop="quantity">
  264. <el-input
  265. v-model="queryParams.quantity"
  266. placeholder="请输入数量"
  267. clearable
  268. @keyup.enter.native="handleQuery"
  269. />
  270. </el-form-item>
  271. <el-form-item label="计量单位" prop="units">
  272. <el-input
  273. v-model="queryParams.units"
  274. placeholder="请输入计量单位"
  275. clearable
  276. @keyup.enter.native="handleQuery"
  277. />
  278. </el-form-item>
  279. <!-- <el-form-item label="预留字段d" prop="reservedColumnD">
  280. <el-input
  281. v-model="queryParams.reservedColumnD"
  282. placeholder="请输入预留字段d"
  283. clearable
  284. @keyup.enter.native="handleQuery"
  285. />
  286. </el-form-item>
  287. <el-form-item label="预留字段e" prop="reservedColumnE">
  288. <el-input
  289. v-model="queryParams.reservedColumnE"
  290. placeholder="请输入预留字段e"
  291. clearable
  292. @keyup.enter.native="handleQuery"
  293. />
  294. </el-form-item>
  295. <el-form-item label="预留字段f" prop="reservedColumnF">
  296. <el-input
  297. v-model="queryParams.reservedColumnF"
  298. placeholder="请输入预留字段f"
  299. clearable
  300. @keyup.enter.native="handleQuery"
  301. />
  302. </el-form-item>
  303. <el-form-item label="预留字段g" prop="reservedColumnG">
  304. <el-input
  305. v-model="queryParams.reservedColumnG"
  306. placeholder="请输入预留字段g"
  307. clearable
  308. @keyup.enter.native="handleQuery"
  309. />
  310. </el-form-item>
  311. <el-form-item label="预留字段h" prop="reservedColumnH">
  312. <el-input
  313. v-model="queryParams.reservedColumnH"
  314. placeholder="请输入预留字段h"
  315. clearable
  316. @keyup.enter.native="handleQuery"
  317. />
  318. </el-form-item>
  319. <el-form-item label="预留字段i" prop="reservedColumnI">
  320. <el-input
  321. v-model="queryParams.reservedColumnI"
  322. placeholder="请输入预留字段i"
  323. clearable
  324. @keyup.enter.native="handleQuery"
  325. />
  326. </el-form-item>
  327. <el-form-item label="预留字段j" prop="reservedColumnJ">
  328. <el-input
  329. v-model="queryParams.reservedColumnJ"
  330. placeholder="请输入预留字段j"
  331. clearable
  332. @keyup.enter.native="handleQuery"
  333. />
  334. </el-form-item> -->
  335. <el-form-item style="padding-left: 30px;">
  336. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  337. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  338. </el-form-item>
  339. </el-form>
  340. <el-row :gutter="10" class="mb8">
  341. <el-col :span="1.5">
  342. <el-button
  343. type="primary"
  344. plain
  345. icon="el-icon-plus"
  346. size="mini"
  347. @click="handleAdd"
  348. v-hasPermi="['asset:information:add']"
  349. >新增</el-button>
  350. </el-col>
  351. <el-col :span="1.5">
  352. <el-button
  353. type="success"
  354. plain
  355. icon="el-icon-edit"
  356. size="mini"
  357. :disabled="single"
  358. @click="handleUpdate"
  359. v-hasPermi="['asset:information:edit']"
  360. >修改</el-button>
  361. </el-col>
  362. <el-col :span="1.5">
  363. <el-button
  364. type="danger"
  365. plain
  366. icon="el-icon-delete"
  367. size="mini"
  368. :disabled="multiple"
  369. @click="handleDelete"
  370. v-hasPermi="['asset:information:remove']"
  371. >删除</el-button>
  372. </el-col>
  373. <el-col :span="1.5">
  374. <el-button
  375. type="warning"
  376. plain
  377. icon="el-icon-download"
  378. size="mini"
  379. @click="handleExport"
  380. v-hasPermi="['asset:information:export']"
  381. >导出</el-button>
  382. </el-col>
  383. <el-col :span="1.5">
  384. <el-button
  385. type="info"
  386. plain
  387. icon="el-icon-upload2"
  388. size="mini"
  389. @click="handleImport"
  390. v-hasPermi="['asset:information:import']"
  391. >导入</el-button>
  392. <!-- v-hasPermi="['collegeManage:studentBase:import']" -->
  393. </el-col>
  394. <el-col :span="1.5">
  395. <el-button
  396. type="primary"
  397. plain
  398. icon="el-icon-menu"
  399. size="mini"
  400. @click="handleDIY"
  401. v-hasPermi="['asset:information:query']"
  402. >自定义字段</el-button>
  403. </el-col>
  404. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  405. </el-row>
  406. <el-table v-loading="loading" :data="informationList" @selection-change="handleSelectionChange">
  407. <el-table-column type="selection" width="55" align="center" />
  408. <!-- <el-table-column label="编号" align="center" prop="id" /> -->
  409. <el-table-column label="资产编号" align="center" prop="number" />
  410. <el-table-column label="资产名称" align="center" prop="name" />
  411. <el-table-column label="资产条码" v-if="isExist('资产条码')" align="center" prop="code" />
  412. <el-table-column label="照片" align="center" prop="imageUrl" width="100" >
  413. <template slot-scope="scope">
  414. <image-preview :src="scope.row.imageUrl" :width="50" :height="50" v-show="(scope.row.imageUrl===''||scope.row.imageUrl==null)?false:true"/>
  415. </template>
  416. </el-table-column>
  417. <el-table-column label="资产分类" align="center" prop="categoryNumber" >
  418. <template slot-scope="scope">
  419. <span>{{ scope.row.categoryNumber != null ? categoryName(scope.row.categoryNumber) : ""}}</span>
  420. </template>
  421. </el-table-column>
  422. <el-table-column label="使用部门" align="center" prop="userDepartment" >
  423. <template slot-scope="scope">
  424. <span>{{ scope.row.userDepartment != null ? companyName(scope.row.userDepartment) : ""}}</span>
  425. </template>
  426. </el-table-column>
  427. <el-table-column label="管理部门" align="center" prop="department">
  428. <template slot-scope="scope">
  429. <span>{{ scope.row.department != null ? companyName(scope.row.department) : ""}}</span>
  430. </template>
  431. </el-table-column>
  432. <el-table-column label="所在位置" align="center" prop="locationNumber" >
  433. <template slot-scope="scope">
  434. <span>{{locationName(scope.row.locationNumber)}}</span>
  435. </template>
  436. </el-table-column>
  437. <el-table-column label="所属公司" align="center" prop="corporation" >
  438. <template slot-scope="scope">
  439. <span>{{ scope.row.corporation != null ? companyName(scope.row.corporation) : ""}}</span>
  440. </template>
  441. </el-table-column>
  442. <el-table-column label="备注" align="center" prop="remark" />
  443. <el-table-column v-if="isExist('管理状态')" label="管理状态" align="center" prop="manageStatus" >
  444. <template slot-scope="scope">
  445. <dict-tag :options="dict.type.sys_manger_status" :value="scope.row.manageStatus"/>
  446. </template>
  447. </el-table-column>
  448. <el-table-column v-if="isExist('资产性质')" label="资产性质" align="center" prop="property" >
  449. <template slot-scope="scope">
  450. <dict-tag :options="dict.type.sys_asset_property" :value="scope.row.property"/>
  451. </template>
  452. </el-table-column>
  453. <el-table-column v-if="isExist('规格型号')" label="规格型号" align="center" prop="specificationsModel" />
  454. <el-table-column v-if="isExist('ABC分类')" label="ABC分类" align="center" prop="abcCategory" />
  455. <el-table-column v-if="isExist('责任人')" label="责任人" align="center" prop="responsiblePerson" />
  456. <el-table-column v-if="isExist('购置日期')" label="购置日期" align="center" prop="purchaseDate" width="180">
  457. <template slot-scope="scope">
  458. <span>{{ parseTime(scope.row.purchaseDate, '{y}-{m}-{d}') }}</span>
  459. </template>
  460. </el-table-column>
  461. <el-table-column v-if="isExist('启用日期')" label="启用日期" align="center" prop="commissioningDate" width="180">
  462. <template slot-scope="scope">
  463. <span>{{ parseTime(scope.row.commissioningDate, '{y}-{m}-{d}') }}</span>
  464. </template>
  465. </el-table-column>
  466. <el-table-column v-if="isExist('原值')" label="原值" align="center" prop="originalValue" />
  467. <el-table-column v-if="isExist('使用年限')" label="使用年限" align="center" prop="durableYears" />
  468. <el-table-column v-if="isExist('净值')" label="净值" align="center" prop="netValue" />
  469. <el-table-column v-if="isExist('残值')" label="残值" align="center" prop="residualValue" />
  470. <el-table-column v-if="isExist('累计折旧')" label="累计折旧" align="center" prop="accumulatedDepreciation" />
  471. <el-table-column v-if="isExist('最近折旧日期')" label="最近折旧日期" align="center" prop="lastDepreciationDate" width="180">
  472. <template slot-scope="scope">
  473. <span>{{ parseTime(scope.row.lastDepreciationDate, '{y}-{m}-{d}') }}</span>
  474. </template>
  475. </el-table-column>
  476. <el-table-column v-if="isExist('折旧方式')" label="折旧方式" align="center" prop="depreciationMethod" />
  477. <el-table-column v-if="isExist('合同编号')" label="合同编号" align="center" prop="contractNumber" />
  478. <el-table-column v-if="isExist('出厂编号')" label="出厂编号" align="center" prop="factoryNumber" />
  479. <el-table-column v-if="isExist('制造商')" label="制造商" align="center" prop="manufacturer" />
  480. <el-table-column v-if="isExist('供应商')" label="供应商" align="center" prop="supplier" />
  481. <el-table-column v-if="isExist('资产用途')" label="资产用途" align="center" prop="purpose" />
  482. <el-table-column v-if="isExist('维保到期日期')" label="维保到期日期" align="center" prop="maintenanceDate" width="180">
  483. <template slot-scope="scope">
  484. <span>{{ parseTime(scope.row.maintenanceDate, '{y}-{m}-{d}') }}</span>
  485. </template>
  486. </el-table-column>
  487. <el-table-column v-if="isExist('维修电话')" label="维修电话" align="center" prop="maintenanceTel" />
  488. <el-table-column v-if="isExist('维修人员')" label="维修人员" align="center" prop="maintenanceUser" />
  489. <el-table-column v-if="isExist('记录状态')" label="记录状态" align="center" prop="recordStatus">
  490. <template slot-scope="scope">
  491. <dict-tag :options="dict.type.asset_record_status" :value="scope.row.recordStatus"/>
  492. </template>
  493. </el-table-column>
  494. <el-table-column v-if="isExist('是否白名单')" label="是否白名单" align="center" prop="isWhitelist" >
  495. <template slot-scope="scope">
  496. <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.isWhitelist"/>
  497. </template>
  498. </el-table-column>
  499. <el-table-column label="数量" align="center" prop="quantity" />
  500. <el-table-column label="计量单位" align="center" prop="units" />
  501. <!-- <el-table-column label="预留字段d" align="center" prop="reservedColumnD" />
  502. <el-table-column label="预留字段e" align="center" prop="reservedColumnE" />
  503. <el-table-column label="预留字段f" align="center" prop="reservedColumnF" />
  504. <el-table-column label="预留字段g" align="center" prop="reservedColumnG" />
  505. <el-table-column label="预留字段h" align="center" prop="reservedColumnH" />
  506. <el-table-column label="预留字段i" align="center" prop="reservedColumnI" />
  507. <el-table-column label="预留字段j" align="center" prop="reservedColumnJ" /> -->
  508. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  509. <template slot-scope="scope">
  510. <el-button
  511. size="mini"
  512. type="text"
  513. icon="el-icon-edit"
  514. @click="handleUpdate(scope.row)"
  515. v-hasPermi="['asset:information:edit']"
  516. >修改</el-button>
  517. <el-button
  518. size="mini"
  519. type="text"
  520. icon="el-icon-delete"
  521. @click="handleDelete(scope.row)"
  522. v-hasPermi="['asset:information:remove']"
  523. >删除</el-button>
  524. </template>
  525. </el-table-column>
  526. </el-table>
  527. <pagination
  528. v-show="total>0"
  529. :total="total"
  530. :page.sync="queryParams.pageNum"
  531. :limit.sync="queryParams.pageSize"
  532. @pagination="getList"
  533. />
  534. <!-- 添加或修改资产信息对话框 -->
  535. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
  536. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  537. <!-- <el-form-item label="资产条码" prop="code">
  538. <el-input v-model="form.code" placeholder="请输入资产条码" />
  539. </el-form-item> -->
  540. <el-form-item label="资产名称" prop="name">
  541. <el-input v-model="form.name" placeholder="请输入资产名称" />
  542. </el-form-item>
  543. <el-form-item label="资产编号" prop="number">
  544. <el-input v-model="form.number" placeholder="请输入资产编号" />
  545. </el-form-item>
  546. <el-form-item label="照片">
  547. <image-upload-temp v-model="form.imageUrl" :limit="1" />
  548. </el-form-item>
  549. <el-form-item label="资产分类" prop="categoryNumber">
  550. <el-select v-model="form.categoryNumber" placeholder="请选择资产分类">
  551. <el-option
  552. v-for="item in categoryList"
  553. :key="item.number"
  554. :label="item.name"
  555. :value="item.number"
  556. ></el-option>
  557. </el-select>
  558. </el-form-item>
  559. <el-form-item label="使用部门" prop="userDepartment">
  560. <treeselect
  561. v-model="form.userDepartment"
  562. :options="deptOptions"
  563. :normalizer="normalizer"
  564. placeholder="选择使用部门"
  565. />
  566. </el-form-item>
  567. <el-form-item label="管理部门" prop="department">
  568. <treeselect
  569. v-model="form.department"
  570. :options="deptOptions"
  571. :normalizer="normalizer"
  572. placeholder="选择管理部门"
  573. />
  574. </el-form-item>
  575. <el-form-item label="所在位置" prop="locationNumber">
  576. <treeselect v-model="form.locationNumber" :options="locationList" :normalizer="tenantIdnormalizer" placeholder="选择位置" />
  577. </el-form-item>
  578. <el-form-item label="所属公司" prop="corporation">
  579. <treeselect
  580. v-model="form.corporation"
  581. :options="deptOptions"
  582. :normalizer="normalizer"
  583. placeholder="选择所属公司"
  584. />
  585. </el-form-item>
  586. <el-form-item label="备注" prop="remark">
  587. <el-input v-model="form.remark" placeholder="请输入备注" />
  588. </el-form-item>
  589. <el-form-item v-if="isExist('资产性质')" label="资产性质" prop="property">
  590. <el-select v-model="form.property" placeholder="请选择资产性质" clearable>
  591. <el-option
  592. v-for="dict in dict.type.sys_asset_property"
  593. :key="dict.value"
  594. :label="dict.label"
  595. :value="dict.value"
  596. />
  597. </el-select>
  598. </el-form-item>
  599. <el-form-item v-if="isExist('规格型号')" label="规格型号" prop="specificationsModel">
  600. <el-input v-model="form.specificationsModel" placeholder="请输入规格型号" />
  601. </el-form-item>
  602. <el-form-item v-if="isExist('ABC分类')" label="ABC分类" prop="abcCategory">
  603. <el-input v-model="form.abcCategory" placeholder="请输入ABC分类" />
  604. </el-form-item>
  605. <el-form-item v-if="isExist('责任人')" label="责任人" prop="responsiblePerson">
  606. <el-input v-model="form.responsiblePerson" placeholder="请输入责任人" />
  607. </el-form-item>
  608. <el-form-item v-if="isExist('购置日期')" label="购置日期" prop="purchaseDate">
  609. <el-date-picker clearable
  610. v-model="form.purchaseDate"
  611. type="date"
  612. value-format="yyyy-MM-dd"
  613. placeholder="请选择购置日期">
  614. </el-date-picker>
  615. </el-form-item>
  616. <el-form-item v-if="isExist('启用日期')" label="启用日期" prop="commissioningDate">
  617. <el-date-picker clearable
  618. v-model="form.commissioningDate"
  619. type="date"
  620. value-format="yyyy-MM-dd"
  621. placeholder="请选择启用日期">
  622. </el-date-picker>
  623. </el-form-item>
  624. <el-form-item v-if="isExist('原值')" label="原值" prop="originalValue">
  625. <el-input v-model="form.originalValue" placeholder="请输入原值" />
  626. </el-form-item>
  627. <el-form-item v-if="isExist('使用年限')" label="使用年限" prop="durableYears">
  628. <el-input v-model="form.durableYears" placeholder="请输入使用年限" />
  629. </el-form-item>
  630. <el-form-item v-if="isExist('净值')" label="净值" prop="netValue">
  631. <el-input v-model="form.netValue" placeholder="请输入净值" />
  632. </el-form-item>
  633. <el-form-item v-if="isExist('残值')" label="残值" prop="residualValue">
  634. <el-input v-model="form.residualValue" placeholder="请输入残值" />
  635. </el-form-item>
  636. <el-form-item v-if="isExist('累计折旧')" label="累计折旧" prop="accumulatedDepreciation">
  637. <el-input v-model="form.accumulatedDepreciation" placeholder="请输入累计折旧" />
  638. </el-form-item>
  639. <el-form-item v-if="isExist('最近折旧日期')" label="最近折旧日期" prop="lastDepreciationDate">
  640. <el-date-picker clearable
  641. v-model="form.lastDepreciationDate"
  642. type="date"
  643. value-format="yyyy-MM-dd"
  644. placeholder="请选择最近折旧日期">
  645. </el-date-picker>
  646. </el-form-item>
  647. <el-form-item v-if="isExist('折旧方式')" label="折旧方式" prop="depreciationMethod">
  648. <el-input v-model="form.depreciationMethod" placeholder="请输入折旧方式" />
  649. </el-form-item>
  650. <el-form-item v-if="isExist('合同编号')" label="合同编号" prop="contractNumber">
  651. <el-input v-model="form.contractNumber" placeholder="请输入合同编号" />
  652. </el-form-item>
  653. <el-form-item v-if="isExist('出厂编号')" label="出厂编号" prop="factoryNumber">
  654. <el-input v-model="form.factoryNumber" placeholder="请输入出厂编号" />
  655. </el-form-item>
  656. <el-form-item v-if="isExist('制造商')" label="制造商" prop="manufacturer">
  657. <el-input v-model="form.manufacturer" placeholder="请输入制造商" />
  658. </el-form-item>
  659. <el-form-item v-if="isExist('供应商')" label="供应商" prop="supplier">
  660. <el-input v-model="form.supplier" placeholder="请输入供应商" />
  661. </el-form-item>
  662. <el-form-item v-if="isExist('资产用途')" label="资产用途" prop="purpose">
  663. <el-input v-model="form.purpose" type="textarea" placeholder="请输入内容" />
  664. </el-form-item>
  665. <el-form-item v-if="isExist('维保到期日期')" label="维保到期日期" prop="maintenanceDate">
  666. <el-date-picker clearable
  667. v-model="form.maintenanceDate"
  668. type="date"
  669. value-format="yyyy-MM-dd"
  670. placeholder="请选择维保到期日期">
  671. </el-date-picker>
  672. </el-form-item>
  673. <el-form-item v-if="isExist('维修电话')" label="维修电话" prop="maintenanceTel">
  674. <el-input v-model="form.maintenanceTel" placeholder="请输入维修电话" />
  675. </el-form-item>
  676. <el-form-item v-if="isExist('维修人员')" label="维修人员" prop="maintenanceUser">
  677. <el-input v-model="form.maintenanceUser" placeholder="请输入维修人员" />
  678. </el-form-item>
  679. <el-form-item v-if="isExist('记录状态')" label="记录状态" prop="recordStatus">
  680. <el-select v-model="form.recordStatus" placeholder="请选择记录状态">
  681. <el-option
  682. v-for="dict in dict.type.asset_record_status"
  683. :key="dict.value"
  684. :label="dict.label"
  685. :value="parseInt(dict.value)"
  686. ></el-option>
  687. </el-select>
  688. </el-form-item>
  689. <el-form-item v-if="isExist('是否白名单')" label="是否白名单" prop="isWhitelist">
  690. <el-select v-model="form.isWhitelist" placeholder="请输入是否白名单">
  691. <el-option
  692. v-for="dict in dict.type.sys_yes_no"
  693. :key="dict.value"
  694. :label="dict.label"
  695. :value="dict.value"
  696. ></el-option>
  697. </el-select>
  698. </el-form-item>
  699. <el-form-item label="数量" prop="quantity">
  700. <el-input v-model="form.quantity" placeholder="请输入数量" />
  701. </el-form-item>
  702. <el-form-item label="计量单位" prop="units">
  703. <el-input v-model="form.units" placeholder="请输入计量单位" />
  704. </el-form-item>
  705. <!-- <el-form-item label="预留字段d" prop="reservedColumnD">
  706. <el-input v-model="form.reservedColumnD" placeholder="请输入预留字段d" />
  707. </el-form-item>
  708. <el-form-item label="预留字段e" prop="reservedColumnE">
  709. <el-input v-model="form.reservedColumnE" placeholder="请输入预留字段e" />
  710. </el-form-item>
  711. <el-form-item label="预留字段f" prop="reservedColumnF">
  712. <el-input v-model="form.reservedColumnF" placeholder="请输入预留字段f" />
  713. </el-form-item>
  714. <el-form-item label="预留字段g" prop="reservedColumnG">
  715. <el-input v-model="form.reservedColumnG" placeholder="请输入预留字段g" />
  716. </el-form-item>
  717. <el-form-item label="预留字段h" prop="reservedColumnH">
  718. <el-input v-model="form.reservedColumnH" placeholder="请输入预留字段h" />
  719. </el-form-item>
  720. <el-form-item label="预留字段i" prop="reservedColumnI">
  721. <el-input v-model="form.reservedColumnI" placeholder="请输入预留字段i" />
  722. </el-form-item>
  723. <el-form-item label="预留字段j" prop="reservedColumnJ">
  724. <el-input v-model="form.reservedColumnJ" placeholder="请输入预留字段j" />
  725. </el-form-item> -->
  726. </el-form>
  727. <div slot="footer" class="dialog-footer">
  728. <el-button type="primary" @click="submitForm">确 定</el-button>
  729. <el-button @click="cancel">取 消</el-button>
  730. </div>
  731. </el-dialog>
  732. <el-dialog :title="title" :visible.sync="diyOpen" width="700px" append-to-body>
  733. <template>
  734. <div>
  735. <el-checkbox-group v-model="checkList" mini>
  736. <el-checkbox label="管理状态" border></el-checkbox>
  737. <el-checkbox label="资产性质" border></el-checkbox>
  738. <el-checkbox label="规格型号" border></el-checkbox>
  739. <el-checkbox label="ABC分类" border></el-checkbox>
  740. <el-checkbox label="责任人" border></el-checkbox>
  741. <el-checkbox label="购置日期" border></el-checkbox>
  742. <el-checkbox label="启用日期" border></el-checkbox>
  743. <el-checkbox label="使用年限" border></el-checkbox>
  744. <el-checkbox label="原值" border></el-checkbox>
  745. <el-checkbox label="净值" border></el-checkbox>
  746. <el-checkbox label="残值" border></el-checkbox>
  747. <el-checkbox label="累计折旧" border></el-checkbox>
  748. <el-checkbox label="最近折旧日期" border></el-checkbox>
  749. <el-checkbox label="折旧方式" border></el-checkbox>
  750. <el-checkbox label="合同编号" border></el-checkbox>
  751. <el-checkbox label="出厂编号" border></el-checkbox>
  752. <el-checkbox label="制造商" border></el-checkbox>
  753. <el-checkbox label="供应商" border></el-checkbox>
  754. <el-checkbox label="维保到期日期" border></el-checkbox>
  755. <el-checkbox label="维修电话" border></el-checkbox>
  756. <el-checkbox label="维修人员" border></el-checkbox>
  757. <el-checkbox label="记录状态" border></el-checkbox>
  758. <el-checkbox label="是否白名单" border></el-checkbox>
  759. <el-checkbox label="资产条码" border></el-checkbox>
  760. </el-checkbox-group>
  761. </div>
  762. </template>
  763. <div slot="footer" class="dialog-footer">
  764. <el-button type="primary" @click="submitDIY">确 定</el-button>
  765. <el-button @click="cancelDIY">取 消</el-button>
  766. </div>
  767. </el-dialog>
  768. <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
  769. <el-upload
  770. ref="upload"
  771. :limit="1"
  772. accept=".xlsx, .xls"
  773. :headers="upload.headers"
  774. :action="upload.url + '?updateSupport=' + upload.updateSupport"
  775. :disabled="upload.isUploading"
  776. :on-progress="handleFileUploadProgress"
  777. :on-success="handleFileSuccess"
  778. :auto-upload="false"
  779. drag
  780. >
  781. <i class="el-icon-upload"></i>
  782. <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
  783. <div class="el-upload__tip text-center" slot="tip">
  784. <div class="el-upload__tip" slot="tip">
  785. <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
  786. </div>
  787. <span>仅允许导入xls、xlsx格式文件。</span>
  788. <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
  789. </div>
  790. </el-upload>
  791. <div slot="footer" class="dialog-footer">
  792. <el-button type="primary" @click="submitFileForm">确 定</el-button>
  793. <el-button @click="upload.open = false">取 消</el-button>
  794. </div>
  795. </el-dialog>
  796. </div>
  797. </template>
  798. <script>
  799. import { listInformation, getInformation, delInformation, addInformation, updateInformation, setDiy, getDiy } from "@/api/asset/information";
  800. import { listCategory } from "@/api/asset/category";
  801. import { treeSelect } from "@/api/asset/location";
  802. import ImageUploadTemp from "@/components/ImageUploadTemp"
  803. import { listDept } from "@/api/system/dept";
  804. import Treeselect from "@riophae/vue-treeselect";
  805. import { getToken } from "@/utils/auth";
  806. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  807. export default {
  808. name: "Information",
  809. dicts: ['asset_record_status', 'sys_yes_no', 'sys_manger_status', 'sys_asset_property'],
  810. components:{
  811. ImageUploadTemp,Treeselect
  812. },
  813. computed:{
  814. isExist() {
  815. return (label) => {
  816. if (!this.checkList.length) {
  817. return false
  818. }
  819. return this.checkList.some(item => item === label);
  820. }
  821. }
  822. },
  823. data() {
  824. return {
  825. // 遮罩层
  826. loading: true,
  827. // 选中数组
  828. ids: [],
  829. // 非单个禁用
  830. single: true,
  831. // 非多个禁用
  832. multiple: true,
  833. // 显示搜索条件
  834. showSearch: true,
  835. // 总条数
  836. total: 0,
  837. arr: [],
  838. // 所属位置表格数据
  839. locationList: [],
  840. // 资产分类表格数据
  841. categoryList: [],
  842. // 资产信息表格数据
  843. informationList: [],
  844. // 部门树选项
  845. deptOptions: [],
  846. // 弹出层标题
  847. title: "",
  848. // 是否显示弹出层
  849. open: false,
  850. //字段自定义弹出层
  851. diyOpen: false,
  852. //自定义字段列表
  853. checkList: [],
  854. // 查询参数
  855. queryParams: {
  856. pageNum: 1,
  857. pageSize: 10,
  858. code: null,
  859. name: null,
  860. number: null,
  861. imageUrl: null,
  862. categoryNumber: null,
  863. specificationsModel: null,
  864. abcCategory: null,
  865. manageStatus: null,
  866. userDepartment: null,
  867. department: null,
  868. responsiblePerson: null,
  869. locationNumber: null,
  870. property: null,
  871. purchaseDate: null,
  872. commissioningDate: null,
  873. originalValue: null,
  874. durableYears: null,
  875. netValue: null,
  876. residualValue: null,
  877. accumulatedDepreciation: null,
  878. lastDepreciationDate: null,
  879. depreciationMethod: null,
  880. contractNumber: null,
  881. factoryNumber: null,
  882. manufacturer: null,
  883. supplier: null,
  884. purpose: null,
  885. maintenanceDate: null,
  886. maintenanceTel: null,
  887. maintenanceUser: null,
  888. corporation: null,
  889. recordStatus: null,
  890. isWhitelist: null,
  891. quantity: null,
  892. units: null,
  893. reservedColumnD: null,
  894. reservedColumnE: null,
  895. reservedColumnF: null,
  896. reservedColumnG: null,
  897. reservedColumnH: null,
  898. reservedColumnI: null,
  899. reservedColumnJ: null
  900. },
  901. // 表单参数
  902. form: {},
  903. // 表单校验
  904. rules: {
  905. number: [
  906. { required: true, message: "资产编号不能为空", trigger: "blur" },
  907. { pattern: /^[A-Fa-f0-9]+$/, message: '资产编号格式仅限[A-Fa-f0-9]' }
  908. ],
  909. specificationsModel: [
  910. { required: true, message: "规格型号不能为空", trigger: "blur" }
  911. ],
  912. manageStatus: [
  913. { required: true, message: "管理状态不能为空", trigger: "change" }
  914. ],
  915. recordStatus: [
  916. { required: true, message: "记录状态不能为空", trigger: "change" }
  917. ],
  918. },
  919. upload: {
  920. // 是否显示弹出层(用户导入)
  921. open: false,
  922. // 弹出层标题(用户导入)
  923. title: "",
  924. // 是否禁用上传
  925. isUploading: false,
  926. // 是否更新已经存在的用户数据
  927. updateSupport: 1,
  928. // 设置上传的请求头部
  929. headers: { Authorization: "Bearer " + getToken() },
  930. // 上传的地址
  931. url: process.env.VUE_APP_BASE_API + "/asset/information/importData" // todo
  932. },
  933. };
  934. },
  935. created() {
  936. this.getList();
  937. },
  938. methods: {
  939. /** 查询资产信息列表 */
  940. getList() {
  941. this.loading = true;
  942. getDiy().then(response => {
  943. this.checkList = response.data
  944. })
  945. listDept().then((response) => {
  946. this.deptOptions = this.handleTree(response.data, "deptId");
  947. this.arr = response.data
  948. });
  949. listCategory().then(response => {
  950. this.categoryList = response.rows;
  951. });
  952. treeSelect().then((response) => {
  953. this.locationList = response.data;
  954. });
  955. listInformation(this.queryParams).then(response => {
  956. this.informationList = response.rows;
  957. this.total = response.total;
  958. this.loading = false;
  959. });
  960. },
  961. /** 转换部门数据结构 */
  962. normalizer(node) {
  963. if (node.children && !node.children.length) {
  964. delete node.children;
  965. }
  966. return {
  967. id: node.deptId,
  968. label: node.deptName,
  969. children: node.children,
  970. };
  971. },
  972. tenantIdnormalizer(node) {
  973. return {
  974. id: node.number,
  975. label: node.label,
  976. children: node.children
  977. }
  978. },
  979. //获取公司名
  980. companyName(val){
  981. let num = parseInt(val)
  982. let arr2 = this.arr.filter(item => item.deptId===num);
  983. return arr2[0].deptName
  984. },
  985. //获取资产分类名
  986. categoryName(val){
  987. //let num = parseInt(val)
  988. let arr2 = this.categoryList.filter(item => item.number===val);
  989. return arr2[0].name
  990. },
  991. //获取所在位置名
  992. locationName(number) {
  993. let name = '未知'
  994. for (let item of this.locationList) {
  995. if (item.number === number) {
  996. name = item.label
  997. break
  998. }
  999. if (item.children) {
  1000. let label = this.findLocation(number, item.children)
  1001. if (label != null) {
  1002. name = label
  1003. break
  1004. }
  1005. }
  1006. }
  1007. return name
  1008. },
  1009. findLocation(number, children) {
  1010. let name = null
  1011. for (let item of children) {
  1012. if (item.number === number) {
  1013. name = item.label
  1014. break
  1015. }
  1016. if (item.children) {
  1017. let label = this.findLocation(number, item.children)
  1018. if (label != null) {
  1019. name = label
  1020. break
  1021. }
  1022. }
  1023. }
  1024. return name
  1025. },
  1026. // 取消按钮
  1027. cancel() {
  1028. this.open = false;
  1029. this.reset();
  1030. },
  1031. // 表单重置
  1032. reset() {
  1033. this.form = {
  1034. id: null,
  1035. code: null,
  1036. name: null,
  1037. number: null,
  1038. imageUrl: null,
  1039. categoryNumber: null,
  1040. specificationsModel: null,
  1041. abcCategory: null,
  1042. manageStatus: null,
  1043. userDepartment: null,
  1044. department: null,
  1045. responsiblePerson: null,
  1046. locationNumber: null,
  1047. property: null,
  1048. purchaseDate: null,
  1049. commissioningDate: null,
  1050. originalValue: null,
  1051. durableYears: null,
  1052. netValue: null,
  1053. residualValue: null,
  1054. accumulatedDepreciation: null,
  1055. lastDepreciationDate: null,
  1056. depreciationMethod: null,
  1057. contractNumber: null,
  1058. factoryNumber: null,
  1059. manufacturer: null,
  1060. supplier: null,
  1061. purpose: null,
  1062. maintenanceDate: null,
  1063. maintenanceTel: null,
  1064. maintenanceUser: null,
  1065. corporation: null,
  1066. recordStatus: null,
  1067. remark: null,
  1068. createBy: null,
  1069. createTime: null,
  1070. updateBy: null,
  1071. updateTime: null,
  1072. isWhitelist: null,
  1073. quantity: null,
  1074. units: null,
  1075. reservedColumnD: null,
  1076. reservedColumnE: null,
  1077. reservedColumnF: null,
  1078. reservedColumnG: null,
  1079. reservedColumnH: null,
  1080. reservedColumnI: null,
  1081. reservedColumnJ: null
  1082. };
  1083. this.resetForm("form");
  1084. },
  1085. /** 搜索按钮操作 */
  1086. handleQuery() {
  1087. this.queryParams.pageNum = 1;
  1088. this.getList();
  1089. },
  1090. /** 重置按钮操作 */
  1091. resetQuery() {
  1092. this.resetForm("queryForm");
  1093. this.handleQuery();
  1094. },
  1095. // 多选框选中数据
  1096. handleSelectionChange(selection) {
  1097. this.ids = selection.map(item => item.id)
  1098. this.single = selection.length!==1
  1099. this.multiple = !selection.length
  1100. },
  1101. /** 新增按钮操作 */
  1102. handleAdd(row) {
  1103. this.reset();
  1104. if (row != undefined) {
  1105. this.form.parentId = row.deptId;
  1106. }
  1107. this.open = true;
  1108. this.title = "添加资产信息";
  1109. listDept().then(response => {
  1110. this.deptOptions = this.handleTree(response.data, "deptId");
  1111. });
  1112. },
  1113. /** 修改按钮操作 */
  1114. handleUpdate(row) {
  1115. this.reset();
  1116. const id = row.id || this.ids
  1117. getInformation(id).then(response => {
  1118. this.form = response.data;
  1119. this.open = true;
  1120. this.title = "修改资产信息";
  1121. });
  1122. },
  1123. /** 自定义字段按钮 */
  1124. handleDIY(){
  1125. this.diyOpen = true;
  1126. this.title = "自定义字段";
  1127. },
  1128. submitDIY(){
  1129. setDiy(this.checkList).then(response => {
  1130. this.diyOpen = false
  1131. this.$modal.msgSuccess("修改成功");
  1132. })
  1133. },
  1134. cancelDIY(){
  1135. this.diyOpen = false
  1136. },
  1137. /** 提交按钮 */
  1138. submitForm() {
  1139. this.$refs["form"].validate(valid => {
  1140. if (valid) {
  1141. if (this.form.id != null) {
  1142. updateInformation(this.form).then(response => {
  1143. this.$modal.msgSuccess("修改成功");
  1144. this.open = false;
  1145. this.getList();
  1146. });
  1147. } else {
  1148. addInformation(this.form).then(response => {
  1149. this.$modal.msgSuccess("新增成功");
  1150. this.open = false;
  1151. this.getList();
  1152. });
  1153. }
  1154. }
  1155. });
  1156. },
  1157. /** 导入按钮操作 */
  1158. handleImport() {
  1159. this.upload.title = "资产信息导入"; // todo
  1160. this.upload.open = true;
  1161. },
  1162. /** 下载模板操作 */
  1163. importTemplate() {
  1164. this.download('/asset/information/importTemplate', {
  1165. }, `stu_base_template_${new Date().getTime()}.xlsx`) // todo
  1166. },
  1167. // 文件上传中处理
  1168. handleFileUploadProgress(event, file, fileList) {
  1169. this.upload.isUploading = true;
  1170. },
  1171. // 文件上传成功处理
  1172. handleFileSuccess(response, file, fileList) {
  1173. this.upload.open = false;
  1174. this.upload.isUploading = false;
  1175. this.$refs.upload.clearFiles();
  1176. this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
  1177. this.getList();
  1178. },
  1179. // 提交上传文件
  1180. submitFileForm() {
  1181. this.$refs.upload.submit();
  1182. },
  1183. /** 删除按钮操作 */
  1184. handleDelete(row) {
  1185. const ids = row.id || this.ids;
  1186. this.$modal.confirm('是否确认删除资产信息编号为"' + ids + '"的数据项?').then(function() {
  1187. return delInformation(ids);
  1188. }).then(() => {
  1189. this.getList();
  1190. this.$modal.msgSuccess("删除成功");
  1191. }).catch(() => {});
  1192. },
  1193. /** 导出按钮操作 */
  1194. handleExport() {
  1195. this.download('asset/information/export', {
  1196. ...this.queryParams
  1197. }, `information_${new Date().getTime()}.xlsx`)
  1198. }
  1199. }
  1200. };
  1201. </script>
  1202. <style lang="less" scoped>
  1203. /deep/ .el-checkbox-group{
  1204. display: flex;
  1205. align-items: center;
  1206. flex-wrap: wrap;
  1207. .el-checkbox {
  1208. flex-basis: 25%;
  1209. margin-bottom: 10px; /* 调整间距 */
  1210. &:nth-child(1) {
  1211. margin-left: 10px;
  1212. }
  1213. }
  1214. }
  1215. /deep/ .vue-treeselect {
  1216. display: inline-block;
  1217. }
  1218. .queryForm {
  1219. /deep/ .vue-treeselect {
  1220. width: 205px;
  1221. height: 32px;
  1222. }
  1223. }
  1224. </style>