albumAuditList.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  1. <template>
  2. <rx-layout>
  3. <div slot="center" style>
  4. <rx-fit>
  5. <div slot="toolheader" border="false" foldbtn="false">
  6. <breadcrumb firstLevel="专辑管理" lastLevel="专辑审核" />
  7. <div class="mainContent">
  8. <div class="body" :style="{'padding-right': $store.state.appSetting.collapsed ? '0px' : '20px' }">
  9. <div class="content">
  10. <a-form ref="auditFrom" layout="inline" style="display:flex;" >
  11. <div style="width:80%;;display:flex;flex-wrap:wrap;">
  12. <div style="display:flex;flex-wrap:wrap;">
  13. <a-form-item
  14. style="width:320px;margin: 5px 40px 5px 0;"
  15. label="专辑名称"
  16. name="name">
  17. <a-input v-model="queryParam.name" placeholder="请输入"/>
  18. </a-form-item>
  19. <a-form-item
  20. style="width:320px;margin: 5px 40px 5px 0;"
  21. label="专辑分类"
  22. name="categoryIds">
  23. <a-cascader v-model="categoryIds"
  24. :options="classifyLevelList"
  25. :fieldNames="{ label: 'name', value: 'pkId', children: 'children' }"
  26. placeholder="请选择"
  27. changeOnSelect
  28. @change="handleClassifyChange" />
  29. </a-form-item>
  30. </div>
  31. <div style="display:flex;flex-wrap:wrap;" v-if="extend" :class="{'show-other': extend}">
  32. <a-form-item
  33. style="width:320px;margin: 5px 40px 5px 0;"
  34. label="负责人"
  35. name="ownerName">
  36. <a-input v-model="queryParam.ownerName" placeholder="请输入" />
  37. </a-form-item>
  38. <a-form-item
  39. style="width:320px;margin: 5px 40px 5px 0;"
  40. label="审核状态"
  41. name="approvalState">
  42. <a-select v-model="queryParam.approvalState" placeholder="请选择" allowClear>
  43. <a-select-option v-for="(item,index) in approvalStateList" :key="index" :value="item.value">
  44. {{item.label}}
  45. </a-select-option>
  46. </a-select>
  47. </a-form-item>
  48. <a-form-item
  49. style="width:320px;margin: 5px 40px 5px 0;"
  50. label="提交时间"
  51. name="createTime">
  52. <a-range-picker v-model="createTime"
  53. separator="→"
  54. format="YYYY/MM/DD"
  55. valueFormat="YYYY-MM-DD"
  56. @change="handleClearTimeChange">
  57. <a-icon v-if="$store.state.appSetting.collapsed" slot="suffixIcon" type="calendar" />
  58. </a-range-picker>
  59. </a-form-item>
  60. </div>
  61. </div>
  62. <div style="width:20%;display:flex;justify-content:flex-end;align-content: flex-start;flex-wrap:wrap;">
  63. <div style="display:flex;justify-content:center;margin-top: 8px;">
  64. <a-button @click="handleResetClick(true)">重置</a-button>
  65. <a-button type="primary" @click="handleSearchClick">查询</a-button>
  66. </div>
  67. <div style="margin-top: 8px;">
  68. <a-button type="link" @click="extend = !extend">
  69. <template v-if="!extend">
  70. <div>
  71. 展开
  72. <a-icon type="down" />
  73. </div>
  74. </template>
  75. <template v-else>
  76. <div>
  77. 收起
  78. <a-icon type="up" />
  79. </div>
  80. </template>
  81. </a-button>
  82. </div>
  83. </div>
  84. </a-form>
  85. <rx-button alias="albumAuditListBatch" :butn-icon="'false'" @click="handldAuditClick('batch')">批量审核</rx-button>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. <rx-grid
  91. ref="auditRef"
  92. class="table-style"
  93. style="background: #fff"
  94. :columns="columns"
  95. :allowRowSelect="true"
  96. :multiSelect="true"
  97. :url="api.query"
  98. :queryParam="queryParam"
  99. data-field="result.data"
  100. :defaultPageSize="10"
  101. :pageSizeOptions="['10','20','30','40']"
  102. idField="pkId"
  103. >
  104. <template slot="albumName" slot-scope="{text}">
  105. <div style="white-space: pre-line">{{ text }}</div>
  106. </template>
  107. <template slot="categoryName" slot-scope="{text}">
  108. <div style="white-space: pre-line">{{ text }}</div>
  109. </template>
  110. <template slot="action" slot-scope="{text,record}">
  111. <template v-if="record.actionFlag.indexOf('approve') > -1">
  112. <rx-button class="clearBtn" alias="albumAuditListProcess" :butn-icon="'none'" @click="handleJumpUpdateClick(record,true)">审核</rx-button>
  113. <rx-button class="clearBtn" alias="albumAuditListFast" :butn-icon="'none'" @click="handldAuditClick('fast',record)">快速审核</rx-button>
  114. </template>
  115. <template v-else>
  116. <rx-button class="clearBtn" alias="albumAuditListlook" :butn-icon="'none'" @click="handleJumpUpdateClick(record,false)">查看</rx-button>
  117. </template>
  118. </template>
  119. </rx-grid>
  120. </rx-fit>
  121. <a-modal v-model="auditShow"
  122. :title="modalTitle"
  123. centered
  124. okText="保存"
  125. @ok="handleOk"
  126. :confirmLoading="saveLoading">
  127. <a-form ref="labelRef" :model="auditForm" layout="inline">
  128. <a-form-item prop="result">
  129. <a-radio-group v-model="auditForm.result">
  130. <a-radio value="1">通过</a-radio>
  131. <a-radio value="0">驳回</a-radio>
  132. </a-radio-group>
  133. </a-form-item>
  134. <a-form-item prop="remark" style="margin-top:10px;">
  135. <a-input v-model="auditForm.remark" type="textarea" :autosize="{minRows: 3, maxRows: 6}" :maxLength="200" placeholder="请输入审批意见" />
  136. </a-form-item>
  137. </a-form>
  138. </a-modal>
  139. </div>
  140. </rx-layout>
  141. </template>
  142. <script>
  143. import breadcrumb from '../components/breadcrumb'
  144. import orgPeople from './components/orgPeople'
  145. import api from '@/api/knowledge/album/albumAudit'
  146. import albumApi from '@/api/knowledge/album/album'
  147. import mixin from "../aMixin/mixin"
  148. const auditMixin = new mixin('audit')
  149. export default {
  150. name: 'auditManageList',
  151. components: {
  152. breadcrumb,
  153. orgPeople
  154. },
  155. mixins: [ auditMixin ],
  156. data() {
  157. return {
  158. api,
  159. albumApi,
  160. saveLoading: false,
  161. urls: '',
  162. modalTitle: '快速审核',
  163. extend: true,
  164. queryParam: {
  165. type: 1,
  166. name: '',
  167. categoryId: '',
  168. ownerName: '',
  169. approvalState: undefined,
  170. createTimeStart: '',
  171. createTimeEnd: ''
  172. },
  173. createTime: [],
  174. categoryIds: [],
  175. classifyLevelList: [],
  176. approvalStateList: [
  177. {value: 1, label: '待节点审核'},
  178. {value: 2, label: '节点驳回'},
  179. {value: 3, label: '待最终审核'},
  180. {value: 4, label: '最终驳回'},
  181. {value: 5, label: '最终通过'}
  182. ],
  183. columns: [
  184. {
  185. title: '专辑ID',
  186. dataIndex: 'pkId',
  187. align: 'center',
  188. width: 200
  189. },
  190. {
  191. title: '专辑名称',
  192. dataIndex: 'albumName',
  193. align: 'center',
  194. width: 150,
  195. scopedSlots: {customRender: 'albumName'}
  196. },
  197. {
  198. title: '所属分类',
  199. dataIndex: 'categoryName',
  200. align: 'center',
  201. width: 150,
  202. scopedSlots: {customRender: 'categoryName'}
  203. },
  204. {
  205. title: '收录知识量',
  206. dataIndex: 'knowledgeTotal',
  207. align: 'center',
  208. width: 100
  209. },
  210. {
  211. title: '专辑负责人',
  212. dataIndex: 'ownerName',
  213. align: 'center',
  214. width: 100
  215. },
  216. {
  217. title: '提交时间',
  218. dataIndex: 'createTime',
  219. align: 'center',
  220. },
  221. {
  222. title: '状态',
  223. dataIndex: 'approvalStateName',
  224. align: 'center',
  225. width: 100
  226. },
  227. {
  228. title: '审核人',
  229. dataIndex: 'previousApproverName',
  230. align: 'center',
  231. width: 100
  232. },
  233. {
  234. title: '最后一次审核时间',
  235. dataIndex: 'previousApproverTime',
  236. align: 'center',
  237. },
  238. {
  239. title: '操作',
  240. dataIndex: 'action',
  241. // align: 'center',
  242. scopedSlots: {customRender: 'action'},
  243. width: 130
  244. }
  245. ],
  246. auditShow: false,
  247. // 要审核的数据
  248. willAuditData: [],
  249. auditForm: {
  250. pkIds:'',
  251. result:'1',
  252. remark:'',
  253. }
  254. }
  255. },
  256. created() {
  257. if(this.$route.query.showOnlyUser) {
  258. this.queryParam.type = 2
  259. } else {
  260. this.queryParam.type = 1
  261. }
  262. this.init()
  263. },
  264. methods: {
  265. async init() {
  266. let res = await albumApi.categories()
  267. this.classifyLevelList = this.formatData(res.data)
  268. },
  269. formatData(data) {
  270. const that = this
  271. data.forEach((element) => {
  272. if (element.children && element.children.length > 0) {
  273. that.formatData(element.children)
  274. } else {
  275. delete element.children
  276. }
  277. })
  278. return data
  279. },
  280. handleSearchClick() {
  281. if(this.createTime && this.createTime.length) {
  282. this.queryParam.createTimeStart = this.createTime[0]
  283. this.queryParam.createTimeEnd = this.createTime[1]
  284. }
  285. if(this.categoryIds && this.categoryIds.length) {
  286. this.queryParam.categoryId = this.categoryIds.slice('-1')[0]
  287. }
  288. this.reloadTable()
  289. },
  290. // 审核跳转
  291. handleJumpUpdateClick(record,arg = false) {
  292. this.$router.push({
  293. path: '/knowledge/albumInfo',
  294. // pkId showCheck: 是否显示审核
  295. query: { pkId: record.pkId, showCheck: arg}
  296. })
  297. },
  298. // 确认审核
  299. handleOk(){
  300. this.saveLoading = true
  301. this.auditForm.pkIds = this.willAuditData.map(item => item.approvalId)
  302. this.auditForm.result = parseInt(this.auditForm.result)
  303. // if(this.$route.query.showUnchecked) {
  304. // ids = this.willAuditData.map(item => item.approvalsFirst.pkId)
  305. // }
  306. api.approve(this.auditForm).then(res => {
  307. if(res.code == 200) {
  308. this.auditShow = false
  309. this.reloadTable()
  310. this.saveLoading = false
  311. }
  312. })
  313. },
  314. // 快速审核/批量审核
  315. handldAuditClick(title,arg = {}) {
  316. this.modalTitle = title == 'fast' ? '快速审核' : '批量审核'
  317. this.auditForm = Object.assign({},this.$options.data().auditForm)
  318. this.willAuditData = []
  319. if(title == 'fast') {
  320. this.willAuditData.push(arg)
  321. } else {
  322. this.willAuditData = this.$refs.auditRef.getSelectedRows()
  323. if(!this.willAuditData.length) {
  324. this.$message.error("请选择要审核的专辑");
  325. return
  326. }
  327. for(let i of this.willAuditData) {
  328. // if(i.approvalStateName != '待节点审核' && i.approvalStateName != '待最终审核') {
  329. // this.$message.error("审核存在状态为驳回/通过的节点,无法审批");
  330. // return
  331. // }
  332. if(i.actionFlag.indexOf('view') > -1) {
  333. this.$message.error("审核存在状态为驳回/通过的节点或您不是审批人,无法审批");
  334. return
  335. }
  336. }
  337. }
  338. this.auditShow = true
  339. },
  340. // 重新加载表格
  341. reloadTable() {
  342. this.$refs.auditRef.loadData()
  343. }
  344. }
  345. }
  346. </script>
  347. <style lang="less" scoped>
  348. @gary: #f8f8f8;
  349. @white: #fff;
  350. .rx-fit {
  351. padding: 40px!important;
  352. background: @gary;
  353. .fit-header {
  354. .mainContent {
  355. width: 100%;
  356. .body {
  357. background: @white;
  358. padding: 10px 0 10px 20px;
  359. .content {
  360. background: @white;
  361. button:first-child {
  362. margin-right: 20px;
  363. }
  364. >button {
  365. margin: 10px;
  366. margin-left: 0;
  367. }
  368. }
  369. }
  370. }
  371. }
  372. .table-style {
  373. padding: 20px;
  374. .clearBtn {
  375. background: none;
  376. color: #3294F7;
  377. text-shadow: none;
  378. padding: 0px 6px;
  379. border: none;
  380. box-shadow: none;
  381. }
  382. }
  383. }
  384. .knowledge-manage {
  385. position: relative;
  386. }
  387. .knowledge-manage::after {
  388. position: absolute;
  389. top: -11px;
  390. left: 76px;
  391. content: attr(data-attr);
  392. width: 20px;
  393. height: 20px;
  394. background: red;
  395. border-radius: 50%;
  396. }
  397. .show-other{
  398. width: 100%;
  399. animation:show-other-search 0.8s;
  400. }
  401. @keyframes show-other-search{
  402. 0%{opacity:0;}
  403. 50%{opacity:0.8;}
  404. 100%{opacity: 1;}
  405. }
  406. </style>
  407. <style scoped>
  408. /deep/ .ant-btn > .anticon + span {
  409. margin-left: 0;
  410. }
  411. /deep/.ant-table-thead > tr > th {
  412. text-align: center;
  413. height: 54px;
  414. }
  415. /deep/ .ant-table-tbody > tr > td {
  416. height: 54px;
  417. }
  418. /deep/ .ant-form{
  419. padding: 0;
  420. }
  421. /deep/ .gridContent{
  422. border: none;
  423. }
  424. </style>