祥兆质量前端
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.

609 lines
44 KiB

  1. <template>
  2. <div class="mod-config">
  3. <!-- 收藏 -->
  4. <div>
  5. <span @click="favoriteFunction()">
  6. <icon-svg :name="favorite?'xiangqufill':'xiangqu'" class="sl-svg"></icon-svg>
  7. </span>
  8. </div>
  9. <!-- 条件查询 -->
  10. <el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
  11. <el-form-item :label="'工厂'">
  12. <el-select v-model="searchData.site" placeholder="请选择" style="width: 120px">
  13. <el-option
  14. v-for = "i in userBuList"
  15. :key = "i.site"
  16. :label = "i.site"
  17. :value = "i.site">
  18. <span style="float: left;width: 120px">{{ i.sitename }}</span>
  19. </el-option>
  20. </el-select>
  21. </el-form-item>
  22. <el-form-item label="年份">
  23. <el-input v-model="searchData.statisticMonth" placeholder="格式:YYYY"></el-input>
  24. </el-form-item>
  25. <el-form-item>
  26. <span slot="label" style="" @click="getBaseList(501)"><a herf="#">供应商编码</a></span>
  27. <el-input v-model="searchData.supplierId" filterable placeholder="请选择或输入供应商编码"></el-input>
  28. </el-form-item>
  29. <el-form-item label="供应商名称">
  30. <el-input v-model="searchData.supplierName" placeholder="请输入供应商名称"></el-input>
  31. </el-form-item>
  32. <el-form-item :label="' '">
  33. <el-button v-if="!authSearch" type="primary" @click="getDataList()">查询</el-button>
  34. <download-excel
  35. :fields="fields()"
  36. :data="exportData"
  37. type="xls"
  38. :name="exportName"
  39. :header="exportHeader"
  40. :footer="exportFooter"
  41. :fetch="createExportData"
  42. :before-generate="startDownload"
  43. :before-finish="finishDownload"
  44. worksheet="导出信息"
  45. class="el-button el-button--primary el-button--medium">
  46. {{ "导出" }}
  47. </download-excel>
  48. <el-button type="primary" @click="computeFlag = true">供应商绩效统计计算</el-button>
  49. </el-form-item>
  50. </el-form>
  51. <!-- 展示列表 -->
  52. <el-table
  53. :height="height"
  54. :data="dataList"
  55. border
  56. style="width: 100%;">
  57. <el-table-column
  58. v-for="(item,index) in columnList" :key="index"
  59. :sortable="item.columnSortable"
  60. :prop="item.columnProp"
  61. :header-align="item.headerAlign"
  62. :show-overflow-tooltip="item.showOverflowTooltip"
  63. :align="item.align"
  64. :fixed="item.fixed==''?false:item.fixed"
  65. :width="item.columnWidth"
  66. :label="item.columnLabel">
  67. <template slot-scope="scope">
  68. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  69. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  70. </template>
  71. </el-table-column>
  72. <el-table-column
  73. fixed="right"
  74. header-align="center"
  75. align="center"
  76. width="80"
  77. label="操作">
  78. <template slot-scope="scope">
  79. <a type="text" size="small" class="highlight" @click="totalPoints(scope.row)">详情</a>
  80. </template>
  81. </el-table-column>
  82. </el-table>
  83. <el-pagination
  84. @size-change="sizeChangeHandle"
  85. @current-change="currentChangeHandle"
  86. :current-page="pageIndex"
  87. :page-sizes="[20, 50, 100, 200, 500]"
  88. :page-size="pageSize"
  89. :total="totalPage"
  90. layout="total, sizes, prev, pager, next, jumper">
  91. </el-pagination>
  92. <el-dialog title="详情" :close-on-click-modal="false" v-drag :visible.sync="suppPerTheMonthTotalPointsFlag" width="951px" style="margin-top: -5vh">
  93. <el-table
  94. :data="suppPerThisMonthDetailsList"
  95. :height="height - 27"
  96. border
  97. style="width: 100%;">
  98. <el-table-column
  99. v-for="(item,index) in columnSuppPerTheMonthTotalPointsList" :key="index"
  100. :sortable="item.columnSortable"
  101. :prop="item.columnProp"
  102. :header-align="item.headerAlign"
  103. :show-overflow-tooltip="item.showOverflowTooltip"
  104. :align="item.align"
  105. :fixed="item.fixed==''?false:item.fixed"
  106. :width="item.columnWidth"
  107. :label="item.columnLabel">
  108. <template slot-scope="scope">
  109. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  110. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  111. </template>
  112. </el-table-column>
  113. </el-table>
  114. <span slot="footer" class="dialog-footer">
  115. <el-button @click="suppPerTheMonthTotalPointsFlag = false">关闭</el-button>
  116. </span>
  117. </el-dialog>
  118. <el-dialog title="供应商绩效统计计算" :close-on-click-modal="false" v-drag :visible.sync="computeFlag" width="500px">
  119. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  120. <el-form-item label="工厂">
  121. <el-input v-model="this.$store.state.user.site" style="width: 221px" disabled></el-input>
  122. </el-form-item>
  123. <el-form-item label="月份" prop="statisticMonth" :rules="rules.statisticMonth">
  124. <el-date-picker
  125. v-model="modalData.statisticMonth"
  126. type="month"
  127. value-format="yyyy-MM"
  128. placeholder="选择月"
  129. style="width: 221px">
  130. </el-date-picker>
  131. </el-form-item>
  132. </el-form>
  133. <span slot="footer" class="dialog-footer">
  134. <el-button type="primary" @click="supplierPerformanceCalculation()">计算</el-button>
  135. <el-button @click="computeFlag = false">关闭</el-button>
  136. </span>
  137. </el-dialog>
  138. <!--列表的组件-->
  139. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  140. </div>
  141. </template>
  142. <script>
  143. import {
  144. supplierPerformanceQuerySummarySearch,
  145. supplierPerformanceTheMonthTotalPoints
  146. } from "@/api/performance/performance.js"
  147. import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
  148. import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
  149. import {getSiteAndBuByUserName} from "../../../api/qc/qc";
  150. import Chooselist from '@/views/modules/common/Chooselist';
  151. import {performanceIndicatorDefinitionCalculation, verifyData} from "../../../api/performance/performance";
  152. /* 列表组件 */
  153. export default {
  154. components: {
  155. Chooselist, /* 选择的组件 */
  156. },
  157. data () {
  158. return {
  159. // 是否收藏
  160. favorite: false,
  161. // 导出 start
  162. exportData: [],
  163. exportName: "供应商年度绩效信息" + this.dayjs().format('YYYYMMDDHHmmss'),
  164. exportHeader: ["供应商年度绩效信息"],
  165. exportFooter: [],
  166. exportList: [],
  167. // 导出 end
  168. searchData: {
  169. site: this.$store.state.user.site,
  170. userName: this.$store.state.user.name,
  171. statisticMonth: new Date().getFullYear(),
  172. supplierId: '',
  173. supplierName: '',
  174. page: 1,
  175. limit: 10,
  176. },
  177. modalData: {
  178. site: '',
  179. bu: '',
  180. flag: '',
  181. createBy: this.$store.state.user.name,
  182. updateBy: this.$store.state.user.name,
  183. itemNo: '',
  184. indicatorDesc: '',
  185. indicatorGroup: '',
  186. active: 'Y',
  187. createDate: '',
  188. statisticMonth: '',
  189. },
  190. pageIndex: 1,
  191. pageSize: 20,
  192. totalPage: 0,
  193. height: 200,
  194. dataList: [],
  195. modalFlag: false,
  196. modalDisableFlag: false,
  197. computeFlag: false,
  198. suppPerTheMonthTotalPointsFlag: false,
  199. // 标头展示
  200. columnList: [
  201. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableSite', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 50, columnProp: 'site', headerAlign: 'center', align: "center", columnLabel: '工厂', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  202. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableSupplierId', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 80, columnProp: 'supplierId', headerAlign: 'center', align: "center", columnLabel: '供应商编码', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  203. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableSupplierName', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 200, columnProp: 'supplierName', headerAlign: 'center', align: "center", columnLabel: '供应商名称', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  204. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalService01', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalService01', headerAlign: 'center', align: "center", columnLabel: '01-服务总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  205. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalDelivery01', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalDelivery01', headerAlign: 'center', align: "center", columnLabel: '01-交货总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  206. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalQuality01', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalQuality01', headerAlign: 'center', align: "center", columnLabel: '01-质量总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  207. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalAll01', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 70, columnProp: 'scoreTotalAll01', headerAlign: 'center', align: "center", columnLabel: '01-总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  208. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableGradeLevel01', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 60, columnProp: 'gradeLevel01', headerAlign: 'center', align: "center", columnLabel: '01-等级', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  209. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalService02', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalService02', headerAlign: 'center', align: "center", columnLabel: '02-服务总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  210. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalDelivery02', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalDelivery02', headerAlign: 'center', align: "center", columnLabel: '02-交货总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  211. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalQuality02', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalQuality02', headerAlign: 'center', align: "center", columnLabel: '02-质量总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  212. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalAll02', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 70, columnProp: 'scoreTotalAll02', headerAlign: 'center', align: "center", columnLabel: '02-总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  213. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableGradeLevel02', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 60, columnProp: 'gradeLevel02', headerAlign: 'center', align: "center", columnLabel: '02-等级', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  214. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalService03', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalService03', headerAlign: 'center', align: "center", columnLabel: '03-服务总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  215. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalDelivery03', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalDelivery03', headerAlign: 'center', align: "center", columnLabel: '03-交货总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  216. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalQuality03', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalQuality03', headerAlign: 'center', align: "center", columnLabel: '03-质量总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  217. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalAll03', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 70, columnProp: 'scoreTotalAll03', headerAlign: 'center', align: "center", columnLabel: '03-总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  218. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableGradeLevel03', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 60, columnProp: 'gradeLevel03', headerAlign: 'center', align: "center", columnLabel: '03-等级', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  219. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalService04', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalService04', headerAlign: 'center', align: "center", columnLabel: '04-服务总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  220. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalDelivery04', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalDelivery04', headerAlign: 'center', align: "center", columnLabel: '04-交货总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  221. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalQuality04', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalQuality04', headerAlign: 'center', align: "center", columnLabel: '04-质量总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  222. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalAll04', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 70, columnProp: 'scoreTotalAll04', headerAlign: 'center', align: "center", columnLabel: '04-总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  223. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableGradeLevel04', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 60, columnProp: 'gradeLevel04', headerAlign: 'center', align: "center", columnLabel: '04-等级', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  224. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalService05', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalService05', headerAlign: 'center', align: "center", columnLabel: '05-服务总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  225. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalDelivery05', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalDelivery05', headerAlign: 'center', align: "center", columnLabel: '05-交货总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  226. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalQuality05', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalQuality05', headerAlign: 'center', align: "center", columnLabel: '05-质量总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  227. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalAll05', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 70, columnProp: 'scoreTotalAll05', headerAlign: 'center', align: "center", columnLabel: '05-总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  228. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableGradeLevel05', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 60, columnProp: 'gradeLevel05', headerAlign: 'center', align: "center", columnLabel: '05-等级', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  229. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalService06', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalService06', headerAlign: 'center', align: "center", columnLabel: '06-服务总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  230. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalDelivery06', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalDelivery06', headerAlign: 'center', align: "center", columnLabel: '06-交货总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  231. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalQuality06', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalQuality06', headerAlign: 'center', align: "center", columnLabel: '06-质量总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  232. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalAll06', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 70, columnProp: 'scoreTotalAll06', headerAlign: 'center', align: "center", columnLabel: '06-总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  233. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableGradeLevel06', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 60, columnProp: 'gradeLevel06', headerAlign: 'center', align: "center", columnLabel: '06-等级', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  234. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalService07', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalService07', headerAlign: 'center', align: "center", columnLabel: '07-服务总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  235. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalDelivery07', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalDelivery07', headerAlign: 'center', align: "center", columnLabel: '07-交货总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  236. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalQuality07', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalQuality07', headerAlign: 'center', align: "center", columnLabel: '07-质量总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  237. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalAll07', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 70, columnProp: 'scoreTotalAll07', headerAlign: 'center', align: "center", columnLabel: '07-总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  238. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableGradeLevel07', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 60, columnProp: 'gradeLevel07', headerAlign: 'center', align: "center", columnLabel: '07-等级', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  239. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalService08', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalService08', headerAlign: 'center', align: "center", columnLabel: '08-服务总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  240. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalDelivery08', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalDelivery08', headerAlign: 'center', align: "center", columnLabel: '08-交货总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  241. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalQuality08', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalQuality08', headerAlign: 'center', align: "center", columnLabel: '08-质量总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  242. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalAll08', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 70, columnProp: 'scoreTotalAll08', headerAlign: 'center', align: "center", columnLabel: '08-总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  243. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableGradeLevel08', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 60, columnProp: 'gradeLevel08', headerAlign: 'center', align: "center", columnLabel: '08-等级', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  244. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalService09', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalService09', headerAlign: 'center', align: "center", columnLabel: '09-服务总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  245. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalDelivery09', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalDelivery09', headerAlign: 'center', align: "center", columnLabel: '09-交货总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  246. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalQuality09', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalQuality09', headerAlign: 'center', align: "center", columnLabel: '09-质量总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  247. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalAll09', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 70, columnProp: 'scoreTotalAll09', headerAlign: 'center', align: "center", columnLabel: '09-总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  248. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableGradeLevel09', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 60, columnProp: 'gradeLevel09', headerAlign: 'center', align: "center", columnLabel: '09-等级', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  249. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalService10', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalService10', headerAlign: 'center', align: "center", columnLabel: '10-服务总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  250. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalDelivery10', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalDelivery10', headerAlign: 'center', align: "center", columnLabel: '10-交货总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  251. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalQuality10', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalQuality10', headerAlign: 'center', align: "center", columnLabel: '10-质量总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  252. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalAll10', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 70, columnProp: 'scoreTotalAll10', headerAlign: 'center', align: "center", columnLabel: '10-总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  253. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableGradeLevel10', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 60, columnProp: 'gradeLevel10', headerAlign: 'center', align: "center", columnLabel: '10-等级', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  254. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalService11', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalService11', headerAlign: 'center', align: "center", columnLabel: '11-服务总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  255. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalDelivery11', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalDelivery11', headerAlign: 'center', align: "center", columnLabel: '11-交货总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  256. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalQuality11', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalQuality11', headerAlign: 'center', align: "center", columnLabel: '11-质量总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  257. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalAll11', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 70, columnProp: 'scoreTotalAll11', headerAlign: 'center', align: "center", columnLabel: '11-总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  258. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableGradeLevel11', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 60, columnProp: 'gradeLevel11', headerAlign: 'center', align: "center", columnLabel: '11-等级', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  259. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalService12', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalService12', headerAlign: 'center', align: "center", columnLabel: '12-服务总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  260. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalDelivery12', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalDelivery12', headerAlign: 'center', align: "center", columnLabel: '12-交货总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  261. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalQuality12', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 90, columnProp: 'scoreTotalQuality12', headerAlign: 'center', align: "center", columnLabel: '12-质量总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  262. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalAll12', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 70, columnProp: 'scoreTotalAll12', headerAlign: 'center', align: "center", columnLabel: '12-总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  263. { userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableGradeLevel12', tableId: "301001Table", tableName: "供应商绩效概览表", columnWidth: 60, columnProp: 'gradeLevel12', headerAlign: 'center', align: "center", columnLabel: '12-等级', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  264. ],
  265. columnSuppPerTheMonthTotalPointsList : [
  266. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableStatisticMonth', tableId: "301001Table", tableName: "供应商绩效概览总得分表", columnWidth: 80, columnProp: 'statisticMonth', headerAlign: 'center', align: "center", columnLabel: '月份', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  267. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableIndicatorItemNo', tableId: "301001Table", tableName: "供应商绩效概览总得分表", columnWidth: 140, columnProp: 'indicatorItemNo', headerAlign: 'center', align: "center", columnLabel: '绩效指标简码', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  268. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableIndicatorDesc', tableId: "301001Table", tableName: "供应商绩效概览总得分表", columnProp: 'indicatorDesc', headerAlign: 'center', align: "left", columnLabel: '绩效项目', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  269. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableIndicatorCount', tableId: "301001Table", tableName: "供应商绩效概览总得分表", columnWidth: 80, columnProp: 'indicatorCount', headerAlign: 'center', align: "center", columnLabel: '绩效条数', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  270. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableIndicatorScore', tableId: "301001Table", tableName: "供应商绩效概览总得分表", columnWidth: 80, columnProp: 'indicatorScore', headerAlign: 'center', align: "center", columnLabel: '绩效分数', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  271. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableIndicatorGroup', tableId: "301001Table", tableName: "供应商绩效概览总得分表", columnWidth: 90, columnProp: 'indicatorGroup', headerAlign: 'center', align: "center", columnLabel: '绩效分类', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  272. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableGradeLevel', tableId: "301001Table", tableName: "供应商绩效概览总得分表", columnWidth: 50, columnProp: 'gradeLevel', headerAlign: 'center', align: "center", columnLabel: '等级', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  273. ],
  274. rules: {
  275. site: [
  276. {required: true, message: ' ', trigger: 'blur'}
  277. ],
  278. itemNo: [
  279. {required: true, message: ' ', trigger: 'blur'}
  280. ],
  281. indicatorDesc: [
  282. {required: true, message: ' ', trigger: 'blur'}
  283. ],
  284. indicatorGroup: [
  285. {required: true, message: ' ', trigger: 'blur'}
  286. ],
  287. active: [
  288. {required: true, message: ' ', trigger: 'blur'}
  289. ],
  290. statisticMonth: [
  291. {required: true, message: ' ', trigger: 'blur'}
  292. ],
  293. },
  294. userBuList: [],
  295. suppPerThisMonthDetailsList: [],
  296. authSearch: false,
  297. downLoading: false,
  298. menuId: this.$route.meta.menuId,
  299. }
  300. },
  301. mounted () {
  302. this.$nextTick(() => {
  303. this.height = window.innerHeight - 180
  304. })
  305. },
  306. created () {
  307. // 按钮控制
  308. this.getButtonAuthData()
  309. // 获取用户的 site 和 bu
  310. this.getSiteAndBuByUserName()
  311. // 校验用户是否收藏
  312. this.favoriteIsOk()
  313. // 动态列
  314. this.getTableUserColumn(this.$route.meta.menuId+'table',1)
  315. },
  316. methods: {
  317. // 获取用户的bu
  318. getSiteAndBuByUserName () {
  319. let tempData = {
  320. username: this.$store.state.user.name,
  321. }
  322. getSiteAndBuByUserName(tempData).then(({data}) => {
  323. if (data.code === 0) {
  324. this.userBuList = data.rows
  325. }
  326. })
  327. },
  328. // 查询获取数据列表
  329. getDataList () {
  330. this.searchData.limit = this.pageSize
  331. this.searchData.page = this.pageIndex
  332. this.searchData.site = this.$store.state.user.site
  333. supplierPerformanceQuerySummarySearch(this.searchData).then(({data}) => {
  334. if (data.code === 0) {
  335. this.dataList = data.page.list
  336. this.pageIndex = data.page.currPage
  337. this.pageSize = data.page.pageSize
  338. this.totalPage = data.page.totalCount
  339. }
  340. })
  341. },
  342. // 获取方法数据列表
  343. getBaseList (val,type) {
  344. this.tagNo = val
  345. this.$nextTick(() => {
  346. let strVal = ''
  347. if (val === 501) {
  348. strVal = this.searchData.supplierId
  349. }
  350. this.$refs.baseList.init(val, strVal)
  351. })
  352. },
  353. /* 列表方法的回调 */
  354. getBaseData(val) {
  355. if (this.tagNo === 501) {
  356. this.searchData.supplierId = val.SupplierID
  357. }
  358. },
  359. totalPoints (row) {
  360. let inData = {
  361. site: row.site,
  362. statisticMonth: this.searchData.statisticMonth,
  363. supplierId: row.supplierId,
  364. limit: 10,
  365. page: 1,
  366. }
  367. supplierPerformanceTheMonthTotalPoints (inData).then(({data}) => {
  368. if (data.code === 0) {
  369. this.suppPerThisMonthDetailsList = data.page.list
  370. this.pageIndex = data.page.currPage
  371. this.pageSize = data.page.pageSize
  372. this.totalPage = data.page.totalCount
  373. }
  374. this.suppPerTheMonthTotalPointsFlag = true
  375. })
  376. },
  377. supplierPerformanceCalculation () {
  378. if (this.modalData.statisticMonth === '' || this.modalData.statisticMonth == null) {
  379. this.$message.warning('请选择月份!')
  380. return
  381. }
  382. let inData = {
  383. site: this.$store.state.user.site,
  384. statisticMonth: this.modalData.statisticMonth,
  385. }
  386. performanceIndicatorDefinitionCalculation(inData).then(({data}) => {
  387. if (data && data.code === 0) {
  388. this.getDataList()
  389. this.$message({
  390. message: '操作成功',
  391. type: 'success',
  392. duration: 1500,
  393. onClose: () => {}
  394. })
  395. this.computeFlag = false
  396. } else {
  397. this.$alert(data.msg, '错误', {
  398. confirmButtonText: '确定'
  399. })
  400. }
  401. })
  402. },
  403. // setupSupplierBlur (tagNo) {
  404. // if (this.searchData.supplierId != null && this.searchData.supplierId !== '') {
  405. // let tempData = {
  406. // tagno: tagNo,
  407. // conditionSql: " and SupplierID = '" + this.searchData.supplierId + "'" + " and site = '" + this.searchData.site + "'"
  408. // }
  409. // verifyData(tempData).then(({data}) => {
  410. // if (data && data.code === 0) {
  411. // if (data.baseListData.length > 0) {
  412. // this.searchData.supplierName = data.baseListData[0].SupplierName
  413. // } else {
  414. // this.$message.warning('供应商编码不存在')
  415. // this.searchData.supplierName = ''
  416. // }
  417. // } else {
  418. // this.$message.warning(data.msg)
  419. // this.modalData.supplierName = ''
  420. // }
  421. // })
  422. // }
  423. // },
  424. // 每页数
  425. sizeChangeHandle (val) {
  426. this.pageSize = val
  427. this.pageIndex = 1
  428. this.getDataList()
  429. },
  430. // 当前页
  431. currentChangeHandle (val) {
  432. this.pageIndex = val
  433. this.getDataList()
  434. },
  435. // 校验用户是否收藏
  436. favoriteIsOk () {
  437. let userFavorite = {
  438. userId: this.$store.state.user.id,
  439. languageCode: this.$i18n.locale
  440. }
  441. userFavoriteList(userFavorite).then(({data}) => {
  442. for (let i = 0; i < data.list.length; i++) {
  443. if(this.$route.meta.menuId === data.list[i].menuId){
  444. this.favorite = true
  445. }
  446. }
  447. })
  448. },
  449. // 收藏 OR 取消收藏
  450. favoriteFunction () {
  451. let userFavorite = {
  452. userId: this.$store.state.user.id,
  453. functionId: this.$route.meta.menuId,
  454. }
  455. if (this.favorite) {
  456. removeUserFavorite(userFavorite).then(({data}) => {
  457. this.$message.success(data.msg)
  458. this.favorite = false
  459. })
  460. } else {
  461. // 收藏
  462. saveUserFavorite(userFavorite).then(({data}) => {
  463. this.$message.success(data.msg)
  464. this.favorite = true
  465. })
  466. }
  467. },
  468. // 动态列开始 获取 用户保存的 格式列
  469. async getTableUserColumn (tableId, columnId) {
  470. let queryTableUser = {
  471. userId: this.$store.state.user.name,
  472. functionId: this.$route.meta.menuId,
  473. tableId: tableId,
  474. status: true,
  475. languageCode: this.$i18n.locale
  476. }
  477. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  478. if (data.rows.length > 0) {
  479. //this.columnList1 = []
  480. switch (columnId) {
  481. case 1:
  482. this.columnList = data.rows
  483. break;
  484. // case 2:
  485. // this.columnDetailList = data.rows
  486. // break;
  487. // case 3:
  488. // this.columnList2 = data.rows
  489. // break;
  490. // case 4:
  491. // this.columnList3 = data.rows
  492. // break;
  493. }
  494. } else {
  495. this.getColumnList(tableId, columnId)
  496. }
  497. })
  498. },
  499. // 获取 tableDefault 列
  500. async getColumnList (tableId, columnId) {
  501. let queryTable = {
  502. functionId: this.$route.meta.menuId,
  503. tableId: tableId,
  504. languageCode: this.$i18n.locale
  505. }
  506. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  507. if (!data.rows.length == 0) {
  508. switch (columnId) {
  509. case 1:
  510. this.columnList = data.rows
  511. break;
  512. // case 2:
  513. // this.columnDetailList = data.rows
  514. // break;
  515. // case 3:
  516. // this.columnList2 = data.rows
  517. // break;
  518. // case 4:
  519. // this.columnList3 = data.rows
  520. // break;
  521. }
  522. } else {
  523. // this.showDefault = true.
  524. }
  525. })
  526. },
  527. //获取按钮的权限数据
  528. getButtonAuthData () {
  529. let searchFlag = this.isAuth(this.menuId+":search")
  530. let saveFlag = this.isAuth(this.menuId+":save")
  531. let updateFlag = this.isAuth(this.menuId+":update")
  532. let deleteFlag = this.isAuth(this.menuId+":delete")
  533. //处理页面的权限数据
  534. this.authSearch = !searchFlag
  535. this.authSave = !saveFlag
  536. this.authUpdate = !updateFlag
  537. this.authDelete = !deleteFlag
  538. },
  539. //导出excel
  540. async createExportData () {
  541. this.searchData.limit = -1
  542. this.searchData.page = 1
  543. await supplierPerformanceQuerySummarySearch(this.searchData).then(({data}) => {
  544. this.exportList = data.page.list
  545. })
  546. return this.exportList
  547. },
  548. startDownload () {},
  549. finishDownload () {},
  550. fields () {
  551. let json = "{"
  552. this.columnList.forEach((item, index) => {
  553. if (index == this.columnList.length - 1) {
  554. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  555. } else {
  556. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  557. }
  558. })
  559. json += "}"
  560. let s = eval("(" + json + ")")
  561. return s
  562. },
  563. }
  564. }
  565. </script>
  566. <style>
  567. .highlight {
  568. font-weight: bold;
  569. color: red;
  570. }
  571. </style>
  572. ```