ProjectXushiCostList.vue 7.4 KB

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