SbInfo.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738
  1. <template>
  2. <a-card :bordered="false">
  3. <a-row :gutter="8" v-show="visible">
  4. <a-col :span="24">
  5. <div>
  6. <div class="table-page-search-wrapper">
  7. <a-form layout="inline">
  8. <a-row :gutter="48">
  9. <a-col :md="6" :sm="24">
  10. <a-form-item label="关键字">
  11. <a-input v-model.trim="queryParam.keyword" placeholder="名称/设备新号"/>
  12. </a-form-item>
  13. </a-col>
  14. <a-col :md="6" :sm="24">
  15. <a-form-item label="设备旧号">
  16. <a-input v-model="queryParam.zbh" placeholder="设备旧号"/>
  17. </a-form-item>
  18. </a-col>
  19. <a-col :md="6" :sm="24">
  20. <a-form-item label="第一维修人">
  21. <a-input v-model="queryParam.repairUserName" placeholder="第一维修人"/>
  22. </a-form-item>
  23. </a-col>
  24. <a-col :md="6" :sm="24">
  25. <a-form-item label="第二维修人">
  26. <a-input v-model="queryParam.repairUserSecondName" placeholder="第二维修人"/>
  27. </a-form-item>
  28. </a-col>
  29. <a-col :md="6" :sm="24">
  30. <a-form-item label="设备等级">
  31. <a-select v-model="queryParam.level" placeholder="请选择">
  32. <a-select-option
  33. v-for="(label,value) in levelMap"
  34. :key="value"
  35. :label="label"
  36. :value="parseInt(value)">{{ label }}
  37. </a-select-option>
  38. </a-select>
  39. </a-form-item>
  40. </a-col>
  41. <a-col :md="6" :sm="24">
  42. <a-form-item label="自定义类型">
  43. <a-select v-model="queryParam.useType" placeholder="请选择">
  44. <a-select-option
  45. v-for="(label,value) in useTypeMap"
  46. :key="value"
  47. :label="label"
  48. :value="parseInt(value)">{{ label }}
  49. </a-select-option>
  50. </a-select>
  51. </a-form-item>
  52. </a-col>
  53. <a-col :md="6" :sm="24">
  54. <a-form-item label="规格型号">
  55. <a-input v-model="queryParam.model" placeholder="规格型号"/>
  56. </a-form-item>
  57. </a-col>
  58. <a-col :md="6" :sm="24">
  59. <a-form-item label="设备位置">
  60. <a-select v-model="queryParam.positionId" placeholder="请选择">
  61. <a-select-option
  62. v-for="({id,name}) in sbPositionData"
  63. :key="id"
  64. :label="name"
  65. :value="id">{{ name }}
  66. </a-select-option>
  67. </a-select>
  68. </a-form-item>
  69. </a-col>
  70. <a-col :md="6" :sm="24">
  71. <a-form-item label="生产商">
  72. <a-input v-model="queryParam.producerName" placeholder="生产商名称"/>
  73. </a-form-item>
  74. </a-col>
  75. <a-col :md="6" :sm="24">
  76. <a-form-item label="设备类型">
  77. <a-tree-select
  78. style="width: 100%"
  79. :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
  80. :treeData="treeData"
  81. :treeNodeFilterProp="'title'"
  82. :showSearch="true"
  83. v-model="queryParam.typeId"
  84. placeholder="请选择"
  85. >
  86. </a-tree-select>
  87. </a-form-item>
  88. </a-col>
  89. <a-col :md="6" :sm="24">
  90. <a-form-item label="设备状态">
  91. <a-select v-model="queryParam.status" placeholder="请选择">
  92. <a-select-option
  93. v-for="(label,value) in statusMap"
  94. :key="value"
  95. :defaultValue="DictCache.VALUE.SB_INFO_STATUS.IN_USE"
  96. :label="label"
  97. :value="parseInt(value)">{{ label }}
  98. </a-select-option>
  99. </a-select>
  100. </a-form-item>
  101. </a-col>
  102. <a-col :md="6" :sm="24">
  103. <a-form-item label="主子设备">
  104. <a-select v-model="queryParam.isChild" placeholder="请选择">
  105. <a-select-option value="1">子设备</a-select-option>
  106. <a-select-option value="2">父设备</a-select-option>
  107. <a-select-option value="3">普通设备</a-select-option>
  108. </a-select>
  109. </a-form-item>
  110. </a-col>
  111. <a-col :md="6 || 24" :sm="24">
  112. <span class="table-page-search-submitButtons">
  113. <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
  114. <a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
  115. </span>
  116. </a-col>
  117. </a-row>
  118. </a-form>
  119. </div>
  120. <div class="table-operator" style="margin-bottom: 8px;">
  121. <a-button v-if="$auth('sb-infos-add')" type="primary" icon="plus" @click="handleAdd">新增</a-button>
  122. <a-button style="margin-left: 8px" v-if="$auth('sb-infos-export')" type="primary" icon="download" @click="doExport">导出</a-button>
  123. <a-button style="margin-left:8px;" type="primary" @click="doImport">
  124. <a-icon type="upload"/>
  125. 新增导入
  126. </a-button>
  127. <a-button style="margin-left:8px;" type="primary" @click="doImportForUpdate">
  128. <a-icon type="upload"/>
  129. 修改导入
  130. </a-button>
  131. <a-button style="margin-left: 8px" type="primary" icon="printer" @click="handlePrintBatch()">批量打印</a-button>
  132. <a-button style="margin-left: 8px" v-if="$auth('sb-infos-generate-code-all')" :loading="confirmLoading" type="primary" @click="batchGenerate()">重新生成二维码</a-button>
  133. <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && $auth('sb-infos-del')">
  134. <a-menu slot="overlay">
  135. <a-popconfirm title="是否要删除所选数据?" @confirm="batchDelete()">
  136. <a-menu-item key="1"><a-icon type="delete" /><a>删除</a></a-menu-item>
  137. </a-popconfirm>
  138. </a-menu>
  139. <a-button style="margin-left: 8px">
  140. 批量操作 <a-icon type="down" />
  141. </a-button>
  142. </a-dropdown>
  143. </div>
  144. <s-table
  145. ref="table"
  146. size="default"
  147. rowKey="id"
  148. :widthSpace="true"
  149. :columns="columns"
  150. :data="loadData"
  151. :alert="options.alert"
  152. :rowSelection="options.rowSelection"
  153. :scroll="{x: 1500, y: BaseTool.Constant.scrollY}"
  154. showPagination="auto"
  155. >
  156. <span slot="action" slot-scope="record">
  157. <template>
  158. <div>
  159. <!--<a-divider type="vertical" />
  160. <a-popconfirm v-if="$auth('sb-infos-del')" title="是否要删除该设备?" @confirm="batchDelete(record.id)">
  161. <a>删除</a>
  162. </a-popconfirm>
  163. <a-divider type="vertical" />
  164. <a @click="handleCopy(record)">复制</a>-->
  165. <a-dropdown>
  166. <a-menu slot="overlay">
  167. <a-menu-item key="0">
  168. <a @click="handleView(record)">查看</a>
  169. </a-menu-item>
  170. <a-menu-item key="1">
  171. <a v-if="$auth('sb-infos-edit')" @click="handleEdit(record)">修改</a>
  172. </a-menu-item>
  173. <a-menu-item v-if="record.status != 2" key="2">
  174. <a-popconfirm title="是否要启用该设备?" @confirm="handleStart(record)">
  175. <a>启用</a>
  176. </a-popconfirm>
  177. </a-menu-item>
  178. <a-menu-item v-if="record.status != 7" key="3">
  179. <a-popconfirm title="是否要停用该设备?" @confirm="handleStop(record)">
  180. <a>停用</a>
  181. </a-popconfirm>
  182. </a-menu-item>
  183. <a-menu-item key="10">
  184. <a v-if="$auth('sb-infos-edit')" @click="handleCopy(record)">复制</a>
  185. </a-menu-item>
  186. <a-menu-item key="4">
  187. <a @click="handlePrint(record)">打印</a>
  188. </a-menu-item>
  189. </a-menu>
  190. <a-button> 操作 <a-icon type="down" /> </a-button>
  191. </a-dropdown>
  192. </div>
  193. </template>
  194. </span>
  195. <span slot="status" slot-scope="text">
  196. <badge
  197. :status="DictCache.COLOR.SB_INFO_STATUS[text]"
  198. :text="statusMap[text]" />
  199. </span>
  200. </s-table>
  201. </div>
  202. </a-col>
  203. </a-row>
  204. <base-form ref="baseModal" :parent-id="queryParam.parentId" :parent-name="queryParam.parentName" @ok="handleOk"/>
  205. <base-form-status-log ref="baseModalStatusLog" @ok="handleOk"/>
  206. <detail ref="detailModal" @ok="handleOk"/>
  207. <download-modal ref="downloadModal"/>
  208. <preview-modal ref="previewModal"/>
  209. <import-form-add ref="importModal" @ok="handleOk"/>
  210. <import-form-update ref="importModalUpdate" @ok="handleOk"/>
  211. <print-sb-code ref="printSbCode"/>
  212. <print-in-sb-info-batch ref="printInSbInfoBatch" @ok="handleOk"/>
  213. </a-card>
  214. </template>
  215. <script>
  216. import { STable, Ellipsis } from '@/components'
  217. import BaseForm from './modules/BaseForm'
  218. import BaseFormStatusLog from '@/views/sb/status-log/modules/BaseForm'
  219. import Detail from './modules/Detail'
  220. import DownloadModal from '@/views/download/DownloadModal'
  221. import PreviewModal from '@/views/preview/PreviewModal'
  222. import { getSbInfoPage, deleteSbInfos, fetchSbInfo, fetchSbInfos, exportSbInfo } from '@/api/sb/info'
  223. import { queryDept } from '@/api/upms/dept'
  224. import { generateSbCodeAll } from '@/api/upms/code'
  225. import { fetchSbTypeTree } from '@/api/sb/type'
  226. import ImportFormAdd from './modules/ImportFormAdd'
  227. import ImportFormUpdate from './modules/ImportFormUpdate'
  228. import PrintSbCode from '@/views/sb/info/modules/PrintSbCode'
  229. import PrintInSbInfoBatch from '@/views/sb/info/modules/PrintInSbInfoBatch'
  230. import { querySbPosition } from '@/api/sb/position'
  231. export default {
  232. name: 'SbInfoList',
  233. components: {
  234. STable,
  235. Ellipsis,
  236. BaseForm,
  237. Detail,
  238. DownloadModal,
  239. PreviewModal,
  240. PrintSbCode,
  241. ImportFormAdd,
  242. ImportFormUpdate,
  243. PrintInSbInfoBatch,
  244. BaseFormStatusLog
  245. },
  246. props: {
  247. filter: {
  248. type: Number,
  249. default: -1
  250. },
  251. useType: {
  252. type: Number,
  253. default: null
  254. }
  255. },
  256. data () {
  257. return {
  258. // 查询参数
  259. queryParam: {
  260. filter: this.filter,
  261. useType: this.useType,
  262. id: this.$route.query.id
  263. },
  264. depreciationTypeMap: {},
  265. visible: true,
  266. sbPositionData: [],
  267. levelMap: {},
  268. unitMap: {},
  269. areaList: {},
  270. companyList: {},
  271. projectList: {},
  272. isChildMap: {},
  273. isShowMap: {},
  274. deptList: {},
  275. confirmLoading: false,
  276. useTypeMap: {},
  277. statusMap: {},
  278. expandedKeys: [],
  279. selectedKeys: [],
  280. sourceTypeMap: {},
  281. treeData: [],
  282. // 表头
  283. columns: [
  284. {
  285. title: '序号',
  286. dataIndex: 'index',
  287. width: 100,
  288. checked: true,
  289. customRender: (text, record, index) => {
  290. return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
  291. }
  292. },
  293. {
  294. title: '设备编号',
  295. dataIndex: 'no',
  296. width: 120,
  297. checked: true
  298. },
  299. {
  300. title: '设备名称',
  301. checked: true,
  302. width: 200,
  303. dataIndex: 'name'
  304. },
  305. {
  306. title: '设备旧号',
  307. dataIndex: 'zbh',
  308. width: 120,
  309. checked: true
  310. },
  311. {
  312. title: '设备类型',
  313. checked: true,
  314. dataIndex: 'type',
  315. width: 150,
  316. customRender: (text, record, index) => {
  317. return record.typeName
  318. }
  319. },
  320. {
  321. title: '设备等级',
  322. checked: true,
  323. dataIndex: 'level',
  324. width: 120,
  325. customRender: (text, record, index) => {
  326. return this.BaseTool.Object.getField(this.levelMap, text)
  327. }
  328. },
  329. {
  330. title: '规格型号',
  331. dataIndex: 'model',
  332. width: 120,
  333. checked: true
  334. },
  335. {
  336. title: '自定义类型',
  337. checked: true,
  338. dataIndex: 'useType',
  339. width: 150,
  340. customRender: (text, record, index) => {
  341. return this.BaseTool.Object.getField(this.useTypeMap, text)
  342. }
  343. },
  344. {
  345. title: '第一维修人',
  346. checked: true,
  347. width: 150,
  348. dataIndex: 'repairUserName'
  349. },
  350. {
  351. title: '第二维修人',
  352. checked: true,
  353. width: 150,
  354. dataIndex: 'repairUserNameSecond'
  355. },
  356. {
  357. title: '设备位置',
  358. checked: true,
  359. width: 200,
  360. dataIndex: 'positionName'
  361. },
  362. {
  363. title: '使用机台',
  364. checked: true,
  365. width: 200,
  366. dataIndex: 'saveUserName'
  367. },
  368. {
  369. title: '生产商',
  370. dataIndex: 'producerName',
  371. width: 120,
  372. checked: true
  373. },
  374. {
  375. title: '大小尺寸',
  376. dataIndex: 'zz',
  377. width: 120,
  378. checked: true
  379. },
  380. {
  381. title: '系列号(出厂编号)',
  382. dataIndex: 'zzh',
  383. width: 120,
  384. checked: true
  385. },
  386. {
  387. title: '是否显示',
  388. dataIndex: 'isShow',
  389. width: 120,
  390. checked: true,
  391. customRender: (text, record, index) => {
  392. return this.BaseTool.Object.getField(this.isShowMap, text)
  393. }
  394. },
  395. {
  396. title: '是否子设备',
  397. dataIndex: 'isChild',
  398. width: 120,
  399. checked: true,
  400. customRender: (text, record, index) => {
  401. return this.BaseTool.Object.getField(this.isChildMap, text)
  402. }
  403. },
  404. {
  405. title: '资产编号1',
  406. dataIndex: 'financingNo',
  407. width: 120,
  408. checked: true
  409. },
  410. {
  411. title: '设备原值',
  412. dataIndex: 'initialValue',
  413. width: 100,
  414. checked: true,
  415. customRender: (text, record, index) => {
  416. return this.BaseTool.Amount.formatter(text)
  417. }
  418. },
  419. {
  420. title: '购置日期',
  421. dataIndex: 'buyDate',
  422. width: 120,
  423. checked: true
  424. },
  425. {
  426. title: '投用日期',
  427. dataIndex: 'startDate',
  428. width: 120,
  429. checked: true
  430. },
  431. /* {
  432. title: '检定日期',
  433. dataIndex: 'checkDate',
  434. width: 150,
  435. checked: true
  436. },
  437. {
  438. title: '检定周期',
  439. dataIndex: 'checkPeriod',
  440. width: 100,
  441. checked: true,
  442. customRender: (text, record, index) => {
  443. if (record.nextCheckDate == null) {
  444. return '未知'
  445. } else {
  446. return text + '月'
  447. }
  448. }
  449. },
  450. {
  451. title: '检定有效期',
  452. dataIndex: 'nextCheckDate',
  453. width: 150,
  454. checked: true
  455. },
  456. {
  457. title: '检定截止',
  458. dataIndex: 'restDay',
  459. width: 100,
  460. checked: true,
  461. customRender: (text, record, index) => {
  462. if (record.nextCheckDate == null) {
  463. return '未知'
  464. } else {
  465. return this.BaseTool.Date.getCountBetween(new Date(), record.nextCheckDate, 1) + '天'
  466. }
  467. }
  468. }, */
  469. {
  470. title: '状态',
  471. checked: true,
  472. dataIndex: 'status',
  473. width: 100,
  474. fixed: 'right',
  475. scopedSlots: { customRender: 'status' }
  476. },
  477. {
  478. title: '操作',
  479. key: 'action',
  480. checked: true,
  481. fixed: 'right',
  482. align: 'center',
  483. width: '200',
  484. scopedSlots: { customRender: 'action' }
  485. }
  486. ],
  487. // 加载数据方法 必须为 Promise 对象
  488. loadData: parameter => {
  489. parameter = {
  490. ...parameter,
  491. ...this.queryParam,
  492. dataScope: {
  493. sortBy: 'asc',
  494. sortName: 'no'
  495. }
  496. }
  497. console.log(parameter)
  498. return getSbInfoPage(Object.assign(parameter, this.queryParam))
  499. .then(res => {
  500. return res.data
  501. })
  502. },
  503. selectedRowKeys: [],
  504. selectedRows: [],
  505. options: {
  506. alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
  507. rowSelection: {
  508. selectedRowKeys: this.selectedRowKeys,
  509. onChange: this.onSelectChange
  510. }
  511. },
  512. optionAlertShow: false
  513. }
  514. },
  515. created () {
  516. console.log('this.$route.query.parentId: ' + this.$route.query.parentId)
  517. this.queryParam.parentId = this.$route.query.parentId
  518. this.queryParam.parentName = this.$route.query.parentName
  519. this.tableOption()
  520. this.depreciationTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_DEPRECIATIONTYPE)
  521. this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_LEVEL)
  522. this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_INFO_STATUS)
  523. this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_UNIT)
  524. this.sourceTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBTYPE_SOURCETYPE)
  525. this.useTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_USE_TYPE)
  526. this.isChildMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_IS_CHILD)
  527. this.isShowMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_IS_SHOW)
  528. },
  529. methods: {
  530. tableOption () {
  531. this.setTree()
  532. if (!this.optionAlertShow) {
  533. this.options = {
  534. alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
  535. rowSelection: {
  536. selectedRowKeys: this.selectedRowKeys,
  537. onChange: this.onSelectChange,
  538. getCheckboxProps: record => ({
  539. props: {
  540. disabled: false,
  541. name: record.id
  542. }
  543. })
  544. }
  545. }
  546. this.optionAlertShow = true
  547. } else {
  548. this.options = {
  549. alert: false,
  550. rowSelection: null
  551. }
  552. this.optionAlertShow = false
  553. }
  554. },
  555. batchDelete (id) {
  556. let ids = []
  557. if (this.BaseTool.String.isBlank(id)) {
  558. const length = this.selectedRows.length
  559. if (length === 0) {
  560. this.$message.info('请选择要删除的记录')
  561. return
  562. }
  563. ids = this.selectedRows.map(item => item.id)
  564. } else {
  565. ids = [id]
  566. }
  567. deleteSbInfos(ids).then(res => {
  568. this.$message.info('删除成功')
  569. this.handleOk()
  570. this.$refs.table.clearSelected()
  571. })
  572. },
  573. batchGenerate () {
  574. this.confirmLoading = true
  575. this.$message.info('正在生成请稍后')
  576. generateSbCodeAll().then(res => {
  577. this.confirmLoading = false
  578. this.$message.info('生成成功')
  579. this.handleOk()
  580. this.$refs.table.clearSelected()
  581. })
  582. },
  583. handleEdit (record) {
  584. fetchSbInfo({ id: record.id }).then(res => {
  585. this.visible = false
  586. const modal = this.$refs.baseModal
  587. modal.base(res.data)
  588. })
  589. },
  590. handlePrint (record) {
  591. this.visible = false
  592. fetchSbInfo({ id: record.id }).then(res => {
  593. const modal = this.$refs.printInSbInfoBatch
  594. modal.base([res.data])
  595. })
  596. },
  597. handlePrintBatch () {
  598. this.visible = false
  599. let ids = []
  600. const length = this.selectedRows.length
  601. if (length === 0) {
  602. this.$message.info('请选择要打印的设备')
  603. return
  604. }
  605. ids = this.selectedRows.map(item => item.id)
  606. fetchSbInfos(ids).then(res => {
  607. const modal = this.$refs.printInSbInfoBatch
  608. modal.base(res.data)
  609. })
  610. },
  611. handleStart (record) {
  612. const modal = this.$refs.baseModalStatusLog
  613. modal.base(null, {
  614. sbId: record.id,
  615. sbNo: record.no,
  616. changeUserId: this.$store.getters.userInfo.userId,
  617. actualUser: this.$store.getters.userInfo.realName,
  618. preStatus: record.status,
  619. afterStatus: this.DictCache.VALUE.SB_INFO_STATUS.IN_USE
  620. })
  621. },
  622. handleStop (record) {
  623. const modal = this.$refs.baseModalStatusLog
  624. modal.base(null, {
  625. sbId: record.id,
  626. sbNo: record.no,
  627. changeUserId: this.$store.getters.userInfo.userId,
  628. actualUser: this.$store.getters.userInfo.realName,
  629. preStatus: record.status,
  630. afterStatus: this.DictCache.VALUE.SB_INFO_STATUS.IN_STOP
  631. })
  632. },
  633. handleAdd () {
  634. this.visible = false
  635. this.$refs.baseModal.base()
  636. },
  637. handleView (record) {
  638. fetchSbInfo({ id: record.id }).then(res => {
  639. this.visible = false
  640. const modal = this.$refs.detailModal
  641. modal.base(res.data)
  642. })
  643. },
  644. handleCopy (record) {
  645. this.visible = false
  646. fetchSbInfo({ id: record.id }).then(res => {
  647. const modal = this.$refs.baseModal
  648. modal.base(res.data, 1)
  649. })
  650. },
  651. handleOk () {
  652. this.visible = true
  653. this.setTree()
  654. this.$refs.table.refresh()
  655. },
  656. onSelectChange (selectedRowKeys, selectedRows) {
  657. this.selectedRowKeys = selectedRowKeys
  658. this.selectedRows = selectedRows
  659. },
  660. resetSearchForm () {
  661. this.queryParam = {
  662. filter: this.filter,
  663. useType: this.useType
  664. }
  665. this.visible = true
  666. this.$refs.table.refresh(true)
  667. },
  668. doExport () {
  669. const parameter = {
  670. ...this.queryParam,
  671. dataScope: {
  672. sortBy: 'asc',
  673. sortName: 'no'
  674. }
  675. }
  676. exportSbInfo(parameter).then(file => {
  677. this.BaseTool.UPLOAD.downLoadExportExcel(file)
  678. })
  679. },
  680. setTree (record = {}) {
  681. queryDept({ nature: this.DictCache.VALUE.SYS_DEPT_NATURE.JITUAN }).then(res => {
  682. this.areaList = res.data
  683. })
  684. fetchSbTypeTree().then(res => {
  685. this.treeData = res.data
  686. })
  687. querySbPosition().then(res => {
  688. this.sbPositionData = res.data
  689. })
  690. },
  691. onSelect: function (selectedKeys, info) {
  692. this.selectedKeys = selectedKeys
  693. this.queryParam.typeId = selectedKeys.length > 0 ? selectedKeys[0] : ''
  694. this.$refs.table.refresh(true)
  695. },
  696. onExpand (expandedKeys) {
  697. this.expandedKeys = expandedKeys
  698. this.autoExpandParent = false
  699. },
  700. handleRepairFilePreview (record) {
  701. console.log(record, 87878)
  702. this.$refs.previewModal.base(record.id, this.DictCache.VALUE.FILE_MODULE.SBINFO_REPAIRFILE)
  703. },
  704. handleRepairFileDownload (record) {
  705. // this.$refs.downloadModal.base(record.id, this.DictCache.VALUE.FILE_MODULE.SBINFO_REPAIRFILE, getDownloadUrl(record.id))
  706. },
  707. handleUseFilePreview (record) {
  708. this.$refs.previewModal.base(record.id, this.DictCache.VALUE.FILE_MODULE.SBINFO_USEFILE)
  709. },
  710. handleUseFileDownload (record) {
  711. // this.$refs.downloadModal.base(record.id, this.DictCache.VALUE.FILE_MODULE.SBINFO_USEFILE, getDownloadUrl(record.id))
  712. },
  713. handleCheckFilePreview (record) {
  714. this.$refs.previewModal.base(record.id, this.DictCache.VALUE.FILE_MODULE.SBINFO_RECHECKFILE)
  715. },
  716. handleCheckFileDownload (record) {
  717. // this.$refs.downloadModal.base(record.id, this.DictCache.VALUE.FILE_MODULE.SBINFO_RECHECKFILE, getDownloadUrl(record.id))
  718. },
  719. doImport () {
  720. this.$refs.importModal.base(null, null)
  721. },
  722. doImportForUpdate () {
  723. this.$refs.importModalUpdate.base(null, null)
  724. }
  725. }
  726. }
  727. </script>