requestProcessing.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. <!-- -->
  2. <template>
  3. <div class="m-container">
  4. <h2>
  5. <div class="squrt"></div>课酬申诉
  6. </h2>
  7. <div class="m-core">
  8. <el-form :inline="true"
  9. :model="searchForm">
  10. <!-- <el-form-item>
  11. <el-input v-model.trim="searchForm.search" @keyup.enter.native="search" placeholder></el-input>
  12. </el-form-item>-->
  13. <el-form-item prop="organId">
  14. <el-select class="multiple"
  15. v-model.trim="searchForm.organId"
  16. filterable
  17. clearable
  18. placeholder="请选择分部">
  19. <el-option v-for="(item,index) in organList"
  20. :key="index"
  21. :label="item.name"
  22. :value="item.id"></el-option>
  23. </el-select>
  24. </el-form-item>
  25. <el-form-item>
  26. <el-select placeholder="老师姓名"
  27. v-model="searchForm.teacherId"
  28. clearable
  29. filterable>
  30. <el-option v-for="(item,index) in teacherList"
  31. :label="item.realName"
  32. :value="item.id"
  33. :key="index"></el-option>
  34. </el-select>
  35. </el-form-item>
  36. <el-form-item>
  37. <el-select placeholder="状态"
  38. v-model="searchForm.statusEnum"
  39. clearable>
  40. <el-option label="待处理"
  41. value="PENDING"></el-option>
  42. <el-option label="已完成"
  43. value="DONE"></el-option>
  44. <el-option label="已同意"
  45. value="AGREED"></el-option>
  46. <el-option label="已拒绝"
  47. value="DENIED"></el-option>
  48. <el-option label="已撤回"
  49. value="WITHDRAWN"></el-option>
  50. </el-select>
  51. </el-form-item>
  52. <el-form-item>
  53. <el-date-picker :clearable="true"
  54. v-model="searchForm.salarySettlementMonth"
  55. type="month"
  56. value-format="yyyy-MM"
  57. placeholder="选择年月"></el-date-picker>
  58. </el-form-item>
  59. <el-form-item>
  60. <el-button type="danger"
  61. @click="search">搜索</el-button>
  62. <el-button @click="onReSet"
  63. type="primary">重置</el-button>
  64. <!-- export/isSettlementCourseSalarys -->
  65. <el-button @click="onExport"
  66. type="primary"
  67. v-permission="'export/teacherSalaryComplaints'"
  68. style=" background: #14928a; border:1px solid #14928a;">导出</el-button>
  69. </el-form-item>
  70. </el-form>
  71. <div class="tableWrap">
  72. <el-table style="width: 100%"
  73. :header-cell-style="{background:'#EDEEF0',color:'#444'}"
  74. :data="tableList">
  75. <el-table-column align="center"
  76. prop="organName"
  77. label="分部"></el-table-column>
  78. <el-table-column align="center"
  79. prop="teacherId"
  80. label="老师编号"></el-table-column>
  81. <el-table-column align="center"
  82. prop="realName"
  83. label="老师姓名"></el-table-column>
  84. <el-table-column align="center"
  85. prop="salarySettlementMonth"
  86. width="150"
  87. label="课酬归属时间"></el-table-column>
  88. <el-table-column align="center"
  89. prop="updateTime"
  90. width="150"
  91. label="申述提交">
  92. <template slot-scope="scope">{{scope.row.updateTime | dateForMinFormat}}</template>
  93. </el-table-column>
  94. <el-table-column align="center"
  95. prop="statusEnum"
  96. label="状态">
  97. <template slot-scope="scope">{{scope.row.statusEnum | statusEnum}}</template>
  98. </el-table-column>
  99. <el-table-column align="center"
  100. prop="operatorRealName"
  101. label="申诉处理者"></el-table-column>
  102. <!-- <el-table-column align="center" prop="reason" width="400" label="备注"></el-table-column> -->
  103. <el-table-column align="center"
  104. prop="courseScheduleId"
  105. width="150"
  106. label="操作">
  107. <template slot-scope="scope">
  108. <div>
  109. <el-button type="text"
  110. @click="lookDetail(scope.row)"
  111. v-permission="'teacherSalaryComplaints/complaintsDispose'">操作</el-button>
  112. </div>
  113. </template>
  114. </el-table-column>
  115. </el-table>
  116. <pagination :total="rules.total"
  117. :page.sync="rules.page"
  118. :limit.sync="rules.limit"
  119. :page-sizes="rules.page_size"
  120. @pagination="getList" />
  121. </div>
  122. </div>
  123. <el-dialog title="课酬申诉"
  124. :visible.sync="dialogVisible"
  125. width="400px">
  126. <div>
  127. <el-form ref="visibleForm"
  128. :model="visibleForm"
  129. class="visibleForm">
  130. <el-form-item label="申述内容"
  131. :rules="[{ required: true, message: '请填写申述内容',trigger: 'blur'}]"
  132. prop="reason">
  133. <el-input type="textarea"
  134. :rows="5"
  135. :disabled="visibleForm.statusEnum !='PENDING'"
  136. v-model.trim="visibleForm.reason"></el-input>
  137. </el-form-item>
  138. <el-form-item label="处理意见"
  139. :rules="[{ required: true, message: '请填写处理意见',trigger: 'blur'}]"
  140. prop="handingSuggestion">
  141. <el-input type="textarea"
  142. :rows="5"
  143. :disabled="visibleForm.statusEnum !='PENDING'"
  144. v-model.trim="visibleForm.handingSuggestion"></el-input>
  145. </el-form-item>
  146. <el-form-item label="处理结果"
  147. v-if="visibleForm.statusEnum !='PENDING'">
  148. {{visibleForm.statusEnum | statusEnum}}
  149. </el-form-item>
  150. </el-form>
  151. </div>
  152. <div slot="footer"
  153. v-if="visibleForm.statusEnum =='PENDING'">
  154. <el-button @click="subreset('DENIED')">拒绝</el-button>
  155. <el-button type="primary"
  156. @click="subreset('AGREED')">同意</el-button>
  157. </div>
  158. </el-dialog>
  159. </div>
  160. </template>
  161. <script>
  162. import qs from 'qs'
  163. import axios from "axios";
  164. import { getToken } from "@/utils/auth";
  165. import pagination from "@/components/Pagination/index";
  166. import load from "@/utils/loading";
  167. import { getTeacher, getEmployeeOrgan } from "@/api/buildTeam";
  168. import {
  169. teacherSalaryComplaints,
  170. teacherSalaryComplaintsDetail,
  171. complaintsDispose
  172. } from "@/api/journal";
  173. export default {
  174. components: { pagination },
  175. data () {
  176. return {
  177. searchForm: {
  178. search: null,
  179. salarySettlementMonth: null,
  180. statusEnum: null,
  181. teacherId: null,
  182. organId: null
  183. },
  184. teacherList: [],
  185. tableList: [],
  186. organList: [],
  187. rules: {
  188. // 分页规则
  189. limit: 10, // 限制显示条数
  190. page: 1, // 当前页
  191. total: 0, // 总条数
  192. page_size: [10, 20, 40, 50] // 选择限制显示条数
  193. },
  194. dialogVisible: false,
  195. visibleForm: {
  196. reason: null,
  197. handingSuggestion: null,
  198. teacherId: null,
  199. salarySettlementMonth: null,
  200. statusEnum: null,
  201. id: null
  202. }
  203. };
  204. },
  205. //生命周期 - 创建完成(可以访问当前this实例)
  206. created () { },
  207. //生命周期 - 挂载完成(可以访问DOM元素)
  208. mounted () {
  209. getTeacher().then(res => {
  210. if (res.code == 200) {
  211. this.teacherList = res.data;
  212. }
  213. });
  214. getEmployeeOrgan().then(res => {
  215. if (res.code == 200) {
  216. this.organList = res.data;
  217. }
  218. });
  219. // 获取分部
  220. this.init();
  221. },
  222. methods: {
  223. init () {
  224. this.getList();
  225. },
  226. getList () {
  227. this.searchForm.page = this.rules.page;
  228. this.searchForm.rows = this.rules.limit;
  229. teacherSalaryComplaints(this.searchForm).then(res => {
  230. if (res.code == 200) {
  231. this.tableList = res.data.rows;
  232. this.rules.total = res.data.total;
  233. }
  234. });
  235. },
  236. search () {
  237. this.rules.page = 1;
  238. this.getList();
  239. },
  240. onReSet () {
  241. this.searchForm = {
  242. search: null,
  243. salarySettlementMonth: null,
  244. statusEnum: null,
  245. teacherId: null,
  246. organId: null
  247. };
  248. this.search();
  249. },
  250. onExport () {
  251. let url = "/api-web/export/teacherSalaryComplaints";
  252. let obj = this.searchForm;
  253. const options = {
  254. method: "post",
  255. headers: {
  256. Authorization: getToken()
  257. },
  258. url,
  259. data: qs.stringify(obj),
  260. responseType: "blob"
  261. };
  262. this.$confirm("您确定导出列表?", "提示", {
  263. confirmButtonText: "确定",
  264. cancelButtonText: "取消",
  265. type: "warning"
  266. })
  267. .then(() => {
  268. load.startLoading();
  269. axios(options)
  270. .then(res => {
  271. let blob = new Blob([res.data], {
  272. // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8',
  273. type: "application/vnd.ms-excel;charset=utf-8"
  274. // word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
  275. });
  276. let text = new Response(blob).text();
  277. text.then(res => {
  278. // 判断是否报错
  279. if (res.indexOf("code") != -1) {
  280. let json = JSON.parse(res);
  281. this.$message.error(json.msg);
  282. } else {
  283. let objectUrl = URL.createObjectURL(blob);
  284. let link = document.createElement("a");
  285. let nowTime = new Date();
  286. let ymd =
  287. nowTime.getFullYear() +
  288. "" +
  289. (nowTime.getMonth() + 1) +
  290. "" +
  291. nowTime.getDate() +
  292. "" +
  293. nowTime.getHours() +
  294. "" +
  295. nowTime.getMinutes();
  296. let fname = ymd + "课酬申诉";
  297. link.href = objectUrl;
  298. link.setAttribute("download", fname);
  299. document.body.appendChild(link);
  300. link.click();
  301. }
  302. });
  303. load.endLoading();
  304. })
  305. .catch(error => {
  306. this.$message.error("导出数据失败,请联系管理员");
  307. load.endLoading();
  308. });
  309. })
  310. .catch(() => { });
  311. },
  312. lookDetail (row) {
  313. teacherSalaryComplaintsDetail({ id: row.id }).then(res => {
  314. if (res.code == 200) {
  315. this.visibleForm = {
  316. reason: res.data.reason,
  317. handingSuggestion: res.data.handingSuggestion,
  318. teacherId: res.data.teacherId,
  319. salarySettlementMonth: res.data.salarySettlementMonth,
  320. statusEnum: res.data.statusEnum,
  321. id: res.data.id,
  322. };
  323. this.dialogVisible = true;
  324. }
  325. });
  326. },
  327. subreset (str) {
  328. this.$refs["visibleForm"].validate(flag => {
  329. if (flag) {
  330. let obj = {
  331. reason: this.visibleForm.reason,
  332. handingSuggestion: this.visibleForm.handingSuggestion,
  333. currentReduceSalary: this.visibleForm.reduceSalary,
  334. salarySettlementMonth: this.visibleForm.salarySettlementMonth,
  335. teacherId: this.visibleForm.teacherId,
  336. statusEnum: str,
  337. id: this.visibleForm.id
  338. };
  339. complaintsDispose(obj).then(res => {
  340. if (res.code == 200) {
  341. this.dialogVisible = false;
  342. this.$message.success("处理成功");
  343. this.getList();
  344. }
  345. });
  346. }
  347. });
  348. }
  349. },
  350. filters: {
  351. statusEnum (val) {
  352. let template = {
  353. PENDING: "待处理",
  354. DONE: "已完成",
  355. AGREED: "已同意",
  356. DENIED: "已拒绝",
  357. WITHDRAWN: "已撤回"
  358. };
  359. return template[val];
  360. }
  361. },
  362. watch: {
  363. dialogVisible (val) {
  364. if (!val) {
  365. this.visibleForm = {
  366. reason: null,
  367. handingSuggestion: null,
  368. teacherId: null,
  369. salarySettlementMonth: null,
  370. statusEnum: null,
  371. id: null
  372. };
  373. this.$refs["visibleForm"].resetFields();
  374. }
  375. }
  376. }
  377. };
  378. </script>
  379. <style lang='scss' scoped>
  380. </style>