SpotcheckItemList.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <template>
  2. <a-card :bordered="false">
  3. <!-- 查询区域 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline" @keyup.enter.native="searchQuery">
  6. <a-row :gutter="24">
  7. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  8. <a-form-item label="点检项名称">
  9. <a-input placeholder="请输入点检项名称" v-model="queryParam.itemname"></a-input>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  13. <a-form-item label="设备类型">
  14. <!-- <j-search-select-tag placeholder="请选择设备类型" v-model="queryParam.equipmenttreeid" dict="tpm_equipment_tree,name,id"/> -->
  15. <j-tree-select
  16. ref="treeSelect"
  17. placeholder="请选择设备类型"
  18. v-model="queryParam.equipmenttreeid"
  19. dict="tpm_equipment_tree,name,id"
  20. pidField="parentid"
  21. pidValue="0"
  22. hasChildField="has_child"
  23. >
  24. </j-tree-select>
  25. </a-form-item>
  26. </a-col>
  27. <template v-if="toggleSearchStatus">
  28. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  29. <a-form-item label="点检项编号">
  30. <a-input placeholder="请输入点检项编号" v-model="queryParam.itemcode"></a-input>
  31. </a-form-item>
  32. </a-col>
  33. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  34. <a-form-item label="点检项分类">
  35. <j-dict-select-tag placeholder="请选择点检项分类" v-model="queryParam.itemtype" dictCode="spotcheck_item_type"/>
  36. </a-form-item>
  37. </a-col>
  38. </template>
  39. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  40. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  41. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  42. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  43. <a @click="handleToggleSearch" style="margin-left: 8px">
  44. {{ toggleSearchStatus ? '收起' : '展开' }}
  45. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  46. </a>
  47. </span>
  48. </a-col>
  49. </a-row>
  50. </a-form>
  51. </div>
  52. <!-- 查询区域-END -->
  53. <!-- 操作按钮区域 -->
  54. <div class="table-operator">
  55. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  56. <!-- <a-button type="primary" icon="download" @click="handleExportXls('点检项')">导出</a-button>
  57. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  58. <a-button type="primary" icon="import">导入</a-button>
  59. </a-upload> -->
  60. <!-- 高级查询区域 -->
  61. <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> -->
  62. <a-dropdown v-if="selectedRowKeys.length > 0">
  63. <a-menu slot="overlay">
  64. <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  65. </a-menu>
  66. <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  67. </a-dropdown>
  68. </div>
  69. <!-- table区域-begin -->
  70. <div>
  71. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  72. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  73. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  74. </div>
  75. <a-table
  76. ref="table"
  77. size="middle"
  78. :scroll="{x:true}"
  79. bordered
  80. rowKey="id"
  81. :columns="columns"
  82. :dataSource="dataSource"
  83. :pagination="ipagination"
  84. :loading="loading"
  85. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  86. class="j-table-force-nowrap"
  87. @change="handleTableChange">
  88. <template slot="htmlSlot" slot-scope="text">
  89. <div v-html="text"></div>
  90. </template>
  91. <template slot="imgSlot" slot-scope="text,record">
  92. <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  93. <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  94. </template>
  95. <template slot="fileSlot" slot-scope="text">
  96. <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  97. <a-button
  98. v-else
  99. :ghost="true"
  100. type="primary"
  101. icon="download"
  102. size="small"
  103. @click="downloadFile(text)">
  104. 下载
  105. </a-button>
  106. </template>
  107. <span slot="action" slot-scope="text, record">
  108. <a @click="handleEdit(record)">编辑</a>
  109. <a-divider type="vertical" />
  110. <a @click="handleDetail(record)">详情</a>
  111. <a-divider type="vertical" />
  112. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  113. <a>删除</a>
  114. </a-popconfirm>
  115. <!-- <a-divider type="vertical" />
  116. <a-dropdown>
  117. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  118. <a-menu slot="overlay">
  119. <a-menu-item>
  120. <a @click="handleDetail(record)">详情</a>
  121. </a-menu-item>
  122. <a-menu-item>
  123. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  124. <a>删除</a>
  125. </a-popconfirm>
  126. </a-menu-item>
  127. </a-menu>
  128. </a-dropdown> -->
  129. </span>
  130. </a-table>
  131. </div>
  132. <!-- <cmms-spotcheck-item-modal ref="modalForm" @ok="modalFormOk"></cmms-spotcheck-item-modal> -->
  133. <spotcheck-item-modal ref="modalForm" @ok="modalFormOk"></spotcheck-item-modal>
  134. </a-card>
  135. </template>
  136. <script>
  137. import '@/assets/less/TableExpand.less'
  138. import { mixinDevice } from '@/utils/mixin'
  139. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  140. import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
  141. import SpotcheckItemModal from './modules/SpotcheckItemModal.vue'
  142. export default {
  143. name: 'SpotcheckItemList',
  144. mixins:[JeecgListMixin, mixinDevice],
  145. components: {
  146. SpotcheckItemModal
  147. },
  148. data () {
  149. return {
  150. description: '点检项管理页面',
  151. // 表头
  152. columns: [
  153. {
  154. title: '序号',
  155. dataIndex: '',
  156. key:'rowIndex',
  157. width:60,
  158. align:"center",
  159. customRender:function (t,r,index) {
  160. return parseInt(index)+1;
  161. }
  162. },
  163. {
  164. title:'点检项名称',
  165. align:"center",
  166. dataIndex: 'itemname'
  167. },
  168. {
  169. title:'设备类型',
  170. align:"center",
  171. dataIndex: 'equipmenttreeid_dictText'
  172. },
  173. {
  174. title:'点检项编号',
  175. align:"center",
  176. sorter: true,
  177. dataIndex: 'itemcode'
  178. },
  179. {
  180. title:'标准',
  181. align:"center",
  182. dataIndex: 'conditions'
  183. },
  184. {
  185. title:'点检项分类',
  186. align:"center",
  187. dataIndex: 'itemtype_dictText'
  188. },
  189. {
  190. title:'标签',
  191. align:"center",
  192. dataIndex: 'tag'
  193. },
  194. {
  195. title:'备注',
  196. align:"center",
  197. dataIndex: 'remark'
  198. },
  199. {
  200. title: '操作',
  201. dataIndex: 'action',
  202. align:"center",
  203. fixed:"right",
  204. width:147,
  205. scopedSlots: { customRender: 'action' }
  206. }
  207. ],
  208. url: {
  209. list: "/cmmsSpotcheckItem/cmmsSpotcheckItem/list",
  210. delete: "/cmmsSpotcheckItem/cmmsSpotcheckItem/delete",
  211. deleteBatch: "/cmmsSpotcheckItem/cmmsSpotcheckItem/deleteBatch",
  212. exportXlsUrl: "/cmmsSpotcheckItem/cmmsSpotcheckItem/exportXls",
  213. importExcelUrl: "cmmsSpotcheckItem/cmmsSpotcheckItem/importExcel",
  214. },
  215. dictOptions:{},
  216. superFieldList:[],
  217. }
  218. },
  219. created() {
  220. this.getSuperFieldList();
  221. },
  222. computed: {
  223. importExcelUrl: function(){
  224. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  225. },
  226. },
  227. methods: {
  228. initDictConfig(){
  229. },
  230. getSuperFieldList(){
  231. let fieldList=[];
  232. fieldList.push({type:'string',value:'itemname',text:'名称',dictCode:''})
  233. fieldList.push({type:'sel_search',value:'equipmenttreeid',text:'设备类型ID',dictTable:"tpm_equipment_tree", dictText:'name', dictCode:'id'})
  234. fieldList.push({type:'string',value:'itemcode',text:'点检项编号',dictCode:''})
  235. fieldList.push({type:'string',value:'conditions',text:'标准',dictCode:''})
  236. fieldList.push({type:'string',value:'itemtype',text:'点检项分类',dictCode:'spotcheck_item_type'})
  237. fieldList.push({type:'string',value:'tag',text:'标签',dictCode:''})
  238. fieldList.push({type:'string',value:'remark',text:'备注',dictCode:''})
  239. this.superFieldList = fieldList
  240. }
  241. }
  242. }
  243. </script>
  244. <style scoped>
  245. @import '~@assets/less/common.less';
  246. </style>