CostCompletionList.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. <template>
  2. <div>
  3. <el-form :inline="true" v-show="isSearchCollapse" class="query-form" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
  4. <!-- 搜索框-->
  5. <el-col :span="8">
  6. <el-form-item label="评价年份" prop="yearOfEvaluation">
  7. <el-date-picker
  8. v-model="searchForm.yearOfEvaluation"
  9. type="year"
  10. size="small"
  11. value-format="yyyy"
  12. placeholder="选择年份">
  13. </el-date-picker>
  14. </el-form-item>
  15. </el-col>
  16. <el-col :span="8">
  17. <el-form-item label="单位名称" prop="unitName">
  18. <el-input size="small" v-model="searchForm.unitName" placeholder="单位名称" clearable></el-input>
  19. </el-form-item>
  20. </el-col>
  21. <el-form-item>
  22. <el-button type="primary" @click="refreshList()" size="small">查询</el-button>
  23. <el-button @click="resetSearch()" size="small">重置</el-button>
  24. </el-form-item>
  25. </el-form>
  26. <el-row>
  27. <!-- <el-button v-if="hasPermission('deductiondetails:deductionDetails:add')" type="primary" size="small" icon="el-icon-plus" @click="add()">扣分</el-button>-->
  28. <el-button v-if="hasPermission('deductiondetails:deductionDetails:edit')" type="warning" size="small" icon="el-icon-edit-outline" @click="sub()"
  29. :disabled="dataListSelections.length != 1" plain>扣分</el-button>
  30. <el-button-group class="pull-right">
  31. <el-button
  32. type="default"
  33. size="small"
  34. icon="el-icon-search"
  35. @click="isSearchCollapse = !isSearchCollapse, isImportCollapse=false">
  36. </el-button>
  37. <el-button
  38. type="default"
  39. size="small"
  40. icon="el-icon-refresh"
  41. @click="refreshList">
  42. </el-button>
  43. </el-button-group>
  44. </el-row>
  45. <el-table
  46. :data="dataList"
  47. border
  48. size="medium"
  49. @selection-change="selectionChangeHandle"
  50. @sort-change="sortChangeHandle"
  51. v-loading="loading"
  52. class="table">
  53. <el-table-column
  54. type="selection"
  55. header-align="center"
  56. align="center"
  57. width="50">
  58. </el-table-column>
  59. <el-table-column
  60. prop="yearOfEvaluation"
  61. show-overflow-tooltip
  62. sortable="custom"
  63. label="施工单位年份">
  64. </el-table-column>
  65. <el-table-column
  66. prop="unitName"
  67. show-overflow-tooltip
  68. sortable="custom"
  69. label="施工单位名称">
  70. </el-table-column>
  71. <el-table-column
  72. prop="basicScore"
  73. show-overflow-tooltip
  74. sortable="custom"
  75. label="基础分数">
  76. </el-table-column>
  77. <el-table-column
  78. prop="reasonOne"
  79. show-overflow-tooltip
  80. sortable="custom"
  81. label="工程竣工结束30天内,未按要求上报竣工资料至结算中心,每发生一起,扣5分。">
  82. <template slot-scope="scope">
  83. <el-link type="primary" :underline="false" @click="edit(scope.row.id,'1')">{{scope.row.reasonOne}}</el-link>
  84. </template>
  85. </el-table-column>
  86. <el-table-column
  87. prop="reasonTwo"
  88. show-overflow-tooltip
  89. sortable="custom"
  90. label="现场签证存在漏签、多签、错签、代签的,每发生一起,扣2-10分。">
  91. <template slot-scope="scope">
  92. <el-link type="primary" :underline="false" @click="edit(scope.row.id,'2')">{{scope.row.reasonTwo}}</el-link>
  93. </template>
  94. </el-table-column>
  95. <el-table-column
  96. prop="reasonThree"
  97. show-overflow-tooltip
  98. sortable="custom"
  99. label="工作量弄虚作假,上报工作量与实际存在10%以上的偏差,每发生一起,扣5分。★">
  100. <template slot-scope="scope">
  101. <el-link type="primary" :underline="false" @click="edit(scope.row.id,'3')">{{scope.row.reasonThree}}</el-link>
  102. </template>
  103. </el-table-column>
  104. <el-table-column
  105. prop="reasonFour"
  106. show-overflow-tooltip
  107. sortable="custom"
  108. label="接到分包中标通知书后,15天内未至安能杰签订分包合同,每发生一起,扣3分。经催办后7天内仍未至安能杰签订合同,追加扣分5分。">
  109. <template slot-scope="scope">
  110. <el-link type="primary" :underline="false" @click="edit(scope.row.id,'4')">{{scope.row.reasonFour}}</el-link>
  111. </template>
  112. </el-table-column>
  113. <el-table-column
  114. prop="reasonFive"
  115. show-overflow-tooltip
  116. sortable="custom"
  117. label="接到安能杰公司开票通知后,7天内未将发票送至安能杰公司,扣1-10分。">
  118. <template slot-scope="scope">
  119. <el-link type="primary" :underline="false" @click="edit(scope.row.id,'5')">{{scope.row.reasonFive}}</el-link>
  120. </template>
  121. </el-table-column>
  122. <el-table-column
  123. prop="sumScore"
  124. show-overflow-tooltip
  125. sortable="custom"
  126. label="汇总评分">
  127. </el-table-column>
  128. </el-table>
  129. <el-pagination
  130. @size-change="sizeChangeHandle"
  131. @current-change="currentChangeHandle"
  132. :current-page="pageNo"
  133. :page-sizes="[10, 20, 50, 100]"
  134. :page-size="pageSize"
  135. :total="total"
  136. background
  137. layout="total, sizes, prev, pager, next, jumper">
  138. </el-pagination>
  139. <!-- 弹窗, 新增 / 修改 -->
  140. <DeductionShowDetailsForm ref="deductionShowDetailsForm" @refreshDataList="refreshList"></DeductionShowDetailsForm>
  141. <DeductionDetailsForm ref="deductionDetailsForm" @refreshDataList="refreshList"></DeductionDetailsForm>
  142. </div>
  143. </template>
  144. <script>
  145. import DeductionShowDetailsForm from './DeductionShowDetailsForm'
  146. import DeductionDetailsForm from '../deductiondetails/DeductionDetailsForm'
  147. export default {
  148. data () {
  149. return {
  150. searchForm: {
  151. yearOfEvaluation: new Date().getFullYear().toString(),
  152. id: '',
  153. unitId: '',
  154. classId: ''
  155. },
  156. columns: [],
  157. dataList: [],
  158. pageNo: 1,
  159. pageSize: 10,
  160. total: 0,
  161. orderBy: '',
  162. subClass: '',
  163. dataListSelections: [],
  164. isSearchCollapse: false,
  165. isImportCollapse: false,
  166. loading: false
  167. }
  168. },
  169. components: {
  170. DeductionShowDetailsForm,
  171. DeductionDetailsForm
  172. },
  173. activated () {
  174. this.refreshList()
  175. },
  176. methods: {
  177. // 获取数据列表
  178. refreshList () {
  179. this.loading = true
  180. this.$http({
  181. url: '/deductionShowDetails/deductionShowDetails/costCompletionList',
  182. method: 'get',
  183. params: {
  184. 'pageNo': this.pageNo,
  185. 'pageSize': this.pageSize,
  186. 'orderBy': this.orderBy,
  187. ...this.searchForm
  188. }
  189. }).then(({data}) => {
  190. if (data && data.success) {
  191. console.log(data)
  192. this.dataList = data.page.list
  193. this.total = data.page.count
  194. this.loading = false
  195. }
  196. })
  197. },
  198. // 每页数
  199. sizeChangeHandle (val) {
  200. this.pageSize = val
  201. this.pageNo = 1
  202. this.refreshList()
  203. },
  204. // 当前页
  205. currentChangeHandle (val) {
  206. this.pageNo = val
  207. this.refreshList()
  208. },
  209. // 多选
  210. selectionChangeHandle (val) {
  211. this.dataListSelections = val
  212. },
  213. // 排序
  214. sortChangeHandle (obj) {
  215. if (obj.order === 'ascending') {
  216. this.orderBy = obj.prop + ' asc'
  217. } else if (obj.order === 'descending') {
  218. this.orderBy = obj.prop + ' desc'
  219. } else {
  220. this.orderBy = ''
  221. }
  222. this.refreshList()
  223. },
  224. // 新增
  225. add () {
  226. this.$refs.deductionShowDetailsForm.init('add', '')
  227. },
  228. edit (id, type) {
  229. id = id || this.dataListSelections.map(item => {
  230. return item.id
  231. })[0]
  232. console.log(id)
  233. switch (type) {
  234. case '1':
  235. this.subClass = 'f3cfc08e5ea24d3780bfe89c0d6c8c80'
  236. break
  237. case '2':
  238. this.subClass = '92c068926a8041369b73708c7ff1eda8'
  239. break
  240. case '3':
  241. this.subClass = 'b5010972a5a44e9a8a8e1e04f5361808'
  242. break
  243. case '4':
  244. this.subClass = 'e30f4db933ef477ca66415d0bb426dac'
  245. break
  246. case '5':
  247. this.subClass = '5aabe8b2882c4de396626e7de6a712f7'
  248. break
  249. }
  250. this.$router.push({path: './DeductionShowDetailsList', query: {unitId: id, subClass: this.subClass}})
  251. },
  252. sub (id) {
  253. id = id || this.dataListSelections.map(item => {
  254. return item.id
  255. })[0]
  256. this.$refs.deductionDetailsForm.init('edit', id)
  257. },
  258. // 查看
  259. view (id) {
  260. this.$refs.deductionShowDetailsForm.init('view', id)
  261. },
  262. // 删除
  263. del (id) {
  264. let ids = id || this.dataListSelections.map(item => {
  265. return item.id
  266. }).join(',')
  267. this.$confirm(`确定删除所选项吗?`, '提示', {
  268. confirmButtonText: '确定',
  269. cancelButtonText: '取消',
  270. type: 'warning'
  271. }).then(() => {
  272. this.loading = true
  273. this.$http({
  274. url: '/deductionshowdetails/deductionShowDetails/delete',
  275. method: 'delete',
  276. params: {'ids': ids}
  277. }).then(({data}) => {
  278. if (data && data.success) {
  279. this.$message.success(data.msg)
  280. this.refreshList()
  281. }
  282. this.loading = false
  283. })
  284. })
  285. },
  286. // 导入成功
  287. uploadSuccess (res, file) {
  288. if (res.success) {
  289. this.$message.success({dangerouslyUseHTMLString: true,
  290. message: res.msg})
  291. } else {
  292. this.$message.error(res.msg)
  293. }
  294. },
  295. // 下载模板
  296. downloadTpl () {
  297. this.$utils.download('/deductionshowdetails/deductionShowDetails/import/template')
  298. },
  299. exportExcel () {
  300. this.$utils.download('/deductionshowdetails/deductionShowDetails/export')
  301. },
  302. resetSearch () {
  303. this.$refs.searchForm.resetFields()
  304. this.refreshList()
  305. }
  306. }
  307. }
  308. </script>