Browse Source

2025.01.20 绩效&送货计划 第一版

master
yuejiayang 12 months ago
parent
commit
bdfd5ca4bc
  1. 5
      src/api/deliverySchedule/supplierDeliveryPlan.js
  2. 9
      src/api/deliverySchedule/supplierDeliverySchedule.js
  3. 21
      src/api/performance/performance.js
  4. 1057
      src/views/modules/deliverySchedule/externalSupplierDeliverySchedule.vue
  5. 1002
      src/views/modules/deliverySchedule/internalSupplierDeliverySchedule.vue
  6. 1046
      src/views/modules/deliverySchedule/supplierDeliverySchedule.vue
  7. 197
      src/views/modules/performance/myPerformance.vue
  8. 758
      src/views/modules/performance/performanceIndicatorDefinition.vue
  9. 550
      src/views/modules/performance/supplierPerformanceTheYear.vue
  10. 435
      src/views/modules/performance/supplierPerformanceThisMonth.vue

5
src/api/deliverySchedule/supplierDeliveryPlan.js

@ -0,0 +1,5 @@
import { createAPI } from "@/utils/httpRequest.js";
export const searchSupplierDeliveryPlan = data => createAPI(`/deliverySchedule/searchSupplierDeliveryPlan`,'post',data)
export const updateSupplierDeliveryPlan = data => createAPI(`/deliverySchedule/updateSupplierDeliveryPlan`,'post',data)

9
src/api/deliverySchedule/supplierDeliverySchedule.js

@ -0,0 +1,9 @@
import { createAPI } from "@/utils/httpRequest.js";
export const searchSupplierDeliverySchedule = data => createAPI(`/deliverySchedule/supplierDeliveryScheduleSearch`,'post',data)
export const updateSupplierDeliveryScheduleDeliveryQty = data => createAPI(`/deliverySchedule/updateSupplierDeliveryScheduleDeliveryQty`,'post',data)
export const autoReservationInitiateHandler = data => createAPI(`/deliverySchedule/autoReservationInitiateHandler`,'post',data)
export const addSupplierDeliveryPlan = data => createAPI(`/deliverySchedule/addSupplierDeliveryPlan`,'post',data)

21
src/api/performance/performance.js

@ -0,0 +1,21 @@
import { createAPI } from "@/utils/httpRequest.js";
export const performanceIndicatorDefinitionSearch = data => createAPI(`/pms/performance/performanceIndicatorDefinitionSearch`,'post',data)
export const performanceIndicatorDefinitionSave = data => createAPI(`/pms/performance/performanceIndicatorDefinitionSave`,'post',data)
export const performanceIndicatorDefinitionUpdate = data => createAPI(`/pms/performance/performanceIndicatorDefinitionUpdate`,'post',data)
export const performanceIndicatorDefinitionDelete = data => createAPI(`/pms/performance/performanceIndicatorDefinitionDelete`,'post',data)
export const performanceIndicatorDefinitionCalculation = data => createAPI(`/pms/performance/performanceIndicatorDefinitionCalculation`,'post',data)
export const suppPerformanceQueryDetailSearch = data => createAPI(`/pms/performance/suppPerformanceQueryDetail`,'post',data)
export const supplierPerformanceThisMonthDetails = data => createAPI(`/pms/performance/supplierPerformanceThisMonthDetails`,'post',data)
export const pastYearPerformanceSearch = data => createAPI(`/pms/performance/pastYearPerformanceSearch`,'post',data)
export const supplierPerformanceQuerySummarySearch = data => createAPI(`/pms/performance/supplierPerformanceQuerySummary`,'post',data)
export const supplierPerformanceTheMonthTotalPoints = data => createAPI(`/pms/performance/suppPerformanceListDetail`,'post',data)

1057
src/views/modules/deliverySchedule/externalSupplierDeliverySchedule.vue
File diff suppressed because it is too large
View File

1002
src/views/modules/deliverySchedule/internalSupplierDeliverySchedule.vue
File diff suppressed because it is too large
View File

1046
src/views/modules/deliverySchedule/supplierDeliverySchedule.vue
File diff suppressed because it is too large
View File

197
src/views/modules/performance/myPerformance.vue

