audit-select-project.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <template>
  2. <a-modal
  3. :class="$style.mainModal"
  4. :body-style="bodyStyle"
  5. :title="title"
  6. :destroy-on-close="true"
  7. :visible="visible"
  8. :width="modalWidth"
  9. @ok="handleOk"
  10. @cancel="handleCancel"
  11. >
  12. <audit-advanced-query
  13. :expand="expand"
  14. :search-data="formData"
  15. :ref-name="searchform"
  16. :search-style="{
  17. height: 'auto',
  18. left: '0px',
  19. top: '120px !important',
  20. width: 'calc(100% - 40px) !important',
  21. }"
  22. :search-fun="handleSearch"
  23. @searchedClick="searchedClick"
  24. @resetForm="resetForm"
  25. >
  26. <template>
  27. <a-col :span="12">
  28. <a-form-model-item :label="'年\u2002\u2002\u2002\u2002度:'">
  29. <a-date-picker
  30. v-model="formData.year"
  31. mode="year"
  32. format="YYYY"
  33. :allow-clear="false"
  34. placeholder="选择年份"
  35. :input-read-only="true"
  36. :open="yearShow"
  37. style-echartclass-open-change="openChange"
  38. @openChange="openChange"
  39. @panelChange="panelYearChange"
  40. ></a-date-picker>
  41. </a-form-model-item>
  42. </a-col>
  43. <a-col :span="12">
  44. <a-form-model-item :label="'项目名称'" prop="projectName">
  45. <a-input v-model="formData.projectName" allow-clear />
  46. </a-form-model-item>
  47. </a-col>
  48. <a-col :span="12">
  49. <a-form-model-item :label="'档案编号'" prop="archivesCode">
  50. <a-input v-model="formData.archivesCode" allow-clear />
  51. </a-form-model-item>
  52. </a-col>
  53. </template>
  54. </audit-advanced-query>
  55. <!-- 列表 -->
  56. <sd-data-table-ex
  57. ref="SJMXDataTable"
  58. :show-advance-btn="true"
  59. form-id="iamArchivesMaintain"
  60. data-url="api/xcoa-mobile/v1/iamarchivesmaintain/already_file"
  61. :pagination="{ pageSize: 10 }"
  62. :filter-expressions="filterExpressions"
  63. :check-type="'radio'"
  64. :columns="columns"
  65. :show-advance-query="true"
  66. :search-fields="['projectName', 'archivesCode']"
  67. show-selection
  68. :process-res="processRes"
  69. @searchbtnClick="searchbtnClick"
  70. @onChange="onChange"
  71. >
  72. </sd-data-table-ex>
  73. </a-modal>
  74. </template>
  75. <script>
  76. import moment from 'moment'
  77. import auditAdvancedQueryMixins from '../../components/audit-advanced-query-mixins'
  78. import auditAdvancedQuery from '../../components/audit-advanced-query.vue'
  79. import components from './_import-components/audit-select-project-import'
  80. const columns = [
  81. {
  82. title: '序号',
  83. dataIndex: 'sortNumber',
  84. customRender: (text, record, index) => `${index + 1}`,
  85. width: '80px',
  86. },
  87. {
  88. title: '归档年度',
  89. dataIndex: 'filingYear',
  90. width: '100px',
  91. },
  92. {
  93. title: '项目名称',
  94. dataIndex: 'projectName',
  95. scopedSlots: { customRender: 'islink' },
  96. },
  97. {
  98. title: '档案编号',
  99. dataIndex: 'archivesCode',
  100. sorter: true,
  101. defaultSortOrder: 'descend', // 没有点击任何排序列时,默认的排序列
  102. },
  103. {
  104. title: '所属机构',
  105. dataIndex: 'createDeptName',
  106. },
  107. ]
  108. export default {
  109. name: 'AuditSelectProject',
  110. metaInfo: {
  111. title: '归档信息',
  112. },
  113. components: {
  114. ...components,
  115. auditAdvancedQuery,
  116. },
  117. mixins: [auditAdvancedQueryMixins],
  118. props: {
  119. // 弹出窗标题
  120. title: {
  121. type: String,
  122. default: '归档信息',
  123. },
  124. // 弹出窗宽度
  125. modalWidth: {
  126. type: String,
  127. default: '1200px',
  128. },
  129. // 弹出窗显示参数
  130. visible: {
  131. type: Boolean,
  132. default: false,
  133. },
  134. },
  135. data() {
  136. return {
  137. year: '',
  138. searchYear: '',
  139. yearShow: false,
  140. bodyStyle: {
  141. // padding: 0,
  142. },
  143. // 列表展示用
  144. columns,
  145. // 高级搜索
  146. searchform: 'searchform',
  147. expand: false,
  148. // 列表展示过滤条件
  149. filterExpressions: [],
  150. formData: {
  151. modelCode: '',
  152. modelName: '',
  153. },
  154. period: [],
  155. }
  156. },
  157. methods: {
  158. moment,
  159. panelYearChange(value) {
  160. this.year = value
  161. this.formData.year = value
  162. this.searchYear = moment(value).format('YYYY')
  163. this.yearShow = false
  164. },
  165. // 弹出日历和关闭日历的回调
  166. openChange(status) {
  167. // status是打开或关闭的状态
  168. if (status) {
  169. this.yearShow = true
  170. } else {
  171. this.yearShow = false
  172. }
  173. },
  174. // 重置年份
  175. resetForm() {
  176. this.formData.year = null
  177. this.searchYear = null
  178. },
  179. processRes(data) {
  180. let index = 0
  181. data.data.forEach((item) => {
  182. item.id = this.$refs.SJMXDataTable.localPagination.current + '-' + index
  183. index++
  184. })
  185. return data
  186. },
  187. handleOk(e) {
  188. this.$parent.visible = !this.$parent.visible
  189. this.$parent.visibleY = !this.$parent.visibleY
  190. // 列表选择事件,返回选择的数据
  191. this.$emit(
  192. 'listMxSelected',
  193. this.$refs.SJMXDataTable.getSelectedRowKeys(),
  194. this.$refs.SJMXDataTable.getSelectedRows()
  195. )
  196. },
  197. handleCancel(e) {
  198. this.$parent.visible = !this.$parent.visible
  199. this.$parent.visibleY = !this.$parent.visibleY
  200. },
  201. // 翻页操作
  202. onChange(pagination, filters, sorter) {
  203. this.pageSize = pagination.pageSize
  204. this.startPosition = (pagination.current - 1) * pagination.pageSize
  205. },
  206. // 开启关闭
  207. searchedClick() {
  208. this.expand = false
  209. },
  210. handleSearch() {
  211. const formData = this.formData
  212. // 获取当前表格过滤条件
  213. this.filterExpressions = []
  214. // 获取高级搜索的数据
  215. // 开始修改
  216. if (formData !== null) {
  217. // 年度
  218. if (this.searchYear) {
  219. this.filterExpressions.push({
  220. dataType: 'str',
  221. name: 'searchYear',
  222. op: 'like',
  223. stringValue: `${this.searchYear}`,
  224. })
  225. }
  226. // 项目名称
  227. if (this.formData.projectName) {
  228. this.filterExpressions.push({
  229. dataType: 'str',
  230. name: 'projectName',
  231. op: 'like',
  232. stringValue: `${this.formData.projectName}`,
  233. })
  234. }
  235. // 档案编号
  236. if (this.formData.archivesCode) {
  237. this.filterExpressions.push({
  238. dataType: 'str',
  239. name: 'archivesCode',
  240. op: 'like',
  241. stringValue: `${this.formData.archivesCode}`,
  242. })
  243. }
  244. }
  245. },
  246. },
  247. }
  248. </script>
  249. <style module lang="scss">
  250. @use '@/common/design' as *;
  251. .main-modal {
  252. :global(.ant-calendar-picker) {
  253. width: 100%;
  254. }
  255. }
  256. </style>