MuseumDutyList.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  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. <j-input placeholder="请输入申请人" v-model="queryParam.applyPerson"></j-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. <j-input placeholder="请输入申请部门" v-model="queryParam.applyDept"></j-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-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  106. <a>删除</a>
  107. </a-popconfirm>
  108. <a-divider type="vertical" />
  109. <a @click="print(record)" :href="printMouldUrl" target="_blank">打印</a>
  110. <!-- <a-dropdown>
  111. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  112. <a-menu slot="overlay">
  113. <a-menu-item>
  114. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  115. <a>删除</a>
  116. </a-popconfirm>
  117. </a-menu-item>
  118. </a-menu>
  119. </a-dropdown> -->
  120. </span>
  121. </a-table>
  122. </div>
  123. <museumDuty-modal ref="modalForm" @ok="modalFormOk"></museumDuty-modal>
  124. </a-card>
  125. </template>
  126. <script>
  127. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  128. import MuseumDutyModal from './modules/MuseumDutyModal'
  129. import JDate from '@/components/jeecg/JDate.vue'
  130. import { getAction } from '@api/manage'
  131. import JInput from '@/components/jeecg/JInput.vue'
  132. export default {
  133. name: "MuseumDutyList",
  134. mixins:[JeecgListMixin],
  135. components: {
  136. JDate,
  137. JInput,
  138. MuseumDutyModal
  139. },
  140. data () {
  141. return {
  142. description: '全馆值班登记管理页面',
  143. monthShowOne: false,
  144. printMouldUrl:'',
  145. // 表头
  146. columns: [
  147. {
  148. title: '#',
  149. dataIndex: '',
  150. key:'rowIndex',
  151. width:60,
  152. align:"center",
  153. customRender:function (t,r,index) {
  154. return parseInt(index)+1;
  155. }
  156. },
  157. {
  158. title:'申请人',
  159. align:"center",
  160. dataIndex: 'applyPerson'
  161. },
  162. {
  163. title:'申请部门',
  164. align:"center",
  165. dataIndex: 'applyDept'
  166. },
  167. {
  168. title:'申请日期',
  169. align:"center",
  170. dataIndex: 'applyDate',
  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: 'dutyMonth',
  179. customRender:function (text) {
  180. return !text?"":(text.length>10?text.substr(0,10):text)
  181. }
  182. },
  183. {
  184. title:'说明',
  185. align:"center",
  186. dataIndex: 'remark'
  187. },
  188. {
  189. title: '操作',
  190. dataIndex: 'action',
  191. align:"center",
  192. scopedSlots: { customRender: 'action' },
  193. }
  194. ],
  195. url: {
  196. list: "/oa/museumDuty/list",
  197. delete: "/oa/museumDuty/delete",
  198. deleteBatch: "/oa/museumDuty/deleteBatch",
  199. exportXlsUrl: "/oa/museumDuty/exportXls",
  200. importExcelUrl: "oa/museumDuty/importExcel",
  201. },
  202. dictOptions:{},
  203. }
  204. },
  205. computed: {
  206. importExcelUrl: function(){
  207. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  208. }
  209. },
  210. methods: {
  211. initDictConfig(){
  212. },
  213. // 弹出日历和关闭日历的回调
  214. openChangeOne(status) {
  215. if (status) {
  216. this.monthShowOne = true;
  217. }
  218. },
  219. // 得到年份选择器的值
  220. panelChangeOne(value) {
  221. this.monthShowOne = false;
  222. this.queryParam.dutyMonth = value;
  223. },
  224. print(record){
  225. this.printMouldUrl = 'http://172.18.91.36:8081/jeecg-boot/jmreport/shareView/834337917675851776'+'?id='+record.id
  226. },
  227. loadData(arg) {
  228. if(!this.url.list){
  229. this.$message.error("请设置url.list属性!")
  230. return
  231. }
  232. //加载数据 若传入参数1则加载第一页的内容
  233. if (arg === 1) {
  234. this.ipagination.current = 1;
  235. }
  236. var params = this.getQueryParams();//查询条件
  237. if(params.dutyMonth){
  238. params.dutyMonth = this.queryParam.dutyMonth.format("YYYY-MM");
  239. }
  240. console.log("params",params)
  241. this.loading = true;
  242. getAction(this.url.list, params).then((res) => {
  243. if (res.success) {
  244. this.dataSource = res.result.records;
  245. this.ipagination.total = res.result.total;
  246. }
  247. if(res.code===510){
  248. this.$message.warning(res.message)
  249. }
  250. this.loading = false;
  251. })
  252. },
  253. }
  254. }
  255. </script>
  256. <style scoped>
  257. @import '~@assets/less/common.less';
  258. </style>