CmmsRepairManageList.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  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.equipmentname"></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-dict-select-tag v-model="queryParam.priority" placeholder="请输入优先级" dictCode="repair_priority"/>
  15. </a-form-item>
  16. </a-col>
  17. <template v-if="toggleSearchStatus">
  18. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  19. <a-form-item label="待办人">
  20. <a-input placeholder="请输入待办人" v-model="queryParam.repairuser"></a-input>
  21. </a-form-item>
  22. </a-col>
  23. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  24. <a-form-item label="维修状态">
  25. <j-dict-select-tag v-model="queryParam.status" placeholder="请选择维修状态" dictCode="repair_handle_status"/>
  26. </a-form-item>
  27. </a-col>
  28. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  29. <a-form-item label="工单状态">
  30. <j-dict-select-tag v-model="queryParam.repairstatus" placeholder="请选择工单状态" dictCode="repair_order_status"/>
  31. </a-form-item>
  32. </a-col>
  33. </template>
  34. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  35. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  36. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  37. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  38. <a @click="handleToggleSearch" style="margin-left: 8px">
  39. {{ toggleSearchStatus ? '收起' : '展开' }}
  40. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  41. </a>
  42. </span>
  43. </a-col>
  44. </a-row>
  45. </a-form>
  46. </div>
  47. <!-- 查询区域-END -->
  48. <!-- 操作按钮区域 -->
  49. <div class="table-operator">
  50. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  51. <a-button type="primary" icon="download" @click="handleExportXls('维修工单')">导出</a-button>
  52. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  53. <a-button type="primary" icon="import">导入</a-button>
  54. </a-upload>
  55. <!-- 高级查询区域 -->
  56. <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
  57. <a-dropdown v-if="selectedRowKeys.length > 0">
  58. <a-menu slot="overlay">
  59. <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  60. </a-menu>
  61. <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  62. </a-dropdown>
  63. </div>
  64. <!-- table区域-begin -->
  65. <div>
  66. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  67. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  68. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  69. </div>
  70. <a-table
  71. ref="table"
  72. size="middle"
  73. :scroll="{x:true}"
  74. bordered
  75. rowKey="id"
  76. :columns="columns"
  77. :dataSource="dataSource"
  78. :pagination="ipagination"
  79. :loading="loading"
  80. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  81. class="j-table-force-nowrap cmms-table"
  82. @change="handleTableChange">
  83. <template slot="htmlSlot" slot-scope="text">
  84. <div v-html="text"></div>
  85. </template>
  86. <template slot="imgSlot" slot-scope="text,record">
  87. <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  88. <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  89. </template>
  90. <template slot="fileSlot" slot-scope="text">
  91. <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  92. <a-button
  93. v-else
  94. :ghost="true"
  95. type="primary"
  96. icon="download"
  97. size="small"
  98. @click="downloadFile(text)">
  99. 下载
  100. </a-button>
  101. </template>
  102. <span slot="priority" slot-scope="text, record">
  103. <a-tag v-if="record.priority === '0'">{{ text }}</a-tag>
  104. <a-tag v-if="record.priority === '1'" color="orange">{{ text }}</a-tag>
  105. <a-tag v-if="record.priority === '2'" color="red">{{ text }}</a-tag>
  106. </span>
  107. <span slot="status" slot-scope="text, record">
  108. <a-tag v-if="record.status === '0'" color="orange">{{ text }}</a-tag>
  109. <a-tag v-if="record.status === '1' || record.priority === '2'" color="blue">{{ text }}</a-tag>
  110. <a-tag v-if="record.status === '3'">{{ text }}</a-tag>
  111. </span>
  112. <span slot="action" slot-scope="text, record">
  113. <a @click="handleEdit(record)">编辑</a>
  114. <a-divider type="vertical" />
  115. <a @click="handleDisptch(record)">派单</a>
  116. <a-divider type="vertical" />
  117. <a-dropdown>
  118. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  119. <a-menu slot="overlay">
  120. <a-menu-item>
  121. <a @click="handleDrawerDetail(record)">详情</a>
  122. </a-menu-item>
  123. <a-menu-item>
  124. <a @click="handleFreeze(record)">冻结</a>
  125. </a-menu-item>
  126. <a-menu-item>
  127. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  128. <a>删除</a>
  129. </a-popconfirm>
  130. </a-menu-item>
  131. </a-menu>
  132. </a-dropdown>
  133. </span>
  134. </a-table>
  135. </div>
  136. <!-- 增改+派单 -->
  137. <cmms-repair-manage-modal ref="modalForm" @ok="modalFormOk"></cmms-repair-manage-modal>
  138. <!-- 详情 -->
  139. <cmms-repair-manage-detail ref="drawerDetail"></cmms-repair-manage-detail>
  140. </a-card>
  141. </template>
  142. <script>
  143. import '@/assets/less/TableExpand.less'
  144. import { mixinDevice } from '@/utils/mixin'
  145. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  146. import CmmsRepairManageModal from './modules/CmmsRepairManageModal'
  147. import CmmsRepairManageDetail from './modules/CmmsRepairManageDetail.vue'
  148. export default {
  149. name: 'CmmsRepairManageList',
  150. mixins:[JeecgListMixin, mixinDevice],
  151. components: {
  152. CmmsRepairManageModal,
  153. CmmsRepairManageDetail,
  154. },
  155. data () {
  156. return {
  157. description: '维修工单管理页面',
  158. // 表头
  159. columns: [
  160. {
  161. title: '序号',
  162. dataIndex: '',
  163. key:'rowIndex',
  164. width:60,
  165. align:"center",
  166. customRender:function (t,r,index) {
  167. return parseInt(index)+1;
  168. }
  169. },
  170. {
  171. title:'优先级',
  172. align:"center",
  173. dataIndex: 'priority_dictText',
  174. scopedSlots: { customRender: 'priority' }
  175. },
  176. {
  177. title:'维修工单编号',
  178. align:"center",
  179. dataIndex: 'repaircode',
  180. customCell: this.customCellDetail
  181. },
  182. {
  183. title:'工单名称',
  184. align:"center",
  185. dataIndex: 'repairname'
  186. },
  187. {
  188. title:'维修时间',
  189. align:"center",
  190. dataIndex: 'repairdate',
  191. customRender:function (text) {
  192. return !text?"":(text.length>10?text.substr(0,10):text)
  193. }
  194. },
  195. // {
  196. // title:'设备ID',
  197. // align:"center",
  198. // dataIndex: 'equipmentid'
  199. // },
  200. {
  201. title:'设备名称',
  202. align:"center",
  203. dataIndex: 'equipmentname'
  204. },
  205. {
  206. title:'设备编号',
  207. align:"center",
  208. dataIndex: 'equipmentcode'
  209. },
  210. {
  211. title:'故障日期',
  212. align:"center",
  213. dataIndex: 'faultdate',
  214. customRender:function (text) {
  215. return !text?"":(text.length>10?text.substr(0,10):text)
  216. }
  217. },
  218. {
  219. title:'故障描述',
  220. align:"center",
  221. dataIndex: 'faultdesc'
  222. },
  223. {
  224. title:'录入人',
  225. align:"center",
  226. dataIndex: 'createBy'
  227. },
  228. {
  229. title:'待办人',
  230. align:"center",
  231. dataIndex: 'repairuser'
  232. },
  233. {
  234. title:'维修时间',
  235. align:"center",
  236. dataIndex: ''
  237. },
  238. {
  239. title:'维修反馈',
  240. align:"center",
  241. dataIndex: 'feedback'
  242. },
  243. // {
  244. // title:'维修结果',
  245. // align:"center",
  246. // dataIndex: 'result'
  247. // },
  248. // {
  249. // title:'关联ID',
  250. // align:"center",
  251. // dataIndex: 'relid'
  252. // },
  253. {
  254. title:'创建时间',
  255. align:"center",
  256. dataIndex: 'createTime',
  257. customRender:function (text) {
  258. return !text?"":(text.length>10?text.substr(0,10):text)
  259. }
  260. },
  261. // {
  262. // title:'备注',
  263. // align:"center",
  264. // dataIndex: 'remark'
  265. // },
  266. {
  267. title:'工单状态',
  268. align:"center",
  269. dataIndex: 'repairstatus_dictText'
  270. },
  271. {
  272. title:'维修状态',
  273. align:"center",
  274. fixed:"right",
  275. width:80,
  276. dataIndex: 'status_dictText',
  277. scopedSlots: { customRender: 'status' }
  278. },
  279. {
  280. title: '操作',
  281. dataIndex: 'action',
  282. align:"center",
  283. fixed:"right",
  284. width:152,
  285. scopedSlots: { customRender: 'action' }
  286. }
  287. ],
  288. url: {
  289. list: "/cmmsRepair/cmmsRepair/list",
  290. delete: "/cmmsRepair/cmmsRepair/delete",
  291. deleteBatch: "/cmmsRepair/cmmsRepair/deleteBatch",
  292. exportXlsUrl: "/cmmsRepair/cmmsRepair/exportXls",
  293. importExcelUrl: "cmmsRepair/cmmsRepair/importExcel",
  294. },
  295. dictOptions:{},
  296. superFieldList:[],
  297. }
  298. },
  299. created() {
  300. this.getSuperFieldList();
  301. },
  302. computed: {
  303. importExcelUrl: function(){
  304. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  305. },
  306. },
  307. methods: {
  308. // 派单
  309. handleDisptch (record) {
  310. this.$refs.modalForm.title = "派单";
  311. this.$refs.modalForm.modalType = "disptch";
  312. this.$refs.modalForm.dispatch(record);
  313. },
  314. // 冻结
  315. handleFreeze(record){
  316. },
  317. initDictConfig(){
  318. },
  319. getSuperFieldList(){
  320. let fieldList=[];
  321. fieldList.push({type:'string',value:'id',text:'维修工单ID',dictCode:''})
  322. fieldList.push({type:'string',value:'createBy',text:'创建者',dictCode:''})
  323. fieldList.push({type:'date',value:'createTime',text:'创建时间'})
  324. fieldList.push({type:'string',value:'remark',text:'备注',dictCode:''})
  325. fieldList.push({type:'string',value:'repaircode',text:'维修工单编号',dictCode:''})
  326. fieldList.push({type:'string',value:'repairname',text:'工单名称',dictCode:''})
  327. fieldList.push({type:'string',value:'equipmentid',text:'设备ID',dictCode:''})
  328. fieldList.push({type:'string',value:'equipmentcode',text:'设备编号',dictCode:''})
  329. fieldList.push({type:'string',value:'equipmentname',text:'设备名称',dictCode:''})
  330. fieldList.push({type:'string',value:'priority',text:'优先级:0普通,1紧急,2特急',dictCode:''})
  331. fieldList.push({type:'date',value:'faultdate',text:'故障日期'})
  332. fieldList.push({type:'string',value:'faultdesc',text:'故障描述',dictCode:''})
  333. fieldList.push({type:'string',value:'repairuser',text:'待办人',dictCode:''})
  334. fieldList.push({type:'date',value:'repairdate',text:'维修时间'})
  335. fieldList.push({type:'string',value:'feedback',text:'维修反馈',dictCode:''})
  336. fieldList.push({type:'string',value:'result',text:'维修结果',dictCode:''})
  337. fieldList.push({type:'string',value:'status',text:'状态:0待处理,1维修检查,2设备维修,3维修结束',dictCode:''})
  338. fieldList.push({type:'string',value:'relid',text:'关联ID:巡检、点检、保养的ID',dictCode:''})
  339. fieldList.push({type:'string',value:'repairstatus',text:'维修工单状态: 0正常、1冻结、2拒绝',dictCode:''})
  340. this.superFieldList = fieldList
  341. }
  342. }
  343. }
  344. </script>
  345. <style scoped>
  346. @import '~@assets/less/common.less';
  347. </style>
  348. <style lang="less" scoped>
  349. .cmms-table{
  350. /deep/ .ant-table-tbody tr:nth-child(2n){
  351. background-color: #fafafa;
  352. }
  353. }
  354. </style>