@ -0,0 +1,197 @@
<<template>
<div class="score-container">
<div class="score-header">
<span>本月得分</span>
<el-input v-model="this.scoreTotalAll" class="score-input" readonly></el-input>
</div>
<el-table :data="tableData" border :span-method="arraySpanMethod" style="width: 50%" :height="300">
<el-table-column prop="type" label="绩效类型" align="center" width="100px"></el-table-column>
<el-table-column prop="item" label="绩效项目" header-align="center" align="left"></el-table-column>
<el-table-column prop="value" label="指标值" align="center" width="80px"></el-table-column>
</el-table>
<p style="margin-top: 10px;font-size: 15px">过往12个月的绩效</p>
<!-- 展示列表 -->
<el-table
:height="height + 80"
:data="dataList2"
border
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import {
pastYearPerformanceSearch,
supplierPerformanceThisMonthDetails,
suppPerformanceQueryDetailSearch
} from "../../../api/performance/performance";
export default {
data() {
return {
dataList: [],
dataList2: [],
scoreTotalAll: '',
searchData: {
site: '',
userName: this.$store.state.user.name,
statisticMonth: '',
supplierId: '',
supplierName: '',
page: 1,
limit: 10,
},
columnList: [
{
userId: this.$store.state.user.name,
functionId: 108003,
serialNumber: '301001TableSite',
tableId: "301001Table",
tableName: "月份",
columnWidth: 80,
columnProp: 'statisticMonth',
headerAlign: 'center',
align: "center",
columnLabel: '月份',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: ''
},
{ userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalService', tableId: "301001Table", tableName: "供应商绩效概览表", columnProp: 'scoreTotalService', headerAlign: 'center', align: "center", columnLabel: '服务总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
{ userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalDelivery', tableId: "301001Table", tableName: "供应商绩效概览表", columnProp: 'scoreTotalDelivery', headerAlign: 'center', align: "center", columnLabel: '交货总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
{ userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalQuality', tableId: "301001Table", tableName: "供应商绩效概览表", columnProp: 'scoreTotalQuality', headerAlign: 'center', align: "center", columnLabel: '质量总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
{ userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableScoreTotalAll', tableId: "301001Table", tableName: "供应商绩效概览表", columnProp: 'scoreTotalAll', headerAlign: 'center', align: "center", columnLabel: '总得分', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
{ userId: this.$store.state.user.name, functionId: 108003, serialNumber: '301001TableGradeLevel', tableId: "301001Table", tableName: "供应商绩效概览表", columnProp: 'gradeLevel', headerAlign: 'center', align: "center", columnLabel: '等级', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
],
tableData: [],
pageIndex: 1,
pageSize: 20,
totalPage: 0,
height: 200,
monthlyScore: '75',
};
},
created() {
this.getDataList();
},
mounted() {
this.generateTableData();
},
methods: {
//
getDataList () {
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
this.searchData.site = this.$store.state.user.site
this.searchData.supplierId = 'BC002'
this.searchData.supplierName = '慈溪市奥明塑料有限公司'
const date = new Date();
const offset = 8 * 60 * 60 * 1000; // GMT+8 offset in milliseconds
const gmt8Date = new Date(date.getTime() + offset);
const year = gmt8Date.getUTCFullYear();
const month = (gmt8Date.getUTCMonth() + 1).toString().padStart(2, '0'); // getUTCMonth() returns 0-11
this.searchData.statisticMonth = `${year}-${month}`;
supplierPerformanceThisMonthDetails(this.searchData).then(({data}) => {
if (data.code === 0) {
this.dataList = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
}
})
suppPerformanceQueryDetailSearch(this.searchData).then(({data}) => {
if (data.code === 0) {
this.scoreTotalAll = data.page.list[0].scoreTotalAll
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
}
})
pastYearPerformanceSearch(this.searchData).then(({data}) => {
if (data.code === 0) {
this.dataList2 = data.list
}
})
},
generateTableData() {
const items = [
{ type: '服务表现', item: '包装数量短缺(件数)' },
{ type: '服务表现', item: '包装方式未按规定要求执行(件数)' },
{ type: '服务表现', item: '到料数量与计划数量差异' },
{ type: '服务表现', item: '需交付总批次(件数)' },
{ type: '交期表现', item: '延期交付(件数)' },
{ type: '交期表现', item: '准时交付批次完成率' },
{ type: '交期表现', item: '需交付总数量' },
{ type: '交期表现', item: '延期交付(数量)' },
{ type: '交期表现', item: '准时交付数量完成率' },
{ type: '质量表现', item: '检验总批数' },
{ type: '质量表现', item: '批量验收数抽选总批数' },
{ type: '质量表现', item: '合格批率' },
{ type: '质量表现', item: '出货检验报告未提交(件数)' },
{ type: '质量表现', item: '出货检验报告数据与样品进料检验的数据不符(件数)' },
{ type: '质量表现', item: '标签不正确或未贴(次数)' }
];
this.tableData = items.map((item, index) => ({
type: item.type,
item: item.item,
value: this.dataList[index] ? this.dataList[index].indicatorScore : 0 // dataList
}));
},
arraySpanMethod({ row, column, rowIndex, columnIndex }) {
if (columnIndex === 0) {
if (rowIndex === 0) {
return [4, 1];
} else if (rowIndex === 4) {
return [5, 1];
} else if (rowIndex === 9) {
return [6, 1];
} else {
return [0, 0];
}
}
}
},
};
</script>
<style>
.score-container {
//padding: 20px;
}
.score-header {
display: flex;
align-items: center;
margin-bottom: 5px;
}
.score-input {
width: 100px;
margin-left: 10px;
}
</style>

758
src/views/modules/performance/performanceIndicatorDefinition.vue

@ -0,0 +1,758 @@
<template>
<div class="mod-config">
<!-- 收藏 -->
<div>
<span @click="favoriteFunction()">
<icon-svg :name="favorite?'xiangqufill':'xiangqu'" class="sl-svg"></icon-svg>
</span>
</div>
<!-- 条件查询 -->
<el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
<el-form-item :label="'工厂'">
<el-select v-model="searchData.site" placeholder="请选择" style="width: 120px">
<el-option
v-for = "i in userBuList"
:key = "i.site"
:label = "i.site"
:value = "i.site">
<span style="float: left;width: 120px">{{ i.sitename }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="'简码'">
<el-input v-model="searchData.itemNo" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'绩效项目'">
<el-input v-model="searchData.indicatorDesc" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="绩效分类">
<el-select v-model="searchData.indicatorGroup" placeholder="请选择">
<el-option label="全部" value=""></el-option>
<el-option label="服务表现" value="服务表现"></el-option>
<el-option label="交期表现" value="交期表现"></el-option>
<el-option label="质量表现" value="质量表现"></el-option>
</el-select>
</el-form-item>
<el-form-item label="是否在用">
<el-select filterable v-model="searchData.active" style="width: 140px">
<el-option label="是" value="Y"></el-option>
<el-option label="否" value="N"></el-option>
</el-select>
</el-form-item>
<el-form-item :label="' '">
<el-button v-if="!authSearch" type="primary" @click="getDataList()">查询</el-button>
<el-button v-if="!authSave" type="primary" @click="addModal()">新增</el-button>
<!-- <el-button type="primary" @click="computeFlag = true">供应商绩效统计计算</el-button>-->
</el-form-item>
</el-form>
<!-- 展示列表 -->
<el-table
:height="height"
:data="dataList"
border
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
<span v-if="item.columnProp === 'active'">{{ scope.row[item.columnProp] === 'Y' ? '' : '' }}</span>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="160"
label="操作">
<template slot-scope="scope">
<a v-if="!authUpdate" type="text" size="small" @click="updateModal(scope.row)">修改</a>
<a v-if="!authDelete" type="text" size="small" @click="deleteModal(scope.row)">删除</a>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[20, 50, 100, 200, 500]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 新增和修改 -->
<el-dialog title="检验方法" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="500px">
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="工厂" prop="site" :rules="rules.site">
<el-select v-model="modalData.site" placeholder="请选择" :disabled="modalDisableFlag" style="width: 221px">
<el-option
v-for = "i in userBuList"
:key = "i.site"
:label = "i.site"
:value = "i.site">
<span style="float: left;width: 100px">{{ i.sitename }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="简码:" prop="itemNo" :rules="rules.itemNo">
<el-input v-model="modalData.itemNo" style="width: 221px" :disabled="modalDisableFlag"></el-input>
</el-form-item>
<el-form-item label="绩效项目:" prop="indicatorDesc" :rules="rules.indicatorDesc">
<el-input v-model="modalData.indicatorDesc" style="width: 221px"></el-input>
</el-form-item>
<el-form-item label="绩效分类:" prop="indicatorGroup" :rules="rules.indicatorGroup">
<el-select v-model="modalData.indicatorGroup" placeholder="请选择" style="width: 221px">
<el-option label="服务表现" value="服务表现"></el-option>
<el-option label="交期表现" value="交期表现"></el-option>
<el-option label="质量表现" value="质量表现"></el-option>
</el-select>
</el-form-item>
<el-form-item label="是否在用:" prop="active" :rules="rules.active">
<el-select v-model="modalData.active" placeholder="请选择" style="width: 221px">
<el-option label="是" value="Y"></el-option>
<el-option label="否" value="N"></el-option>
</el-select>
</el-form-item>
<el-form-item label="备注:" prop="remark">
<el-input v-model="modalData.remark" clearable style="width: 221px"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="saveData">保存</el-button>
<el-button @click="modalFlag = false">取消</el-button>
</span>
</el-dialog>
<el-dialog title="供应商绩效统计计算" :close-on-click-modal="false" v-drag :visible.sync="computeFlag" width="500px">
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="工厂">
<el-input v-model="this.$store.state.user.site" style="width: 221px" disabled></el-input>
</el-form-item>
<el-form-item label="月份" prop="statisticMonth" :rules="rules.statisticMonth">
<el-date-picker
v-model="modalData.statisticMonth"
type="month"
value-format="yyyy-MM"
placeholder="选择月"
style="width: 221px">
</el-date-picker>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="supplierPerformanceCalculation()">计算</el-button>
<el-button @click="computeFlag = false">关闭</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {
performanceIndicatorDefinitionSearch,
performanceIndicatorDefinitionSave,
performanceIndicatorDefinitionUpdate,
performanceIndicatorDefinitionDelete,
performanceIndicatorDefinitionCalculation
} from "@/api/performance/performance.js"
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
import {getSiteAndBuByUserName} from "../../../api/qc/qc";
export default {
data () {
return {
//
favorite: false,
// start
exportData: [],
exportName: "检验方法" + this.dayjs().format('YYYYMMDDHHmmss'),
exportHeader: ["检验方法"],
exportFooter: [],
exportList: [],
// end
searchData: {
site: '',
userName: this.$store.state.user.name,
itemNo: '',
indicatorDesc: '',
indicatorGroup: '',
active: 'Y',
page: 1,
limit: 10,
},
pageIndex: 1,
pageSize: 20,
totalPage: 0,
height: 200,
dataList: [],
modalFlag: false,
modalDisableFlag: false,
computeFlag: false,
modalData: {
site: '',
bu: '',
flag: '',
createBy: this.$store.state.user.name,
updateBy: this.$store.state.user.name,
itemNo: '',
indicatorDesc: '',
indicatorGroup: '',
active: 'Y',
createDate: '',
statisticMonth: '',
},
//
columnList: [
{
userId: this.$store.state.user.name,
functionId: 108001,
serialNumber: '301001TableSite',
tableId: "301001Table",
tableName: "绩效指标定义表",
columnWidth: 40,
columnProp: 'site',
headerAlign: 'center',
align: "center",
columnLabel: '工厂',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 108001,
serialNumber: '301001TableItemNo',
tableId: "301001Table",
tableName: "绩效指标定义表",
columnWidth: 110,
columnProp: 'itemNo',
headerAlign: 'center',
align: "center",
columnLabel: '简码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 108001,
serialNumber: '301001TableIndicatorDesc',
tableId: "301001Table",
tableName: "绩效指标定义表",
columnWidth: 210,
columnProp: 'indicatorDesc',
headerAlign: 'center',
align: "left",
columnLabel: '绩效项目',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 108001,
serialNumber: '301001TableIndicatorGroup',
tableId: "301001Table",
tableName: "绩效指标定义表",
columnWidth: 182,
columnProp: 'indicatorGroup',
headerAlign: 'center',
align: "center",
columnLabel: '绩效分类',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 108001,
serialNumber: '301001TableActive',
tableId: "301001Table",
tableName: "绩效指标定义表",
columnWidth: 90,
columnProp: 'active',
headerAlign: 'center',
align: "center",
columnLabel: '是否在用',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 108001,
serialNumber: '301001TableCreateDate',
tableId: "301001Table",
tableName: "绩效指标定义表",
columnWidth: 182,
columnProp: 'createDate',
headerAlign: 'center',
align: "center",
columnLabel: '创建时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 108001,
serialNumber: '301001TableCreateBy',
tableId: "301001Table",
tableName: "绩效指标定义表",
columnWidth: 182,
columnProp: 'createBy',
headerAlign: 'center',
align: "center",
columnLabel: '创建人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 108001,
serialNumber: '301001TableUpdateDate',
tableId: "301001Table",
tableName: "绩效指标定义表",
columnWidth: 182,
columnProp: 'updateDate',
headerAlign: 'center',
align: "center",
columnLabel: '更新时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
{
userId: this.$store.state.user.name,
functionId: 108001,
serialNumber: '301001TableUpdateBy',
tableId: "301001Table",
tableName: "绩效指标定义表",
columnWidth: 182,
columnProp: 'updateBy',
headerAlign: 'center',
align: "center",
columnLabel: '更新人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
},
],
rules: {
site: [
{required: true, message: ' ', trigger: 'blur'}
],
itemNo: [
{required: true, message: ' ', trigger: 'blur'}
],
indicatorDesc: [
{required: true, message: ' ', trigger: 'blur'}
],
indicatorGroup: [
{required: true, message: ' ', trigger: 'blur'}
],
active: [
{required: true, message: ' ', trigger: 'blur'}
],
statisticMonth: [
{required: true, message: ' ', trigger: 'blur'}
],
},
options: [],
userBuList: [],
authSearch: false,
authSave: false,
authUpdate: false,
authDelete: false,
menuId: this.$route.meta.menuId,
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 180
})
},
created () {
//
this.getDataList()
//
this.getButtonAuthData()
// site bu
this.getSiteAndBuByUserName()
//
this.favoriteIsOk()
//
this.getTableUserColumn(this.$route.meta.menuId+'table',1)
},
watch: {
//
'modalData.itemNo' (val) {
this.modalData.itemNo = val.toUpperCase()
}
},
methods: {
// bu
getSiteAndBuByUserName () {
let tempData = {
username: this.$store.state.user.name,
}
getSiteAndBuByUserName(tempData).then(({data}) => {
if (data.code === 0) {
this.userBuList = data.rows
}
})
},
//
getDataList () {
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
this.searchData.site = this.$store.state.user.site
performanceIndicatorDefinitionSearch(this.searchData).then(({data}) => {
if (data.code === 0) {
this.dataList = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
}
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
addModal () {
this.modalData = {
flag: '1',
site: '',
bu: this.userBuList[0].buNo,
createBy: this.$store.state.user.name,
updateBy: this.$store.state.user.name,
itemNo: '',
indicatorDesc: '',
indicatorGroup: '',
active: 'Y',
}
this.modalDisableFlag = false
this.modalFlag = true
},
//
updateModal (row) {
this.modalData = {
flag: '2',
bu: row.site + '_' + row.buNo,
site: row.site,
createBy: this.$store.state.user.name,
updateBy: this.$store.state.user.name,
itemNo: row.itemNo,
indicatorDesc: row.indicatorDesc,
indicatorGroup: row.indicatorGroup,
active: row.active,
}
this.modalDisableFlag = true
this.modalFlag = true
},
//
deleteModal (row) {
this.$confirm(`是否删除这个检验方法?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
performanceIndicatorDefinitionDelete(row).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}).catch(() => {
})
},
// /
saveData () {
if (this.modalData.site === '' || this.modalData.site == null) {
this.$message.warning('请选择工厂!')
return
}
if (this.modalData.itemNo === '' || this.modalData.itemNo == null) {
this.$message.warning('请输入简码!')
return
}
if (this.modalData.indicatorDesc === '' || this.modalData.indicatorDesc == null) {
this.$message.warning('请输入绩效项目!')
return
}
if (this.modalData.indicatorGroup === '' || this.modalData.indicatorGroup == null) {
this.$message.warning('请选择绩效分类!')
return
}
if (this.modalData.flag === '1') { //
performanceIndicatorDefinitionSave(this.modalData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.modalFlag = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
} else { //
performanceIndicatorDefinitionUpdate(this.modalData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.modalFlag = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}
},
supplierPerformanceCalculation () {
if (this.modalData.statisticMonth === '' || this.modalData.statisticMonth == null) {
this.$message.warning('请选择月份!')
return
}
let inData = {
site: this.$store.state.user.site,
statisticMonth: this.modalData.statisticMonth,
}
performanceIndicatorDefinitionCalculation(inData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
this.computeFlag = false
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
//
favoriteIsOk () {
let userFavorite = {
userId: this.$store.state.user.id,
languageCode: this.$i18n.locale
}
userFavoriteList(userFavorite).then(({data}) => {
for (let i = 0; i < data.list.length; i++) {
if(this.$route.meta.menuId === data.list[i].menuId){
this.favorite = true
}
}
})
},
// OR
favoriteFunction () {
let userFavorite = {
userId: this.$store.state.user.id,
functionId: this.$route.meta.menuId,
}
if (this.favorite) {
removeUserFavorite(userFavorite).then(({data}) => {
this.$message.success(data.msg)
this.favorite = false
})
} else {
//
saveUserFavorite(userFavorite).then(({data}) => {
this.$message.success(data.msg)
this.favorite = true
})
}
},
//excel
async createExportData() {
this.searchData.limit = -1
this.searchData.page = 1
await performanceIndicatorDefinitionSearch(this.searchData).then(({data}) => {
this.exportList= data.rows
})
return this.exportList
},
startDownload() {},
finishDownload() {},
fields () {
let json = "{"
this.columnList.forEach((item, index) => {
if (index == this.columnList.length - 1) {
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
} else {
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
}
})
json += "}"
let s = eval("(" + json + ")")
return s
},
//
async getTableUserColumn (tableId, columnId) {
let queryTableUser = {
userId: this.$store.state.user.name,
functionId: this.$route.meta.menuId,
tableId: tableId,
status: true,
languageCode: this.$i18n.locale
}
await getTableUserListLanguage(queryTableUser).then(({data}) => {
if (data.rows.length > 0) {
//this.columnList1 = []
switch (columnId) {
case 1:
this.columnList = data.rows
break;
// case 2:
// this.columnDetailList = data.rows
// break;
// case 3:
// this.columnList2 = data.rows
// break;
// case 4:
// this.columnList3 = data.rows
// break;
}
} else {
this.getColumnList(tableId, columnId)
}
})
},
// tableDefault
async getColumnList (tableId, columnId) {
let queryTable = {
functionId: this.$route.meta.menuId,
tableId: tableId,
languageCode: this.$i18n.locale
}
await getTableDefaultListLanguage(queryTable).then(({data}) => {
if (!data.rows.length == 0) {
switch (columnId) {
case 1:
this.columnList = data.rows
break;
// case 2:
// this.columnDetailList = data.rows
// break;
// case 3:
// this.columnList2 = data.rows
// break;
// case 4:
// this.columnList3 = data.rows
// break;
}
} else {
// this.showDefault = true.
}
})
},
//
getButtonAuthData () {
let searchFlag = this.isAuth(this.menuId+":search")
let saveFlag = this.isAuth(this.menuId+":save")
let updateFlag = this.isAuth(this.menuId+":update")
let deleteFlag = this.isAuth(this.menuId+":delete")
//
this.authSearch = !searchFlag
this.authSave = !saveFlag
this.authUpdate = !updateFlag
this.authDelete = !deleteFlag
},
}
}
</script>

550
src/views/modules/performance/supplierPerformanceTheYear.vue

@ -0,0 +1,550 @@
<template>
<div class="mod-config">
<!-- 收藏 -->
<div>
<span @click="favoriteFunction()">
<icon-svg :name="favorite?'xiangqufill':'xiangqu'" class="sl-svg"></icon-svg>
</span>
</div>
<!-- 条件查询 -->
<el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
<el-form-item :label="'工厂'">
<el-select v-model="searchData.site" placeholder="请选择" style="width: 120px">
<el-option
v-for = "i in userBuList"
:key = "i.site"
:label = "i.site"
:value = "i.site">
<span style="float: left;width: 120px">{{ i.sitename }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="年份">
<el-input v-model="searchData.statisticMonth" placeholder="格式:YYYY"></el-input>
</el-form-item>
<el-form-item>
<span slot="label" style="" @click="getBaseList(501)"><a herf="#">供应商编码</a></span>
<el-input v-model="searchData.supplierId" filterable placeholder="请选择或输入供应商编码"></el-input>
</el-form-item>
<el-form-item label="供应商名称">
<el-input v-model="searchData.supplierName" placeholder="请输入供应商名称"></el-input>
</el-form-item>
<el-form-item :label="' '">
<el-button v-if="!authSearch" type="primary" @click="getDataList()">查询</el-button>
<el-button type="primary" @click="computeFlag = true">供应商绩效统计计算</el-button>
</el-form-item>
</el-form>
<!-- 展示列表 -->
<el-table
:height="height"
:data="dataList"
border
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="80"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" class="highlight" @click="totalPoints(scope.row)">总得分</a>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[20, 50, 100, 200, 500]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<el-dialog title="总得分" :close-on-click-modal="false" v-drag :visible.sync="suppPerTheMonthTotalPointsFlag" width="951px" style="margin-top: -30px">
<el-table
:data="suppPerThisMonthDetailsList"
:height="height - 27"
border
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnSuppPerTheMonthTotalPointsList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button @click="suppPerTheMonthTotalPointsFlag = false">关闭</el-button>
</span>
</el-dialog>
<el-dialog title="供应商绩效统计计算" :close-on-click-modal="false" v-drag :visible.sync="computeFlag" width="500px">
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="工厂">
<el-input v-model="this.$store.state.user.site" style="width: 221px" disabled></el-input>
</el-form-item>
<el-form-item label="月份" prop="statisticMonth" :rules="rules.statisticMonth">
<el-date-picker
v-model="modalData.statisticMonth"
type="month"
value-format="yyyy-MM"
placeholder="选择月"
style="width: 221px">
</el-date-picker>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="supplierPerformanceCalculation()">计算</el-button>
<el-button @click="computeFlag = false">关闭</el-button>
</span>
</el-dialog>
<!--列表的组件-->
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
<script>
import {
supplierPerformanceQuerySummarySearch,
supplierPerformanceTheMonthTotalPoints
} from "@/api/performance/performance.js"
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
import {getSiteAndBuByUserName} from "../../../api/qc/qc";
import Chooselist from '@/views/modules/common/Chooselist';
import {performanceIndicatorDefinitionCalculation} from "../../../api/performance/performance";
/* 列表组件 */
export default {
components: {
Chooselist, /* 选择的组件 */
},
data () {
return {
//
favorite: false,
// start
exportData: [],
exportName: "检验方法" + this.dayjs().format('YYYYMMDDHHmmss'),
exportHeader: ["检验方法"],
exportFooter: [],
exportList: [],
// end
searchData: {
site: '',
userName: this.$store.state.user.name,
statisticMonth: new Date().getFullYear(),
supplierId: '',
supplierName: '',
page: 1,
limit: 10,
},
modalData: {
site: '',
bu: '',
flag: '',
createBy: this.$store.state.user.name,
updateBy: this.$store.state.user.name,
itemNo: '',
indicatorDesc: '',
indicatorGroup: '',
active: 'Y',
createDate: '',
statisticMonth: '',
},
pageIndex: 1,
pageSize: 20,
totalPage: 0,
height: 200,
dataList: [],
modalFlag: false,
modalDisableFlag: false,
computeFlag: false,
suppPerTheMonthTotalPointsFlag: false,
//
columnList: [
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
],
columnSuppPerTheMonthTotalPointsList : [
{ 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: '' },
{ 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: '' },
{ userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableIndicatorDesc', tableId: "301001Table", tableName: "供应商绩效概览总得分表", columnWidth: 260, columnProp: 'indicatorDesc', headerAlign: 'center', align: "center", columnLabel: '绩效项目', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
],
rules: {
site: [
{required: true, message: ' ', trigger: 'blur'}
],
itemNo: [
{required: true, message: ' ', trigger: 'blur'}
],
indicatorDesc: [
{required: true, message: ' ', trigger: 'blur'}
],
indicatorGroup: [
{required: true, message: ' ', trigger: 'blur'}
],
active: [
{required: true, message: ' ', trigger: 'blur'}
],
statisticMonth: [
{required: true, message: ' ', trigger: 'blur'}
],
},
userBuList: [],
suppPerThisMonthDetailsList: [],
authSearch: false,
menuId: this.$route.meta.menuId,
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 180
})
},
created () {
//
this.getDataList()
//
this.getButtonAuthData()
// site bu
this.getSiteAndBuByUserName()
//
this.favoriteIsOk()
//
this.getTableUserColumn(this.$route.meta.menuId+'table',1)
},
methods: {
// bu
getSiteAndBuByUserName () {
let tempData = {
username: this.$store.state.user.name,
}
getSiteAndBuByUserName(tempData).then(({data}) => {
if (data.code === 0) {
this.userBuList = data.rows
}
})
},
//
getDataList () {
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
this.searchData.site = this.$store.state.user.site
supplierPerformanceQuerySummarySearch(this.searchData).then(({data}) => {
if (data.code === 0) {
this.dataList = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
}
})
},
//
getBaseList (val,type) {
this.tagNo = val
this.$nextTick(() => {
let strVal = ''
if (val === 501) {
strVal = this.searchData.supplierId
}
this.$refs.baseList.init(val, strVal)
})
},
/* 列表方法的回调 */
getBaseData(val) {
if (this.tagNo === 501) {
this.searchData.supplierId = val.SupplierID
this.searchData.supplierName = val.SupplierName
}
},
totalPoints (row) {
let inData = {
site: row.site,
statisticMonth: this.searchData.statisticMonth,
supplierId: row.supplierId,
limit: 10,
page: 1,
}
supplierPerformanceTheMonthTotalPoints (inData).then(({data}) => {
if (data.code === 0) {
this.suppPerThisMonthDetailsList = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
}
this.suppPerTheMonthTotalPointsFlag = true
})
},
supplierPerformanceCalculation () {
if (this.modalData.statisticMonth === '' || this.modalData.statisticMonth == null) {
this.$message.warning('请选择月份!')
return
}
let inData = {
site: this.$store.state.user.site,
statisticMonth: this.modalData.statisticMonth,
}
performanceIndicatorDefinitionCalculation(inData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
this.computeFlag = false
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
favoriteIsOk () {
let userFavorite = {
userId: this.$store.state.user.id,
languageCode: this.$i18n.locale
}
userFavoriteList(userFavorite).then(({data}) => {
for (let i = 0; i < data.list.length; i++) {
if(this.$route.meta.menuId === data.list[i].menuId){
this.favorite = true
}
}
})
},
// OR
favoriteFunction () {
let userFavorite = {
userId: this.$store.state.user.id,
functionId: this.$route.meta.menuId,
}
if (this.favorite) {
removeUserFavorite(userFavorite).then(({data}) => {
this.$message.success(data.msg)
this.favorite = false
})
} else {
//
saveUserFavorite(userFavorite).then(({data}) => {
this.$message.success(data.msg)
this.favorite = true
})
}
},
//
async getTableUserColumn (tableId, columnId) {
let queryTableUser = {
userId: this.$store.state.user.name,
functionId: this.$route.meta.menuId,
tableId: tableId,
status: true,
languageCode: this.$i18n.locale
}
await getTableUserListLanguage(queryTableUser).then(({data}) => {
if (data.rows.length > 0) {
//this.columnList1 = []
switch (columnId) {
case 1:
this.columnList = data.rows
break;
// case 2:
// this.columnDetailList = data.rows
// break;
// case 3:
// this.columnList2 = data.rows
// break;
// case 4:
// this.columnList3 = data.rows
// break;
}
} else {
this.getColumnList(tableId, columnId)
}
})
},
// tableDefault
async getColumnList (tableId, columnId) {
let queryTable = {
functionId: this.$route.meta.menuId,
tableId: tableId,
languageCode: this.$i18n.locale
}
await getTableDefaultListLanguage(queryTable).then(({data}) => {
if (!data.rows.length == 0) {
switch (columnId) {
case 1:
this.columnList = data.rows
break;
// case 2:
// this.columnDetailList = data.rows
// break;
// case 3:
// this.columnList2 = data.rows
// break;
// case 4:
// this.columnList3 = data.rows
// break;
}
} else {
// this.showDefault = true.
}
})
},
//
getButtonAuthData () {
let searchFlag = this.isAuth(this.menuId+":search")
let saveFlag = this.isAuth(this.menuId+":save")
let updateFlag = this.isAuth(this.menuId+":update")
let deleteFlag = this.isAuth(this.menuId+":delete")
//
this.authSearch = !searchFlag
this.authSave = !saveFlag
this.authUpdate = !updateFlag
this.authDelete = !deleteFlag
},
}
}
</script>
<style>
.highlight {
font-weight: bold;
color: red;
}
</style>
```

435
src/views/modules/performance/supplierPerformanceThisMonth.vue

@ -0,0 +1,435 @@
<template>
<div class="mod-config">
<!-- 收藏 -->
<div>
<span @click="favoriteFunction()">
<icon-svg :name="favorite?'xiangqufill':'xiangqu'" class="sl-svg"></icon-svg>
</span>
</div>
<!-- 条件查询 -->
<el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
<el-form-item :label="'工厂'">
<el-select v-model="searchData.site" placeholder="请选择" style="width: 120px">
<el-option
v-for = "i in userBuList"
:key = "i.site"
:label = "i.site"
:value = "i.site">
<span style="float: left;width: 120px">{{ i.sitename }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="月份">
<el-input v-model="searchData.statisticMonth" placeholder="格式:YYYY-MM"></el-input>
</el-form-item>
<el-form-item>
<span slot="label" style="" @click="getBaseList(501)"><a herf="#">供应商编码</a></span>
<el-input v-model="searchData.supplierId" filterable placeholder="请选择或输入供应商编码"></el-input>
</el-form-item>
<el-form-item label="供应商名称">
<el-input v-model="searchData.supplierName" placeholder="请输入供应商名称"></el-input>
</el-form-item>
<el-form-item :label="' '">
<el-button v-if="!authSearch" type="primary" @click="getDataList()">查询</el-button>
</el-form-item>
</el-form>
<!-- 展示列表 -->
<el-table
:height="height"
:data="dataList"
border
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="80"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="details(scope.row)">详情</a>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[20, 50, 100, 200, 500]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<el-dialog title="详情" :close-on-click-modal="false" v-drag :visible.sync="suppPerThisMonthDetailsFlag" width="951px" style="margin-top: -30px">
<el-table
:data="suppPerThisMonthDetailsList"
:height="height - 27"
border
style="width: 100%;">
<el-table-column
v-for="(item,index) in columnSuppPerThisMonthDetailsList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed==''?false:item.fixed"
:width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button @click="suppPerThisMonthDetailsFlag = false">关闭</el-button>
</span>
</el-dialog>
<!--列表的组件-->
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
</template>
<script>
import {
suppPerformanceQueryDetailSearch,
supplierPerformanceThisMonthDetails
} from "@/api/performance/performance.js"
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
import {getSiteAndBuByUserName} from "../../../api/qc/qc";
import Chooselist from '@/views/modules/common/Chooselist';/* 列表组件 */
export default {
components: {
Chooselist, /* 选择的组件 */
},
data () {
const date = new Date();
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); //
return {
//
favorite: false,
// start
exportData: [],
exportName: "检验方法" + this.dayjs().format('YYYYMMDDHHmmss'),
exportHeader: ["检验方法"],
exportFooter: [],
exportList: [],
// end
searchData: {
site: '',
userName: this.$store.state.user.name,
statisticMonth: `${year}-${month}`, // YYYY-MM
supplierId: '',
supplierName: '',
page: 1,
limit: 10,
},
pageIndex: 1,
pageSize: 20,
totalPage: 0,
height: 200,
dataList: [],
modalFlag: false,
modalDisableFlag: false,
computeFlag: false,
suppPerThisMonthDetailsFlag: false,
//
columnList: [
{
userId: this.$store.state.user.name,
functionId: 108002,
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: ''
},
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
],
columnSuppPerThisMonthDetailsList : [
{ 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: '' },
{ 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: '' },
{ userId: this.$store.state.user.name, functionId: 108002, serialNumber: '301001TableIndicatorDesc', tableId: "301001Table", tableName: "供应商本月绩效统计表", columnWidth: 260, columnProp: 'indicatorDesc', headerAlign: 'center', align: "center", columnLabel: '绩效项目', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
{ 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: '' },
],
userBuList: [],
suppPerThisMonthDetailsList: [],
authSearch: false,
menuId: this.$route.meta.menuId,
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 180
})
},
created () {
//
this.getDataList()
//
this.getButtonAuthData()
// site bu
this.getSiteAndBuByUserName()
//
this.favoriteIsOk()
//
this.getTableUserColumn(this.$route.meta.menuId+'table',1)
},
methods: {
// bu
getSiteAndBuByUserName () {
let tempData = {
username: this.$store.state.user.name,
}
getSiteAndBuByUserName(tempData).then(({data}) => {
if (data.code === 0) {
this.userBuList = data.rows
}
})
},
//
getDataList () {
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
this.searchData.site = this.$store.state.user.site
suppPerformanceQueryDetailSearch(this.searchData).then(({data}) => {
if (data.code === 0) {
this.dataList = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
}
})
},
//
getBaseList (val,type) {
this.tagNo = val
this.$nextTick(() => {
let strVal = ''
if (val === 501) {
strVal = this.searchData.supplierId
}
this.$refs.baseList.init(val, strVal)
})
},
/* 列表方法的回调 */
getBaseData(val) {
if (this.tagNo === 501) {
this.searchData.supplierId = val.SupplierID
this.searchData.supplierName = val.SupplierName
}
},
details (row) {
let inData = {
site: row.site,
statisticMonth: this.searchData.statisticMonth,
supplierId: row.supplierId,
limit: 10,
page: 1,
}
supplierPerformanceThisMonthDetails (inData).then(({data}) => {
if (data.code === 0) {
this.suppPerThisMonthDetailsList = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
}
this.suppPerThisMonthDetailsFlag = true
})
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
//
favoriteIsOk () {
let userFavorite = {
userId: this.$store.state.user.id,
languageCode: this.$i18n.locale
}
userFavoriteList(userFavorite).then(({data}) => {
for (let i = 0; i < data.list.length; i++) {
if(this.$route.meta.menuId === data.list[i].menuId){
this.favorite = true
}
}
})
},
// OR
favoriteFunction () {
let userFavorite = {
userId: this.$store.state.user.id,
functionId: this.$route.meta.menuId,
}
if (this.favorite) {
removeUserFavorite(userFavorite).then(({data}) => {
this.$message.success(data.msg)
this.favorite = false
})
} else {
//
saveUserFavorite(userFavorite).then(({data}) => {
this.$message.success(data.msg)
this.favorite = true
})
}
},
//
async getTableUserColumn (tableId, columnId) {
let queryTableUser = {
userId: this.$store.state.user.name,
functionId: this.$route.meta.menuId,
tableId: tableId,
status: true,
languageCode: this.$i18n.locale
}
await getTableUserListLanguage(queryTableUser).then(({data}) => {
if (data.rows.length > 0) {
//this.columnList1 = []
switch (columnId) {
case 1:
this.columnList = data.rows
break;
// case 2:
// this.columnDetailList = data.rows
// break;
// case 3:
// this.columnList2 = data.rows
// break;
// case 4:
// this.columnList3 = data.rows
// break;
}
} else {
this.getColumnList(tableId, columnId)
}
})
},
// tableDefault
async getColumnList (tableId, columnId) {
let queryTable = {
functionId: this.$route.meta.menuId,
tableId: tableId,
languageCode: this.$i18n.locale
}
await getTableDefaultListLanguage(queryTable).then(({data}) => {
if (!data.rows.length == 0) {
switch (columnId) {
case 1:
this.columnList = data.rows
break;
// case 2:
// this.columnDetailList = data.rows
// break;
// case 3:
// this.columnList2 = data.rows
// break;
// case 4:
// this.columnList3 = data.rows
// break;
}
} else {
// this.showDefault = true.
}
})
},
//
getButtonAuthData () {
let searchFlag = this.isAuth(this.menuId+":search")
let saveFlag = this.isAuth(this.menuId+":save")
let updateFlag = this.isAuth(this.menuId+":update")
let deleteFlag = this.isAuth(this.menuId+":delete")
//
this.authSearch = !searchFlag
this.authSave = !saveFlag
this.authUpdate = !updateFlag
this.authDelete = !deleteFlag
},
}
}
</script>
Loading…
Cancel
Save