SubmissionList.vue 8.2 KB

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