planList.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <template>
  2. <div class="app-container">
  3. <div class="title-container">
  4. <breadcrumb id="breadcrumb-container" class="breadcrumb-container"/>
  5. </div>
  6. <div style="padding-top: 30px;">
  7. <el-tabs v-model="activeName">
  8. <el-tab-pane :label="itemName +'【项目阶段确认和评价】' " name="first" class="pane">
  9. <div class="form-container" >
  10. <div style="height: 300px;">
  11. <el-timeline v-if="stageFlow.length>0">
  12. <el-timeline-item v-for="(s,index) in stageFlow" :key="index" :timestamp="s.name" placement="top" color="green">
  13. <el-card class="card">
  14. <div class="it">
  15. <span class="el-icon-s-flag">目标:</span> <el-tag type="success">{{s.target}}</el-tag>
  16. </div>
  17. <div class="it">
  18. <span class="el-icon-time">时间段:</span> <el-tag>{{s.startDate}}</el-tag> 至 <el-tag>{{s.endDate}}</el-tag>
  19. </div>
  20. <div v-if="s.weight" class="it">
  21. <span class="el-icon-coin">提成比重:</span> <el-tag type="danger">{{s.weight}}%</el-tag>
  22. </div>
  23. <div v-if="s.dutyer" class="it">
  24. <span class="el-icon-user-solid">负责人:</span> <el-tag>{{s.dutyer}}</el-tag>
  25. </div>
  26. <div v-if="s.coefficient" class="it">
  27. <span class="el-icon-coin">逾期提成系数:</span> <el-tag type="danger">{{s.coefficient}}%</el-tag>
  28. </div>
  29. <div v-if="s.participated" class="it" >
  30. <icon class="el-icon-user"/> 参与人提成系数:
  31. <span v-for="(p,index) in s.participated" :key="index"><el-tag>{{p.userName}} : {{p.weight}}%</el-tag>
  32. </span>
  33. </div>
  34. <el-switch
  35. class="del"
  36. style="display: block"
  37. v-model= s.overdue
  38. active-color="#ff4949"
  39. inactive-color="#13ce66"
  40. active-text="逾期"
  41. inactive-text="未逾期"
  42. @change="updateOverdue(s)">
  43. </el-switch>
  44. </el-card>
  45. </el-timeline-item>
  46. </el-timeline>
  47. <el-alert v-else
  48. title="此项目还未排期"
  49. type="error"
  50. :closable="false"
  51. show-icon>
  52. </el-alert>
  53. </div>
  54. </div>
  55. <div class="form-container" style="margin-left: 50px; margin-right:100px;">
  56. <el-form ref="postForm" :model="postForm" >
  57. <el-row>
  58. <el-col>
  59. <el-form-item
  60. label="项目评语:"
  61. prop="remark"
  62. label-width="180px"
  63. class="postInfo-container-item"
  64. >
  65. <el-input type="textarea" :autosize="{ minRows: 8, maxRows: 8}" v-model="postForm.comments" class="filter-item" placeholder="200字符"/>
  66. </el-form-item>
  67. </el-col>
  68. </el-row>
  69. <el-row>
  70. <el-col>
  71. <el-form-item
  72. label="评价权重:"
  73. label-width="180px"
  74. class="postInfo-container-item"
  75. >
  76. <div class="block" style="height: 250px">
  77. <el-rate v-model="postForm.weight" :max="maxScore" score-template="{value}%" show-score allow-half class="filter-item"></el-rate>
  78. </div>
  79. </el-form-item>
  80. </el-col>
  81. </el-row>
  82. <el-row>
  83. <el-col>
  84. <el-form-item
  85. label-width="180px"
  86. class="postInfo-container-item"
  87. >
  88. <el-button type="success" @click="commit" class="filter-item">提 交</el-button>
  89. </el-form-item>
  90. </el-col>
  91. </el-row>
  92. </el-form>
  93. </div>
  94. </el-tab-pane>
  95. </el-tabs>
  96. </div>
  97. </div>
  98. </template>
  99. <script>
  100. import Breadcrumb from '@/components/Breadcrumb'
  101. export default {
  102. name: 'planList',
  103. components: {
  104. Breadcrumb,
  105. },
  106. data() {
  107. return {
  108. type: 'detail',
  109. itemId: this.$route.query.id,
  110. itemName: this.$route.query.itemName,
  111. id:null,
  112. activeName: 'first',
  113. vLoading: false,
  114. listQuery:{},
  115. filterMethod(query, item) {
  116. return item.label.indexOf(query) > -1;
  117. },
  118. stageFlow:[],
  119. stages:[],
  120. value1: null,
  121. colors: ['#99A9BF', '#F7BA2A', '#FF9900'], // 等同于 { 2: '#99A9BF', 4: { value: '#F7BA2A', excluded: true }, 5: '#FF9900' }
  122. maxScore:100,
  123. postForm:{
  124. id:null,
  125. itemId:null,
  126. weight:null,
  127. comments:null
  128. }
  129. }
  130. },
  131. created() {
  132. this.getFlow();
  133. this.getEvaluate();
  134. },
  135. methods: {
  136. commit(){
  137. if (!this.itemId){
  138. this.$notify({
  139. title: '错误',
  140. message: '提交失败',
  141. type: 'error',
  142. duration: 1000
  143. });
  144. return;
  145. }
  146. this.postForm.itemId = this.itemId;
  147. if (this.postForm.id){
  148. this.$api.itemEvaluate.edit(Object.assign({}, this.postForm, {
  149. })).then(res=>{
  150. if (res.code ===200){
  151. this.$notify({
  152. title: '成功',
  153. message: '修改成功',
  154. type: 'success',
  155. duration: 1000
  156. });
  157. this.getEvaluate();
  158. }
  159. });
  160. }else {
  161. this.$api.itemEvaluate.add(Object.assign({}, this.postForm, {
  162. })).then(res=>{
  163. if (res.code ===200){
  164. this.$notify({
  165. title: '成功',
  166. message: '评价成功',
  167. type: 'success',
  168. duration: 1000
  169. });
  170. this.getEvaluate();
  171. }
  172. })
  173. }
  174. },
  175. getEvaluate(){
  176. this.$api.itemEvaluate.detailByItemId(this.itemId).then(res => {
  177. this.postForm = res.data === null ? [] : res.data;
  178. });
  179. },
  180. updateOverdue(stage){
  181. this.$api.itemStage.confirm({stageId:stage.id ,overdue:stage.overdue}).then(res=>{
  182. if (res.code === 200){
  183. this.$notify({
  184. title: '成功',
  185. message: '修改成功',
  186. type: 'success',
  187. duration: 2000
  188. });
  189. }
  190. })
  191. },
  192. getSimpleAll() {
  193. this.$api.itemStage.simpleAll(this.itemId).then(res => {
  194. this.stages = res.data;
  195. });
  196. },
  197. getFlow() {
  198. this.$api.itemStage.flow(this.itemId).then(res => {
  199. this.stageFlow = res.data === null ? [] : res.data;
  200. });
  201. }
  202. }
  203. }
  204. </script>
  205. <style lang="css" scoped>
  206. .pane{
  207. display: flex;
  208. }
  209. .pane>div{
  210. flex: 1;
  211. }
  212. .form-container{
  213. padding-top: 30px;
  214. width: 500px;
  215. height: 800px;
  216. border: 1px solid darkgray;
  217. box-shadow: 10px 10px 5px #888888;;
  218. border-radius: 10px;
  219. overflow: auto;
  220. }
  221. .form-container:hover{
  222. }
  223. .evaluate{
  224. width: 300px;
  225. /*height: 800px;*/
  226. margin-left: 100px;
  227. overflow: auto;
  228. }
  229. div.it{
  230. margin-top: 10px;
  231. }
  232. .card{
  233. display: flex;
  234. width: 600px;
  235. }
  236. .del{
  237. position: absolute;
  238. top:60px;
  239. left: 480px;
  240. }
  241. .filter-item{
  242. width: 80%;
  243. }
  244. /deep/ .el-rate__icon{
  245. font-size: 30px;
  246. }
  247. </style>