CostModelXishuList.vue 6.2 KB

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