ItdmWtkehuList.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  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.weituiClient"></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.weituiLxr"></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.weituiPhone"></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. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  71. class="j-table-force-nowrap"
  72. @change="handleTableChange">
  73. <template slot="htmlSlot" slot-scope="text">
  74. <div v-html="text"></div>
  75. </template>
  76. <template slot="imgSlot" slot-scope="text,record">
  77. <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
  78. <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  79. </template>
  80. <template slot="fileSlot" slot-scope="text">
  81. <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
  82. <a-button
  83. v-else
  84. :ghost="true"
  85. type="primary"
  86. icon="download"
  87. size="small"
  88. @click="downloadFile(text)">
  89. 下载
  90. </a-button>
  91. </template>
  92. <span slot="action" slot-scope="text, record">
  93. <a @click="handleEdit(record)">编辑</a>
  94. <a-divider type="vertical" />
  95. <a-dropdown>
  96. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  97. <a-menu slot="overlay">
  98. <a-menu-item>
  99. <a @click="handleDetail(record)">详情</a>
  100. </a-menu-item>
  101. <a-menu-item>
  102. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  103. <a>删除</a>
  104. </a-popconfirm>
  105. </a-menu-item>
  106. </a-menu>
  107. </a-dropdown>
  108. </span>
  109. </a-table>
  110. </div>
  111. <itdm-wtkehu-modal ref="modalForm" @ok="modalFormOk"></itdm-wtkehu-modal>
  112. </a-card>
  113. </template>
  114. <script>
  115. import '@/assets/less/TableExpand.less'
  116. import { mixinDevice } from '@/utils/mixin'
  117. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  118. import ItdmWtkehuModal from './modules/ItdmWtkehuModal'
  119. export default {
  120. name: 'ItdmWtkehuList',
  121. mixins:[JeecgListMixin, mixinDevice],
  122. components: {
  123. ItdmWtkehuModal
  124. },
  125. data () {
  126. return {
  127. description: '客户管理管理页面',
  128. // 表头
  129. columns: [
  130. {
  131. title: '#',
  132. dataIndex: '',
  133. key:'rowIndex',
  134. width:60,
  135. align:"center",
  136. customRender:function (t,r,index) {
  137. return parseInt(index)+1;
  138. }
  139. },
  140. {
  141. title:'委托单位名称',
  142. align:"center",
  143. dataIndex: 'weituiClient',
  144. customRender: (value, row, index) => {
  145. console.log(value, row, index)
  146. const obj = {
  147. children: value,
  148. attrs: {},
  149. };
  150. let arr = this.dataSource.filter((res) => {
  151. return res.weituiClient == row.weituiClient;
  152. });
  153. if(index == 0){
  154. obj.attrs.rowSpan = arr.length
  155. }else {
  156. if(row.weituiClient !== this.dataSource[index - 1].weituiClient){
  157. obj.attrs.rowSpan = arr.length
  158. } else {
  159. obj.attrs.rowSpan = 0
  160. }
  161. }
  162. return obj
  163. },
  164. },
  165. {
  166. title:'委托单位地址',
  167. align:"center",
  168. dataIndex: 'weituiAddress',
  169. customRender: (value, row, index) => {
  170. console.log(value, row, index)
  171. const obj = {
  172. children: value,
  173. attrs: {},
  174. };
  175. let arr = this.dataSource.filter((res) => {
  176. return res.weituiAddress == row.weituiAddress;
  177. });
  178. if(index == 0){
  179. obj.attrs.rowSpan = arr.length
  180. }else {
  181. if(row.weituiAddress !== this.dataSource[index - 1].weituiAddress){
  182. obj.attrs.rowSpan = arr.length
  183. } else {
  184. obj.attrs.rowSpan = 0
  185. }
  186. }
  187. return obj
  188. },
  189. },
  190. {
  191. title:'委托联系人',
  192. align:"center",
  193. dataIndex: 'weituiLxr'
  194. },
  195. {
  196. title:'委托电话',
  197. align:"center",
  198. dataIndex: 'weituiPhone'
  199. },
  200. {
  201. title:'委托邮箱',
  202. align:"center",
  203. dataIndex: 'weituiEmail'
  204. },
  205. {
  206. title: '操作',
  207. dataIndex: 'action',
  208. align:"center",
  209. fixed:"right",
  210. width:147,
  211. scopedSlots: { customRender: 'action' }
  212. }
  213. ],
  214. url: {
  215. list: "/ItdmWtkehu/itdmWtkehu/list",
  216. delete: "/ItdmWtkehu/itdmWtkehu/delete",
  217. deleteBatch: "/ItdmWtkehu/itdmWtkehu/deleteBatch",
  218. exportXlsUrl: "/ItdmWtkehu/itdmWtkehu/exportXls",
  219. importExcelUrl: "ItdmWtkehu/itdmWtkehu/importExcel",
  220. },
  221. dictOptions:{},
  222. superFieldList:[],
  223. }
  224. },
  225. created() {
  226. this.getSuperFieldList();
  227. },
  228. computed: {
  229. importExcelUrl: function(){
  230. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  231. },
  232. },
  233. methods: {
  234. initDictConfig(){
  235. },
  236. getSuperFieldList(){
  237. let fieldList=[];
  238. fieldList.push({type:'string',value:'weituiClient',text:'委托单位名称',dictCode:''})
  239. fieldList.push({type:'string',value:'weituiAddress',text:'委托单位地址',dictCode:''})
  240. fieldList.push({type:'string',value:'weituiLxr',text:'委托联系人',dictCode:''})
  241. fieldList.push({type:'string',value:'weituiPhone',text:'委托电话',dictCode:''})
  242. fieldList.push({type:'string',value:'weituiEmail',text:'委托邮箱',dictCode:''})
  243. this.superFieldList = fieldList
  244. }
  245. }
  246. }
  247. </script>
  248. <style scoped>
  249. @import '~@assets/less/common.less';
  250. </style>