eb5e9255961400cb278228db0a824618fe470c2e.svn-base 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  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. <j-dict-select-tag placeholder="请选择河段名称" v-model="queryParam.hdmc" dictCode="hlmc"/>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  13. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  14. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  15. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  16. <!-- <a @click="handleToggleSearch" style="margin-left: 8px">-->
  17. <!-- {{ toggleSearchStatus ? '收起' : '展开' }}-->
  18. <!-- <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>-->
  19. <!-- </a>-->
  20. </span>
  21. </a-col>
  22. </a-row>
  23. </a-form>
  24. </div>
  25. <!-- 查询区域-END -->
  26. <!-- 操作按钮区域 -->
  27. <div class="table-operator">
  28. <a-button @click="handleAdd" v-has="'yhyc:add'" type="primary" icon="plus">新增</a-button>
  29. <a-button v-has="'yhyc:dc'" type="primary" icon="download" @click="handleExportXls('基本信息表')">导出</a-button>
  30. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  31. <a-button v-has="'yhyc:dr'" type="primary" icon="import">导入</a-button>
  32. </a-upload>
  33. <!-- 高级查询区域 -->
  34. <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
  35. </div>
  36. <!-- table区域-begin -->
  37. <div>
  38. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  39. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  40. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  41. </div>
  42. <a-table
  43. ref="table"
  44. size="middle"
  45. bordered
  46. rowKey="id"
  47. class="j-table-force-nowrap"
  48. :scroll="{x:true}"
  49. :columns="columns"
  50. :dataSource="dataSource"
  51. :pagination="ipagination"
  52. :loading="loading"
  53. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}"
  54. :customRow="clickThenSelect"
  55. @change="handleTableChange">
  56. <template slot="hdmc" slot-scope="text,record">
  57. <a @click="handleDetail(record)">{{ text }}</a>
  58. </template>
  59. <template slot="htmlSlot" slot-scope="text">
  60. <div v-html="text"></div>
  61. </template>
  62. <template slot="imgSlot" slot-scope="text">
  63. <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  64. <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  65. </template>
  66. <template slot="fileSlot" slot-scope="text">
  67. <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  68. <a-button
  69. v-else
  70. :ghost="true"
  71. type="primary"
  72. icon="download"
  73. size="small"
  74. @click="downloadFile(text)">
  75. 下载
  76. </a-button>
  77. </template>
  78. <span slot="action" slot-scope="text, record">
  79. <a-space>
  80. <a-button @click='handleEdit(record)' v-has="'yhyc:bj'" size='small' type='primary'>编辑</a-button>
  81. <a-popconfirm title='确定删除吗?' @confirm='() => handleDelete(record.id)'>
  82. <a-button size='small' v-has="'yhyc:delete'" type='danger'>删除</a-button>
  83. </a-popconfirm>
  84. </a-space>
  85. <!-- <a-divider type="vertical" />-->
  86. <!-- <a-dropdown>-->
  87. <!-- <a class="ant-dropdown-link" v-has="'yhyc:delete'" type="primary" icon="plus">更多 <a-icon type="down" /></a>-->
  88. <!-- <a-menu slot="overlay">-->
  89. <!-- <a-menu-item>-->
  90. <!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">-->
  91. <!-- <a>删除</a>-->
  92. <!-- </a-popconfirm>-->
  93. <!-- </a-menu-item>-->
  94. <!-- </a-menu>-->
  95. <!-- </a-dropdown>-->
  96. </span>
  97. </a-table>
  98. </div>
  99. <a-tabs defaultActiveKey="1">
  100. <a-tab-pane tab="目标清单" key="1" >
  101. <RmMbqdList :mainId="selectedMainId" />
  102. </a-tab-pane>
  103. <a-tab-pane tab="问题清单" key="2" forceRender>
  104. <RmWtqdList :mainId="selectedMainId" />
  105. </a-tab-pane>
  106. <a-tab-pane tab="目标分解表" key="3" forceRender>
  107. <RmMbfjbList :mainId="selectedMainId" />
  108. </a-tab-pane>
  109. <a-tab-pane tab="任务清单" key="4" forceRender>
  110. <RmRwqdList :mainId="selectedMainId" />
  111. </a-tab-pane>
  112. <a-tab-pane tab="责任与措施清单" key="5" forceRender>
  113. <RmZrycsqdList :mainId="selectedMainId" />
  114. </a-tab-pane>
  115. </a-tabs>
  116. <rmJbxx-modal ref="modalForm" @ok="modalFormOk"></rmJbxx-modal>
  117. </a-card>
  118. </template>
  119. <script>
  120. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  121. import RmJbxxModal from './modules/RmJbxxModal'
  122. import { getAction } from '@/api/manage'
  123. import RmMbqdList from './RmMbqdList'
  124. import RmWtqdList from './RmWtqdList'
  125. import RmMbfjbList from './RmMbfjbList'
  126. import RmRwqdList from './RmRwqdList'
  127. import RmZrycsqdList from './RmZrycsqdList'
  128. import {initDictOptions,filterMultiDictText} from '@/components/dict/JDictSelectUtil'
  129. import '@/assets/less/TableExpand.less'
  130. export default {
  131. name: "RmJbxxList",
  132. mixins:[JeecgListMixin],
  133. components: {
  134. RmMbqdList,
  135. RmWtqdList,
  136. RmMbfjbList,
  137. RmRwqdList,
  138. RmZrycsqdList,
  139. RmJbxxModal
  140. },
  141. data () {
  142. return {
  143. description: '基本信息表管理页面',
  144. // 表头
  145. columns: [
  146. {
  147. title:'河段名称',
  148. align:"center",
  149. dataIndex: 'hdmc_dictText',
  150. scopedSlots: { customRender: 'hdmc' }
  151. },
  152. {
  153. title:'方案名称',
  154. align:"center",
  155. dataIndex: 'famc'
  156. },
  157. {
  158. title:'编制日期',
  159. align:"center",
  160. dataIndex: 'bzrq',
  161. customRender:function (text) {
  162. return !text?"":(text.length>10?text.substr(0,10):text)
  163. }
  164. },
  165. {
  166. title:'开始年月',
  167. align:"center",
  168. dataIndex: 'ksnf',
  169. customRender:function (text) {
  170. return !text?"":(text.length>10?text.substr(0,10):text)
  171. }
  172. },
  173. {
  174. title:'终止年月',
  175. align:"center",
  176. dataIndex: 'zznf',
  177. customRender:function (text) {
  178. return !text?"":(text.length>10?text.substr(0,10):text)
  179. }
  180. },
  181. {
  182. title:'编制单位',
  183. align:"center",
  184. dataIndex: 'bzdw'
  185. },
  186. {
  187. title:'备注',
  188. align:"center",
  189. dataIndex: 'bz'
  190. },
  191. {
  192. title:'文本方案',
  193. align:"center",
  194. dataIndex: 'wbfa',
  195. scopedSlots: {customRender: 'fileSlot'}
  196. },
  197. {
  198. title:'相关图件',
  199. align:"center",
  200. dataIndex: 'xgtj',
  201. scopedSlots: {customRender: 'imgSlot'}
  202. },
  203. {
  204. title: '操作',
  205. dataIndex: 'action',
  206. align:"center",
  207. fixed:"right",
  208. width:147,
  209. scopedSlots: { customRender: 'action' },
  210. }
  211. ],
  212. url: {
  213. list: "/hzz.yhyc/rmJbxx/list",
  214. delete: "/hzz.yhyc/rmJbxx/delete",
  215. deleteBatch: "/hzz.yhyc/rmJbxx/deleteBatch",
  216. exportXlsUrl: "/hzz.yhyc/rmJbxx/exportXls",
  217. importExcelUrl: "hzz.yhyc/rmJbxx/importExcel",
  218. },
  219. dictOptions:{
  220. hdmc:[],
  221. },
  222. /* 分页参数 */
  223. ipagination:{
  224. current: 1,
  225. pageSize: 5,
  226. pageSizeOptions: ['5', '10', '50'],
  227. showTotal: (total, range) => {
  228. return range[0] + "-" + range[1] + " 共" + total + "条"
  229. },
  230. showQuickJumper: true,
  231. showSizeChanger: true,
  232. total: 0
  233. },
  234. selectedMainId:'',
  235. superFieldList:[],
  236. }
  237. },
  238. created() {
  239. this.getSuperFieldList();
  240. },
  241. computed: {
  242. importExcelUrl: function(){
  243. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  244. }
  245. },
  246. methods: {
  247. initDictConfig(){
  248. initDictOptions('hlmc').then((res) => {
  249. if (res.success) {
  250. this.$set(this.dictOptions, 'hdmc', res.result)
  251. }
  252. })
  253. },
  254. clickThenSelect(record) {
  255. return {
  256. on: {
  257. click: () => {
  258. this.onSelectChange(record.id.split(","), [record]);
  259. }
  260. }
  261. }
  262. },
  263. onClearSelected() {
  264. this.selectedRowKeys = [];
  265. this.selectionRows = [];
  266. this.selectedMainId=''
  267. },
  268. onSelectChange(selectedRowKeys, selectionRows) {
  269. this.selectedMainId=selectedRowKeys[0]
  270. this.selectedRowKeys = selectedRowKeys;
  271. this.selectionRows = selectionRows;
  272. },
  273. loadData(arg) {
  274. if(!this.url.list){
  275. this.$message.error("请设置url.list属性!")
  276. return
  277. }
  278. //加载数据 若传入参数1则加载第一页的内容
  279. if (arg === 1) {
  280. this.ipagination.current = 1;
  281. }
  282. this.onClearSelected()
  283. var params = this.getQueryParams();//查询条件
  284. this.loading = true;
  285. getAction(this.url.list, params).then((res) => {
  286. if (res.success) {
  287. this.dataSource = res.result.records;
  288. this.ipagination.total = Number(res.result.total);
  289. }
  290. if(res.code===510){
  291. this.$message.warning(res.message)
  292. }
  293. this.loading = false;
  294. })
  295. },
  296. getSuperFieldList(){
  297. let fieldList=[];
  298. fieldList.push({type:'string',value:'hdmc',text:'河段名称',dictCode:'hlmc'})
  299. fieldList.push({type:'string',value:'famc',text:'方案名称',dictCode:''})
  300. fieldList.push({type:'date',value:'bzrq',text:'编制日期'})
  301. fieldList.push({type:'date',value:'ksnf',text:'开始年月'})
  302. fieldList.push({type:'date',value:'zznf',text:'终止年月'})
  303. fieldList.push({type:'string',value:'bzdw',text:'编制单位',dictCode:''})
  304. fieldList.push({type:'string',value:'bz',text:'备注',dictCode:''})
  305. fieldList.push({type:'string',value:'wbfa',text:'文本方案',dictCode:''})
  306. fieldList.push({type:'string',value:'xgtj',text:'相关图件',dictCode:''})
  307. this.superFieldList = fieldList
  308. }
  309. }
  310. }
  311. </script>
  312. <style scoped>
  313. @import '~@assets/less/common.less'
  314. </style>