audit-nb-selectproject.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. <template>
  2. <div :class="$style.selectproject">
  3. <audit-advanced-query
  4. :expand="expand"
  5. :search-data="advSearchForm"
  6. :ref-name="searchform"
  7. :search-style="{
  8. height: '170px',
  9. left: '0px',
  10. top: '50px !important',
  11. width: 'calc(100% - 40px) !important',
  12. }"
  13. :search-fun="advSearch"
  14. @searchedClick="searchedClick"
  15. >
  16. <template>
  17. <a-row>
  18. <a-col :span="8">
  19. <a-form-model-item label="项目名称" prop="projectTitle">
  20. <a-input v-model="advSearchForm.projectTitle" />
  21. </a-form-model-item>
  22. </a-col>
  23. <a-col :span="8">
  24. <a-form-model-item label="项目编号" prop="projectCode">
  25. <a-input v-model="advSearchForm.projectCode" />
  26. </a-form-model-item>
  27. </a-col>
  28. <a-col :span="8">
  29. <a-form-model-item label="项目组长" prop="groupLeaderName">
  30. <a-input v-model="advSearchForm.groupLeaderName" />
  31. </a-form-model-item>
  32. </a-col>
  33. <!-- <a-col :span="12">
  34. <a-form-model-item label="年度" prop="planYear" style="padding-left:2em">
  35. <a-date-picker
  36. v-model="advSearchForm.planYear"
  37. mode="year"
  38. picker="YYYY"
  39. format="YYYY"
  40. :allow-clear="false"
  41. placeholder="选择年度"
  42. :input-read-only="true"
  43. :value="planYear"
  44. :open="endOpen"
  45. @panelChange="yearChange"
  46. @openChange="handleEndOpenChange"
  47. ></a-date-picker>
  48. </a-form-model-item>
  49. </a-col> -->
  50. </a-row>
  51. </template>
  52. </audit-advanced-query>
  53. <!-- 列表 -->
  54. <sd-data-table-ex
  55. ref="NBDataTable"
  56. :show-advance-btn="true"
  57. form-id="iamAuditProject"
  58. data-url="api/xcoa-mobile/v1/rectPlan-project/find-project"
  59. :pagination="{ pageSize: 10 }"
  60. :filter-expressions="filterExpressions"
  61. :check-type="'radio'"
  62. :columns="columns"
  63. :show-advance-query="true"
  64. :search-fields="['projectTitle', 'projectCode']"
  65. show-selection
  66. :process-res="processRes"
  67. :custom-row="
  68. (record, index) => {
  69. return {
  70. on: {
  71. dblclick: () => {
  72. fndblclick(record, index)
  73. },
  74. },
  75. }
  76. }
  77. "
  78. @searchbtnClick="searchbtnClick"
  79. @onChange="onChange"
  80. >
  81. </sd-data-table-ex>
  82. </div>
  83. </template>
  84. <script>
  85. import moment from 'moment'
  86. import axios from '@/common/services/axios-instance'
  87. import auditAdvancedQuery from '../../components/audit-advanced-query.vue'
  88. import auditAdvancedQueryMixins from '../../components/audit-advanced-query-mixins'
  89. import components from './_import-components/audit-nb-selectproject-import'
  90. const columns = [
  91. {
  92. title: '序号',
  93. dataIndex: 'sortNumber',
  94. customRender: (text, record, index) => `${index + 1}`,
  95. width: '80px',
  96. },
  97. {
  98. title: '项目id',
  99. dataIndex: 'id',
  100. width: '80px',
  101. sdHidden: true,
  102. },
  103. {
  104. title: '项目名称',
  105. dataIndex: 'projectTitle',
  106. width: '35%',
  107. scopedSlots: { customRender: 'isLink' },
  108. },
  109. {
  110. title: '项目编号',
  111. width: '15%',
  112. sorter: true,
  113. dataIndex: 'projectCode',
  114. },
  115. {
  116. title: '被审计单位',
  117. dataIndex: 'auditedUnitNames',
  118. },
  119. {
  120. title: '被审计单位Ids',
  121. dataIndex: 'auditedUnitcodeS',
  122. sdHidden: true,
  123. },
  124. {
  125. title: '项目组长',
  126. dataIndex: 'groupLeaderName',
  127. },
  128. {
  129. title: '项目组长Id',
  130. dataIndex: 'groupLeaderAccount',
  131. sdHidden: true,
  132. },
  133. {
  134. title: '年度',
  135. dataIndex: 'planYear',
  136. defaultSortOrder: 'descend',
  137. sdHidden: true,
  138. },
  139. {
  140. title: '状态',
  141. dataIndex: 'itemStatus',
  142. sdHidden: true,
  143. },
  144. ]
  145. export default {
  146. name: 'AuditNbSelectproject',
  147. metaInfo: {
  148. title: '内部项目',
  149. },
  150. components: {
  151. ...components,
  152. auditAdvancedQuery,
  153. },
  154. mixins: [auditAdvancedQueryMixins],
  155. data() {
  156. return {
  157. itemStatusOptions: [],
  158. auditTypeOptions: [],
  159. auditModeOptions: [],
  160. columns,
  161. formData: {
  162. projectTitle: '',
  163. projectCode: '',
  164. },
  165. searchform: 'searchform',
  166. isShowAdvSearch: false,
  167. advSearchForm: {
  168. projectTitle: '',
  169. projectCode: '',
  170. groupLeaderName: '',
  171. auditMode: '',
  172. itemStatus: '',
  173. auditType: '',
  174. planYear: '',
  175. },
  176. projectId: '',
  177. setType: '',
  178. // 列表展示过滤条件
  179. filterExpressions: [],
  180. period: [],
  181. endOpen: false,
  182. planYear: null,
  183. }
  184. },
  185. created() {
  186. // 初始化数据字典信息
  187. this.initDictionaryInfo()
  188. this.planYear = moment(new Date())
  189. this.advSearchForm.planYear = moment(new Date()).format('YYYY')
  190. },
  191. methods: {
  192. moment,
  193. yearChange(value) {
  194. this.planYear = value
  195. this.advSearchForm.planYear = value.format('YYYY')
  196. if (document.getElementsByClassName('ant-calendar-picker-container').length > 0) {
  197. document.getElementsByClassName('ant-calendar-picker-container')[0].style.display = 'none'
  198. }
  199. },
  200. handleEndOpenChange(open) {
  201. this.endOpen = open
  202. },
  203. fndblclick(record, index) {
  204. this.$emit('listSelected', [record], index)
  205. },
  206. initDictionaryInfo() {
  207. axios({
  208. url: 'api/xcoa-mobile/v1/iam-law/dictionary?key=PRODUCT_IAM_AUDIT_PROJECT_STATUS',
  209. method: 'get',
  210. }).then((res) => {
  211. // if (res.status === 200) {
  212. this.itemStatusOptions = res.data
  213. // }
  214. })
  215. axios({
  216. url: 'api/xcoa-mobile/v1/iam-law/dictionary?key=PRODUCT_IAM_AUDIT_METHOD',
  217. method: 'get',
  218. }).then((res) => {
  219. // if (res.status === 200) {
  220. this.auditModeOptions = res.data
  221. // }
  222. })
  223. axios({
  224. url: 'api/xcoa-mobile/v1/iam-law/dictionary?key=PRODUCT_IAM_AUDIT_TYPE',
  225. method: 'get',
  226. }).then((res) => {
  227. // if (res.status === 200) {
  228. this.auditTypeOptions = res.data
  229. // }
  230. })
  231. },
  232. processRes(data) {
  233. let index = 0
  234. data.data.forEach((item) => {
  235. item.id = this.$refs.SJMXDataTable.localPagination.current + '-' + index
  236. index++
  237. })
  238. return data
  239. },
  240. // 翻页操作
  241. onChange(pagination, filters, sorter) {
  242. this.pageSize = pagination.pageSize
  243. this.startPosition = (pagination.current - 1) * pagination.pageSize
  244. },
  245. // 开启关闭
  246. searchedClick() {
  247. this.expand = false
  248. },
  249. advSearch() {
  250. this.filterExpressions = []
  251. // 项目名称
  252. if (this.advSearchForm.projectTitle) {
  253. this.filterExpressions.push({
  254. dataType: 'str',
  255. name: 'projectTitle',
  256. op: 'like',
  257. stringValue: `%${this.advSearchForm.projectTitle}%`,
  258. })
  259. }
  260. // 项目编号
  261. if (this.advSearchForm.projectCode) {
  262. this.filterExpressions.push({
  263. dataType: 'str',
  264. name: 'projectCode',
  265. op: 'like',
  266. stringValue: `%${this.advSearchForm.projectCode}%`,
  267. })
  268. }
  269. // 项目组长
  270. if (this.advSearchForm.groupLeaderName) {
  271. this.filterExpressions.push({
  272. dataType: 'str',
  273. name: 'groupLeaderName',
  274. op: 'like',
  275. stringValue: `%${this.advSearchForm.groupLeaderName}%`,
  276. })
  277. }
  278. // // 年度
  279. // if (this.advSearchForm.planYear) {
  280. // this.filterExpressions.push({
  281. // dataType: 'str',
  282. // name: 'planYear',
  283. // op: 'eq',
  284. // stringValue: `${this.advSearchForm.planYear}`,
  285. // })
  286. // }
  287. },
  288. },
  289. }
  290. </script>
  291. <style module lang="scss">
  292. @use '@/common/design' as *;
  293. .selectproject {
  294. :global(.ant-calendar-picker) {
  295. width: calc(100% + 33px);
  296. }
  297. }
  298. </style>