achievementsMuban.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  1. <template>
  2. <div class="container" style="margin: 15px 0 0 0">
  3. <fullscreen :fullscreen.sync="fullscreen" class="container-box"
  4. style="margin: 0 !important; padding: 0 !important">
  5. <div class="titbox">
  6. <h2 class="font-ui">绩效模板管理</h2>
  7. <div>
  8. <i class="el-icon-refresh" @click="iconCli(1)"></i>
  9. <i class="el-icon-full-screen" @click="iconCli(2)"></i>
  10. </div>
  11. </div>
  12. <div class="search">
  13. <mySearch :searchList="searchList" @searchInfo="searchInfo"></mySearch>
  14. <el-button size="small" @click="addExcel" type="primary" v-if="isManageMuban">新增模板</el-button>
  15. </div>
  16. <div class="tabbox">
  17. <el-table height="calc(100% - 40px)" v-loading="loading" class="com-table" ref="multipleTable"
  18. :data="tableData" tooltip-effect="dark" size="small" border style="width: 100%">
  19. <el-table-column align="center" prop="tabName" label="模板名称" show-overflow-tooltip>
  20. </el-table-column>
  21. <el-table-column align="center" prop="opTime" show-overflow-tooltip label="配置时间">
  22. </el-table-column>
  23. <el-table-column align="center" prop="opNo" show-overflow-tooltip label="配置工号">
  24. </el-table-column>
  25. <el-table-column align="center" prop="opName" show-overflow-tooltip label="配置姓名">
  26. </el-table-column>
  27. <el-table-column align="center" prop="groupName" show-overflow-tooltip label="使用科室">
  28. </el-table-column>
  29. <el-table-column align="center" prop="stsDesc" show-overflow-tooltip label="模板状态">
  30. </el-table-column>
  31. <el-table-column align="center" prop="tempTypeDesc" show-overflow-tooltip label="模板类型" width="150">
  32. </el-table-column>
  33. <el-table-column align="center" prop="hotline" width="200" label="操作">
  34. <template slot-scope="scope">
  35. <el-button :disabled="scope.row.tempStsDesc == '作废'" size="mini" type="primary" plain
  36. @click="issue(scope.row)" v-if="isManageMuban">下发</el-button>
  37. <el-button size="mini" type="primary" plain @click="detailes(scope.row)">查看</el-button>
  38. <!-- <el-button
  39. size="mini"
  40. type="primary"
  41. plain
  42. @click="updates(scope.row)"
  43. >修改</el-button
  44. > -->
  45. <el-button :disabled="scope.row.tempStsDesc == '作废'" size="mini" type="danger" plain
  46. @click="deletes(scope.row)" v-if="isManageMuban">作废</el-button>
  47. </template>
  48. </el-table-column>
  49. </el-table>
  50. <el-pagination class="pageBox" @current-change="currchange" layout="prev, pager, next" background
  51. :total="total">
  52. </el-pagination>
  53. </div>
  54. <myMessage :messTit="messTit" @closeMessage="closeMessage" :centerDialogVisible="centerDialogVisible"
  55. v-if="centerDialogVisible"></myMessage>
  56. </fullscreen>
  57. <el-dialog title="下发绩效" :visible.sync="dialogStatus" width="50%" :close-on-press-escape="false"
  58. :show-close="false" :destroy-on-close="true" :close-on-click-modal="false" :append-to-body="true">
  59. <el-form ref="ruleForm" :rules="rules" :model="formData" label-width="80px">
  60. <el-form-item label="绩效标题" prop="woTitle">
  61. <el-input placeholder="请输入绩效标题" v-model="formData.woTitle"></el-input>
  62. </el-form-item>
  63. <el-form-item v-if="tempType == '0' || tempType == '1'" label="下发月份" prop="sendMonth">
  64. <el-date-picker style="width: 100% !important" v-model="formData.sendMonth" value-format="yyyy-MM"
  65. type="month" placeholder="选择月份">
  66. </el-date-picker>
  67. </el-form-item>
  68. <el-form-item v-else label="下发年份" prop="sendYear">
  69. <el-date-picker style="width: 100% !important" v-model="formData.sendYear" value-format="yyyy"
  70. type="year" placeholder="选择年份">
  71. </el-date-picker>
  72. </el-form-item>
  73. <el-form-item label="反馈时间" prop="requiredTime">
  74. <el-date-picker style="width: 100%" v-model="formData.requiredTime" type="datetime"
  75. placeholder="选择反馈时间" value-format="yyyy-MM-01 HH:mm:ss">
  76. </el-date-picker>
  77. </el-form-item>
  78. <el-form-item label="接收科室" prop="sendNoArr">
  79. <el-select placeholder="接收科室" v-model="formData.sendNoArr" style="width: 100%"
  80. :disabled="tempType == '0'" multiple>
  81. <el-option v-for="items in options" :key="items.value" :label="items.loginName + ' ' + items.groupName"
  82. :value="items.groupId">
  83. </el-option>
  84. </el-select>
  85. </el-form-item>
  86. <el-form-item label="需要回复" prop="needReply">
  87. <el-select
  88. style="width: 100% !important"
  89. v-model="formData.needReply"
  90. placeholder="请选择是否需要回复">
  91. <el-option label="是" value="是"> </el-option>
  92. <el-option label="否" value="否"> </el-option>
  93. </el-select>
  94. </el-form-item>
  95. </el-form>
  96. <div slot="footer" class="dialog-footer">
  97. <el-button @click="resetUser('ruleForm')">取 消</el-button>
  98. <el-button v-loading="loading" @click="subUser('ruleForm')">确 定</el-button>
  99. </div>
  100. </el-dialog>
  101. </div>
  102. </template>
  103. <script>
  104. import mySearch from "../../../components/search";
  105. import myMessage from "../../../components/myMessage.vue";
  106. export default {
  107. components: {
  108. mySearch,
  109. myMessage,
  110. },
  111. data() {
  112. return {
  113. centerDialogVisible: false,
  114. messTit: "",
  115. dataId: "",
  116. options: [],
  117. dialogStatus: false,
  118. formData: {
  119. woTitle: "",
  120. requiredTime: "",
  121. sendNoArr: [],
  122. sendMonth: "",
  123. sendYear: "",
  124. needReply: "是",
  125. },
  126. rules: {
  127. woTitle: [{
  128. required: true,
  129. message: "请输入预算标题",
  130. trigger: "blur"
  131. }, ],
  132. requiredTime: [{
  133. required: true,
  134. message: "请选择反馈时间",
  135. trigger: "change",
  136. }, ],
  137. sendNoArr: [{
  138. required: true,
  139. message: "请选择接收科室",
  140. trigger: "change",
  141. }, ],
  142. sendMonth: [{
  143. required: true,
  144. message: "请选择下发月份",
  145. trigger: "change",
  146. }, ],
  147. sendYear: [{
  148. required: true,
  149. message: "请选择下发年份",
  150. trigger: "change",
  151. }, ],
  152. },
  153. fullscreen: false,
  154. total: 0,
  155. pageSize: 1,
  156. tableData: [],
  157. searchList: [{
  158. type: "input",
  159. tit: "模板名称",
  160. value: "",
  161. width: "100%",
  162. options: [],
  163. }, ],
  164. params: {
  165. tempName: "",
  166. },
  167. loading: false,
  168. tableCell: "",
  169. tempType: "",
  170. isManageMuban: false
  171. };
  172. },
  173. methods: {
  174. // 查看详情
  175. detailes(val) {
  176. this.$router.push({
  177. path: "seekpi",
  178. query: {
  179. tabCode: val.tabCode,
  180. type: "see",
  181. },
  182. });
  183. },
  184. // 增加表单处理
  185. async subUser(formName) {
  186. let sendNoArr = [];
  187. let valid = await this.$refs[formName].validate().catch((err) => err);
  188. if (valid) {
  189. this.options.map((row) => {
  190. this.formData.sendNoArr.map((item) => {
  191. if (item == row.groupId) {
  192. sendNoArr.push({
  193. receiveNo: row.loginNo,
  194. receiveName: row.loginName,
  195. receiveDeptCode: row.groupId,
  196. receiveDeptName: row.groupName,
  197. });
  198. }
  199. });
  200. });
  201. let data = {
  202. tabName: this.tableCell.tabName,
  203. tabCode: this.tableCell.tabCode,
  204. requireTime: this.formData.requiredTime,
  205. receive: sendNoArr,
  206. kpiMonth: this.formData.sendMonth,
  207. tempType: this.tempType,
  208. subType: this.tableCell.subType || "a",
  209. kpiYear: this.formData.sendYear,
  210. needReply: this.formData.needReply,
  211. };
  212. let results = await this.$http({
  213. url: "/market/kpidepts/checkExists",
  214. method: "post",
  215. headers: {
  216. "Content-Type": "application/json",
  217. },
  218. data: data,
  219. });
  220. data.kpiTitle = this.formData.woTitle;
  221. if (results.data.result == 0) {
  222. this.subTask(data);
  223. } else {
  224. let confirm = await this.$confirm(
  225. "本月已下发过绩效是否覆盖下发",
  226. "提示", {
  227. type: "warning"
  228. }
  229. ).catch(() => {
  230. this.$message({
  231. type: "info",
  232. message: "已取消",
  233. });
  234. });
  235. if (confirm == "confirm") {
  236. this.subTask(data);
  237. }
  238. }
  239. }
  240. },
  241. // 下发任务
  242. subTask(data) {
  243. this.$http({
  244. url: "/market/kpidepts/add",
  245. method: "post",
  246. headers: {
  247. "Content-Type": "application/json",
  248. },
  249. data: data,
  250. })
  251. .then((res) => {
  252. if (res.data.result == 0) {
  253. this.$message({
  254. type: "success",
  255. message: "下发成功",
  256. });
  257. } else {
  258. this.$message({
  259. type: "error",
  260. message: res.data.desc,
  261. });
  262. }
  263. this.loading = false;
  264. this.dialogStatus = false;
  265. this.getList(this.params, this.pageSize);
  266. })
  267. .catch((err) => {
  268. this.loading = false;
  269. });
  270. },
  271. // 取消提交
  272. resetUser(formName) {
  273. this.$refs[formName].resetFields();
  274. this.dialogStatus = false;
  275. },
  276. // 下发按钮
  277. issue(val) {
  278. this.tableCell = val;
  279. this.dialogStatus = true;
  280. this.formData.sendNoArr = [];
  281. if (val.tempType == "0") {
  282. this.formData.sendNoArr.push(val.groupId);
  283. }
  284. this.tempType = val.tempType;
  285. },
  286. // 删除模板
  287. deletes(val) {
  288. this.centerDialogVisible = true;
  289. this.messTit = "即将作废绩效模板, 是否确定?";
  290. this.dataId = val.id;
  291. // this.$confirm("即将作废绩效模板, 是否确定?", "提示", {
  292. // confirmButtonText: "确定",
  293. // cancelButtonText: "取消",
  294. // type: "warning",
  295. // })
  296. // .then(() => {
  297. // this.$http({
  298. // url: "/market/kpitemps/delKpiTemp",
  299. // method: "post",
  300. // headers: {
  301. // "Content-Type": "application/json",
  302. // },
  303. // data: { id: val.id },
  304. // }).then((res) => {
  305. // this.$message({
  306. // message: "删除成功",
  307. // type: "success",
  308. // });
  309. // this.getList(this.params, this.pageSize);
  310. // });
  311. // })
  312. // .catch(() => {});
  313. },
  314. closeMessage(v) {
  315. this.centerDialogVisible = false;
  316. if (v === 1) {
  317. this.$http({
  318. url: "/market/kpitemps/delKpiTemp",
  319. method: "post",
  320. headers: {
  321. "Content-Type": "application/json",
  322. },
  323. data: {
  324. id: this.dataId
  325. },
  326. }).then((res) => {
  327. if (res.data.result == "0") {
  328. this.$message({
  329. message: "删除成功",
  330. type: "success",
  331. });
  332. }
  333. this.getList(this.params, this.pageSize);
  334. });
  335. }
  336. },
  337. // 新增模板
  338. addExcel() {
  339. this.$router.push("/initKpi?status=add");
  340. },
  341. // 修改模板 --废弃
  342. updates(val) {
  343. this.$router.push({
  344. path: "seekpi",
  345. query: {
  346. tabCode: val.tabCode,
  347. type: "update",
  348. },
  349. });
  350. },
  351. //搜索数据
  352. searchInfo(v) {
  353. this.params = {};
  354. v[0] ? (this.params.tempName = v[0]) : "";
  355. this.getList(this.params, this.pageSize);
  356. },
  357. //获取列表
  358. getList(v, n) {
  359. this.loading = true;
  360. this.pageSize = n;
  361. this.$http({
  362. url: "/market/kpitemp/queryPage",
  363. method: "post",
  364. headers: {
  365. "Content-Type": "application/json",
  366. page: '{"pageNo":"' + n + '","pageSize":"10"}',
  367. },
  368. data: v,
  369. }).then((res) => {
  370. this.loading = false;
  371. this.tableData = res.data.data;
  372. this.total = res.data.totalRecord;
  373. });
  374. },
  375. //功能栏
  376. iconCli(v) {
  377. if (v === 1) {
  378. this.getList(this.params, this.pageSize);
  379. }
  380. if (v === 2) {
  381. this.fullscreen = !this.fullscreen;
  382. }
  383. },
  384. // 分页
  385. currchange(v) {
  386. this.pageSize = v;
  387. this.getList(this.params, this.pageSize);
  388. },
  389. // 获取科室信息
  390. getOpations() {
  391. this.$http({
  392. url: "/sysmgr/sys/mk/offices/queryList",
  393. method: "post",
  394. headers: {
  395. "Content-Type": "application/json",
  396. },
  397. data: {},
  398. }).then((res) => {
  399. this.options = res.data.body;
  400. });
  401. },
  402. },
  403. mounted() {
  404. this.getOpations();
  405. this.getList(this.params, this.pageSize);
  406. let menus = JSON.parse(window.sessionStorage.childrenMenus);
  407. menus.forEach(item=>{
  408. if(item.systemflag == 1 && item.jspUrl == '/kpiMuban'){
  409. this.isManageMuban = true
  410. }
  411. })
  412. },
  413. watch: {
  414. $route() {
  415. this.getList(this.params, this.pageSize);
  416. },
  417. },
  418. };
  419. </script>
  420. <style scoped>
  421. .el-upload-list {
  422. float: right;
  423. }
  424. .el-input__suffix {
  425. cursor: pointer;
  426. }
  427. .container .el-upload {
  428. width: auto !important;
  429. }
  430. </style>
  431. <style scoped lang="scss">
  432. .btn-default {
  433. display: inline;
  434. margin-left: 10px;
  435. }
  436. .titbox {
  437. div {
  438. float: right;
  439. i {
  440. font-size: 22px;
  441. margin-left: 20px;
  442. cursor: pointer;
  443. }
  444. }
  445. }
  446. .tabbox {
  447. margin-top: 15px;
  448. }
  449. .pageBox {
  450. text-align: right;
  451. margin-top: 10px;
  452. }
  453. </style>