index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="从表id" prop="subId">
  5. <el-input
  6. v-model="queryParams.subId"
  7. placeholder="请输入从表id"
  8. clearable
  9. size="small"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item label="审批id" prop="approveId">
  14. <el-input
  15. v-model="queryParams.approveId"
  16. placeholder="请输入审批id"
  17. clearable
  18. size="small"
  19. @keyup.enter.native="handleQuery"
  20. />
  21. </el-form-item>
  22. <el-form-item label="单元" prop="unit">
  23. <el-input
  24. v-model="queryParams.unit"
  25. placeholder="请输入单元"
  26. clearable
  27. size="small"
  28. @keyup.enter.native="handleQuery"
  29. />
  30. </el-form-item>
  31. <el-form-item label="系统名称" prop="systemName">
  32. <el-input
  33. v-model="queryParams.systemName"
  34. placeholder="请输入系统名称"
  35. clearable
  36. size="small"
  37. @keyup.enter.native="handleQuery"
  38. />
  39. </el-form-item>
  40. <el-form-item label="气密介质" prop="airtightMedium">
  41. <el-input
  42. v-model="queryParams.airtightMedium"
  43. placeholder="请输入气密介质"
  44. clearable
  45. size="small"
  46. @keyup.enter.native="handleQuery"
  47. />
  48. </el-form-item>
  49. <el-form-item label="气密压力" prop="airtightPressure">
  50. <el-input
  51. v-model="queryParams.airtightPressure"
  52. placeholder="请输入气密压力"
  53. clearable
  54. size="small"
  55. @keyup.enter.native="handleQuery"
  56. />
  57. </el-form-item>
  58. <el-form-item label="保压始压力" prop="initialPressure">
  59. <el-input
  60. v-model="queryParams.initialPressure"
  61. placeholder="请输入保压始压力"
  62. clearable
  63. size="small"
  64. @keyup.enter.native="handleQuery"
  65. />
  66. </el-form-item>
  67. <el-form-item label="保压终压力" prop="finalPressure">
  68. <el-input
  69. v-model="queryParams.finalPressure"
  70. placeholder="请输入保压终压力"
  71. clearable
  72. size="small"
  73. @keyup.enter.native="handleQuery"
  74. />
  75. </el-form-item>
  76. <el-form-item label="泄露率" prop="leakageRate">
  77. <el-input
  78. v-model="queryParams.leakageRate"
  79. placeholder="请输入泄露率"
  80. clearable
  81. size="small"
  82. @keyup.enter.native="handleQuery"
  83. />
  84. </el-form-item>
  85. <el-form-item label="合格" prop="standard">
  86. <el-input
  87. v-model="queryParams.standard"
  88. placeholder="请输入合格"
  89. clearable
  90. size="small"
  91. @keyup.enter.native="handleQuery"
  92. />
  93. </el-form-item>
  94. <el-form-item label="确认人" prop="identifyingPerson">
  95. <el-input
  96. v-model="queryParams.identifyingPerson"
  97. placeholder="请输入确认人"
  98. clearable
  99. size="small"
  100. @keyup.enter.native="handleQuery"
  101. />
  102. </el-form-item>
  103. <el-form-item label="确认日期" prop="confirmationDate">
  104. <el-date-picker clearable size="small" style="width: 200px"
  105. v-model="queryParams.confirmationDate"
  106. type="date"
  107. value-format="yyyy-MM-dd"
  108. placeholder="选择确认日期">
  109. </el-date-picker>
  110. </el-form-item>
  111. <el-form-item label="创建人" prop="createrCode">
  112. <el-input
  113. v-model="queryParams.createrCode"
  114. placeholder="请输入创建人"
  115. clearable
  116. size="small"
  117. @keyup.enter.native="handleQuery"
  118. />
  119. </el-form-item>
  120. <el-form-item label="创建时间" prop="createdate">
  121. <el-date-picker clearable size="small" style="width: 200px"
  122. v-model="queryParams.createdate"
  123. type="date"
  124. value-format="yyyy-MM-dd"
  125. placeholder="选择创建时间">
  126. </el-date-picker>
  127. </el-form-item>
  128. <el-form-item label="修改人" prop="updaterCode">
  129. <el-input
  130. v-model="queryParams.updaterCode"
  131. placeholder="请输入修改人"
  132. clearable
  133. size="small"
  134. @keyup.enter.native="handleQuery"
  135. />
  136. </el-form-item>
  137. <el-form-item label="修改时间" prop="updatedate">
  138. <el-date-picker clearable size="small" style="width: 200px"
  139. v-model="queryParams.updatedate"
  140. type="date"
  141. value-format="yyyy-MM-dd"
  142. placeholder="选择修改时间">
  143. </el-date-picker>
  144. </el-form-item>
  145. <el-form-item label="部门编号" prop="deptId">
  146. <el-input
  147. v-model="queryParams.deptId"
  148. placeholder="请输入部门编号"
  149. clearable
  150. size="small"
  151. @keyup.enter.native="handleQuery"
  152. />
  153. </el-form-item>
  154. <el-form-item label="备注" prop="remarks">
  155. <el-input
  156. v-model="queryParams.remarks"
  157. placeholder="请输入备注"
  158. clearable
  159. size="small"
  160. @keyup.enter.native="handleQuery"
  161. />
  162. </el-form-item>
  163. <el-form-item>
  164. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  165. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  166. </el-form-item>
  167. </el-form>
  168. <el-row :gutter="10" class="mb8">
  169. <el-col :span="1.5">
  170. <el-button
  171. type="primary"
  172. icon="el-icon-plus"
  173. size="mini"
  174. @click="handleAdd"
  175. v-hasPermi="['pssr:airtight:add']"
  176. >新增</el-button>
  177. </el-col>
  178. <el-col :span="1.5">
  179. <el-button
  180. type="success"
  181. icon="el-icon-edit"
  182. size="mini"
  183. :disabled="single"
  184. @click="handleUpdate"
  185. v-hasPermi="['pssr:airtight:edit']"
  186. >修改</el-button>
  187. </el-col>
  188. <el-col :span="1.5">
  189. <el-button
  190. type="danger"
  191. icon="el-icon-delete"
  192. size="mini"
  193. :disabled="multiple"
  194. @click="handleDelete"
  195. v-hasPermi="['pssr:airtight:remove']"
  196. >删除</el-button>
  197. </el-col>
  198. <el-col :span="1.5">
  199. <el-button
  200. type="info"
  201. icon="el-icon-upload2"
  202. size="mini"
  203. @click="handleImport"
  204. v-hasPermi="['pssr:airtight:edit']"
  205. >导入</el-button>
  206. </el-col>
  207. <el-col :span="1.5">
  208. <el-button
  209. type="warning"
  210. icon="el-icon-download"
  211. size="mini"
  212. @click="handleExport"
  213. v-hasPermi="['pssr:airtight:export']"
  214. >导出</el-button>
  215. </el-col>
  216. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  217. </el-row>
  218. <el-table v-loading="loading" :data="airtightList" @selection-change="handleSelectionChange" :height="clientHeight" border>
  219. <el-table-column type="selection" width="55" align="center" />
  220. <el-table-column label="唯一标识ID" align="center" prop="id" :show-overflow-tooltip="true"/>
  221. <el-table-column label="从表id" align="center" prop="subId" :show-overflow-tooltip="true"/>
  222. <el-table-column label="审批id" align="center" prop="approveId" :show-overflow-tooltip="true"/>
  223. <el-table-column label="单元" align="center" prop="unit" :show-overflow-tooltip="true"/>
  224. <el-table-column label="系统名称" align="center" prop="systemName" :show-overflow-tooltip="true"/>
  225. <el-table-column label="气密介质" align="center" prop="airtightMedium" :show-overflow-tooltip="true"/>
  226. <el-table-column label="气密压力" align="center" prop="airtightPressure" :show-overflow-tooltip="true"/>
  227. <el-table-column label="保压始压力" align="center" prop="initialPressure" :show-overflow-tooltip="true"/>
  228. <el-table-column label="保压终压力" align="center" prop="finalPressure" :show-overflow-tooltip="true"/>
  229. <el-table-column label="泄露率" align="center" prop="leakageRate" :show-overflow-tooltip="true"/>
  230. <el-table-column label="合格" align="center" prop="standard" :show-overflow-tooltip="true"/>
  231. <el-table-column label="确认人" align="center" prop="identifyingPerson" :show-overflow-tooltip="true"/>
  232. <el-table-column label="确认日期" align="center" prop="confirmationDate" width="100">
  233. <template slot-scope="scope">
  234. <span>{{ parseTime(scope.row.confirmationDate, '{y}-{m}-{d}') }}</span>
  235. </template>
  236. </el-table-column>
  237. <el-table-column label="创建人" align="center" prop="createrCode" :show-overflow-tooltip="true"/>
  238. <el-table-column label="创建时间" align="center" prop="createdate" width="100">
  239. <template slot-scope="scope">
  240. <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
  241. </template>
  242. </el-table-column>
  243. <el-table-column label="修改人" align="center" prop="updaterCode" :show-overflow-tooltip="true"/>
  244. <el-table-column label="修改时间" align="center" prop="updatedate" width="100">
  245. <template slot-scope="scope">
  246. <span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>
  247. </template>
  248. </el-table-column>
  249. <el-table-column label="部门编号" align="center" prop="deptId" :show-overflow-tooltip="true"/>
  250. <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
  251. <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
  252. <template slot-scope="scope">
  253. <el-button
  254. size="mini"
  255. type="text"
  256. icon="el-icon-edit"
  257. @click="handleUpdate(scope.row)"
  258. v-hasPermi="['pssr:airtight:edit']"
  259. >修改</el-button>
  260. <el-button
  261. size="mini"
  262. type="text"
  263. icon="el-icon-delete"
  264. @click="handleDelete(scope.row)"
  265. v-hasPermi="['pssr:airtight:remove']"
  266. >删除</el-button>
  267. </template>
  268. </el-table-column>
  269. </el-table>
  270. <pagination
  271. v-show="total>0"
  272. :total="total"
  273. :page.sync="queryParams.pageNum"
  274. :limit.sync="queryParams.pageSize"
  275. @pagination="getList"
  276. />
  277. <!-- 添加或修改气密对话框 -->
  278. <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="open" width="500px" append-to-body>
  279. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  280. <el-form-item label="从表id" prop="subId">
  281. <el-input v-model="form.subId" placeholder="请输入从表id" />
  282. </el-form-item>
  283. <el-form-item label="审批id" prop="approveId">
  284. <el-input v-model="form.approveId" placeholder="请输入审批id" />
  285. </el-form-item>
  286. <el-form-item label="单元" prop="unit">
  287. <el-input v-model="form.unit" placeholder="请输入单元" />
  288. </el-form-item>
  289. <el-form-item label="系统名称" prop="systemName">
  290. <el-input v-model="form.systemName" placeholder="请输入系统名称" />
  291. </el-form-item>
  292. <el-form-item label="气密介质" prop="airtightMedium">
  293. <el-input v-model="form.airtightMedium" placeholder="请输入气密介质" />
  294. </el-form-item>
  295. <el-form-item label="气密压力" prop="airtightPressure">
  296. <el-input v-model="form.airtightPressure" placeholder="请输入气密压力" />
  297. </el-form-item>
  298. <el-form-item label="保压始压力" prop="initialPressure">
  299. <el-input v-model="form.initialPressure" placeholder="请输入保压始压力" />
  300. </el-form-item>
  301. <el-form-item label="保压终压力" prop="finalPressure">
  302. <el-input v-model="form.finalPressure" placeholder="请输入保压终压力" />
  303. </el-form-item>
  304. <el-form-item label="泄露率" prop="leakageRate">
  305. <el-input v-model="form.leakageRate" placeholder="请输入泄露率" />
  306. </el-form-item>
  307. <el-form-item label="合格" prop="standard">
  308. <el-input v-model="form.standard" placeholder="请输入合格" />
  309. </el-form-item>
  310. <el-form-item label="确认人" prop="identifyingPerson">
  311. <el-input v-model="form.identifyingPerson" placeholder="请输入确认人" />
  312. </el-form-item>
  313. <el-form-item label="确认日期" prop="confirmationDate">
  314. <el-date-picker clearable size="small" style="width: 200px"
  315. v-model="form.confirmationDate"
  316. type="date"
  317. value-format="yyyy-MM-dd"
  318. placeholder="选择确认日期">
  319. </el-date-picker>
  320. </el-form-item>
  321. <el-form-item label="删除状态" prop="delFlag">
  322. <el-input v-model="form.delFlag" placeholder="请输入删除状态" />
  323. </el-form-item>
  324. <el-form-item label="创建人" prop="createrCode">
  325. <el-input v-model="form.createrCode" placeholder="请输入创建人" />
  326. </el-form-item>
  327. <el-form-item label="创建时间" prop="createdate">
  328. <el-date-picker clearable size="small" style="width: 200px"
  329. v-model="form.createdate"
  330. type="date"
  331. value-format="yyyy-MM-dd"
  332. placeholder="选择创建时间">
  333. </el-date-picker>
  334. </el-form-item>
  335. <el-form-item label="修改人" prop="updaterCode">
  336. <el-input v-model="form.updaterCode" placeholder="请输入修改人" />
  337. </el-form-item>
  338. <el-form-item label="修改时间" prop="updatedate">
  339. <el-date-picker clearable size="small" style="width: 200px"
  340. v-model="form.updatedate"
  341. type="date"
  342. value-format="yyyy-MM-dd"
  343. placeholder="选择修改时间">
  344. </el-date-picker>
  345. </el-form-item>
  346. <el-form-item label="部门编号" prop="deptId">
  347. <el-input v-model="form.deptId" placeholder="请输入部门编号" />
  348. </el-form-item>
  349. <el-form-item label="备注" prop="remarks">
  350. <el-input v-model="form.remarks" placeholder="请输入备注" />
  351. </el-form-item>
  352. <el-form-item label="归属部门" prop="deptId">
  353. <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
  354. </el-form-item>
  355. </el-form>
  356. <div slot="footer" class="dialog-footer">
  357. <el-button type="primary" @click="submitForm">确 定</el-button>
  358. <el-button @click="cancel">取 消</el-button>
  359. </div>
  360. </el-dialog>
  361. <!-- 用户导入对话框 -->
  362. <el-dialog :close-on-click-modal="false" :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
  363. <el-upload
  364. ref="upload"
  365. :limit="1"
  366. accept=".xlsx, .xls"
  367. :headers="upload.headers"
  368. :action="upload.url + '?updateSupport=' + upload.updateSupport"
  369. :disabled="upload.isUploading"
  370. :on-progress="handleFileUploadProgress"
  371. :on-success="handleFileSuccess"
  372. :auto-upload="false"
  373. drag
  374. >
  375. <i class="el-icon-upload"></i>
  376. <div class="el-upload__text">
  377. 将文件拖到此处,或
  378. <em>点击上传</em>
  379. </div>
  380. <div class="el-upload__tip" slot="tip">
  381. <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
  382. <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
  383. </div>
  384. <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
  385. </el-upload>
  386. <div slot="footer" class="dialog-footer">
  387. <el-button type="primary" @click="submitFileForm">确 定</el-button>
  388. <el-button @click="upload.open = false">取 消</el-button>
  389. </div>
  390. </el-dialog>
  391. </div>
  392. </template>
  393. <script>
  394. import { listAirtight, getAirtight, delAirtight, addAirtight, updateAirtight, exportAirtight, importTemplate} from "@/api/pssr/airtight";
  395. import { treeselect } from "@/api/system/dept";
  396. import { getToken } from "@/utils/auth";
  397. import Treeselect from "@riophae/vue-treeselect";
  398. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  399. export default {
  400. name: "Airtight",
  401. components: { Treeselect },
  402. props: {
  403. subId: {
  404. type: Number,
  405. default: 0
  406. },
  407. isApprove: {
  408. type: Number,
  409. default: 0
  410. },
  411. },
  412. data() {
  413. return {
  414. // 遮罩层
  415. loading: true,
  416. // 选中数组
  417. ids: [],
  418. // 非单个禁用
  419. single: true,
  420. // 非多个禁用
  421. multiple: true,
  422. // 显示搜索条件
  423. showSearch: false,
  424. // 总条数
  425. total: 0,
  426. // 气密表格数据
  427. airtightList: [],
  428. // 弹出层标题
  429. title: "",
  430. // 部门树选项
  431. deptOptions: undefined,
  432. clientHeight:300,
  433. // 是否显示弹出层
  434. open: false,
  435. // 用户导入参数
  436. upload: {
  437. // 是否显示弹出层(用户导入)
  438. open: false,
  439. // 弹出层标题(用户导入)
  440. title: "",
  441. // 是否禁用上传
  442. isUploading: false,
  443. // 是否更新已经存在的用户数据
  444. updateSupport: 0,
  445. // 设置上传的请求头部
  446. headers: { Authorization: "Bearer " + getToken() },
  447. // 上传的地址
  448. url: process.env.VUE_APP_BASE_API + "/pssr/airtight/importData"
  449. },
  450. // 查询参数
  451. queryParams: {
  452. pageNum: 1,
  453. pageSize: 20,
  454. subId: this.subId,
  455. approveId: null,
  456. unit: null,
  457. systemName: null,
  458. airtightMedium: null,
  459. airtightPressure: null,
  460. initialPressure: null,
  461. finalPressure: null,
  462. leakageRate: null,
  463. standard: null,
  464. identifyingPerson: null,
  465. confirmationDate: null,
  466. createrCode: null,
  467. createdate: null,
  468. updaterCode: null,
  469. updatedate: null,
  470. deptId: null,
  471. remarks: null
  472. },
  473. // 表单参数
  474. form: {},
  475. // 表单校验
  476. rules: {
  477. }
  478. };
  479. },
  480. watch: {
  481. // 根据名称筛选部门树
  482. deptName(val) {
  483. this.$refs.tree.filter(val);
  484. }
  485. },
  486. created() {
  487. //设置表格高度对应屏幕高度
  488. this.$nextTick(() => {
  489. this.clientHeight = document.body.clientHeight -250
  490. })
  491. this.getList();
  492. this.getTreeselect();
  493. },
  494. methods: {
  495. /** 查询气密列表 */
  496. getList() {
  497. this.loading = true;
  498. listAirtight(this.queryParams).then(response => {
  499. this.airtightList = response.rows;
  500. this.total = response.total;
  501. this.loading = false;
  502. });
  503. },
  504. /** 查询部门下拉树结构 */
  505. getTreeselect() {
  506. treeselect().then(response => {
  507. this.deptOptions = response.data;
  508. });
  509. },
  510. // 取消按钮
  511. cancel() {
  512. this.open = false;
  513. this.reset();
  514. },
  515. // 表单重置
  516. reset() {
  517. this.form = {
  518. id: null,
  519. subId: this.subId,
  520. approveId: null,
  521. unit: null,
  522. systemName: null,
  523. airtightMedium: null,
  524. airtightPressure: null,
  525. initialPressure: null,
  526. finalPressure: null,
  527. leakageRate: null,
  528. standard: null,
  529. identifyingPerson: null,
  530. confirmationDate: null,
  531. delFlag: null,
  532. createrCode: null,
  533. createdate: null,
  534. updaterCode: null,
  535. updatedate: null,
  536. deptId: null,
  537. remarks: null
  538. };
  539. this.resetForm("form");
  540. },
  541. /** 搜索按钮操作 */
  542. handleQuery() {
  543. this.queryParams.pageNum = 1;
  544. this.getList();
  545. },
  546. /** 重置按钮操作 */
  547. resetQuery() {
  548. this.resetForm("queryForm");
  549. this.handleQuery();
  550. },
  551. // 多选框选中数据
  552. handleSelectionChange(selection) {
  553. this.ids = selection.map(item => item.id)
  554. this.single = selection.length!==1
  555. this.multiple = !selection.length
  556. },
  557. /** 新增按钮操作 */
  558. handleAdd() {
  559. this.reset();
  560. this.open = true;
  561. this.title = "添加气密";
  562. },
  563. /** 修改按钮操作 */
  564. handleUpdate(row) {
  565. this.reset();
  566. const id = row.id || this.ids
  567. getAirtight(id).then(response => {
  568. this.form = response.data;
  569. this.open = true;
  570. this.title = "修改气密";
  571. });
  572. },
  573. /** 提交按钮 */
  574. submitForm() {
  575. this.$refs["form"].validate(valid => {
  576. if (valid) {
  577. if (this.form.id != null) {
  578. updateAirtight(this.form).then(response => {
  579. this.msgSuccess("修改成功");
  580. this.open = false;
  581. this.getList();
  582. });
  583. } else {
  584. addAirtight(this.form).then(response => {
  585. this.msgSuccess("新增成功");
  586. this.open = false;
  587. this.getList();
  588. });
  589. }
  590. }
  591. });
  592. },
  593. /** 删除按钮操作 */
  594. handleDelete(row) {
  595. const ids = row.id || this.ids;
  596. this.$confirm('是否确认删除?', "警告", {
  597. confirmButtonText: "确定",
  598. cancelButtonText: "取消",
  599. type: "warning"
  600. }).then(function() {
  601. return delAirtight(ids);
  602. }).then(() => {
  603. this.getList();
  604. this.msgSuccess("删除成功");
  605. })
  606. },
  607. /** 导出按钮操作 */
  608. handleExport() {
  609. const queryParams = this.queryParams;
  610. this.$confirm('是否确认导出所有气密数据项?', "警告", {
  611. confirmButtonText: "确定",
  612. cancelButtonText: "取消",
  613. type: "warning"
  614. }).then(function() {
  615. return exportAirtight(queryParams);
  616. }).then(response => {
  617. this.download(response.msg);
  618. })
  619. },
  620. /** 导入按钮操作 */
  621. handleImport() {
  622. this.upload.title = "用户导入";
  623. this.upload.open = true;
  624. },
  625. /** 下载模板操作 */
  626. importTemplate() {
  627. importTemplate().then(response => {
  628. this.download(response.msg);
  629. });
  630. },
  631. // 文件上传中处理
  632. handleFileUploadProgress(event, file, fileList) {
  633. this.upload.isUploading = true;
  634. },
  635. // 文件上传成功处理
  636. handleFileSuccess(response, file, fileList) {
  637. this.upload.open = false;
  638. this.upload.isUploading = false;
  639. this.$refs.upload.clearFiles();
  640. this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
  641. this.getList();
  642. },
  643. // 提交上传文件
  644. submitFileForm() {
  645. this.$refs.upload.submit();
  646. }
  647. }
  648. };
  649. </script>