BtCustList.vue 7.5 KB

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