综合办公系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xmTable.vue 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601
  1. <template>
  2. <div style="padding:10px">
  3. <h2 style="text-align: center;">项目管理部考核表</h2>
  4. <table class="table" ref="tableDatas">
  5. <tr>
  6. <td class="table-title">姓名</td>
  7. <td style="text-align:left;padding-left:10px;">{{ tableForm.nickName }}</td>
  8. <td class="table-title" style="width:50px">考核时间</td>
  9. <td>
  10. <el-date-picker v-model="tableForm.assessTime" type="month" placeholder="选择日期">
  11. </el-date-picker>
  12. </td>
  13. <td colspan="3" class="table-title">部门负责人考核意见</td>
  14. <td colspan="3" class="table-title" style="width:300px;">分管领导考核意见</td>
  15. </tr>
  16. <tr>
  17. <td class="table-title">所在部门</td>
  18. <td colspan="3" style="text-align:left;padding-left:10px;">{{ tableForm.deptName }}</td>
  19. <td colspan="3">
  20. <el-radio-group v-model="tableForm.deptAssessment" :disabled="!isDeptLeader">
  21. <el-radio v-for="dict in dict.type.cmc_accessment" :key="dict.value" :label="dict.value">
  22. {{ dict.label }}
  23. </el-radio>
  24. </el-radio-group>
  25. </td>
  26. <td colspan="3">
  27. <el-radio-group v-model="tableForm.managerAssessment" :disabled="!isManager">
  28. <el-radio v-for="dict in dict.type.cmc_accessment" :key="dict.value" :label="dict.value">
  29. {{ dict.label }}
  30. </el-radio>
  31. </el-radio-group>
  32. </td>
  33. </tr>
  34. <tr>
  35. <td class="table-title">部门职务</td>
  36. <td colspan="3" style="text-align:left;padding-left:10px;">{{ tableForm.postGroup }}</td>
  37. <td colspan="3" rowspan="3">
  38. <el-input type="textarea" :rows="4" placeholder="请输入考核意见" v-model="tableForm.deptAdvice"
  39. :disabled="!isDeptLeader">
  40. </el-input>
  41. <el-row justify="center" type="flex">
  42. <el-col :span="12">考核人:<el-input v-model="tableForm.deptAssesser" style="width:150px;" placeholder="请输入考核人"
  43. :disabled="!isDeptLeader"></el-input> </el-col>
  44. <el-col :span="12">日期:<el-date-picker type="date" placeholder="请选择考核日期" v-model="tableForm.deptTime"
  45. style="width:150px;" :disabled="!isDeptLeader"></el-date-picker> </el-col>
  46. </el-row>
  47. </td>
  48. <td colspan="3" rowspan="3">
  49. <el-input type="textarea" :rows="4" placeholder="请输入考核意见" v-model="tableForm.managerAdvice"
  50. :disabled="!isManager">
  51. </el-input>
  52. <el-row justify="center">
  53. <el-col :span="12">考核人:<el-input v-model="tableForm.managerAssesser" style="width:150px;" placeholder="请输入考核人"
  54. :disabled="!isManager"></el-input></el-col>
  55. <el-col :span="12">日期:<el-date-picker type="date" placeholder="请选择考核日期" v-model="tableForm.managerTime"
  56. style="width:150px;" :disabled="!isManager"></el-date-picker></el-col>
  57. </el-row>
  58. </td>
  59. </tr>
  60. <tr>
  61. <td class="table-title">技术职称</td>
  62. <td colspan="3" style="text-align:left;padding-left:10px;">{{ tableForm.titles }}</td>
  63. </tr>
  64. <tr>
  65. <td class="table-title">入职年月</td>
  66. <td style="text-align:left;padding-left:10px;">{{ tableForm.entryDate != null ?
  67. tableForm.entryDate.substring(0, 10) : tableForm.entryDate }}</td>
  68. <td class="table-title">年龄</td>
  69. <td style="text-align:left;padding-left:10px;">{{ tableForm.age }}</td>
  70. </tr>
  71. <tr>
  72. <td rowspan="2" class="table-title">考核内容</td>
  73. <td colspan="5" class="table-fillin">被考核人填写</td>
  74. <td colspan="3" class="table-fzr" style="width:300px;">负责人考核</td>
  75. </tr>
  76. <tr>
  77. <td class="table-fillin">工作内容</td>
  78. <td class="table-fillin">单位</td>
  79. <td class="table-fillin">工作量</td>
  80. <td class="table-fillin">熟练程度</td>
  81. <td class="table-fillin">备注</td>
  82. <td class="table-fzr">工作量</td>
  83. <td class="table-fzr">岗位综合表现</td>
  84. <td class="table-fzr">考核建议</td>
  85. </tr>
  86. <tr>
  87. <td rowspan="6">参与生产</td>
  88. <td>项目负责</td>
  89. <td>项</td>
  90. <td class="personInput">
  91. <span v-if="!isStaff">{{ tableForm.f0101 }}</span>
  92. <el-input v-if="isStaff" v-model="tableForm.f0101"></el-input>
  93. </td>
  94. <td rowspan="6">
  95. <el-radio-group v-model="tableForm.familiar01" :disabled="!isStaff">
  96. <div><el-radio :label="0">生疏</el-radio></div>
  97. <div><el-radio :label="2">熟练</el-radio></div>
  98. <div><el-radio :label="3">精通</el-radio></div>
  99. </el-radio-group>
  100. </td>
  101. <td rowspan="6">
  102. <div>{{ tableForm.remark01 }}</div>
  103. <el-input v-if="isStaff" v-model="tableForm.remark01" type="textarea" :rows="4"></el-input>
  104. </td>
  105. <td rowspan="6">
  106. <el-radio-group v-model="tableForm.workload01" :disabled="!isPiLeader">
  107. <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
  108. <el-radio :key="dict.value" :label="dict.value"
  109. @click.native.prevent="cancelSelect(dict.value, 'workload01', isStaff)">
  110. {{ dict.label }}
  111. </el-radio>
  112. </div>
  113. </el-radio-group>
  114. </td>
  115. <td rowspan="6">
  116. <el-radio-group v-model="tableForm.assessment01" :disabled="!isPiLeader">
  117. <div v-for="dict in dict.type.cmc_accessment" style="text-align:left">
  118. <el-radio :key="dict.value" :label="dict.value"
  119. @click.native.prevent="cancelSelect(dict.value, 'assessment01', isStaff)">
  120. {{ dict.label }}
  121. </el-radio>
  122. </div>
  123. </el-radio-group>
  124. </td>
  125. <td rowspan="6">
  126. <el-input type="textarea" :rows="4" v-model="tableForm.advice01" :disabled="!isPiLeader">
  127. </el-input>
  128. </td>
  129. </tr>
  130. <tr>
  131. <td>外业负责</td>
  132. <td>项</td>
  133. <td class="personInput">
  134. <span v-if="!isStaff">{{ tableForm.f0102 }}</span>
  135. <el-input v-if="isStaff" v-model="tableForm.f0102"></el-input>
  136. </td>
  137. </tr>
  138. <tr>
  139. <td>内业负责</td>
  140. <td>项</td>
  141. <td class="personInput">
  142. <span v-if="!isStaff">{{ tableForm.f0103 }}</span>
  143. <el-input v-if="isStaff" v-model="tableForm.f0103"></el-input>
  144. </td>
  145. </tr>
  146. <tr>
  147. <td>参与外业</td>
  148. <td>项</td>
  149. <td class="personInput">
  150. <span v-if="!isStaff">{{ tableForm.f0104 }}</span>
  151. <el-input v-if="isStaff" v-model="tableForm.f0104"></el-input>
  152. </td>
  153. </tr>
  154. <tr>
  155. <td>参与内业</td>
  156. <td>项</td>
  157. <td class="personInput">
  158. <span v-if="!isStaff">{{ tableForm.f0105 }}</span>
  159. <el-input v-if="isStaff" v-model="tableForm.f0105"></el-input>
  160. </td>
  161. </tr>
  162. <tr>
  163. <td>资料整编</td>
  164. <td>项</td>
  165. <td class="personInput">
  166. <span v-if="!isStaff">{{ tableForm.f0106 }}</span>
  167. <el-input v-if="isStaff" v-model="tableForm.f0106">
  168. </el-input>
  169. </td>
  170. </tr>
  171. <!-- -->
  172. <tr>
  173. <td rowspan="6">项目管理</td>
  174. <td>项目备案</td>
  175. <td>项</td>
  176. <td class="personInput">
  177. <span v-if="!isStaff">{{ tableForm.f0201 }}</span>
  178. <el-input v-if="isStaff" v-model="tableForm.f0201"></el-input>
  179. </td>
  180. <td rowspan="6">
  181. <el-radio-group v-model="tableForm.familiar02" :disabled="!isStaff">
  182. <div><el-radio :label="0">生疏</el-radio></div>
  183. <div><el-radio :label="2">熟练</el-radio></div>
  184. <div><el-radio :label="3">精通</el-radio></div>
  185. </el-radio-group>
  186. </td>
  187. <td rowspan="6">
  188. <div>{{ tableForm.remark02 }}</div>
  189. <el-input v-if="isStaff" v-model="tableForm.remark02" type="textarea" :rows="4"></el-input>
  190. </td>
  191. <td rowspan="6">
  192. <el-radio-group v-model="tableForm.workload02" :disabled="!isPiLeader">
  193. <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
  194. <el-radio :key="dict.value" :label="dict.value"
  195. @click.native.prevent="cancelSelect(dict.value, 'workload02', isStaff)">
  196. {{ dict.label }}
  197. </el-radio>
  198. </div>
  199. </el-radio-group>
  200. </td>
  201. <td rowspan="6">
  202. <el-radio-group v-model="tableForm.assessment02" :disabled="!isPiLeader">
  203. <div v-for="dict in dict.type.cmc_accessment" style="text-align:left">
  204. <el-radio :key="dict.value" :label="dict.value"
  205. @click.native.prevent="cancelSelect(dict.value, 'assessment02', isStaff)">
  206. {{ dict.label }}
  207. </el-radio>
  208. </div>
  209. </el-radio-group>
  210. </td>
  211. <td rowspan="6">
  212. <el-input type="textarea" :rows="4" v-model="tableForm.advice02" :disabled="!isPiLeader">
  213. </el-input>
  214. </td>
  215. </tr>
  216. <tr>
  217. <td>项目预算</td>
  218. <td>项</td>
  219. <td>
  220. <span v-if="!isStaff">{{ tableForm.f0202 }}</span>
  221. <el-input v-if="isStaff" v-model="tableForm.f0202"></el-input>
  222. </td>
  223. </tr>
  224. <tr>
  225. <td>任务分发</td>
  226. <td>项</td>
  227. <td>
  228. <span v-if="!isStaff">{{ tableForm.f0203 }}</span>
  229. <el-input v-if="isStaff" v-model="tableForm.f0203"></el-input>
  230. </td>
  231. </tr>
  232. <tr>
  233. <td>项目交底</td>
  234. <td>项</td>
  235. <td>
  236. <span v-if="!isStaff">{{ tableForm.f0204 }}</span>
  237. <el-input v-if="isStaff" v-model="tableForm.f0204"></el-input>
  238. </td>
  239. </tr>
  240. <tr>
  241. <td>项目内部结算</td>
  242. <td>项</td>
  243. <td>
  244. <span v-if="!isStaff">{{ tableForm.f0205 }}</span>
  245. <el-input v-if="isStaff" v-model="tableForm.f0205"></el-input>
  246. </td>
  247. </tr>
  248. <tr>
  249. <td>顾客回访</td>
  250. <td>项</td>
  251. <td>
  252. <span v-if="!isStaff">{{ tableForm.f0206 }}</span>
  253. <el-input v-if="isStaff" v-model="tableForm.f0206"></el-input>
  254. </td>
  255. </tr>
  256. <!-- -->
  257. <tr>
  258. <td rowspan="3">委外管理</td>
  259. <td>委外合同办理</td>
  260. <td>项</td>
  261. <td class="personInput">
  262. <span v-if="!isStaff">{{ tableForm.f0301 }}</span>
  263. <el-input v-if="isStaff" v-model="tableForm.f0301"></el-input>
  264. </td>
  265. <td rowspan="3">
  266. <el-radio-group v-model="tableForm.familiar03" :disabled="!isStaff">
  267. <div><el-radio :label="0">生疏</el-radio></div>
  268. <div><el-radio :label="2">熟练</el-radio></div>
  269. <div><el-radio :label="3">精通</el-radio></div>
  270. </el-radio-group>
  271. </td>
  272. <td rowspan="3">
  273. <div>{{ tableForm.remark03 }}</div>
  274. <el-input v-if="isStaff" v-model="tableForm.remark03" type="textarea" :rows="4"></el-input>
  275. </td>
  276. <td rowspan="3">
  277. <el-radio-group v-model="tableForm.workload03" :disabled="!isPiLeader">
  278. <div v-for="dict in dict.type.cmc_workload" style="text-align:left">
  279. <el-radio :key="dict.value" :label="dict.value"
  280. @click.native.prevent="cancelSelect(dict.value, 'workload03', isStaff)">
  281. {{ dict.label }}
  282. </el-radio>
  283. </div>
  284. </el-radio-group>
  285. </td>
  286. <td rowspan="3">
  287. <el-radio-group v-model="tableForm.assessment03" :disabled="!isPiLeader">
  288. <div v-for="dict in dict.type.cmc_accessment" style="text-align:left">
  289. <el-radio :key="dict.value" :label="dict.value"
  290. @click.native.prevent="cancelSelect(dict.value, 'assessment03', isStaff)">
  291. {{ dict.label }}
  292. </el-radio>
  293. </div>
  294. </el-radio-group>
  295. </td>
  296. <td rowspan="3">
  297. <el-input type="textarea" :rows="4" v-model="tableForm.advice03" :disabled="!isPiLeader">
  298. </el-input>
  299. </td>
  300. </tr>
  301. <tr>
  302. <td>委外支付办理</td>
  303. <td>项</td>
  304. <td>
  305. <span v-if="!isStaff">{{ tableForm.f0302 }}</span>
  306. <el-input v-if="isStaff" v-model="tableForm.f0302"></el-input>
  307. </td>
  308. </tr>
  309. <tr>
  310. <td>合格分包商管理</td>
  311. <td>项</td>
  312. <td>
  313. <span v-if="!isStaff">{{ tableForm.f0303 }}</span>
  314. <el-input v-if="isStaff" v-model="tableForm.f0303"></el-input>
  315. </td>
  316. </tr>
  317. <!-- -->
  318. <tr style="height:90px;">
  319. <td>其他工作</td>
  320. <td colspan="9">
  321. <span v-if="!isStaff">{{ tableForm.otherWork }}</span>
  322. <el-input v-if="isStaff" v-model="tableForm.otherWork" type="textarea" :rows="2"></el-input>
  323. </td>
  324. </tr>
  325. <tr style="height:90px;">
  326. <td>年度自述</td>
  327. <td colspan="9">
  328. <span v-if="!isStaff">{{ tableForm.selfAssess }}</span>
  329. <el-input v-if="isStaff" v-model="tableForm.selfAssess" type="textarea" :rows="2"></el-input>
  330. </td>
  331. </tr>
  332. </table>
  333. <el-row justify="center" type="flex" style="margin-top:20px;">
  334. <el-button type="primary" size="mini" @click="submit">{{ taskName == '员工填报' ? '提交' : '审核通过' }}</el-button>
  335. <el-button v-if="taskName == '员工填报'" type="warning" size="mini" @click="$emit('close')">取消</el-button>
  336. </el-row>
  337. </div>
  338. </template>
  339. <script>
  340. import { XMContent } from '@/assets/datas/XMContent'
  341. import { getDicts as getDicts } from '@/api/system/dict/data'
  342. import { complete, getNextFlowNode } from "@/api/flowable/todo";
  343. import { getAssess, modifyAssess, submitAssess, listAssess } from '@/api/oa/assess/assess';
  344. import { getUsersDeptLeader, getUsersManageLeader } from '@/api/system/post.js'
  345. export default {
  346. dicts: ['cmc_role', 'cmc_skill', 'cmc_accessment', 'cmc_workload'],
  347. props: {
  348. taskName: {
  349. type: String
  350. },
  351. taskForm: {
  352. type: Object
  353. }
  354. },
  355. watch: {
  356. tableForm: function (newval, oldval) {
  357. this.formatForm();
  358. }
  359. },
  360. data() {
  361. return {
  362. tableForm: {},
  363. form: {},
  364. radio1: "",
  365. radio2: "",
  366. textarea1: "",
  367. textarea2: "",
  368. isDeptLeader: false,
  369. isPiLeader: false,
  370. isManager: false,
  371. isStaff: false,
  372. }
  373. },
  374. created() {
  375. this.initForm();
  376. },
  377. mounted() {
  378. this.formatForm();
  379. },
  380. methods: {
  381. initForm() {
  382. getAssess(this.taskForm.formId).then(res => {
  383. let data = res.data;
  384. for (let d in data) {
  385. if (d.includes('role')) {
  386. if (data[d] != "" && data[d] != undefined && data[d] != null)
  387. data[d] = data[d].split(',')
  388. }
  389. if (d.includes('familiar')) {
  390. if (data[d] != "" && data[d] != undefined && data[d] != null)
  391. data[d] = parseInt(data[d])
  392. }
  393. }
  394. this.tableForm = data;
  395. })
  396. },
  397. formatForm() {
  398. if (this.taskName == '项目负责人审核') {
  399. this.isPiLeader = true;
  400. this.isDeptLeader = false;
  401. this.isManager = false;
  402. this.isStaff = false;
  403. } else if (this.taskName == '部门审核') {
  404. this.isPiLeader = false;
  405. this.isDeptLeader = true;
  406. this.isManager = false;
  407. this.isStaff = false;
  408. } else if (this.taskName == '分管审核') {
  409. this.isPiLeader = false;
  410. this.isDeptLeader = false;
  411. this.isManager = true;
  412. this.isStaff = false;
  413. } else if (this.taskName == '员工填报') {
  414. this.isPiLeader = false;
  415. this.isDeptLeader = false;
  416. this.isManager = false;
  417. this.isStaff = true;
  418. }
  419. },
  420. submit() {
  421. let flag = this.formValidate(this.tableForm)
  422. if (flag) {
  423. // this.$emit('submit', this.tableForm);
  424. let formData = new FormData();
  425. this.tableForm.formId = this.taskForm.formId;
  426. let form = JSON.stringify(this.tableForm);
  427. formData.append("form", form);
  428. listAssess({ assessId: this.tableForm.formId }).then(result => {
  429. let list = result;
  430. if (list.total != 0) {
  431. modifyAssess(formData);
  432. } else {
  433. submitAssess(formData);
  434. }
  435. })
  436. const params = { taskId: this.taskForm.taskId }
  437. getNextFlowNode(params).then(res => {
  438. if (this.taskName == '员工填报') {
  439. getUsersDeptLeader({ userId: this.$store.getters.userId }).then(res => {
  440. if (res.data)
  441. this.$set(this.taskForm.variables, "approval", res.data.userId);
  442. complete(this.taskForm).then(response => {
  443. this.$modal.msgSuccess(response.msg);
  444. this.$emit("goBack");
  445. });
  446. })
  447. } else if (this.taskName == '部门审核') {
  448. getUsersManageLeader({ userId: this.$store.getters.userId }).then(res => {
  449. let userId = res.data.userId;
  450. this.$set(this.taskForm.variables, "approval", userId);
  451. complete(this.taskForm).then(response => {
  452. this.$modal.msgSuccess(response.msg);
  453. this.$emit("goBack");
  454. });
  455. })
  456. } else if (this.taskName == '分管审核') {
  457. complete(this.taskForm).then(response => {
  458. this.$modal.msgSuccess(response.msg);
  459. this.$emit("goBack");
  460. });
  461. }
  462. })
  463. }
  464. },
  465. formValidate(form) {
  466. let flag = [];
  467. for (let f in form) {
  468. if (f.startsWith('familiar') && form[f] != null) {
  469. flag.push(f.slice(-2));
  470. } else if (f.length == 5 && f.startsWith('f')) {
  471. if (form[f] != "" && form[f] != undefined && form[f] != null)
  472. flag.push(f.substring(1, 3));
  473. }
  474. }
  475. let isF = false;
  476. if (flag.length == 0) {
  477. this.$modal.msgError("表格未填写,请填写表格");
  478. } else {
  479. isF = true
  480. }
  481. return isF
  482. },
  483. cancelSelect(value, name, disabled) {
  484. if (disabled) {
  485. return
  486. }
  487. if (this.isStaff) {
  488. if (this.tableForm[name] == value) {
  489. this.tableForm[name] = null
  490. } else {
  491. if (this.tableForm[name] !== undefined)
  492. this.tableForm[name] = value
  493. else {
  494. this.$set(this.tableForm, name, value)
  495. }
  496. }
  497. }
  498. if (this.isPiLeader) {
  499. if (this.tableForm[name] == value) {
  500. this.tableForm[name] = null
  501. } else {
  502. if (this.tableForm[name] !== undefined)
  503. this.tableForm[name] = value
  504. }
  505. }
  506. },
  507. },
  508. }
  509. </script>
  510. <style lang="scss" scoped>
  511. .table {
  512. border-collapse: collapse;
  513. width: 100%;
  514. }
  515. .table-title {
  516. background-color: #90d6f1;
  517. font-weight: bold;
  518. }
  519. .table-fillin {
  520. background-color: #bfee93;
  521. font-weight: bold;
  522. }
  523. .table-fzr {
  524. background-color: #eead93;
  525. font-weight: bold;
  526. }
  527. .table,
  528. th,
  529. td {
  530. border: 1px solid black;
  531. text-align: center;
  532. }
  533. td {
  534. height: 50px;
  535. // width: 100px;
  536. }
  537. .head {
  538. background-color: #ccc;
  539. }
  540. ::v-deep .el-checkbox__input.is-disabled.is-checked .el-checkbox__inner::after {
  541. border-color: #fff;
  542. }
  543. ::v-deep .el-checkbox__input.is-disabled.is-checked .el-checkbox__inner {
  544. background-color: #409eff;
  545. border-color: #409eff;
  546. }
  547. ::v-deep .el-checkbox__input.is-disabled+span.el-checkbox__label {
  548. color: #000;
  549. }
  550. ::v-deep .el-checkbox__label {
  551. font-size: 12px;
  552. }
  553. ::v-deep .el-radio__input.is-disabled .el-radio__inner,
  554. .el-radio__input.is-disabled.is-checked .el-radio__inner {
  555. background-color: #f1f1f1;
  556. border-color: #f1f1f1;
  557. }
  558. ::v-deep .el-radio__input.is-disabled+span.el-radio__label {
  559. color: #000;
  560. }
  561. ::v-deep .el-radio__input.is-checked .el-radio__inner::after {
  562. content: "";
  563. width: 10px;
  564. height: 5px;
  565. border: 2px solid #409eff;
  566. border-top: transparent;
  567. border-right: transparent;
  568. text-align: center;
  569. display: block;
  570. position: absolute;
  571. top: 2px;
  572. left: 2px;
  573. vertical-align: middle;
  574. transform: rotate(-45deg);
  575. border-radius: 0px;
  576. background: none;
  577. }
  578. </style>