SbInfo.vue 25 KB

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