performanceList.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <template>
  2. <div class="app-container">
  3. <div class="title-container">
  4. <breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
  5. </div>
  6. <y-page-list-layout :page-list="pageData" :page-para="listQuery" :get-page-list="getList">
  7. <template slot="left">
  8. <el-input v-model="listQuery.keyword" placeholder="关键字搜索..." clearable
  9. style="margin-left: 20px;width: 500px;float: left;">
  10. </el-input>
  11. <el-select style="margin-left: 20px;width: 170px;float: left;" v-model="listQuery.production" clearable placeholder="产品类型">
  12. <el-option value="STATEMENT" label="价值意见书">价值意见书</el-option>
  13. <el-option value="REPORT" label="报告">报告</el-option>
  14. <el-option value="LETTER" label="复评函">复评函</el-option>
  15. </el-select>
  16. <el-button class="filter-item" style="margin-left: 10px;float: left;" type="primary" @click="searchList" round>搜索
  17. </el-button>
  18. <el-button class="filter-item" style="float: left;" round type="success" @click="resetSearch()">重置
  19. </el-button>
  20. </template>
  21. <parentTable :data="pageData.records" slot="table" style="width: 100%;">
  22. <el-table-column label="订单编号" align="center" >
  23. <template slot-scope="{row}">
  24. <span>{{ row.orderId }}</span>
  25. </template>
  26. </el-table-column>
  27. <el-table-column label="项目名称" align="center" show-overflow-tooltip>
  28. <template slot-scope="{row}">
  29. <span>{{ row.name }}</span>
  30. </template>
  31. </el-table-column>
  32. <el-table-column label="产品编号" align="center" width='300' >
  33. <template slot-scope="{row}">
  34. <span>{{ row.reportNo }}</span>
  35. </template>
  36. </el-table-column>
  37. <el-table-column label="产品类型" align="center" >
  38. <template slot-scope="{row}">
  39. <span>{{ row.production }}</span>
  40. </template>
  41. </el-table-column>
  42. <el-table-column label="实收款" align="center" >
  43. <template slot-scope="{row}">
  44. <span>{{ row.claimTimes>0?'已认领':'未认领' }}</span>
  45. </template>
  46. </el-table-column>
  47. <el-table-column label="绩效分配" align="center" >
  48. <template slot-scope="{row}">
  49. <span>{{ row.isAllot?'已分配':'未分配' }}</span>
  50. </template>
  51. </el-table-column>
  52. <el-table-column label="操作" align="center" width='120' >
  53. <template slot-scope="{row}">
  54. <el-button type="text" size="small" @click="doPerformanceAllot(row)">{{!row.isAllot?'分配':'查看'}}</el-button>
  55. </template>
  56. </el-table-column>
  57. </parentTable>
  58. </y-page-list-layout>
  59. <el-dialog :visible.sync="allotDialog" width="75%" center custom-class="doWarehouseClass">
  60. <el-form ref="performanceForm" :model="performance" class="form-container">
  61. <div class="createMajor-main-container">
  62. <div class="postInfo-container">
  63. <el-row>
  64. <el-col :xs="24" :sm="12" :lg="24" :span="6">
  65. <el-button style="float:right" type="success" @click="saveAllot()">确认分配</el-button>
  66. </el-col>
  67. </el-row>
  68. <div>
  69. <el-divider content-position="left">
  70. <h3 class="title">{{reportNo}} 绩效分配</h3>
  71. </el-divider>
  72. </div>
  73. <el-row class="row-style" v-if="performance.performanceList.length>0">
  74. <el-col :xs="24" :sm="12" :lg="6" :span="6" v-for="(a,index) in performance.performanceList">
  75. <el-card shadow="always" style="margin-top:30px;margin-right:15px;margin-bottom:30px;">
  76. <span v-if="a.isPrincipal" style="position:absolute; top:35px;left :87px"><el-tag type="danger">项目负责人</el-tag></span>
  77. <div class="performance-avatar-wrapper perfomance-icon-title">{{a.userName.slice(-2)}}</div>
  78. <el-input v-model.number="a.ratio" type="number" style="width:80%;margin-left:5px">
  79. <template slot="append">%</template>
  80. </el-input>
  81. </el-card>
  82. </el-col>
  83. </el-row>
  84. </div>
  85. </div>
  86. </el-form>
  87. </el-dialog>
  88. </div>
  89. </template>
  90. <script>
  91. import YPageListLayout from '@/components/YPageListLayout'
  92. import Breadcrumb from '@/components/Breadcrumb'
  93. export default {
  94. name: 'performanceList',
  95. components: {
  96. Breadcrumb,
  97. YPageListLayout
  98. },
  99. data() {
  100. return {
  101. pageData: { records: [] },
  102. listQuery: {
  103. page: 1,
  104. size: 10,
  105. descs: 'id',
  106. },
  107. allotDialog:false,
  108. performance:{
  109. performanceList:[],
  110. majorProductionId:null
  111. },
  112. reportNo:null,
  113. majorId:null
  114. }
  115. },
  116. created() {
  117. this.getList();
  118. },
  119. methods: {
  120. resetSearch() {
  121. this.$router.push({ query: {} });
  122. this.listQuery = {
  123. current: 1,
  124. size: 10,
  125. descs: 'id',
  126. }
  127. this.getList()
  128. },
  129. searchList() {
  130. // 重置分页
  131. this.listQuery.page = 1
  132. this.listQuery.size = 10
  133. this.getList()
  134. },
  135. getList() {
  136. this.$api.majorProduction.performanceList(Object.assign({}, this.listQuery)).then(res=>{
  137. if (res.code ===200){
  138. this.pageData = res.data;
  139. }
  140. })
  141. },
  142. doPerformanceAllot(row){
  143. this.allotDialog = true;
  144. this.reportNo = row.reportNo;
  145. this.performance.majorProductionId = row.id;
  146. this.majorId= row.majorId;
  147. this.$api.majorPerformanceAllot.list(row.id).then(res=>{
  148. if (res.code ===200 ){
  149. const list = res.data;
  150. for (let i in list){
  151. if (list[i].ratio==null){
  152. list[i].ratio = 0;
  153. }else {
  154. list[i].ratio = (list[i].ratio)*100;
  155. }
  156. }
  157. this.performance.performanceList = list;
  158. }
  159. })
  160. },
  161. saveAllot(){
  162. const id = this.performance.majorProductionId;
  163. const list = this.performance.performanceList;
  164. let total = 0;
  165. list.map(function(item){
  166. total += item.ratio;
  167. })
  168. if (total!=100){
  169. this.$notify({
  170. title: '提示',
  171. message: '绩效分配之和需等于100,请检查。',
  172. type: 'warning',
  173. duration: 2000
  174. });
  175. return;
  176. }
  177. for(let i in list){
  178. list[i].majorProductionId = id;
  179. list[i].ratio = (list[i].ratio)/100;
  180. list[i].userType = 'EVALUATE';
  181. list[i].majorId = this.majorId;
  182. }
  183. this.$api.majorPerformanceAllot.allot(list).then(res=>{
  184. if (res.code ===200 && res.data){
  185. this.$notify({
  186. title: '成功',
  187. message: '保存成功',
  188. type: 'success',
  189. duration: 2000
  190. });
  191. this.allotDialog = false;
  192. this.getList();
  193. }else {
  194. this.$notify({
  195. title: '失败',
  196. message: '保存失败',
  197. type: 'error',
  198. duration: 2000
  199. });
  200. }
  201. })
  202. }
  203. },
  204. }
  205. </script>
  206. <style lang="scss" scoped>
  207. /deep/.doWarehouseClass {
  208. border-radius: 10px;
  209. }
  210. .performance-avatar-wrapper{
  211. width: 50px;
  212. height: 50px;
  213. position: relative;
  214. border-radius: 50%;
  215. background-color: rgba(129,216,207,1);
  216. text-align: center;
  217. line-height: 50px;
  218. }
  219. .perfomance-icon-title{
  220. font-size: 20px;
  221. color: rgba(255, 255, 255, 1);
  222. display: inline-block;
  223. position: relative;
  224. top: -2px;
  225. }
  226. </style>