index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  1. <template>
  2. <div>
  3. <el-breadcrumb class="heading">
  4. <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
  5. <el-breadcrumb-item :to="{ path: '/system/auditsetting' }">单位审批步骤自定义配置</el-breadcrumb-item>
  6. </el-breadcrumb>
  7. <el-card class="box-card" style="height: calc(100vh - 115px);">
  8. <div slot="header">
  9. <span>
  10. <i class="icon icon-table2"></i> 自定义配置
  11. </span>
  12. <span style="float: right;">
  13. <router-link :to="'/system/auditsetting/add/operation?step='+this.$route.query.step">
  14. <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;">添加</el-button>
  15. </router-link>
  16. </span>
  17. <el-form ref="form" :inline="true" style="float: right; margin-top: -10px">
  18. <!--<el-form-item label="上报时间">
  19. <el-date-picker size="mini" style="width: 220px" v-model="CreateOn" type="daterange" range-separator="至"
  20. start-placeholder="生成日期" end-placeholder="结束日期"></el-date-picker>
  21. </el-form-item>-->
  22. <el-form-item label="上级组织" label-width="120px" v-if="false">
  23. <el-cascader :options="orgtreelist" :props="orgtreeprops" change-on-select :show-all-levels="false" v-model="selectedorg"
  24. placeholder="请选择组织"></el-cascader>
  25. </el-form-item>
  26. <el-form-item>
  27. <el-dropdown split-button type="primary" size="mini" @click="handleSearch" @command="searchCommand">
  28. 查询
  29. <el-dropdown-menu slot="dropdown">
  30. <el-dropdown-item command="search">高级查询</el-dropdown-item>
  31. <el-dropdown-item command="clear">查询重置</el-dropdown-item>
  32. </el-dropdown-menu>
  33. </el-dropdown>
  34. </el-form-item>
  35. </el-form>
  36. </div>
  37. <el-table :data="entityList" border height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby">
  38. <el-table-column label="操作" width="160" align="center" fixed>
  39. <template slot-scope="scope">
  40. <router-link :to="'/system/auditsetting/' + scope.row.Id + '/operation'">
  41. <el-button type="primary" title="编辑" size="mini">编辑</el-button>
  42. </router-link>
  43. <el-popover placement="top" title="提示">
  44. <el-alert
  45. title=""
  46. description="确认要删除吗?"
  47. trigger="click"
  48. type="warning"
  49. :closable="false">
  50. </el-alert>
  51. <br/>
  52. <div style="text-align: right; margin: 0">
  53. <el-button type="primary" size="mini" @click="deleteEntity(scope.row)">删除</el-button>
  54. </div>
  55. <el-button slot="reference" type="plain" title="删除" style="margin-left:3px" size="mini">删除</el-button>
  56. </el-popover>
  57. </template>
  58. </el-table-column>
  59. <el-table-column v-for="column in tableColumns" :key="column.Id"
  60. v-if="column.prop != 'CreateOn'" :prop="column.prop" sortable min-width="100" :label="column.label" align="center" show-overflow-tooltip></el-table-column>
  61. <!--<el-table-column prop="CreateOn" sortable min-width="150" label="生成时间" align="center" show-overflow-tooltip>
  62. <template slot-scope="scope">
  63. {{ jstimehandle(scope.row.CreateOn+'') }}
  64. </template>
  65. </el-table-column>-->
  66. </el-table>
  67. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
  68. :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
  69. </el-pagination>
  70. </el-card>
  71. <el-dialog title="高级查询" :visible.sync="dialogVisible" width="720px">
  72. <el-form ref="advancedsearchForm" label-width="110px">
  73. <el-row>
  74. <el-col :span="12">
  75. <el-form-item label="生成时间">
  76. <el-date-picker size="mini" v-model="CreateOn" type="daterange" style="width:100%" range-separator="至"
  77. start-placeholder="生成日期" end-placeholder="结束日期"></el-date-picker>
  78. </el-form-item>
  79. </el-col>
  80. <el-col :span="12">
  81. <el-form-item label="单位ID">
  82. <el-input size="mini" v-model="searchForm.OrganizeId" style="width:100%" placeholder="请输入"></el-input>
  83. </el-form-item>
  84. </el-col>
  85. <el-col :span="12">
  86. <el-form-item label="单位名称">
  87. <el-input size="mini" v-model="searchForm.OrganizeName" style="width:100%" placeholder="请输入"></el-input>
  88. </el-form-item>
  89. </el-col>
  90. <el-col :span="12">
  91. <el-form-item label="审批步骤编码">
  92. <el-input size="mini" v-model="searchForm.AuditStepCode" style="width:100%" placeholder="请输入"></el-input>
  93. </el-form-item>
  94. </el-col>
  95. <el-col :span="12">
  96. <el-form-item label="审批步骤名称">
  97. <el-input size="mini" v-model="searchForm.AuditStepName" style="width:100%" placeholder="请输入"></el-input>
  98. </el-form-item>
  99. </el-col>
  100. <el-col :span="12">
  101. <el-form-item label="角色ID">
  102. <el-input size="mini" v-model="searchForm.RoleId" style="width:100%" placeholder="请输入"></el-input>
  103. </el-form-item>
  104. </el-col>
  105. <el-col :span="12">
  106. <el-form-item label="角色名称">
  107. <el-input size="mini" v-model="searchForm.RoleName" style="width:100%" placeholder="请输入"></el-input>
  108. </el-form-item>
  109. </el-col>
  110. <el-col :span="12">
  111. <el-form-item label="备注">
  112. <el-input size="mini" v-model="searchForm.Remark" style="width:100%" placeholder="请输入"></el-input>
  113. </el-form-item>
  114. </el-col>
  115. </el-row>
  116. </el-form>
  117. <span slot="footer" class="dialog-footer">
  118. <el-button size="mini" @click="dialogVisible = false">取 消</el-button>
  119. <el-button size="mini" type="primary" @click="handleSearch">查 询</el-button>
  120. </span>
  121. </el-dialog>
  122. </div>
  123. </template>
  124. <script>
  125. import { mapGetters } from 'vuex'
  126. import api from '@/api/system/auditsetting'
  127. export default {
  128. computed: {
  129. ...mapGetters({
  130. authUser: 'authUser'
  131. })
  132. },
  133. name: 'oilauditsetting',
  134. data () {
  135. return {
  136. dialogVisible: false,
  137. // 列表数据
  138. entityList: [],
  139. // 分页参数
  140. size: 10,
  141. currentPage: 1,
  142. currentItemCount: 0,
  143. ACode: "",
  144. // 列表排序
  145. Column: {
  146. Order: '',
  147. Prop: ''
  148. },
  149. // 查询时间
  150. CreateOn: [new Date(new Date().getTime() - 30 * 24 * 60 * 60 * 1000), new Date()],
  151. // 查询项
  152. searchFormReset: {},
  153. searchForm: {
  154. Id: '',
  155. OrganizeId: '',
  156. OrganizeName: '',
  157. AuditStepCode: '',
  158. AuditStepName: '',
  159. RoleId: '',
  160. RoleName: '',
  161. Remark: '',
  162. IsDelete: '',
  163. CreateOn: '',
  164. CreateUserId: '',
  165. CreateBy: '',
  166. ModifiedOn: '',
  167. ModifiedUserId: '',
  168. ModifiedBy: ''
  169. },
  170. tableColumns: [
  171. {
  172. prop: 'OrganizeName',
  173. label: '单位名称',
  174. width: 100,
  175. sort: true
  176. },
  177. {
  178. prop: 'AuditStepCode',
  179. label: '审批步骤编码',
  180. width: 100,
  181. sort: true
  182. },
  183. {
  184. prop: 'AuditStepName',
  185. label: '审批步骤名称',
  186. width: 100,
  187. sort: true
  188. },
  189. {
  190. prop: 'RoleName',
  191. label: '角色名称',
  192. width: 100,
  193. sort: true
  194. },
  195. {
  196. prop: 'WorkFlowName',
  197. label: '工作流名称',
  198. width: 100,
  199. sort: true
  200. },
  201. {
  202. prop: 'Remark',
  203. label: '备注',
  204. width: 100,
  205. sort: true
  206. },
  207. {
  208. prop: 'CreateOn',
  209. label: '创建时间',
  210. width: 100,
  211. sort: true
  212. }
  213. ]
  214. }
  215. },
  216. created () {
  217. // 查询条件初始值备份
  218. Object.assign(this.searchFormReset, this.searchForm)
  219. // 查询列表
  220. if (this.$route.query.step == 1){
  221. //企业法规处审核
  222. this.ACode = "FIRST_TRIAL"
  223. } else if (this.$route.query.step == 2) {
  224. //二级单位复审
  225. this.ACode = "SECOND_TRIAL"
  226. } else if (this.$route.query.step == 3) {
  227. //业务处室接收
  228. this.ACode = "PROF_RECE"
  229. } else if (this.$route.query.step == 4) {
  230. //业务处室专业审核
  231. this.ACode = "PROF_AUDIT"
  232. } else if (this.$route.query.step == 5) {
  233. //集中评审
  234. this.ACode = "PROF_CONCENT"
  235. } else if (this.$route.query.step == 6) {
  236. //企业法规处审核
  237. this.ACode = "PROF_REGULATION"
  238. }
  239. this.initDatas()
  240. // his.getDictOptions()
  241. },
  242. methods: {
  243. initDatas () {
  244. // 分页及列表条件
  245. let params = {
  246. _currentPage: this.currentPage,
  247. _size: this.size,
  248. Order: this.Column.Order,
  249. Prop: this.Column.Prop,
  250. Code: this.ACode
  251. }
  252. let myCreateOn = []
  253. // 解析时间
  254. if (this.CreateOn.length === 2) {
  255. this.CreateOn[1].setHours(23)
  256. this.CreateOn[1].setMinutes(59)
  257. this.CreateOn[1].setSeconds(59)
  258. myCreateOn.push(this.formatDateTime(this.CreateOn[0]))
  259. myCreateOn.push(this.formatDateTime(this.CreateOn[1]))
  260. }
  261. // 查询条件
  262. Object.assign(params, this.searchForm)
  263. // 访问接口
  264. api.getList(myCreateOn.join(','), params, this.$axios).then(res => {
  265. this.entityList = res.data.items
  266. this.currentItemCount = res.data.currentItemCount
  267. }).catch(err => {
  268. console.error(err)
  269. })
  270. },
  271. /* getDictOptions () {
  272. api.getDictList(this.$axios).then(res => {
  273. this.searchForm.OrganizeId = res.data.items['OrganizeId']
  274. }).catch(err => {
  275. console.error(err)
  276. })
  277. }, */
  278. searchCommand (command) {
  279. if (command === 'search') {
  280. this.dialogVisible = true
  281. } else if (command === 'clear') {
  282. this.clearSearch()
  283. }
  284. },
  285. // 列表排序功能
  286. orderby (column) {
  287. if (column.order === 'ascending') {
  288. this.Column.Order = 'asc'
  289. } else if (column.order === 'descending') {
  290. this.Column.Order = 'desc'
  291. }
  292. this.Column.Prop = column.prop
  293. this.initDatas()
  294. },
  295. clearSearch () {
  296. Object.assign(this.searchForm, this.searchFormReset)
  297. // this.searchForm = this.searchFormReset;
  298. this.CreateOn = ''
  299. this.initDatas()
  300. },
  301. handleSearch () {
  302. this.currentPage = 1
  303. this.dialogVisible = false
  304. this.initDatas()
  305. },
  306. handleCurrentChange (value) {
  307. this.currentPage = value
  308. this.initDatas()
  309. },
  310. handleSizeChange (value) {
  311. this.size = value
  312. this.currentPage = 1
  313. this.initDatas()
  314. },
  315. deleteEntity (row) {
  316. row.deleteConfirmFlag = false
  317. api.deleteEntity(row.Id, this.$axios).then(res => {
  318. if (res.data.code === 0) {
  319. this.initDatas()
  320. this.$message({
  321. type: 'success',
  322. message: res.data.message
  323. })
  324. } else {
  325. this.$message({
  326. type: 'warning',
  327. message: res.data.message
  328. })
  329. }
  330. }).catch(err => {
  331. console.error(err)
  332. })
  333. },
  334. jstimehandle (val) {
  335. if (val === '') {
  336. return '----'
  337. } else if (val === '0001-01-01T08:00:00+08:00') {
  338. return '----'
  339. } else if (val === '5000-01-01T23:59:59+08:00') {
  340. return '永久'
  341. } else {
  342. val = val.replace('T', ' ')
  343. return val.substring(0, 10)
  344. }
  345. },
  346. formatDateTime (date) {
  347. var y = date.getFullYear()
  348. var m = date.getMonth() + 1
  349. m = m < 10 ? ('0' + m) : m
  350. var d = date.getDate()
  351. d = d < 10 ? ('0' + d) : d
  352. var h = date.getHours()
  353. var minute = date.getMinutes()
  354. minute = minute < 10 ? ('0' + minute) : minute
  355. return y + '-' + m + '-' + d + ' ' + h + ':' + minute
  356. }
  357. }
  358. }
  359. </script>
  360. <style lang="scss">
  361. .el-pagination {
  362. margin: 1rem 0 2rem;
  363. text-align: right;
  364. }
  365. </style>