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

456 lines
28 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-MM"></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. </el-form-item>
  35. </el-form>
  36. <!-- 展示列表 -->
  37. <el-table
  38. :height="height"
  39. :data="dataList"
  40. border
  41. style="width: 100%;">
  42. <el-table-column
  43. v-for="(item,index) in columnList" :key="index"
  44. :sortable="item.columnSortable"
  45. :prop="item.columnProp"
  46. :header-align="item.headerAlign"
  47. :show-overflow-tooltip="item.showOverflowTooltip"
  48. :align="item.align"
  49. :fixed="item.fixed==''?false:item.fixed"
  50. :width="item.columnWidth"
  51. :label="item.columnLabel">
  52. <template slot-scope="scope">
  53. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  54. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  55. </template>
  56. </el-table-column>
  57. <el-table-column
  58. fixed="right"
  59. header-align="center"
  60. align="center"
  61. width="80"
  62. label="操作">
  63. <template slot-scope="scope">
  64. <a type="text" size="small" @click="details(scope.row)">详情</a>
  65. </template>
  66. </el-table-column>
  67. </el-table>
  68. <el-pagination
  69. @size-change="sizeChangeHandle"
  70. @current-change="currentChangeHandle"
  71. :current-page="pageIndex"
  72. :page-sizes="[20, 50, 100, 200, 500]"
  73. :page-size="pageSize"
  74. :total="totalPage"
  75. layout="total, sizes, prev, pager, next, jumper">
  76. </el-pagination>
  77. <el-dialog title="详情" :close-on-click-modal="false" v-drag :visible.sync="suppPerThisMonthDetailsFlag" width="951px" style="margin-top: -5vh">
  78. <el-table
  79. :data="suppPerThisMonthDetailsList"
  80. :height="height - 27"
  81. border
  82. style="width: 100%;">
  83. <el-table-column
  84. v-for="(item,index) in columnSuppPerThisMonthDetailsList" :key="index"
  85. :sortable="item.columnSortable"
  86. :prop="item.columnProp"
  87. :header-align="item.headerAlign"
  88. :show-overflow-tooltip="item.showOverflowTooltip"
  89. :align="item.align"
  90. :fixed="item.fixed==''?false:item.fixed"
  91. :width="item.columnWidth"
  92. :label="item.columnLabel">
  93. <template slot-scope="scope">
  94. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  95. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  96. </template>
  97. </el-table-column>
  98. </el-table>
  99. <span slot="footer" class="dialog-footer">
  100. <el-button @click="suppPerThisMonthDetailsFlag = false">关闭</el-button>
  101. </span>
  102. </el-dialog>
  103. <!--列表的组件-->
  104. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  105. </div>
  106. </template>
  107. <script>
  108. import {
  109. suppPerformanceQueryDetailSearch,
  110. supplierPerformanceThisMonthDetails
  111. } from "@/api/performance/performance.js"
  112. import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
  113. import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
  114. import {getSiteAndBuByUserName} from "../../../api/qc/qc";
  115. import Chooselist from '@/views/modules/common/Chooselist';
  116. import {verifyData} from "../../../api/performance/performance";
  117. /* 列表组件 */
  118. export default {
  119. components: {
  120. Chooselist, /* 选择的组件 */
  121. },
  122. data () {
  123. const date = new Date();
  124. const year = date.getFullYear();
  125. const month = String(date.getMonth() + 1).padStart(2, '0'); // 获取当前月份并补零
  126. return {
  127. // 是否收藏
  128. favorite: false,
  129. // 导出 start
  130. exportData: [],
  131. exportName: "检验方法" + this.dayjs().format('YYYYMMDDHHmmss'),
  132. exportHeader: ["检验方法"],
  133. exportFooter: [],
  134. exportList: [],
  135. // 导出 end
  136. searchData: {
  137. site: this.$store.state.user.site,
  138. userName: this.$store.state.user.name,
  139. statisticMonth: `${year}-${month}`, // 设置默认为当前月份,格式为 YYYY-MM
  140. supplierId: '',
  141. supplierName: '',
  142. page: 1,
  143. limit: 10,
  144. },
  145. pageIndex: 1,
  146. pageSize: 20,
  147. totalPage: 0,
  148. height: 200,
  149. dataList: [],
  150. modalFlag: false,
  151. modalDisableFlag: false,
  152. computeFlag: false,
  153. suppPerThisMonthDetailsFlag: false,
  154. // 标头展示
  155. columnList: [
  156. {
  157. userId: this.$store.state.user.name,
  158. functionId: 108002,
  159. serialNumber: '301001TableSite',
  160. tableId: "301001Table",
  161. tableName: "供应商本月绩效统计表",
  162. columnWidth: 50,
  163. columnProp: 'site',
  164. headerAlign: 'center',
  165. align: "center",
  166. columnLabel: '工厂',
  167. columnHidden: false,
  168. columnImage: false,
  169. columnSortable: false,
  170. sortLv: 0,
  171. status: true,
  172. fixed: ''
  173. },
  174. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableSupplierId', tableId: "301001Table", tableName: "供应商本月绩效统计表", columnWidth: 100, columnProp: 'supplierId', headerAlign: 'center', align: "center", columnLabel: '供应商编码', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  175. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableSupplierName', tableId: "301001Table", tableName: "供应商本月绩效统计表", columnWidth: 180, columnProp: 'supplierName', headerAlign: 'center', align: "center", columnLabel: '供应商名称', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  176. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableCountBzsldqjs', tableId: "301001Table", tableName: "供应商本月绩效统计表", columnWidth: 115, columnProp: 'countBzsldqjs', headerAlign: 'center', align: "center", columnLabel: '包装数量短缺(件数)', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  177. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableCountBzfswagdyqzx', tableId: "301001Table", tableName: "供应商本月绩效统计表", columnWidth: 190, columnProp: 'countBzfswagdyqzx', headerAlign: 'center', align: "center", columnLabel: '包装方式未按规定要求执行(件数)', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  178. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableCountDlslyjhslcy', tableId: "301001Table", tableName: "供应商本月绩效统计表", columnWidth: 145, columnProp: 'countDlslyjhslcy', headerAlign: 'center', align: "center", columnLabel: '到料数量与计划数量差异', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  179. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableCountXqjfzpc', tableId: "301001Table", tableName: "供应商本月绩效统计表", columnWidth: 115, columnProp: 'countXqjfzpc', headerAlign: 'center', align: "center", columnLabel: '需交付总批次(件数)', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  180. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableCountYqjf', tableId: "301001Table", tableName: "供应商本月绩效统计表", columnWidth: 90, columnProp: 'countYqjf', headerAlign: 'center', align: "center", columnLabel: '延期交付(件数)', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  181. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableCountZsjhpswcl', tableId: "301001Table", tableName: "供应商本月绩效统计表", columnWidth: 118, columnProp: 'countZsjhpswcl', headerAlign: 'center', align: "center", columnLabel: '准时交货批数完成率', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  182. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableCountXjfzsl', tableId: "301001Table", tableName: "供应商本月绩效统计表", columnWidth: 85, columnProp: 'countXjfzsl', headerAlign: 'center', align: "center", columnLabel: '需交付总数量', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  183. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableCountYqjfSl', tableId: "301001Table", tableName: "供应商本月绩效统计表", columnWidth: 90, columnProp: 'countYqjfSl', headerAlign: 'center', align: "center", columnLabel: '延期交付(数量)', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  184. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableCountZsjhslwcl', tableId: "301001Table", tableName: "供应商本月绩效统计表", columnWidth: 120, columnProp: 'countZsjhslwcl', headerAlign: 'center', align: "center", columnLabel: '准时交货数量完成率', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  185. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableCountJyzps', tableId: "301001Table", tableName: "供应商本月绩效统计表", columnWidth: 80, columnProp: 'countJyzps', headerAlign: 'center', align: "center", columnLabel: '检验总批数', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  186. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableCountPlthTxzps', tableId: "301001Table", tableName: "供应商本月绩效统计表", columnWidth: 125, columnProp: 'countPlthTxzps', headerAlign: 'center', align: "center", columnLabel: '批量退货或挑选总批数', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  187. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableCountHgpl', tableId: "301001Table", tableName: "供应商本月绩效统计表", columnWidth: 70, columnProp: 'countHgpl', headerAlign: 'center', align: "center", columnLabel: '合格批率', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  188. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableCountChjybgwtj', tableId: "301001Table", tableName: "供应商本月绩效统计表", columnWidth: 155, columnProp: 'countChjybgwtj', headerAlign: 'center', align: "center", columnLabel: '出货检验报告未提交(件数)', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  189. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableCountChjybgbf', tableId: "301001Table", tableName: "供应商本月绩效统计表", columnWidth: 285, columnProp: 'countChjybgbf', headerAlign: 'center', align: "center", columnLabel: '出货检验报告数据与祥兆进料检验的数据不符(件数)', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  190. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableCountBqbzqWt', tableId: "301001Table", tableName: "供应商本月绩效统计表", columnWidth: 145, columnProp: 'countBqbzqWt', headerAlign: 'center', align: "center", columnLabel: '标签不正确或未贴(次数)', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  191. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableScoreBzsldq', tableId: "301001Table", tableName: "供应商本月绩效统计表", columnWidth: 85, columnProp: 'scoreBzsldq', headerAlign: 'center', align: "center", columnLabel: '包装数量短缺', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  192. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableScoreBzfswagdyqzx', tableId: "301001Table", tableName: "供应商本月绩效统计表", columnWidth: 85, columnProp: 'scoreBzfswagdyqzx', headerAlign: 'center', align: "center", columnLabel: '包装方式不符', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  193. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableScoreDlslyjhslcy', tableId: "301001Table", tableName: "供应商本月绩效统计表", columnWidth: 85, columnProp: 'scoreDlslyjhslcy', headerAlign: 'center', align: "center", columnLabel: '到料数量不符', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  194. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableScoreYqjf', tableId: "301001Table", tableName: "供应商本月绩效统计表", columnWidth: 70, columnProp: 'scoreYqjf', headerAlign: 'center', align: "center", columnLabel: '延期交付', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  195. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableScorePlth', tableId: "301001Table", tableName: "供应商本月绩效统计表", columnWidth: 125, columnProp: 'scorePlth', headerAlign: 'center', align: "center", columnLabel: '批量退货或挑选总批数', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  196. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableScoreChjybgwtj', tableId: "301001Table", tableName: "供应商本月绩效统计表", columnWidth: 120, columnProp: 'scoreChjybgwtj', headerAlign: 'center', align: "center", columnLabel: '出货检验报告未提交', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  197. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableScoreChjybgbf', tableId: "301001Table", tableName: "供应商本月绩效统计表", columnWidth: 250, columnProp: 'scoreChjybgbf', headerAlign: 'center', align: "center", columnLabel: '出货检验报告数据与祥兆进料检验的数据不符', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  198. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableScoreBqbzqWt', tableId: "301001Table", tableName: "供应商本月绩效统计表", columnWidth: 110, columnProp: 'scoreBqbzqWt', headerAlign: 'center', align: "center", columnLabel: '标签不正确或未贴', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  199. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableScoreTotalService', tableId: "301001Table", tableName: "供应商本月绩效统计表", columnWidth: 80, columnProp: 'scoreTotalService', headerAlign: 'center', align: "center", columnLabel: '服务总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  200. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableScoreTotalDelivery', tableId: "301001Table", tableName: "供应商本月绩效统计表", columnWidth: 80, columnProp: 'scoreTotalDelivery', headerAlign: 'center', align: "center", columnLabel: '交货总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  201. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableScoreTotalQuality', tableId: "301001Table", tableName: "供应商本月绩效统计表", columnWidth: 80, columnProp: 'scoreTotalQuality', headerAlign: 'center', align: "center", columnLabel: '质量总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  202. { userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableScoreTotalAll', tableId: "301001Table", tableName: "供应商本月绩效统计表", columnWidth: 55, columnProp: 'scoreTotalAll', headerAlign: 'center', align: "center", columnLabel: '总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
  203. { 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: '' },
  204. ],
  205. columnSuppPerThisMonthDetailsList : [
  206. { 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: '' },
  207. { 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: '' },
  208. { 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: '' },
  209. { 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: '' },
  210. { 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: '' },
  211. { 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: '' },
  212. { 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: '' },
  213. ],
  214. userBuList: [],
  215. suppPerThisMonthDetailsList: [],
  216. authSearch: false,
  217. menuId: this.$route.meta.menuId,
  218. }
  219. },
  220. mounted () {
  221. this.$nextTick(() => {
  222. this.height = window.innerHeight - 180
  223. })
  224. },
  225. created () {
  226. // 按钮控制
  227. this.getButtonAuthData()
  228. // 获取用户的 site 和 bu
  229. this.getSiteAndBuByUserName()
  230. // 校验用户是否收藏
  231. this.favoriteIsOk()
  232. // 动态列
  233. this.getTableUserColumn(this.$route.meta.menuId+'table',1)
  234. },
  235. methods: {
  236. // 获取用户的bu
  237. getSiteAndBuByUserName () {
  238. let tempData = {
  239. username: this.$store.state.user.name,
  240. }
  241. getSiteAndBuByUserName(tempData).then(({data}) => {
  242. if (data.code === 0) {
  243. this.userBuList = data.rows
  244. }
  245. })
  246. },
  247. // 查询获取数据列表
  248. getDataList () {
  249. this.searchData.limit = this.pageSize
  250. this.searchData.page = this.pageIndex
  251. this.searchData.site = this.$store.state.user.site
  252. suppPerformanceQueryDetailSearch(this.searchData).then(({data}) => {
  253. if (data.code === 0) {
  254. this.dataList = data.page.list
  255. this.pageIndex = data.page.currPage
  256. this.pageSize = data.page.pageSize
  257. this.totalPage = data.page.totalCount
  258. }
  259. })
  260. },
  261. // 获取方法数据列表
  262. getBaseList (val,type) {
  263. this.tagNo = val
  264. this.$nextTick(() => {
  265. let strVal = ''
  266. if (val === 501) {
  267. strVal = this.searchData.supplierId
  268. }
  269. this.$refs.baseList.init(val, strVal)
  270. })
  271. },
  272. /* 列表方法的回调 */
  273. getBaseData(val) {
  274. if (this.tagNo === 501) {
  275. this.searchData.supplierId = val.SupplierID
  276. }
  277. },
  278. details (row) {
  279. let inData = {
  280. site: row.site,
  281. statisticMonth: this.searchData.statisticMonth,
  282. supplierId: row.supplierId,
  283. limit: 10,
  284. page: 1,
  285. }
  286. supplierPerformanceThisMonthDetails (inData).then(({data}) => {
  287. if (data.code === 0) {
  288. this.suppPerThisMonthDetailsList = data.page.list
  289. this.pageIndex = data.page.currPage
  290. this.pageSize = data.page.pageSize
  291. this.totalPage = data.page.totalCount
  292. }
  293. this.suppPerThisMonthDetailsFlag = true
  294. })
  295. },
  296. // 每页数
  297. sizeChangeHandle (val) {
  298. this.pageSize = val
  299. this.pageIndex = 1
  300. this.getDataList()
  301. },
  302. // 当前页
  303. currentChangeHandle (val) {
  304. this.pageIndex = val
  305. this.getDataList()
  306. },
  307. // 校验用户是否收藏
  308. favoriteIsOk () {
  309. let userFavorite = {
  310. userId: this.$store.state.user.id,
  311. languageCode: this.$i18n.locale
  312. }
  313. userFavoriteList(userFavorite).then(({data}) => {
  314. for (let i = 0; i < data.list.length; i++) {
  315. if(this.$route.meta.menuId === data.list[i].menuId){
  316. this.favorite = true
  317. }
  318. }
  319. })
  320. },
  321. // setupSupplierBlur (tagNo) {
  322. // if (this.searchData.supplierId != null && this.searchData.supplierId !== '') {
  323. // let tempData = {
  324. // tagno: tagNo,
  325. // conditionSql: " and SupplierID = '" + this.searchData.supplierId + "'" + " and site = '" + this.searchData.site + "'"
  326. // }
  327. // verifyData(tempData).then(({data}) => {
  328. // if (data && data.code === 0) {
  329. // if (data.baseListData.length > 0) {
  330. // this.searchData.supplierName = data.baseListData[0].SupplierName
  331. // } else {
  332. // this.$message.warning('供应商编码不存在')
  333. // this.searchData.supplierName = ''
  334. // }
  335. // } else {
  336. // this.$message.warning(data.msg)
  337. // this.modalData.supplierName = ''
  338. // }
  339. // })
  340. // }
  341. // },
  342. // 收藏 OR 取消收藏
  343. favoriteFunction () {
  344. let userFavorite = {
  345. userId: this.$store.state.user.id,
  346. functionId: this.$route.meta.menuId,
  347. }
  348. if (this.favorite) {
  349. removeUserFavorite(userFavorite).then(({data}) => {
  350. this.$message.success(data.msg)
  351. this.favorite = false
  352. })
  353. } else {
  354. // 收藏
  355. saveUserFavorite(userFavorite).then(({data}) => {
  356. this.$message.success(data.msg)
  357. this.favorite = true
  358. })
  359. }
  360. },
  361. // 动态列开始 获取 用户保存的 格式列
  362. async getTableUserColumn (tableId, columnId) {
  363. let queryTableUser = {
  364. userId: this.$store.state.user.name,
  365. functionId: this.$route.meta.menuId,
  366. tableId: tableId,
  367. status: true,
  368. languageCode: this.$i18n.locale
  369. }
  370. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  371. if (data.rows.length > 0) {
  372. //this.columnList1 = []
  373. switch (columnId) {
  374. case 1:
  375. this.columnList = data.rows
  376. break;
  377. // case 2:
  378. // this.columnDetailList = data.rows
  379. // break;
  380. // case 3:
  381. // this.columnList2 = data.rows
  382. // break;
  383. // case 4:
  384. // this.columnList3 = data.rows
  385. // break;
  386. }
  387. } else {
  388. this.getColumnList(tableId, columnId)
  389. }
  390. })
  391. },
  392. // 获取 tableDefault 列
  393. async getColumnList (tableId, columnId) {
  394. let queryTable = {
  395. functionId: this.$route.meta.menuId,
  396. tableId: tableId,
  397. languageCode: this.$i18n.locale
  398. }
  399. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  400. if (!data.rows.length == 0) {
  401. switch (columnId) {
  402. case 1:
  403. this.columnList = data.rows
  404. break;
  405. // case 2:
  406. // this.columnDetailList = data.rows
  407. // break;
  408. // case 3:
  409. // this.columnList2 = data.rows
  410. // break;
  411. // case 4:
  412. // this.columnList3 = data.rows
  413. // break;
  414. }
  415. } else {
  416. // this.showDefault = true.
  417. }
  418. })
  419. },
  420. //获取按钮的权限数据
  421. getButtonAuthData () {
  422. let searchFlag = this.isAuth(this.menuId+":search")
  423. let saveFlag = this.isAuth(this.menuId+":save")
  424. let updateFlag = this.isAuth(this.menuId+":update")
  425. let deleteFlag = this.isAuth(this.menuId+":delete")
  426. //处理页面的权限数据
  427. this.authSearch = !searchFlag
  428. this.authSave = !saveFlag
  429. this.authUpdate = !updateFlag
  430. this.authDelete = !deleteFlag
  431. },
  432. }
  433. }
  434. </script>