MuseumDutyList.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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.applyPerson"></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.applyDept"></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. <j-date placeholder="请选择申请日期" v-model="queryParam.applyDate" style="width: 100%;"></j-date>
  21. </a-form-item>
  22. </a-col>
  23. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  24. <a-form-item label="值班月">
  25. <a-date-picker
  26. mode="month"
  27. v-model="queryParam.dutyMonth"
  28. placeholder="请选择班月"
  29. format="YYYY-MM"
  30. :open="monthShowOne"
  31. @openChange="openChangeOne"
  32. @panelChange="panelChangeOne"
  33. style="width: 100%;"
  34. />
  35. </a-form-item>
  36. </a-col>
  37. </template>
  38. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  39. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  40. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  41. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  42. <a @click="handleToggleSearch" style="margin-left: 8px">
  43. {{ toggleSearchStatus ? '收起' : '展开' }}
  44. <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
  45. </a>
  46. </span>
  47. </a-col>
  48. </a-row>
  49. </a-form>
  50. </div>
  51. <!-- 查询区域-END -->
  52. <!-- 操作按钮区域 -->
  53. <div class="table-operator">
  54. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  55. <!-- <a-button type="primary" icon="download" @click="handleExportXls('全馆值班登记')">导出</a-button>-->
  56. <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
  57. <!-- <a-button type="primary" icon="import">导入</a-button>-->
  58. <!-- </a-upload>-->
  59. <a-dropdown v-if="selectedRowKeys.length > 0">
  60. <a-menu slot="overlay">
  61. <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  62. </a-menu>
  63. <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  64. </a-dropdown>
  65. </div>
  66. <!-- table区域-begin -->
  67. <div>
  68. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  69. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  70. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  71. </div>
  72. <a-table
  73. ref="table"
  74. size="middle"
  75. bordered
  76. rowKey="id"
  77. :columns="columns"
  78. :dataSource="dataSource"
  79. :pagination="ipagination"
  80. :loading="loading"
  81. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  82. @change="handleTableChange">
  83. <template slot="htmlSlot" slot-scope="text">
  84. <div v-html="text"></div>
  85. </template>
  86. <template slot="imgSlot" slot-scope="text">
  87. <span v-if="!text" style="font-size: 12px;font-style: italic;">无此图片</span>
  88. <img v-else :src="getImgView(text)" height="25px" alt="图片不存在" style="max-width:80px;font-size: 12px;font-style: italic;"/>
  89. </template>
  90. <template slot="fileSlot" slot-scope="text">
  91. <span v-if="!text" style="font-size: 12px;font-style: italic;">无此文件</span>
  92. <a-button
  93. v-else
  94. :ghost="true"
  95. type="primary"
  96. icon="download"
  97. size="small"
  98. @click="uploadFile(text)">
  99. 下载
  100. </a-button>
  101. </template>
  102. <span slot="action" slot-scope="text, record">
  103. <a @click="handleEdit(record)">编辑</a>
  104. <a-divider type="vertical" />
  105. <a-dropdown>
  106. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  107. <a-menu slot="overlay">
  108. <a-menu-item>
  109. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  110. <a>删除</a>
  111. </a-popconfirm>
  112. </a-menu-item>
  113. </a-menu>
  114. </a-dropdown>
  115. </span>
  116. </a-table>
  117. </div>
  118. <museumDuty-modal ref="modalForm" @ok="modalFormOk"></museumDuty-modal>
  119. </a-card>
  120. </template>
  121. <script>
  122. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  123. import MuseumDutyModal from './modules/MuseumDutyModal'
  124. import JDate from '@/components/jeecg/JDate.vue'
  125. import { getAction } from '@api/manage'
  126. export default {
  127. name: "MuseumDutyList",
  128. mixins:[JeecgListMixin],
  129. components: {
  130. JDate,
  131. MuseumDutyModal
  132. },
  133. data () {
  134. return {
  135. description: '全馆值班登记管理页面',
  136. monthShowOne: false,
  137. // 表头
  138. columns: [
  139. {
  140. title: '#',
  141. dataIndex: '',
  142. key:'rowIndex',
  143. width:60,
  144. align:"center",
  145. customRender:function (t,r,index) {
  146. return parseInt(index)+1;
  147. }
  148. },
  149. {
  150. title:'申请人',
  151. align:"center",
  152. dataIndex: 'applyPerson'
  153. },
  154. {
  155. title:'申请部门',
  156. align:"center",
  157. dataIndex: 'applyDept'
  158. },
  159. {
  160. title:'申请日期',
  161. align:"center",
  162. dataIndex: 'applyDate',
  163. customRender:function (text) {
  164. return !text?"":(text.length>10?text.substr(0,10):text)
  165. }
  166. },
  167. {
  168. title:'值班月',
  169. align:"center",
  170. dataIndex: 'dutyMonth',
  171. customRender:function (text) {
  172. return !text?"":(text.length>10?text.substr(0,10):text)
  173. }
  174. },
  175. {
  176. title:'说明',
  177. align:"center",
  178. dataIndex: 'remark'
  179. },
  180. {
  181. title: '操作',
  182. dataIndex: 'action',
  183. align:"center",
  184. scopedSlots: { customRender: 'action' },
  185. }
  186. ],
  187. url: {
  188. list: "/oa/museumDuty/list",
  189. delete: "/oa/museumDuty/delete",
  190. deleteBatch: "/oa/museumDuty/deleteBatch",
  191. exportXlsUrl: "/oa/museumDuty/exportXls",
  192. importExcelUrl: "oa/museumDuty/importExcel",
  193. },
  194. dictOptions:{},
  195. }
  196. },
  197. computed: {
  198. importExcelUrl: function(){
  199. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  200. }
  201. },
  202. methods: {
  203. initDictConfig(){
  204. },
  205. // 弹出日历和关闭日历的回调
  206. openChangeOne(status) {
  207. if (status) {
  208. this.monthShowOne = true;
  209. }
  210. },
  211. // 得到年份选择器的值
  212. panelChangeOne(value) {
  213. this.monthShowOne = false;
  214. this.queryParam.dutyMonth = value;
  215. },
  216. loadData(arg) {
  217. if(!this.url.list){
  218. this.$message.error("请设置url.list属性!")
  219. return
  220. }
  221. //加载数据 若传入参数1则加载第一页的内容
  222. if (arg === 1) {
  223. this.ipagination.current = 1;
  224. }
  225. var params = this.getQueryParams();//查询条件
  226. if(params.dutyMonth){
  227. params.dutyMonth = this.queryParam.dutyMonth.format("YYYY-MM");
  228. }
  229. console.log("params",params)
  230. this.loading = true;
  231. getAction(this.url.list, params).then((res) => {
  232. if (res.success) {
  233. this.dataSource = res.result.records;
  234. this.ipagination.total = res.result.total;
  235. }
  236. if(res.code===510){
  237. this.$message.warning(res.message)
  238. }
  239. this.loading = false;
  240. })
  241. },
  242. }
  243. }
  244. </script>
  245. <style scoped>
  246. @import '~@assets/less/common.less';
  247. </style>