59c5559041787df5b172b786dd45114551642ae2.svn-base 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  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. </div>
  21. <!-- table区域-begin -->
  22. <div>
  23. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  24. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  25. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  26. </div>
  27. <a-table
  28. ref="table"
  29. size="middle"
  30. bordered
  31. rowKey="id"
  32. class="j-table-force-nowrap"
  33. :scroll="{x:true}"
  34. :columns="columns"
  35. :dataSource="dataSource"
  36. :pagination="ipagination"
  37. :loading="loading"
  38. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}"
  39. :customRow="clickThenSelect"
  40. @change="handleTableChange">
  41. <template slot="htmlSlot" slot-scope="text">
  42. <div v-html="text"></div>
  43. </template>
  44. <template slot="imgSlot" slot-scope="text">
  45. <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  46. <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  47. </template>
  48. <template slot="fileSlot" slot-scope="text">
  49. <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  50. <a-button
  51. v-else
  52. :ghost="true"
  53. type="primary"
  54. icon="download"
  55. size="small"
  56. @click="downloadFile(text)">
  57. 下载
  58. </a-button>
  59. </template>
  60. <span slot="action" slot-scope="text, record">
  61. <a @click="handleEdit(record)">编辑</a>
  62. <a-divider type="vertical" />
  63. <a-dropdown>
  64. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  65. <a-menu slot="overlay">
  66. <a-menu-item>
  67. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  68. <a>删除</a>
  69. </a-popconfirm>
  70. </a-menu-item>
  71. </a-menu>
  72. </a-dropdown>
  73. </span>
  74. </a-table>
  75. </div>
  76. <a-tabs defaultActiveKey="1">
  77. <a-tab-pane tab="信息采集明细表" key="1" >
  78. <RmCjxxmxList :mainId="selectedMainId" />
  79. </a-tab-pane>
  80. </a-tabs>
  81. <rmXxcj-modal ref="modalForm" @ok="modalFormOk"></rmXxcj-modal>
  82. </a-card>
  83. </template>
  84. <script>
  85. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  86. import RmXxcjModal from './modules/RmXxcjModal'
  87. import { getAction } from '@/api/manage'
  88. import RmCjxxmxList from './RmCjxxmxList'
  89. import '@/assets/less/TableExpand.less'
  90. export default {
  91. name: "RmXxcjList",
  92. mixins:[JeecgListMixin],
  93. components: {
  94. RmCjxxmxList,
  95. RmXxcjModal
  96. },
  97. data () {
  98. return {
  99. description: '外业信息采集管理页面',
  100. // 表头
  101. columns: [
  102. {
  103. title:'项目编号',
  104. align:"center",
  105. dataIndex: 'xmbh'
  106. },
  107. {
  108. title:'项目名称',
  109. align:"center",
  110. dataIndex: 'xmmc'
  111. },
  112. {
  113. title:'采集人',
  114. align:"center",
  115. dataIndex: 'cjr'
  116. },
  117. {
  118. title:'采集时间',
  119. align:"center",
  120. dataIndex: 'cjsj',
  121. customRender:function (text) {
  122. return !text?"":(text.length>10?text.substr(0,10):text)
  123. }
  124. },
  125. {
  126. title: '操作',
  127. dataIndex: 'action',
  128. align:"center",
  129. fixed:"right",
  130. width:147,
  131. scopedSlots: { customRender: 'action' },
  132. }
  133. ],
  134. url: {
  135. list: "/hzz.xxcj/rmXxcj/list",
  136. delete: "/hzz.xxcj/rmXxcj/delete",
  137. deleteBatch: "/hzz.xxcj/rmXxcj/deleteBatch",
  138. exportXlsUrl: "/hzz.xxcj/rmXxcj/exportXls",
  139. importExcelUrl: "hzz.xxcj/rmXxcj/importExcel",
  140. },
  141. dictOptions:{
  142. },
  143. /* 分页参数 */
  144. ipagination:{
  145. current: 1,
  146. pageSize: 5,
  147. pageSizeOptions: ['5', '10', '50'],
  148. showTotal: (total, range) => {
  149. return range[0] + "-" + range[1] + " 共" + total + "条"
  150. },
  151. showQuickJumper: true,
  152. showSizeChanger: true,
  153. total: 0
  154. },
  155. selectedMainId:'',
  156. superFieldList:[],
  157. }
  158. },
  159. created() {
  160. this.getSuperFieldList();
  161. },
  162. computed: {
  163. importExcelUrl: function(){
  164. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  165. }
  166. },
  167. methods: {
  168. initDictConfig(){
  169. },
  170. clickThenSelect(record) {
  171. return {
  172. on: {
  173. click: () => {
  174. this.onSelectChange(record.id.split(","), [record]);
  175. }
  176. }
  177. }
  178. },
  179. onClearSelected() {
  180. this.selectedRowKeys = [];
  181. this.selectionRows = [];
  182. this.selectedMainId=''
  183. },
  184. onSelectChange(selectedRowKeys, selectionRows) {
  185. this.selectedMainId=selectedRowKeys[0]
  186. this.selectedRowKeys = selectedRowKeys;
  187. this.selectionRows = selectionRows;
  188. },
  189. loadData(arg) {
  190. if(!this.url.list){
  191. this.$message.error("请设置url.list属性!")
  192. return
  193. }
  194. //加载数据 若传入参数1则加载第一页的内容
  195. if (arg === 1) {
  196. this.ipagination.current = 1;
  197. }
  198. this.onClearSelected()
  199. var params = this.getQueryParams();//查询条件
  200. this.loading = true;
  201. getAction(this.url.list, params).then((res) => {
  202. if (res.success) {
  203. this.dataSource = res.result.records;
  204. this.ipagination.total = Number(res.result.total);
  205. }
  206. if(res.code===510){
  207. this.$message.warning(res.message)
  208. }
  209. this.loading = false;
  210. })
  211. },
  212. getSuperFieldList(){
  213. let fieldList=[];
  214. fieldList.push({type:'string',value:'xmbh',text:'项目编号',dictCode:''})
  215. fieldList.push({type:'string',value:'xmmc',text:'项目名称',dictCode:''})
  216. fieldList.push({type:'string',value:'cjr',text:'采集人',dictCode:''})
  217. fieldList.push({type:'date',value:'cjsj',text:'采集时间'})
  218. this.superFieldList = fieldList
  219. }
  220. }
  221. }
  222. </script>
  223. <style scoped>
  224. @import '~@assets/less/common.less'
  225. </style>