CostModelMsgList.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  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.xiangmuName"></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. <a-input placeholder="请输入导入费用类型" v-model="queryParam.feiyongType"></a-input>
  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.xiangmuMsg"></a-input>
  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. class="j-table-force-nowrap"
  71. @change="handleTableChange">
  72. <template slot="htmlSlot" slot-scope="text">
  73. <div v-html="text"></div>
  74. </template>
  75. <template slot="imgSlot" slot-scope="text,record">
  76. <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  77. <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  78. </template>
  79. <template slot="fileSlot" slot-scope="text">
  80. <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  81. <a-button
  82. v-else
  83. :ghost="true"
  84. type="primary"
  85. icon="download"
  86. size="small"
  87. @click="downloadFile(text)">
  88. 下载
  89. </a-button>
  90. </template>
  91. <!-- <span slot="action" slot-scope="text, record">
  92. <a @click="handleEdit(record)">编辑</a>
  93. <a-divider type="vertical" />
  94. <a-dropdown>
  95. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  96. <a-menu slot="overlay">
  97. <a-menu-item>
  98. <a @click="handleDetail(record)">详情</a>
  99. </a-menu-item>
  100. <a-menu-item>
  101. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  102. <a>删除</a>
  103. </a-popconfirm>
  104. </a-menu-item>
  105. </a-menu>
  106. </a-dropdown>
  107. </span> -->
  108. </a-table>
  109. </div>
  110. <cost-model-msg-modal ref="modalForm" @ok="modalFormOk"></cost-model-msg-modal>
  111. </a-card>
  112. </template>
  113. <script>
  114. import '@/assets/less/TableExpand.less'
  115. import { mixinDevice } from '@/utils/mixin'
  116. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  117. import CostModelMsgModal from './modules/CostModelMsgModal'
  118. import { getAction } from '@/api/manage'
  119. export default {
  120. name: 'CostModelMsgList',
  121. mixins:[JeecgListMixin, mixinDevice],
  122. components: {
  123. CostModelMsgModal
  124. },
  125. props: ['id'],
  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:'项目ID',
  143. align:"center",
  144. dataIndex: 'xiangmuId'
  145. },
  146. {
  147. title:'项目名称',
  148. align:"center",
  149. dataIndex: 'xiangmuName'
  150. },
  151. // {
  152. // title:'导入费用类型',
  153. // align:"center",
  154. // dataIndex: 'feiyongType_dictText'
  155. // },
  156. {
  157. title:'导入提示信息',
  158. align:"center",
  159. dataIndex: 'xiangmuMsg'
  160. },
  161. // {
  162. // title: '操作',
  163. // dataIndex: 'action',
  164. // align:"center",
  165. // fixed:"right",
  166. // width:147,
  167. // scopedSlots: { customRender: 'action' }
  168. // }
  169. ],
  170. url: {
  171. list: "/costModelMsg/costModelMsg/list",
  172. delete: "/costModelMsg/costModelMsg/delete",
  173. deleteBatch: "/costModelMsg/costModelMsg/deleteBatch",
  174. exportXlsUrl: "/costModelMsg/costModelMsg/exportXls",
  175. importExcelUrl: "costModelMsg/costModelMsg/importExcel",
  176. },
  177. dictOptions:{},
  178. superFieldList:[],
  179. }
  180. },
  181. created() {
  182. this.getSuperFieldList();
  183. },
  184. computed: {
  185. importExcelUrl: function(){
  186. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  187. },
  188. },
  189. methods: {
  190. loadData(arg) {
  191. this.queryParam.xiangmuId = this.id
  192. if(!this.url.list){
  193. this.$message.error("请设置url.list属性!")
  194. return
  195. }
  196. //加载数据 若传入参数1则加载第一页的内容
  197. if (arg === 1) {
  198. this.ipagination.current = 1;
  199. }
  200. var params = this.getQueryParams();//查询条件
  201. this.loading = true;
  202. getAction(this.url.list, params).then((res) => {
  203. if (res.success) {
  204. //update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
  205. this.dataSource = res.result.records||res.result;
  206. if(res.result.total)
  207. {
  208. this.ipagination.total = res.result.total;
  209. }else{
  210. this.ipagination.total = 0;
  211. }
  212. //update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
  213. }else{
  214. this.$message.warning(res.message)
  215. }
  216. }).finally(() => {
  217. this.loading = false
  218. })
  219. },
  220. initDictConfig(){
  221. },
  222. getSuperFieldList(){
  223. let fieldList=[];
  224. fieldList.push({type:'string',value:'xiangmuId',text:'项目ID',dictCode:''})
  225. fieldList.push({type:'string',value:'xiangmuName',text:'项目名称',dictCode:''})
  226. fieldList.push({type:'string',value:'feiyongType',text:'导入费用类型',dictCode:''})
  227. fieldList.push({type:'string',value:'xiangmuMsg',text:'导入提示信息',dictCode:''})
  228. this.superFieldList = fieldList
  229. }
  230. }
  231. }
  232. </script>
  233. <style scoped>
  234. @import '~@assets/less/common.less';
  235. </style>