UpkeepList.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  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-row>
  8. </a-form>
  9. </div>
  10. <!-- 查询区域-END -->
  11. <!-- 操作按钮区域 -->
  12. <div class="table-operator">
  13. <!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  14. <a-button type="primary" icon="download" @click="handleExportXls('保养工单')">导出</a-button>
  15. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  16. <a-button type="primary" icon="import">导入</a-button>
  17. </a-upload> -->
  18. <!-- 高级查询区域 -->
  19. <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> -->
  20. <!-- <a-dropdown v-if="selectedRowKeys.length > 0">
  21. <a-menu slot="overlay">
  22. <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  23. </a-menu>
  24. <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  25. </a-dropdown> -->
  26. </div>
  27. <!-- table区域-begin -->
  28. <div>
  29. <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  30. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  31. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  32. </div> -->
  33. <a-table
  34. ref="table"
  35. size="middle"
  36. :scroll="{x:true}"
  37. bordered
  38. rowKey="id"
  39. :columns="columns"
  40. :dataSource="dataSource"
  41. :pagination="ipagination"
  42. :loading="loading"
  43. class="j-table-force-nowrap"
  44. @change="handleTableChange">
  45. <template slot="htmlSlot" slot-scope="text">
  46. <div v-html="text"></div>
  47. </template>
  48. <template slot="imgSlot" slot-scope="text,record">
  49. <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  50. <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  51. </template>
  52. <template slot="fileSlot" slot-scope="text">
  53. <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  54. <a-button
  55. v-else
  56. :ghost="true"
  57. type="primary"
  58. icon="download"
  59. size="small"
  60. @click="downloadFile(text)">
  61. 下载
  62. </a-button>
  63. </template>
  64. <span slot="action" slot-scope="text, record">
  65. <a @click="handleEdit(record)">反馈</a>
  66. <!-- <a @click="handleEdit(record)">编辑</a> -->
  67. <!-- <a-divider type="vertical" /> -->
  68. <!-- <a-dropdown>
  69. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  70. <a-menu slot="overlay">
  71. <a-menu-item>
  72. <a @click="handleDetail(record)">详情</a>
  73. </a-menu-item>
  74. <a-menu-item>
  75. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  76. <a>删除</a>
  77. </a-popconfirm>
  78. </a-menu-item>
  79. </a-menu>
  80. </a-dropdown> -->
  81. </span>
  82. </a-table>
  83. </div>
  84. <upkeep-modal ref="modalForm" @ok="modalFormOk"></upkeep-modal>
  85. </a-card>
  86. </template>
  87. <script>
  88. import '@/assets/less/TableExpand.less'
  89. import { mixinDevice } from '@/utils/mixin'
  90. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  91. import UpkeepModal from './modules/UpkeepModal'
  92. export default {
  93. name: 'UpkeepList',
  94. mixins:[JeecgListMixin, mixinDevice],
  95. components: {
  96. UpkeepModal
  97. },
  98. data () {
  99. return {
  100. description: '保养工单管理页面',
  101. // 表头
  102. columns: [
  103. {
  104. title: '#',
  105. dataIndex: '',
  106. key:'rowIndex',
  107. width:60,
  108. align:"center",
  109. customRender:function (t,r,index) {
  110. return parseInt(index)+1;
  111. }
  112. },
  113. {
  114. title:'保养工单编号',
  115. align:"center",
  116. dataIndex: 'upkeepcode'
  117. },
  118. // {
  119. // title:'保养名称(标题)',
  120. // align:"center",
  121. // dataIndex: 'upkeepname'
  122. // },
  123. // {
  124. // title:'保养计划ID',
  125. // align:"center",
  126. // dataIndex: 'upkeepplanid'
  127. // },
  128. // {
  129. // title:'保养工作项目ID',
  130. // align:"center",
  131. // dataIndex: 'upkeepprojid'
  132. // },
  133. // {
  134. // title:'工作项目名称',
  135. // align:"center",
  136. // dataIndex: 'projectname'
  137. // },
  138. {
  139. title:'计划名称',
  140. align:"center",
  141. dataIndex: 'planname'
  142. },
  143. {
  144. title:'地点',
  145. align:"center",
  146. dataIndex: 'address'
  147. },
  148. // {
  149. // title:'厂商名称',
  150. // align:"center",
  151. // dataIndex: 'supplier'
  152. // },
  153. // {
  154. // title:'厂商电话',
  155. // align:"center",
  156. // dataIndex: 'suppliertel'
  157. // },
  158. // {
  159. // title:'联系人',
  160. // align:"center",
  161. // dataIndex: 'linker'
  162. // },
  163. // {
  164. // title:'联系人电话',
  165. // align:"center",
  166. // dataIndex: 'linkertel'
  167. // },
  168. {
  169. title:'负责人',
  170. align:"center",
  171. dataIndex: 'chargeruser_dict'
  172. },
  173. // {
  174. // title:'描述',
  175. // align:"center",
  176. // dataIndex: 'upkeepdesc'
  177. // },
  178. {
  179. title:'状态:0待处理、1已通知、2未执行、3未完成、4已完成',
  180. align:"center",
  181. dataIndex: 'status_dict'
  182. },
  183. {
  184. title:'备注',
  185. align:"center",
  186. dataIndex: 'remark'
  187. },
  188. // {
  189. // title:'处理意见',
  190. // align:"center",
  191. // dataIndex: 'opinion'
  192. // },
  193. {
  194. title: '操作',
  195. dataIndex: 'action',
  196. align:"center",
  197. fixed:"right",
  198. width:147,
  199. scopedSlots: { customRender: 'action' }
  200. }
  201. ],
  202. url: {
  203. list: "/cmmsUpkeep/cmmsUpkeep/list",
  204. delete: "/cmmsUpkeep/cmmsUpkeep/delete",
  205. deleteBatch: "/cmmsUpkeep/cmmsUpkeep/deleteBatch",
  206. exportXlsUrl: "/cmmsUpkeep/cmmsUpkeep/exportXls",
  207. importExcelUrl: "cmmsUpkeep/cmmsUpkeep/importExcel",
  208. },
  209. dictOptions:{},
  210. superFieldList:[],
  211. }
  212. },
  213. created() {
  214. this.getSuperFieldList();
  215. },
  216. computed: {
  217. importExcelUrl: function(){
  218. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  219. },
  220. },
  221. methods: {
  222. initDictConfig(){
  223. },
  224. getSuperFieldList(){
  225. let fieldList=[];
  226. fieldList.push({type:'string',value:'remark',text:'备注',dictCode:''})
  227. fieldList.push({type:'string',value:'upkeepcode',text:'保养工单编号',dictCode:''})
  228. fieldList.push({type:'string',value:'upkeepname',text:'保养名称(标题)',dictCode:''})
  229. fieldList.push({type:'string',value:'upkeepplanid',text:'保养计划ID',dictCode:''})
  230. fieldList.push({type:'string',value:'upkeepprojid',text:'保养工作项目ID',dictCode:''})
  231. fieldList.push({type:'string',value:'projectname',text:'工作项目名称',dictCode:''})
  232. fieldList.push({type:'string',value:'planname',text:'计划名称',dictCode:''})
  233. fieldList.push({type:'string',value:'address',text:'地点',dictCode:''})
  234. fieldList.push({type:'string',value:'supplier',text:'厂商名称',dictCode:''})
  235. fieldList.push({type:'string',value:'suppliertel',text:'厂商电话',dictCode:''})
  236. fieldList.push({type:'string',value:'linker',text:'联系人',dictCode:''})
  237. fieldList.push({type:'string',value:'linkertel',text:'联系人电话',dictCode:''})
  238. fieldList.push({type:'string',value:'chargeruser',text:'负责人',dictCode:''})
  239. fieldList.push({type:'string',value:'upkeepdesc',text:'描述',dictCode:''})
  240. fieldList.push({type:'string',value:'status',text:'状态:0待处理、1已通知、2未执行、3未完成、4已完成',dictCode:''})
  241. fieldList.push({type:'string',value:'opinion',text:'处理意见',dictCode:''})
  242. this.superFieldList = fieldList
  243. }
  244. }
  245. }
  246. </script>
  247. <style scoped>
  248. @import '~@assets/less/common.less';
  249. </style>